@commercelayer/provisioning-sdk 3.0.0-beta.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -4
- package/lib/{api-CrVODncY.d.ts → api-CnrR2t1g.d.ts} +34 -25
- package/lib/{api-DtxN9ZNI.d.cts → api-R3mMNn87.d.cts} +34 -25
- package/lib/api.cjs +23 -23
- package/lib/api.d.cts +1 -1
- package/lib/api.d.ts +1 -1
- package/lib/api.js +13 -13
- package/lib/binding.cjs +3 -3
- package/lib/binding.d.cts +4 -4
- package/lib/binding.d.ts +4 -4
- package/lib/binding.js +2 -2
- package/lib/bundle.cjs +17 -17
- package/lib/bundle.d.cts +1 -1
- package/lib/bundle.d.ts +1 -1
- package/lib/bundle.js +15 -15
- package/lib/{chunk-QTXYKCKC.js → chunk-2FZWJMYX.js} +5 -5
- package/lib/chunk-2FZWJMYX.js.map +1 -0
- package/lib/{chunk-4TC4U7TK.cjs → chunk-3UQ4UNHL.cjs} +6 -6
- package/lib/chunk-3UQ4UNHL.cjs.map +1 -0
- package/lib/{chunk-H5YSO3AX.cjs → chunk-5RZ2O2CJ.cjs} +10 -10
- package/lib/{chunk-H5YSO3AX.cjs.map → chunk-5RZ2O2CJ.cjs.map} +1 -1
- package/lib/{chunk-PBYGXPJ6.cjs → chunk-5V2JEFHA.cjs} +4 -4
- package/lib/chunk-5V2JEFHA.cjs.map +1 -0
- package/lib/{chunk-5VPJA5UV.js → chunk-7BSFPWED.js} +3 -3
- package/lib/chunk-7BSFPWED.js.map +1 -0
- package/lib/{chunk-HVYM2S4K.cjs → chunk-ATSYNXFW.cjs} +8 -8
- package/lib/{chunk-HVYM2S4K.cjs.map → chunk-ATSYNXFW.cjs.map} +1 -1
- package/lib/{chunk-43XNULI4.cjs → chunk-B77PPXQ4.cjs} +4 -4
- package/lib/chunk-B77PPXQ4.cjs.map +1 -0
- package/lib/{chunk-6FFP3YXV.js → chunk-BOAFNR4A.js} +3 -3
- package/lib/chunk-BOAFNR4A.js.map +1 -0
- package/lib/{chunk-2H27UDGO.cjs → chunk-C4PVJRMW.cjs} +4 -4
- package/lib/chunk-C4PVJRMW.cjs.map +1 -0
- package/lib/{chunk-OTK6VLW5.js → chunk-CR45TDCY.js} +3 -3
- package/lib/{chunk-OTK6VLW5.js.map → chunk-CR45TDCY.js.map} +1 -1
- package/lib/{chunk-NDCVBYCJ.js → chunk-D7JC6E6O.js} +3 -3
- package/lib/chunk-D7JC6E6O.js.map +1 -0
- package/lib/{chunk-EUMMY3TQ.cjs → chunk-EXABJOAU.cjs} +4 -4
- package/lib/chunk-EXABJOAU.cjs.map +1 -0
- package/lib/{chunk-YAVEKFKE.cjs → chunk-F52NPQLI.cjs} +4 -4
- package/lib/{chunk-YAVEKFKE.cjs.map → chunk-F52NPQLI.cjs.map} +1 -1
- package/lib/{chunk-6PWTKNOC.js → chunk-H76I777K.js} +4 -4
- package/lib/{chunk-6PWTKNOC.js.map → chunk-H76I777K.js.map} +1 -1
- package/lib/{chunk-LV5XV2UF.cjs → chunk-HKSMUVBZ.cjs} +26 -26
- package/lib/{chunk-LV5XV2UF.cjs.map → chunk-HKSMUVBZ.cjs.map} +1 -1
- package/lib/{chunk-BFBXXP4Q.js → chunk-IRSVIAA3.js} +3 -3
- package/lib/chunk-IRSVIAA3.js.map +1 -0
- package/lib/{chunk-3PE2OE6B.js → chunk-JEP7T7W5.js} +3 -3
- package/lib/chunk-JEP7T7W5.js.map +1 -0
- package/lib/{chunk-4PMMCL4I.cjs → chunk-JO4BHGCD.cjs} +4 -4
- package/lib/chunk-JO4BHGCD.cjs.map +1 -0
- package/lib/{chunk-XKY46RI6.cjs → chunk-KOCBBI6X.cjs} +4 -4
- package/lib/chunk-KOCBBI6X.cjs.map +1 -0
- package/lib/{chunk-RWUBFJZ6.js → chunk-LWRSBPJL.js} +3 -3
- package/lib/chunk-LWRSBPJL.js.map +1 -0
- package/lib/{chunk-DTORLDNE.cjs → chunk-NYLVQKFV.cjs} +8 -8
- package/lib/{chunk-DTORLDNE.cjs.map → chunk-NYLVQKFV.cjs.map} +1 -1
- package/lib/{chunk-LSEKNECC.js → chunk-OJYX2GPK.js} +3 -3
- package/lib/chunk-OJYX2GPK.js.map +1 -0
- package/lib/{chunk-6MIFOPOB.js → chunk-OO2DV22U.js} +14 -14
- package/lib/{chunk-6MIFOPOB.js.map → chunk-OO2DV22U.js.map} +1 -1
- package/lib/{chunk-73VBQFUA.cjs → chunk-PG4GQVZI.cjs} +4 -4
- package/lib/{chunk-73VBQFUA.cjs.map → chunk-PG4GQVZI.cjs.map} +1 -1
- package/lib/{chunk-6SNLYMKG.js → chunk-PKQGWLOZ.js} +4 -4
- package/lib/{chunk-6SNLYMKG.js.map → chunk-PKQGWLOZ.js.map} +1 -1
- package/lib/{chunk-MT2XP4UJ.cjs → chunk-RADEEFOM.cjs} +4 -4
- package/lib/chunk-RADEEFOM.cjs.map +1 -0
- package/lib/chunk-T7GAOLT5.js +12 -0
- package/lib/chunk-T7GAOLT5.js.map +1 -0
- package/lib/{chunk-DDFTZDVN.cjs → chunk-TVU45BYJ.cjs} +5 -5
- package/lib/chunk-TVU45BYJ.cjs.map +1 -0
- package/lib/{chunk-37LZALYC.js → chunk-VGP6LU6F.js} +3 -3
- package/lib/{chunk-37LZALYC.js.map → chunk-VGP6LU6F.js.map} +1 -1
- package/lib/{chunk-YYM7BH33.cjs → chunk-VUWMD2QC.cjs} +4 -4
- package/lib/chunk-VUWMD2QC.cjs.map +1 -0
- package/lib/{chunk-3AXLHEDT.js → chunk-YT2JKVV4.js} +3 -3
- package/lib/{chunk-3AXLHEDT.js.map → chunk-YT2JKVV4.js.map} +1 -1
- package/lib/{chunk-IRQX6AG3.js → chunk-ZJNUYDXX.js} +3 -3
- package/lib/chunk-ZJNUYDXX.js.map +1 -0
- package/lib/commercelayer.cjs +10 -10
- package/lib/commercelayer.d.cts +2 -2
- package/lib/commercelayer.d.ts +2 -2
- package/lib/commercelayer.js +4 -4
- package/lib/enum.d.cts +1 -1
- package/lib/enum.d.ts +1 -1
- package/lib/index.cjs +22 -22
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +17 -17
- package/lib/model.d.cts +1 -1
- package/lib/model.d.ts +1 -1
- package/lib/resources/api_credentials.cjs +5 -5
- package/lib/resources/api_credentials.d.cts +2 -2
- package/lib/resources/api_credentials.d.ts +1 -1
- package/lib/resources/api_credentials.js +4 -4
- package/lib/resources/application_memberships.cjs +5 -5
- package/lib/resources/application_memberships.d.cts +2 -2
- package/lib/resources/application_memberships.d.ts +1 -1
- package/lib/resources/application_memberships.js +4 -4
- package/lib/resources/identity_providers.cjs +5 -5
- package/lib/resources/identity_providers.d.cts +2 -2
- package/lib/resources/identity_providers.d.ts +1 -1
- package/lib/resources/identity_providers.js +4 -4
- package/lib/resources/membership_profiles.cjs +5 -5
- package/lib/resources/membership_profiles.d.cts +2 -2
- package/lib/resources/membership_profiles.d.ts +1 -1
- package/lib/resources/membership_profiles.js +4 -4
- package/lib/resources/memberships.cjs +5 -5
- package/lib/resources/memberships.d.cts +2 -2
- package/lib/resources/memberships.d.ts +1 -1
- package/lib/resources/memberships.js +4 -4
- package/lib/resources/organizations.cjs +5 -5
- package/lib/resources/organizations.d.cts +2 -2
- package/lib/resources/organizations.d.ts +1 -1
- package/lib/resources/organizations.js +4 -4
- package/lib/resources/permissions.cjs +5 -5
- package/lib/resources/permissions.d.cts +2 -2
- package/lib/resources/permissions.d.ts +1 -1
- package/lib/resources/permissions.js +4 -4
- package/lib/resources/roles.cjs +5 -5
- package/lib/resources/roles.d.cts +2 -2
- package/lib/resources/roles.d.ts +1 -1
- package/lib/resources/roles.js +4 -4
- package/lib/resources/users.cjs +5 -5
- package/lib/resources/users.d.cts +2 -2
- package/lib/resources/users.d.ts +1 -1
- package/lib/resources/users.js +4 -4
- package/lib/resources/versions.cjs +5 -5
- package/lib/resources/versions.d.cts +2 -2
- package/lib/resources/versions.d.ts +1 -1
- package/lib/resources/versions.js +4 -4
- package/lib/static.cjs +6 -6
- package/lib/static.d.cts +1 -1
- package/lib/static.d.ts +1 -1
- package/lib/static.js +5 -5
- package/lib/version.cjs +4 -4
- package/lib/version.d.cts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -8
- package/lib/chunk-2H27UDGO.cjs.map +0 -1
- package/lib/chunk-3PE2OE6B.js.map +0 -1
- package/lib/chunk-43XNULI4.cjs.map +0 -1
- package/lib/chunk-4PMMCL4I.cjs.map +0 -1
- package/lib/chunk-4TC4U7TK.cjs.map +0 -1
- package/lib/chunk-5VPJA5UV.js.map +0 -1
- package/lib/chunk-6FFP3YXV.js.map +0 -1
- package/lib/chunk-BFBXXP4Q.js.map +0 -1
- package/lib/chunk-DDFTZDVN.cjs.map +0 -1
- package/lib/chunk-EUMMY3TQ.cjs.map +0 -1
- package/lib/chunk-IRQX6AG3.js.map +0 -1
- package/lib/chunk-LSEKNECC.js.map +0 -1
- package/lib/chunk-MT2XP4UJ.cjs.map +0 -1
- package/lib/chunk-NDCVBYCJ.js.map +0 -1
- package/lib/chunk-PBYGXPJ6.cjs.map +0 -1
- package/lib/chunk-QTXYKCKC.js.map +0 -1
- package/lib/chunk-RWUBFJZ6.js.map +0 -1
- package/lib/chunk-VVSV5FR6.js +0 -12
- package/lib/chunk-VVSV5FR6.js.map +0 -1
- package/lib/chunk-XKY46RI6.cjs.map +0 -1
- package/lib/chunk-YYM7BH33.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../gen/version.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,cAmEb,CAAA;;;ACnEO,IAAM,cAAsB,eAAA,CAAI;AAGhC,IAAM,kBAAA,GAA6B;AAGnC,IAAM,yBAAyB","file":"chunk-VVSV5FR6.js","sourcesContent":["{\n \"name\": \"@commercelayer/provisioning-sdk\",\n \"version\": \"3.0.0-beta.3\",\n \"main\": \"lib/index.cjs\",\n \"types\": \"lib/index.d.ts\",\n \"module\": \"lib/index.js\",\n \"type\": \"module\",\n \"sideEffects\": false,\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./lib/index.d.ts\",\n \"default\": \"./lib/index.js\"\n },\n \"require\": {\n \"types\": \"./lib/index.d.cts\",\n \"default\": \"./lib/index.cjs\"\n }\n }\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"generate\": \"tsx ../sdk-generator/src/generator.ts && pnpm check\",\n \"generate-local\": \"tsx ../sdk-generator/src/generator.ts --local && pnpm check\",\n \"lint\": \"biome check --enforce-assist=true\",\n \"check\": \"biome check --enforce-assist=true --write\",\n \"ts:check\": \"tsc --noEmit -p tsconfig.json\",\n \"test\": \"vitest\",\n \"coverage\": \"vitest run --coverage\",\n \"verify:pack\": \"publint && attw --pack .\"\n },\n \"keywords\": [\n \"javascript\",\n \"ecommerce\",\n \"jamstack\",\n \"commercelayer\",\n \"provisioning\"\n ],\n \"author\": \"Pierluigi Viti <pierluigi@commercelayer.io>\",\n \"license\": \"MIT\",\n \"description\": \"Commerce Layer Provisioning API Javascript SDK\",\n \"files\": [\n \"lib/**/*\"\n ],\n \"engines\": {\n \"node\": \">=20\"\n },\n \"devDependencies\": {\n \"@arethetypeswrong/cli\": \"^0.18.5\",\n \"@biomejs/biome\": \"^2.5.14\",\n \"@commercelayer/js-auth\": \"^8.0.1\",\n \"@commercelayer/sdk-generator\": \"workspace:*\",\n \"@types/debug\": \"^4.1.13\",\n \"@types/node\": \"^25.9.8\",\n \"@vitest/coverage-v8\": \"^5.0.2\",\n \"dotenv\": \"^18.0.4\",\n \"json-typescript\": \"^1.1.2\",\n \"jsonapi-typescript\": \"^0.1.3\",\n \"publint\": \"^0.3.24\",\n \"tsup\": \"^8.5.1\",\n \"tsx\": \"^4.23.15\",\n \"typescript\": \"^5.9.3\",\n \"vitest\": \"^5.0.2\"\n },\n \"repository\": \"github:commercelayer/commercelayer-sdk\",\n \"bugs\": \"https://github.com/commercelayer/commercelayer-sdk/issues\",\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import pkg from '../package.json' with { type: 'json' }\n\nexport const SDK_VERSION: string = pkg.version\n\n// Autogenerated API schema version, do not remove this line\nexport const API_SCHEMA_VERSION: string = 'latest'\n\n// Autogenerated supported API versions, do not remove this line\nexport const API_SUPPORTED_VERSIONS = [] as const\n\n/**\n * The API versions this build accepts as the `apiVersion` init option — the\n * union of {@link API_SUPPORTED_VERSIONS}. On a legacy build the tuple is\n * empty, so this resolves to `never` and the option can only be omitted (the\n * legacy API is unversioned).\n */\nexport type ApiVersion = (typeof API_SUPPORTED_VERSIONS)[number]\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../gen/resources/users.ts"],"names":["ApiSingleton"],"mappings":";;;;;AA2EA,IAAM,KAAA,GAAN,MAAM,MAAA,SAAcA,8BAAA,CAAmB;AAAA,EACrC,OAAgB,IAAA,GAAiB,OAAA;AAAA,EAEjC,MAAM,MAAA,CAAO,QAAA,EAAsB,MAAA,EAAoC,OAAA,EAA0C;AAC/G,IAAA,OAAO,IAAA,CAAK,SAAA,CAAU,MAAA,CAAyB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,MAAA,CAAM,IAAA,EAAK,EAAG,MAAA,EAAQ,OAAA,EAAS,IAAA,CAAK,MAAM,CAAA;AAAA,EAChH;AAAA,EAEA,OAAO,QAAA,EAAiC;AACtC,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,MAAA,CAAM,IAAA;AAAA,EAClD;AAAA,EAEA,aAAa,EAAA,EAAyC;AACpD,IAAA,OAAO,KAAA,CAAM,qBAA8B,EAAE,CAAA;AAAA,EAC/C;AAAA,EAEA,sBAAsB,GAAA,EAA0B;AAC9C,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA+B,GAAG,GAAG,CAAA;AAAA,EACpD;AAAA,EAEA,IAAA,GAAiB;AACf,IAAA,OAAO,MAAA,CAAM,IAAA;AAAA,EACf;AAAA,EAEA,IAAA,GAAe;AACb,IAAA,OAAO,MAAA;AAAA,EACT;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,KAAA,EAAM;AAC3B,IAAO,aAAA,GAAQ","file":"chunk-XKY46RI6.cjs","sourcesContent":["import type { QueryParamsRetrieve } from '@runtime/query'\nimport type {\n Resource,\n ResourceId,\n ResourceRel,\n ResourceSort,\n /* ResourceFilter */ ResourcesConfig,\n SingletonUpdate,\n} from '@runtime/resource'\nimport { ApiSingleton } from '@runtime/resource'\n\ntype UserType = 'users'\ntype UserRel = ResourceRel & { type: UserType }\n\nexport type UserSort = Pick<User, 'id' | 'email' | 'first_name' | 'last_name'> & ResourceSort\n// export type UserFilter = Pick<User, 'id' | 'email' | 'first_name' | 'last_name' | 'time_zone'> & ResourceFilter\n\n/**\n * The User object is returned as part of the response body of each successful retrieve or update API call to the /api/user endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/users/object\n */\ninterface User extends Resource {\n readonly type: UserType\n\n /**\n * The user email.\n * @example ```\"user@commercelayer.io\"```\n */\n email: string\n /**\n * The user first name.\n * @example ```\"John\"```\n */\n first_name: string\n /**\n * The user last name.\n * @example ```\"Doe\"```\n */\n last_name: string\n /**\n * The user preferred timezone.\n * @example ```\"UTC\"```\n */\n time_zone?: string | null\n /**\n * The user 2FA setting.\n * @example ```true```\n */\n otp_required_for_login?: boolean | null\n}\n\ninterface UserUpdate extends SingletonUpdate {\n /**\n * The user email.\n * @example ```\"user@commercelayer.io\"```\n */\n email?: string | null\n /**\n * The user first name.\n * @example ```\"John\"```\n */\n first_name?: string | null\n /**\n * The user last name.\n * @example ```\"Doe\"```\n */\n last_name?: string | null\n /**\n * The user preferred timezone.\n * @example ```\"UTC\"```\n */\n time_zone?: string | null\n}\n\nclass Users extends ApiSingleton<User> {\n static readonly TYPE: UserType = 'users' as const\n\n async update(resource: UserUpdate, params?: QueryParamsRetrieve<User>, options?: ResourcesConfig): Promise<User> {\n return this.resources.update<UserUpdate, User>({ ...resource, type: Users.TYPE }, params, options, this.path())\n }\n\n isUser(resource: any): resource is User {\n return resource.type && resource.type === Users.TYPE\n }\n\n relationship(id: string | ResourceId | null): UserRel {\n return super.relationshipOneToOne<UserRel>(id)\n }\n\n relationshipToMany(...ids: string[]): UserRel[] {\n return super.relationshipOneToMany<UserRel>(...ids)\n }\n\n type(): UserType {\n return Users.TYPE\n }\n\n path(): string {\n return 'user'\n }\n}\n\nconst instance = new Users()\nexport default instance\n\nexport type { User, Users, UserType, UserUpdate }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../gen/resources/identity_providers.ts"],"names":["ApiResource"],"mappings":";;;;;AAgOA,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0BA,6BAAA,CAA8B;AAAA,EAC5D,OAAgB,IAAA,GAA6B,oBAAA;AAAA,EAE7C,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EAC2B;AAC3B,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,mBAAkB,IAAA,EAAK;AAAA,MAC5C,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,MAAA,CACJ,QAAA,EACA,MAAA,EACA,OAAA,EAC2B;AAC3B,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,mBAAkB,IAAA,EAAK;AAAA,MAC5C,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,MAAA,CAAO,EAAA,EAAyB,OAAA,EAA0C;AAC9E,IAAA,MAAM,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,OAAO,EAAA,KAAO,QAAA,GAAW,EAAE,EAAA,EAAI,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAK,GAAI,IAAI,OAAO,CAAA;AAAA,EACzG;AAAA,EAEA,MAAM,IAAA,CACJ,kBAAA,EACA,MAAA,EACA,OAAA,EACe;AACf,IAAA,MAAM,mBAAA,GAAuB,mBAAwC,EAAA,IAAO,kBAAA;AAC5E,IAAA,OAAO,KAAK,SAAA,CAAU,KAAA;AAAA,MACpB,EAAE,MAAM,OAAA,EAAQ;AAAA,MAChB,sBAAsB,mBAAmB,CAAA,KAAA,CAAA;AAAA,MACzC,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,QAAA,CACJ,EAAA,EACA,MAAA,EACA,OAAA,EAC2B;AAC3B,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,EAAA,EAAI,OAAO,EAAA,KAAO,QAAA,GAAW,EAAA,GAAK,EAAA,CAAG,EAAA,EAAI,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAM,QAAA,EAAU,IAAA,EAAK;AAAA,MACxF,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,MAAM,OAAA,CACJ,EAAA,EACA,MAAA,EACA,OAAA,EAC2B;AAC3B,IAAA,OAAO,KAAK,SAAA,CAAU,MAAA;AAAA,MACpB,EAAE,EAAA,EAAI,OAAO,EAAA,KAAO,QAAA,GAAW,EAAA,GAAK,EAAA,CAAG,EAAA,EAAI,IAAA,EAAM,kBAAA,CAAkB,IAAA,EAAM,OAAA,EAAS,IAAA,EAAK;AAAA,MACvF,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEA,mBAAmB,QAAA,EAA6C;AAC9D,IAAA,OAAO,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,IAAA,KAAS,kBAAA,CAAkB,IAAA;AAAA,EAC9D;AAAA,EAEA,aAAa,EAAA,EAAqD;AAChE,IAAA,OAAO,KAAA,CAAM,qBAA0C,EAAE,CAAA;AAAA,EAC3D;AAAA,EAEA,sBAAsB,GAAA,EAAsC;AAC1D,IAAA,OAAO,KAAA,CAAM,qBAAA,CAA2C,GAAG,GAAG,CAAA;AAAA,EAChE;AAAA,EAEA,IAAA,GAA6B;AAC3B,IAAA,OAAO,kBAAA,CAAkB,IAAA;AAAA,EAC3B;AACF,CAAA;AAEA,IAAM,QAAA,GAAW,IAAI,iBAAA,EAAkB;AACvC,IAAO,0BAAA,GAAQ","file":"chunk-YYM7BH33.cjs","sourcesContent":["import type { QueryParamsRetrieve } from '@runtime/query'\nimport type {\n Resource,\n ResourceCreate,\n ResourceId,\n ResourceRel,\n ResourceSort,\n /* ResourceFilter */ ResourcesConfig,\n ResourceUpdate,\n} from '@runtime/resource'\nimport { ApiResource } from '@runtime/resource'\n\nimport type { User } from './users'\n\ntype IdentityProviderType = 'identity_providers'\ntype IdentityProviderRel = ResourceRel & { type: IdentityProviderType }\n\nexport type IdentityProviderSort = Pick<\n IdentityProvider,\n | 'id'\n | 'name'\n | 'client_id'\n | 'client_secret'\n | 'issuer'\n | 'status'\n | 'domains'\n | 'token_url'\n | 'authorize_url'\n | 'jwks_url'\n | 'txt_record'\n | 'organization'\n | 'disabled_at'\n> &\n ResourceSort\n// export type IdentityProviderFilter = Pick<IdentityProvider, 'id' | 'name' | 'client_id' | 'client_secret' | 'issuer' | 'status' | 'domains' | 'token_url' | 'authorize_url' | 'jwks_url' | 'txt_record' | 'organization' | 'disabled_at'> & ResourceFilter\n\n/**\n * The Identity provider object is returned as part of the response body of each successful list, retrieve, create, update or delete API call to the /api/identity_providers endpoint.\n *\n * @link https://docs.commercelayer.io/provisioning-api-reference/identity_providers/object\n */\ninterface IdentityProvider extends Resource {\n readonly type: IdentityProviderType\n\n /**\n * The name of the Identity provider.\n * @example ```\"Org auth0\"```\n */\n name: string\n /**\n * The client ID used for the auth workflow.\n * @example ```\"a6CDk5v1ZV99GrtOcfYVEZRnDDt\"```\n */\n client_id: string\n /**\n * The client secret used for the auth workflow.\n * @example ```\"s6CD55v1ZV99ArtOcfYVEZRnDDf\"```\n */\n client_secret: string\n /**\n * The issuer used for the auth workflow.\n * @example ```\"https://dev.auth987.com/\"```\n */\n issuer: string\n /**\n * The identity provider status. One of `pending` (default), `verified` or `error`.\n * @example ```\"pending\"```\n */\n status: 'pending' | 'verified' | 'error'\n /**\n * The list of domains in scope (comma-separated).\n * @example ```\"dev.auth987.com,stg.auth987.com\"```\n */\n domains: string\n /**\n * The token URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/oauth/token\"```\n */\n token_url: string\n /**\n * The authorize URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/authorize\"```\n */\n authorize_url: string\n /**\n * The JWKS key store URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/.well-known/jwks.json\"```\n */\n jwks_url: string\n /**\n * The TXT record value used to check the domain.\n * @example ```\"cl-verification=a6CDk5v\"```\n */\n txt_record?: string | null\n /**\n * The organization identifier for authorize params.\n * @example ```\"org_76gsfs5gd\"```\n */\n organization?: string | null\n /**\n * Time at which this resource was disabled.\n * @example ```\"2018-01-01T12:00:00.000Z\"```\n */\n disabled_at?: string | null\n\n user?: User | null\n}\n\ninterface IdentityProviderCreate extends ResourceCreate {\n /**\n * The name of the Identity provider.\n * @example ```\"Org auth0\"```\n */\n name: string\n /**\n * The client ID used for the auth workflow.\n * @example ```\"a6CDk5v1ZV99GrtOcfYVEZRnDDt\"```\n */\n client_id: string\n /**\n * The client secret used for the auth workflow.\n * @example ```\"s6CD55v1ZV99ArtOcfYVEZRnDDf\"```\n */\n client_secret: string\n /**\n * The issuer used for the auth workflow.\n * @example ```\"https://dev.auth987.com/\"```\n */\n issuer: string\n /**\n * The list of domains in scope (comma-separated).\n * @example ```\"dev.auth987.com,stg.auth987.com\"```\n */\n domains: string\n /**\n * The token URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/oauth/token\"```\n */\n token_url: string\n /**\n * The authorize URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/authorize\"```\n */\n authorize_url: string\n /**\n * The JWKS key store URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/.well-known/jwks.json\"```\n */\n jwks_url: string\n /**\n * The organization identifier for authorize params.\n * @example ```\"org_76gsfs5gd\"```\n */\n organization?: string | null\n /**\n * Send this attribute if you want to mark this resource as disabled.\n * @example ```true```\n */\n _disable?: boolean | null\n /**\n * Send this attribute if you want to mark this resource as enabled.\n * @example ```true```\n */\n _enable?: boolean | null\n}\n\ninterface IdentityProviderUpdate extends ResourceUpdate {\n /**\n * The name of the Identity provider.\n * @example ```\"Org auth0\"```\n */\n name?: string | null\n /**\n * The client ID used for the auth workflow.\n * @example ```\"a6CDk5v1ZV99GrtOcfYVEZRnDDt\"```\n */\n client_id?: string | null\n /**\n * The client secret used for the auth workflow.\n * @example ```\"s6CD55v1ZV99ArtOcfYVEZRnDDf\"```\n */\n client_secret?: string | null\n /**\n * The issuer used for the auth workflow.\n * @example ```\"https://dev.auth987.com/\"```\n */\n issuer?: string | null\n /**\n * The list of domains in scope (comma-separated).\n * @example ```\"dev.auth987.com,stg.auth987.com\"```\n */\n domains?: string | null\n /**\n * The token URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/oauth/token\"```\n */\n token_url?: string | null\n /**\n * The authorize URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/authorize\"```\n */\n authorize_url?: string | null\n /**\n * The JWKS key store URL used for the auth workflow.\n * @example ```\"https://dev.auth987.com/.well-known/jwks.json\"```\n */\n jwks_url?: string | null\n /**\n * The organization identifier for authorize params.\n * @example ```\"org_76gsfs5gd\"```\n */\n organization?: string | null\n /**\n * Send this attribute if you want to mark this resource as disabled.\n * @example ```true```\n */\n _disable?: boolean | null\n /**\n * Send this attribute if you want to mark this resource as enabled.\n * @example ```true```\n */\n _enable?: boolean | null\n}\n\nclass IdentityProviders extends ApiResource<IdentityProvider> {\n static readonly TYPE: IdentityProviderType = 'identity_providers' as const\n\n async create(\n resource: IdentityProviderCreate,\n params?: QueryParamsRetrieve<IdentityProvider>,\n options?: ResourcesConfig,\n ): Promise<IdentityProvider> {\n return this.resources.create<IdentityProviderCreate, IdentityProvider>(\n { ...resource, type: IdentityProviders.TYPE },\n params,\n options,\n )\n }\n\n async update(\n resource: IdentityProviderUpdate,\n params?: QueryParamsRetrieve<IdentityProvider>,\n options?: ResourcesConfig,\n ): Promise<IdentityProvider> {\n return this.resources.update<IdentityProviderUpdate, IdentityProvider>(\n { ...resource, type: IdentityProviders.TYPE },\n params,\n options,\n )\n }\n\n async delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void> {\n await this.resources.delete(typeof id === 'string' ? { id, type: IdentityProviders.TYPE } : id, options)\n }\n\n async user(\n identityProviderId: string | IdentityProvider,\n params?: QueryParamsRetrieve<User>,\n options?: ResourcesConfig,\n ): Promise<User> {\n const _identityProviderId = (identityProviderId as IdentityProvider).id || (identityProviderId as string)\n return this.resources.fetch<User>(\n { type: 'users' },\n `identity_providers/${_identityProviderId}/user`,\n params,\n options,\n ) as unknown as User\n }\n\n async _disable(\n id: string | IdentityProvider,\n params?: QueryParamsRetrieve<IdentityProvider>,\n options?: ResourcesConfig,\n ): Promise<IdentityProvider> {\n return this.resources.update<IdentityProviderUpdate, IdentityProvider>(\n { id: typeof id === 'string' ? id : id.id, type: IdentityProviders.TYPE, _disable: true },\n params,\n options,\n )\n }\n\n async _enable(\n id: string | IdentityProvider,\n params?: QueryParamsRetrieve<IdentityProvider>,\n options?: ResourcesConfig,\n ): Promise<IdentityProvider> {\n return this.resources.update<IdentityProviderUpdate, IdentityProvider>(\n { id: typeof id === 'string' ? id : id.id, type: IdentityProviders.TYPE, _enable: true },\n params,\n options,\n )\n }\n\n isIdentityProvider(resource: any): resource is IdentityProvider {\n return resource.type && resource.type === IdentityProviders.TYPE\n }\n\n relationship(id: string | ResourceId | null): IdentityProviderRel {\n return super.relationshipOneToOne<IdentityProviderRel>(id)\n }\n\n relationshipToMany(...ids: string[]): IdentityProviderRel[] {\n return super.relationshipOneToMany<IdentityProviderRel>(...ids)\n }\n\n type(): IdentityProviderType {\n return IdentityProviders.TYPE\n }\n}\n\nconst instance = new IdentityProviders()\nexport default instance\n\nexport type {\n IdentityProvider,\n IdentityProviderCreate,\n IdentityProviders,\n IdentityProviderType,\n IdentityProviderUpdate,\n}\n"]}
|