diff --git a/README.md b/README.md index b4f9343e..98367ea5 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,91 @@ Swagger-generated API Reference Documentation -**Under development** - [Live demo](http://rebilly.github.io/ReDoc/) +## Deployment + +## tl;dr +```html + + + + ReDoc + + + + + + + + + + + + +``` + +#### 1. Install redoc +Install using [bower](bower.io): + + bower install redoc + +or using [npm](https://docs.npmjs.com/getting-started/what-is-npm): + + npm install redoc --save + +Alternatively you can just download [`redoc.min.js`](https://raw.githubusercontent.com/Rebilly/ReDoc/releases/dist/redoc.min.js). + +#### 2. Reference redoc script in HTML +Then reference [`redoc.min.js`](https://raw.githubusercontent.com/Rebilly/ReDoc/releases/dist/redoc.min.js) in your HTML page: +```html + +``` +For npm: +```html + +``` + +#### 3. Add `` element to your page +```html + +``` + +#### 4. Enjoy :smile: + +## Configuration + +* `spec-url` - relative or absolute url to your spec file +* `scroll-y-offset` - If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc. +`scroll-y-offset` can be specified in various ways: + * **number**: A fixed number of pixels to be used as offset + * **selector**: selector of the element to be used for specifying the offset. The distance from the top of the page to the element's bottom will be used as offset. + * **function**: A getter function. Must return a number representing the offset (in pixels). + +## Advanced usage +Instead of adding `spec-url` attribute to the `` element you can initialize ReDoc via globally exposed `Redoc` object: +```js +Redoc.init(specUrl, options) +``` + +`options` is javascript object with camel-cased versions of options names as the keys. For example: +```js +Redoc.init('http://petstore.swagger.io/v2/swagger.json', { + scrollYOffset: 50 +}) +``` +----------- ## Running locally 1. Clone repository `git clone https://github.com/Rebilly/ReDoc.git` diff --git a/bower.json b/bower.json index f246c497..5e33c388 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "redoc", "description": "Swagger-generated API Reference Documentation", - "main": "dist/redoc.full.min.js", + "main": "dist/redoc.min.js", "authors": [ "Roman Hotsiy" ], diff --git a/build/paths.js b/build/paths.js index c780902c..06f5c267 100644 --- a/build/paths.js +++ b/build/paths.js @@ -3,7 +3,7 @@ module.exports = { html: 'lib/**/*.html', scss: 'lib/**/*.scss', sourceEntryPoint: 'lib/index.js', - outputName: 'redoc.full', + outputName: 'redoc', output: 'dist/', tmp: '.tmp/', demo: 'demo/**/*', diff --git a/build/tasks/build.js b/build/tasks/build.js index 0e29efa4..18677e6e 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -55,7 +55,7 @@ var JS_DEV_DEPS_MIN = [ gulp.task('sass', function () { return gulp.src(paths.scss, { base: './' }) - .pipe(sass.sync().on('error', sass.logError)) + .pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError)) .pipe(gulp.dest(paths.tmp)); }); diff --git a/demo/index.html b/demo/index.html index 89d6f4d2..f7889511 100644 --- a/demo/index.html +++ b/demo/index.html @@ -3,21 +3,21 @@ ReDoc + +
+ + +
- - Loading... - + - + diff --git a/demo/main.css b/demo/main.css index 888fc739..8e9a6df3 100644 --- a/demo/main.css +++ b/demo/main.css @@ -19,21 +19,55 @@ nav header { float: left; margin-left: 20px; font-size: 25px; - color: white; - position: absolute; + color: #00329F; + font-weight: bold; } + nav input { width: 50%; box-sizing: border-box; max-width: 500px; + + color: #555; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075); + -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; +} + +nav input:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); } nav button { - border: 1px solid #FFFFFF; - cursor: pointer; - color: white; - background-color: #21476D; + background-color: #fff; + color: #333; padding: 2px 10px; + + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border: 1px solid #ccc; + border-radius: 4px; +} + +nav button:hover { + background-color: #e6e6e6; + border-color: #adadad; +} +nav button:active { + background-color: #d4d4d4; + border-color: #8c8c8c; } nav { @@ -41,8 +75,25 @@ nav { height: 50px; line-height: 50px; text-align: center; - background-color: #053361; + background-color: white; + border-bottom: 1px solid #ccc; position: fixed; top: 0; z-index: 1; + box-sizing: border-box; +} + +@media (min-width: 1000px) { + nav header { + position: absolute; + } +} + +@media (max-width: 500px) { + nav input { + width: 70%; + } + nav header { + display: none; + } } diff --git a/demo/main.js b/demo/main.js index 70529977..a7fd542a 100644 --- a/demo/main.js +++ b/demo/main.js @@ -1,9 +1,11 @@ ;(function() { 'use strict'; - var loadButton = document.getElementById('load-button'); + var schemaUrlForm = document.getElementById('schema-url-form'); var schemaUrlInput = document.getElementById('schema-url-input'); - loadButton.addEventListener('click', function() { + schemaUrlForm.addEventListener('submit', function(event) { + event.preventDefault(); Redoc.init(schemaUrlInput.value); + return false; }) })(); diff --git a/demo/rebilly.json b/demo/rebilly.json deleted file mode 100644 index c144d1ea..00000000 --- a/demo/rebilly.json +++ /dev/null @@ -1,5413 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2.1", - "title": "Rebilly REST API", - "contact": { - "name": "Rebilly API Support", - "url": "https://www.rebilly.com/contact/", - "email": "integrations@rebilly.com" - }, - "license": { - "name": "Rebilly", - "url": "https://www.rebilly.com/api/license/" - }, - "termsOfService": "https://www.rebilly.com/terms/" - }, - "host": "api.rebilly.com", - "basePath": "/v2.1", - "schemes": [ - "https" - ], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "tags": [ - { - "name": "Introduction", - "description": "The Rebilly API is built on HTTP. Our API is RESTful. It has predictable\nresource URLs. It returns HTTP response codes to indicate errors. It also\naccepts and returns JSON int he HTTP body. You can use your favorite\nHTTP/REST library for your programming language to use Rebilly's API, or \nyou can use one of our SDKs (currently available in PHP and C#).\n" - }, - { - "name": "Authentication", - "description": "When you sign up for an account, you are given your first API key. \nYou can generate additional API keys, and delete API keys (as you may \nneed to rotate your keys in the future). You authenticate to the \nRebilly API by providing your secret key in the request header. \nRebilly authenticates each request by searching for the presence \nof an HTTP header: REB-APIKEY. JWT authentication may be coming soon. \nRebilly also has a client-side authentication scheme that uses an\napiUser and HMAC-SHA1 signature (only for the Tokens resource), so\nthat you may safely create tokens from the client-side without compromising\nyour secret keys. Never share your secret keys. Keep them guarded and secure.\nThe client-side authentication scheme uses one HTTP header named REB-AUTH.\n" - }, - { - "name": "Customer", - "description": "Customers are your customers, sometimes known as accounts, clients,\nmembers, patrons, or players in other systems.\n" - }, - { - "name": "Contact", - "description": "Contacts belong to Customers. A Customer can have many contacts.\nSome contacts are associated to Invoices, Payment Cards, Subscriptions\nand Transactions.\n" - }, - { - "name": "Blacklist", - "description": "Your blacklists contains values of customerIds, email addresses,\nipAddresses, bank identification numbers, countries or payment cards that\nyou do NOT want to do business with. They are a good tool for managing\nrisk. A blacklist entry that expires after a period of time we call a\ngreylist.\n" - }, - { - "name": "Layout", - "description": "Layouts are used to hold collections of plans. A layout can be used to\npower a pricing page. You can make multiple layouts, and use rules to\ntarget them to different audiences.\n" - }, - { - "name": "Organization", - "description": "Organizations include the name and address of the entities related to your\naccount. An account may be multi-national, and support multiple\norganizations. Note: Organizations are share between \"Live\" and \"Sandbox\"\n" - }, - { - "name": "Payment", - "description": "Collect money from your customers with payments.\n" - }, - { - "name": "Product", - "description": "Your product includes digital goods, services, and physical goods. \n" - }, - { - "name": "Taxes", - "description": "You can map a product to a tax category. The tax category is used by \ntax providers to calculate taxes for invoices.\n" - }, - { - "name": "Website", - "description": "Website is your website accepting payments\n" - } - ], - "securityDefinitions": { - "ApiKey": { - "description": "When you sign up for an account, you are given your first API key.\nTo do so please follow this link: https://www.rebilly.com/site/signup/\nAlso you can generate additional API keys, and delete API keys (as you may\nneed to rotate your keys in the future).\n", - "name": "REB-APIKEY", - "type": "apiKey", - "in": "header" - } - }, - "security": [ - { - "ApiKey": [] - } - ], - "responses": { - "AccessForbidden": { - "description": "Access forbidden, invalid API-KEY was used", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "NotFound": { - "description": "Resource was not found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "Conflict": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "InvalidDataError": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "parameters": { - "resourceId": { - "name": "id", - "in": "path", - "description": "The resource identifier string", - "type": "string", - "required": true - }, - "collectionLimit": { - "name": "limit", - "in": "query", - "description": "The collection items limit", - "type": "integer", - "minimum": 0, - "maximum": 1000 - }, - "collectionOffset": { - "name": "offset", - "in": "query", - "description": "The collection items offset", - "type": "integer", - "minimum": 0 - } - }, - "paths": { - "/authentication-options": { - "get": { - "tags": [ - "Customer Authentication" - ], - "summary": "Read current authentication options", - "description": "Read current authentication options\n", - "responses": { - "200": { - "description": "Current authentication options was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/AuthenticationOptions" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "put": { - "tags": [ - "Customer Authentication" - ], - "summary": "Change authentication options", - "description": "Change options\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Authentication Options resource", - "required": true, - "schema": { - "$ref": "#/definitions/AuthenticationOptions" - } - } - ], - "responses": { - "200": { - "description": "Authentication Options were updated", - "schema": { - "$ref": "#/definitions/AuthenticationOptions" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/authentication-tokens/{token}": { - "parameters": [ - { - "name": "token", - "in": "path", - "description": "The token identifier string", - "type": "string", - "required": true - } - ], - "get": { - "tags": [ - "Customer Authentication" - ], - "summary": "Verify", - "description": "Verify an authentication token\n", - "responses": { - "200": { - "description": "Authentication Token was verified", - "schema": { - "$ref": "#/definitions/AuthenticationToken" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "delete": { - "tags": [ - "Customer Authentication" - ], - "summary": "Logout a user", - "description": "Logout a user\n", - "responses": { - "204": { - "description": "User was logged out" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/authentication-tokens": { - "get": { - "tags": [ - "Customer Authentication" - ], - "summary": "Retrieve a list of auth tokens", - "description": "Retrieve a list of auth tokens\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of auth tokens was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/AuthenticationToken" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Customer Authentication" - ], - "summary": "Login", - "description": "Login a user (customer)\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "AuthenticationToken resource", - "required": true, - "schema": { - "$ref": "#/definitions/AuthenticationToken" - } - } - ], - "responses": { - "201": { - "description": "Login successful", - "schema": { - "$ref": "#/definitions/AuthenticationToken" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/blacklists/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Blacklist" - ], - "summary": "Retrieve a blacklist", - "description": "Retrieve a blacklist with specified identifier string\n", - "responses": { - "200": { - "description": "Blacklist was retrieved successfully", - "schema": { - "$ref": "#/definitions/Blacklist" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Blacklist" - ], - "summary": "Create a blacklist with predefined ID", - "description": "Create a blacklist with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Blacklist resource", - "required": true, - "schema": { - "$ref": "#/definitions/Blacklist" - } - } - ], - "responses": { - "201": { - "description": "Blacklist was created", - "schema": { - "$ref": "#/definitions/Blacklist" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "409": { - "description": "Blacklist exist and cannot be updated", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - }, - "delete": { - "tags": [ - "Blacklist" - ], - "summary": "Delete a blacklist", - "description": "Delete a blacklist with predefined identifier string\n", - "responses": { - "204": { - "description": "Blacklist was deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/blacklists": { - "get": { - "tags": [ - "Blacklists" - ], - "summary": "Retrieve a list of blacklists", - "description": "Retrieve a list of blacklists\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Blacklists was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Blacklist" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Blacklists" - ], - "summary": "Create a blacklist", - "description": "Create a blacklist\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Blacklist resource", - "required": true, - "schema": { - "$ref": "#/definitions/Blacklist" - } - } - ], - "responses": { - "201": { - "description": "Blacklist was created", - "schema": { - "$ref": "#/definitions/Blacklist" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/contacts/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Contact" - ], - "summary": "Retrieve a contact", - "description": "Retrieve a contact with specified identifier string\n", - "responses": { - "200": { - "description": "Contact was retrieved successfully", - "schema": { - "$ref": "#/definitions/Contact" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Contact" - ], - "summary": "Create or update a contact with predefined ID", - "description": "Create or update a contact with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Contact resource", - "required": true, - "schema": { - "$ref": "#/definitions/Contact" - } - } - ], - "responses": { - "201": { - "description": "Contact was created", - "schema": { - "$ref": "#/definitions/Contact" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "description": "Contact exists and cannot be updated" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/contacts": { - "get": { - "tags": [ - "Contact" - ], - "summary": "Retrieve a list of contacts", - "description": "Retrieve a list of contacts\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Contacts was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Contact" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Contact" - ], - "summary": "Create a contact", - "description": "Create a contact\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Contact resource", - "required": true, - "schema": { - "$ref": "#/definitions/Contact" - } - } - ], - "responses": { - "201": { - "description": "Contact was created", - "schema": { - "$ref": "#/definitions/Contact" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/credentials/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Customer Authentication" - ], - "summary": "Retrieve a credential", - "description": "Retrieve a credential with specified identifier string\n", - "responses": { - "200": { - "description": "Credential was retrieved successfully", - "schema": { - "$ref": "#/definitions/Credential" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Customer Authentication" - ], - "summary": "Create or update a credential with predefined ID", - "description": "Create or update a credential with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Credential resource", - "required": true, - "schema": { - "$ref": "#/definitions/Credential" - } - } - ], - "responses": { - "200": { - "description": "Credential was updated", - "schema": { - "$ref": "#/definitions/Credential" - } - }, - "201": { - "description": "Credential was created", - "schema": { - "$ref": "#/definitions/Credential" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - }, - "delete": { - "tags": [ - "Customer Authentication" - ], - "summary": "Delete a credential", - "description": "Delete a credential with predefined identifier string\n", - "responses": { - "204": { - "description": "Credential was deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/credentials": { - "get": { - "tags": [ - "Customer Authentication" - ], - "summary": "Retrieve a list of credentials", - "description": "Retrieve a list of credentials\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Credentials was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Credential" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Customer Authentication" - ], - "summary": "Create a credential", - "description": "Create a credential\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Credential resource", - "required": true, - "schema": { - "$ref": "#/definitions/Credential" - } - } - ], - "responses": { - "201": { - "description": "Credential was created", - "schema": { - "$ref": "#/definitions/Credential" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/custom-fields/{resource}/{name}": { - "parameters": [ - { - "name": "resource", - "in": "path", - "description": "The resource type string", - "type": "string", - "required": true, - "enum": [ - "customers", - "payment-cards", - "subscriptions", - "payments", - "websites", - "contacts" - ] - }, - { - "name": "name", - "in": "path", - "description": "The custom field's identifier string", - "type": "string", - "required": true - } - ], - "get": { - "tags": [ - "Custom Fields" - ], - "summary": "Retrieve a Custom Field", - "description": "Retrieve a schema of the given Custom Field for the given resource type\n", - "responses": { - "200": { - "description": "A schema of the Custom Field was retrieved successfully", - "schema": { - "$ref": "#/definitions/CustomField" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Custom Fields" - ], - "summary": "Create or alter a Custom Field", - "description": "Create or alter a schema of the given Custom Field for the given resource type.\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Custom Fields schema of the given resource type", - "required": true, - "schema": { - "$ref": "#/definitions/CustomField" - } - } - ], - "responses": { - "200": { - "description": "The Custom Field was updated", - "schema": { - "$ref": "#/definitions/CustomField" - } - }, - "201": { - "description": "The Custom Fields was created", - "schema": { - "$ref": "#/definitions/CustomField" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "409": { - "description": "The schema is in use: remove all the associated data in order to remove or alter the schema", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - }, - "delete": { - "tags": [ - "Custom Fields" - ], - "summary": "Delete a custom field", - "description": "Delete a custom field by its name\n", - "responses": { - "204": { - "description": "Custom field has been deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "description": "The field is in use: remove all the associated data first", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/custom-fields/{resource}": { - "parameters": [ - { - "name": "resource", - "in": "path", - "description": "The resource type string", - "type": "string", - "required": true, - "enum": [ - "customers", - "payment-cards", - "subscriptions", - "payments", - "websites", - "contacts" - ] - } - ], - "get": { - "tags": [ - "Custom Fields" - ], - "summary": "Retrieve Custom Fields", - "description": "Retrieve a schema of Custom Fields for the given resource type\n", - "responses": { - "200": { - "description": "A schema of Custom Fields was retrieved successfully", - "schema": { - "description": "The list of custom fields", - "type": "array", - "items": { - "$ref": "#/definitions/CustomField" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - } - }, - "/customers/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Customer" - ], - "summary": "Retrieve a customer", - "description": "Retrieve a customer with specified identifier string\n", - "responses": { - "200": { - "description": "Customer was retrieved successfully", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Customer" - ], - "summary": "Create a customer with predefined ID", - "description": "Create a customer with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Customer resource", - "required": true, - "schema": { - "$ref": "#/definitions/Customer" - } - } - ], - "responses": { - "200": { - "description": "Customer was updated", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "201": { - "description": "Customer was created", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/customers": { - "get": { - "tags": [ - "Customer" - ], - "summary": "Retrieve a list of customers", - "description": "Retrieve a list of customers\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Customers was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Customer" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Customer" - ], - "summary": "Create a customer", - "description": "Create a customer\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Customer resource", - "required": true, - "schema": { - "$ref": "#/definitions/Customer" - } - } - ], - "responses": { - "201": { - "description": "Customer was created", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/gateway-accounts/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Gateway Account" - ], - "summary": "Retrieve a Gateway Account", - "description": "Retrieve a Gateway Account with specified identifier string\n", - "responses": { - "200": { - "description": "Gateway Account was retrieved successfully", - "schema": { - "$ref": "#/definitions/GatewayAccount" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Gateway Account" - ], - "summary": "Create or update a Gateway Account with predefined ID", - "description": "Create or update a GatewayAccount with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Gateway Account resource", - "required": true, - "schema": { - "$ref": "#/definitions/GatewayAccount" - } - } - ], - "responses": { - "200": { - "description": "Gateway Account was updated", - "schema": { - "$ref": "#/definitions/GatewayAccount" - } - }, - "201": { - "description": "Gateway Account was created", - "schema": { - "$ref": "#/definitions/GatewayAccount" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - }, - "delete": { - "tags": [ - "Gateway Account" - ], - "summary": "Delete a Gateway Account", - "description": "Delete a Gateway Account with predefined identifier string\n", - "responses": { - "204": { - "description": "Gateway Account was deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/gateway-accounts": { - "get": { - "tags": [ - "Gateway Account" - ], - "summary": "Retrieve a list of gateway accounts", - "description": "Retrieve a list of gateway accounts\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Gateway Accounts was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GatewayAccount" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Gateway Account" - ], - "summary": "Create a Gateway Account", - "description": "Create a Gateway Account\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Gateway Account resource", - "required": true, - "schema": { - "$ref": "#/definitions/GatewayAccount" - } - } - ], - "responses": { - "201": { - "description": "Gateway Account was created", - "schema": { - "$ref": "#/definitions/GatewayAccount" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/invoices/{id}/abandon": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Invoice" - ], - "summary": "Abandon an invoice", - "description": "Abandon an invoice with specified identifier string\n", - "responses": { - "201": { - "description": "Invoice was abandoned successfully", - "schema": { - "$ref": "#/definitions/Invoice" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/invoices/{id}/issue": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Invoice" - ], - "summary": "Issue an invoice", - "description": "Issue an invoice with specified identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "InvoiceItem resource", - "required": true, - "schema": { - "$ref": "#/definitions/InvoiceIssue" - } - } - ], - "responses": { - "201": { - "description": "Invoice was abandoned successfully", - "schema": { - "$ref": "#/definitions/Invoice" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/invoices/{id}/items": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Invoice" - ], - "summary": "Retrieve invoice items", - "description": "Retrieve an invoice items with specified invoice identifier string\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "Invoice items were retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/InvoiceItem" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "post": { - "tags": [ - "Invoice" - ], - "summary": "Create an invoice item", - "description": "Create an invoice item\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "InvoiceItem resource", - "required": true, - "schema": { - "$ref": "#/definitions/InvoiceItem" - } - } - ], - "responses": { - "201": { - "description": "InvoiceItem was created", - "schema": { - "$ref": "#/definitions/InvoiceItem" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/invoices/{id}/void": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Invoice" - ], - "summary": "Void an invoice", - "description": "Void an invoice with specified identifier string\n", - "responses": { - "201": { - "description": "Invoice was voided successfully", - "schema": { - "$ref": "#/definitions/Invoice" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/invoices/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Invoice" - ], - "summary": "Retrieve an invoice", - "description": "Retrieve an invoice with specified identifier string\n", - "responses": { - "200": { - "description": "Invoice was retrieved successfully", - "schema": { - "$ref": "#/definitions/Invoice" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Invoice" - ], - "summary": "Create or update an invoice with predefined ID", - "description": "Create or update an invoice with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Invoice resource", - "required": true, - "schema": { - "$ref": "#/definitions/Invoice" - } - } - ], - "responses": { - "200": { - "description": "Invoice was updated", - "schema": { - "$ref": "#/definitions/Invoice" - } - }, - "201": { - "description": "Invoice was created", - "schema": { - "$ref": "#/definitions/Invoice" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/invoices": { - "get": { - "tags": [ - "Invoice" - ], - "summary": "Retrieve a list of invoices", - "description": "Retrieve a list of invoices\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of invoices was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Invoice" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Invoice" - ], - "summary": "Create an invoice", - "description": "Create an invoice\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Invoice resource", - "required": true, - "schema": { - "$ref": "#/definitions/Invoice" - } - } - ], - "responses": { - "201": { - "description": "Invoice was created", - "schema": { - "$ref": "#/definitions/Invoice" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/layouts/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Layout" - ], - "summary": "Retrieve a layout", - "description": "Retrieve a layout with specified identifier string\n", - "responses": { - "200": { - "description": "Layout was retrieved successfully", - "schema": { - "$ref": "#/definitions/Layout" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Layout" - ], - "summary": "Create or update a layout with predefined ID", - "description": "Create or update a layout with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Layout resource", - "required": true, - "schema": { - "$ref": "#/definitions/Layout" - } - } - ], - "responses": { - "200": { - "description": "Layout was updated", - "schema": { - "$ref": "#/definitions/Layout" - } - }, - "201": { - "description": "Layout was created", - "schema": { - "$ref": "#/definitions/Layout" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/layouts": { - "get": { - "tags": [ - "Layout" - ], - "summary": "Retrieve a layout list", - "description": "Retrieve a layout list\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "Layout list was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Layout" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Layout" - ], - "summary": "Create a layout", - "description": "Create a layout\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Layout resource", - "required": true, - "schema": { - "$ref": "#/definitions/Layout" - } - } - ], - "responses": { - "201": { - "description": "Layout was created", - "schema": { - "$ref": "#/definitions/Layout" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/lead-sources/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Lead Source" - ], - "summary": "Retrieve a LeadSource", - "description": "Retrieve a LeadSource with specified identifier string\n", - "responses": { - "200": { - "description": "LeadSource was retrieved successfully", - "schema": { - "$ref": "#/definitions/LeadSource" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Lead Source" - ], - "summary": "Create a LeadSource with predefined ID", - "description": "Create a LeadSource with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "LeadSource resource", - "required": true, - "schema": { - "$ref": "#/definitions/LeadSource" - } - } - ], - "responses": { - "200": { - "description": "LeadSource was updated", - "schema": { - "$ref": "#/definitions/LeadSource" - } - }, - "201": { - "description": "LeadSource was created", - "schema": { - "$ref": "#/definitions/LeadSource" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/lead-sources": { - "get": { - "tags": [ - "Lead Source" - ], - "summary": "Retrieve a list of LeadSources", - "description": "Retrieve a list of LeadSources\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of LeadSources was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/LeadSource" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Lead Source" - ], - "summary": "Create a LeadSource", - "description": "Create a LeadSource\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "LeadSource resource", - "required": true, - "schema": { - "$ref": "#/definitions/LeadSource" - } - } - ], - "responses": { - "201": { - "description": "LeadSource was created", - "schema": { - "$ref": "#/definitions/LeadSource" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/notes/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Note" - ], - "summary": "Retrieve a note", - "description": "Retrieve a note with specified identifier string\n", - "responses": { - "200": { - "description": "Note was retrieved successfully", - "schema": { - "$ref": "#/definitions/Note" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Note" - ], - "summary": "Create or update a note with predefined ID", - "description": "Create or update a note with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Note resource", - "required": true, - "schema": { - "$ref": "#/definitions/Note" - } - } - ], - "responses": { - "200": { - "description": "Note was updated", - "schema": { - "$ref": "#/definitions/Note" - } - }, - "201": { - "description": "Note was created", - "schema": { - "$ref": "#/definitions/Note" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/notes": { - "get": { - "tags": [ - "Note" - ], - "summary": "Retrieve a list of notes", - "description": "Retrieve a list of notes\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Notes was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Note" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Note" - ], - "summary": "Create a note", - "description": "Create a note\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Note resource", - "required": true, - "schema": { - "$ref": "#/definitions/Note" - } - } - ], - "responses": { - "201": { - "description": "Note was created", - "schema": { - "$ref": "#/definitions/Note" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/organizations/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Organization" - ], - "summary": "Retrieve a organization", - "description": "Retrieve a organization with specified identifier string\n", - "responses": { - "200": { - "description": "Organization was retrieved successfully", - "schema": { - "$ref": "#/definitions/Organization" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Organization" - ], - "summary": "Create or update a organization with predefined ID", - "description": "Create or update a organization with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Organization resource", - "required": true, - "schema": { - "$ref": "#/definitions/Organization" - } - } - ], - "responses": { - "200": { - "description": "Organization was updated", - "schema": { - "$ref": "#/definitions/Organization" - } - }, - "201": { - "description": "Organization was created", - "schema": { - "$ref": "#/definitions/Organization" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - }, - "delete": { - "tags": [ - "Organization" - ], - "summary": "Delete a organization", - "description": "Delete a organization with predefined identifier string\n", - "responses": { - "204": { - "description": "Organization was deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "description": "Organization has related resources and cannot be deleted", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/organizations": { - "get": { - "tags": [ - "Organization" - ], - "summary": "Retrieve a list of organizations", - "description": "Retrieve a list of organizations\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of organizations was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Organization" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Organization" - ], - "summary": "Create a organization", - "description": "Create a organization\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Organization resource", - "required": true, - "schema": { - "$ref": "#/definitions/Organization" - } - } - ], - "responses": { - "201": { - "description": "Organization was created", - "schema": { - "$ref": "#/definitions/Organization" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/password-tokens/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Customer Authentication" - ], - "summary": "Retrieve a Reset Password Token", - "description": "Retrieve a Reset Password Token with specified identifier string\n", - "responses": { - "200": { - "description": "ResetPasswordToken was retrieved successfully", - "schema": { - "$ref": "#/definitions/ResetPasswordToken" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "delete": { - "tags": [ - "Customer Authentication" - ], - "summary": "Delete a Reset Password Token", - "description": "Delete a Reset Password Token with predefined identifier string\n", - "responses": { - "204": { - "description": "ResetPasswordToken was deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "description": "ResetPasswordToken has related resources and cannot be deleted" - } - } - } - }, - "/password-tokens": { - "get": { - "tags": [ - "Customer Authentication" - ], - "summary": "Retrieve a list of tokens", - "description": "Retrieve a list of tokens\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Reset Password Tokens was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ResetPasswordToken" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Customer Authentication" - ], - "summary": "Create a Reset Password Token", - "description": "Create a Reset Password Token\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "ResetPasswordToken resource", - "required": true, - "schema": { - "$ref": "#/definitions/ResetPasswordToken" - } - } - ], - "responses": { - "201": { - "description": "Reset Password Token was created", - "schema": { - "$ref": "#/definitions/ResetPasswordToken" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/payment-cards/{id}/authorization": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "PaymentCard", - "Public" - ], - "summary": "Authorize a Payment Card", - "description": "Authorize a Payment Card\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "PaymentCard resource", - "required": true, - "schema": { - "type": "object", - "required": [ - "websiteId", - "currency" - ], - "properties": { - "websiteId": { - "description": "The Website ID", - "type": "string" - }, - "currency": { - "description": "Currency (three letter code)", - "type": "string" - }, - "gatewayAccountId": { - "description": "The Gateway account ID", - "type": "string" - }, - "amount": { - "description": "Amount", - "type": "number", - "format": "double" - } - } - } - } - ], - "responses": { - "201": { - "description": "Authorization successful", - "schema": { - "$ref": "#/definitions/PaymentCard" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/payment-cards/{id}/deactivation": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Payment Card" - ], - "summary": "Deactivate a Payment Card", - "description": "Deactivate a Payment Card\n", - "responses": { - "201": { - "description": "Authorization successful", - "schema": { - "$ref": "#/definitions/PaymentCard" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/payment-cards/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Payment Card" - ], - "summary": "Retrieve a Payment Card", - "description": "Retrieve a Payment Card with specified identifier string\n", - "responses": { - "200": { - "description": "PaymentCard was retrieved successfully", - "schema": { - "$ref": "#/definitions/PaymentCard" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/payment-cards": { - "get": { - "tags": [ - "Payment Card" - ], - "summary": "Retrieve a list of Payment Cards", - "description": "Retrieve a list of Payments Cards\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Payment Card was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentCard" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Payment Card" - ], - "summary": "Create a Payment Card", - "description": "Create a Payment Card\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "PaymentCard resource", - "required": true, - "schema": { - "$ref": "#/definitions/PaymentCard" - } - } - ], - "responses": { - "201": { - "description": "Payment Card was created", - "schema": { - "$ref": "#/definitions/PaymentCard" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/payments/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Payment" - ], - "summary": "Retrieve a payment", - "description": "Retrieve a payment with specified identifier string\n", - "responses": { - "200": { - "description": "Payment was retrieved successfully", - "schema": { - "$ref": "#/definitions/PaymentResponse" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Payment" - ], - "summary": "Create a payment with predefined ID", - "description": "Make a payment with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Payment resource", - "required": true, - "schema": { - "$ref": "#/definitions/Payment" - } - } - ], - "responses": { - "201": { - "description": "Payment was processed", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentResponse" - } - } - }, - "202": { - "description": "Payment was accepted", - "schema": { - "$ref": "#/definitions/PaymentResponse" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/payments": { - "get": { - "tags": [ - "Payment" - ], - "summary": "Retrieve a payment list", - "description": "Retrieve a payment list\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "Payment list was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentResponse" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "post": { - "tags": [ - "Payment" - ], - "summary": "Create a payment", - "description": "Create a payment\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Payment resource", - "required": true, - "schema": { - "$ref": "#/definitions/Payment" - } - } - ], - "responses": { - "201": { - "description": "Payment was processed", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentResponse" - } - } - }, - "202": { - "description": "Payment was accepted", - "schema": { - "$ref": "#/definitions/PaymentResponse" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/plans/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Plan" - ], - "summary": "Retrieve a plan", - "description": "Retrieve a plan with specified identifier string\n", - "responses": { - "200": { - "description": "Plan was retrieved successfully", - "schema": { - "$ref": "#/definitions/Plan" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Plan" - ], - "summary": "Create or update a Plan with predefined ID", - "description": "Create or update a Plan with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Plan resource", - "required": true, - "schema": { - "$ref": "#/definitions/Plan" - } - } - ], - "responses": { - "200": { - "description": "Plan was updated", - "schema": { - "$ref": "#/definitions/Plan" - } - }, - "201": { - "description": "Plan was created", - "schema": { - "$ref": "#/definitions/Plan" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - }, - "delete": { - "tags": [ - "Plan" - ], - "summary": "Delete a Plan", - "description": "Delete a Plan with predefined identifier string\n", - "responses": { - "204": { - "description": "Plan was deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/plans": { - "get": { - "tags": [ - "Plan" - ], - "summary": "Retrieve a list of plans", - "description": "Retrieve a list of plans\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Plans was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Plan" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Plan" - ], - "summary": "Create a plan", - "description": "Create a plan\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Plan resource", - "required": true, - "schema": { - "$ref": "#/definitions/Plan" - } - } - ], - "responses": { - "201": { - "description": "Plan was created", - "schema": { - "$ref": "#/definitions/Plan" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/products/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Product" - ], - "summary": "Retrieve a product", - "description": "Retrieve a product with specified identifier string\n", - "responses": { - "200": { - "description": "Product was retrieved successfully", - "schema": { - "$ref": "#/definitions/Product" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Product" - ], - "summary": "Create a product with predefined ID", - "description": "Create a product with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Product resource", - "required": true, - "schema": { - "$ref": "#/definitions/Product" - } - } - ], - "responses": { - "200": { - "description": "Product was updated", - "schema": { - "$ref": "#/definitions/Product" - } - }, - "201": { - "description": "Product was created", - "schema": { - "$ref": "#/definitions/Product" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/products": { - "get": { - "tags": [ - "Product" - ], - "summary": "Retrieve a list of products", - "description": "Retrieve a list of products\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of products was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Product" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Product" - ], - "summary": "Create a Product", - "description": "Create a Product\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Product resource", - "required": true, - "schema": { - "$ref": "#/definitions/Product" - } - } - ], - "responses": { - "201": { - "description": "Product was created", - "schema": { - "$ref": "#/definitions/Product" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "$ref": "#/responses/InvalidDataError" - } - } - } - }, - "/queue/payments/{id}/cancel": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Payment" - ], - "summary": "Cancel a scheduled payment", - "description": "Cancel a scheduled payment with specified identifier string\n", - "responses": { - "201": { - "description": "Successful cancel the payment", - "schema": { - "$ref": "#/definitions/PaymentResponse" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/queue/payments/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Payment" - ], - "summary": "Retrieve a scheduled payment", - "description": "Retrieve a payment with specified identifier string\n", - "responses": { - "200": { - "description": "Successful retrieve the payment that still waiting to be processed", - "schema": { - "$ref": "#/definitions/PaymentResponse" - } - }, - "303": { - "description": "Payment was successfully processed and moved out from queue", - "schema": { - "$ref": "#/definitions/PaymentResponse" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/queue/payments": { - "get": { - "tags": [ - "Payment" - ], - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "summary": "Retrieve a scheduled payment list", - "description": "Retrieve a scheduled payment list\n", - "responses": { - "200": { - "description": "Successful retrieve the payments list that still waiting to be processed", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentResponse" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - } - }, - "/subscriptions/{id}/cancel": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Subscription" - ], - "summary": "Cancel a subscription", - "description": "Cancel a subscription\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Only policy", - "required": true, - "schema": { - "$ref": "#/definitions/SubscriptionCancel" - } - } - ], - "responses": { - "201": { - "description": "Subscription was switched", - "schema": { - "$ref": "#/definitions/Subscription" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/subscriptions/{id}/switch": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Subscription" - ], - "summary": "Switch a subscription", - "description": "Switch a subscription\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "SubscriptionSwitch resource", - "required": true, - "schema": { - "$ref": "#/definitions/SubscriptionSwitch" - } - } - ], - "responses": { - "201": { - "description": "Subscription was switched", - "schema": { - "$ref": "#/definitions/Subscription" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/subscriptions/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Subscription" - ], - "summary": "Retrieve a subscription", - "description": "Retrieve a subscription with specified identifier string\n", - "responses": { - "200": { - "description": "Subscription was retrieved successfully", - "schema": { - "$ref": "#/definitions/Subscription" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Subscription" - ], - "summary": "Create or update a subscription with predefined ID", - "description": "Create or update a subscription with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Subscription resource", - "required": true, - "schema": { - "$ref": "#/definitions/Subscription" - } - } - ], - "responses": { - "200": { - "description": "Subscription was updated", - "schema": { - "$ref": "#/definitions/Subscription" - } - }, - "201": { - "description": "Subscription was created", - "schema": { - "$ref": "#/definitions/Subscription" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/subscriptions": { - "get": { - "tags": [ - "Subscription" - ], - "summary": "Retrieve a list of subscriptions", - "description": "Retrieve a list of subscriptions\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of subscriptions was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Subscription" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Subscription" - ], - "summary": "Create a subscription", - "description": "Create a subscription\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Subscription resource", - "required": true, - "schema": { - "$ref": "#/definitions/Subscription" - } - } - ], - "responses": { - "201": { - "description": "Subscription was created", - "schema": { - "$ref": "#/definitions/Subscription" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/tax-categories": { - "get": { - "tags": [ - "Taxes" - ], - "summary": "Retrieve a list of tax categories", - "description": "Retrieve a list of tax categories\n", - "responses": { - "200": { - "description": "A list of tax categories was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TaxCategory" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - } - }, - "/tokens/{token}/expiration": { - "parameters": [ - { - "name": "token", - "in": "path", - "description": "The token identifier string", - "type": "string", - "required": true - } - ], - "post": { - "tags": [ - "Payment Card Token" - ], - "summary": "Expire a token", - "description": "Expire a token\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "PaymentCardToken resource", - "required": true, - "schema": { - "$ref": "#/definitions/PaymentCardToken" - } - } - ], - "responses": { - "201": { - "description": "Token expiration successful", - "schema": { - "$ref": "#/definitions/PaymentCardToken" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/tokens/{token}": { - "parameters": [ - { - "name": "token", - "in": "path", - "description": "The token identifier string", - "type": "string", - "required": true - } - ], - "get": { - "tags": [ - "Payment Card Token" - ], - "summary": "Retrieve a token", - "description": "Retrieve a token with specified identifier string\n", - "responses": { - "200": { - "description": "Token was retrieved successfully", - "schema": { - "$ref": "#/definitions/PaymentCardToken" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/tokens": { - "get": { - "tags": [ - "Payment Card Token" - ], - "summary": "Retrieve a list of tokens", - "description": "Retrieve a list of tokens\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of tokens was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentCardToken" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Payment Card Token" - ], - "summary": "Create a token", - "description": "Create a token\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "PaymentCardToken resource", - "required": true, - "schema": { - "$ref": "#/definitions/PaymentCardToken" - } - } - ], - "responses": { - "201": { - "description": "Token was created", - "schema": { - "$ref": "#/definitions/PaymentCardToken" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - }, - "/transactions/{id}/refund": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "post": { - "tags": [ - "Transaction" - ], - "summary": "Refund a Transaction", - "description": "Refund a Transaction with specified identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Transaction resource", - "required": true, - "schema": { - "$ref": "#/definitions/TransactionRefund" - } - } - ], - "responses": { - "201": { - "description": "Transaction was refunded successfully", - "schema": { - "$ref": "#/definitions/Transaction" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/transactions/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Transaction" - ], - "summary": "Retrieve a Transaction", - "description": "Retrieve a Transaction with specified identifier string\n", - "responses": { - "200": { - "description": "Transaction was retrieved successfully", - "schema": { - "$ref": "#/definitions/Transaction" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - } - }, - "/transactions": { - "get": { - "tags": [ - "Transaction" - ], - "summary": "Retrieve a list of transactions", - "description": "Retrieve a list of transactions\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of transactions was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Transaction" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - } - }, - "/websites/{id}": { - "parameters": [ - { - "$ref": "#/parameters/resourceId" - } - ], - "get": { - "tags": [ - "Website" - ], - "summary": "Retrieve a website", - "description": "Retrieve a website with specified identifier string\n", - "responses": { - "200": { - "description": "Website was retrieved successfully", - "schema": { - "$ref": "#/definitions/Website" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Website" - ], - "summary": "Create or update a website with predefined ID", - "description": "Create or update a website with predefined identifier string\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Website resource", - "required": true, - "schema": { - "$ref": "#/definitions/Website" - } - } - ], - "responses": { - "200": { - "description": "Website was updated", - "schema": { - "$ref": "#/definitions/Website" - } - }, - "201": { - "description": "Website was created", - "schema": { - "$ref": "#/definitions/Website" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - }, - "delete": { - "tags": [ - "Website" - ], - "summary": "Delete a website", - "description": "Delete a website with predefined identifier string\n", - "responses": { - "204": { - "description": "Website was deleted" - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "description": "Website has related resources and cannot be deleted" - } - } - } - }, - "/websites": { - "get": { - "tags": [ - "Website" - ], - "summary": "Retrieve a list of websites", - "description": "Retrieve a list of websites\n", - "parameters": [ - { - "$ref": "#/parameters/collectionLimit" - }, - { - "$ref": "#/parameters/collectionOffset" - } - ], - "responses": { - "200": { - "description": "A list of Websites was retrieved successfully", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Website" - } - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - } - } - }, - "post": { - "tags": [ - "Website" - ], - "summary": "Create a website", - "description": "Create a website\n", - "parameters": [ - { - "name": "body", - "in": "body", - "description": "Website resource", - "required": true, - "schema": { - "$ref": "#/definitions/Website" - } - } - ], - "responses": { - "201": { - "description": "Website was created", - "schema": { - "$ref": "#/definitions/Website" - } - }, - "401": { - "$ref": "#/responses/AccessForbidden" - }, - "422": { - "description": "Invalid data was sent", - "schema": { - "$ref": "#/definitions/InvalidError" - } - } - } - } - } - }, - "definitions": { - "AuthenticationOptions": { - "type": "object", - "properties": { - "passwordPattern": { - "description": "Allowed password pattern", - "type": "string" - }, - "credentialTtl": { - "description": "The default lifetime of the credential in seconds", - "type": "integer" - }, - "authTokenTtl": { - "description": "The default lifetime of the auth-token in seconds", - "type": "integer" - }, - "resetTokenTtl": { - "description": "The default lifetime of the reset-token in seconds", - "type": "integer" - } - } - }, - "AuthenticationToken": { - "type": "object", - "required": [ - "username", - "password" - ], - "properties": { - "token": { - "description": "The token identifier string", - "type": "string", - "readOnly": true - }, - "username": { - "description": "The token's username", - "type": "string" - }, - "password": { - "description": "The token's password (write-only)", - "type": "string", - "format": "password" - }, - "credentialId": { - "description": "The credential's ID", - "type": "string", - "readOnly": true - }, - "customerId": { - "description": "The token's customer ID", - "type": "string", - "readOnly": true - }, - "expiredTime": { - "description": "Token's expired time", - "type": "string", - "format": "date-time" - }, - "_links": { - "description": "The links related to token", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Blacklist": { - "type": "object", - "required": [ - "type", - "value" - ], - "properties": { - "id": { - "description": "The blacklist identifier string", - "type": "string", - "readOnly": true - }, - "type": { - "description": "The blacklist type", - "type": "string", - "enum": [ - "paymentCardId", - "customerId", - "email", - "ipAddress", - "country" - ] - }, - "value": { - "description": "The blacklist value", - "type": "string" - }, - "ttl": { - "description": "The blacklist time to live", - "type": "integer", - "minimum": 30 - }, - "expireTime": { - "description": "The blacklist expire time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "createdTime": { - "description": "The blacklist created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "The blacklist updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to blacklist", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Contact": { - "type": "object", - "properties": { - "id": { - "description": "The contact identifier string", - "type": "string", - "readOnly": true - }, - "customerId": { - "description": "The contact ID", - "type": "string" - }, - "firstName": { - "description": "The contact first name", - "type": "string" - }, - "lastName": { - "description": "The contact last name", - "type": "string" - }, - "organization": { - "description": "The contact organization", - "type": "string" - }, - "address": { - "description": "The contact street address", - "type": "string", - "maxLength": 60 - }, - "address2": { - "description": "The contact street address (second line)", - "type": "string", - "maxLength": 60 - }, - "city": { - "description": "The contact city", - "type": "string", - "maxLength": 45 - }, - "region": { - "description": "The contact region (state)", - "type": "string", - "maxLength": 45 - }, - "country": { - "description": "The contact country ISO Alpha-2 code", - "type": "string", - "pattern": "^[A-Z]{2}$" - }, - "postalCode": { - "description": "The contact postal code", - "type": "string", - "maxLength": 10 - }, - "phoneNumber": { - "description": "The contact phone number", - "type": "string" - }, - "createdTime": { - "description": "The contact created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "The contact updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to contact", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - }, - "customFields": { - "$ref": "#/definitions/ResourceCustomFields" - } - } - }, - "Credential": { - "type": "object", - "required": [ - "username", - "password", - "customerId" - ], - "properties": { - "id": { - "description": "The credential identifier string", - "type": "string", - "readOnly": true - }, - "username": { - "description": "Credential's username", - "type": "string" - }, - "password": { - "description": "The credential's password", - "type": "string", - "format": "password" - }, - "customerId": { - "description": "The credential's customer ID", - "type": "string" - }, - "expiredTime": { - "description": "The credential's expired time", - "type": "string", - "format": "date-time" - }, - "_links": { - "description": "The links related to credential", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Customer": { - "type": "object", - "properties": { - "id": { - "description": "The customer identifier string", - "type": "string", - "readOnly": true - }, - "email": { - "description": "The customer email", - "type": "string", - "format": "email", - "maxLength": 100 - }, - "firstName": { - "description": "The customer first name", - "type": "string" - }, - "lastName": { - "description": "The customer last name", - "type": "string" - }, - "ipAddress": { - "description": "The customer IP", - "type": "string", - "format": "ipv4" - }, - "defaultCard": { - "description": "The customer default card ID", - "type": "string" - }, - "createdTime": { - "description": "The customer created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "The customer updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to customer", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - }, - "customFields": { - "$ref": "#/definitions/ResourceCustomFields" - } - } - }, - "CustomField": { - "description": "A separate Custom Field schema", - "type": "object", - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "description": "The name of the custom field", - "type": "string" - }, - "type": { - "description": "Type value | Description\n------------- | -------------\narray | An array of strings up to 255 characters, maximum size is 1000 elements\nboolean | true or false\ndate | String of format \"full-date\" (YYYY-MM-DD) from RFC-3339 (full-date)\ndatetime | String of format \"date-time\" (YYYY-MM-DDTHH:MM:SSZ) from RFC-3339 (date-time)\ninteger | Cardinal value of -2^31..2^31-1\nnumber | Float value. It can take cardinal values also which are interpreted as float\nstring | Regular string up to 255 characters\nmonetary | A map of 3-letters currency code and amount, e.g. {\"currency\": \"EUR\", \"amount\": 25.30}\n", - "type": "string", - "enum": [ - "array", - "boolean", - "datetime", - "integer", - "number", - "string", - "monetary" - ] - }, - "description": { - "description": "The custom field description", - "type": "string" - }, - "additionalSchema": { - "description": "Additional parameters which can be added according to type:\nParameter Name | Types | Description\n-------------- | ------------- | -------------\nallowedValues | string, array | List of allowed values\n" - } - } - }, - "DeclineInstructions": { - "type": "object", - "description": "Dunning instructions object for payment declines", - "properties": { - "dunningId": { - "description": "The dunning identifier string", - "type": "string" - }, - "dunningIndex": { - "readOnly": true, - "description": "The position in the sequence of dunning", - "type": "integer" - } - } - }, - "Error": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "minimum": 100, - "maximum": 600 - }, - "error": { - "type": "string" - } - } - }, - "GatewayAccount": { - "type": "object", - "required": [ - "gatewayName", - "merchantCategoryCode", - "websites", - "acquirerName", - "acceptedCurrencies", - "organizationId" - ], - "properties": { - "id": { - "description": "The gateway identifier string", - "type": "string", - "readOnly": true - }, - "gatewayName": { - "description": "The gateway name", - "type": "string" - }, - "gatewayConfig": { - "type": "object", - "description": "Gateway config. Fields depends on gatewayName" - }, - "merchantCategoryCode": { - "description": "The gateway's merchant category code", - "type": "integer", - "minimum": 742, - "maximum": 9950 - }, - "descriptor": { - "description": "The gateway's desciptor", - "type": "string" - }, - "city": { - "description": "The gateway's city field", - "type": "string" - }, - "organizationId": { - "description": "Organization ID", - "type": "string" - }, - "websites": { - "description": "Websites IDs", - "type": "array", - "items": { - "type": "string", - "description": "Website ID" - } - }, - "acquirerName": { - "description": "Acquirer name", - "type": "string" - }, - "monthlyLimit": { - "description": "Monthly Limit", - "type": "integer", - "format": "double", - "minimum": 0 - }, - "threeDSecure": { - "description": "True, if Gateway Account allows 3DSecure", - "type": "boolean" - }, - "threeDSecureType": { - "description": "Type of 3DSecure", - "type": "string", - "enum": [ - null, - "integrated", - "external" - ] - }, - "dynamicDescriptor": { - "description": "True, if Gateway Account allows dynamic descriptor", - "type": "boolean" - }, - "acceptedCurrencies": { - "description": "Accepted currencies (array of the currency three letter code)", - "type": "array", - "items": { - "type": "string" - } - }, - "paymentMethods": { - "description": "Accepted payments methods", - "type": "array", - "items": { - "type": "string", - "enum": [ - "Visa", - "Mastercard", - "American_Express", - "Discover", - "Maestro", - "Solo", - "Electron", - "JCB", - "Voyager", - "Diners_Club", - "Switch", - "Laser" - ] - } - }, - "downtimeStart": { - "description": "Gateway downtime start", - "type": "string", - "format": "date-time" - }, - "downtimeEnd": { - "description": "Gateway downtime end", - "type": "string", - "format": "date-time" - }, - "createdTime": { - "description": "Gateway Account created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "Gateway Account updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to gateway account", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "InvalidError": { - "allOf": [ - { - "$ref": "#/definitions/Error" - }, - { - "type": "object", - "properties": { - "details": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "Invoice": { - "type": "object", - "required": [ - "customerId", - "websiteId", - "currency" - ], - "properties": { - "id": { - "description": "The invoice identifier string", - "type": "string", - "readOnly": true - }, - "customerId": { - "description": "The customer's ID", - "type": "string" - }, - "websiteId": { - "description": "The website's ID", - "type": "string" - }, - "currency": { - "description": "The currency three letter code", - "type": "string" - }, - "billingContactId": { - "description": "Invoice's billing contact ID", - "type": "string", - "format": "email" - }, - "deliveryContactId": { - "description": "Invoice's delivery contact ID", - "type": "string" - }, - "items": { - "type": "array", - "description": "Invoice items array", - "readOnly": true, - "items": { - "type": "string" - } - }, - "abandonedTime": { - "description": "Invoice abandoned time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "voidedTime": { - "description": "Invoice voided time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "closedTime": { - "description": "Invoice closed time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "dueTime": { - "description": "Invoice due time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "issuedTime": { - "description": "Invoice issued time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "createdTime": { - "description": "Invoice created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to invoice", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "InvoiceIssue": { - "type": "object", - "properties": { - "issueTime": { - "type": "string", - "format": "date-time" - } - } - }, - "InvoiceItem": { - "type": "object", - "required": [ - "type", - "unitPrice" - ], - "properties": { - "id": { - "description": "The website identifier string", - "type": "string", - "readOnly": true - }, - "type": { - "description": "Invoice item's type", - "type": "string", - "enum": [ - "debit", - "credit" - ] - }, - "unitPrice": { - "description": "Invoice item's price", - "type": "number", - "format": "double" - }, - "quantity": { - "description": "Invoice item's quantity", - "type": "integer" - }, - "description": { - "description": "Invoice item's description", - "type": "string" - }, - "periodStartTime": { - "description": "Start time", - "type": "string", - "format": "date-time" - }, - "periodEndTime": { - "description": "End time", - "type": "string", - "format": "date-time" - }, - "_links": { - "description": "The links related to invoice item", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Layout": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "id": { - "description": "The layout identifier string", - "type": "string", - "readOnly": true - }, - "name": { - "description": "The name of the layout string", - "type": "string" - }, - "items": { - "description": "The array of layout items (planId and starred)", - "type": "array", - "items": { - "$ref": "#/definitions/LayoutItem" - } - }, - "createdBy": { - "description": "The process that created this layout", - "type": "string", - "readOnly": true - }, - "updatedBy": { - "description": "The process that updated this layout", - "type": "string", - "readOnly": true - }, - "createdTime": { - "description": "Layout created time", - "type": "string", - "readOnly": true - }, - "updatedTime": { - "description": "Layout updated time", - "type": "string", - "readOnly": true - }, - "customFields": { - "description": "Any custom object that must be stored with layout", - "type": "object" - }, - "_links": { - "description": "The links related to this layout", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "LayoutItem": { - "type": "object", - "properties": { - "planId": { - "description": "The plan identifier string", - "type": "string" - }, - "starred": { - "description": "Boolean if the plan should be starred (special callout presentation)", - "type": "boolean" - }, - "order": { - "description": "Item's order in Layout", - "type": "integer", - "readOnly": true - } - } - }, - "LeadSource": { - "type": "object", - "required": [ - "customerId" - ], - "properties": { - "id": { - "description": "The lead source identifier string", - "type": "string", - "readOnly": true - }, - "customerId": { - "description": "Customer ID", - "type": "string" - }, - "medium": { - "description": "Lead Source's medium (eg search, display)", - "type": "string" - }, - "source": { - "description": "Lead Source's source (eg google, yahoo)", - "type": "string" - }, - "campaign": { - "description": "Lead Source's campaign (eg go-big-123)", - "type": "string" - }, - "term": { - "description": "Lead Source's term (eg salt shakers)", - "type": "string" - }, - "content": { - "description": "Lead Source's content (eg smiley faces)", - "type": "string" - }, - "affiliate": { - "description": "Lead Source's affiliate (eg 123, Bob Smith)", - "type": "string" - }, - "subAffiliate": { - "description": "Lead Source's sub-affiliate also called a sub-id or click id in some circles (eg 123456)", - "type": "string" - }, - "salesAgent": { - "description": "Lead Source's sales agent (eg James Bond)", - "type": "string" - }, - "clickId": { - "description": "Lead Source's click id (may come from an ad server)", - "type": "string" - }, - "path": { - "description": "Lead Source's path uri (eg www.example.com/some/landing/path)", - "type": "string" - }, - "ipAddress": { - "description": "Customer's IP Address", - "type": "string" - }, - "currency": { - "description": "Currency (three letter ISO 4217 alpha code) (eg USD, EUR)", - "type": "string" - }, - "amount": { - "description": "The amount that the lead cost", - "type": "number", - "format": "double" - }, - "createdTime": { - "description": "LeadSource created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "LeadSource updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to LeadSource", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Link": { - "type": "object", - "properties": { - "rel": { - "description": "The link type", - "type": "string", - "enum": [ - "self" - ] - }, - "href": { - "description": "The link URL", - "type": "string" - } - } - }, - "Note": { - "type": "object", - "required": [ - "content", - "relatedType", - "relatedId" - ], - "properties": { - "id": { - "description": "The note identifier string", - "type": "string", - "readOnly": true - }, - "createdBy": { - "description": "The note's creator", - "type": "string", - "readOnly": true - }, - "content": { - "description": "The note's name", - "type": "string" - }, - "archived": { - "description": "Is the note archived (excluded from List method)", - "type": "boolean" - }, - "relatedType": { - "description": "The note's related resource type (customer, paymentCard, paymentGateway, subscription, transaction)", - "type": "string" - }, - "relatedId": { - "description": "The note's related resource ID", - "type": "string" - }, - "createdTime": { - "description": "Note created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "Note updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "archivedTime": { - "description": "Note archived time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to note", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Organization": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "id": { - "description": "The organization identifier string", - "type": "string", - "readOnly": true - }, - "createdTime": { - "description": "The organization created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "The organization updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "name": { - "description": "The organization name", - "type": "string", - "maxLength": 60 - }, - "address": { - "description": "The organization street address", - "type": "string", - "maxLength": 60 - }, - "address2": { - "description": "The organization street address", - "type": "string", - "maxLength": 60 - }, - "city": { - "description": "The organization city", - "type": "string", - "maxLength": 45 - }, - "region": { - "description": "The organization region (state)", - "type": "string", - "maxLength": 45 - }, - "country": { - "description": "The organization country ISO Alpha-2 code", - "type": "string", - "pattern": "^[A-Z]{2}$" - }, - "postalCode": { - "description": "The organization postal code", - "type": "string", - "maxLength": 10 - }, - "_links": { - "description": "The links related to organization", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Payment": { - "type": "object", - "required": [ - "websiteId", - "customerId", - "currency", - "amount", - "method", - "paymentInstrument" - ], - "properties": { - "websiteId": { - "description": "The website identifier string", - "type": "string" - }, - "customerId": { - "description": "The customer identifier string", - "type": "string" - }, - "currency": { - "description": "The payment currency ISO Alpha code", - "type": "string" - }, - "amount": { - "description": "The payment amount", - "type": "integer", - "format": "double" - }, - "scheduledTime": { - "description": "The time the payment is scheduled for collection", - "type": "string", - "format": "date-time" - }, - "invoiceIds": { - "description": "The array of invoice identifiers", - "type": "array", - "items": { - "type": "string" - } - }, - "method": { - "description": "The payment method", - "type": "string", - "enum": [ - "payment_card", - "paypal", - "cash" - ] - }, - "description": { - "description": "The payment description", - "type": "string", - "maxLength": 255 - }, - "paymentInstrument": { - "$ref": "#/definitions/PaymentInstrument" - }, - "customFields": { - "$ref": "#/definitions/ResourceCustomFields" - }, - "declineInstructions": { - "$ref": "#/definitions/DeclineInstructions" - } - } - }, - "PaymentCard": { - "type": "object", - "properties": { - "id": { - "description": "The card identifier string", - "type": "string", - "readOnly": true - }, - "customerId": { - "description": "The Customer's ID. Required if card is creating not from Token", - "type": "string" - }, - "pan": { - "description": "The card PAN (Primary Account Number). Required if card is creating not from Token", - "type": "string" - }, - "expYear": { - "description": "Card's expiry year. Required if card is creating not from Token", - "type": "integer" - }, - "expMonth": { - "description": "Card's expiry month. Required if card is creating not from Token", - "type": "integer" - }, - "cvv": { - "description": "Card's cvv (card verification value). Required if card is creating not from Token", - "type": "string" - }, - "billingContactId": { - "description": "The Billing Contact ID. Required if card is creating not from Token", - "type": "string" - }, - "token": { - "description": "PaymentCardToken. Use without any other fields", - "type": "string" - }, - "status": { - "description": "Payment Card status", - "type": "string", - "readOnly": true, - "enum": [ - "active", - "expired", - "inactive", - "deactivated", - "pending" - ] - }, - "createdTime": { - "description": "Card created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "Card updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to card", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - }, - "customFields": { - "$ref": "#/definitions/ResourceCustomFields" - } - } - }, - "PaymentCardToken": { - "type": "object", - "required": [ - "pan", - "expMonth", - "expYear", - "firstName", - "lastName" - ], - "properties": { - "id": { - "description": "The token identifier string", - "type": "string", - "readOnly": true - }, - "pan": { - "description": "The card PAN (Primary Account Number)", - "type": "string" - }, - "expMonth": { - "description": "Card's expiry month", - "type": "integer" - }, - "expYear": { - "description": "Card's expiry year", - "type": "integer" - }, - "firstName": { - "description": "First name on payment card", - "type": "string" - }, - "lastName": { - "description": "Last name on payment card", - "type": "string" - }, - "cvv": { - "description": "The CVV/CVC of the payment card", - "type": "string" - }, - "address": { - "description": "Customer's billing address 1", - "type": "string" - }, - "address2": { - "description": "Customer's billing address 2", - "type": "string" - }, - "city": { - "description": "Billing address city", - "type": "string" - }, - "region": { - "description": "Billing region", - "type": "string" - }, - "country": { - "description": "Billing country - Two letter code", - "type": "string" - }, - "phoneNumber": { - "description": "Phone number", - "type": "string" - }, - "postalCode": { - "description": "Billing postal code", - "type": "string" - }, - "fingerprint": { - "description": "Device fingerprint hash", - "type": "string" - }, - "_links": { - "description": "The links related to token", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "PaymentInstrument": { - "type": "object", - "description": "Payment instrument object", - "properties": { - "paymentCardId": { - "description": "The payment card identifier string, required when paying by payment card", - "type": "string" - }, - "gatewayAccountId": { - "description": "The payment gateway identifier string", - "type": "string" - } - } - }, - "PaymentResponse": { - "allOf": [ - { - "$ref": "#/definitions/Payment" - }, - { - "type": "object", - "properties": { - "id": { - "description": "The payment identifier string", - "type": "string" - }, - "createdBy": { - "description": "The process that created this payment", - "type": "string" - }, - "updatedBy": { - "description": "The process that updated this payment", - "type": "string" - }, - "state": { - "description": "Payment state", - "type": "string" - }, - "createdTime": { - "description": "Payment created time", - "type": "string" - }, - "updatedTime": { - "description": "Payment updated time", - "type": "string" - }, - "_links": { - "description": "The links related to payment", - "type": "array", - "items": { - "$ref": "#/definitions/Link" - } - } - } - } - ] - }, - "Plan": { - "type": "object", - "required": [ - "name", - "currency" - ], - "properties": { - "id": { - "description": "The website identifier string", - "type": "string", - "readOnly": true - }, - "name": { - "description": "The plan name", - "type": "string" - }, - "currency": { - "description": "Currency (three letter ISO 4217 code)", - "type": "string" - }, - "currencySign": { - "description": "Currency sign", - "type": "string" - }, - "isActive": { - "description": "If the plan is not active, customers cannot subscribe to the plan (default to true)", - "type": "boolean" - }, - "description": { - "description": "The plan description", - "type": "string" - }, - "richDescription": { - "description": "The plan rich description - supports HTML", - "type": "string" - }, - "recurringAmount": { - "description": "The amount that recurs according to the schedule", - "type": "number", - "format": "double" - }, - "recurringPeriodUnit": { - "description": "The unit of time", - "type": "string", - "enum": [ - "day", - "week", - "month", - "year" - ] - }, - "recurringPeriodLength": { - "description": "The length of time (used with the recurringPeriodUnit)", - "type": "integer" - }, - "trialAmount": { - "description": "The amount of a trial - 0 is a valid value (for free)", - "type": "number", - "format": "double" - }, - "trialPeriodUnit": { - "description": "The unit of time", - "type": "string", - "enum": [ - "day", - "week", - "month", - "year" - ] - }, - "trialPeriodLength": { - "description": "The length of time (used with the trialPeriodUnit)", - "type": "integer" - }, - "setupAmount": { - "description": "The amount of a trial - 0 is a valid value (for free)", - "type": "number", - "format": "double" - }, - "expireTime": { - "description": "Time when the plan is not longer valid", - "type": "string", - "format": "date-time" - }, - "contractTermUnit": { - "description": "The unit of time", - "type": "string", - "enum": [ - "day", - "week", - "month", - "year" - ] - }, - "contractTermLength": { - "description": "The length that corresponds with the contractTermUnit", - "type": "integer" - }, - "recurringPeriodLimit": { - "description": "The number of times a subscription will rebill until the contract is over", - "type": "integer" - }, - "minQuantity": { - "description": "Minimum quantity per order, defaults to 1", - "type": "integer" - }, - "maxQuantity": { - "description": "Maximum quantity per order (NULL if no maximum)", - "type": "integer" - }, - "createdTime": { - "description": "Plan created time", - "type": "string", - "format": "date-time" - }, - "updatedTime": { - "description": "Plan updated time", - "type": "string", - "format": "date-time" - }, - "_links": { - "description": "The links related to plan", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Product": { - "type": "object", - "description": "Your product includes digital goods, services, and physical goods. \nProducts appear on invoice line items. If you set a tax category identifier,\ntaxes will be calculated upon invoice generation.\n", - "example": "{\n \"id\": \"stringid\",\n \"name\": \"Widget\",\n \"description\": \"Fantastic widget\",\n \"taxCategoryId\": null,\n \"customFields\": [],\n \"createdTime\": \"2015-08-27 13:45:12\",\n \"updatedTime\": \"2015-08-27 13:45:12\",\n \"_links\": [\n {\n \"self\": \"https://api.rebilly.com/v2.1/products/stringid\"\n }\n ]\n}\n", - "properties": { - "id": { - "description": "The product identifier string", - "type": "string", - "readOnly": true, - "maxLength": 50 - }, - "name": { - "description": "The product name", - "type": "string", - "maxLength": 255 - }, - "description": { - "description": "The product description", - "type": "string", - "maxLength": 512 - }, - "taxCategoryId": { - "description": "The product's tax category identifier string", - "type": "string", - "enum": [ - "99999", - "20010", - "40030", - "51020", - "51010", - "31000", - "30070" - ] - }, - "customFields": { - "description": "Any custom object that may be stored with product (see custom fields)", - "type": "string" - }, - "createdTime": { - "description": "The product created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "The product updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to product", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "ResetPasswordToken": { - "type": "object", - "required": [ - "username", - "password" - ], - "properties": { - "token": { - "description": "The token's identifier string", - "type": "string", - "readOnly": true - }, - "username": { - "description": "The token's username", - "type": "string" - }, - "password": { - "description": "Token's password (only for POST)", - "type": "string", - "format": "password" - }, - "credential": { - "description": "Token's credential ID", - "type": "string" - }, - "expiredTime": { - "description": "Password expired time", - "type": "string", - "format": "date-time" - }, - "_links": { - "description": "The links related to token", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "ResourceCustomFields": { - "description": "\"Custom Fields list as a map `{\"custom field name\": \"custom field value\", ...}\"`.\nThe format must follow the saved format (see Custom Fields section for the formats).\n", - "type": "object" - }, - "Subscription": { - "type": "object", - "required": [ - "customerId", - "planId", - "websiteId" - ], - "properties": { - "id": { - "description": "The Subscription identifier string", - "type": "string", - "readOnly": true - }, - "customerId": { - "description": "Unique id for each customer", - "type": "string" - }, - "planId": { - "description": "Unique id for each plan", - "type": "string" - }, - "websiteId": { - "description": "Unique id for each website", - "type": "string" - }, - "initialInvoiceId": { - "description": "Unique id for the initial invoice", - "type": "string" - }, - "deliveryContactId": { - "description": "Unique id for each delivery contact", - "type": "string" - }, - "billingContactId": { - "description": "Unique id for each billing contact", - "type": "string" - }, - "status": { - "description": "Subscription status", - "type": "string", - "readOnly": true - }, - "quantity": { - "description": "Quantity for each subscription. Default value to 1", - "type": "integer" - }, - "startTime": { - "description": "Subscription start time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "activationTime": { - "description": "Subscription activation time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "endTime": { - "description": "Subscription end time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "renewalTime": { - "description": "Subscription renewal time", - "type": "string", - "format": "date-time" - }, - "cancelledTime": { - "description": "Subscription cancelled time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "createdTime": { - "description": "Subscription created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "Subscription updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to subscription", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - }, - "customFields": { - "$ref": "#/definitions/ResourceCustomFields" - } - } - }, - "SubscriptionCancel": { - "type": "object", - "required": [ - "policy" - ], - "properties": { - "policy": { - "description": "Cancel policy", - "type": "string", - "enum": [ - "AT_NEXT_RENEWAL", - "NOW_WITH_PRORATA_REFUND", - "NOW_WITH_PRORATA_CREDIT", - "NOW_WITHOUT_REFUND", - "NOW_WITH_FULL_REFUND" - ] - } - } - }, - "SubscriptionSwitch": { - "type": "object", - "required": [ - "planId", - "policy" - ], - "properties": { - "planId": { - "description": "The plan identifier string", - "type": "string" - }, - "policy": { - "description": "Switch policy", - "type": "string", - "enum": [ - "AT_NEXT_RENEWAL", - "NOW_WITH_PRORATA_REFUND", - "NOW_WITH_PRORATA_CREDIT", - "NOW_WITHOUT_REFUND" - ] - }, - "websiteId": { - "description": "The website's ID", - "type": "string" - }, - "quantity": { - "description": "Quantity for each subscription. Default value to 1", - "type": "integer" - } - } - }, - "TaxCategory": { - "type": "object", - "properties": { - "id": { - "description": "The tax category identifier string", - "type": "string", - "readOnly": true, - "maxLength": 50, - "enum": [ - "99999", - "20010", - "40030", - "51020", - "51010", - "31000", - "30070" - ] - }, - "description": { - "description": "The tax category description", - "type": "string", - "maxLength": 512 - }, - "taxProvider": { - "description": "The tax category maps to a provider", - "type": "string", - "enum": [ - "TaxJar" - ] - }, - "_links": { - "description": "The links related to tax category", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "Transaction": { - "type": "object", - "properties": { - "id": { - "description": "The transaction identifier string", - "type": "string", - "readOnly": true - }, - "type": { - "description": "Transaction type", - "type": "string", - "readOnly": true, - "enum": [ - "authorize", - "capture", - "credit", - "refund", - "sale", - "void" - ] - }, - "result": { - "description": "Transaction result", - "type": "string", - "readOnly": true, - "enum": [ - "approved", - "conn_error", - "declined", - "never_sent", - "pending", - "pending_processor", - "timeout", - "unknown" - ] - }, - "amount": { - "description": "The transactions's amount", - "type": "number", - "format": "double", - "readOnly": true - }, - "currency": { - "description": "The transactions's currency", - "type": "string", - "readOnly": true - }, - "parentTransactionId": { - "description": "The transactions's parent ID", - "type": "string", - "readOnly": true - }, - "rebillNumber": { - "description": "The transactions's rebill number", - "type": "integer", - "readOnly": true - }, - "gatewayAccountId": { - "description": "The transactions's Gateway Account ID", - "type": "string", - "readOnly": true - }, - "gatewayResponse": { - "description": "The transactions's processor response", - "type": "string", - "readOnly": true - }, - "websiteId": { - "description": "Website's ID", - "type": "string", - "readOnly": true - }, - "customerId": { - "description": "Customer's ID", - "type": "string", - "readOnly": true - }, - "paymentCardId": { - "description": "Payment Card's ID", - "type": "string", - "readOnly": true - }, - "createdTime": { - "description": "Transaction created time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "updatedTime": { - "description": "Transaction updated time", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "_links": { - "description": "The links related to transaction", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - } - } - }, - "TransactionRefund": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "description": "Refund amount", - "type": "number", - "format": "double" - } - } - }, - "Website": { - "type": "object", - "required": [ - "name", - "url", - "servicePhone", - "serviceEmail" - ], - "properties": { - "id": { - "description": "The website identifier string", - "type": "string", - "readOnly": true - }, - "name": { - "description": "The website's name", - "type": "string" - }, - "url": { - "description": "The website's domain address", - "type": "string" - }, - "servicePhone": { - "description": "The website's customer service phone number", - "type": "string" - }, - "serviceEmail": { - "description": "The website's customer service email address", - "type": "string", - "format": "email" - }, - "checkoutPageUri": { - "description": "Your own custom URI for this Checkout Page", - "type": "string" - }, - "webHookUrl": { - "description": "Webhook Url (only for POST/PUT)", - "type": "string" - }, - "webHookUsername": { - "description": "Webhook HTTP Authentication Username (only for POST/PUT)", - "type": "string" - }, - "webHookPassword": { - "description": "Webhook HTTP Authentication Password (only for POST/PUT)", - "type": "string" - }, - "createdTime": { - "description": "Website created time", - "type": "string", - "format": "date-time" - }, - "updatedTime": { - "description": "Website updated time", - "type": "string", - "format": "date-time" - }, - "_links": { - "description": "The links related to website", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Link" - } - }, - "customFields": { - "$ref": "#/definitions/ResourceCustomFields" - } - } - } - } -} diff --git a/demo/swagger.json b/demo/swagger.json index adb0c45f..2a126a55 100644 --- a/demo/swagger.json +++ b/demo/swagger.json @@ -29,7 +29,7 @@ },{ "name": "JSONP", "x-traitTag": true, - "description": "If you're writing an AJAX application, and you'd like to wrap our response with a callback, all you have to do is specify a callback parameter with any API call:\n```\n https://api.instagram.com/v1/tags/coffee/media/recent?access_token=fb2e77d.47a0479900504cb3ab4a1f626d174d2d&callback=callbackFunction\n```\nWould respond with:\n```js\ncallbackFunction({\n ...\n});\n```", + "description": "If you're writing an AJAX application, and you'd like to wrap our response with a callback, all you have to do is specify a callback parameter with any API call:\n```\n https://api.instagram.com/v1/tags/coffee/media/recent?access_token=fb2e77d.47a0479900504cb3ab4a1f626d174d2d&callback=callbackFunction\n```\nWould respond with:\n```js\ncallbackFunction({\n ...\n});\n``` \n > Example of markdown blockquote", "externalDocs": { "description": "Find out more", "url": "http://swagger.io" diff --git a/lib/common/components/StickySidebar/sticky-sidebar.js b/lib/common/components/StickySidebar/sticky-sidebar.js index 345d1d8e..c0f2cd1b 100644 --- a/lib/common/components/StickySidebar/sticky-sidebar.js +++ b/lib/common/components/StickySidebar/sticky-sidebar.js @@ -1,34 +1,26 @@ 'use strict'; -import {Component, View, OnInit, OnDestroy, ElementRef} from 'angular2/core'; +import {Directive, ElementRef} from 'angular2/core'; import {BrowserDomAdapter} from 'angular2/platform/browser'; -@Component({ - selector: 'sticky-sidebar', +@Directive({ + selector: '[sticky-sidebar]', inputs: ['scrollParent', 'scrollYOffset'] }) -@View({ - template: ` - - `, - lifecycle: [OnInit, OnDestroy] -}) export default class StickySidebar { - constructor(elementRef, adapter) { + constructor(elementRef, dom) { this.element = elementRef.nativeElement; - this.adapter = adapter; + this.dom = dom; // initial styling - this.adapter.setStyle(this.element, 'position', 'absolute'); - this.adapter.setStyle(this.element, 'top', '0'); - this.adapter.setStyle(this.element, 'bottom', '0'); - this.adapter.setStyle(this.element, 'max-height', '100%'); + this.dom.setStyle(this.element, 'position', 'absolute'); + this.dom.setStyle(this.element, 'top', '0'); + this.dom.setStyle(this.element, 'bottom', '0'); + this.dom.setStyle(this.element, 'max-height', '100%'); } bind() { - this.cancelScrollBinding = this.adapter.onAndCancel(this.scrollParent, 'scroll', () => { this.updatePosition(); }); + this.cancelScrollBinding = this.dom.onAndCancel(this.scrollParent, 'scroll', () => { this.updatePosition(); }); this.updatePosition(); } @@ -45,13 +37,13 @@ export default class StickySidebar { } stick() { - this.adapter.setStyle(this.element, 'position', 'fixed'); - this.adapter.setStyle(this.element, 'top', this.scrollYOffset() + 'px'); + this.dom.setStyle(this.element, 'position', 'fixed'); + this.dom.setStyle(this.element, 'top', this.scrollYOffset() + 'px'); } unstick() { - this.adapter.setStyle(this.element, 'position', 'absolute'); - this.adapter.setStyle(this.element, 'top', 0); + this.dom.setStyle(this.element, 'position', 'absolute'); + this.dom.setStyle(this.element, 'top', 0); } get scrollY() { diff --git a/lib/common/components/StickySidebar/sticky-sidebar.spec.js b/lib/common/components/StickySidebar/sticky-sidebar.spec.js index 96bc5b3a..d77ea9eb 100644 --- a/lib/common/components/StickySidebar/sticky-sidebar.spec.js +++ b/lib/common/components/StickySidebar/sticky-sidebar.spec.js @@ -1,6 +1,6 @@ 'use strict'; -import { getChildDebugElement } from 'tests/helpers'; +import { getChildDebugElementByType } from 'tests/helpers'; import {Component, View, provide} from 'angular2/core'; import {BrowserDomAdapter} from 'angular2/platform/browser'; @@ -29,7 +29,7 @@ describe('Common components', () => { beforeEach((done) => { builder.createAsync(TestApp).then(_fixture => { fixture = _fixture; - let debugEl = getChildDebugElement(fixture.debugElement, 'sticky-sidebar'); + let debugEl = getChildDebugElementByType(fixture.debugElement, StickySidebar); component = debugEl.componentInstance; done(); }, err => done.fail(err)); @@ -67,8 +67,8 @@ describe('Common components', () => { `
- - +
+
` diff --git a/lib/common/components/Tabs/tabs.spec.js b/lib/common/components/Tabs/tabs.spec.js index b1bba444..9e7145a7 100644 --- a/lib/common/components/Tabs/tabs.spec.js +++ b/lib/common/components/Tabs/tabs.spec.js @@ -48,8 +48,8 @@ describe('Common components', () => { let tabs = childDebugEls.map(debugEl => debugEl.componentInstance); let [tab1, tab2] = tabs; - tab1.active.should.be.true; - tab2.active.should.be.false; + tab1.active.should.be.true(); + tab2.active.should.be.false(); }); it('should change active tab on click', () => { diff --git a/lib/common/styles/_variables.scss b/lib/common/styles/_variables.scss index ad0bba63..9df2da78 100644 --- a/lib/common/styles/_variables.scss +++ b/lib/common/styles/_variables.scss @@ -6,7 +6,7 @@ $side-bar-bg-color: #FAFAFA; $side-menu-item-color: #384248; $side-menu-even-bg-color: #F0F0F0; -$side-menu-active-bg-color: #E6E6E6; +$side-menu-active-bg-color: #DEDEDE; $side-menu-item-hpadding: 20px; $side-menu-item-vpadding: 5px; @@ -16,3 +16,5 @@ $sample-panel-headers-color: #8A9094; $sample-panel-color: #CFD2D3; $tree-lines-color: #7D97CE; + +$side-menu-mobile-breakpoint: 1000px; diff --git a/lib/components/ApiInfo/api-info.scss b/lib/components/ApiInfo/api-info.scss index fbd4d4b2..0b76f7c9 100644 --- a/lib/components/ApiInfo/api-info.scss +++ b/lib/components/ApiInfo/api-info.scss @@ -2,4 +2,5 @@ .api-info-header { color: $headers-color; + font-weight: normal; } diff --git a/lib/components/JsonSchema/json-schema-common.scss b/lib/components/JsonSchema/json-schema-common.scss new file mode 100644 index 00000000..434b63f3 --- /dev/null +++ b/lib/components/JsonSchema/json-schema-common.scss @@ -0,0 +1,160 @@ +@import '../../common/styles/variables'; +$lines-width: 1px; +$bullet-size: 7px; +$cell-spacing: 25px; +$cell-padding: 10px; +$bullet-margin: 10px; +$line-border: $lines-width solid $tree-lines-color; +$line-border-erase: ($lines-width + 1px) solid white; + +$param-name-height: 20px; + +$sub-schema-offset: ($bullet-size/2) + $bullet-margin; + +.param-schema { + padding-left: $sub-schema-offset - $lines-width; + border-left: $line-border; +} + +.param-wrap { + position: relative; +} + +.param-schema:before { + content: ""; + position: absolute; + left: $sub-schema-offset; + top: ($param-name-height/2) + $cell-padding; + bottom: 0; + border-left: $line-border; +} + +.param-name { + font-size: 14px; + padding: $cell-padding $cell-spacing $cell-padding 0; + font-weight: bold; + box-sizing: border-box; + line-height: $param-name-height; + border-left: $line-border; + white-space: nowrap; + position: relative; +} + +.param-info { + width: 100%; + padding: $cell-padding 0; + box-sizing: border-box; + border-bottom: 1px solid #ccc; +} + +.param { + display: flex; +} + +.param-required { + color: red; + font-weight: bold; + font-size: 12px; + line-height: $param-name-height; + vertical-align: middle; +} + +.param-type { + color: #999; + font-size: 12px; + line-height: $param-name-height; + vertical-align: middle; + font-weight: bold; +} + +.param-type.array:before { + content: "Array of "; + color: #999; +} + +.param-type.string { + color: rgba(0, 80, 0, 0.7); +} + +.param-type.integer, .param-type.number { + color: rgba(74, 139, 179, 0.8); +} + +.param-type.object { + color: rgba(0, 50, 159, 0.7); +} + +.param-type.boolean { + color: firebrick; +} + +.param-type.with-hint { + &:before, &:after { + content: "\\00a0"; + } + background-color: rgba(0, 50, 159, 0.1); + padding: 0.2em 0; + font-size: 0.85em; + border-radius: 3px; + cursor: help; +} + +.param-type-trivial { + margin: 10px 10px 0; + display: inline-block; +} + +/* tree */ + +// Bullet +.param-name > span:before { + content: ""; + display: inline-block; + width: $bullet-size; + height: $bullet-size; + background-color: $tree-lines-color; + margin: 0 $bullet-margin; + vertical-align: middle; +} + +.param-name > span:after { + content: ""; + position: absolute; + border-top: $line-border; + width: $bullet-margin; + left: 0; + top: ($param-name-height/2) + $cell-padding; +} + +.param-wrap:first-of-type > .param > .param-name:before { + content: ""; + display: block; + position: absolute; + left: -$lines-width; + top: 0; + border-left: $line-border-erase; + height: ($param-name-height/2) + $cell-padding; +} + +.param-wrap:last-of-type > .param > .param-name { + position: static; + + &:after { + content: ""; + display: block; + position: absolute; + left: -$lines-width; + border-left: $line-border-erase; + top: ($param-name-height/2) + $cell-padding + $lines-width; + background-color: white; + bottom: 0; + } +} + +.param-wrap:last-of-type > .param-schema { + border-left-color: transparent; +} + +.param-schema .param-wrap:first-of-type .param-name:before { + display: none !important; +} diff --git a/lib/components/JsonSchema/json-schema-lazy.js b/lib/components/JsonSchema/json-schema-lazy.js new file mode 100644 index 00000000..dddfb83b --- /dev/null +++ b/lib/components/JsonSchema/json-schema-lazy.js @@ -0,0 +1,35 @@ +'use strict'; + +import {Component, View, ElementRef} from 'angular2/core'; +import {CORE_DIRECTIVES} from 'angular2/common'; +import JsonSchema from './json-schema'; +import {DynamicComponentLoader} from 'angular2/src/core/linker/dynamic_component_loader'; +import OptionsManager from '../../options'; + +@Component({ + selector: 'json-schema-lazy', + inputs: ['pointer'] +}) +@View({ + template: '', + directives: [CORE_DIRECTIVES] +}) +export default class JsonSchemaLazy { + + constructor(elementRef, dcl) { + this.elementRef = elementRef; + this.dcl = dcl; + } + + load() { + if (OptionsManager.instance().options.disableLazySchemas) return; + if (this.loaded) return; + if (this.pointer) { + this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => { + compRef.instance.pointer = this.pointer; + }); + } + this.loaded = true; + } +} +JsonSchemaLazy.parameters = [[ElementRef], [DynamicComponentLoader]]; diff --git a/lib/components/JsonSchema/json-schema-lazy.spec.js b/lib/components/JsonSchema/json-schema-lazy.spec.js new file mode 100644 index 00000000..19691476 --- /dev/null +++ b/lib/components/JsonSchema/json-schema-lazy.spec.js @@ -0,0 +1,87 @@ +'use strict'; + +import { getChildDebugElement } from 'tests/helpers'; +import {Component, View, provide} from 'angular2/core'; +import {DynamicComponentLoader} from 'angular2/src/core/linker/dynamic_component_loader'; + +import { + TestComponentBuilder, + inject, + beforeEach, + beforeEachProviders, + it +} from 'angular2/testing'; + +import JsonSchemaLazy from 'lib/components/JsonSchema/json-schema-lazy'; +import SchemaManager from 'lib/utils/SchemaManager'; + +describe('Redoc components', () => { + describe('JsonSchemaLazy Component', () => { + let builder; + let component; + let schemaMgr = new SchemaManager(); + let fixture; + let loader; + let appRef = { + instance: {} + }; + beforeEachProviders(() => [ + provide(SchemaManager, {useValue: schemaMgr}) + ]); + beforeEach(inject([TestComponentBuilder, DynamicComponentLoader], (tcb, dcl) => { + builder = tcb; + loader = dcl; + spyOn(loader, 'loadNextToLocation').and.returnValue({then: (fn) => fn(appRef)}); + })); + beforeEach((done) => { + builder.createAsync(TestApp).then(_fixture => { + fixture = _fixture; + let debugEl = getChildDebugElement(fixture.debugElement, 'json-schema-lazy'); + component = debugEl.componentInstance; + done(); + }, err => done.fail(err)); + }); + + afterEach(() => { + loader.loadNextToLocation.and.callThrough(); + }); + + it('should init component', () => { + expect(component).not.toBeNull(); + }); + + it('should run loadNextToLocation on load', () => { + component.pointer = '#/def'; + fixture.detectChanges(); + component.load(); + expect(loader.loadNextToLocation).toHaveBeenCalled(); + }); + + it('should not run loadNextToLocation if already loaded', () => { + component.pointer = '#/def'; + fixture.detectChanges(); + component.load(); + component.load(); + expect(loader.loadNextToLocation.calls.count()).toEqual(1); + }); + + it('should init json-schema with correct pointer', () => { + component.pointer = '#/def'; + fixture.detectChanges(); + component.load(); + expect(appRef.instance.pointer).toEqual(component.pointer); + }); + }); +}); + + +/** Test component that contains a Method. */ +@Component({selector: 'test-app'}) +@View({ + directives: [JsonSchemaLazy], + providers: [SchemaManager, DynamicComponentLoader], + template: + `` +}) +class TestApp { +} diff --git a/lib/components/JsonSchema/json-schema.html b/lib/components/JsonSchema/json-schema.html index 58e947c5..298b3943 100644 --- a/lib/components/JsonSchema/json-schema.html +++ b/lib/components/JsonSchema/json-schema.html @@ -1,4 +1,7 @@ -{{_displayType}} + + {{_displayType}} +
@@ -7,7 +10,8 @@
- {{prop._displayType}} {{prop._displayFormat}} + {{prop._displayType}} {{prop._displayFormat}} Required
diff --git a/lib/components/JsonSchema/json-schema.js b/lib/components/JsonSchema/json-schema.js index dee18747..75f723e3 100644 --- a/lib/components/JsonSchema/json-schema.js +++ b/lib/components/JsonSchema/json-schema.js @@ -63,14 +63,15 @@ export default class JsonSchema extends BaseComponent { if (!schema.properties) { this.isTrivial = true; - this._displayType = `${schema.type} (Custom key-value pairs)`; + this._displayType = schema.type; + this._displayTypeHint = 'This field may contain data of any type'; return; } let discriminatorFieldIdx = -1; let props = Object.keys(schema.properties).map((prop, idx) => { let propData = schema.properties[prop]; - this.injectPropData(prop, propData, schema); + propData = this.injectPropData(prop, propData, schema); if (propData.isDiscriminator) discriminatorFieldIdx = idx; return propData; }); @@ -97,6 +98,7 @@ export default class JsonSchema extends BaseComponent { } injectPropData(prop, propData, schema) { + propData = Object.assign({}, propData); propData._name = prop; propData.isRequired = this.requiredMap[prop]; propData._displayType = propData.type; @@ -108,16 +110,24 @@ export default class JsonSchema extends BaseComponent { itemType = propData.items.title || 'object'; propData._pointer = propData.items._pointer || JsonPointer.join(this.pointer, ['properties', prop, 'items']); } - propData._displayType = `array of ${itemType}`; + propData._displayType = `${itemType}`; propData.format = itemFormat; propData._isArray = true; + propData.type = 'array ' + propData.items.type; } if (propData.type === 'object') { propData._displayType = propData.title || 'object'; } + if (!propData.type) { + propData._displayType = '< * >'; + propData._displayTypeHint = 'This field may contain data of any type'; + } + if (propData.format) propData._displayFormat = `<${propData.format}>`; + + return propData; } init() { diff --git a/lib/components/JsonSchema/json-schema.scss b/lib/components/JsonSchema/json-schema.scss index da4fe420..ce1605d1 100644 --- a/lib/components/JsonSchema/json-schema.scss +++ b/lib/components/JsonSchema/json-schema.scss @@ -1,129 +1,4 @@ -@import '../../common/styles/variables'; -$lines-width: 1px; -$bullet-size: 7px; -$cell-spacing: 25px; -$cell-padding: 10px; -$bullet-margin: 10px; -$line-border: $lines-width solid $tree-lines-color; -$line-border-erase: ($lines-width + 1px) solid white; - -$param-name-height: 20px; - -$sub-schema-offset: ($bullet-size/2) + $bullet-margin; - -.param-schema { - padding-left: $sub-schema-offset - $lines-width; - border-left: $line-border; -} - -.param-wrap { - position: relative; -} - -.param-schema:before { - content: ""; - position: absolute; - left: $sub-schema-offset; - top: ($param-name-height/2) + $cell-padding; - bottom: 0; - border-left: $line-border; -} - -.param-name { - font-size: 14px; - padding: $cell-padding $cell-spacing $cell-padding 0; - font-weight: bold; - box-sizing: border-box; - line-height: $param-name-height; - border-left: $line-border; - white-space: nowrap; - position: relative; -} - -.param-info { - width: 100%; - padding: $cell-padding 0; - box-sizing: border-box; - border-bottom: 1px solid #ccc; -} - -.param { - display: flex; -} - -.param-required { - color: red; - font-weight: bold; - font-size: 12px; - line-height: $param-name-height; - vertical-align: middle; -} - -.param-type { - text-transform: capitalize; - color: #999; - font-size: 12px; - line-height: $param-name-height; - vertical-align: middle; - font-weight: bold; -} - -.param-type-trivial { - margin: 10px 10px 0; - display: inline-block; -} - -/* tree */ - -// Bullet -.param-name > span:before { - content: ""; - display: inline-block; - width: $bullet-size; - height: $bullet-size; - background-color: $tree-lines-color; - margin: 0 $bullet-margin; - vertical-align: middle; -} - -.param-name > span:after { - content: ""; - position: absolute; - border-top: $line-border; - width: $bullet-margin; - left: 0; - top: ($param-name-height/2) + $cell-padding; -} - -.param-wrap:first-of-type .param-name:before { - content: ""; - display: block; - position: absolute; - left: -$lines-width; - top: 0; - border-left: $line-border-erase; - height: ($param-name-height/2) + $cell-padding; -} - -.param-wrap:last-of-type > .param > .param-name:after { - content: ""; - display: block; - position: absolute; - left: -$lines-width - 1px; - border-left: $line-border-erase; - top: ($param-name-height/2) + $cell-padding + $lines-width; - background-color: white; - bottom: 0; -} - -.param-wrap:last-of-type > .param-schema { - border-left-color: transparent; -} - -.param-schema .param-wrap:first-of-type .param-name:before { - display: none !important; -} - +@import 'json-schema-common'; /* styles for array-schema for array */ $array-marker-font-sz: 12px; @@ -166,6 +41,10 @@ $array-marker-line-height: 1.5; height: ($param-name-height/2) + $cell-padding; } +.params-wrap > .param > .param-schema.param-array { + border-left-color: transparent; +} + .param.discriminator { > div { padding-bottom: 0; diff --git a/lib/components/JsonSchema/json-schema.spec.js b/lib/components/JsonSchema/json-schema.spec.js new file mode 100644 index 00000000..17ed7ba2 --- /dev/null +++ b/lib/components/JsonSchema/json-schema.spec.js @@ -0,0 +1,73 @@ +'use strict'; + +import { getChildDebugElement } from 'tests/helpers'; +import {Component, View, provide} from 'angular2/core'; + +import { + TestComponentBuilder, + inject, + beforeEach, + beforeEachProviders, + it +} from 'angular2/testing'; + +import JsonSchema from 'lib/components/JsonSchema/json-schema'; +import SchemaManager from 'lib/utils/SchemaManager'; + +describe('Redoc components', () => { + describe('JsonSchema Component', () => { + let builder; + let component; + let schemaMgr = new SchemaManager(); + let fixture; + beforeEachProviders(() => [ + provide(SchemaManager, {useValue: schemaMgr}) + ]); + beforeEach(inject([TestComponentBuilder], (tcb) => { + builder = tcb; + })); + beforeEach((done) => { + builder.createAsync(TestApp).then(_fixture => { + fixture = _fixture; + let debugEl = getChildDebugElement(fixture.debugElement, 'json-schema'); + component = debugEl.componentInstance; + done(); + }, err => done.fail(err)); + }); + + it('should init component', () => { + component.pointer = ''; + schemaMgr._schema = {type: 'object'}; + fixture.detectChanges(); + expect(component).not.toBeNull(); + }); + + it('should set isTrivial for non-object/array types', () => { + component.pointer = ''; + schemaMgr._schema = {type: 'string'}; + fixture.detectChanges(); + component.isTrivial.should.be.true(); + }); + + it('should use < * > notation for prop without type', () => { + component.pointer = ''; + schemaMgr._schema = {type: 'object', properties: { + test: {} + }}; + fixture.detectChanges(); + component.data.properties[0]._displayType.should.be.equal('< * >'); + }); + }); +}); + + +/** Test component that contains a Method. */ +@Component({selector: 'test-app'}) +@View({ + directives: [JsonSchema], + providers: [SchemaManager], + template: + `` +}) +class TestApp { +} diff --git a/lib/components/Method/method.scss b/lib/components/Method/method.scss index 2dcc7fa7..38e7fbd0 100644 --- a/lib/components/Method/method.scss +++ b/lib/components/Method/method.scss @@ -103,6 +103,7 @@ responses-samples { .method-description { padding: 30px 0; + margin: 0; } .http-method { diff --git a/lib/components/MethodsList/methods-list.scss b/lib/components/MethodsList/methods-list.scss index 8bbc0fcb..bc6f128e 100644 --- a/lib/components/MethodsList/methods-list.scss +++ b/lib/components/MethodsList/methods-list.scss @@ -15,7 +15,7 @@ .tag-info h1 { color: $headers-color; text-transform: capitalize; - font-weight: bold; + font-weight: normal; } .methods { diff --git a/lib/components/ParamsList/params-list.scss b/lib/components/ParamsList/params-list.scss index af9a4d91..23c9b10a 100644 --- a/lib/components/ParamsList/params-list.scss +++ b/lib/components/ParamsList/params-list.scss @@ -4,9 +4,10 @@ padding: 0.2em 0; margin: 0.5em 0; color: #253137; + font-weight: normal; } -@import '../JsonSchema/json-schema.scss'; +@import '../JsonSchema/json-schema-common'; // paramters can't be multilevel so table representation works for it without javascript diff --git a/lib/components/Redoc/redoc.html b/lib/components/Redoc/redoc.html index 504d783e..c72f5d40 100644 --- a/lib/components/Redoc/redoc.html +++ b/lib/components/Redoc/redoc.html @@ -1,8 +1,8 @@
- - - - +
diff --git a/lib/components/Redoc/redoc.js b/lib/components/Redoc/redoc.js index a0ccd4d5..77b3bf8f 100644 --- a/lib/components/Redoc/redoc.js +++ b/lib/components/Redoc/redoc.js @@ -16,9 +16,11 @@ import {ElementRef} from 'angular2/core'; import {BrowserDomAdapter, bootstrap} from 'angular2/platform/browser'; import detectScollParent from 'scrollparent'; -import {isFunction} from 'angular2/src/facade/lang'; +import {isFunction, isString} from 'angular2/src/facade/lang'; -let optionNames = new Set(['scrollYOffset']); +let optionNames = new Set(['scrollYOffset', 'disableLazySchemas']); + +let dom = new BrowserDomAdapter(); @RedocComponent({ selector: 'redoc', @@ -41,6 +43,7 @@ export default class Redoc extends BaseComponent { this.parseOptions(); this.options = Object.assign({}, optionsMgr.options, this.options); this.normalizeOptions(); + optionsMgr.options = this.options; } parseOptions() { @@ -79,12 +82,63 @@ export default class Redoc extends BaseComponent { } } } + + if (isString(this.options.disableLazySchemas)) this.options.disableLazySchemas = true; + } + + static showLoadingAnimation() { + if (!dom.query('#redoc-loading-style')) { + let animStyle = dom.createStyleElement(` + redoc.loading { + position: relative; + display: block; + min-height:350px; + } + + redoc.loading:before { + content: "Loading..."; + font-size: 28px; + text-align: center; + padding-top: 40px; + color: #3F5C9C; + font-weight: bold; + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: white; + z-index: 9999; + opacity: 1; + transition: all 0.6s ease-out; + } + + redoc.loading-remove:before { + opacity: 0; + } + `); + animStyle.id = 'redoc-loading-style'; + dom.appendChild(dom.defaultDoc().head, animStyle); + } + let elem = dom.query('redoc'); + dom.addClass(elem, 'loading'); + } + + static hideLoadingAnimation() { + let redocEl = dom.query('redoc'); + dom.addClass(redocEl, 'loading-remove'); + setTimeout(() => { + dom.removeClass(redocEl, 'loading-remove'); + dom.removeClass(redocEl, 'loading'); + }, 400); } static init(schemaUrl, options) { if (Redoc.appRef) { Redoc.dispose(); } + Redoc.showLoadingAnimation(); return SchemaManager.instance().load(schemaUrl) .then(() => { (new OptionsManager()).options = options; @@ -92,6 +146,7 @@ export default class Redoc extends BaseComponent { }) .then( (appRef) => { + Redoc.hideLoadingAnimation(); Redoc.appRef = appRef; redocEvents.bootstrapped.next(); console.log('ReDoc bootstrapped!'); @@ -117,6 +172,7 @@ export default class Redoc extends BaseComponent { static dispose() { let dom = new BrowserDomAdapter(); let el = dom.query('redoc'); + let elClone; let parent; let nextSibling; if (el) { @@ -124,14 +180,15 @@ export default class Redoc extends BaseComponent { nextSibling = el.nextElementSibling; } + elClone = el.cloneNode(false); + if (Redoc.appRef) { Redoc.appRef.dispose(); Redoc.appRef = null; // Redoc dispose removes host element, so need to restore it - el = dom.createElement('redoc'); - el.innerText = 'Loading...'; - parent && parent.insertBefore(el, nextSibling); + elClone.innerHTML = 'Loading...'; + parent && parent.insertBefore(elClone, nextSibling); } } } diff --git a/lib/components/Redoc/redoc.scss b/lib/components/Redoc/redoc.scss index b62d179b..d8eefc6a 100644 --- a/lib/components/Redoc/redoc.scss +++ b/lib/components/Redoc/redoc.scss @@ -5,24 +5,6 @@ box-sizing: border-box; } -:host { - pre { - white-space: pre-wrap; - background-color: #f2f2f2; - padding: 10px; - overflow-x: auto; - line-height: normal; - } - - code { - background-color: #f2f2f2; - } - - p { - margin: 0; - } -} - .redoc-wrap { position: relative; } @@ -49,17 +31,48 @@ api-info { api-logo { display: block; text-align: center; + + @media (max-width: $side-menu-mobile-breakpoint) { + display: none; + } } -sticky-sidebar { +[sticky-sidebar] { width: $side-bar-width; + background-color: $side-bar-bg-color; overflow-y: auto; overflow-x: hidden; - background-color: $side-bar-bg-color; + + @media (max-width: $side-menu-mobile-breakpoint) { + z-index: 1; + width: 100%; + bottom: auto !important; + } } #api-content { margin-left: $side-bar-width; + @media (max-width: $side-menu-mobile-breakpoint) { + padding-top: 3em; + margin-left: 0; + } +} + +#api-content:after { + content: ""; + position: absolute;; + left:0; + right: 0; + top: 0; + bottom: 0; + background-color: black; + opacity: 0.5; + transition: all 0.3s ease; + display: none; +} + +#api-content.menu-opened:after { + display: block;; } footer { @@ -77,3 +90,104 @@ footer { color: $headers-color; } } + +/* global redoc styles */ + +:host p { + margin: 0; + margin-bottom: 1em; +} + +/* markdown elements */ + +:host .redoc-markdown-block { + pre { + font-family: Courier, monospace; + white-space: pre-wrap; + background-color: rgba(0,0,0,0.04); + padding: 10px; + overflow-x: auto; + line-height: normal; + border-radius: 3px; + + code { + background-color: transparent; + + &:before, &:after { + content: none; + } + } + } + + code { + font-family: Courier, monospace; + background-color: rgba(0,0,0,0.04); + padding: 0.2em 0; + font-size: 0.85em; + border-radius: 3px; + + &:before, &:after { + letter-spacing: -0.2em; + content: "\\00a0"; + } + } + + p { + margin: 0; + margin-bottom: 1em; + } + + p:last-of-type { + margin-bottom: 0; + } + + blockquote { + margin: 0; + margin-bottom: 1em; + padding: 0 15px; + color: #777; + border-left: 4px solid #ddd; + } + + img { + max-width: 100%; + box-sizing: content-box; + } + + ul, ol { + padding-left: 2em; + margin: 0; + margin-bottom: 1em; + } + + table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + word-break: keep-all; + border-collapse: collapse; + border-spacing: 0; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + table tr { + background-color: #fff; + border-top: 1px solid #ccc; + + &:nth-child(2n) { + background-color: #f8f8f8; + } + } + + table th, table td { + padding: 6px 13px; + border: 1px solid #ddd; + } + + table th { + text-align: left; + font-weight: bold; + } +} diff --git a/lib/components/Redoc/redoc.spec.js b/lib/components/Redoc/redoc.spec.js index ea67adaa..e332965b 100644 --- a/lib/components/Redoc/redoc.spec.js +++ b/lib/components/Redoc/redoc.spec.js @@ -105,28 +105,39 @@ describe('Redoc components', () => { }); }); }); -}); -describe('Redoc init', () => { - it('should return promise', () => { - let res = Redoc.init(); - res.should.be.instanceof(Promise); - }); - - it('should reject promise for not specifed url', (done) => { - let res = Redoc.init(); - res.then(() => { done.fail('Should not been called'); }, () => { - done(); + describe('Redoc init', () => { + let dom = new BrowserDomAdapter(); + let elem; + beforeEach(() => { + elem = dom.createElement('redoc'); + dom.defaultDoc().body.appendChild(elem); }); - }); - //skip because of PhantomJS crashes on this testcase - xit('should init redoc', (done) => { - var node = document.createElement('redoc'); - document.body.appendChild(node); - let res = Redoc.init('/tests/schemas/extended-petstore.json'); - res.then(() => { done(); }, () => { - done.fail('Error handler should not been called'); + afterEach(() => { + dom.defaultDoc().body.removeChild(elem); + }); + + it('should return promise', () => { + let res = Redoc.init(); + res.should.be.instanceof(Promise); + }); + + it('should reject promise for not specifed url', (done) => { + let res = Redoc.init(); + res.then(() => { done.fail('Should not been called'); }, () => { + done(); + }); + }); + + //skip because of PhantomJS crashes on this testcase + xit('should init redoc', (done) => { + var node = document.createElement('redoc'); + document.body.appendChild(node); + let res = Redoc.init('/tests/schemas/extended-petstore.json'); + res.then(() => { done(); }, () => { + done.fail('Error handler should not been called'); + }); }); }); @@ -217,7 +228,7 @@ describe('Redoc init', () => { @View({ directives: [Redoc], template: - `` + `` }) class TestApp { } diff --git a/lib/components/ResponsesList/responses-list.html b/lib/components/ResponsesList/responses-list.html index aa9df574..569a12d4 100644 --- a/lib/components/ResponsesList/responses-list.html +++ b/lib/components/ResponsesList/responses-list.html @@ -1,6 +1,6 @@

Responses

+ [type]="response.type" [empty]="response.empty" (open)="lazySchema.load()">
Headers @@ -14,6 +14,8 @@
Response schema
- + + + diff --git a/lib/components/ResponsesList/responses-list.js b/lib/components/ResponsesList/responses-list.js index 31007576..827e8238 100644 --- a/lib/components/ResponsesList/responses-list.js +++ b/lib/components/ResponsesList/responses-list.js @@ -3,8 +3,10 @@ import {RedocComponent, BaseComponent} from '../base'; import JsonPointer from '../../utils/JsonPointer'; import JsonSchema from '../JsonSchema/json-schema'; +import JsonSchemaLazy from '../JsonSchema/json-schema-lazy'; import Zippy from '../../common/components/Zippy/zippy'; import {statusCodeType} from '../../utils/helpers'; +import OptionsManager from '../../options'; function isNumeric(n) { return (!isNaN(parseFloat(n)) && isFinite(n)); @@ -14,7 +16,7 @@ function isNumeric(n) { selector: 'responses-list', templateUrl: './lib/components/ResponsesList/responses-list.html', styleUrls: ['./lib/components/ResponsesList/responses-list.css'], - directives: [JsonSchema, Zippy] + directives: [JsonSchema, Zippy, JsonSchemaLazy] }) export default class ResponsesList extends BaseComponent { constructor(schemaMgr) { @@ -24,6 +26,7 @@ export default class ResponsesList extends BaseComponent { prepareModel() { this.data = {}; this.data.responses = []; + this.enabledLazy = !OptionsManager.instance().options.disableLazySchemas; let responses = this.componentSchema; if (!responses) return; @@ -40,6 +43,7 @@ export default class ResponsesList extends BaseComponent { resp.pointer = ref; } + resp.empty = !resp.schema; resp.code = respCode; resp.type = statusCodeType(resp.code); if (resp.headers) { @@ -48,6 +52,7 @@ export default class ResponsesList extends BaseComponent { respInfo.name = k; return respInfo; }); + resp.empty = false; } resp.extendable = resp.headers || resp.length; return resp; diff --git a/lib/components/ResponsesList/responses-list.scss b/lib/components/ResponsesList/responses-list.scss index b279d536..6dd25bfc 100644 --- a/lib/components/ResponsesList/responses-list.scss +++ b/lib/components/ResponsesList/responses-list.scss @@ -3,6 +3,7 @@ padding: 0.2em 0; margin: 0.5em 0; color: #253137; + font-weight: normal; } .header-name { diff --git a/lib/components/ResponsesSamples/responses-samples.scss b/lib/components/ResponsesSamples/responses-samples.scss index a8b3481f..9d33323f 100644 --- a/lib/components/ResponsesSamples/responses-samples.scss +++ b/lib/components/ResponsesSamples/responses-samples.scss @@ -13,9 +13,10 @@ header { margin: 5px 0; color: $sample-panel-headers-color; text-transform: uppercase; + font-weight: normal; } -:host tabs li { +:host > tabs > ul li { font-size: 13px; margin: 2px 0; padding: 2px 5px; diff --git a/lib/components/SchemaSample/schema-sample.html b/lib/components/SchemaSample/schema-sample.html index f01cfb59..9fe51cae 100644 --- a/lib/components/SchemaSample/schema-sample.html +++ b/lib/components/SchemaSample/schema-sample.html @@ -1,5 +1,5 @@
 Sample unavailable 
-
{{data.sample | json}}
+

 
diff --git a/lib/components/SchemaSample/schema-sample.js b/lib/components/SchemaSample/schema-sample.js index 6d5fafc9..79382e53 100644 --- a/lib/components/SchemaSample/schema-sample.js +++ b/lib/components/SchemaSample/schema-sample.js @@ -4,19 +4,19 @@ import {RedocComponent, BaseComponent} from '../base'; import SchemaSampler from 'json-schema-instantiator'; +import {JsonFormatter} from '../../utils/JsonFormatterPipe'; +import {ElementRef} from 'angular2/core'; + @RedocComponent({ selector: 'schema-sample', templateUrl: './lib/components/SchemaSample/schema-sample.html', - styles: [` - pre { - background-color: transparent; - padding: 0; - } - `] + pipes: [JsonFormatter], + styleUrls: ['./lib/components/SchemaSample/schema-sample.css'] }) export default class SchemaSample extends BaseComponent { - constructor(schemaMgr) { + constructor(schemaMgr, elementRef) { super(schemaMgr); + this.element = elementRef.nativeElement; } init() { @@ -44,5 +44,19 @@ export default class SchemaSample extends BaseComponent { } this.data.sample = sample; + + + this.element.addEventListener('click', (event) => { + var collapsed, target = event.target; + if (event.target.className === 'collapser') { + collapsed = target.parentNode.getElementsByClassName('collapsible')[0]; + if (collapsed.parentNode.classList.contains('collapsed')) { + collapsed.parentNode.classList.remove('collapsed'); + } else { + collapsed.parentNode.classList.add('collapsed'); + } + } + }); } } +SchemaSample.parameters = SchemaSample.parameters.concat([[ElementRef]]); diff --git a/lib/components/SchemaSample/schema-sample.scss b/lib/components/SchemaSample/schema-sample.scss new file mode 100644 index 00000000..3d5bb3fc --- /dev/null +++ b/lib/components/SchemaSample/schema-sample.scss @@ -0,0 +1,112 @@ +pre { + background-color: transparent; + padding: 0; +} +:host { + .property { + //font-weight: bold; + } + + .type-null { + color: gray; + } + + .type-boolean { + color: firebrick; + } + + .type-number { + color: #4A8BB3; + } + + .type-string { + color: #66B16E; + } + + .callback-function { + color: gray; + } + + .collapser:after { + content: "-"; + cursor: pointer; + } + + .collapsed > .collapser:after { + content: "+"; + cursor: pointer; + } + + .ellipsis:after { + content: " … "; + } + + .collapsible { + margin-left: 2em; + } + + .hoverable { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 2px; + padding-right: 2px; + border-radius: 2px; + } + + .hovered { + background-color: rgba(235, 238, 249, 1); + } + + .collapser { + padding-right: 6px; + padding-left: 6px; + } + + ul, .redoc-json ul { + list-style-type: none; + padding: 0px; + margin: 0px 0px 0px 26px; + } + + li { + position: relative; + } + + .hoverable { + transition: background-color .2s ease-out 0s; + -webkit-transition: background-color .2s ease-out 0s; + display: inline-block; + } + + .hovered { + transition-delay: .2s; + -webkit-transition-delay: .2s; + } + + .selected { + outline-style: solid; + outline-width: 1px; + outline-style: dotted; + } + + .collapsed>.collapsible { + display: none; + } + + .ellipsis { + display: none; + } + + .collapsed>.ellipsis { + display: inherit; + } + + .collapser { + position: absolute; + top: 1px; + left: -1.5em; + cursor: default; + user-select: none; + -webkit-user-select: none; + } +} diff --git a/lib/components/SideMenu/side-menu.html b/lib/components/SideMenu/side-menu.html index 53d125c1..754cde31 100644 --- a/lib/components/SideMenu/side-menu.html +++ b/lib/components/SideMenu/side-menu.html @@ -1,13 +1,22 @@ - -