diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 0d25a51..eba13f9 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -1,7 +1,7 @@ name: Release on: push: - branches: [ main, beta ] + branches: [ main, beta, prerelease ] pull_request: branches: [ main ] jobs: diff --git a/.releaserc b/.releaserc index 0555499..414090f 100644 --- a/.releaserc +++ b/.releaserc @@ -4,7 +4,8 @@ "branches": [ { "name": "main", "channel": "latest" }, "+([0-9])?(.{+([0-9]),x}).x", - { "name": "beta", "prerelease": true } + { "name": "beta", "prerelease": true }, + { "name": "prerelease", "prerelease": "rc" } ], "plugins": [ "@semantic-release/commit-analyzer", diff --git a/gen/generator.ts b/gen/generator.ts index 072da49..0c89c6d 100644 --- a/gen/generator.ts +++ b/gen/generator.ts @@ -696,7 +696,7 @@ const generateResource = (type: string, name: string, resource: Resource): strin res = res.replace(/##__IMPORT_RESOURCE_COMMON__##/, Array.from(declaredImportsCommon).join(', ')) res = res.replace(/##__MODEL_SORTABLE_INTERFACE__##/, (resModelType === 'ApiSingleton') ? '' : `, ${resModelInterface}Sort`) - const importQueryModels = (qryMod.size > 0)? `import type { ${Array.from(qryMod).sort().reverse().join(', ')} } from '../query'` : '' + const importQueryModels = (qryMod.size > 0) ? `import type { ${Array.from(qryMod).sort().reverse().join(', ')} } from '../query'` : '' res = res.replace(/##__IMPORT_QUERY_MODELS__##/, importQueryModels) @@ -720,6 +720,7 @@ const generateResource = (type: string, name: string, resource: Resource): strin const relationshipTypes: Set = new Set() const sortableFields: string[] = [] const filterableFields: string[] = [] + let nullables = false typesArray.forEach(t => { const cudSuffix = getCUDSuffix(t) @@ -733,6 +734,7 @@ const generateResource = (type: string, name: string, resource: Resource): strin sortableFields.push('id', ...Object.values(component.attributes).filter(f => (f.sortable && !RESOURCE_COMMON_FIELDS.includes(f.name))).map(f => f.name)) filterableFields.push('id', ...Object.values(component.attributes).filter(f => (f.filterable && !RESOURCE_COMMON_FIELDS.includes(f.name))).map(f => f.name)) } + nullables ||= tplCmp.nullables }) res = res.replace(/##__MODEL_INTERFACES__##/g, modelInterfaces.join('\n\n\n')) res = res.replace(/##__IMPORT_RESOURCE_INTERFACES__##/g, resourceInterfaces.join(', ')) @@ -757,6 +759,10 @@ const generateResource = (type: string, name: string, resource: Resource): strin // Enum types definitions + // Nullable type import + console.log(type + ' - ' + nullables) + if (!nullables) res = res.replace(/import type { Nullable/, '// import type { Nullable') + return res @@ -876,7 +882,7 @@ const nullable = (type: string): string => { type ComponentEnums = { [key: string]: string } -const templatedComponent = (res: string, name: string, cmp: Component): { component: string, models: string[], enums: ComponentEnums } => { +const templatedComponent = (res: string, name: string, cmp: Component): { component: string, models: string[], enums: ComponentEnums, nullables: boolean } => { const cudModel = isCUDModel(name) @@ -886,13 +892,15 @@ const templatedComponent = (res: string, name: string, cmp: Component): { compon // Attributes const attributes = Object.values(cmp.attributes) const fields: string[] = [] + let nullables = false attributes.forEach(a => { if (!RESOURCE_COMMON_FIELDS.includes(a.name)) { if (cudModel || a.fetchable) { let attrType = fixAttributeType(a) if (a.enum) enums[a.name] = attrType - // fields.push('/**\n* Unique identifier for the resource (hash).\n* @example ```"XAyRWNUzyN"```\n*/') + if (a.description || a.example) fields.push(`/** ${a.description? `\n\t * ${a.description}.` : ''}${a.example? `\n\t * @example \`\`\`"${(typeof a.example === 'object')? JSON.stringify(a.example) : a.example}"\`\`\``: ''}\n\t */`) fields.push(`${a.name}${a.required ? '' : '?'}: ${a.required ? attrType : nullable(attrType)}`) + nullables ||= (!a.required && !RESOURCE_COMMON_FIELDS.includes(a.name)) } } }) @@ -931,6 +939,7 @@ const templatedComponent = (res: string, name: string, cmp: Component): { compon } rels.push(`${r.name}${r.required ? '' : '?'}: ${r.required ? resName : nullable(resName)}`) + nullables ||= !r.required } }) @@ -946,8 +955,7 @@ const templatedComponent = (res: string, name: string, cmp: Component): { compon component = component.replace(/##__RESOURCE_MODEL_FIELDS__##/g, fieldsStr) component = component.replace(/##__RESOURCE_MODEL_RELATIONSHIPS__##/g, relsStr) - - return { component, models, enums } + return { component, models, enums, nullables } } diff --git a/gen/resources copy.json b/gen/resources copy.json deleted file mode 100644 index d6694bb..0000000 --- a/gen/resources copy.json +++ /dev/null @@ -1,130 +0,0 @@ -[ - { - "id": "api_credential", - "attributes": { - "fields": { - "mode": { - "sortable": true, - "filterable": true - } - }, - "relationships": { - "organization": { - "filterable": true - }, - "role": { - "filterable": true - } - } - } - }, - { - "id": "application_membership", - "attributes": { - "fields": {}, - "relationships": { - "api_credential": { - "filterable": true - }, - "membership": { - "filterable": true - }, - "organization": { - "filterable": true - }, - "role": { - "filterable": true - } - } - } - }, - { - "id": "membership", - "attributes": { - "fields": { - "status": { - "filterable": true - } - }, - "relationships": { - "organization": { - "filterable": true - }, - "role": { - "filterable": true - }, - "application_memberships": { - "filterable": true - } - } - } - }, - { - "id": "organization", - "attributes": { - "fields": {}, - "relationships": { - "memberships": { - "filterable": true - }, - "roles": { - "filterable": true - }, - "permissions": { - "filterable": true - }, - "api_credentials": { - "filterable": true - } - } - } - }, - { - "id": "permission", - "attributes": { - "fields": {}, - "relationships": { - "organization": { - "filterable": true - }, - "role": { - "filterable": true - } - } - } - }, - { - "id": "role", - "attributes": { - "fields": {}, - "relationships": { - "organization": { - "filterable": true - }, - "permissions": { - "filterable": true - }, - "memberships": { - "filterable": true - }, - "api_credentials": { - "filterable": true - } - } - } - }, - { - "id": "user", - "attributes": { - "fields": {}, - "relationships": {} - } - }, - { - "id": "version", - "attributes": { - "fields": {}, - "relationships": {} - } - } -] \ No newline at end of file diff --git a/gen/resources.json b/gen/resources.json index d6694bb..6ac26f1 100644 --- a/gen/resources.json +++ b/gen/resources.json @@ -1,130 +1,2364 @@ [ { "id": "api_credential", + "type": "resources", "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update", + "delete" + ], + "examples": {}, + "filter_scopes": [], "fields": { + "name": { + "type": "string", + "desc": "The API credential internal name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "My app" + }, + "kind": { + "type": "string", + "desc": "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.).", + "required": "required", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "sales_channel" + }, + "confidential": { + "type": "boolean", + "desc": "Indicates if the API credential it's confidential.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "true" + }, + "redirect_uri": { + "type": "string", + "desc": "The API credential redirect URI.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "https://bluebrand.com/img/logo.svg" + }, + "client_id": { + "type": "string", + "desc": "The API credential unique ID.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "xxxx-yyyy-zzzz" + }, + "client_secret": { + "type": "string", + "desc": "The API credential unique secret.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "xxxx-yyyy-zzzz" + }, + "scopes": { + "type": "string", + "desc": "The API credential scopes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "market:all market:9 market:122 market:6 stock_location:6 stock_location:33" + }, + "expires_in": { + "type": "integer", + "desc": "The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "7200" + }, "mode": { + "type": "string", + "desc": "Indicates the environment the resource belongs to (one of `test` or `live`).", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, "sortable": true, - "filterable": true + "example": "test" + }, + "custom": { + "type": "boolean", + "desc": "Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "false" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } } }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the API credential.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApiCredentialResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the API credential.", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApiCredentialResource", + "class_name": "Role" } - } + }, + "filters": [ + "id", + "name", + "kind", + "confidential", + "redirect_uri", + "client_id", + "scopes", + "expires_in", + "mode", + "custom", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "role_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "application_membership", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update", + "delete" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "filters": { + "type": "object", + "desc": "Set of key-value pairs that contains restrictions and scopes of the application membership.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "market_id_in": [ + 202, + 203 + ] + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "api_credential": { - "filterable": true + "type": "has_one", + "desc": "The API credential associated to the application membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "class_name": "ApiCredential", + "parent_resource": "V1::ApplicationMembershipResource" }, "membership": { - "filterable": true + "type": "has_one", + "desc": "The membership associated to the application membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApplicationMembershipResource", + "class_name": "Membership" }, "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApplicationMembershipResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the application membership.", + "required": "required", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::ApplicationMembershipResource", + "class_name": "Role" + } + }, + "filters": [ + "id", + "filters", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "api_credential_id", + "membership_id", + "organization_id", + "role_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] + } + }, + { + "id": "billing_profile", + "type": "resources", + "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "email": { + "type": "string", + "desc": "The billing profile email.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "commercelayer@commercelayer.io" + }, + "stripe_id": { + "type": "string", + "desc": "The Stripe identification of the billing profile.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "bp_62727272" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } } - } + }, + "relationships": { + "subscriptions": { + "type": "has_many", + "desc": "The subscriptions associated to the billing profile.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::BillingProfileResource", + "class_name": "Subscription" + }, + "user": { + "type": "has_one", + "desc": "The user associated to the billing profile.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::BillingProfileResource", + "class_name": "User" + } + }, + "filters": [ + "id", + "email", + "stripe_id", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "subscriptions_id", + "user_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "membership", + "type": "resources", "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update", + "delete" + ], + "examples": {}, + "filter_scopes": [], "fields": { + "user_email": { + "type": "string", + "desc": "The user email.", + "required": "required", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "commercelayer@commercelayer.io" + }, + "user_first_name": { + "type": "string", + "desc": "The user first name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "John" + }, + "user_last_name": { + "type": "string", + "desc": "The user last name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "Doe" + }, "status": { - "filterable": true + "type": "string", + "desc": "The memberships status. One of `pending` (default), `active`.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "pending", + "enum": [ + "pending", + "active" + ], + "aasm": true + }, + "owner": { + "type": "boolean", + "desc": "Indicates if the user it's the owner of the organization.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "true" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } } }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the membership.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::MembershipResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the membership.", + "required": "required", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::MembershipResource", + "class_name": "Role" }, "application_memberships": { - "filterable": true + "type": "has_many", + "desc": "The application memberships associated to the membership.", + "creatable": true, + "updatable": true, + "filterable": true, + "sortable": false, + "parent_resource": "V1::MembershipResource", + "class_name": "ApplicationMembership" + }, + "versions": { + "type": "has_many", + "desc": "The associated changes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "conditions": { + "include": "CoreMixins::Concerns::Versionable" + }, + "parent_resource": "V1::MembershipResource", + "class_name": "Version" } - } + }, + "filters": [ + "id", + "user_email", + "status", + "owner", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "role_id", + "application_memberships_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "organization", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "name": { + "type": "string", + "desc": "The organization's internal name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "The Blue Brand" + }, + "slug": { + "type": "string", + "desc": "The organization's slug name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "the-blue-brand" + }, + "domain": { + "type": "string", + "desc": "The organization's domain.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "the-blue-brand.commercelayer.io" + }, + "config": { + "type": "object", + "desc": "The organization's configuration.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "mfe": { + "default": { + "links": { + "cart": "https://cart.example.com/:order_id?accessToken=:access_token", + "checkout": "https://checkout.example.com/:order_id?accessToken=:accessToken", + "identity": "https://example.com/login", + "microstore": "https://example.com/microstore/?accessToken=:access_token", + "my_account": "https://example.com/my-custom-account?accessToken=:access_token" + }, + "checkout": { + "thankyou_page": "https://example.com/thanks/:lang/:orderId", + "billing_countries": [ + { + "value": "ES", + "label": "Espana" + }, + { + "value": "IT", + "label": "Italia" + }, + { + "value": "US", + "label": "Unites States of America" + } + ], + "shipping_countries": [ + { + "value": "ES", + "label": "Espana" + }, + { + "value": "IT", + "label": "Italia" + }, + { + "value": "US", + "label": "Unites States of America" + } + ], + "billing_states": { + "FR": [ + { + "value": "PA", + "label": "Paris" + }, + { + "value": "LY", + "label": "Lyon" + }, + { + "value": "NI", + "label": "Nice" + }, + { + "value": "MA", + "label": "Marseille" + }, + { + "value": "BO", + "label": "Bordeaux" + } + ] + }, + "shipping_states": { + "FR": [ + { + "value": "PA", + "label": "Paris" + }, + { + "value": "LY", + "label": "Lyon" + }, + { + "value": "NI", + "label": "Nice" + }, + { + "value": "MA", + "label": "Marseille" + }, + { + "value": "BO", + "label": "Bordeaux" + } + ] + }, + "default_country": "US" + }, + "urls": { + "privacy": "https://example.com/privacy/:lang", + "terms": "https://example.com/terms/:lang" + } + }, + "market:id:ZKcv13rT": { + "links": { + "cart": "https://example.com/custom-cart/:order_id?accessToken=:access_token" + }, + "checkout": { + "thankyou_page": "https://example.com/thanks/:order_id" + } + } + } + } + }, + "support_phone": { + "type": "string", + "desc": "The organization's support phone.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "+01 30800857" + }, + "support_email": { + "type": "string", + "desc": "The organization's support email.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "support@bluebrand.com" + }, + "logo_url": { + "type": "string", + "desc": "The URL to the organization's logo.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "https://bluebrand.com/img/logo.svg" + }, + "favicon_url": { + "type": "string", + "desc": "The URL to the organization's favicon.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "https://bluebrand.com/img/favicon.ico" + }, + "primary_color": { + "type": "string", + "desc": "The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "#C8984E" + }, + "contrast_color": { + "type": "string", + "desc": "The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "#FFFFCC" + }, + "gtm_id": { + "type": "string", + "desc": "The organization's Google Tag Manager ID.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "GTM-5FJXX6" + }, + "gtm_id_test": { + "type": "string", + "desc": "The organization's Google Tag Manager ID for test.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "GTM-5FJXX7" + }, + "discount_disabled": { + "type": "boolean", + "desc": "Indicates if organization has discount disabled.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "false" + }, + "account_disabled": { + "type": "boolean", + "desc": "Indicates if organization has account disabled.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "false" + }, + "acceptance_disabled": { + "type": "boolean", + "desc": "Indicates if organization has acceptance disabled.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": "tre", + "sortable": false, + "example": "false" + }, + "max_concurrent_promotions": { + "type": "integer", + "desc": "The maximum number of active concurrent promotions allowed for your organization.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "10" + }, + "max_concurrent_imports": { + "type": "integer", + "desc": "The maximum number of concurrent imports allowed for your organization.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "30" + }, + "region": { + "type": "string", + "desc": "The region where the organization it's located, default value it's `eu-west-1`.", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "eu-west-1" + }, + "can_switch_live": { + "type": "boolean", + "desc": "Indicates if the organization can switch to live mode.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "false" + }, + "subscription_info": { + "type": "object", + "desc": "Information about the current subscription such as the plan type, limits and subscription totals counter.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "plan_type": "growth", + "limits": { + "markets": 5, + "skus": 10000, + "organizations": 2, + "memberships": 5 + }, + "totals": { + "organizations": 1, + "markets": 0, + "memberships": 2, + "skus": 0 + } + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "memberships": { - "filterable": true + "type": "has_many", + "desc": "The memberships associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "Membership" }, "roles": { - "filterable": true + "type": "has_many", + "desc": "The roles associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "Role" }, "permissions": { - "filterable": true + "type": "has_many", + "desc": "The permissions associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "Permission" }, "api_credentials": { - "filterable": true + "type": "has_many", + "desc": "The API credentials associated to the organization.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::OrganizationResource", + "class_name": "ApiCredential" } - } + }, + "filters": [ + "id", + "name", + "slug", + "domain", + "support_phone", + "support_email", + "logo_url", + "favicon_url", + "primary_color", + "contrast_color", + "discount_disabled", + "account_disabled", + "acceptance_disabled", + "max_concurrent_promotions", + "max_concurrent_imports", + "region", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "memberships_id", + "roles_id", + "permissions_id", + "api_credentials_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "permission", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "can_create": { + "type": "boolean", + "desc": "Determines if the permission have access to create rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "can_read": { + "type": "boolean", + "desc": "Determines if the permission have access to read rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "can_update": { + "type": "boolean", + "desc": "Determines if the permission have access to update rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "can_destroy": { + "type": "boolean", + "desc": "Determines if the permission have access to destroy rights.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "subject": { + "type": "string", + "desc": "The resource where this permission is applied.", + "required": "required", + "creatable": true, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "restrictions": { + "type": "object", + "desc": "An object that contains additional restrictions.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the permission.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::PermissionResource", + "class_name": "Organization" }, "role": { - "filterable": true + "type": "has_one", + "desc": "The role associated to the permission.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::PermissionResource", + "class_name": "Role" + }, + "versions": { + "type": "has_many", + "desc": "The associated changes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "conditions": { + "include": "CoreMixins::Concerns::Versionable" + }, + "parent_resource": "V1::PermissionResource", + "class_name": "Version" } - } + }, + "filters": [ + "id", + "can_create", + "can_read", + "can_update", + "can_destroy", + "subject", + "restrictions", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "role_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] + } + }, + { + "id": "plan", + "type": "resources", + "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "list", + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "enterprise": { + "type": "boolean", + "desc": "Indicates if the plan it's an enterprise one.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false + }, + "price_cents": { + "type": "integer", + "desc": "Indicates the plan price, in cents.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "5000" + }, + "currency_code": { + "type": "string", + "desc": "The currency used in the `price_cents` field.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "USD" + }, + "extra": { + "type": "object", + "desc": "An object that contains additional specifications.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "foo": "bar" + } + }, + "name": { + "type": "string", + "desc": "The plan name.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "Developer" + }, + "limits": { + "type": "object", + "desc": "The limits associated to the plan.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "markets": 5, + "skus": 10000, + "organizations": 2, + "memberships": 5 + } + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, + "relationships": {}, + "filters": [ + "id", + "enterprise", + "price_cents", + "currency_code", + "name", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "role", + "type": "resources", "attributes": { - "fields": {}, + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "name": { + "type": "string", + "desc": "The role name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "Custom role" + }, + "kind": { + "type": "string", + "desc": "The kind of role, one of: `custom`, `admin`, `read_only`", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "default": "custom", + "example": "custom" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, "relationships": { "organization": { - "filterable": true + "type": "has_one", + "desc": "The organization associated to the role.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "Organization" }, "permissions": { - "filterable": true + "type": "has_many", + "desc": "The permissions associated to the role.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "Permission" }, "memberships": { - "filterable": true + "type": "has_many", + "desc": "The memberships associated to the role.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "Membership" }, "api_credentials": { - "filterable": true + "type": "has_many", + "desc": "The API credentials associated to the role.", + "creatable": false, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::RoleResource", + "class_name": "ApiCredential" + }, + "versions": { + "type": "has_many", + "desc": "The associated changes.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "conditions": { + "include": "CoreMixins::Concerns::Versionable" + }, + "parent_resource": "V1::RoleResource", + "class_name": "Version" + } + }, + "filters": [ + "id", + "name", + "kind", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "organization_id", + "permissions_id", + "memberships_id", + "api_credentials_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] + } + }, + { + "id": "subscription", + "type": "resources", + "attributes": { + "singleton": false, + "deprecated": false, + "actions": [ + "create", + "list", + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "plan_type": { + "type": "string", + "desc": "The plan type associated to this subscription.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "developer" + }, + "status": { + "type": "string", + "desc": "The subscription status. One of `draft` (default), `pending`, `activated`, `expired`, `canceled` or `on_error`.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "pending", + "enum": [ + "draft", + "pending", + "activated", + "expired", + "canceled", + "on_error" + ], + "aasm": true + }, + "stripe_id": { + "type": "string", + "desc": "The Stripe identifier of the subscription.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "sub_097542425" + }, + "totals": { + "type": "object", + "desc": "The number of current organizations, markets, memberships, and SKUs associated with the subscription.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": { + "organizations": 1, + "markets": 0, + "memberships": 0, + "skus": 0 + } + }, + "cancellable": { + "type": "boolean", + "desc": "Indicates if the subscription can be cancelled.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "true" + }, + "account_type": { + "type": "string", + "desc": "Indicates the billing context associated to the subscription.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "inc" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } } - } + }, + "relationships": { + "plan": { + "type": "has_one", + "desc": "The plan associated to the subscription.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::SubscriptionResource", + "class_name": "Plan" + }, + "billing_profile": { + "type": "has_one", + "desc": "The billing profile associated to the subscription.", + "required": "required", + "creatable": true, + "updatable": false, + "filterable": true, + "sortable": false, + "parent_resource": "V1::SubscriptionResource", + "class_name": "BillingProfile" + } + }, + "filters": [ + "id", + "plan_type", + "status", + "stripe_id", + "cancellable", + "account_type", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "plan_id", + "billing_profile_id", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "user", + "type": "resources", "attributes": { - "fields": {}, - "relationships": {} + "singleton": true, + "deprecated": false, + "actions": [ + "retrieve", + "update" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "email": { + "type": "string", + "desc": "The user email.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "user@commercelayer.io" + }, + "first_name": { + "type": "string", + "desc": "The user first name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "John" + }, + "last_name": { + "type": "string", + "desc": "The user last name.", + "required": "required", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "Doe" + }, + "time_zone": { + "type": "string", + "desc": "The user preferred timezone.", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "UTC" + }, + "otp_required_for_login": { + "type": "boolean", + "desc": "The user 2FA setting.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": true + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, + "relationships": {}, + "filters": [ + "id", + "email", + "first_name", + "last_name", + "time_zone", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } }, { "id": "version", + "type": "resources", "attributes": { - "fields": {}, - "relationships": {} + "singleton": false, + "deprecated": false, + "actions": [ + "list", + "retrieve" + ], + "examples": {}, + "filter_scopes": [], + "fields": { + "item_type": { + "type": "string", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "deprecated": true + }, + "resource_type": { + "type": "string", + "desc": "The type of the versioned resource.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "roles" + }, + "resource_id": { + "type": "string", + "desc": "The versioned resource ID.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": "PzdJhdLdYV" + }, + "event": { + "type": "string", + "desc": "The event which generates the version.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "update" + }, + "ip_address": { + "type": "string", + "desc": "The request remote IP.", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "example": "127.0.0.1" + }, + "user_agent": { + "type": "string", + "desc": "The request User Agent.", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "example": "Chrome/108.0.0.0 Safari/537.36" + }, + "uuid": { + "type": "string", + "desc": "The request ID.", + "creatable": false, + "updatable": false, + "fetchable": false, + "filterable": false, + "sortable": false, + "example": "2284362d2b024dc8a8736770ab2a7050bd35487c" + }, + "changes": { + "type": "object", + "desc": "The object changes payload.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "{ \"name\": [\"previous\", \"new\"] }" + }, + "who": { + "type": "object", + "desc": "Information about who triggered the change, only showed when it's from a JWT token.", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": false, + "sortable": false, + "example": "{ \"application\": { \"id\": \"DNOPYiZYpn\", \"kind\": \"integration\", \"public\": true }}" + }, + "id": { + "format": "id", + "type": "string", + "desc": "Unique identifier for the resource (hash).", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "XAyRWNUzyN" + }, + "created_at": { + "type": "datetime", + "desc": "Time at which the resource was created.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "datetime", + "desc": "Time at which the resource was last updated.", + "required": "required", + "creatable": false, + "updatable": false, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "2018-01-01T12:00:00.000Z" + }, + "reference": { + "type": "string", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE" + }, + "reference_origin": { + "type": "string", + "desc": "Any identifier of the third party system that defines the reference code.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": true, + "example": "ANY-EXTERNAL-REFEFERNCE-ORIGIN" + }, + "metadata": { + "type": "object", + "desc": "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.", + "required": "optional", + "creatable": true, + "updatable": true, + "fetchable": true, + "filterable": true, + "sortable": false, + "example": { + "foo": "bar" + } + } + }, + "relationships": {}, + "filters": [ + "id", + "resource_type", + "resource_id", + "created_at", + "updated_at", + "reference", + "reference_origin", + "metadata", + "q", + "ids", + "created_at_from", + "created_at_to", + "updated_at_from", + "updated_at_to" + ] } } ] \ No newline at end of file diff --git a/gen/resources.ts b/gen/resources.ts index 7669bfe..434792d 100644 --- a/gen/resources.ts +++ b/gen/resources.ts @@ -3,7 +3,7 @@ import { resolve } from "node:path" const RESOURCES_LOCAL_PATH = resolve('./gen/resources.json') -const RESOURCES_REMOTE_URL = 'https://core.commercelayer.io/api/public/resources' +const RESOURCES_REMOTE_URL = 'https://provisioning.commercelayer.io/api/public/resources'// 'https://provisioning.commercelayer.co/api/public/resources' const downloadResources = async (url?: string): Promise => { diff --git a/gen/schema.ts b/gen/schema.ts index b3908c7..0e2bead 100644 --- a/gen/schema.ts +++ b/gen/schema.ts @@ -277,7 +277,7 @@ const parseComponents = (schemaComponents: any[]): ComponentMap => { // Attributes Object.entries(cmpAttributes.properties as object).forEach(a => { const [aKey, aValue] = a - const fetchable = (aValue.nullable !== undefined) + const fetchable = (aValue.nullable !== undefined) || aValue.readOnly attributes[aKey] = { name: aKey, type: (aValue.type === 'array') ? `${aValue.items.type}[]` : aValue.type, diff --git a/gen/templates/create.tpl b/gen/templates/create.tpl index f6865b6..75530b3 100644 --- a/gen/templates/create.tpl +++ b/gen/templates/create.tpl @@ -1,3 +1,3 @@ -async create(resource: ##__RESOURCE_REQUEST_CLASS__##, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { +async create(resource: ##__RESOURCE_REQUEST_CLASS__##, params?: QueryParamsRetrieve<##__RESOURCE_RESPONSE_CLASS__##>, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { return this.resources.create<##__RESOURCE_REQUEST_CLASS__##, ##__RESOURCE_RESPONSE_CLASS__##>({ ...resource, type: ##__RESOURCE_CLASS__##.TYPE }, params, options) } \ No newline at end of file diff --git a/gen/templates/list.tpl b/gen/templates/list.tpl index 666b1c7..bfe04e2 100644 --- a/gen/templates/list.tpl +++ b/gen/templates/list.tpl @@ -1,3 +1,3 @@ -async list(params?: QueryParamsList, options?: ResourcesConfig): Promise> { +async list(params?: QueryParamsList<##__RESOURCE_RESPONSE_CLASS__##>, options?: ResourcesConfig): Promise> { return this.resources.list<##__RESOURCE_RESPONSE_CLASS__##>({ type: ##__RESOURCE_CLASS__##.TYPE }, params, options) } \ No newline at end of file diff --git a/gen/templates/retrieve.tpl b/gen/templates/retrieve.tpl index 98f6717..561d77a 100644 --- a/gen/templates/retrieve.tpl +++ b/gen/templates/retrieve.tpl @@ -1,3 +1,3 @@ -async retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { +async retrieve(id: string, params?: QueryParamsRetrieve<##__RESOURCE_RESPONSE_CLASS__##>, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { return this.resources.retrieve<##__RESOURCE_RESPONSE_CLASS__##>({ type: ##__RESOURCE_CLASS__##.TYPE, id }, params, options) } \ No newline at end of file diff --git a/gen/templates/singleton.tpl b/gen/templates/singleton.tpl index 574eca7..6449aaf 100644 --- a/gen/templates/singleton.tpl +++ b/gen/templates/singleton.tpl @@ -1,3 +1,3 @@ -async retrieve(params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { +async retrieve(params?: QueryParamsRetrieve<##__RESOURCE_RESPONSE_CLASS__##>, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { return this.resources.retrieve<##__RESOURCE_RESPONSE_CLASS__##>({ type: ##__RESOURCE_CLASS__##.TYPE }, params, options) } \ No newline at end of file diff --git a/gen/templates/singleton_update.tpl b/gen/templates/singleton_update.tpl index b835dd8..f75219e 100644 --- a/gen/templates/singleton_update.tpl +++ b/gen/templates/singleton_update.tpl @@ -1,4 +1,4 @@ -async update(resource: ##__RESOURCE_REQUEST_CLASS__##, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { +async update(resource: ##__RESOURCE_REQUEST_CLASS__##, params?: QueryParamsRetrieve<##__RESOURCE_RESPONSE_CLASS__##>, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { const res = await this.retrieve(params, options) // JsonAPI requires id in the request body return this.resources.update<##__RESOURCE_REQUEST_CLASS__##, ##__RESOURCE_RESPONSE_CLASS__##>({ ...resource, id: res.id, type: ##__RESOURCE_CLASS__##.TYPE }, params, options) } \ No newline at end of file diff --git a/gen/templates/update.tpl b/gen/templates/update.tpl index 66111db..f2182ef 100644 --- a/gen/templates/update.tpl +++ b/gen/templates/update.tpl @@ -1,3 +1,3 @@ -async update(resource: ##__RESOURCE_REQUEST_CLASS__##, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { +async update(resource: ##__RESOURCE_REQUEST_CLASS__##, params?: QueryParamsRetrieve<##__RESOURCE_RESPONSE_CLASS__##>, options?: ResourcesConfig): Promise<##__RESOURCE_RESPONSE_CLASS__##> { return this.resources.update<##__RESOURCE_REQUEST_CLASS__##, ##__RESOURCE_RESPONSE_CLASS__##>({ ...resource, type: ##__RESOURCE_CLASS__##.TYPE }, params, options) } \ No newline at end of file diff --git a/package.json b/package.json index c866162..e77d657 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@commercelayer/provisioning-sdk", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.17", "main": "lib/index.js", "types": "lib/index.d.ts", "module": "lib/index.mjs", @@ -42,17 +42,17 @@ "@semantic-release/git": "^10.0.1", "@types/debug": "^4.1.12", "@types/jest": "^29.5.12", - "@types/node": "^20.12.4", + "@types/node": "^20.12.7", "dotenv": "^16.4.5", "eslint": "^8.57.0", "jest": "^29.7.0", "json-typescript": "^1.1.2", "jsonapi-typescript": "^0.1.3", "lodash.isequal": "^4.5.0", - "semantic-release": "^23.0.7", + "semantic-release": "^23.0.8", "tsup": "^8.0.2", "tsx": "^4.7.2", - "typescript": "^5.4.3" + "typescript": "^5.4.5" }, "repository": "github:commercelayer/provisioning-sdk", "bugs": "https://github.com/commercelayer/provisioning-sdk/issues", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 445fb20..b11e854 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,16 +16,16 @@ devDependencies: version: 7.24.1(@babel/core@7.24.4) '@commercelayer/eslint-config-ts': specifier: 1.4.5 - version: 1.4.5(eslint@8.57.0)(typescript@5.4.3) + version: 1.4.5(eslint@8.57.0)(typescript@5.4.5) '@commercelayer/js-auth': specifier: ^6.0.0 version: 6.0.0 '@semantic-release/changelog': specifier: ^6.0.3 - version: 6.0.3(semantic-release@23.0.7) + version: 6.0.3(semantic-release@23.0.8) '@semantic-release/git': specifier: ^10.0.1 - version: 10.0.1(semantic-release@23.0.7) + version: 10.0.1(semantic-release@23.0.8) '@types/debug': specifier: ^4.1.12 version: 4.1.12 @@ -33,8 +33,8 @@ devDependencies: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^20.12.4 - version: 20.12.4 + specifier: ^20.12.7 + version: 20.12.7 dotenv: specifier: ^16.4.5 version: 16.4.5 @@ -43,7 +43,7 @@ devDependencies: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.12.4) + version: 29.7.0(@types/node@20.12.7) json-typescript: specifier: ^1.1.2 version: 1.1.2 @@ -54,17 +54,17 @@ devDependencies: specifier: ^4.5.0 version: 4.5.0 semantic-release: - specifier: ^23.0.7 - version: 23.0.7(typescript@5.4.3) + specifier: ^23.0.8 + version: 23.0.8(typescript@5.4.5) tsup: specifier: ^8.0.2 - version: 8.0.2(typescript@5.4.3) + version: 8.0.2(typescript@5.4.5) tsx: specifier: ^4.7.2 version: 4.7.2 typescript: - specifier: ^5.4.3 - version: 5.4.3 + specifier: ^5.4.5 + version: 5.4.5 packages: @@ -1325,23 +1325,23 @@ packages: dev: true optional: true - /@commercelayer/eslint-config-ts@1.4.5(eslint@8.57.0)(typescript@5.4.3): + /@commercelayer/eslint-config-ts@1.4.5(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-5YqhT5f7V1vs+HTcNwMLXOzo8P1NrRJaJmMF3E/bk1eJDNLIQFVnDX5Z/B4BFcC9GrCOBjuYERYpC6QVnVWEnQ==} peerDependencies: eslint: '>=8.0' typescript: '>=5.0' dependencies: - '@typescript-eslint/eslint-plugin': 7.5.0(@typescript-eslint/parser@7.5.0)(eslint@8.57.0)(typescript@5.4.3) - '@typescript-eslint/parser': 7.5.0(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 - eslint-config-love: 43.1.0(@typescript-eslint/eslint-plugin@7.5.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.57.0)(typescript@5.4.3) + eslint-config-love: 43.1.0(@typescript-eslint/eslint-plugin@7.6.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.57.0)(typescript@5.4.5) eslint-config-prettier: 9.1.0(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.5.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.6.0)(eslint@8.57.0) eslint-plugin-n: 16.6.2(eslint@8.57.0) eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) eslint-plugin-promise: 6.1.1(eslint@8.57.0) prettier: 3.2.5 - typescript: 5.4.3 + typescript: 5.4.5 transitivePeerDependencies: - '@types/eslint' - eslint-import-resolver-typescript @@ -1651,7 +1651,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 @@ -1672,14 +1672,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.12.4) + jest-config: 29.7.0(@types/node@20.12.7) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -1707,7 +1707,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 jest-mock: 29.7.0 dev: true @@ -1734,7 +1734,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.12.4 + '@types/node': 20.12.7 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -1767,7 +1767,7 @@ packages: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.12.4 + '@types/node': 20.12.7 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -1855,7 +1855,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.4 + '@types/node': 20.12.7 '@types/yargs': 17.0.32 chalk: 4.1.2 dev: true @@ -1916,15 +1916,15 @@ packages: engines: {node: '>= 18'} dev: true - /@octokit/core@6.1.1: - resolution: {integrity: sha512-uVypPdnZV7YoEa69Ky2kTSw3neFLGT0PZ54OwUMDph7w6TmhF0ZnoVcvb/kYnjDHCFo2mfoeRDYifLKhLNasUg==} + /@octokit/core@6.1.2: + resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} engines: {node: '>= 18'} dependencies: '@octokit/auth-token': 5.1.0 '@octokit/graphql': 8.1.0 - '@octokit/request': 9.0.1 + '@octokit/request': 9.1.0 '@octokit/request-error': 6.1.0 - '@octokit/types': 13.0.0 + '@octokit/types': 13.4.0 before-after-hook: 3.0.2 universal-user-agent: 7.0.2 dev: true @@ -1933,7 +1933,7 @@ packages: resolution: {integrity: sha512-ogZ5uLMeGBZUzS32fNt9j+dNw3kkEn5CSw4CVkN1EvCNdFYWrQ5diQR6Hh52VrPR0oayIoYTqQFL/l8RqkV0qw==} engines: {node: '>= 18'} dependencies: - '@octokit/types': 13.0.0 + '@octokit/types': 13.4.0 universal-user-agent: 7.0.2 dev: true @@ -1941,49 +1941,45 @@ packages: resolution: {integrity: sha512-XDvj6GcUnQYgbCLXElt3vZDzNIPGvGiwxQO2XzsvfVUjebGh0E5eCD/1My9zUGSNKaGVZitVuO8LMziGmoFryg==} engines: {node: '>= 18'} dependencies: - '@octokit/request': 9.0.1 - '@octokit/types': 13.0.0 + '@octokit/request': 9.1.0 + '@octokit/types': 13.4.0 universal-user-agent: 7.0.2 dev: true - /@octokit/openapi-types@20.0.0: - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} + /@octokit/openapi-types@22.0.1: + resolution: {integrity: sha512-1yN5m1IMNXthoBDUXFF97N1gHop04B3H8ws7wtOr8GgRyDO1gKALjwMHARNBoMBiB/2vEe/vxstrApcJZzQbnQ==} dev: true - /@octokit/openapi-types@21.2.0: - resolution: {integrity: sha512-xx+Xd6I7rYvul/hgUDqv6TeGX0IOGnhSg9IOeYgd/uI7IAqUy6DE2B6Ipv2M4mWoxaMcWjIzgTIcv8pMO3F3vw==} - dev: true - - /@octokit/plugin-paginate-rest@10.0.0(@octokit/core@6.1.1): - resolution: {integrity: sha512-G1Z67qOiFneKDJyMafHQkWnKm1kU3FfbRZLzxgsFg4dOa3pRNdABbdk+xo/oev6P88lnbt7GKdBNB6dJZuPphA==} + /@octokit/plugin-paginate-rest@11.1.0(@octokit/core@6.1.2): + resolution: {integrity: sha512-VyWrvJUivEv2pKmHLBLtLX2vDbGfMiLrxSZE7vV2NAO1VsCWFIVVj7xodkOr7zOfsEkzTvF1Koi7Rsg6KvSc2A==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=6' dependencies: - '@octokit/core': 6.1.1 - '@octokit/types': 12.6.0 + '@octokit/core': 6.1.2 + '@octokit/types': 13.4.0 dev: true - /@octokit/plugin-retry@7.1.0(@octokit/core@6.1.1): + /@octokit/plugin-retry@7.1.0(@octokit/core@6.1.2): resolution: {integrity: sha512-6mc4xNtT6eoDBGrJJn0sFALUmIba2f7Wx+G8XV9GkBLcyX5PogBdx2mDMW5yPPqSD/y23tYagkjOLX9sT7O6jA==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': '>=6' dependencies: - '@octokit/core': 6.1.1 + '@octokit/core': 6.1.2 '@octokit/request-error': 6.1.0 - '@octokit/types': 13.0.0 + '@octokit/types': 13.4.0 bottleneck: 2.19.5 dev: true - /@octokit/plugin-throttling@9.1.0(@octokit/core@6.1.1): + /@octokit/plugin-throttling@9.1.0(@octokit/core@6.1.2): resolution: {integrity: sha512-16lDMMhChavhvXKr2zRK7sD+hTpuVm697xZNf1a0C/MFRZU8CFkrNJEYX7Fqo2dc44lISp7V5Vm0sgJIx2bRkw==} engines: {node: '>= 18'} peerDependencies: '@octokit/core': ^6.0.0 dependencies: - '@octokit/core': 6.1.1 - '@octokit/types': 13.0.0 + '@octokit/core': 6.1.2 + '@octokit/types': 13.4.0 bottleneck: 2.19.5 dev: true @@ -1991,29 +1987,23 @@ packages: resolution: {integrity: sha512-xcLJv4IgfWIOEEVZwfhUN3yHNWJL0AMw1J1Ba8BofM9RdDTbapg6MO4zNxlPS4XXX9aAIsbDRa47K57EhgeVAw==} engines: {node: '>= 18'} dependencies: - '@octokit/types': 13.0.0 + '@octokit/types': 13.4.0 dev: true - /@octokit/request@9.0.1: - resolution: {integrity: sha512-kL+cAcbSl3dctYLuJmLfx6Iku2MXXy0jszhaEIjQNaCp4zjHXrhVAHeuaRdNvJjW9qjl3u1MJ72+OuBP0YW/pg==} + /@octokit/request@9.1.0: + resolution: {integrity: sha512-1mDzqKSiryRKZM++MhO6WQBukWbikes6AN6UTxB5vpRnNUbPDkVfUhpSvZ3aXYEFnbcV8DZkikOnCr3pdgMD3Q==} engines: {node: '>= 18'} dependencies: '@octokit/endpoint': 10.1.0 '@octokit/request-error': 6.1.0 - '@octokit/types': 12.6.0 + '@octokit/types': 13.4.0 universal-user-agent: 7.0.2 dev: true - /@octokit/types@12.6.0: - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - dependencies: - '@octokit/openapi-types': 20.0.0 - dev: true - - /@octokit/types@13.0.0: - resolution: {integrity: sha512-jSOgEoFZvjg78txlb7cuRTAEvyyQkIEB4Nujg5ZN7E1xaICsr8A0X045Nwb1wUWNrBUHBHZNtcsDIhk8d8ipCw==} + /@octokit/types@13.4.0: + resolution: {integrity: sha512-WlMegy3lPXYWASe3k9Jslc5a0anrYAYMWtsFrxBTdQjS70hvLH6C+PGvHbOsgy3RA3LouGJoU/vAt4KarecQLQ==} dependencies: - '@octokit/openapi-types': 21.2.0 + '@octokit/openapi-types': 22.0.1 dev: true /@pkgjs/parseargs@0.11.0: @@ -2049,127 +2039,127 @@ packages: config-chain: 1.1.13 dev: true - /@rollup/rollup-android-arm-eabi@4.14.0: - resolution: {integrity: sha512-jwXtxYbRt1V+CdQSy6Z+uZti7JF5irRKF8hlKfEnF/xJpcNGuuiZMBvuoYM+x9sr9iWGnzrlM0+9hvQ1kgkf1w==} + /@rollup/rollup-android-arm-eabi@4.14.2: + resolution: {integrity: sha512-ahxSgCkAEk+P/AVO0vYr7DxOD3CwAQrT0Go9BJyGQ9Ef0QxVOfjDZMiF4Y2s3mLyPrjonchIMH/tbWHucJMykQ==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.14.0: - resolution: {integrity: sha512-fI9nduZhCccjzlsA/OuAwtFGWocxA4gqXGTLvOyiF8d+8o0fZUeSztixkYjcGq1fGZY3Tkq4yRvHPFxU+jdZ9Q==} + /@rollup/rollup-android-arm64@4.14.2: + resolution: {integrity: sha512-lAarIdxZWbFSHFSDao9+I/F5jDaKyCqAPMq5HqnfpBw8dKDiCaaqM0lq5h1pQTLeIqueeay4PieGR5jGZMWprw==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.14.0: - resolution: {integrity: sha512-BcnSPRM76/cD2gQC+rQNGBN6GStBs2pl/FpweW8JYuz5J/IEa0Fr4AtrPv766DB/6b2MZ/AfSIOSGw3nEIP8SA==} + /@rollup/rollup-darwin-arm64@4.14.2: + resolution: {integrity: sha512-SWsr8zEUk82KSqquIMgZEg2GE5mCSfr9sE/thDROkX6pb3QQWPp8Vw8zOq2GyxZ2t0XoSIUlvHDkrf5Gmf7x3Q==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.14.0: - resolution: {integrity: sha512-LDyFB9GRolGN7XI6955aFeI3wCdCUszFWumWU0deHA8VpR3nWRrjG6GtGjBrQxQKFevnUTHKCfPR4IvrW3kCgQ==} + /@rollup/rollup-darwin-x64@4.14.2: + resolution: {integrity: sha512-o/HAIrQq0jIxJAhgtIvV5FWviYK4WB0WwV91SLUnsliw1lSAoLsmgEEgRWzDguAFeUEUUoIWXiJrPqU7vGiVkA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.14.0: - resolution: {integrity: sha512-ygrGVhQP47mRh0AAD0zl6QqCbNsf0eTo+vgwkY6LunBcg0f2Jv365GXlDUECIyoXp1kKwL5WW6rsO429DBY/bA==} + /@rollup/rollup-linux-arm-gnueabihf@4.14.2: + resolution: {integrity: sha512-nwlJ65UY9eGq91cBi6VyDfArUJSKOYt5dJQBq8xyLhvS23qO+4Nr/RreibFHjP6t+5ap2ohZrUJcHv5zk5ju/g==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.14.0: - resolution: {integrity: sha512-x+uJ6MAYRlHGe9wi4HQjxpaKHPM3d3JjqqCkeC5gpnnI6OWovLdXTpfa8trjxPLnWKyBsSi5kne+146GAxFt4A==} + /@rollup/rollup-linux-arm64-gnu@4.14.2: + resolution: {integrity: sha512-Pg5TxxO2IVlMj79+c/9G0LREC9SY3HM+pfAwX7zj5/cAuwrbfj2Wv9JbMHIdPCfQpYsI4g9mE+2Bw/3aeSs2rQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.14.0: - resolution: {integrity: sha512-nrRw8ZTQKg6+Lttwqo6a2VxR9tOroa2m91XbdQ2sUUzHoedXlsyvY1fN4xWdqz8PKmf4orDwejxXHjh7YBGUCA==} + /@rollup/rollup-linux-arm64-musl@4.14.2: + resolution: {integrity: sha512-cAOTjGNm84gc6tS02D1EXtG7tDRsVSDTBVXOLbj31DkwfZwgTPYZ6aafSU7rD/4R2a34JOwlF9fQayuTSkoclA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-powerpc64le-gnu@4.14.0: - resolution: {integrity: sha512-xV0d5jDb4aFu84XKr+lcUJ9y3qpIWhttO3Qev97z8DKLXR62LC3cXT/bMZXrjLF9X+P5oSmJTzAhqwUbY96PnA==} - cpu: [ppc64le] + /@rollup/rollup-linux-powerpc64le-gnu@4.14.2: + resolution: {integrity: sha512-4RyT6v1kXb7C0fn6zV33rvaX05P0zHoNzaXI/5oFHklfKm602j+N4mn2YvoezQViRLPnxP8M1NaY4s/5kXO5cw==} + cpu: [ppc64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.14.0: - resolution: {integrity: sha512-SDDhBQwZX6LPRoPYjAZWyL27LbcBo7WdBFWJi5PI9RPCzU8ijzkQn7tt8NXiXRiFMJCVpkuMkBf4OxSxVMizAw==} + /@rollup/rollup-linux-riscv64-gnu@4.14.2: + resolution: {integrity: sha512-KNUH6jC/vRGAKSorySTyc/yRYlCwN/5pnMjXylfBniwtJx5O7X17KG/0efj8XM3TZU7raYRXJFFReOzNmL1n1w==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-s390x-gnu@4.14.0: - resolution: {integrity: sha512-RxB/qez8zIDshNJDufYlTT0ZTVut5eCpAZ3bdXDU9yTxBzui3KhbGjROK2OYTTor7alM7XBhssgoO3CZ0XD3qA==} + /@rollup/rollup-linux-s390x-gnu@4.14.2: + resolution: {integrity: sha512-xPV4y73IBEXToNPa3h5lbgXOi/v0NcvKxU0xejiFw6DtIYQqOTMhZ2DN18/HrrP0PmiL3rGtRG9gz1QE8vFKXQ==} cpu: [s390x] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.14.0: - resolution: {integrity: sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg==} + /@rollup/rollup-linux-x64-gnu@4.14.2: + resolution: {integrity: sha512-QBhtr07iFGmF9egrPOWyO5wciwgtzKkYPNLVCFZTmr4TWmY0oY2Dm/bmhHjKRwZoGiaKdNcKhFtUMBKvlchH+Q==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.14.0: - resolution: {integrity: sha512-i0QwbHYfnOMYsBEyjxcwGu5SMIi9sImDVjDg087hpzXqhBSosxkE7gyIYFHgfFl4mr7RrXksIBZ4DoLoP4FhJg==} + /@rollup/rollup-linux-x64-musl@4.14.2: + resolution: {integrity: sha512-8zfsQRQGH23O6qazZSFY5jP5gt4cFvRuKTpuBsC1ZnSWxV8ZKQpPqOZIUtdfMOugCcBvFGRa1pDC/tkf19EgBw==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.14.0: - resolution: {integrity: sha512-Fq52EYb0riNHLBTAcL0cun+rRwyZ10S9vKzhGKKgeD+XbwunszSY0rVMco5KbOsTlwovP2rTOkiII/fQ4ih/zQ==} + /@rollup/rollup-win32-arm64-msvc@4.14.2: + resolution: {integrity: sha512-H4s8UjgkPnlChl6JF5empNvFHp77Jx+Wfy2EtmYPe9G22XV+PMuCinZVHurNe8ggtwoaohxARJZbaH/3xjB/FA==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.14.0: - resolution: {integrity: sha512-e/PBHxPdJ00O9p5Ui43+vixSgVf4NlLsmV6QneGERJ3lnjIua/kim6PRFe3iDueT1rQcgSkYP8ZBBXa/h4iPvw==} + /@rollup/rollup-win32-ia32-msvc@4.14.2: + resolution: {integrity: sha512-djqpAjm/i8erWYF0K6UY4kRO3X5+T4TypIqw60Q8MTqSBaQNpNXDhxdjpZ3ikgb+wn99svA7jxcXpiyg9MUsdw==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.14.0: - resolution: {integrity: sha512-aGg7iToJjdklmxlUlJh/PaPNa4PmqHfyRMLunbL3eaMO0gp656+q1zOKkpJ/CVe9CryJv6tAN1HDoR8cNGzkag==} + /@rollup/rollup-win32-x64-msvc@4.14.2: + resolution: {integrity: sha512-teAqzLT0yTYZa8ZP7zhFKEx4cotS8Tkk5XiqNMJhD4CpaWB1BHARE4Qy+RzwnXvSAYv+Q3jAqCVBS+PS+Yee8Q==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /@semantic-release/changelog@6.0.3(semantic-release@23.0.7): + /@semantic-release/changelog@6.0.3(semantic-release@23.0.8): resolution: {integrity: sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==} engines: {node: '>=14.17'} peerDependencies: @@ -2179,10 +2169,10 @@ packages: aggregate-error: 3.1.0 fs-extra: 11.2.0 lodash: 4.17.21 - semantic-release: 23.0.7(typescript@5.4.3) + semantic-release: 23.0.8(typescript@5.4.5) dev: true - /@semantic-release/commit-analyzer@12.0.0(semantic-release@23.0.7): + /@semantic-release/commit-analyzer@12.0.0(semantic-release@23.0.8): resolution: {integrity: sha512-qG+md5gdes+xa8zP7lIo1fWE17zRdO8yMCaxh9lyL65TQleoSv8WHHOqRURfghTytUh+NpkSyBprQ5hrkxOKVQ==} engines: {node: '>=20.8.1'} peerDependencies: @@ -2195,7 +2185,7 @@ packages: import-from-esm: 1.3.3 lodash-es: 4.17.21 micromatch: 4.0.5 - semantic-release: 23.0.7(typescript@5.4.3) + semantic-release: 23.0.8(typescript@5.4.5) transitivePeerDependencies: - supports-color dev: true @@ -2210,7 +2200,7 @@ packages: engines: {node: '>=18'} dev: true - /@semantic-release/git@10.0.1(semantic-release@23.0.7): + /@semantic-release/git@10.0.1(semantic-release@23.0.8): resolution: {integrity: sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==} engines: {node: '>=14.17'} peerDependencies: @@ -2224,21 +2214,21 @@ packages: lodash: 4.17.21 micromatch: 4.0.5 p-reduce: 2.1.0 - semantic-release: 23.0.7(typescript@5.4.3) + semantic-release: 23.0.8(typescript@5.4.5) transitivePeerDependencies: - supports-color dev: true - /@semantic-release/github@10.0.2(semantic-release@23.0.7): - resolution: {integrity: sha512-SP5ihhv/uQa8vPuWKmbJrrzfv8lRUkDFC6qwgaWoorrflN1DEW0IGCa9w/PxUp8Ad3dbvXZPmpXdGiP3eyTzhg==} + /@semantic-release/github@10.0.3(semantic-release@23.0.8): + resolution: {integrity: sha512-nSJQboKrG4xBn7hHpRMrK8lt5DgqJg50ZMz9UbrsfTxuRk55XVoQEadbGZ2L9M0xZAC6hkuwkDhQJKqfPU35Fw==} engines: {node: '>=20.8.1'} peerDependencies: semantic-release: '>=20.1.0' dependencies: - '@octokit/core': 6.1.1 - '@octokit/plugin-paginate-rest': 10.0.0(@octokit/core@6.1.1) - '@octokit/plugin-retry': 7.1.0(@octokit/core@6.1.1) - '@octokit/plugin-throttling': 9.1.0(@octokit/core@6.1.1) + '@octokit/core': 6.1.2 + '@octokit/plugin-paginate-rest': 11.1.0(@octokit/core@6.1.2) + '@octokit/plugin-retry': 7.1.0(@octokit/core@6.1.2) + '@octokit/plugin-throttling': 9.1.0(@octokit/core@6.1.2) '@semantic-release/error': 4.0.0 aggregate-error: 5.0.0 debug: 4.3.4 @@ -2250,13 +2240,13 @@ packages: lodash-es: 4.17.21 mime: 4.0.1 p-filter: 4.1.0 - semantic-release: 23.0.7(typescript@5.4.3) + semantic-release: 23.0.8(typescript@5.4.5) url-join: 5.0.0 transitivePeerDependencies: - supports-color dev: true - /@semantic-release/npm@12.0.0(semantic-release@23.0.7): + /@semantic-release/npm@12.0.0(semantic-release@23.0.8): resolution: {integrity: sha512-72TVYQCH9NvVsO/y13eF8vE4bNnfls518+4KcFwJUKi7AtA/ZXoNgSg9gTTfw5eMZMkiH0izUrpGXgZE/cSQhA==} engines: {node: '>=20.8.1'} peerDependencies: @@ -2269,16 +2259,16 @@ packages: lodash-es: 4.17.21 nerf-dart: 1.0.0 normalize-url: 8.0.1 - npm: 10.5.1 + npm: 10.5.2 rc: 1.2.8 read-pkg: 9.0.1 registry-auth-token: 5.0.2 - semantic-release: 23.0.7(typescript@5.4.3) + semantic-release: 23.0.8(typescript@5.4.5) semver: 7.6.0 tempy: 3.1.0 dev: true - /@semantic-release/release-notes-generator@13.0.0(semantic-release@23.0.7): + /@semantic-release/release-notes-generator@13.0.0(semantic-release@23.0.8): resolution: {integrity: sha512-LEeZWb340keMYuREMyxrODPXJJ0JOL8D/mCl74B4LdzbxhtXV2LrPN2QBEcGJrlQhoqLO0RhxQb6masHytKw+A==} engines: {node: '>=20.8.1'} peerDependencies: @@ -2294,7 +2284,7 @@ packages: into-stream: 7.0.0 lodash-es: 4.17.21 read-pkg-up: 11.0.0 - semantic-release: 23.0.7(typescript@5.4.3) + semantic-release: 23.0.8(typescript@5.4.5) transitivePeerDependencies: - supports-color dev: true @@ -2367,7 +2357,7 @@ packages: /@types/graceful-fs@4.1.9: resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} dependencies: - '@types/node': 20.12.4 + '@types/node': 20.12.7 dev: true /@types/istanbul-lib-coverage@2.0.6: @@ -2405,8 +2395,8 @@ packages: resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} dev: true - /@types/node@20.12.4: - resolution: {integrity: sha512-E+Fa9z3wSQpzgYQdYmme5X3OTuejnnTx88A6p6vkkJosR3KBz+HpE3kqNm98VE6cfLFcISx7zW7MsJkH6KwbTw==} + /@types/node@20.12.7: + resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} dependencies: undici-types: 5.26.5 dev: true @@ -2433,8 +2423,8 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@7.5.0(@typescript-eslint/parser@7.5.0)(eslint@8.57.0)(typescript@5.4.3): - resolution: {integrity: sha512-HpqNTH8Du34nLxbKgVMGljZMG0rJd2O9ecvr2QLYp+7512ty1j42KnsFwspPXg1Vh8an9YImf6CokUBltisZFQ==} + /@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -2445,24 +2435,24 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.5.0(eslint@8.57.0)(typescript@5.4.3) - '@typescript-eslint/scope-manager': 7.5.0 - '@typescript-eslint/type-utils': 7.5.0(eslint@8.57.0)(typescript@5.4.3) - '@typescript-eslint/utils': 7.5.0(eslint@8.57.0)(typescript@5.4.3) - '@typescript-eslint/visitor-keys': 7.5.0 + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.6.0 + '@typescript-eslint/type-utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.6.0 debug: 4.3.4 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.3) - typescript: 5.4.3 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.3): + /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2474,17 +2464,17 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.3) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.4.3 + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@7.5.0(eslint@8.57.0)(typescript@5.4.3): - resolution: {integrity: sha512-cj+XGhNujfD2/wzR1tabNsidnYRaFfEkcULdcIyVBYcXjBvBKOes+mpMBP7hMpOyk+gBcfXsrg4NBGAStQyxjQ==} + /@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -2493,13 +2483,13 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.5.0 - '@typescript-eslint/types': 7.5.0 - '@typescript-eslint/typescript-estree': 7.5.0(typescript@5.4.3) - '@typescript-eslint/visitor-keys': 7.5.0 + '@typescript-eslint/scope-manager': 7.6.0 + '@typescript-eslint/types': 7.6.0 + '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.6.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.4.3 + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true @@ -2512,16 +2502,16 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true - /@typescript-eslint/scope-manager@7.5.0: - resolution: {integrity: sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==} + /@typescript-eslint/scope-manager@7.6.0: + resolution: {integrity: sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w==} engines: {node: ^18.18.0 || >=20.0.0} dependencies: - '@typescript-eslint/types': 7.5.0 - '@typescript-eslint/visitor-keys': 7.5.0 + '@typescript-eslint/types': 7.6.0 + '@typescript-eslint/visitor-keys': 7.6.0 dev: true - /@typescript-eslint/type-utils@7.5.0(eslint@8.57.0)(typescript@5.4.3): - resolution: {integrity: sha512-A021Rj33+G8mx2Dqh0nMO9GyjjIBK3MqgVgZ2qlKf6CJy51wY/lkkFqq3TqqnH34XyAHUkq27IjlUkWlQRpLHw==} + /@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -2530,12 +2520,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.5.0(typescript@5.4.3) - '@typescript-eslint/utils': 7.5.0(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.3) - typescript: 5.4.3 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true @@ -2545,12 +2535,12 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/types@7.5.0: - resolution: {integrity: sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==} + /@typescript-eslint/types@7.6.0: + resolution: {integrity: sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==} engines: {node: ^18.18.0 || >=20.0.0} dev: true - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.3): + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2566,14 +2556,14 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.3) - typescript: 5.4.3 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.5.0(typescript@5.4.3): - resolution: {integrity: sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==} + /@typescript-eslint/typescript-estree@7.6.0(typescript@5.4.5): + resolution: {integrity: sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -2581,21 +2571,21 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.5.0 - '@typescript-eslint/visitor-keys': 7.5.0 + '@typescript-eslint/types': 7.6.0 + '@typescript-eslint/visitor-keys': 7.6.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - minimatch: 9.0.3 + minimatch: 9.0.4 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.3) - typescript: 5.4.3 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@7.5.0(eslint@8.57.0)(typescript@5.4.3): - resolution: {integrity: sha512-3vZl9u0R+/FLQcpy2EHyRGNqAS/ofJ3Ji8aebilfJe+fobK8+LbIFmrHciLVDxjDoONmufDcnVSF38KwMEOjzw==} + /@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -2603,9 +2593,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.5.0 - '@typescript-eslint/types': 7.5.0 - '@typescript-eslint/typescript-estree': 7.5.0(typescript@5.4.3) + '@typescript-eslint/scope-manager': 7.6.0 + '@typescript-eslint/types': 7.6.0 + '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -2621,11 +2611,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@7.5.0: - resolution: {integrity: sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==} + /@typescript-eslint/visitor-keys@7.6.0: + resolution: {integrity: sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw==} engines: {node: ^18.18.0 || >=20.0.0} dependencies: - '@typescript-eslint/types': 7.5.0 + '@typescript-eslint/types': 7.6.0 eslint-visitor-keys: 3.4.3 dev: true @@ -2988,8 +2978,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001605 - electron-to-chromium: 1.4.726 + caniuse-lite: 1.0.30001609 + electron-to-chromium: 1.4.735 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.23.0) dev: true @@ -3009,8 +2999,8 @@ packages: engines: {node: '>=6'} dev: true - /builtins@5.0.1: - resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} + /builtins@5.1.0: + resolution: {integrity: sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==} dependencies: semver: 7.6.0 dev: true @@ -3056,8 +3046,8 @@ packages: engines: {node: '>=10'} dev: true - /caniuse-lite@1.0.30001605: - resolution: {integrity: sha512-nXwGlFWo34uliI9z3n6Qc0wZaf7zaZWA1CPZ169La5mV3I/gem7bst0vr5XQH5TJXZIMfDeZyOrZnSlVzKxxHQ==} + /caniuse-lite@1.0.30001609: + resolution: {integrity: sha512-JFPQs34lHKx1B5t1EpQpWH4c+29zIyn/haGsbpfq3suuV9v56enjFt23zqijxGTMwy1p/4H2tjnQMY+p1WoAyA==} dev: true /chalk@2.4.2: @@ -3270,7 +3260,7 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /cosmiconfig@9.0.0(typescript@5.4.3): + /cosmiconfig@9.0.0(typescript@5.4.5): resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: @@ -3283,10 +3273,10 @@ packages: import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 - typescript: 5.4.3 + typescript: 5.4.5 dev: true - /create-jest@29.7.0(@types/node@20.12.4): + /create-jest@29.7.0(@types/node@20.12.7): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -3295,7 +3285,7 @@ packages: chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.12.4) + jest-config: 29.7.0(@types/node@20.12.7) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -3371,8 +3361,8 @@ packages: ms: 2.1.2 dev: true - /dedent@1.5.1: - resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} + /dedent@1.5.3: + resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} peerDependencies: babel-plugin-macros: ^3.1.0 peerDependenciesMeta: @@ -3465,8 +3455,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.726: - resolution: {integrity: sha512-xtjfBXn53RORwkbyKvDfTajtnTp0OJoPOIBzXvkNbb7+YYvCHJflba3L7Txyx/6Fov3ov2bGPr/n5MTixmPhdQ==} + /electron-to-chromium@1.4.735: + resolution: {integrity: sha512-pkYpvwg8VyOTQAeBqZ7jsmpCjko1Qc6We1ZtZCjRyYbT5v4AIUKDy5cQTRotQlSSZmMr8jqpEt6JtOj5k7lR7A==} dev: true /emittery@0.13.1: @@ -3666,7 +3656,7 @@ packages: semver: 7.6.0 dev: true - /eslint-config-love@43.1.0(@typescript-eslint/eslint-plugin@7.5.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.57.0)(typescript@5.4.3): + /eslint-config-love@43.1.0(@typescript-eslint/eslint-plugin@7.6.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.2)(eslint-plugin-promise@6.1.1)(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-r3+7mSaOl0BEGf8LEntPPDbWTDw8o0Dpy9vdts7m+NAuSpmz9C/gL+64lC0Z8nKNE4uwdymPGll4czGQiR+XmQ==} peerDependencies: '@typescript-eslint/eslint-plugin': ^6.4.0 @@ -3676,14 +3666,14 @@ packages: eslint-plugin-promise: ^6.0.0 typescript: '*' dependencies: - '@typescript-eslint/eslint-plugin': 7.5.0(@typescript-eslint/parser@7.5.0)(eslint@8.57.0)(typescript@5.4.3) - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.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.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.5.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.6.0)(eslint@8.57.0) eslint-plugin-n: 16.6.2(eslint@8.57.0) eslint-plugin-promise: 6.1.1(eslint@8.57.0) - typescript: 5.4.3 + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true @@ -3707,7 +3697,7 @@ packages: eslint-plugin-promise: ^6.0.0 dependencies: eslint: 8.57.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.5.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.6.0)(eslint@8.57.0) eslint-plugin-n: 16.6.2(eslint@8.57.0) eslint-plugin-promise: 6.1.1(eslint@8.57.0) dev: true @@ -3722,7 +3712,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.5.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.6.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} peerDependencies: @@ -3743,7 +3733,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.5.0(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -3763,7 +3753,7 @@ packages: eslint-compat-utils: 0.5.0(eslint@8.57.0) dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.5.0)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.6.0)(eslint@8.57.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -3773,7 +3763,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.5.0(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -3782,7 +3772,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.5.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.6.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -3805,7 +3795,7 @@ packages: eslint: '>=7.0.0' dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - builtins: 5.0.1 + builtins: 5.1.0 eslint: 8.57.0 eslint-plugin-es-x: 7.6.0(eslint@8.57.0) get-tsconfig: 4.7.3 @@ -4238,7 +4228,7 @@ packages: split2: 1.0.0 stream-combiner2: 1.1.1 through2: 2.0.5 - traverse: 0.6.8 + traverse: 0.6.9 dev: true /glob-parent@5.1.2: @@ -4825,10 +4815,10 @@ packages: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 chalk: 4.1.2 co: 4.6.0 - dedent: 1.5.1 + dedent: 1.5.3 is-generator-fn: 2.1.0 jest-each: 29.7.0 jest-matcher-utils: 29.7.0 @@ -4846,7 +4836,7 @@ packages: - supports-color dev: true - /jest-cli@29.7.0(@types/node@20.12.4): + /jest-cli@29.7.0(@types/node@20.12.7): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4860,10 +4850,10 @@ packages: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.12.4) + create-jest: 29.7.0(@types/node@20.12.7) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.12.4) + jest-config: 29.7.0(@types/node@20.12.7) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -4874,7 +4864,7 @@ packages: - ts-node dev: true - /jest-config@29.7.0(@types/node@20.12.4): + /jest-config@29.7.0(@types/node@20.12.7): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -4889,7 +4879,7 @@ packages: '@babel/core': 7.24.4 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 babel-jest: 29.7.0(@babel/core@7.24.4) chalk: 4.1.2 ci-info: 3.9.0 @@ -4949,7 +4939,7 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 jest-mock: 29.7.0 jest-util: 29.7.0 dev: true @@ -4965,7 +4955,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 20.12.4 + '@types/node': 20.12.7 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -5016,7 +5006,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 jest-util: 29.7.0 dev: true @@ -5071,7 +5061,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -5102,7 +5092,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -5154,7 +5144,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -5179,7 +5169,7 @@ packages: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.12.4 + '@types/node': 20.12.7 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -5191,13 +5181,13 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.12.4 + '@types/node': 20.12.7 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@29.7.0(@types/node@20.12.4): + /jest@29.7.0(@types/node@20.12.7): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5210,7 +5200,7 @@ packages: '@jest/core': 29.7.0 '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.12.4) + jest-cli: 29.7.0(@types/node@20.12.7) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -5626,8 +5616,8 @@ packages: path-key: 4.0.0 dev: true - /npm@10.5.1: - resolution: {integrity: sha512-RozZuGuWbbhDM2sRhOSLIRb3DLyof6TREi0TW5b3xUEBropDhDqEHv0iAjA1zsIwXKgfIkR8GvQMd4oeKKg9eQ==} + /npm@10.5.2: + resolution: {integrity: sha512-cHVG7QEJwJdZyOrK0dKX5uf3R5Fd0E8AcmSES1jLtO52UT1enUKZ96Onw/xwq4CbrTZEnDuu2Vf9kCQh/Sd12w==} engines: {node: ^18.17.0 || >=20.5.0} hasBin: true dev: true @@ -6092,6 +6082,15 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true + /read-package-up@11.0.0: + resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} + engines: {node: '>=18'} + dependencies: + find-up-simple: 1.0.0 + read-pkg: 9.0.1 + type-fest: 4.15.0 + dev: true + /read-pkg-up@11.0.0: resolution: {integrity: sha512-LOVbvF1Q0SZdjClSefZ0Nz5z8u+tIE7mV5NibzmE9VYmDe9CaBbAVtz1veOSZbofrdsilxuDAYnFenukZVp8/Q==} engines: {node: '>=18'} @@ -6241,28 +6240,28 @@ packages: glob: 7.2.3 dev: true - /rollup@4.14.0: - resolution: {integrity: sha512-Qe7w62TyawbDzB4yt32R0+AbIo6m1/sqO7UPzFS8Z/ksL5mrfhA0v4CavfdmFav3D+ub4QeAgsGEe84DoWe/nQ==} + /rollup@4.14.2: + resolution: {integrity: sha512-WkeoTWvuBoFjFAhsEOHKRoZ3r9GfTyhh7Vff1zwebEFLEFjT1lG3784xEgKiTa7E+e70vsC81roVL2MP4tgEEQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.14.0 - '@rollup/rollup-android-arm64': 4.14.0 - '@rollup/rollup-darwin-arm64': 4.14.0 - '@rollup/rollup-darwin-x64': 4.14.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.14.0 - '@rollup/rollup-linux-arm64-gnu': 4.14.0 - '@rollup/rollup-linux-arm64-musl': 4.14.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.14.0 - '@rollup/rollup-linux-riscv64-gnu': 4.14.0 - '@rollup/rollup-linux-s390x-gnu': 4.14.0 - '@rollup/rollup-linux-x64-gnu': 4.14.0 - '@rollup/rollup-linux-x64-musl': 4.14.0 - '@rollup/rollup-win32-arm64-msvc': 4.14.0 - '@rollup/rollup-win32-ia32-msvc': 4.14.0 - '@rollup/rollup-win32-x64-msvc': 4.14.0 + '@rollup/rollup-android-arm-eabi': 4.14.2 + '@rollup/rollup-android-arm64': 4.14.2 + '@rollup/rollup-darwin-arm64': 4.14.2 + '@rollup/rollup-darwin-x64': 4.14.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.14.2 + '@rollup/rollup-linux-arm64-gnu': 4.14.2 + '@rollup/rollup-linux-arm64-musl': 4.14.2 + '@rollup/rollup-linux-powerpc64le-gnu': 4.14.2 + '@rollup/rollup-linux-riscv64-gnu': 4.14.2 + '@rollup/rollup-linux-s390x-gnu': 4.14.2 + '@rollup/rollup-linux-x64-gnu': 4.14.2 + '@rollup/rollup-linux-x64-musl': 4.14.2 + '@rollup/rollup-win32-arm64-msvc': 4.14.2 + '@rollup/rollup-win32-ia32-msvc': 4.14.2 + '@rollup/rollup-win32-x64-msvc': 4.14.2 fsevents: 2.3.3 dev: true @@ -6295,18 +6294,18 @@ packages: is-regex: 1.1.4 dev: true - /semantic-release@23.0.7(typescript@5.4.3): - resolution: {integrity: sha512-PFxXQE57zrYiCbWKkdsVUF08s0SifEw3WhDhrN47ZEUWQiLl21FI9Dg/H8g7i/lPx0IkF6u7PjJbgxPceXKBeg==} + /semantic-release@23.0.8(typescript@5.4.5): + resolution: {integrity: sha512-yZkuWcTTfh5h/DrR4Q4QvJSARJdb6wjwn/sN0qKMYEkvwaVFek8YWfrgtL8oWaRdl0fLte0Y1wWMzLbwoaII1g==} engines: {node: '>=20.8.1'} hasBin: true dependencies: - '@semantic-release/commit-analyzer': 12.0.0(semantic-release@23.0.7) + '@semantic-release/commit-analyzer': 12.0.0(semantic-release@23.0.8) '@semantic-release/error': 4.0.0 - '@semantic-release/github': 10.0.2(semantic-release@23.0.7) - '@semantic-release/npm': 12.0.0(semantic-release@23.0.7) - '@semantic-release/release-notes-generator': 13.0.0(semantic-release@23.0.7) + '@semantic-release/github': 10.0.3(semantic-release@23.0.8) + '@semantic-release/npm': 12.0.0(semantic-release@23.0.8) + '@semantic-release/release-notes-generator': 13.0.0(semantic-release@23.0.8) aggregate-error: 5.0.0 - cosmiconfig: 9.0.0(typescript@5.4.3) + cosmiconfig: 9.0.0(typescript@5.4.5) debug: 4.3.4 env-ci: 11.0.0 execa: 8.0.1 @@ -6323,7 +6322,7 @@ packages: micromatch: 4.0.5 p-each-series: 3.0.0 p-reduce: 3.0.0 - read-pkg-up: 11.0.0 + read-package-up: 11.0.0 resolve-from: 5.0.0 semver: 7.6.0 semver-diff: 4.0.0 @@ -6769,9 +6768,13 @@ packages: punycode: 2.3.1 dev: true - /traverse@0.6.8: - resolution: {integrity: sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==} + /traverse@0.6.9: + resolution: {integrity: sha512-7bBrcF+/LQzSgFmT0X5YclVqQxtv7TDJ1f8Wj7ibBu/U6BMLeOpUxuZjV7rMc44UtKxlnMFigdhFAIszSX1DMg==} engines: {node: '>= 0.4'} + dependencies: + gopd: 1.0.1 + typedarray.prototype.slice: 1.0.3 + which-typed-array: 1.1.15 dev: true /tree-kill@1.2.2: @@ -6779,13 +6782,13 @@ packages: hasBin: true dev: true - /ts-api-utils@1.3.0(typescript@5.4.3): + /ts-api-utils@1.3.0(typescript@5.4.5): resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.4.3 + typescript: 5.4.5 dev: true /ts-interface-checker@0.1.13: @@ -6805,7 +6808,7 @@ packages: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true - /tsup@8.0.2(typescript@5.4.3): + /tsup@8.0.2(typescript@5.4.5): resolution: {integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==} engines: {node: '>=18'} hasBin: true @@ -6834,11 +6837,11 @@ packages: joycon: 3.1.1 postcss-load-config: 4.0.2 resolve-from: 5.0.0 - rollup: 4.14.0 + rollup: 4.14.2 source-map: 0.8.0-beta.0 sucrase: 3.35.0 tree-kill: 1.2.2 - typescript: 5.4.3 + typescript: 5.4.5 transitivePeerDependencies: - supports-color - ts-node @@ -6936,8 +6939,20 @@ packages: possible-typed-array-names: 1.0.0 dev: true - /typescript@5.4.3: - resolution: {integrity: sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==} + /typedarray.prototype.slice@1.0.3: + resolution: {integrity: sha512-8WbVAQAUlENo1q3c3zZYuy5k9VzBQvp8AX9WOtbvyWlLM1v5JaSRmjubLjzHF4JFtptjH/5c/i95yaElvcjC0A==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-errors: 1.3.0 + typed-array-buffer: 1.0.2 + typed-array-byte-offset: 1.0.2 + dev: true + + /typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} hasBin: true dev: true diff --git a/src/commercelayer.ts b/src/commercelayer.ts index f81efc2..b62c265 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.4' +const OPEN_API_SCHEMA_VERSION = '1.0.5' export { OPEN_API_SCHEMA_VERSION } diff --git a/src/fetch.ts b/src/fetch.ts index 29eb04f..1ed2777 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -1,5 +1,4 @@ -import type { DocWithData } from 'jsonapi-typescript' import type { InterceptorManager } from './interceptor' @@ -9,7 +8,7 @@ const debug = Debug('fetch') export type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise -export type FetchResponse = DocWithData +export type FetchResponse = any export type FetchRequestOptions = RequestInit export type FetchClientOptions = { interceptors?: InterceptorManager, diff --git a/src/index.ts b/src/index.ts index a04a2fa..7b968b7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,23 +2,29 @@ // SDK export { default, CommerceLayerProvisioning } from './commercelayer' -// Commerce Layer Provisioning client type -export type { CommerceLayerProvisioningClient } from './commercelayer' - // Commerce Layer Provisioning static functions export { CommerceLayerProvisioningStatic } from './static' -// Query filter types -export type { QueryParamsRetrieve, QueryParamsList, QueryParams } from './query' -// Resource model types -export type * from './model' +/** ** TYPES ** **/ -// Resource API types -export type * from './api' +// Commerce Layer Provisioning client type +export type { CommerceLayerProvisioningClient } from './commercelayer' + +// Query filter types +export type * from './query' // Raw response reader and request/response interceptors export type { RequestObj, ResponseObj, ErrorObj, HeadersObj } from './interceptor' // Error types export type { SdkError, ApiError, ErrorType } from './error' + +// Resource types +export type * from './resource' + +// Resource model types +export type * from './model' + +// Resource API types +export type * from './api' diff --git a/src/query.ts b/src/query.ts index 2ccd165..7bfb51d 100644 --- a/src/query.ts +++ b/src/query.ts @@ -14,12 +14,12 @@ const objectFilters = ['_jcont'] // type QueryResType = T extends { type: infer Type } ? Type : never type QueryResType = T['type'] -type QueryInclude = string[] +export type QueryInclude = string[] type QueryResourceFields = keyof ResourceFields[R] -type QueryArrayFields = Array>> -type QueryRecordFields = { [key in keyof ResourceFields]?: Array<(QueryResourceFields)> } +export type QueryArrayFields = Array>> +export type QueryRecordFields = { [key in keyof ResourceFields]?: Array<(QueryResourceFields)> } -interface QueryParamsRetrieve { +export interface QueryParamsRetrieve { include?: QueryInclude fields?: QueryArrayFields | QueryRecordFields } @@ -27,22 +27,20 @@ interface QueryParamsRetrieve { type QuerySortType = 'asc' | 'desc' type QueryResourceSortable = ResourceSortFields[QueryResType] type QueryResourceSortableFields = StringKey> -type QueryArraySortable = Array | `-${QueryResourceSortableFields}`> -type QueryRecordSortable = Partial, QuerySortType>> -type QueryFilter = Record> -type QueryPageNumber = number -type QueryPageSize = PositiveNumberRange<25> +export type QueryArraySortable = Array | `-${QueryResourceSortableFields}`> +export type QueryRecordSortable = Partial, QuerySortType>> +export type QueryFilter = Record> +export type QueryPageNumber = number +export type QueryPageSize = PositiveNumberRange<25> -interface QueryParamsList extends QueryParamsRetrieve { +export interface QueryParamsList extends QueryParamsRetrieve { sort?: QueryArraySortable | QueryRecordSortable filters?: QueryFilter pageNumber?: QueryPageNumber pageSize?: QueryPageSize } -type QueryParams = QueryParamsRetrieve | QueryParamsList - -export type { QueryParamsRetrieve, QueryParamsList, QueryParams, QueryFilter } +export type QueryParams = QueryParamsRetrieve | QueryParamsList diff --git a/src/resource.ts b/src/resource.ts index 1ca4269..d9b6bd3 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -8,10 +8,10 @@ import config from './config' import type { Nullable } from './types' import { CommerceLayerProvisioningStatic } from './static' import { isResourceId } from './common' +import { ErrorType, SdkError } from './error' import Debug from './debug' -import { ErrorType, SdkError } from './error' const debug = Debug('resource') @@ -64,7 +64,7 @@ type ListMeta = { } -class ListResponse extends Array { +class ListResponse extends Array { readonly meta: ListMeta @@ -148,7 +148,7 @@ class ResourceAdapter { - async retrieve(resource: ResourceId | ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async retrieve(resource: ResourceId | ResourceType, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { const singleton = !('id' in resource) || CommerceLayerProvisioningStatic.isSingleton(resource.type) @@ -167,7 +167,7 @@ class ResourceAdapter { } - async list(resource: ResourceType, params?: QueryParamsList, options?: ResourcesConfig): Promise> { + async list(resource: ResourceType, params?: QueryParamsList, options?: ResourcesConfig): Promise> { debug('list: %o, %O, %O', resource, params || {}, options || {}) @@ -205,7 +205,7 @@ class ResourceAdapter { } - async update(resource: U & ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: U & ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { const singleton = !('id' in resource) || CommerceLayerProvisioningStatic.isSingleton(resource.type) @@ -308,7 +308,7 @@ abstract class ApiResourceBase { // reference, reference_origin and metadata attributes are always updatable - async update(resource: ResourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: ResourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.update({ ...resource, type: this.type() }, params, options) } @@ -317,16 +317,16 @@ abstract class ApiResourceBase { abstract class ApiResource extends ApiResourceBase { - async retrieve(id: string | ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async retrieve(id: string | ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.retrieve((typeof id === 'string') ? { type: this.type(), id } : id, params, options) } - async list(params?: QueryParamsList, options?: ResourcesConfig): Promise> { + async list(params?: QueryParamsList, options?: ResourcesConfig): Promise> { return this.resources.list({ type: this.type() }, params, options) } - async count(filter?: QueryFilter | QueryParamsList, options?: ResourcesConfig): Promise { - const params: QueryParamsList = { filters: isParamsList(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 } + async count(filter?: QueryFilter | QueryParamsList, options?: ResourcesConfig): Promise { + const params: QueryParamsList = { filters: isParamsList(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 } const response = await this.list(params, options) return Promise.resolve(response.meta.recordCount) } @@ -336,7 +336,7 @@ abstract class ApiResource extends ApiResourceBase { abstract class ApiSingleton extends ApiResourceBase { - async retrieve(params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async retrieve(params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.retrieve({ type: this.type() }, params, options) } diff --git a/src/resources/api_credentials.ts b/src/resources/api_credentials.ts index f9fa87b..86d6ccb 100644 --- a/src/resources/api_credentials.ts +++ b/src/resources/api_credentials.ts @@ -14,22 +14,61 @@ type RoleRel = ResourceRel & { type: RoleType } export type ApiCredentialSort = Pick & ResourceSort -// export type ApiCredentialFilter = Pick & ResourceFilter +// export type ApiCredentialFilter = Pick & ResourceFilter interface ApiCredential extends Resource { readonly type: ApiCredentialType + /** + * The API credential internal name.. + * @example ```"My app"``` + */ name: string + /** + * 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"``` + */ kind: string + /** + * Indicates if the API credential it's confidential.. + * @example ```"true"``` + */ confidential: boolean + /** + * The API credential redirect URI.. + * @example ```"https://bluebrand.com/img/logo.svg"``` + */ redirect_uri?: Nullable + /** + * The API credential unique ID.. + * @example ```"xxxx-yyyy-zzzz"``` + */ client_id: string + /** + * The API credential unique secret.. + * @example ```"xxxx-yyyy-zzzz"``` + */ client_secret: string + /** + * The API credential scopes.. + * @example ```"market:all market:9 market:122 market:6 stock_location:6 stock_location:33"``` + */ scopes: string + /** + * 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"``` + */ expires_in?: Nullable + /** + * Indicates the environment the resource belongs to (one of `test` or `live`).. + * @example ```"test"``` + */ mode?: Nullable + /** + * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).. + */ custom?: Nullable organization?: Nullable @@ -40,11 +79,34 @@ interface ApiCredential extends Resource { interface ApiCredentialCreate extends ResourceCreate { + /** + * The API credential internal name.. + * @example ```"My app"``` + */ name: string + /** + * 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"``` + */ kind: string + /** + * The API credential redirect URI.. + * @example ```"https://bluebrand.com/img/logo.svg"``` + */ redirect_uri?: Nullable + /** + * 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"``` + */ expires_in?: Nullable + /** + * Indicates the environment the resource belongs to (one of `test` or `live`).. + * @example ```"test"``` + */ mode?: Nullable + /** + * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).. + */ custom?: Nullable organization: OrganizationRel @@ -55,8 +117,20 @@ interface ApiCredentialCreate extends ResourceCreate { interface ApiCredentialUpdate extends ResourceUpdate { + /** + * The API credential internal name.. + * @example ```"My app"``` + */ name?: Nullable + /** + * The API credential redirect URI.. + * @example ```"https://bluebrand.com/img/logo.svg"``` + */ redirect_uri?: Nullable + /** + * 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"``` + */ expires_in?: Nullable role?: Nullable @@ -68,11 +142,11 @@ class ApiCredentials extends ApiResource { static readonly TYPE: ApiCredentialType = 'api_credentials' as const - async create(resource: ApiCredentialCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async create(resource: ApiCredentialCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.create({ ...resource, type: ApiCredentials.TYPE }, params, options) } - async update(resource: ApiCredentialUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: ApiCredentialUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.update({ ...resource, type: ApiCredentials.TYPE }, params, options) } diff --git a/src/resources/application_memberships.ts b/src/resources/application_memberships.ts index 6a68d6b..07404f3 100644 --- a/src/resources/application_memberships.ts +++ b/src/resources/application_memberships.ts @@ -18,13 +18,17 @@ type RoleRel = ResourceRel & { type: RoleType } export type ApplicationMembershipSort = Pick & ResourceSort -// export type ApplicationMembershipFilter = Pick & ResourceFilter +// export type ApplicationMembershipFilter = Pick & ResourceFilter interface ApplicationMembership extends Resource { readonly type: ApplicationMembershipType + /** + * Set of key-value pairs that contains restrictions and scopes of the application membership.. + * @example ```"{"market_id_in":[202,203]}"``` + */ filters?: Nullable> api_credential?: Nullable @@ -37,6 +41,10 @@ interface ApplicationMembership extends Resource { interface ApplicationMembershipCreate extends ResourceCreate { + /** + * Set of key-value pairs that contains restrictions and scopes of the application membership.. + * @example ```"{"market_id_in":[202,203]}"``` + */ filters?: Nullable> api_credential: ApiCredentialRel @@ -49,6 +57,10 @@ interface ApplicationMembershipCreate extends ResourceCreate { interface ApplicationMembershipUpdate extends ResourceUpdate { + /** + * Set of key-value pairs that contains restrictions and scopes of the application membership.. + * @example ```"{"market_id_in":[202,203]}"``` + */ filters?: Nullable> role?: Nullable @@ -60,11 +72,11 @@ class ApplicationMemberships extends ApiResource { static readonly TYPE: ApplicationMembershipType = 'application_memberships' as const - async create(resource: ApplicationMembershipCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async create(resource: ApplicationMembershipCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.create({ ...resource, type: ApplicationMemberships.TYPE }, params, options) } - async update(resource: ApplicationMembershipUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: ApplicationMembershipUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.update({ ...resource, type: ApplicationMemberships.TYPE }, params, options) } diff --git a/src/resources/memberships.ts b/src/resources/memberships.ts index 18bfd5a..234f8b6 100644 --- a/src/resources/memberships.ts +++ b/src/resources/memberships.ts @@ -16,18 +16,38 @@ type RoleRel = ResourceRel & { type: RoleType } type ApplicationMembershipRel = ResourceRel & { type: ApplicationMembershipType } -export type MembershipSort = Pick & ResourceSort -// export type MembershipFilter = Pick & ResourceFilter +export type MembershipSort = Pick & ResourceSort +// export type MembershipFilter = Pick & ResourceFilter interface Membership extends Resource { readonly type: MembershipType + /** + * The user email.. + * @example ```"commercelayer@commercelayer.io"``` + */ user_email: string + /** + * The user first name.. + * @example ```"John"``` + */ user_first_name: string + /** + * The user last name.. + * @example ```"Doe"``` + */ user_last_name: string + /** + * The memberships status. One of `pending` (default), `active`.. + * @example ```"pending"``` + */ status: 'pending' | 'active' + /** + * Indicates if the user it's the owner of the organization.. + * @example ```"true"``` + */ owner: boolean organization?: Nullable @@ -40,6 +60,10 @@ interface Membership extends Resource { interface MembershipCreate extends ResourceCreate { + /** + * The user email.. + * @example ```"commercelayer@commercelayer.io"``` + */ user_email: string organization: OrganizationRel @@ -61,11 +85,11 @@ class Memberships extends ApiResource { static readonly TYPE: MembershipType = 'memberships' as const - async create(resource: MembershipCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async create(resource: MembershipCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.create({ ...resource, type: Memberships.TYPE }, params, options) } - async update(resource: MembershipUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: MembershipUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.update({ ...resource, type: Memberships.TYPE }, params, options) } diff --git a/src/resources/organizations.ts b/src/resources/organizations.ts index c1d0fe7..4210ca9 100644 --- a/src/resources/organizations.ts +++ b/src/resources/organizations.ts @@ -14,32 +14,108 @@ type OrganizationRel = ResourceRel & { type: OrganizationType } export type OrganizationSort = Pick & ResourceSort -// export type OrganizationFilter = Pick & ResourceFilter +// export type OrganizationFilter = Pick & ResourceFilter interface Organization extends Resource { readonly type: OrganizationType + /** + * The organization's internal name.. + * @example ```"The Blue Brand"``` + */ name: string + /** + * The organization's slug name.. + * @example ```"the-blue-brand"``` + */ slug: string + /** + * The organization's domain.. + * @example ```"the-blue-brand.commercelayer.io"``` + */ domain: string + /** + * The organization's configuration.. + * @example ```"{"mfe":{"default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:accessToken","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:lang/:orderId","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}}}"``` + */ config?: Nullable> + /** + * The organization's support phone.. + * @example ```"+01 30800857"``` + */ support_phone?: Nullable + /** + * The organization's support email.. + * @example ```"support@bluebrand.com"``` + */ support_email?: Nullable + /** + * The URL to the organization's logo.. + * @example ```"https://bluebrand.com/img/logo.svg"``` + */ logo_url?: Nullable + /** + * The URL to the organization's favicon.. + * @example ```"https://bluebrand.com/img/favicon.ico"``` + */ favicon_url?: Nullable + /** + * The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).. + * @example ```"#C8984E"``` + */ primary_color?: Nullable + /** + * The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).. + * @example ```"#FFFFCC"``` + */ contrast_color?: Nullable + /** + * The organization's Google Tag Manager ID.. + * @example ```"GTM-5FJXX6"``` + */ gtm_id?: Nullable + /** + * The organization's Google Tag Manager ID for test.. + * @example ```"GTM-5FJXX7"``` + */ gtm_id_test?: Nullable + /** + * Indicates if organization has discount disabled.. + */ discount_disabled?: Nullable + /** + * Indicates if organization has account disabled.. + */ account_disabled?: Nullable + /** + * Indicates if organization has acceptance disabled.. + */ acceptance_disabled?: Nullable + /** + * The maximum number of active concurrent promotions allowed for your organization.. + * @example ```"10"``` + */ max_concurrent_promotions: number + /** + * The maximum number of concurrent imports allowed for your organization.. + * @example ```"30"``` + */ max_concurrent_imports: number + /** + * The region where the organization it's located, default value it's `eu-west-1`.. + * @example ```"eu-west-1"``` + */ region?: Nullable + /** + * Indicates if the organization can switch to live mode.. + */ can_switch_live: boolean + /** + * Information about the current subscription such as the plan type, limits and subscription totals counter.. + * @example ```"{"plan_type":"growth","limits":{"markets":5,"skus":10000,"organizations":2,"memberships":5},"totals":{"organizations":1,"markets":0,"memberships":2,"skus":0}}"``` + */ subscription_info: Record memberships?: Nullable @@ -52,19 +128,72 @@ interface Organization extends Resource { interface OrganizationCreate extends ResourceCreate { + /** + * The organization's internal name.. + * @example ```"The Blue Brand"``` + */ name: string + /** + * The organization's configuration.. + * @example ```"{"mfe":{"default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:accessToken","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:lang/:orderId","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}}}"``` + */ config?: Nullable> + /** + * The organization's support phone.. + * @example ```"+01 30800857"``` + */ support_phone?: Nullable + /** + * The organization's support email.. + * @example ```"support@bluebrand.com"``` + */ support_email?: Nullable + /** + * The URL to the organization's logo.. + * @example ```"https://bluebrand.com/img/logo.svg"``` + */ logo_url?: Nullable + /** + * The URL to the organization's favicon.. + * @example ```"https://bluebrand.com/img/favicon.ico"``` + */ favicon_url?: Nullable + /** + * The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).. + * @example ```"#C8984E"``` + */ primary_color?: Nullable + /** + * The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).. + * @example ```"#FFFFCC"``` + */ contrast_color?: Nullable + /** + * The organization's Google Tag Manager ID.. + * @example ```"GTM-5FJXX6"``` + */ gtm_id?: Nullable + /** + * The organization's Google Tag Manager ID for test.. + * @example ```"GTM-5FJXX7"``` + */ gtm_id_test?: Nullable + /** + * Indicates if organization has discount disabled.. + */ discount_disabled?: Nullable + /** + * Indicates if organization has account disabled.. + */ account_disabled?: Nullable + /** + * Indicates if organization has acceptance disabled.. + */ acceptance_disabled?: Nullable + /** + * The region where the organization it's located, default value it's `eu-west-1`.. + * @example ```"eu-west-1"``` + */ region?: Nullable } @@ -72,18 +201,67 @@ interface OrganizationCreate extends ResourceCreate { interface OrganizationUpdate extends ResourceUpdate { + /** + * The organization's internal name.. + * @example ```"The Blue Brand"``` + */ name?: Nullable + /** + * The organization's configuration.. + * @example ```"{"mfe":{"default":{"links":{"cart":"https://cart.example.com/:order_id?accessToken=:access_token","checkout":"https://checkout.example.com/:order_id?accessToken=:accessToken","identity":"https://example.com/login","microstore":"https://example.com/microstore/?accessToken=:access_token","my_account":"https://example.com/my-custom-account?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:lang/:orderId","billing_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"shipping_countries":[{"value":"ES","label":"Espana"},{"value":"IT","label":"Italia"},{"value":"US","label":"Unites States of America"}],"billing_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"shipping_states":{"FR":[{"value":"PA","label":"Paris"},{"value":"LY","label":"Lyon"},{"value":"NI","label":"Nice"},{"value":"MA","label":"Marseille"},{"value":"BO","label":"Bordeaux"}]},"default_country":"US"},"urls":{"privacy":"https://example.com/privacy/:lang","terms":"https://example.com/terms/:lang"}},"market:id:ZKcv13rT":{"links":{"cart":"https://example.com/custom-cart/:order_id?accessToken=:access_token"},"checkout":{"thankyou_page":"https://example.com/thanks/:order_id"}}}}"``` + */ config?: Nullable> + /** + * The organization's support phone.. + * @example ```"+01 30800857"``` + */ support_phone?: Nullable + /** + * The organization's support email.. + * @example ```"support@bluebrand.com"``` + */ support_email?: Nullable + /** + * The URL to the organization's logo.. + * @example ```"https://bluebrand.com/img/logo.svg"``` + */ logo_url?: Nullable + /** + * The URL to the organization's favicon.. + * @example ```"https://bluebrand.com/img/favicon.ico"``` + */ favicon_url?: Nullable + /** + * The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).. + * @example ```"#C8984E"``` + */ primary_color?: Nullable + /** + * The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers).. + * @example ```"#FFFFCC"``` + */ contrast_color?: Nullable + /** + * The organization's Google Tag Manager ID.. + * @example ```"GTM-5FJXX6"``` + */ gtm_id?: Nullable + /** + * The organization's Google Tag Manager ID for test.. + * @example ```"GTM-5FJXX7"``` + */ gtm_id_test?: Nullable + /** + * Indicates if organization has discount disabled.. + */ discount_disabled?: Nullable + /** + * Indicates if organization has account disabled.. + */ account_disabled?: Nullable + /** + * Indicates if organization has acceptance disabled.. + */ acceptance_disabled?: Nullable } @@ -93,11 +271,11 @@ class Organizations extends ApiResource { static readonly TYPE: OrganizationType = 'organizations' as const - async create(resource: OrganizationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async create(resource: OrganizationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.create({ ...resource, type: Organizations.TYPE }, params, options) } - async update(resource: OrganizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: OrganizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.update({ ...resource, type: Organizations.TYPE }, params, options) } diff --git a/src/resources/permissions.ts b/src/resources/permissions.ts index 435f981..46a54c0 100644 --- a/src/resources/permissions.ts +++ b/src/resources/permissions.ts @@ -14,18 +14,37 @@ type RoleRel = ResourceRel & { type: RoleType } export type PermissionSort = Pick & ResourceSort -// export type PermissionFilter = Pick & ResourceFilter +// export type PermissionFilter = Pick & ResourceFilter interface Permission extends Resource { readonly type: PermissionType + /** + * Determines if the permission have access to create rights.. + */ can_create: boolean + /** + * Determines if the permission have access to read rights.. + */ can_read: boolean + /** + * Determines if the permission have access to update rights.. + */ can_update: boolean + /** + * Determines if the permission have access to destroy rights.. + */ can_destroy: boolean + /** + * The resource where this permission is applied.. + */ subject: string + /** + * An object that contains additional restrictions.. + * @example ```"{"foo":"bar"}"``` + */ restrictions: Record organization?: Nullable @@ -37,10 +56,25 @@ interface Permission extends Resource { interface PermissionCreate extends ResourceCreate { + /** + * Determines if the permission have access to create rights.. + */ can_create: boolean + /** + * Determines if the permission have access to read rights.. + */ can_read: boolean + /** + * Determines if the permission have access to update rights.. + */ can_update: boolean + /** + * Determines if the permission have access to destroy rights.. + */ can_destroy: boolean + /** + * The resource where this permission is applied.. + */ subject: string role: RoleRel @@ -50,9 +84,21 @@ interface PermissionCreate extends ResourceCreate { interface PermissionUpdate extends ResourceUpdate { + /** + * Determines if the permission have access to create rights.. + */ can_create?: Nullable + /** + * Determines if the permission have access to read rights.. + */ can_read?: Nullable + /** + * Determines if the permission have access to update rights.. + */ can_update?: Nullable + /** + * Determines if the permission have access to destroy rights.. + */ can_destroy?: Nullable } @@ -62,11 +108,11 @@ class Permissions extends ApiResource { static readonly TYPE: PermissionType = 'permissions' as const - async create(resource: PermissionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async create(resource: PermissionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.create({ ...resource, type: Permissions.TYPE }, params, options) } - async update(resource: PermissionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: PermissionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.update({ ...resource, type: Permissions.TYPE }, params, options) } diff --git a/src/resources/roles.ts b/src/resources/roles.ts index 341521a..e57118b 100644 --- a/src/resources/roles.ts +++ b/src/resources/roles.ts @@ -16,14 +16,22 @@ type OrganizationRel = ResourceRel & { type: OrganizationType } export type RoleSort = Pick & ResourceSort -// export type RoleFilter = Pick & ResourceFilter +// export type RoleFilter = Pick & ResourceFilter interface Role extends Resource { readonly type: RoleType + /** + * The role name.. + * @example ```"Custom role"``` + */ name: string + /** + * The kind of role, one of: `custom`, `admin`, `read_only`. + * @example ```"custom"``` + */ kind: string organization?: Nullable @@ -37,6 +45,10 @@ interface Role extends Resource { interface RoleCreate extends ResourceCreate { + /** + * The role name.. + * @example ```"Custom role"``` + */ name: string organization: OrganizationRel @@ -46,6 +58,10 @@ interface RoleCreate extends ResourceCreate { interface RoleUpdate extends ResourceUpdate { + /** + * The role name.. + * @example ```"Custom role"``` + */ name?: Nullable } @@ -55,11 +71,11 @@ class Roles extends ApiResource { static readonly TYPE: RoleType = 'roles' as const - async create(resource: RoleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async create(resource: RoleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.create({ ...resource, type: Roles.TYPE }, params, options) } - async update(resource: RoleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: RoleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { return this.resources.update({ ...resource, type: Roles.TYPE }, params, options) } diff --git a/src/resources/user.ts b/src/resources/user.ts index f9b0e6e..c860e8c 100644 --- a/src/resources/user.ts +++ b/src/resources/user.ts @@ -9,18 +9,37 @@ type UserType = 'user' type UserRel = ResourceRel & { type: UserType } -export type UserSort = Pick & ResourceSort -// export type UserFilter = Pick & ResourceFilter +export type UserSort = Pick & ResourceSort +// export type UserFilter = Pick & ResourceFilter interface User extends Resource { readonly type: UserType + /** + * The user email.. + * @example ```"user@commercelayer.io"``` + */ email: string + /** + * The user first name.. + * @example ```"John"``` + */ first_name: string + /** + * The user last name.. + * @example ```"Doe"``` + */ last_name: string + /** + * The user preferred timezone.. + * @example ```"UTC"``` + */ time_zone?: Nullable + /** + * The user 2FA setting.. + */ otp_required_for_login: boolean } @@ -28,9 +47,25 @@ interface User extends Resource { interface UserUpdate extends ResourceUpdate { + /** + * The user email.. + * @example ```"user@commercelayer.io"``` + */ email?: Nullable + /** + * The user first name.. + * @example ```"John"``` + */ first_name?: Nullable + /** + * The user last name.. + * @example ```"Doe"``` + */ last_name?: Nullable + /** + * The user preferred timezone.. + * @example ```"UTC"``` + */ time_zone?: Nullable } @@ -40,7 +75,7 @@ class Users extends ApiSingleton { static readonly TYPE: UserType = 'user' as const - async update(resource: UserUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { + async update(resource: UserUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise { const res = await this.retrieve(params, options) // JsonAPI requires id in the request body return this.resources.update({ ...resource, id: res.id, type: Users.TYPE }, params, options) } diff --git a/src/resources/versions.ts b/src/resources/versions.ts index a60fc74..5b9b4d6 100644 --- a/src/resources/versions.ts +++ b/src/resources/versions.ts @@ -1,4 +1,4 @@ -import type { Nullable } from '../types' +// import type { Nullable } from '../types' import { ApiResource } from '../resource' import type { Resource, ResourceId, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource' @@ -10,17 +10,37 @@ type VersionRel = ResourceRel & { type: VersionType } export type VersionSort = Pick & ResourceSort -// export type VersionFilter = Pick & ResourceFilter +// export type VersionFilter = Pick & ResourceFilter interface Version extends Resource { readonly type: VersionType + /** + * The type of the versioned resource.. + * @example ```"roles"``` + */ resource_type: string + /** + * The versioned resource ID.. + * @example ```"PzdJhdLdYV"``` + */ resource_id: string + /** + * The event which generates the version.. + * @example ```"update"``` + */ event: string + /** + * The object changes payload.. + * @example ```"{"name":["previous","new"]}"``` + */ changes: Record + /** + * Information about who triggered the change, only showed when it's from a JWT token.. + * @example ```"{"application":{"id":"DNOPYiZYpn","kind":"integration","public":true}}"``` + */ who: Record } diff --git a/src/util.ts b/src/util.ts index d6a0553..246d63d 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,4 +1,4 @@ -import type { ObjectType } from "../src/common" +import type { ObjectType } from "../src/types" // import path from 'path' diff --git a/test/spot.ts b/test/spot.ts index f134b01..4802253 100644 --- a/test/spot.ts +++ b/test/spot.ts @@ -2,6 +2,7 @@ import clProvisioning from '../src' import { inspect } from 'util' import getToken from './token' +// import { } from '../lib/index' (async () => { diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 90fd1a0..b04fdcd 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -1,7 +1,6 @@ { "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ - /* Basic Options */ "incremental": false /* Enable incremental compilation */, "target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, @@ -18,12 +17,11 @@ "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - "removeComments": true, /* Do not emit comments to output. */ + "removeComments": false, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ @@ -33,7 +31,6 @@ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ // "noUnusedLocals": true, /* Report errors on unused locals. */ // "noUnusedParameters": true, /* Report errors on unused parameters. */ @@ -41,7 +38,6 @@ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ - /* Module Resolution Options */ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ @@ -53,20 +49,19 @@ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ "skipLibCheck": true /* Skip type checking of declaration files. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": ["src/**/*"] -} + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index fa2af5d..72a83fa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ - /* Basic Options */ "incremental": false /* Enable incremental compilation */, "target": "ES2018" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, @@ -18,12 +17,11 @@ "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - "removeComments": true, /* Do not emit comments to output. */ + "removeComments": false, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ @@ -33,7 +31,6 @@ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ // "noUnusedLocals": true, /* Report errors on unused locals. */ // "noUnusedParameters": true, /* Report errors on unused parameters. */ @@ -41,7 +38,6 @@ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ - /* Module Resolution Options */ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ @@ -53,20 +49,19 @@ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ "skipLibCheck": true /* Skip type checking of declaration files. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": ["src/**/*"] -} + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/tsup.config.js b/tsup.config.js index 3da6171..ad266e2 100644 --- a/tsup.config.js +++ b/tsup.config.js @@ -3,13 +3,14 @@ import { defineConfig } from 'tsup' const env = process.env.NODE_ENV export default defineConfig(() => ({ - sourcemap: false, + sourcemap: env === 'development', clean: true, dts: true, format: ['cjs', 'esm'], minify: true, bundle: true, - watch: env === 'development', + // treeshake: true, + // watch: env === 'development', target: 'es2020', entry: ['src/index.ts'], outDir: 'lib',