From 686e24ae6f3c63a2a07d9e5fac8047161d7b462c Mon Sep 17 00:00:00 2001 From: Pierluigi Viti Date: Tue, 23 Jan 2024 10:17:37 +0100 Subject: [PATCH] feat: update resources to schema v1.0.1 --- gen/openapi.json | 10843 ++++++++-------- gen/schema.ts | 4 - package.json | 2 +- pnpm-lock.yaml | 178 +- specs/resource.spec.ts | 4 +- specs/resources/api_credentials.spec.ts | 2 +- .../resources/application_memberships.spec.ts | 24 +- specs/resources/memberships.spec.ts | 23 +- specs/resources/organizations.spec.ts | 2 +- specs/resources/permissions.spec.ts | 2 +- specs/resources/roles.spec.ts | 2 +- specs/resources/user.spec.ts | 2 +- specs/resources/versions.spec.ts | 2 +- src/api.ts | 7 +- src/commercelayer.ts | 2 +- src/model.ts | 2 +- src/resources/application_memberships.ts | 9 - src/resources/memberships.ts | 7 - src/resources/organizations.ts | 2 +- 19 files changed, 5427 insertions(+), 5692 deletions(-) diff --git a/gen/openapi.json b/gen/openapi.json index ff64877..bb5aa29 100644 --- a/gen/openapi.json +++ b/gen/openapi.json @@ -1,5836 +1,5629 @@ { - "openapi": "3.0.1", - "info": { - "title": "Commerce Layer Provisioning API", - "version": "1.0.0", - "contact": { - "name": "API Support", - "url": "https://commercelayer.io", - "email": "support@commercelayer.io" - }, - "description": "Headless Commerce for Global Brands." - }, - "servers": [ - { - "url": "https://provisioning.commercelayer.io", - "description": "Commerce Layer Provisioning API" + "openapi": "3.0.1", + "info": { + "title": "Commerce Layer Provisioning API", + "version": "1.0.1", + "contact": { + "name": "API Support", + "url": "https://commercelayer.io", + "email": "support@commercelayer.io" + }, + "description": "Headless Commerce for Global Brands." }, - { - "url": "https://docs.commercelayer.io/provisioning-api", - "description": "API reference" - } - ], - "paths": { - "/api_credentials": { - "get": { - "operationId": "GET/api_credentials", - "summary": "List all API credentials", - "description": "List all API credentials", - "tags": [ - "api_credentials" - ], - "responses": { - "200": { - "description": "A list of API credential objects", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/apiCredentialResponseList" - } - } - } - } - } - }, - "post": { - "operationId": "POST/api_credentials", - "summary": "Creates an API credential", - "description": "Creates an API credential", - "tags": [ - "api_credentials" - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/apiCredentialCreate" - } - } - } + "servers": [ + { + "url": "https://provisioning.commercelayer.io", + "description": "Commerce Layer Provisioning API" }, - "responses": { - "201": { - "description": "The created API credential object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/apiCredentialResponse" - } - } - } - } + { + "url": "https://docs.commercelayer.io/provisioning-api", + "description": "API reference" } - } - }, - "/api_credentials/{apiCredentialId}": { - "get": { - "operationId": "GET/api_credentials/apiCredentialId", - "summary": "Retrieve an API credential", - "description": "Retrieve an API credential", - "parameters": [ - { - "name": "apiCredentialId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "tags": [ - "api_credentials" - ], - "responses": { - "200": { - "description": "The API credential object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/apiCredentialResponse" + ], + "paths": { + "/api_credentials": { + "post": { + "operationId": "POST/api_credentials", + "summary": "Creates an API credential", + "description": "Creates an API credential", + "tags": [ + "api_credentials" + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/apiCredentialCreate" + } + } + } + }, + "responses": { + "201": { + "description": "The created API credential object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/apiCredentialResponse" + } + } + } + } } - } - } - } - } - }, - "patch": { - "operationId": "PATCH/api_credentials/apiCredentialId", - "summary": "Updates an API credential", - "description": "Updates an API credential", - "tags": [ - "api_credentials" - ], - "parameters": [ - { - "name": "apiCredentialId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/apiCredentialUpdate" - } + "get": { + "operationId": "GET/api_credentials", + "summary": "List all API credentials", + "description": "List all API credentials", + "tags": [ + "api_credentials" + ], + "responses": { + "200": { + "description": "A list of API credential objects", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/apiCredentialResponseList" + } + } + } + } + } } - } }, - "responses": { - "200": { - "description": "The updated API credential object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/apiCredentialResponse" + "/api_credentials/{apiCredentialId}": { + "get": { + "operationId": "GET/api_credentials/apiCredentialId", + "summary": "Retrieve an API credential", + "description": "Retrieve an API credential", + "parameters": [ + { + "name": "apiCredentialId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "tags": [ + "api_credentials" + ], + "responses": { + "200": { + "description": "The API credential object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/apiCredentialResponse" + } + } + } + } } - } - } - } - } - }, - "delete": { - "operationId": "DELETE/api_credentials/apiCredentialId", - "summary": "Delete an API credential", - "description": "Delete an API credential", - "tags": [ - "api_credentials" - ], - "parameters": [ - { - "name": "apiCredentialId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "204": { - "description": "No content" - } - } - } - }, - "/api_credentials/{apiCredentialId}/organization": { - "get": { - "operationId": "GET/apiCredentialId/organization", - "summary": "Related API credential", - "description": "Related API credential", - "tags": [ - "organizations", - "has_one" - ], - "parameters": [ - { - "name": "apiCredentialId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The organization associated to the API credential" - } - } - } - }, - "/api_credentials/{apiCredentialId}/role": { - "get": { - "operationId": "GET/apiCredentialId/role", - "summary": "Related API credential", - "description": "Related API credential", - "tags": [ - "roles", - "has_one" - ], - "parameters": [ - { - "name": "apiCredentialId", - "in": "path", - "schema": { - "type": "string" + "patch": { + "operationId": "PATCH/api_credentials/apiCredentialId", + "summary": "Updates an API credential", + "description": "Updates an API credential", + "tags": [ + "api_credentials" + ], + "parameters": [ + { + "name": "apiCredentialId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/apiCredentialUpdate" + } + } + } + }, + "responses": { + "200": { + "description": "The updated API credential object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/apiCredentialResponse" + } + } + } + } + } }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The role associated to the API credential" - } - } - } - }, - "/application_memberships": { - "get": { - "operationId": "GET/application_memberships", - "summary": "List all application memberships", - "description": "List all application memberships", - "tags": [ - "application_memberships" - ], - "responses": { - "200": { - "description": "A list of application membership objects", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/applicationMembershipResponseList" + "delete": { + "operationId": "DELETE/api_credentials/apiCredentialId", + "summary": "Delete an API credential", + "description": "Delete an API credential", + "tags": [ + "api_credentials" + ], + "parameters": [ + { + "name": "apiCredentialId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "204": { + "description": "No content" + } } - } - } - } - } - }, - "post": { - "operationId": "POST/application_memberships", - "summary": "Creates an application membership", - "description": "Creates an application membership", - "tags": [ - "application_memberships" - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/applicationMembershipCreate" - } } - } }, - "responses": { - "201": { - "description": "The created application membership object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/applicationMembershipResponse" + "/api_credentials/{apiCredentialId}/organization": { + "get": { + "operationId": "GET/apiCredentialId/organization", + "summary": "Related API credential", + "description": "Related API credential", + "tags": [ + "organizations", + "has_one" + ], + "parameters": [ + { + "name": "apiCredentialId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The organization associated to the API credential" + } } - } } - } - } - } - }, - "/application_memberships/{applicationMembershipId}": { - "get": { - "operationId": "GET/application_memberships/applicationMembershipId", - "summary": "Retrieve an application membership", - "description": "Retrieve an application membership", - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "tags": [ - "application_memberships" - ], - "responses": { - "200": { - "description": "The application membership object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/applicationMembershipResponse" + }, + "/api_credentials/{apiCredentialId}/role": { + "get": { + "operationId": "GET/apiCredentialId/role", + "summary": "Related API credential", + "description": "Related API credential", + "tags": [ + "roles", + "has_one" + ], + "parameters": [ + { + "name": "apiCredentialId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The role associated to the API credential" + } } - } - } - } - } - }, - "patch": { - "operationId": "PATCH/application_memberships/applicationMembershipId", - "summary": "Updates an application membership", - "description": "Updates an application membership", - "tags": [ - "application_memberships" - ], - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/applicationMembershipUpdate" - } } - } }, - "responses": { - "200": { - "description": "The updated application membership object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/applicationMembershipResponse" + "/application_memberships": { + "post": { + "operationId": "POST/application_memberships", + "summary": "Creates an application membership", + "description": "Creates an application membership", + "tags": [ + "application_memberships" + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/applicationMembershipCreate" + } + } + } + }, + "responses": { + "201": { + "description": "The created application membership object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/applicationMembershipResponse" + } + } + } + } } - } - } - } - } - }, - "delete": { - "operationId": "DELETE/application_memberships/applicationMembershipId", - "summary": "Delete an application membership", - "description": "Delete an application membership", - "tags": [ - "application_memberships" - ], - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "204": { - "description": "No content" - } - } - } - }, - "/application_memberships/{applicationMembershipId}/api_credential": { - "get": { - "operationId": "GET/applicationMembershipId/api_credential", - "summary": "Related application membership", - "description": "Related application membership", - "tags": [ - "api_credentials", - "has_one" - ], - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The api_credential associated to the application membership" - } - } - } - }, - "/application_memberships/{applicationMembershipId}/membership": { - "get": { - "operationId": "GET/applicationMembershipId/membership", - "summary": "Related application membership", - "description": "Related application membership", - "tags": [ - "memberships", - "has_one" - ], - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The membership associated to the application membership" - } - } - } - }, - "/application_memberships/{applicationMembershipId}/user": { - "get": { - "operationId": "GET/applicationMembershipId/user", - "summary": "Related application membership", - "description": "Related application membership", - "tags": [ - "user", - "has_one" - ], - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The user associated to the application membership" - } - } - } - }, - "/application_memberships/{applicationMembershipId}/organization": { - "get": { - "operationId": "GET/applicationMembershipId/organization", - "summary": "Related application membership", - "description": "Related application membership", - "tags": [ - "organizations", - "has_one" - ], - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The organization associated to the application membership" - } - } - } - }, - "/application_memberships/{applicationMembershipId}/role": { - "get": { - "operationId": "GET/applicationMembershipId/role", - "summary": "Related application membership", - "description": "Related application membership", - "tags": [ - "roles", - "has_one" - ], - "parameters": [ - { - "name": "applicationMembershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The role associated to the application membership" - } - } - } - }, - "/memberships": { - "get": { - "operationId": "GET/memberships", - "summary": "List all memberships", - "description": "List all memberships", - "tags": [ - "memberships" - ], - "responses": { - "200": { - "description": "A list of membership objects", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/membershipResponseList" + "get": { + "operationId": "GET/application_memberships", + "summary": "List all application memberships", + "description": "List all application memberships", + "tags": [ + "application_memberships" + ], + "responses": { + "200": { + "description": "A list of application membership objects", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/applicationMembershipResponseList" + } + } + } + } } - } - } - } - } - }, - "post": { - "operationId": "POST/memberships", - "summary": "Creates an membership", - "description": "Creates an membership", - "tags": [ - "memberships" - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/membershipCreate" - } } - } }, - "responses": { - "201": { - "description": "The created membership object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/membershipResponse" + "/application_memberships/{applicationMembershipId}": { + "get": { + "operationId": "GET/application_memberships/applicationMembershipId", + "summary": "Retrieve an application membership", + "description": "Retrieve an application membership", + "parameters": [ + { + "name": "applicationMembershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "tags": [ + "application_memberships" + ], + "responses": { + "200": { + "description": "The application membership object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/applicationMembershipResponse" + } + } + } + } } - } - } - } - } - } - }, - "/memberships/{membershipId}": { - "get": { - "operationId": "GET/memberships/membershipId", - "summary": "Retrieve an membership", - "description": "Retrieve an membership", - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "tags": [ - "memberships" - ], - "responses": { - "200": { - "description": "The membership object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/membershipResponse" + "patch": { + "operationId": "PATCH/application_memberships/applicationMembershipId", + "summary": "Updates an application membership", + "description": "Updates an application membership", + "tags": [ + "application_memberships" + ], + "parameters": [ + { + "name": "applicationMembershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/applicationMembershipUpdate" + } + } + } + }, + "responses": { + "200": { + "description": "The updated application membership object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/applicationMembershipResponse" + } + } + } + } } - } - } - } - } - }, - "patch": { - "operationId": "PATCH/memberships/membershipId", - "summary": "Updates an membership", - "description": "Updates an membership", - "tags": [ - "memberships" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/membershipUpdate" - } + "delete": { + "operationId": "DELETE/application_memberships/applicationMembershipId", + "summary": "Delete an application membership", + "description": "Delete an application membership", + "tags": [ + "application_memberships" + ], + "parameters": [ + { + "name": "applicationMembershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "204": { + "description": "No content" + } + } } - } }, - "responses": { - "200": { - "description": "The updated membership object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/membershipResponse" + "/application_memberships/{applicationMembershipId}/api_credential": { + "get": { + "operationId": "GET/applicationMembershipId/api_credential", + "summary": "Related application membership", + "description": "Related application membership", + "tags": [ + "api_credentials", + "has_one" + ], + "parameters": [ + { + "name": "applicationMembershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The api_credential associated to the application membership" + } } - } - } - } - } - }, - "delete": { - "operationId": "DELETE/memberships/membershipId", - "summary": "Delete an membership", - "description": "Delete an membership", - "tags": [ - "memberships" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "204": { - "description": "No content" - } - } - } - }, - "/memberships/{membershipId}/resend": { - "post": { - "operationId": "POST/memberships/membershipId/resend", - "summary": "Resend invitation", - "description": "Resend invitation for the given membership", - "tags": [ - "memberships" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { } - } }, - "responses": { - "202": { - "description": "Confirmation that the invitation has been sent", - "content": { - } - } - } - } - }, - "/memberships/{membershipId}/organization": { - "get": { - "operationId": "GET/membershipId/organization", - "summary": "Related membership", - "description": "Related membership", - "tags": [ - "organizations", - "has_one" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The organization associated to the membership" - } - } - } - }, - "/memberships/{membershipId}/role": { - "get": { - "operationId": "GET/membershipId/role", - "summary": "Related membership", - "description": "Related membership", - "tags": [ - "roles", - "has_one" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The role associated to the membership" - } - } - } - }, - "/memberships/{membershipId}/application_memberships": { - "get": { - "operationId": "GET/membershipId/application_memberships", - "summary": "Related membership", - "description": "Related membership", - "tags": [ - "application_memberships", - "has_many" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The application_memberships associated to the membership" - } - } - } - }, - "/memberships/{membershipId}/user": { - "get": { - "operationId": "GET/membershipId/user", - "summary": "Related membership", - "description": "Related membership", - "tags": [ - "user", - "has_one" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The user associated to the membership" - } - } - } - }, - "/memberships/{membershipId}/versions": { - "get": { - "operationId": "GET/membershipId/versions", - "summary": "Related membership", - "description": "Related membership", - "tags": [ - "versions", - "has_many" - ], - "parameters": [ - { - "name": "membershipId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The versions associated to the membership" - } - } - } - }, - "/organizations": { - "get": { - "operationId": "GET/organizations", - "summary": "List all organizations", - "description": "List all organizations", - "tags": [ - "organizations" - ], - "responses": { - "200": { - "description": "A list of organization objects", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/organizationResponseList" + "/application_memberships/{applicationMembershipId}/membership": { + "get": { + "operationId": "GET/applicationMembershipId/membership", + "summary": "Related application membership", + "description": "Related application membership", + "tags": [ + "memberships", + "has_one" + ], + "parameters": [ + { + "name": "applicationMembershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The membership associated to the application membership" + } } - } - } - } - } - }, - "post": { - "operationId": "POST/organizations", - "summary": "Creates an organization", - "description": "Creates an organization", - "tags": [ - "organizations" - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/organizationCreate" - } } - } }, - "responses": { - "201": { - "description": "The created organization object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/organizationResponse" + "/application_memberships/{applicationMembershipId}/organization": { + "get": { + "operationId": "GET/applicationMembershipId/organization", + "summary": "Related application membership", + "description": "Related application membership", + "tags": [ + "organizations", + "has_one" + ], + "parameters": [ + { + "name": "applicationMembershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The organization associated to the application membership" + } } - } } - } - } - } - }, - "/organizations/{organizationId}": { - "get": { - "operationId": "GET/organizations/organizationId", - "summary": "Retrieve an organization", - "description": "Retrieve an organization", - "parameters": [ - { - "name": "organizationId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "tags": [ - "organizations" - ], - "responses": { - "200": { - "description": "The organization object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/organizationResponse" + }, + "/application_memberships/{applicationMembershipId}/role": { + "get": { + "operationId": "GET/applicationMembershipId/role", + "summary": "Related application membership", + "description": "Related application membership", + "tags": [ + "roles", + "has_one" + ], + "parameters": [ + { + "name": "applicationMembershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The role associated to the application membership" + } } - } - } - } - } - }, - "patch": { - "operationId": "PATCH/organizations/organizationId", - "summary": "Updates an organization", - "description": "Updates an organization", - "tags": [ - "organizations" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/organizationUpdate" - } } - } }, - "responses": { - "200": { - "description": "The updated organization object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/organizationResponse" + "/memberships": { + "post": { + "operationId": "POST/memberships", + "summary": "Creates an membership", + "description": "Creates an membership", + "tags": [ + "memberships" + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/membershipCreate" + } + } + } + }, + "responses": { + "201": { + "description": "The created membership object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/membershipResponse" + } + } + } + } } - } - } - } - } - } - }, - "/organizations/{organizationId}/transfer_ownership": { - "patch": { - "operationId": "PATCH/organizations/organizationId/transfer_ownership", - "summary": "Transfer ownership of an organization", - "description": "Transfers the ownership of an organization to a new owner", - "tags": [ - "organizations" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "required": [ - "data" + "get": { + "operationId": "GET/memberships", + "summary": "List all memberships", + "description": "List all memberships", + "tags": [ + "memberships" ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { - "type": "object", - "properties": { - "new_owner_email": { - "type": "string", - "description": "The user email of the new owner of the organization.", - "example": "test@commercelayer.io", - "nullable": false - } + "responses": { + "200": { + "description": "A list of membership objects", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/membershipResponseList" + } + } } - } } - } } - } } - } }, - "responses": { - "202": { - "description": "The confirmation of the transfer ownership", - "content": { - } - } - } - } - }, - "/organizations/{organizationId}/memberships": { - "get": { - "operationId": "GET/organizationId/memberships", - "summary": "Related organization", - "description": "Related organization", - "tags": [ - "memberships", - "has_many" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The memberships associated to the organization" - } - } - } - }, - "/organizations/{organizationId}/roles": { - "get": { - "operationId": "GET/organizationId/roles", - "summary": "Related organization", - "description": "Related organization", - "tags": [ - "roles", - "has_many" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The roles associated to the organization" - } - } - } - }, - "/organizations/{organizationId}/permissions": { - "get": { - "operationId": "GET/organizationId/permissions", - "summary": "Related organization", - "description": "Related organization", - "tags": [ - "permissions", - "has_many" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "schema": { - "type": "string" + "/memberships/{membershipId}": { + "get": { + "operationId": "GET/memberships/membershipId", + "summary": "Retrieve an membership", + "description": "Retrieve an membership", + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "tags": [ + "memberships" + ], + "responses": { + "200": { + "description": "The membership object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/membershipResponse" + } + } + } + } + } }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The permissions associated to the organization" - } - } - } - }, - "/organizations/{organizationId}/api_credentials": { - "get": { - "operationId": "GET/organizationId/api_credentials", - "summary": "Related organization", - "description": "Related organization", - "tags": [ - "api_credentials", - "has_many" - ], - "parameters": [ - { - "name": "organizationId", - "in": "path", - "schema": { - "type": "string" + "patch": { + "operationId": "PATCH/memberships/membershipId", + "summary": "Updates an membership", + "description": "Updates an membership", + "tags": [ + "memberships" + ], + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/membershipUpdate" + } + } + } + }, + "responses": { + "200": { + "description": "The updated membership object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/membershipResponse" + } + } + } + } + } }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The api_credentials associated to the organization" - } - } - } - }, - "/permissions": { - "get": { - "operationId": "GET/permissions", - "summary": "List all permissions", - "description": "List all permissions", - "tags": [ - "permissions" - ], - "responses": { - "200": { - "description": "A list of permission objects", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/permissionResponseList" + "delete": { + "operationId": "DELETE/memberships/membershipId", + "summary": "Delete an membership", + "description": "Delete an membership", + "tags": [ + "memberships" + ], + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "204": { + "description": "No content" + } } - } - } - } - } - }, - "post": { - "operationId": "POST/permissions", - "summary": "Creates an permission", - "description": "Creates an permission", - "tags": [ - "permissions" - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/permissionCreate" - } } - } }, - "responses": { - "201": { - "description": "The created permission object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/permissionResponse" - } - } - } - } - } - } - }, - "/permissions/{permissionId}": { - "get": { - "operationId": "GET/permissions/permissionId", - "summary": "Retrieve an permission", - "description": "Retrieve an permission", - "parameters": [ - { - "name": "permissionId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "tags": [ - "permissions" - ], - "responses": { - "200": { - "description": "The permission object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/permissionResponse" + "/memberships/{membershipId}/resend": { + "post": { + "operationId": "POST/memberships/membershipId/resend", + "summary": "Resend invitation", + "description": "Resend invitation for the given membership", + "tags": [ + "memberships" + ], + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": {} + } + }, + "responses": { + "202": { + "description": "Confirmation that the invitation has been sent", + "content": {} + } } - } - } - } - } - }, - "patch": { - "operationId": "PATCH/permissions/permissionId", - "summary": "Updates an permission", - "description": "Updates an permission", - "tags": [ - "permissions" - ], - "parameters": [ - { - "name": "permissionId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/permissionUpdate" - } } - } }, - "responses": { - "200": { - "description": "The updated permission object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/permissionResponse" + "/memberships/{membershipId}/organization": { + "get": { + "operationId": "GET/membershipId/organization", + "summary": "Related membership", + "description": "Related membership", + "tags": [ + "organizations", + "has_one" + ], + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The organization associated to the membership" + } } - } } - } - } - } - }, - "/permissions/{permissionId}/organization": { - "get": { - "operationId": "GET/permissionId/organization", - "summary": "Related permission", - "description": "Related permission", - "tags": [ - "organizations", - "has_one" - ], - "parameters": [ - { - "name": "permissionId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The organization associated to the permission" - } - } - } - }, - "/permissions/{permissionId}/role": { - "get": { - "operationId": "GET/permissionId/role", - "summary": "Related permission", - "description": "Related permission", - "tags": [ - "roles", - "has_one" - ], - "parameters": [ - { - "name": "permissionId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The role associated to the permission" - } - } - } - }, - "/permissions/{permissionId}/versions": { - "get": { - "operationId": "GET/permissionId/versions", - "summary": "Related permission", - "description": "Related permission", - "tags": [ - "versions", - "has_many" - ], - "parameters": [ - { - "name": "permissionId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The versions associated to the permission" - } - } - } - }, - "/roles": { - "get": { - "operationId": "GET/roles", - "summary": "List all roles", - "description": "List all roles", - "tags": [ - "roles" - ], - "responses": { - "200": { - "description": "A list of role objects", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/roleResponseList" + }, + "/memberships/{membershipId}/role": { + "get": { + "operationId": "GET/membershipId/role", + "summary": "Related membership", + "description": "Related membership", + "tags": [ + "roles", + "has_one" + ], + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The role associated to the membership" + } } - } - } - } - } - }, - "post": { - "operationId": "POST/roles", - "summary": "Creates an role", - "description": "Creates an role", - "tags": [ - "roles" - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/roleCreate" - } } - } }, - "responses": { - "201": { - "description": "The created role object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/roleResponse" + "/memberships/{membershipId}/application_memberships": { + "get": { + "operationId": "GET/membershipId/application_memberships", + "summary": "Related membership", + "description": "Related membership", + "tags": [ + "application_memberships", + "has_many" + ], + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The application_memberships associated to the membership" + } } - } } - } - } - } - }, - "/roles/{roleId}": { - "get": { - "operationId": "GET/roles/roleId", - "summary": "Retrieve an role", - "description": "Retrieve an role", - "parameters": [ - { - "name": "roleId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "tags": [ - "roles" - ], - "responses": { - "200": { - "description": "The role object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/roleResponse" + }, + "/memberships/{membershipId}/versions": { + "get": { + "operationId": "GET/membershipId/versions", + "summary": "Related membership", + "description": "Related membership", + "tags": [ + "versions", + "has_many" + ], + "parameters": [ + { + "name": "membershipId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The versions associated to the membership" + } } - } - } - } - } - }, - "patch": { - "operationId": "PATCH/roles/roleId", - "summary": "Updates an role", - "description": "Updates an role", - "tags": [ - "roles" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/roleUpdate" - } } - } }, - "responses": { - "200": { - "description": "The updated role object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/roleResponse" + "/organizations": { + "post": { + "operationId": "POST/organizations", + "summary": "Creates an organization", + "description": "Creates an organization", + "tags": [ + "organizations" + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/organizationCreate" + } + } + } + }, + "responses": { + "201": { + "description": "The created organization object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/organizationResponse" + } + } + } + } } - } - } - } - } - } - }, - "/roles/{roleId}/organization": { - "get": { - "operationId": "GET/roleId/organization", - "summary": "Related role", - "description": "Related role", - "tags": [ - "organizations", - "has_one" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The organization associated to the role" - } - } - } - }, - "/roles/{roleId}/permissions": { - "get": { - "operationId": "GET/roleId/permissions", - "summary": "Related role", - "description": "Related role", - "tags": [ - "permissions", - "has_many" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The permissions associated to the role" - } - } - } - }, - "/roles/{roleId}/memberships": { - "get": { - "operationId": "GET/roleId/memberships", - "summary": "Related role", - "description": "Related role", - "tags": [ - "memberships", - "has_many" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The memberships associated to the role" - } - } - } - }, - "/roles/{roleId}/api_credentials": { - "get": { - "operationId": "GET/roleId/api_credentials", - "summary": "Related role", - "description": "Related role", - "tags": [ - "api_credentials", - "has_many" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The api_credentials associated to the role" - } - } - } - }, - "/roles/{roleId}/versions": { - "get": { - "operationId": "GET/roleId/versions", - "summary": "Related role", - "description": "Related role", - "tags": [ - "versions", - "has_many" - ], - "parameters": [ - { - "name": "roleId", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The resource's id" - } - ], - "responses": { - "200": { - "description": "The versions associated to the role" - } - } - } - }, - "/user": { - "get": { - "operationId": "GET/user/userId", - "summary": "Retrieve an user", - "description": "Retrieve an user", - "parameters": [ - - ], - "tags": [ - "user", - "singleton" - ], - "responses": { - "200": { - "description": "The user object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/userResponse" + "get": { + "operationId": "GET/organizations", + "summary": "List all organizations", + "description": "List all organizations", + "tags": [ + "organizations" + ], + "responses": { + "200": { + "description": "A list of organization objects", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/organizationResponseList" + } + } + } + } } - } - } - } - } - }, - "patch": { - "operationId": "PATCH/user/userId", - "summary": "Updates an user", - "description": "Updates an user", - "tags": [ - "user", - "singleton" - ], - "parameters": [ - - ], - "requestBody": { - "required": true, - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/userUpdate" - } } - } }, - "responses": { - "200": { - "description": "The updated user object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/userResponse" - } - } - } - } - } - } - }, - "/versions": { - "get": { - "operationId": "GET/versions", - "summary": "List all versions", - "description": "List all versions", - "tags": [ - "versions" - ], - "responses": { - "200": { - "description": "A list of version objects", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/versionResponseList" + "/organizations/{organizationId}": { + "get": { + "operationId": "GET/organizations/organizationId", + "summary": "Retrieve an organization", + "description": "Retrieve an organization", + "parameters": [ + { + "name": "organizationId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "tags": [ + "organizations" + ], + "responses": { + "200": { + "description": "The organization object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/organizationResponse" + } + } + } + } } - } - } - } - } - } - }, - "/versions/{versionId}": { - "get": { - "operationId": "GET/versions/versionId", - "summary": "Retrieve an version", - "description": "Retrieve an version", - "parameters": [ - { - "name": "versionId", - "in": "path", - "schema": { - "type": "string" }, - "required": true, - "description": "The resource's id" - } - ], - "tags": [ - "versions" - ], - "responses": { - "200": { - "description": "The version object", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/versionResponse" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "apiCredential": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "attributes": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The API credential internal name.", - "example": "My app", - "nullable": false - }, - "kind": { - "type": "string", - "description": "The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).", - "example": "sales_channel", - "nullable": false - }, - "confidential": { - "type": "boolean", - "description": "Indicates if the API credential it's confidential.", - "example": true, - "nullable": false - }, - "redirect_uri": { - "type": "string", - "description": "The API credential redirect URI.", - "example": "https://bluebrand.com/img/logo.svg", - "nullable": true - }, - "client_id": { - "type": "string", - "description": "The API credential unique ID.", - "example": "xxxx-yyyy-zzzz", - "nullable": false - }, - "client_secret": { - "type": "string", - "description": "The API credential unique secret.", - "example": "xxxx-yyyy-zzzz", - "nullable": false - }, - "scopes": { - "type": "string", - "description": "The API credential scopes.", - "example": "market:all market:9 market:122 market:6 stock_location:6 stock_location:33", - "nullable": false - }, - "expires_in": { - "type": "integer", - "description": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", - "example": 7200, - "nullable": true - }, - "mode": { - "type": "string", - "description": "Indicates the environment the resource belongs to (one of `test` or `live`).", - "example": "test", - "nullable": true - }, - "custom": { - "type": "boolean", - "description": "Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).", - "example": false, - "nullable": true - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { - "type": "object", - "properties": { - "organization": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "patch": { + "operationId": "PATCH/organizations/organizationId", + "summary": "Updates an organization", + "description": "Updates an organization", + "tags": [ + "organizations" + ], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/organizationUpdate" + } } - } } - }, - "role": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + }, + "responses": { + "200": { + "description": "The updated organization object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/organizationResponse" + } + } } - } } - } } - } } - } - } - }, - "apiCredentialCreate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "attributes": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The API credential internal name.", - "example": "My app" - }, - "kind": { - "type": "string", - "description": "The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).", - "example": "sales_channel" - }, - "redirect_uri": { - "type": "string", - "description": "The API credential redirect URI.", - "example": "https://bluebrand.com/img/logo.svg" - }, - "expires_in": { - "type": "integer", - "description": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", - "example": 7200 - }, - "mode": { - "type": "string", - "description": "Indicates the environment the resource belongs to (one of `test` or `live`).", - "example": "test" - }, - "custom": { - "type": "boolean", - "description": "Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).", - "example": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE" - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - } - } - }, - "required": [ - "name", - "kind" - ] - }, - "relationships": { - "type": "object", - "properties": { - "organization": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "role": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + }, + "/organizations/{organizationId}/transfer_ownership": { + "patch": { + "operationId": "PATCH/organizations/organizationId/transfer_ownership", + "summary": "Transfer ownership of an organization", + "description": "Transfers the ownership of an organization to a new owner", + "tags": [ + "organizations" + ], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "required": [ + "type", + "id", + "attributes" + ], + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "new_owner_email": { + "type": "string", + "description": "The user email of the new owner of the organization.", + "example": "test@commercelayer.io", + "nullable": false + } + } + } + } + } + } + } } - } } - } }, - "required": [ - "organization" - ] - } - } - } - } - }, - "apiCredentialUpdate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The API credential internal name.", - "example": "My app", - "nullable": false - }, - "redirect_uri": { - "type": "string", - "description": "The API credential redirect URI.", - "example": "https://bluebrand.com/img/logo.svg", - "nullable": true - }, - "expires_in": { - "type": "integer", - "description": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", - "example": 7200, - "nullable": true - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { - "type": "object", - "properties": { - "role": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + "responses": { + "202": { + "description": "The confirmation of the transfer ownership", + "content": {} } - } } - } } - } - } - }, - "apiCredentialResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - } - } - }, - "attributes": { - "$ref": "#/components/schemas/apiCredential/properties/data/properties/attributes" - }, - "relationships": { - "type": "object", - "properties": { - "organization": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organization" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } - } - } + }, + "/organizations/{organizationId}/memberships": { + "get": { + "operationId": "GET/organizationId/memberships", + "summary": "Related organization", + "description": "Related organization", + "tags": [ + "memberships", + "has_many" + ], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "role": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "role" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } - } - } + ], + "responses": { + "200": { + "description": "The memberships associated to the organization" } - } } - } - } - } - } - }, - "apiCredentialResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/apiCredentialResponse/properties/data" } - } - } - }, - "applicationMembership": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "attributes": { - "type": "object", - "properties": { - "filters": { - "type": "object", - "description": "Set of key-value pairs that contains restrictions and scopes of the application membership.", - "example": { - "market_id_in": [ - 202, - 203 - ] - }, - "nullable": true - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { - "type": "object", - "properties": { - "api_credential": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "membership": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + }, + "/organizations/{organizationId}/roles": { + "get": { + "operationId": "GET/organizationId/roles", + "summary": "Related organization", + "description": "Related organization", + "tags": [ + "roles", + "has_many" + ], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "user": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + ], + "responses": { + "200": { + "description": "The roles associated to the organization" } - }, - "organization": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + } + } + }, + "/organizations/{organizationId}/permissions": { + "get": { + "operationId": "GET/organizationId/permissions", + "summary": "Related organization", + "description": "Related organization", + "tags": [ + "permissions", + "has_many" + ], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "role": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + ], + "responses": { + "200": { + "description": "The permissions associated to the organization" } - } } - } } - } - } - }, - "applicationMembershipCreate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "attributes": { - "type": "object", - "properties": { - "filters": { - "type": "object", - "description": "Set of key-value pairs that contains restrictions and scopes of the application membership.", - "example": { - "market_id_in": [ - 202, - 203 - ] - } - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE" - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - } - } + }, + "/organizations/{organizationId}/api_credentials": { + "get": { + "operationId": "GET/organizationId/api_credentials", + "summary": "Related organization", + "description": "Related organization", + "tags": [ + "api_credentials", + "has_many" + ], + "parameters": [ + { + "name": "organizationId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The api_credentials associated to the organization" + } } - }, - "relationships": { - "type": "object", - "properties": { - "api_credential": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "membership": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "user": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "organization": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "role": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + } + }, + "/permissions": { + "post": { + "operationId": "POST/permissions", + "summary": "Creates an permission", + "description": "Creates an permission", + "tags": [ + "permissions" + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/permissionCreate" + } } - } } - } }, - "required": [ - "api_credential", - "membership", - "user", - "organization", - "role" - ] - } - } - } - } - }, - "applicationMembershipUpdate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { - "type": "object", - "properties": { - "filters": { - "type": "object", - "description": "Set of key-value pairs that contains restrictions and scopes of the application membership.", - "example": { - "market_id_in": [ - 202, - 203 - ] - }, - "nullable": true - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } + "responses": { + "201": { + "description": "The created permission object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/permissionResponse" + } + } + } + } } - }, - "relationships": { - "type": "object", - "properties": { - "role": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + }, + "get": { + "operationId": "GET/permissions", + "summary": "List all permissions", + "description": "List all permissions", + "tags": [ + "permissions" + ], + "responses": { + "200": { + "description": "A list of permission objects", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/permissionResponseList" + } + } } - } } - } } - } } - } - } - }, - "applicationMembershipResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - } - } - }, - "attributes": { - "$ref": "#/components/schemas/applicationMembership/properties/data/properties/attributes" - }, - "relationships": { - "type": "object", - "properties": { - "api_credential": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credential" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } - } - } + }, + "/permissions/{permissionId}": { + "get": { + "operationId": "GET/permissions/permissionId", + "summary": "Retrieve an permission", + "description": "Retrieve an permission", + "parameters": [ + { + "name": "permissionId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "membership": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "membership" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + ], + "tags": [ + "permissions" + ], + "responses": { + "200": { + "description": "The permission object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/permissionResponse" + } + } } - } } - }, - "user": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } - } - } + } + }, + "patch": { + "operationId": "PATCH/permissions/permissionId", + "summary": "Updates an permission", + "description": "Updates an permission", + "tags": [ + "permissions" + ], + "parameters": [ + { + "name": "permissionId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "organization": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organization" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/permissionUpdate" + } } - } } - }, - "role": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "role" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + }, + "responses": { + "200": { + "description": "The updated permission object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/permissionResponse" + } + } } - } } - } } - } } - } - } - }, - "applicationMembershipResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/applicationMembershipResponse/properties/data" - } - } - } - }, - "membership": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "attributes": { - "type": "object", - "properties": { - "user_email": { - "type": "string", - "description": "The user email.", - "example": "commercelayer@commercelayer.io", - "nullable": false - }, - "user_first_name": { - "type": "string", - "description": "The user first name.", - "example": "John", - "nullable": false - }, - "user_last_name": { - "type": "string", - "description": "The user last name.", - "example": "Doe", - "nullable": false - }, - "status": { - "type": "string", - "description": "The memberships status. One of `pending` (default), `active`.", - "example": "pending", - "nullable": false, - "enum": [ - "pending", - "active" - ] - }, - "owner": { - "type": "boolean", - "description": "Indicates if the user it's the owner of the organization.", - "example": true, - "nullable": false - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { - "type": "object", - "properties": { - "organization": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + }, + "/permissions/{permissionId}/organization": { + "get": { + "operationId": "GET/permissionId/organization", + "summary": "Related permission", + "description": "Related permission", + "tags": [ + "organizations", + "has_one" + ], + "parameters": [ + { + "name": "permissionId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "role": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + ], + "responses": { + "200": { + "description": "The organization associated to the permission" } - }, - "application_memberships": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + } + } + }, + "/permissions/{permissionId}/role": { + "get": { + "operationId": "GET/permissionId/role", + "summary": "Related permission", + "description": "Related permission", + "tags": [ + "roles", + "has_one" + ], + "parameters": [ + { + "name": "permissionId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "user": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + ], + "responses": { + "200": { + "description": "The role associated to the permission" } - }, - "versions": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + } + } + }, + "/permissions/{permissionId}/versions": { + "get": { + "operationId": "GET/permissionId/versions", + "summary": "Related permission", + "description": "Related permission", + "tags": [ + "versions", + "has_many" + ], + "parameters": [ + { + "name": "permissionId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The versions associated to the permission" } - } } - } } - } - } - }, - "membershipCreate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "attributes": { - "type": "object", - "properties": { - "user_email": { - "type": "string", - "description": "The user email.", - "example": "commercelayer@commercelayer.io" - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE" - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - } - } - }, - "required": [ - "user_email" - ] - }, - "relationships": { - "type": "object", - "properties": { - "organization": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "role": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "application_memberships": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + }, + "/roles": { + "post": { + "operationId": "POST/roles", + "summary": "Creates an role", + "description": "Creates an role", + "tags": [ + "roles" + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/roleCreate" + } } - } } - } }, - "required": [ - "organization", - "role" - ] - } - } - } - } - }, - "membershipUpdate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { - "type": "object", - "properties": { - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { - "type": "object", - "properties": { - "role": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "responses": { + "201": { + "description": "The created role object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/roleResponse" + } + } } - } - } - }, - "application_memberships": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + } + } + }, + "get": { + "operationId": "GET/roles", + "summary": "List all roles", + "description": "List all roles", + "tags": [ + "roles" + ], + "responses": { + "200": { + "description": "A list of role objects", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/roleResponseList" + } + } } - } } - } } - } } - } - } - }, - "membershipResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - } - } - }, - "attributes": { - "$ref": "#/components/schemas/membership/properties/data/properties/attributes" - }, - "relationships": { - "type": "object", - "properties": { - "organization": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organization" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } - } - } + }, + "/roles/{roleId}": { + "get": { + "operationId": "GET/roles/roleId", + "summary": "Retrieve an role", + "description": "Retrieve an role", + "parameters": [ + { + "name": "roleId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "role": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "role" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + ], + "tags": [ + "roles" + ], + "responses": { + "200": { + "description": "The role object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/roleResponse" + } + } } - } } - }, - "application_memberships": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "application_memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } - } - } + } + }, + "patch": { + "operationId": "PATCH/roles/roleId", + "summary": "Updates an role", + "description": "Updates an role", + "tags": [ + "roles" + ], + "parameters": [ + { + "name": "roleId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "user": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + ], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/roleUpdate" + } } - } } - }, - "versions": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + }, + "responses": { + "200": { + "description": "The updated role object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/roleResponse" + } + } } - } } - } } - } - } - } - } - }, - "membershipResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/membershipResponse/properties/data" } - } - } - }, - "organization": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "attributes": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The organization's internal name.", - "example": "The Blue Brand", - "nullable": false - }, - "slug": { - "type": "string", - "description": "The organization's slug name.", - "example": "the-blue-brand", - "nullable": false - }, - "domain": { - "type": "string", - "description": "The organization's domain.", - "example": "the-blue-brand.commercelayer.io", - "nullable": false - }, - "support_phone": { - "type": "string", - "description": "The organization's support phone.", - "example": "+01 30800857", - "nullable": true - }, - "support_email": { - "type": "string", - "description": "The organization's support email.", - "example": "support@bluebrand.com", - "nullable": true - }, - "logo_url": { - "type": "string", - "description": "The URL to the organization's logo.", - "example": "https://bluebrand.com/img/logo.svg", - "nullable": true - }, - "favicon_url": { - "type": "string", - "description": "The URL to the organization's favicon.", - "example": "https://bluebrand.com/img/favicon.ico", - "nullable": true - }, - "primary_color": { - "type": "string", - "description": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", - "example": "#C8984E", - "nullable": true - }, - "contrast_color": { - "type": "string", - "description": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", - "example": "#FFFFCC", - "nullable": true - }, - "gtm_id": { - "type": "string", - "description": "The organization's Google Tag Manager ID.", - "example": "GTM-5FJXX6", - "nullable": true - }, - "gtm_id_test": { - "type": "string", - "description": "The organization's Google Tag Manager ID for test.", - "example": "GTM-5FJXX7", - "nullable": true - }, - "discount_disabled": { - "type": "boolean", - "description": "Indicates if organization has discount disabled.", - "example": false, - "nullable": true - }, - "account_disabled": { - "type": "boolean", - "description": "Indicates if organization has account disabled.", - "example": false, - "nullable": true - }, - "acceptance_disabled": { - "type": "boolean", - "description": "Indicates if organization has acceptance disabled.", - "example": false, - "nullable": true - }, - "max_concurrent_promotions": { - "type": "integer", - "description": "The maximum number of active concurrent promotions allowed for your organization.", - "example": 10, - "nullable": false - }, - "max_concurrent_imports": { - "type": "integer", - "description": "The maximum number of concurrent imports allowed for your organization.", - "example": 30, - "nullable": false - }, - "associated_markets": { - "type": "object", - "description": "An object that contains the markets of the organization.", - "example": { - "foo": "bar" - }, - "nullable": false - }, - "region": { - "type": "string", - "description": "The region where the organization it's located, default value it's `eu-west-1`.", - "example": "eu-west-1", - "nullable": true - }, - "can_switch_live": { - "type": "boolean", - "description": "Indicates if the organization can switch to live mode.", - "example": false, - "nullable": false - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { - "type": "object", - "properties": { - "memberships": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + }, + "/roles/{roleId}/organization": { + "get": { + "operationId": "GET/roleId/organization", + "summary": "Related role", + "description": "Related role", + "tags": [ + "organizations", + "has_one" + ], + "parameters": [ + { + "name": "roleId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "roles": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + ], + "responses": { + "200": { + "description": "The organization associated to the role" } - }, - "permissions": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + } + } + }, + "/roles/{roleId}/permissions": { + "get": { + "operationId": "GET/roleId/permissions", + "summary": "Related role", + "description": "Related role", + "tags": [ + "permissions", + "has_many" + ], + "parameters": [ + { + "name": "roleId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" } - }, - "api_credentials": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } + ], + "responses": { + "200": { + "description": "The permissions associated to the role" } - } } - } } - } - } - }, - "organizationCreate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "attributes": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The organization's internal name.", - "example": "The Blue Brand" - }, - "support_phone": { - "type": "string", - "description": "The organization's support phone.", - "example": "+01 30800857" - }, - "support_email": { - "type": "string", - "description": "The organization's support email.", - "example": "support@bluebrand.com" - }, - "logo_url": { - "type": "string", - "description": "The URL to the organization's logo.", - "example": "https://bluebrand.com/img/logo.svg" - }, - "favicon_url": { - "type": "string", - "description": "The URL to the organization's favicon.", - "example": "https://bluebrand.com/img/favicon.ico" - }, - "primary_color": { - "type": "string", - "description": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", - "example": "#C8984E" - }, - "contrast_color": { - "type": "string", - "description": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", - "example": "#FFFFCC" - }, - "gtm_id": { - "type": "string", - "description": "The organization's Google Tag Manager ID.", - "example": "GTM-5FJXX6" - }, - "gtm_id_test": { - "type": "string", - "description": "The organization's Google Tag Manager ID for test.", - "example": "GTM-5FJXX7" - }, - "discount_disabled": { - "type": "boolean", - "description": "Indicates if organization has discount disabled.", - "example": false - }, - "account_disabled": { - "type": "boolean", - "description": "Indicates if organization has account disabled.", - "example": false - }, - "acceptance_disabled": { - "type": "boolean", - "description": "Indicates if organization has acceptance disabled.", - "example": false - }, - "region": { - "type": "string", - "description": "The region where the organization it's located, default value it's `eu-west-1`.", - "example": "eu-west-1" - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE" - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - } - } - }, - "required": [ - "name" - ] - }, - "relationships": { - "type": "object", - "properties": { + }, + "/roles/{roleId}/memberships": { + "get": { + "operationId": "GET/roleId/memberships", + "summary": "Related role", + "description": "Related role", + "tags": [ + "memberships", + "has_many" + ], + "parameters": [ + { + "name": "roleId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The memberships associated to the role" + } } - } } - } - } - }, - "organizationUpdate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The organization's internal name.", - "example": "The Blue Brand", - "nullable": false - }, - "support_phone": { - "type": "string", - "description": "The organization's support phone.", - "example": "+01 30800857", - "nullable": true - }, - "support_email": { - "type": "string", - "description": "The organization's support email.", - "example": "support@bluebrand.com", - "nullable": true - }, - "logo_url": { - "type": "string", - "description": "The URL to the organization's logo.", - "example": "https://bluebrand.com/img/logo.svg", - "nullable": true - }, - "favicon_url": { - "type": "string", - "description": "The URL to the organization's favicon.", - "example": "https://bluebrand.com/img/favicon.ico", - "nullable": true - }, - "primary_color": { - "type": "string", - "description": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", - "example": "#C8984E", - "nullable": true - }, - "contrast_color": { - "type": "string", - "description": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", - "example": "#FFFFCC", - "nullable": true - }, - "gtm_id": { - "type": "string", - "description": "The organization's Google Tag Manager ID.", - "example": "GTM-5FJXX6", - "nullable": true - }, - "gtm_id_test": { - "type": "string", - "description": "The organization's Google Tag Manager ID for test.", - "example": "GTM-5FJXX7", - "nullable": true - }, - "discount_disabled": { - "type": "boolean", - "description": "Indicates if organization has discount disabled.", - "example": false, - "nullable": false - }, - "account_disabled": { - "type": "boolean", - "description": "Indicates if organization has account disabled.", - "example": false, - "nullable": false - }, - "acceptance_disabled": { - "type": "boolean", - "description": "Indicates if organization has acceptance disabled.", - "example": false, - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { - "type": "object", - "properties": { + }, + "/roles/{roleId}/api_credentials": { + "get": { + "operationId": "GET/roleId/api_credentials", + "summary": "Related role", + "description": "Related role", + "tags": [ + "api_credentials", + "has_many" + ], + "parameters": [ + { + "name": "roleId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The api_credentials associated to the role" + } } - } } - } - } - }, - "organizationResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - } + }, + "/roles/{roleId}/versions": { + "get": { + "operationId": "GET/roleId/versions", + "summary": "Related role", + "description": "Related role", + "tags": [ + "versions", + "has_many" + ], + "parameters": [ + { + "name": "roleId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "responses": { + "200": { + "description": "The versions associated to the role" + } } - }, - "attributes": { - "$ref": "#/components/schemas/organization/properties/data/properties/attributes" - }, - "relationships": { - "type": "object", - "properties": { - "memberships": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + } + }, + "/user": { + "get": { + "operationId": "GET/user/userId", + "summary": "Retrieve an user", + "description": "Retrieve an user", + "parameters": [], + "tags": [ + "user", + "singleton" + ], + "responses": { + "200": { + "description": "The user object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/userResponse" + } + } } - } } - }, - "roles": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + } + }, + "patch": { + "operationId": "PATCH/user/userId", + "summary": "Updates an user", + "description": "Updates an user", + "tags": [ + "user", + "singleton" + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/userUpdate" + } } - } } - }, - "permissions": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + }, + "responses": { + "200": { + "description": "The updated user object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/userResponse" + } + } } - } } - }, - "api_credentials": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } + } + } + }, + "/versions": { + "get": { + "operationId": "GET/versions", + "summary": "List all versions", + "description": "List all versions", + "tags": [ + "versions" + ], + "responses": { + "200": { + "description": "A list of version objects", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/versionResponseList" + } + } } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + } + } + } + }, + "/versions/{versionId}": { + "get": { + "operationId": "GET/versions/versionId", + "summary": "Retrieve an version", + "description": "Retrieve an version", + "parameters": [ + { + "name": "versionId", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The resource's id" + } + ], + "tags": [ + "versions" + ], + "responses": { + "200": { + "description": "The version object", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/versionResponse" + } + } } - } } - } } - } - } - } - } - }, - "organizationResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/organizationResponse/properties/data" } - } } - }, - "permission": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "attributes": { - "type": "object", - "properties": { - "can_create": { - "type": "boolean", - "description": "Determines if the permission have access to create rights.", - "example": false, - "nullable": false - }, - "can_read": { - "type": "boolean", - "description": "Determines if the permission have access to read rights.", - "example": false, - "nullable": false - }, - "can_update": { - "type": "boolean", - "description": "Determines if the permission have access to update rights.", - "example": false, - "nullable": false - }, - "can_destroy": { - "type": "boolean", - "description": "Determines if the permission have access to destroy rights.", - "example": false, - "nullable": false - }, - "subject": { - "type": "string", - "description": "The resource where this permission is applied.", - "example": "", - "nullable": false - }, - "restrictions": { - "type": "object", - "description": "An object that contains additional restrictions.", - "example": { - "foo": "bar" - }, - "nullable": false - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } - } - }, - "relationships": { + }, + "components": { + "schemas": { + "apiCredential": { "type": "object", "properties": { - "organization": { - "type": "object", - "properties": { - "data": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The API credential internal name.", + "example": "My app", + "nullable": false + }, + "kind": { + "type": "string", + "description": "The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).", + "example": "sales_channel", + "nullable": false + }, + "confidential": { + "type": "boolean", + "description": "Indicates if the API credential it's confidential.", + "example": true, + "nullable": false + }, + "redirect_uri": { + "type": "string", + "description": "The API credential redirect URI.", + "example": "https://bluebrand.com/img/logo.svg", + "nullable": true + }, + "client_id": { + "type": "string", + "description": "The API credential unique ID.", + "example": "xxxx-yyyy-zzzz", + "nullable": false + }, + "client_secret": { + "type": "string", + "description": "The API credential unique secret.", + "example": "xxxx-yyyy-zzzz", + "nullable": false + }, + "scopes": { + "type": "string", + "description": "The API credential scopes.", + "example": "market:all market:9 market:122 market:6 stock_location:6 stock_location:33", + "nullable": false + }, + "expires_in": { + "type": "integer", + "description": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", + "example": 7200, + "nullable": true + }, + "mode": { + "type": "string", + "description": "Indicates the environment the resource belongs to (one of `test` or `live`).", + "example": "test", + "nullable": true + }, + "custom": { + "type": "boolean", + "description": "Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).", + "example": false, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - } } - }, - "role": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } - } - } - } - }, - "versions": { - "type": "object", - "properties": { - "data": { + } + }, + "apiCredentialCreate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The API credential internal name.", + "example": "My app" + }, + "kind": { + "type": "string", + "description": "The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).", + "example": "sales_channel" + }, + "redirect_uri": { + "type": "string", + "description": "The API credential redirect URI.", + "example": "https://bluebrand.com/img/logo.svg" + }, + "expires_in": { + "type": "integer", + "description": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", + "example": 7200 + }, + "mode": { + "type": "string", + "description": "Indicates the environment the resource belongs to (one of `test` or `live`).", + "example": "test" + }, + "custom": { + "type": "boolean", + "description": "Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).", + "example": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + } + } + }, + "required": [ + "name", + "kind" + ] + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "role": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + }, + "required": [ + "organization" + ] + } } - } } - } } - } - } - } - } - }, - "permissionCreate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "attributes": { - "type": "object", - "properties": { - "can_create": { - "type": "boolean", - "description": "Determines if the permission have access to create rights.", - "example": false - }, - "can_read": { - "type": "boolean", - "description": "Determines if the permission have access to read rights.", - "example": false - }, - "can_update": { - "type": "boolean", - "description": "Determines if the permission have access to update rights.", - "example": false - }, - "can_destroy": { - "type": "boolean", - "description": "Determines if the permission have access to destroy rights.", - "example": false - }, - "subject": { - "type": "string", - "description": "The resource where this permission is applied.", - "example": "" - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE" - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - } - } - }, + }, + "apiCredentialUpdate": { "required": [ - "can_create", - "can_read", - "can_update", - "can_destroy", - "subject" - ] - }, - "relationships": { + "data" + ], "type": "object", "properties": { - "role": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { + "data": { "type": "object", + "required": [ + "type", + "id", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The API credential internal name.", + "example": "My app", + "nullable": false + }, + "redirect_uri": { + "type": "string", + "description": "The API credential redirect URI.", + "example": "https://bluebrand.com/img/logo.svg", + "nullable": true + }, + "expires_in": { + "type": "integer", + "description": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", + "example": 7200, + "nullable": true + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "role": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - } } - } - }, - "required": [ - "role" - ] - } - } - } - } - }, - "permissionUpdate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { - "type": "object", - "properties": { - "can_create": { - "type": "boolean", - "description": "Determines if the permission have access to create rights.", - "example": false, - "nullable": false - }, - "can_read": { - "type": "boolean", - "description": "Determines if the permission have access to read rights.", - "example": false, - "nullable": false - }, - "can_update": { - "type": "boolean", - "description": "Determines if the permission have access to update rights.", - "example": false, - "nullable": false - }, - "can_destroy": { - "type": "boolean", - "description": "Determines if the permission have access to destroy rights.", - "example": false, - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } } - }, - "relationships": { + }, + "apiCredentialResponse": { "type": "object", "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/apiCredential/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organization" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "role" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + } + } + } + } + } } - } - } - } - } - }, - "permissionResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "links": { + }, + "apiCredentialResponseList": { "type": "object", "properties": { - "self": { - "type": "string", - "description": "URL" - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/apiCredentialResponse/properties/data" + } + } } - }, - "attributes": { - "$ref": "#/components/schemas/permission/properties/data/properties/attributes" - }, - "relationships": { + }, + "applicationMembership": { "type": "object", "properties": { - "organization": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organization" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "attributes": { + "type": "object", + "properties": { + "filters": { + "type": "object", + "description": "Set of key-value pairs that contains restrictions and scopes of the application membership.", + "example": { + "market_id_in": [ + 202, + 203 + ] + }, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "api_credential": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "membership": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "organization": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - } } - }, - "role": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { + } + }, + "applicationMembershipCreate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "role" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "attributes": { + "type": "object", + "properties": { + "filters": { + "type": "object", + "description": "Set of key-value pairs that contains restrictions and scopes of the application membership.", + "example": { + "market_id_in": [ + 202, + 203 + ] + } + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + } + } + } + }, + "relationships": { + "type": "object", + "properties": { + "api_credential": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "membership": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "organization": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "role": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + }, + "required": [ + "api_credential", + "membership", + "organization", + "role" + ] + } } - } } - }, - "versions": { - "type": "object", - "properties": { - "links": { + } + }, + "applicationMembershipUpdate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "id", + "attributes" + ], "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "filters": { + "type": "object", + "description": "Set of key-value pairs that contains restrictions and scopes of the application membership.", + "example": { + "market_id_in": [ + 202, + 203 + ] + }, + "nullable": true + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "role": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - }, - "data": { + } + } + }, + "applicationMembershipResponse": { + "type": "object", + "properties": { + "data": { "type": "object", "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/applicationMembership/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": { + "api_credential": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credential" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "membership": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "membership" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "organization": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organization" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "role" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + } + } + } } - } } - } } - } - } - } - } - }, - "permissionResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/permissionResponse/properties/data" - } - } - } - }, - "role": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "attributes": { + }, + "applicationMembershipResponseList": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The role name.", - "example": "Custom role", - "nullable": false - }, - "kind": { - "type": "string", - "description": "The kind of role, one of: `custom`, `admin`, `read_only`", - "example": "custom", - "nullable": false - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/applicationMembershipResponse/properties/data" + } + } } - }, - "relationships": { + }, + "membership": { "type": "object", "properties": { - "organization": { - "type": "object", - "properties": { - "data": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "attributes": { + "type": "object", + "properties": { + "user_email": { + "type": "string", + "description": "The user email.", + "example": "commercelayer@commercelayer.io", + "nullable": false + }, + "user_first_name": { + "type": "string", + "description": "The user first name.", + "example": "John", + "nullable": false + }, + "user_last_name": { + "type": "string", + "description": "The user last name.", + "example": "Doe", + "nullable": false + }, + "status": { + "type": "string", + "description": "The memberships status. One of `pending` (default), `active`.", + "example": "pending", + "nullable": false, + "enum": [ + "pending", + "active" + ] + }, + "owner": { + "type": "boolean", + "description": "Indicates if the user it's the owner of the organization.", + "example": true, + "nullable": false + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "application_memberships": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "versions": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - } } - }, - "permissions": { - "type": "object", - "properties": { - "data": { + } + }, + "membershipCreate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "attributes": { + "type": "object", + "properties": { + "user_email": { + "type": "string", + "description": "The user email.", + "example": "commercelayer@commercelayer.io" + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + } + } + }, + "required": [ + "user_email" + ] + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "role": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "application_memberships": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + }, + "required": [ + "organization", + "role" + ] + } } - } } - }, - "memberships": { - "type": "object", - "properties": { - "data": { + } + }, + "membershipUpdate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "id", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "role": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "application_memberships": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - } } - }, - "api_credentials": { - "type": "object", - "properties": { - "data": { + } + }, + "membershipResponse": { + "type": "object", + "properties": { + "data": { "type": "object", "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/membership/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organization" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "role" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "application_memberships": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "application_memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "versions": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + } + } + } } - } } - }, - "versions": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + } + }, + "membershipResponseList": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/membershipResponse/properties/data" } - } } - } } - } - } - } - } - }, - "roleCreate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "attributes": { + }, + "organization": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The role name.", - "example": "Custom role" - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE" - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - } - } - }, + "data": { + "type": "object", + "required": [ + "type", + "attributes" + ], + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The organization's internal name.", + "example": "The Blue Brand", + "nullable": false + }, + "slug": { + "type": "string", + "description": "The organization's slug name.", + "example": "the-blue-brand", + "nullable": false + }, + "domain": { + "type": "string", + "description": "The organization's domain.", + "example": "the-blue-brand.commercelayer.io", + "nullable": false + }, + "support_phone": { + "type": "string", + "description": "The organization's support phone.", + "example": "+01 30800857", + "nullable": true + }, + "support_email": { + "type": "string", + "description": "The organization's support email.", + "example": "support@bluebrand.com", + "nullable": true + }, + "logo_url": { + "type": "string", + "description": "The URL to the organization's logo.", + "example": "https://bluebrand.com/img/logo.svg", + "nullable": true + }, + "favicon_url": { + "type": "string", + "description": "The URL to the organization's favicon.", + "example": "https://bluebrand.com/img/favicon.ico", + "nullable": true + }, + "primary_color": { + "type": "string", + "description": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "example": "#C8984E", + "nullable": true + }, + "contrast_color": { + "type": "string", + "description": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "example": "#FFFFCC", + "nullable": true + }, + "gtm_id": { + "type": "string", + "description": "The organization's Google Tag Manager ID.", + "example": "GTM-5FJXX6", + "nullable": true + }, + "gtm_id_test": { + "type": "string", + "description": "The organization's Google Tag Manager ID for test.", + "example": "GTM-5FJXX7", + "nullable": true + }, + "discount_disabled": { + "type": "boolean", + "description": "Indicates if organization has discount disabled.", + "example": false, + "nullable": true + }, + "account_disabled": { + "type": "boolean", + "description": "Indicates if organization has account disabled.", + "example": false, + "nullable": true + }, + "acceptance_disabled": { + "type": "boolean", + "description": "Indicates if organization has acceptance disabled.", + "example": false, + "nullable": true + }, + "max_concurrent_promotions": { + "type": "integer", + "description": "The maximum number of active concurrent promotions allowed for your organization.", + "example": 10, + "nullable": false + }, + "max_concurrent_imports": { + "type": "integer", + "description": "The maximum number of concurrent imports allowed for your organization.", + "example": 30, + "nullable": false + }, + "region": { + "type": "string", + "description": "The region where the organization it's located, default value it's `eu-west-1`.", + "example": "eu-west-1", + "nullable": true + }, + "can_switch_live": { + "type": "boolean", + "description": "Indicates if the organization can switch to live mode.", + "example": false, + "nullable": false + }, + "subscription_totals": { + "type": "object", + "description": "The number of current organizations, markets, memberships, and SKUs associated with the active subscription.", + "example": { + "organizations": 1, + "markets": 0, + "memberships": 0, + "skus": 0 + }, + "nullable": false + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "memberships": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "roles": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "api_credentials": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } + } + } + } + }, + "organizationCreate": { "required": [ - "name" - ] - }, - "relationships": { + "data" + ], "type": "object", "properties": { - "organization": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organizations" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The organization's internal name.", + "example": "The Blue Brand" + }, + "support_phone": { + "type": "string", + "description": "The organization's support phone.", + "example": "+01 30800857" + }, + "support_email": { + "type": "string", + "description": "The organization's support email.", + "example": "support@bluebrand.com" + }, + "logo_url": { + "type": "string", + "description": "The URL to the organization's logo.", + "example": "https://bluebrand.com/img/logo.svg" + }, + "favicon_url": { + "type": "string", + "description": "The URL to the organization's favicon.", + "example": "https://bluebrand.com/img/favicon.ico" + }, + "primary_color": { + "type": "string", + "description": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "example": "#C8984E" + }, + "contrast_color": { + "type": "string", + "description": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "example": "#FFFFCC" + }, + "gtm_id": { + "type": "string", + "description": "The organization's Google Tag Manager ID.", + "example": "GTM-5FJXX6" + }, + "gtm_id_test": { + "type": "string", + "description": "The organization's Google Tag Manager ID for test.", + "example": "GTM-5FJXX7" + }, + "discount_disabled": { + "type": "boolean", + "description": "Indicates if organization has discount disabled.", + "example": false + }, + "account_disabled": { + "type": "boolean", + "description": "Indicates if organization has account disabled.", + "example": false + }, + "acceptance_disabled": { + "type": "boolean", + "description": "Indicates if organization has acceptance disabled.", + "example": false + }, + "region": { + "type": "string", + "description": "The region where the organization it's located, default value it's `eu-west-1`.", + "example": "eu-west-1" + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + } + } + }, + "required": [ + "name" + ] + }, + "relationships": { + "type": "object", + "properties": {} + } } - } } - } - }, + } + }, + "organizationUpdate": { "required": [ - "organization" - ] - } - } - } - } - }, - "roleUpdate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { + "data" + ], "type": "object", "properties": { - "name": { - "type": "string", - "description": "The role name.", - "example": "Custom role", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } + "data": { + "type": "object", + "required": [ + "type", + "id", + "attributes" + ], + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The organization's internal name.", + "example": "The Blue Brand", + "nullable": false + }, + "support_phone": { + "type": "string", + "description": "The organization's support phone.", + "example": "+01 30800857", + "nullable": true + }, + "support_email": { + "type": "string", + "description": "The organization's support email.", + "example": "support@bluebrand.com", + "nullable": true + }, + "logo_url": { + "type": "string", + "description": "The URL to the organization's logo.", + "example": "https://bluebrand.com/img/logo.svg", + "nullable": true + }, + "favicon_url": { + "type": "string", + "description": "The URL to the organization's favicon.", + "example": "https://bluebrand.com/img/favicon.ico", + "nullable": true + }, + "primary_color": { + "type": "string", + "description": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "example": "#C8984E", + "nullable": true + }, + "contrast_color": { + "type": "string", + "description": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "example": "#FFFFCC", + "nullable": true + }, + "gtm_id": { + "type": "string", + "description": "The organization's Google Tag Manager ID.", + "example": "GTM-5FJXX6", + "nullable": true + }, + "gtm_id_test": { + "type": "string", + "description": "The organization's Google Tag Manager ID for test.", + "example": "GTM-5FJXX7", + "nullable": true + }, + "discount_disabled": { + "type": "boolean", + "description": "Indicates if organization has discount disabled.", + "example": false, + "nullable": false + }, + "account_disabled": { + "type": "boolean", + "description": "Indicates if organization has account disabled.", + "example": false, + "nullable": false + }, + "acceptance_disabled": { + "type": "boolean", + "description": "Indicates if organization has acceptance disabled.", + "example": false, + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": {} + } + } + } } - }, - "relationships": { + }, + "organizationResponse": { "type": "object", "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/organization/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": { + "memberships": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "roles": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "api_credentials": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + } + } + } + } + } } - } - } - } - } - }, - "roleResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "roles" - ] - }, - "links": { + }, + "organizationResponseList": { "type": "object", "properties": { - "self": { - "type": "string", - "description": "URL" - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/organizationResponse/properties/data" + } + } } - }, - "attributes": { - "$ref": "#/components/schemas/role/properties/data/properties/attributes" - }, - "relationships": { + }, + "permission": { "type": "object", "properties": { - "organization": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "organization" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "attributes": { + "type": "object", + "properties": { + "can_create": { + "type": "boolean", + "description": "Determines if the permission have access to create rights.", + "example": false, + "nullable": false + }, + "can_read": { + "type": "boolean", + "description": "Determines if the permission have access to read rights.", + "example": false, + "nullable": false + }, + "can_update": { + "type": "boolean", + "description": "Determines if the permission have access to update rights.", + "example": false, + "nullable": false + }, + "can_destroy": { + "type": "boolean", + "description": "Determines if the permission have access to destroy rights.", + "example": false, + "nullable": false + }, + "subject": { + "type": "string", + "description": "The resource where this permission is applied.", + "example": "", + "nullable": false + }, + "restrictions": { + "type": "object", + "description": "An object that contains additional restrictions.", + "example": { + "foo": "bar" + }, + "nullable": false + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "versions": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - } } - }, - "permissions": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { + } + }, + "permissionCreate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "permissions" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "attributes": { + "type": "object", + "properties": { + "can_create": { + "type": "boolean", + "description": "Determines if the permission have access to create rights.", + "example": false + }, + "can_read": { + "type": "boolean", + "description": "Determines if the permission have access to read rights.", + "example": false + }, + "can_update": { + "type": "boolean", + "description": "Determines if the permission have access to update rights.", + "example": false + }, + "can_destroy": { + "type": "boolean", + "description": "Determines if the permission have access to destroy rights.", + "example": false + }, + "subject": { + "type": "string", + "description": "The resource where this permission is applied.", + "example": "" + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + } + } + }, + "required": [ + "can_create", + "can_read", + "can_update", + "can_destroy", + "subject" + ] + }, + "relationships": { + "type": "object", + "properties": { + "role": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + }, + "required": [ + "role" + ] + } } - } } - }, - "memberships": { - "type": "object", - "properties": { - "links": { - "type": "object", - "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } - } - }, - "data": { + } + }, + "permissionUpdate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "id", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "memberships" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "can_create": { + "type": "boolean", + "description": "Determines if the permission have access to create rights.", + "example": false, + "nullable": false + }, + "can_read": { + "type": "boolean", + "description": "Determines if the permission have access to read rights.", + "example": false, + "nullable": false + }, + "can_update": { + "type": "boolean", + "description": "Determines if the permission have access to update rights.", + "example": false, + "nullable": false + }, + "can_destroy": { + "type": "boolean", + "description": "Determines if the permission have access to destroy rights.", + "example": false, + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": {} + } } - } } - }, - "api_credentials": { - "type": "object", - "properties": { - "links": { + } + }, + "permissionResponse": { + "type": "object", + "properties": { + "data": { "type": "object", "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/permission/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organization" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "role": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "role" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "versions": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + } + } + } } - }, - "data": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "api_credentials" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + } + } + }, + "permissionResponseList": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/permissionResponse/properties/data" } - } } - }, - "versions": { - "type": "object", - "properties": { - "links": { + } + }, + "role": { + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "self": { - "type": "string", - "description": "URL" - }, - "related": { - "type": "string", - "description": "URL" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The role name.", + "example": "Custom role", + "nullable": false + }, + "kind": { + "type": "string", + "description": "The kind of role, one of: `custom`, `admin`, `read_only`", + "example": "custom", + "nullable": false + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "memberships": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "api_credentials": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + }, + "versions": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + } + } } - }, - "data": { + } + } + }, + "roleCreate": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "type": "object", + "required": [ + "type", + "attributes" + ], "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "id": { - "type": "string", - "description": "The resource ID" - } + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The role name.", + "example": "Custom role" + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + } + } + }, + "required": [ + "name" + ] + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organizations" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + } + } + } + } + } + }, + "required": [ + "organization" + ] + } } - } } - } } - } - } - } - } - }, - "roleResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/roleResponse/properties/data" - } - } - } - }, - "user": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "attributes": { + }, + "roleUpdate": { + "required": [ + "data" + ], "type": "object", "properties": { - "email": { - "type": "string", - "description": "The user email.", - "example": "user@commercelayer.io", - "nullable": false - }, - "first_name": { - "type": "string", - "description": "The user first name.", - "example": "John", - "nullable": false - }, - "last_name": { - "type": "string", - "description": "The user last name.", - "example": "Doe", - "nullable": false - }, - "time_zone": { - "type": "string", - "description": "The user preferred timezone.", - "example": "UTC", - "nullable": true - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } + "data": { + "type": "object", + "required": [ + "type", + "id", + "attributes" + ], + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The role name.", + "example": "Custom role", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": {} + } + } + } } - }, - "relationships": { + }, + "roleResponse": { "type": "object", "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "roles" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/role/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": { + "organization": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "organization" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "permissions": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "permissions" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "memberships": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "memberships" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "api_credentials": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "api_credentials" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + }, + "versions": { + "type": "object", + "properties": { + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + }, + "related": { + "type": "string", + "description": "URL" + } + } + }, + "data": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "id": { + "type": "string", + "description": "The resource ID" + } + } + } + } + } + } + } + } + } } - } - } - } - } - }, - "userUpdate": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "id", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "attributes": { + }, + "roleResponseList": { "type": "object", "properties": { - "email": { - "type": "string", - "description": "The user email.", - "example": "user@commercelayer.io", - "nullable": false - }, - "first_name": { - "type": "string", - "description": "The user first name.", - "example": "John", - "nullable": false - }, - "last_name": { - "type": "string", - "description": "The user last name.", - "example": "Doe", - "nullable": false - }, - "time_zone": { - "type": "string", - "description": "The user preferred timezone.", - "example": "UTC", - "nullable": true - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/roleResponse/properties/data" + } + } } - }, - "relationships": { + }, + "user": { "type": "object", "properties": { + "data": { + "type": "object", + "required": [ + "type", + "attributes" + ], + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "user" + ] + }, + "attributes": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user email.", + "example": "user@commercelayer.io", + "nullable": false + }, + "first_name": { + "type": "string", + "description": "The user first name.", + "example": "John", + "nullable": false + }, + "last_name": { + "type": "string", + "description": "The user last name.", + "example": "Doe", + "nullable": false + }, + "time_zone": { + "type": "string", + "description": "The user preferred timezone.", + "example": "UTC", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": {} + } + } + } } - } - } - } - } - }, - "userResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "user" - ] - }, - "links": { + }, + "userUpdate": { + "required": [ + "data" + ], "type": "object", "properties": { - "self": { - "type": "string", - "description": "URL" - } + "data": { + "type": "object", + "required": [ + "type", + "id", + "attributes" + ], + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "user" + ] + }, + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "attributes": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user email.", + "example": "user@commercelayer.io", + "nullable": false + }, + "first_name": { + "type": "string", + "description": "The user first name.", + "example": "John", + "nullable": false + }, + "last_name": { + "type": "string", + "description": "The user last name.", + "example": "Doe", + "nullable": false + }, + "time_zone": { + "type": "string", + "description": "The user preferred timezone.", + "example": "UTC", + "nullable": true + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": {} + } + } + } } - }, - "attributes": { - "$ref": "#/components/schemas/user/properties/data/properties/attributes" - }, - "relationships": { + }, + "userResponse": { "type": "object", "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "user" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/user/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": {} + } + } + } } - } - } - } - } - }, - "userResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/userResponse/properties/data" - } - } - } - }, - "version": { - "type": "object", - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "attributes": { + }, + "userResponseList": { "type": "object", "properties": { - "resource_type": { - "type": "string", - "description": "The type of the versioned resource.", - "example": "roles", - "nullable": false - }, - "resource_id": { - "type": "string", - "description": "The versioned resource ID.", - "example": "PzdJhdLdYV", - "nullable": false - }, - "event": { - "type": "string", - "description": "The event which generates the version.", - "example": "update", - "nullable": false - }, - "changes": { - "type": "object", - "description": "The object changes payload.", - "example": { - "name": [ - "previous", - "new" - ] - }, - "nullable": false - }, - "who": { - "type": "object", - "description": "Information about who triggered the change, only showed when it's from a JWT token.", - "example": { - "application": { - "id": "DNOPYiZYpn", - "kind": "integration", - "public": true - } - }, - "nullable": false - }, - "created_at": { - "type": "string", - "description": "Time at which the resource was created.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "updated_at": { - "type": "string", - "description": "Time at which the resource was last updated.", - "example": "2018-01-01T12:00:00.000Z", - "nullable": false - }, - "reference": { - "type": "string", - "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", - "example": "ANY-EXTERNAL-REFEFERNCE", - "nullable": true - }, - "reference_origin": { - "type": "string", - "description": "Any identifier of the third party system that defines the reference code.", - "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", - "nullable": true - }, - "metadata": { - "type": "object", - "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", - "example": { - "foo": "bar" - }, - "nullable": true - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/userResponse/properties/data" + } + } } - }, - "relationships": { + }, + "version": { "type": "object", "properties": { + "data": { + "type": "object", + "required": [ + "type", + "attributes" + ], + "properties": { + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "attributes": { + "type": "object", + "properties": { + "resource_type": { + "type": "string", + "description": "The type of the versioned resource.", + "example": "roles", + "nullable": false + }, + "resource_id": { + "type": "string", + "description": "The versioned resource ID.", + "example": "PzdJhdLdYV", + "nullable": false + }, + "event": { + "type": "string", + "description": "The event which generates the version.", + "example": "update", + "nullable": false + }, + "changes": { + "type": "object", + "description": "The object changes payload.", + "example": { + "name": [ + "previous", + "new" + ] + }, + "nullable": false + }, + "who": { + "type": "object", + "description": "Information about who triggered the change, only showed when it's from a JWT token.", + "example": { + "application": { + "id": "DNOPYiZYpn", + "kind": "integration", + "public": true + } + }, + "nullable": false + }, + "created_at": { + "type": "string", + "description": "Time at which the resource was created.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "updated_at": { + "type": "string", + "description": "Time at which the resource was last updated.", + "example": "2018-01-01T12:00:00.000Z", + "nullable": false + }, + "reference": { + "type": "string", + "description": "A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.", + "example": "ANY-EXTERNAL-REFEFERNCE", + "nullable": true + }, + "reference_origin": { + "type": "string", + "description": "Any identifier of the third party system that defines the reference code.", + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN", + "nullable": true + }, + "metadata": { + "type": "object", + "description": "Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.", + "example": { + "foo": "bar" + }, + "nullable": true + } + } + }, + "relationships": { + "type": "object", + "properties": {} + } + } + } } - } - } - } - } - }, - "versionResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The resource's id", - "example": "XGZwpOSrWL" - }, - "type": { - "type": "string", - "description": "The resource's type", - "enum": [ - "versions" - ] - }, - "links": { + }, + "versionResponse": { "type": "object", "properties": { - "self": { - "type": "string", - "description": "URL" - } + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The resource's id", + "example": "XGZwpOSrWL" + }, + "type": { + "type": "string", + "description": "The resource's type", + "enum": [ + "versions" + ] + }, + "links": { + "type": "object", + "properties": { + "self": { + "type": "string", + "description": "URL" + } + } + }, + "attributes": { + "$ref": "#/components/schemas/version/properties/data/properties/attributes" + }, + "relationships": { + "type": "object", + "properties": {} + } + } + } } - }, - "attributes": { - "$ref": "#/components/schemas/version/properties/data/properties/attributes" - }, - "relationships": { + }, + "versionResponseList": { "type": "object", "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/versionResponse/properties/data" + } + } } - } } - } - } - }, - "versionResponseList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/versionResponse/properties/data" + }, + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" } - } } - } - }, - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" - } - } - }, - "tags": [ - { - "name": "singleton", - "description": "singleton resource" - }, - { - "name": "api_credentials", - "description": "resource type" - }, - { - "name": "has_one", - "description": "relationship kind" - }, - { - "name": "application_memberships", - "description": "resource type" - }, - { - "name": "memberships", - "description": "resource type" - }, - { - "name": "has_many", - "description": "relationship kind" }, - { - "name": "organizations", - "description": "resource type" - }, - { - "name": "permissions", - "description": "resource type" - }, - { - "name": "roles", - "description": "resource type" - }, - { - "name": "user", - "description": "resource type" - }, - { - "name": "versions", - "description": "resource type" - } - ], - "security": [ - { - "bearerAuth": [ - - ] - } - ] + "tags": [ + { + "name": "singleton", + "description": "singleton resource" + }, + { + "name": "api_credentials", + "description": "resource type" + }, + { + "name": "has_one", + "description": "relationship kind" + }, + { + "name": "application_memberships", + "description": "resource type" + }, + { + "name": "memberships", + "description": "resource type" + }, + { + "name": "has_many", + "description": "relationship kind" + }, + { + "name": "organizations", + "description": "resource type" + }, + { + "name": "permissions", + "description": "resource type" + }, + { + "name": "roles", + "description": "resource type" + }, + { + "name": "user", + "description": "resource type" + }, + { + "name": "versions", + "description": "resource type" + } + ], + "security": [ + { + "bearerAuth": [] + } + ] } \ No newline at end of file diff --git a/gen/schema.ts b/gen/schema.ts index f7251bb..4129f3f 100644 --- a/gen/schema.ts +++ b/gen/schema.ts @@ -1,14 +1,10 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable no-console */ import { readFileSync, writeFileSync } from 'fs' import { snakeCase } from 'lodash' import axios from 'axios' import { resolve } from 'path' import { sortObjectFields } from '../src/util' -import { inspect } from 'util' -// eslint-disable-next-line @typescript-eslint/no-var-requires const Inflector = require('inflector-js') diff --git a/package.json b/package.json index cf92a9d..ac65226 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@types/jest": "^29.5.11", "@types/lodash": "^4.14.202", "@types/node": "^20.11.5", - "dotenv": "^16.3.1", + "dotenv": "^16.3.2", "eslint": "^8.56.0", "inflector-js": "^1.0.1", "jest": "^29.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2dc7d44..e9dce5c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,8 +44,8 @@ devDependencies: specifier: ^20.11.5 version: 20.11.5 dotenv: - specifier: ^16.3.1 - version: 16.3.1 + specifier: ^16.3.2 + version: 16.3.2 eslint: specifier: ^8.56.0 version: 8.56.0 @@ -89,7 +89,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.21 + '@jridgewell/trace-mapping': 0.3.22 dev: true /@babel/code-frame@7.23.5: @@ -134,7 +134,7 @@ packages: dependencies: '@babel/types': 7.23.6 '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.21 + '@jridgewell/trace-mapping': 0.3.22 jsesc: 2.5.2 dev: true @@ -1250,7 +1250,7 @@ packages: babel-plugin-polyfill-corejs2: 0.4.8(@babel/core@7.23.7) babel-plugin-polyfill-corejs3: 0.8.7(@babel/core@7.23.7) babel-plugin-polyfill-regenerator: 0.5.5(@babel/core@7.23.7) - core-js-compat: 3.35.0 + core-js-compat: 3.35.1 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -1345,12 +1345,12 @@ packages: eslint: '>=8.0' typescript: '>=5.0' dependencies: - '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 eslint-config-prettier: 9.1.0(eslint@8.56.0) - eslint-config-standard-with-typescript: 42.0.0(@typescript-eslint/eslint-plugin@6.19.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + eslint-config-standard-with-typescript: 42.0.0(@typescript-eslint/eslint-plugin@6.19.1)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0) eslint-plugin-n: 16.6.2(eslint@8.56.0) eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.4) eslint-plugin-promise: 6.1.1(eslint@8.56.0) @@ -1778,7 +1778,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.21 + '@jridgewell/trace-mapping': 0.3.22 '@types/node': 20.11.5 chalk: 4.1.2 collect-v8-coverage: 1.0.2 @@ -1812,7 +1812,7 @@ packages: resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jridgewell/trace-mapping': 0.3.21 + '@jridgewell/trace-mapping': 0.3.22 callsites: 3.1.0 graceful-fs: 4.2.11 dev: true @@ -1843,7 +1843,7 @@ packages: dependencies: '@babel/core': 7.23.7 '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.21 + '@jridgewell/trace-mapping': 0.3.22 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 @@ -1878,7 +1878,7 @@ packages: dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.21 + '@jridgewell/trace-mapping': 0.3.22 dev: true /@jridgewell/resolve-uri@3.1.1: @@ -1895,8 +1895,8 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.21: - resolution: {integrity: sha512-SRfKmRe1KvYnxjEMtxEr+J4HIeMX5YBg/qhRHpxEIGjhX1rshcHlnFUE9K0GazhVKWM7B+nARSkV8LuvJdJ5/g==} + /@jridgewell/trace-mapping@0.3.22: + resolution: {integrity: sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==} dependencies: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 @@ -1935,8 +1935,8 @@ packages: engines: {node: '>= 18'} dev: true - /@octokit/core@5.0.2: - resolution: {integrity: sha512-cZUy1gUvd4vttMic7C0lwPed8IYXWYp8kHIMatyhY8t8n3Cpw2ILczkV5pGMPqef7v0bLo0pOHrEHarsau2Ydg==} + /@octokit/core@5.1.0: + resolution: {integrity: sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==} engines: {node: '>= 18'} dependencies: '@octokit/auth-token': 4.0.0 @@ -1969,35 +1969,35 @@ packages: resolution: {integrity: sha512-6G+ywGClliGQwRsjvqVYpklIfa7oRPA0vyhPQG/1Feh+B+wU0vGH1JiJ5T25d3g1JZYBHzR2qefLi9x8Gt+cpw==} dev: true - /@octokit/plugin-paginate-rest@9.1.5(@octokit/core@5.0.2): + /@octokit/plugin-paginate-rest@9.1.5(@octokit/core@5.1.0): resolution: {integrity: sha512-WKTQXxK+bu49qzwv4qKbMMRXej1DU2gq017euWyKVudA6MldaSSQuxtz+vGbhxV4CjxpUxjZu6rM2wfc1FiWVg==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=5' dependencies: - '@octokit/core': 5.0.2 + '@octokit/core': 5.1.0 '@octokit/types': 12.4.0 dev: true - /@octokit/plugin-retry@6.0.1(@octokit/core@5.0.2): + /@octokit/plugin-retry@6.0.1(@octokit/core@5.1.0): resolution: {integrity: sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=5' dependencies: - '@octokit/core': 5.0.2 + '@octokit/core': 5.1.0 '@octokit/request-error': 5.0.1 '@octokit/types': 12.4.0 bottleneck: 2.19.5 dev: true - /@octokit/plugin-throttling@8.1.3(@octokit/core@5.0.2): + /@octokit/plugin-throttling@8.1.3(@octokit/core@5.1.0): resolution: {integrity: sha512-pfyqaqpc0EXh5Cn4HX9lWYsZ4gGbjnSmUILeu4u2gnuM50K/wIk9s1Pxt3lVeVwekmITgN/nJdoh43Ka+vye8A==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': ^5.0.0 dependencies: - '@octokit/core': 5.0.2 + '@octokit/core': 5.1.0 '@octokit/types': 12.4.0 bottleneck: 2.19.5 dev: true @@ -2126,10 +2126,10 @@ packages: peerDependencies: semantic-release: '>=20.1.0' dependencies: - '@octokit/core': 5.0.2 - '@octokit/plugin-paginate-rest': 9.1.5(@octokit/core@5.0.2) - '@octokit/plugin-retry': 6.0.1(@octokit/core@5.0.2) - '@octokit/plugin-throttling': 8.1.3(@octokit/core@5.0.2) + '@octokit/core': 5.1.0 + '@octokit/plugin-paginate-rest': 9.1.5(@octokit/core@5.1.0) + '@octokit/plugin-retry': 6.0.1(@octokit/core@5.1.0) + '@octokit/plugin-throttling': 8.1.3(@octokit/core@5.1.0) '@semantic-release/error': 4.0.0 aggregate-error: 5.0.0 debug: 4.3.4 @@ -2204,8 +2204,8 @@ packages: engines: {node: '>=18'} dev: true - /@sinonjs/commons@3.0.0: - resolution: {integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==} + /@sinonjs/commons@3.0.1: + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} dependencies: type-detect: 4.0.8 dev: true @@ -2213,7 +2213,7 @@ packages: /@sinonjs/fake-timers@10.3.0: resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} dependencies: - '@sinonjs/commons': 3.0.0 + '@sinonjs/commons': 3.0.1 dev: true /@tsconfig/node10@1.0.9: @@ -2340,8 +2340,8 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==} + /@typescript-eslint/eslint-plugin@6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -2352,11 +2352,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.19.0 + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/type-utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.1 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -2369,8 +2369,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} + /@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2379,10 +2379,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.19.0 + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.1 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -2390,16 +2390,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.19.0: - resolution: {integrity: sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==} + /@typescript-eslint/scope-manager@6.19.1: + resolution: {integrity: sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/visitor-keys': 6.19.0 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/visitor-keys': 6.19.1 dev: true - /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==} + /@typescript-eslint/type-utils@6.19.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2408,8 +2408,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) @@ -2418,13 +2418,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@6.19.0: - resolution: {integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==} + /@typescript-eslint/types@6.19.1: + resolution: {integrity: sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): - resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} + /@typescript-eslint/typescript-estree@6.19.1(typescript@5.3.3): + resolution: {integrity: sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -2432,8 +2432,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/visitor-keys': 6.19.0 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/visitor-keys': 6.19.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -2445,8 +2445,8 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==} + /@typescript-eslint/utils@6.19.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2454,9 +2454,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.19.0 - '@typescript-eslint/types': 6.19.0 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.3.3) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -2464,11 +2464,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.19.0: - resolution: {integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==} + /@typescript-eslint/visitor-keys@6.19.1: + resolution: {integrity: sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/types': 6.19.1 eslint-visitor-keys: 3.4.3 dev: true @@ -2761,7 +2761,7 @@ packages: dependencies: '@babel/core': 7.23.7 '@babel/helper-define-polyfill-provider': 0.4.4(@babel/core@7.23.7) - core-js-compat: 3.35.0 + core-js-compat: 3.35.1 transitivePeerDependencies: - supports-color dev: true @@ -2846,7 +2846,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001579 - electron-to-chromium: 1.4.639 + electron-to-chromium: 1.4.642 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) dev: true @@ -3073,8 +3073,8 @@ packages: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true - /core-js-compat@3.35.0: - resolution: {integrity: sha512-5blwFAddknKeNgsjBzilkdQ0+YK8L1PfqPYq40NOYMYFSS38qj+hpTcLLWwpIwA2A5bje/x5jmVn2tzUMg9IVw==} + /core-js-compat@3.35.1: + resolution: {integrity: sha512-sftHa5qUJY3rs9Zht1WEnmkvXputCyDBczPnr7QDgL8n3qrF3CMXY4VPSYtOLLiOUJcah2WNXREd48iOl6mQIw==} dependencies: browserslist: 4.22.2 dev: true @@ -3254,8 +3254,8 @@ packages: is-obj: 2.0.0 dev: true - /dotenv@16.3.1: - resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} + /dotenv@16.3.2: + resolution: {integrity: sha512-HTlk5nmhkm8F6JcdXvHIzaorzCoziNQT9mGxLPVXW8wJF1TiGSL60ZGB4gHWabHOaMmWmhvk2/lPHfnBiT78AQ==} engines: {node: '>=12'} dev: true @@ -3273,8 +3273,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.639: - resolution: {integrity: sha512-CkKf3ZUVZchr+zDpAlNLEEy2NJJ9T64ULWaDgy3THXXlPVPkLu3VOs9Bac44nebVtdwl2geSj6AxTtGDOxoXhg==} + /electron-to-chromium@1.4.642: + resolution: {integrity: sha512-M4+u22ZJGpk4RY7tne6W+APkZhnnhmAH48FNl8iEFK2lEgob+U5rUQsIqQhvAwCXYpfd3H20pHK/ENsCvwTbsA==} dev: true /emittery@0.13.1: @@ -3450,7 +3450,7 @@ packages: eslint: 8.56.0 dev: true - /eslint-config-standard-with-typescript@42.0.0(@typescript-eslint/eslint-plugin@6.19.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3): + /eslint-config-standard-with-typescript@42.0.0(@typescript-eslint/eslint-plugin@6.19.1)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-m1/2g/Sicun1uFZOFigJVeOqo9fE7OkMsNtilcpHwdCdcGr21qsGqYiyxYSvvHfJwY7w5OTQH0hxk8sM2N5Ohg==} peerDependencies: '@typescript-eslint/eslint-plugin': ^6.4.0 @@ -3460,11 +3460,11 @@ packages: eslint-plugin-promise: ^6.0.0 typescript: '*' dependencies: - '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0) eslint-plugin-n: 16.6.2(eslint@8.56.0) eslint-plugin-promise: 6.1.1(eslint@8.56.0) typescript: 5.3.3 @@ -3482,7 +3482,7 @@ packages: eslint-plugin-promise: ^6.0.0 dependencies: eslint: 8.56.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0) eslint-plugin-n: 16.6.2(eslint@8.56.0) eslint-plugin-promise: 6.1.1(eslint@8.56.0) dev: true @@ -3497,7 +3497,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.19.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -3518,7 +3518,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 @@ -3538,7 +3538,7 @@ packages: eslint-compat-utils: 0.1.2(eslint@8.56.0) dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.19.0)(eslint@8.56.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -3548,7 +3548,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -3557,7 +3557,7 @@ packages: doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.19.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -5659,7 +5659,7 @@ packages: dependencies: '@babel/code-frame': 7.23.5 index-to-position: 0.1.2 - type-fest: 4.9.0 + type-fest: 4.10.0 dev: true /path-exists@3.0.0: @@ -5833,7 +5833,7 @@ packages: dependencies: find-up-simple: 1.0.0 read-pkg: 9.0.1 - type-fest: 4.9.0 + type-fest: 4.10.0 dev: true /read-pkg@9.0.1: @@ -5843,7 +5843,7 @@ packages: '@types/normalize-package-data': 2.4.4 normalize-package-data: 6.0.0 parse-json: 8.1.0 - type-fest: 4.9.0 + type-fest: 4.10.0 unicorn-magic: 0.1.0 dev: true @@ -6510,8 +6510,8 @@ packages: engines: {node: '>=14.16'} dev: true - /type-fest@4.9.0: - resolution: {integrity: sha512-KS/6lh/ynPGiHD/LnAobrEFq3Ad4pBzOlJ1wAnJx9N4EYoqFhMfLIBjUT2UEx4wg5ZE+cC1ob6DCSpppVo+rtg==} + /type-fest@4.10.0: + resolution: {integrity: sha512-NPaKJsb4wyJ16qc8zBQrWswLKv/YirgBFykvUQ1Iajt2wd+twC8E4hFXdlIXqiMl6kWA0zY8tUJ9ELVAdu5h7w==} engines: {node: '>=16'} dev: true @@ -6663,7 +6663,7 @@ packages: resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.21 + '@jridgewell/trace-mapping': 0.3.22 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 dev: true diff --git a/specs/resource.spec.ts b/specs/resource.spec.ts index 7883899..e090c29 100644 --- a/specs/resource.spec.ts +++ b/specs/resource.spec.ts @@ -60,10 +60,10 @@ describe('SDK:resource suite', () => { it('resource.create', async () => { - const user_email = 'spec@provisioning-sdk-test.org-role' + const user_email = 'spec@provisioning-sdk-test.org' const org = (await clp.organizations.list()).first() const role = (await clp.roles.list()).first() - if (!org || !role) return + if (!org || !role) throw new Error('Missing role or organization') const ms = await clp.memberships.create({ user_email, organization: clp.organizations.relationship(org), diff --git a/specs/resources/api_credentials.spec.ts b/specs/resources/api_credentials.spec.ts index 4322f68..99dcf36 100644 --- a/specs/resources/api_credentials.spec.ts +++ b/specs/resources/api_credentials.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ diff --git a/specs/resources/application_memberships.spec.ts b/specs/resources/application_memberships.spec.ts index 4acb870..d2741da 100644 --- a/specs/resources/application_memberships.spec.ts +++ b/specs/resources/application_memberships.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ @@ -27,7 +27,6 @@ describe('ApplicationMemberships resource', () => { const createAttributes = { api_credential: clp.api_credentials.relationship(TestData.id), membership: clp.memberships.relationship(TestData.id), - user: clp.user.relationship(TestData.id), organization: clp.organizations.relationship(TestData.id), role: clp.roles.relationship(TestData.id), } @@ -241,27 +240,6 @@ describe('ApplicationMemberships resource', () => { /* relationship.membership stop */ - /* relationship.user start */ - it(resourceType + '.user', async () => { - - const id = TestData.id - const params = { fields: { user: CommonData.paramsFields } } - - const intId = clp.addRequestInterceptor((config) => { - expect(config.method).toBe('get') - checkCommon(config, resourceType, id, currentAccessToken, 'user') - checkCommonParams(config, params) - return interceptRequest() - }) - - await clp[resourceType].user(id, params, CommonData.options) - .catch(handleError) - .finally(() => clp.removeInterceptor('request', intId)) - - }) - /* relationship.user stop */ - - /* relationship.organization start */ it(resourceType + '.organization', async () => { diff --git a/specs/resources/memberships.spec.ts b/specs/resources/memberships.spec.ts index 45cef52..eec6a0f 100644 --- a/specs/resources/memberships.spec.ts +++ b/specs/resources/memberships.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ @@ -261,27 +261,6 @@ describe('Memberships resource', () => { /* relationship.application_memberships stop */ - /* relationship.user start */ - it(resourceType + '.user', async () => { - - const id = TestData.id - const params = { fields: { user: CommonData.paramsFields } } - - const intId = clp.addRequestInterceptor((config) => { - expect(config.method).toBe('get') - checkCommon(config, resourceType, id, currentAccessToken, 'user') - checkCommonParams(config, params) - return interceptRequest() - }) - - await clp[resourceType].user(id, params, CommonData.options) - .catch(handleError) - .finally(() => clp.removeInterceptor('request', intId)) - - }) - /* relationship.user stop */ - - /* relationship.versions start */ it(resourceType + '.versions', async () => { diff --git a/specs/resources/organizations.spec.ts b/specs/resources/organizations.spec.ts index 2a8bb7e..84284b9 100644 --- a/specs/resources/organizations.spec.ts +++ b/specs/resources/organizations.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ diff --git a/specs/resources/permissions.spec.ts b/specs/resources/permissions.spec.ts index 880aa04..0751074 100644 --- a/specs/resources/permissions.spec.ts +++ b/specs/resources/permissions.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ diff --git a/specs/resources/roles.spec.ts b/specs/resources/roles.spec.ts index 8663a33..486decf 100644 --- a/specs/resources/roles.spec.ts +++ b/specs/resources/roles.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ diff --git a/specs/resources/user.spec.ts b/specs/resources/user.spec.ts index a5dd710..7b50822 100644 --- a/specs/resources/user.spec.ts +++ b/specs/resources/user.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ diff --git a/specs/resources/versions.spec.ts b/specs/resources/versions.spec.ts index 9be5c75..a23b286 100644 --- a/specs/resources/versions.spec.ts +++ b/specs/resources/versions.spec.ts @@ -1,5 +1,5 @@ /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. * Source code generated automatically by SDK codegen **/ diff --git a/src/api.ts b/src/api.ts index 5c6bd28..59e0a39 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,6 +1,11 @@ + + + + + 'user' 'user' @@ -26,7 +31,7 @@ import type { VersionType } from './resources/versions' // ##__API_RESOURCES_START__## // ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##' /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. **/ export { default as ApiCredentials } from './resources/api_credentials' export { default as ApplicationMemberships } from './resources/application_memberships' diff --git a/src/commercelayer.ts b/src/commercelayer.ts index 64c2710..71442fc 100644 --- a/src/commercelayer.ts +++ b/src/commercelayer.ts @@ -10,7 +10,7 @@ const debug = Debug('commercelayer') // Autogenerated schema version number, do not remove this line -const OPEN_API_SCHEMA_VERSION = '1.0.0' +const OPEN_API_SCHEMA_VERSION = '1.0.1' export { OPEN_API_SCHEMA_VERSION } diff --git a/src/model.ts b/src/model.ts index 59a9219..769028f 100644 --- a/src/model.ts +++ b/src/model.ts @@ -2,7 +2,7 @@ // ##__MODEL_TYPES_START__## // ##__MODEL_TYPES_TEMPLATE:: export type { ##__RESOURCE_MODELS__## } from './resources/##__RESOURCE_TYPE__##' /** - * ©2023 Commerce Layer Inc. + * ©2024 Commerce Layer Inc. **/ export type { ApiCredential, ApiCredentialCreate, ApiCredentialUpdate } from './resources/api_credentials' export type { ApplicationMembership, ApplicationMembershipCreate, ApplicationMembershipUpdate } from './resources/application_memberships' diff --git a/src/resources/application_memberships.ts b/src/resources/application_memberships.ts index 518fb26..acf38e8 100644 --- a/src/resources/application_memberships.ts +++ b/src/resources/application_memberships.ts @@ -4,7 +4,6 @@ import type { QueryParamsRetrieve } from '../query' import type { ApiCredential, ApiCredentialType } from './api_credentials' import type { Membership, MembershipType } from './memberships' -import type { User, UserType } from './user' import type { Organization, OrganizationType } from './organizations' import type { Role, RoleType } from './roles' @@ -13,7 +12,6 @@ type ApplicationMembershipType = 'application_memberships' type ApplicationMembershipRel = ResourceRel & { type: ApplicationMembershipType } type ApiCredentialRel = ResourceRel & { type: ApiCredentialType } type MembershipRel = ResourceRel & { type: MembershipType } -type UserRel = ResourceRel & { type: UserType } type OrganizationRel = ResourceRel & { type: OrganizationType } type RoleRel = ResourceRel & { type: RoleType } @@ -26,7 +24,6 @@ interface ApplicationMembership extends Resource { api_credential?: ApiCredential | null membership?: Membership | null - user?: User | null organization?: Organization | null role?: Role | null @@ -39,7 +36,6 @@ interface ApplicationMembershipCreate extends ResourceCreate { api_credential: ApiCredentialRel membership: MembershipRel - user: UserRel organization: OrganizationRel role: RoleRel @@ -81,11 +77,6 @@ class ApplicationMemberships extends ApiResource { return this.resources.fetch({ type: 'memberships' }, `application_memberships/${_applicationMembershipId}/membership`, params, options) as unknown as Membership } - async user(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { - const _applicationMembershipId = (applicationMembershipId as ApplicationMembership).id || applicationMembershipId as string - return this.resources.fetch({ type: 'user' }, `application_memberships/${_applicationMembershipId}/user`, params, options) as unknown as User - } - async organization(applicationMembershipId: string | ApplicationMembership, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { const _applicationMembershipId = (applicationMembershipId as ApplicationMembership).id || applicationMembershipId as string return this.resources.fetch({ type: 'organizations' }, `application_memberships/${_applicationMembershipId}/organization`, params, options) as unknown as Organization diff --git a/src/resources/memberships.ts b/src/resources/memberships.ts index fa19fec..5ecb467 100644 --- a/src/resources/memberships.ts +++ b/src/resources/memberships.ts @@ -5,7 +5,6 @@ import type { QueryParamsRetrieve, QueryParamsList } from '../query' import type { Organization, OrganizationType } from './organizations' import type { Role, RoleType } from './roles' import type { ApplicationMembership, ApplicationMembershipType } from './application_memberships' -import type { User } from './user' import type { Version } from './versions' @@ -29,7 +28,6 @@ interface Membership extends Resource { organization?: Organization | null role?: Role | null application_memberships?: ApplicationMembership[] | null - user?: User | null versions?: Version[] | null } @@ -90,11 +88,6 @@ class Memberships extends ApiResource { return this.resources.fetch({ type: 'application_memberships' }, `memberships/${_membershipId}/application_memberships`, params, options) as unknown as ListResponse } - async user(membershipId: string | Membership, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { - const _membershipId = (membershipId as Membership).id || membershipId as string - return this.resources.fetch({ type: 'user' }, `memberships/${_membershipId}/user`, params, options) as unknown as User - } - async versions(membershipId: string | Membership, params?: QueryParamsList, options?: ResourcesConfig): Promise> { const _membershipId = (membershipId as Membership).id || membershipId as string return this.resources.fetch({ type: 'versions' }, `memberships/${_membershipId}/versions`, params, options) as unknown as ListResponse diff --git a/src/resources/organizations.ts b/src/resources/organizations.ts index 430f0bd..73124cb 100644 --- a/src/resources/organizations.ts +++ b/src/resources/organizations.ts @@ -32,9 +32,9 @@ interface Organization extends Resource { acceptance_disabled?: boolean | null max_concurrent_promotions: number max_concurrent_imports: number - associated_markets: Record region?: string | null can_switch_live: boolean + subscription_totals: Record memberships?: Membership[] | null roles?: Role[] | null