@workos-inc/node 8.7.0 → 8.9.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/lib/factory-ClnPnWTz.mjs +4729 -0
- package/lib/factory-ClnPnWTz.mjs.map +1 -0
- package/lib/factory-DlHvKYOI.cjs +4914 -0
- package/lib/factory-DlHvKYOI.cjs.map +1 -0
- package/lib/index.cjs +33 -74
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +19 -156
- package/lib/index.d.mts +34 -0
- package/lib/index.mjs +39 -0
- package/lib/index.mjs.map +1 -0
- package/lib/index.worker.cjs +32 -71
- package/lib/index.worker.cjs.map +1 -1
- package/lib/index.worker.d.cts +2 -135
- package/lib/index.worker.d.mts +2 -0
- package/lib/index.worker.mjs +34 -0
- package/lib/index.worker.mjs.map +1 -0
- package/lib/webapi-DoOhnR2U.cjs +3336 -0
- package/lib/webapi-DoOhnR2U.cjs.map +1 -0
- package/lib/webapi-oTg8yaNv.mjs +3289 -0
- package/lib/webapi-oTg8yaNv.mjs.map +1 -0
- package/lib/workos-CcjPGl_n.d.cts +4973 -0
- package/lib/workos-DYZ38_bk.d.mts +4973 -0
- package/package.json +51 -74
- package/lib/access-token.interface-Buok__jV.d.cts +0 -18
- package/lib/access-token.serializer-tYgOvBoN.cjs +0 -20
- package/lib/access-token.serializer-tYgOvBoN.cjs.map +0 -1
- package/lib/action.interface-CuR159eL.cjs +0 -0
- package/lib/action.interface-TVBOqlx0.d.cts +0 -63
- package/lib/action.serializer-DAcb-o-1.cjs +0 -47
- package/lib/action.serializer-DAcb-o-1.cjs.map +0 -1
- package/lib/actions/actions.cjs +0 -3
- package/lib/actions/actions.d.cts +0 -2
- package/lib/actions/actions.d.ts +0 -41
- package/lib/actions/actions.js +0 -53
- package/lib/actions/actions.js.map +0 -1
- package/lib/actions/interfaces/action.interface.cjs +0 -0
- package/lib/actions/interfaces/action.interface.d.cts +0 -2
- package/lib/actions/interfaces/action.interface.d.ts +0 -63
- package/lib/actions/interfaces/action.interface.js +0 -1
- package/lib/actions/interfaces/index.cjs +0 -0
- package/lib/actions/interfaces/index.d.cts +0 -3
- package/lib/actions/interfaces/index.d.ts +0 -3
- package/lib/actions/interfaces/index.js +0 -1
- package/lib/actions/interfaces/response-payload.interface.cjs +0 -0
- package/lib/actions/interfaces/response-payload.interface.d.cts +0 -2
- package/lib/actions/interfaces/response-payload.interface.d.ts +0 -26
- package/lib/actions/interfaces/response-payload.interface.js +0 -1
- package/lib/actions/serializers/action.serializer.cjs +0 -3
- package/lib/actions/serializers/action.serializer.d.cts +0 -7
- package/lib/actions/serializers/action.serializer.d.ts +0 -7
- package/lib/actions/serializers/action.serializer.js +0 -42
- package/lib/actions/serializers/action.serializer.js.map +0 -1
- package/lib/actions-BjKImREg.d.cts +0 -41
- package/lib/actions-DRojhekm.cjs +0 -58
- package/lib/actions-DRojhekm.cjs.map +0 -1
- package/lib/add-environment-role-permission-options.interface-DPQPMlMJ.d.cts +0 -7
- package/lib/add-environment-role-permission-options.interface-SgWJ1ky5.cjs +0 -0
- package/lib/add-flag-target-options.interface-5g9jOlv2.cjs +0 -0
- package/lib/add-flag-target-options.interface-9IQ0-3hu.d.cts +0 -8
- package/lib/add-organization-role-permission-options.interface-DjcIZCA2.d.cts +0 -7
- package/lib/add-organization-role-permission-options.interface-vB_dUo4U.cjs +0 -0
- package/lib/api-key-required.exception-DUX_xJyw.d.cts +0 -10
- package/lib/api-key-required.exception-hy_QT4YB.cjs +0 -20
- package/lib/api-key-required.exception-hy_QT4YB.cjs.map +0 -1
- package/lib/api-key.interface-CiHEJPea.d.cts +0 -32
- package/lib/api-key.interface-D9M-QfXG.cjs +0 -0
- package/lib/api-key.serializer-384tUKDU.cjs +0 -24
- package/lib/api-key.serializer-384tUKDU.cjs.map +0 -1
- package/lib/api-key.serializer-DM6_cVFr.d.cts +0 -7
- package/lib/api-keys/api-keys.cjs +0 -3
- package/lib/api-keys/api-keys.d.cts +0 -2
- package/lib/api-keys/api-keys.d.ts +0 -13
- package/lib/api-keys/api-keys.js +0 -19
- package/lib/api-keys/api-keys.js.map +0 -1
- package/lib/api-keys/interfaces/api-key.interface.cjs +0 -0
- package/lib/api-keys/interfaces/api-key.interface.d.cts +0 -2
- package/lib/api-keys/interfaces/api-key.interface.d.ts +0 -32
- package/lib/api-keys/interfaces/api-key.interface.js +0 -1
- package/lib/api-keys/interfaces/create-organization-api-key-options.interface.cjs +0 -0
- package/lib/api-keys/interfaces/create-organization-api-key-options.interface.d.cts +0 -2
- package/lib/api-keys/interfaces/create-organization-api-key-options.interface.d.ts +0 -16
- package/lib/api-keys/interfaces/create-organization-api-key-options.interface.js +0 -1
- package/lib/api-keys/interfaces/created-api-key.interface.cjs +0 -0
- package/lib/api-keys/interfaces/created-api-key.interface.d.cts +0 -2
- package/lib/api-keys/interfaces/created-api-key.interface.d.ts +0 -34
- package/lib/api-keys/interfaces/created-api-key.interface.js +0 -1
- package/lib/api-keys/interfaces/index.cjs +0 -0
- package/lib/api-keys/interfaces/index.d.cts +0 -6
- package/lib/api-keys/interfaces/index.d.ts +0 -6
- package/lib/api-keys/interfaces/index.js +0 -1
- package/lib/api-keys/interfaces/list-organization-api-keys-options.interface.cjs +0 -0
- package/lib/api-keys/interfaces/list-organization-api-keys-options.interface.d.cts +0 -2
- package/lib/api-keys/interfaces/list-organization-api-keys-options.interface.d.ts +0 -9
- package/lib/api-keys/interfaces/list-organization-api-keys-options.interface.js +0 -1
- package/lib/api-keys/interfaces/validate-api-key.interface.cjs +0 -0
- package/lib/api-keys/interfaces/validate-api-key.interface.d.cts +0 -2
- package/lib/api-keys/interfaces/validate-api-key.interface.d.ts +0 -15
- package/lib/api-keys/interfaces/validate-api-key.interface.js +0 -1
- package/lib/api-keys/serializers/api-key.serializer.cjs +0 -3
- package/lib/api-keys/serializers/api-key.serializer.d.cts +0 -2
- package/lib/api-keys/serializers/api-key.serializer.d.ts +0 -7
- package/lib/api-keys/serializers/api-key.serializer.js +0 -18
- package/lib/api-keys/serializers/api-key.serializer.js.map +0 -1
- package/lib/api-keys/serializers/create-organization-api-key-options.serializer.cjs +0 -3
- package/lib/api-keys/serializers/create-organization-api-key-options.serializer.d.cts +0 -2
- package/lib/api-keys/serializers/create-organization-api-key-options.serializer.d.ts +0 -7
- package/lib/api-keys/serializers/create-organization-api-key-options.serializer.js +0 -11
- package/lib/api-keys/serializers/create-organization-api-key-options.serializer.js.map +0 -1
- package/lib/api-keys/serializers/created-api-key.serializer.cjs +0 -3
- package/lib/api-keys/serializers/created-api-key.serializer.d.cts +0 -2
- package/lib/api-keys/serializers/created-api-key.serializer.d.ts +0 -7
- package/lib/api-keys/serializers/created-api-key.serializer.js +0 -19
- package/lib/api-keys/serializers/created-api-key.serializer.js.map +0 -1
- package/lib/api-keys/serializers/index.cjs +0 -9
- package/lib/api-keys/serializers/index.d.cts +0 -5
- package/lib/api-keys/serializers/index.d.ts +0 -5
- package/lib/api-keys/serializers/index.js +0 -6
- package/lib/api-keys/serializers/validate-api-key.serializer.cjs +0 -3
- package/lib/api-keys/serializers/validate-api-key.serializer.d.cts +0 -2
- package/lib/api-keys/serializers/validate-api-key.serializer.d.ts +0 -7
- package/lib/api-keys/serializers/validate-api-key.serializer.js +0 -10
- package/lib/api-keys/serializers/validate-api-key.serializer.js.map +0 -1
- package/lib/api-keys-DpNACVjB.cjs +0 -24
- package/lib/api-keys-DpNACVjB.cjs.map +0 -1
- package/lib/api-keys-FoD7rQEa.d.cts +0 -779
- package/lib/app-info.interface-DXCu_oOm.d.cts +0 -8
- package/lib/assign-role-options.interface-CoMCEKhg.cjs +0 -0
- package/lib/assign-role-options.interface-EodzUpo8.d.cts +0 -19
- package/lib/assign-role-options.serializer-B2EB0RUA.d.cts +0 -7
- package/lib/assign-role-options.serializer-Bt2btRso.cjs +0 -19
- package/lib/assign-role-options.serializer-Bt2btRso.cjs.map +0 -1
- package/lib/audit-log-export-options.interface-DFCYxLnl.d.cts +0 -22
- package/lib/audit-log-export-options.interface-mof1h-Fh.cjs +0 -0
- package/lib/audit-log-export-options.serializer-BTNHRx_Y.d.cts +0 -7
- package/lib/audit-log-export-options.serializer-DAwtL9MV.cjs +0 -20
- package/lib/audit-log-export-options.serializer-DAwtL9MV.cjs.map +0 -1
- package/lib/audit-log-export.interface-DdSK_HSO.d.cts +0 -20
- package/lib/audit-log-export.interface-ndtjUpSz.cjs +0 -0
- package/lib/audit-log-export.serializer-DyItrRKD.cjs +0 -19
- package/lib/audit-log-export.serializer-DyItrRKD.cjs.map +0 -1
- package/lib/audit-log-export.serializer-pz3S0J_1.d.cts +0 -7
- package/lib/audit-logs/audit-logs.cjs +0 -3
- package/lib/audit-logs/audit-logs.d.cts +0 -2
- package/lib/audit-logs/audit-logs.d.ts +0 -18
- package/lib/audit-logs/audit-logs.js +0 -38
- package/lib/audit-logs/audit-logs.js.map +0 -1
- package/lib/audit-logs/interfaces/audit-log-export-options.interface.cjs +0 -0
- package/lib/audit-logs/interfaces/audit-log-export-options.interface.d.cts +0 -2
- package/lib/audit-logs/interfaces/audit-log-export-options.interface.d.ts +0 -22
- package/lib/audit-logs/interfaces/audit-log-export-options.interface.js +0 -1
- package/lib/audit-logs/interfaces/audit-log-export.interface.cjs +0 -0
- package/lib/audit-logs/interfaces/audit-log-export.interface.d.cts +0 -2
- package/lib/audit-logs/interfaces/audit-log-export.interface.d.ts +0 -20
- package/lib/audit-logs/interfaces/audit-log-export.interface.js +0 -1
- package/lib/audit-logs/interfaces/create-audit-log-event-options.interface.cjs +0 -0
- package/lib/audit-logs/interfaces/create-audit-log-event-options.interface.d.cts +0 -2
- package/lib/audit-logs/interfaces/create-audit-log-event-options.interface.d.ts +0 -43
- package/lib/audit-logs/interfaces/create-audit-log-event-options.interface.js +0 -1
- package/lib/audit-logs/interfaces/create-audit-log-schema-options.interface.cjs +0 -0
- package/lib/audit-logs/interfaces/create-audit-log-schema-options.interface.d.cts +0 -2
- package/lib/audit-logs/interfaces/create-audit-log-schema-options.interface.d.ts +0 -67
- package/lib/audit-logs/interfaces/create-audit-log-schema-options.interface.js +0 -1
- package/lib/audit-logs/interfaces/index.cjs +0 -0
- package/lib/audit-logs/interfaces/index.d.cts +0 -5
- package/lib/audit-logs/interfaces/index.d.ts +0 -5
- package/lib/audit-logs/interfaces/index.js +0 -1
- package/lib/audit-logs/serializers/audit-log-export-options.serializer.cjs +0 -3
- package/lib/audit-logs/serializers/audit-log-export-options.serializer.d.cts +0 -2
- package/lib/audit-logs/serializers/audit-log-export-options.serializer.d.ts +0 -7
- package/lib/audit-logs/serializers/audit-log-export-options.serializer.js +0 -14
- package/lib/audit-logs/serializers/audit-log-export-options.serializer.js.map +0 -1
- package/lib/audit-logs/serializers/audit-log-export.serializer.cjs +0 -3
- package/lib/audit-logs/serializers/audit-log-export.serializer.d.cts +0 -2
- package/lib/audit-logs/serializers/audit-log-export.serializer.d.ts +0 -7
- package/lib/audit-logs/serializers/audit-log-export.serializer.js +0 -13
- package/lib/audit-logs/serializers/audit-log-export.serializer.js.map +0 -1
- package/lib/audit-logs/serializers/create-audit-log-event-options.serializer.cjs +0 -3
- package/lib/audit-logs/serializers/create-audit-log-event-options.serializer.d.cts +0 -2
- package/lib/audit-logs/serializers/create-audit-log-event-options.serializer.d.ts +0 -7
- package/lib/audit-logs/serializers/create-audit-log-event-options.serializer.js +0 -17
- package/lib/audit-logs/serializers/create-audit-log-event-options.serializer.js.map +0 -1
- package/lib/audit-logs/serializers/create-audit-log-schema-options.serializer.cjs +0 -3
- package/lib/audit-logs/serializers/create-audit-log-schema-options.serializer.d.cts +0 -2
- package/lib/audit-logs/serializers/create-audit-log-schema-options.serializer.d.ts +0 -7
- package/lib/audit-logs/serializers/create-audit-log-schema-options.serializer.js +0 -32
- package/lib/audit-logs/serializers/create-audit-log-schema-options.serializer.js.map +0 -1
- package/lib/audit-logs/serializers/create-audit-log-schema.serializer.cjs +0 -3
- package/lib/audit-logs/serializers/create-audit-log-schema.serializer.d.cts +0 -2
- package/lib/audit-logs/serializers/create-audit-log-schema.serializer.d.ts +0 -7
- package/lib/audit-logs/serializers/create-audit-log-schema.serializer.js +0 -26
- package/lib/audit-logs/serializers/create-audit-log-schema.serializer.js.map +0 -1
- package/lib/audit-logs/serializers/index.cjs +0 -11
- package/lib/audit-logs/serializers/index.d.cts +0 -6
- package/lib/audit-logs/serializers/index.d.ts +0 -6
- package/lib/audit-logs/serializers/index.js +0 -7
- package/lib/audit-logs-BXPMHkYl.cjs +0 -43
- package/lib/audit-logs-BXPMHkYl.cjs.map +0 -1
- package/lib/authenticate-with-code-and-verifier-options.interface-DHpnQj2w.cjs +0 -0
- package/lib/authenticate-with-code-and-verifier-options.interface-DW8HBYmR.d.cts +0 -17
- package/lib/authenticate-with-code-and-verifier-options.serializer-BEILlMya.cjs +0 -20
- package/lib/authenticate-with-code-and-verifier-options.serializer-BEILlMya.cjs.map +0 -1
- package/lib/authenticate-with-code-and-verifier-options.serializer-CqSRBDhV.d.cts +0 -8
- package/lib/authenticate-with-code-options.interface-D_91NAcH.cjs +0 -0
- package/lib/authenticate-with-code-options.interface-H0yfsHxj.d.cts +0 -20
- package/lib/authenticate-with-code-options.serializer-59xsqmhD.d.cts +0 -8
- package/lib/authenticate-with-code-options.serializer-BMz_1tBW.cjs +0 -21
- package/lib/authenticate-with-code-options.serializer-BMz_1tBW.cjs.map +0 -1
- package/lib/authenticate-with-email-verification-options.interface-C9ZJu4jT.cjs +0 -0
- package/lib/authenticate-with-email-verification-options.interface-bntD5tLo.d.cts +0 -18
- package/lib/authenticate-with-email-verification.serializer-BcGBk2xZ.cjs +0 -20
- package/lib/authenticate-with-email-verification.serializer-BcGBk2xZ.cjs.map +0 -1
- package/lib/authenticate-with-magic-auth-options.interface-DKiBkjxK.d.cts +0 -22
- package/lib/authenticate-with-magic-auth-options.interface-Dv3BRcaM.cjs +0 -0
- package/lib/authenticate-with-magic-auth-options.serializer-9MhQMc3z.d.cts +0 -8
- package/lib/authenticate-with-magic-auth-options.serializer-CYU4H_5p.cjs +0 -22
- package/lib/authenticate-with-magic-auth-options.serializer-CYU4H_5p.cjs.map +0 -1
- package/lib/authenticate-with-options-base.interface-C3xH9pmi.d.cts +0 -41
- package/lib/authenticate-with-options-base.interface-CytZiAfd.cjs +0 -0
- package/lib/authenticate-with-organization-selection-options.serializer-DY4N430u.cjs +0 -20
- package/lib/authenticate-with-organization-selection-options.serializer-DY4N430u.cjs.map +0 -1
- package/lib/authenticate-with-organization-selection.interface-BjNOboud.d.cts +0 -18
- package/lib/authenticate-with-organization-selection.interface-C6L-ADkz.cjs +0 -0
- package/lib/authenticate-with-password-options.interface-CBzERAqt.d.cts +0 -20
- package/lib/authenticate-with-password-options.interface-CSJGrQ5X.cjs +0 -0
- package/lib/authenticate-with-password-options.serializer-DPYtf-9Q.cjs +0 -21
- package/lib/authenticate-with-password-options.serializer-DPYtf-9Q.cjs.map +0 -1
- package/lib/authenticate-with-password-options.serializer-KtTlJKNW.d.cts +0 -8
- package/lib/authenticate-with-refresh-token-options.interface-Bc0KcSmQ.d.cts +0 -18
- package/lib/authenticate-with-refresh-token-options.interface-D3XfeTmP.cjs +0 -0
- package/lib/authenticate-with-refresh-token-public-client-options.interface-BUR1ShKn.d.cts +0 -16
- package/lib/authenticate-with-refresh-token-public-client-options.interface-DVfBzMNm.cjs +0 -0
- package/lib/authenticate-with-refresh-token-public-client-options.serializer-BKRVqmNa.d.cts +0 -8
- package/lib/authenticate-with-refresh-token-public-client-options.serializer-BUO_bMxj.cjs +0 -19
- package/lib/authenticate-with-refresh-token-public-client-options.serializer-BUO_bMxj.cjs.map +0 -1
- package/lib/authenticate-with-refresh-token.options.serializer-Ba3QVuMY.cjs +0 -20
- package/lib/authenticate-with-refresh-token.options.serializer-Ba3QVuMY.cjs.map +0 -1
- package/lib/authenticate-with-refresh-token.options.serializer-CXsmQ8PX.d.cts +0 -9
- package/lib/authenticate-with-session-cookie.interface--Ugw1Meh.d.cts +0 -45
- package/lib/authenticate-with-session-cookie.interface-jDv8x_VH.cjs +0 -17
- package/lib/authenticate-with-session-cookie.interface-jDv8x_VH.cjs.map +0 -1
- package/lib/authenticate-with-totp-options.interface-BTIYdseY.cjs +0 -0
- package/lib/authenticate-with-totp-options.interface-CBZmKTjf.d.cts +0 -20
- package/lib/authenticate-with-totp-options.serializer-D9zV4n4M.d.cts +0 -8
- package/lib/authenticate-with-totp-options.serializer-Dv5iQHm4.cjs +0 -21
- package/lib/authenticate-with-totp-options.serializer-Dv5iQHm4.cjs.map +0 -1
- package/lib/authentication-event.interface-Bf03cz-8.d.cts +0 -28
- package/lib/authentication-event.interface-DCzKFcA6.cjs +0 -0
- package/lib/authentication-event.serializer-CNGLraV3.d.cts +0 -7
- package/lib/authentication-event.serializer-CqD91u8L.cjs +0 -20
- package/lib/authentication-event.serializer-CqD91u8L.cjs.map +0 -1
- package/lib/authentication-radar-risk-detected-event.interface-B4L-0H-B.d.cts +0 -24
- package/lib/authentication-radar-risk-detected-event.interface-ChSqAcxc.cjs +0 -0
- package/lib/authentication-radar-risk-event-serializer-CDBrk7yn.cjs +0 -21
- package/lib/authentication-radar-risk-event-serializer-CDBrk7yn.cjs.map +0 -1
- package/lib/authentication-response.interface-B5XOTdYu.d.cts +0 -28
- package/lib/authentication-response.interface-Bm9zyZ7t.cjs +0 -0
- package/lib/authentication-response.serializer-DCSj_OPJ.cjs +0 -26
- package/lib/authentication-response.serializer-DCSj_OPJ.cjs.map +0 -1
- package/lib/authentication-response.serializer-DbD9-wIb.d.cts +0 -7
- package/lib/authorization/authorization.cjs +0 -3
- package/lib/authorization/authorization.d.cts +0 -2
- package/lib/authorization/authorization.d.ts +0 -77
- package/lib/authorization/authorization.js +0 -223
- package/lib/authorization/authorization.js.map +0 -1
- package/lib/authorization/index.cjs +0 -4
- package/lib/authorization/index.d.cts +0 -32
- package/lib/authorization/index.d.ts +0 -32
- package/lib/authorization/index.js +0 -3
- package/lib/authorization/interfaces/add-environment-role-permission-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/add-environment-role-permission-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/add-environment-role-permission-options.interface.d.ts +0 -7
- package/lib/authorization/interfaces/add-environment-role-permission-options.interface.js +0 -1
- package/lib/authorization/interfaces/add-organization-role-permission-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/add-organization-role-permission-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/add-organization-role-permission-options.interface.d.ts +0 -7
- package/lib/authorization/interfaces/add-organization-role-permission-options.interface.js +0 -1
- package/lib/authorization/interfaces/assign-role-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/assign-role-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/assign-role-options.interface.d.ts +0 -19
- package/lib/authorization/interfaces/assign-role-options.interface.js +0 -1
- package/lib/authorization/interfaces/authorization-resource-check.interface.cjs +0 -0
- package/lib/authorization/interfaces/authorization-resource-check.interface.d.cts +0 -2
- package/lib/authorization/interfaces/authorization-resource-check.interface.d.ts +0 -22
- package/lib/authorization/interfaces/authorization-resource-check.interface.js +0 -1
- package/lib/authorization/interfaces/authorization-resource-identifier.interface.cjs +0 -0
- package/lib/authorization/interfaces/authorization-resource-identifier.interface.d.cts +0 -2
- package/lib/authorization/interfaces/authorization-resource-identifier.interface.d.ts +0 -11
- package/lib/authorization/interfaces/authorization-resource-identifier.interface.js +0 -1
- package/lib/authorization/interfaces/authorization-resource.interface.cjs +0 -0
- package/lib/authorization/interfaces/authorization-resource.interface.d.cts +0 -2
- package/lib/authorization/interfaces/authorization-resource.interface.d.ts +0 -78
- package/lib/authorization/interfaces/authorization-resource.interface.js +0 -1
- package/lib/authorization/interfaces/create-environment-role-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/create-environment-role-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/create-environment-role-options.interface.d.ts +0 -16
- package/lib/authorization/interfaces/create-environment-role-options.interface.js +0 -1
- package/lib/authorization/interfaces/create-organization-role-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/create-organization-role-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/create-organization-role-options.interface.d.ts +0 -14
- package/lib/authorization/interfaces/create-organization-role-options.interface.js +0 -1
- package/lib/authorization/interfaces/create-permission-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/create-permission-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/create-permission-options.interface.d.ts +0 -16
- package/lib/authorization/interfaces/create-permission-options.interface.js +0 -1
- package/lib/authorization/interfaces/delete-authorization-resource-by-external-id-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/delete-authorization-resource-by-external-id-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/delete-authorization-resource-by-external-id-options.interface.d.ts +0 -10
- package/lib/authorization/interfaces/delete-authorization-resource-by-external-id-options.interface.js +0 -1
- package/lib/authorization/interfaces/delete-authorization-resource-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/delete-authorization-resource-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/delete-authorization-resource-options.interface.d.ts +0 -8
- package/lib/authorization/interfaces/delete-authorization-resource-options.interface.js +0 -1
- package/lib/authorization/interfaces/environment-role.interface.cjs +0 -0
- package/lib/authorization/interfaces/environment-role.interface.d.cts +0 -2
- package/lib/authorization/interfaces/environment-role.interface.d.ts +0 -36
- package/lib/authorization/interfaces/environment-role.interface.js +0 -1
- package/lib/authorization/interfaces/get-authorization-resource-by-external-id-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/get-authorization-resource-by-external-id-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/get-authorization-resource-by-external-id-options.interface.d.ts +0 -9
- package/lib/authorization/interfaces/get-authorization-resource-by-external-id-options.interface.js +0 -1
- package/lib/authorization/interfaces/index.cjs +0 -0
- package/lib/authorization/interfaces/index.d.cts +0 -31
- package/lib/authorization/interfaces/index.d.ts +0 -31
- package/lib/authorization/interfaces/index.js +0 -1
- package/lib/authorization/interfaces/list-authorization-resources-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/list-authorization-resources-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/list-authorization-resources-options.interface.d.ts +0 -22
- package/lib/authorization/interfaces/list-authorization-resources-options.interface.js +0 -1
- package/lib/authorization/interfaces/list-memberships-for-resource-by-external-id-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/list-memberships-for-resource-by-external-id-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/list-memberships-for-resource-by-external-id-options.interface.d.ts +0 -13
- package/lib/authorization/interfaces/list-memberships-for-resource-by-external-id-options.interface.js +0 -1
- package/lib/authorization/interfaces/list-memberships-for-resource-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/list-memberships-for-resource-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/list-memberships-for-resource-options.interface.d.ts +0 -11
- package/lib/authorization/interfaces/list-memberships-for-resource-options.interface.js +0 -1
- package/lib/authorization/interfaces/list-permissions-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/list-permissions-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/list-permissions-options.interface.d.ts +0 -7
- package/lib/authorization/interfaces/list-permissions-options.interface.js +0 -1
- package/lib/authorization/interfaces/list-resources-for-membership-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/list-resources-for-membership-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/list-resources-for-membership-options.interface.d.ts +0 -24
- package/lib/authorization/interfaces/list-resources-for-membership-options.interface.js +0 -1
- package/lib/authorization/interfaces/list-role-assignments-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/list-role-assignments-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/list-role-assignments-options.interface.d.ts +0 -9
- package/lib/authorization/interfaces/list-role-assignments-options.interface.js +0 -1
- package/lib/authorization/interfaces/organization-role.interface.cjs +0 -0
- package/lib/authorization/interfaces/organization-role.interface.d.cts +0 -2
- package/lib/authorization/interfaces/organization-role.interface.d.ts +0 -16
- package/lib/authorization/interfaces/organization-role.interface.js +0 -1
- package/lib/authorization/interfaces/permission.interface.cjs +0 -0
- package/lib/authorization/interfaces/permission.interface.d.cts +0 -2
- package/lib/authorization/interfaces/permission.interface.d.ts +0 -42
- package/lib/authorization/interfaces/permission.interface.js +0 -1
- package/lib/authorization/interfaces/remove-organization-role-permission-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/remove-organization-role-permission-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/remove-organization-role-permission-options.interface.d.ts +0 -7
- package/lib/authorization/interfaces/remove-organization-role-permission-options.interface.js +0 -1
- package/lib/authorization/interfaces/remove-role-assignment-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/remove-role-assignment-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/remove-role-assignment-options.interface.d.ts +0 -8
- package/lib/authorization/interfaces/remove-role-assignment-options.interface.js +0 -1
- package/lib/authorization/interfaces/remove-role-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/remove-role-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/remove-role-options.interface.d.ts +0 -19
- package/lib/authorization/interfaces/remove-role-options.interface.js +0 -1
- package/lib/authorization/interfaces/role-assignment.interface.cjs +0 -0
- package/lib/authorization/interfaces/role-assignment.interface.d.cts +0 -2
- package/lib/authorization/interfaces/role-assignment.interface.d.ts +0 -49
- package/lib/authorization/interfaces/role-assignment.interface.js +0 -1
- package/lib/authorization/interfaces/set-environment-role-permissions-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/set-environment-role-permissions-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/set-environment-role-permissions-options.interface.d.ts +0 -7
- package/lib/authorization/interfaces/set-environment-role-permissions-options.interface.js +0 -1
- package/lib/authorization/interfaces/set-organization-role-permissions-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/set-organization-role-permissions-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/set-organization-role-permissions-options.interface.d.ts +0 -7
- package/lib/authorization/interfaces/set-organization-role-permissions-options.interface.js +0 -1
- package/lib/authorization/interfaces/update-authorization-resource-by-external-id-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/update-authorization-resource-by-external-id-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/update-authorization-resource-by-external-id-options.interface.d.ts +0 -11
- package/lib/authorization/interfaces/update-authorization-resource-by-external-id-options.interface.js +0 -1
- package/lib/authorization/interfaces/update-environment-role-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/update-environment-role-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/update-environment-role-options.interface.d.ts +0 -12
- package/lib/authorization/interfaces/update-environment-role-options.interface.js +0 -1
- package/lib/authorization/interfaces/update-organization-role-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/update-organization-role-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/update-organization-role-options.interface.d.ts +0 -12
- package/lib/authorization/interfaces/update-organization-role-options.interface.js +0 -1
- package/lib/authorization/interfaces/update-permission-options.interface.cjs +0 -0
- package/lib/authorization/interfaces/update-permission-options.interface.d.cts +0 -2
- package/lib/authorization/interfaces/update-permission-options.interface.d.ts +0 -12
- package/lib/authorization/interfaces/update-permission-options.interface.js +0 -1
- package/lib/authorization/serializers/assign-role-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/assign-role-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/assign-role-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/assign-role-options.serializer.js +0 -13
- package/lib/authorization/serializers/assign-role-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/authorization-check-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/authorization-check-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/authorization-check-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/authorization-check-options.serializer.js +0 -13
- package/lib/authorization/serializers/authorization-check-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/authorization-resource.serializer.cjs +0 -3
- package/lib/authorization/serializers/authorization-resource.serializer.d.cts +0 -2
- package/lib/authorization/serializers/authorization-resource.serializer.d.ts +0 -7
- package/lib/authorization/serializers/authorization-resource.serializer.js +0 -17
- package/lib/authorization/serializers/authorization-resource.serializer.js.map +0 -1
- package/lib/authorization/serializers/create-authorization-resource-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/create-authorization-resource-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/create-authorization-resource-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/create-authorization-resource-options.serializer.js +0 -17
- package/lib/authorization/serializers/create-authorization-resource-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/create-environment-role-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/create-environment-role-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/create-environment-role-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/create-environment-role-options.serializer.js +0 -11
- package/lib/authorization/serializers/create-environment-role-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/create-organization-role-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/create-organization-role-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/create-organization-role-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/create-organization-role-options.serializer.js +0 -10
- package/lib/authorization/serializers/create-organization-role-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/create-permission-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/create-permission-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/create-permission-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/create-permission-options.serializer.js +0 -11
- package/lib/authorization/serializers/create-permission-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/environment-role.serializer.cjs +0 -3
- package/lib/authorization/serializers/environment-role.serializer.d.cts +0 -2
- package/lib/authorization/serializers/environment-role.serializer.d.ts +0 -7
- package/lib/authorization/serializers/environment-role.serializer.js +0 -17
- package/lib/authorization/serializers/environment-role.serializer.js.map +0 -1
- package/lib/authorization/serializers/index.cjs +0 -43
- package/lib/authorization/serializers/index.d.cts +0 -21
- package/lib/authorization/serializers/index.d.ts +0 -21
- package/lib/authorization/serializers/index.js +0 -22
- package/lib/authorization/serializers/list-authorization-resources-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/list-authorization-resources-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/list-authorization-resources-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/list-authorization-resources-options.serializer.js +0 -16
- package/lib/authorization/serializers/list-authorization-resources-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/list-memberships-for-resource-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/list-memberships-for-resource-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/list-memberships-for-resource-options.serializer.d.ts +0 -9
- package/lib/authorization/serializers/list-memberships-for-resource-options.serializer.js +0 -12
- package/lib/authorization/serializers/list-memberships-for-resource-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/list-resources-for-membership-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/list-resources-for-membership-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/list-resources-for-membership-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/list-resources-for-membership-options.serializer.js +0 -16
- package/lib/authorization/serializers/list-resources-for-membership-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/organization-role.serializer.cjs +0 -5
- package/lib/authorization/serializers/organization-role.serializer.d.cts +0 -2
- package/lib/authorization/serializers/organization-role.serializer.d.ts +0 -10
- package/lib/authorization/serializers/organization-role.serializer.js +0 -40
- package/lib/authorization/serializers/organization-role.serializer.js.map +0 -1
- package/lib/authorization/serializers/permission.serializer.cjs +0 -3
- package/lib/authorization/serializers/permission.serializer.d.cts +0 -2
- package/lib/authorization/serializers/permission.serializer.d.ts +0 -7
- package/lib/authorization/serializers/permission.serializer.js +0 -16
- package/lib/authorization/serializers/permission.serializer.js.map +0 -1
- package/lib/authorization/serializers/remove-role-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/remove-role-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/remove-role-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/remove-role-options.serializer.js +0 -13
- package/lib/authorization/serializers/remove-role-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/role-assignment.serializer.cjs +0 -3
- package/lib/authorization/serializers/role-assignment.serializer.d.cts +0 -2
- package/lib/authorization/serializers/role-assignment.serializer.d.ts +0 -7
- package/lib/authorization/serializers/role-assignment.serializer.js +0 -17
- package/lib/authorization/serializers/role-assignment.serializer.js.map +0 -1
- package/lib/authorization/serializers/update-authorization-resource-by-external-id-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/update-authorization-resource-by-external-id-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/update-authorization-resource-by-external-id-options.serializer.d.ts +0 -8
- package/lib/authorization/serializers/update-authorization-resource-by-external-id-options.serializer.js +0 -9
- package/lib/authorization/serializers/update-authorization-resource-by-external-id-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/update-authorization-resource-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/update-authorization-resource-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/update-authorization-resource-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/update-authorization-resource-options.serializer.js +0 -9
- package/lib/authorization/serializers/update-authorization-resource-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/update-environment-role-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/update-environment-role-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/update-environment-role-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/update-environment-role-options.serializer.js +0 -9
- package/lib/authorization/serializers/update-environment-role-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/update-organization-role-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/update-organization-role-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/update-organization-role-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/update-organization-role-options.serializer.js +0 -9
- package/lib/authorization/serializers/update-organization-role-options.serializer.js.map +0 -1
- package/lib/authorization/serializers/update-permission-options.serializer.cjs +0 -3
- package/lib/authorization/serializers/update-permission-options.serializer.d.cts +0 -2
- package/lib/authorization/serializers/update-permission-options.serializer.d.ts +0 -7
- package/lib/authorization/serializers/update-permission-options.serializer.js +0 -9
- package/lib/authorization/serializers/update-permission-options.serializer.js.map +0 -1
- package/lib/authorization-CFjcVm0f.cjs +0 -228
- package/lib/authorization-CFjcVm0f.cjs.map +0 -1
- package/lib/authorization-check-options.serializer-BD_SSghP.cjs +0 -19
- package/lib/authorization-check-options.serializer-BD_SSghP.cjs.map +0 -1
- package/lib/authorization-check-options.serializer-Bf0LA_aB.d.cts +0 -7
- package/lib/authorization-resource-check.interface-BPaHa5zy.cjs +0 -0
- package/lib/authorization-resource-check.interface-BTZ0DC-5.d.cts +0 -22
- package/lib/authorization-resource-identifier.interface-BxMAEe4m.d.cts +0 -11
- package/lib/authorization-resource.interface-DIAEcvVn.d.cts +0 -78
- package/lib/authorization-resource.interface-DoncaLia.cjs +0 -0
- package/lib/authorization-resource.serializer-B5pMimLt.cjs +0 -23
- package/lib/authorization-resource.serializer-B5pMimLt.cjs.map +0 -1
- package/lib/authorization-resource.serializer-DuD1RYA6.d.cts +0 -7
- package/lib/authorization-url-options.interface-DbdK4xoe.d.cts +0 -45
- package/lib/authorization-url-options.interface-DmZLjxDG.cjs +0 -0
- package/lib/authorization-url-options.interface-gjezKDx0.cjs +0 -0
- package/lib/authorization-url-options.interface-jpmqnJeg.d.cts +0 -55
- package/lib/bad-request.exception-BmjHrQEZ.cjs +0 -26
- package/lib/bad-request.exception-BmjHrQEZ.cjs.map +0 -1
- package/lib/bad-request.exception-CvMc1eG9.d.cts +0 -25
- package/lib/base64-DtRxstGt.cjs +0 -44
- package/lib/base64-DtRxstGt.cjs.map +0 -1
- package/lib/batch-write-resources-options.serializer-D9yfiBPL.d.cts +0 -7
- package/lib/batch-write-resources-options.serializer-JVsYFsRR.cjs +0 -23
- package/lib/batch-write-resources-options.serializer-JVsYFsRR.cjs.map +0 -1
- package/lib/challenge-factor-options-CpnZRyry.d.cts +0 -10
- package/lib/challenge.interface-Dm34-dD_.d.cts +0 -22
- package/lib/challenge.serializer-B3MYXnw3.cjs +0 -20
- package/lib/challenge.serializer-B3MYXnw3.cjs.map +0 -1
- package/lib/challenge.serializer-SFcuZrJh.d.cts +0 -7
- package/lib/check-op.enum-BTWiIyiU.d.cts +0 -8
- package/lib/check-op.enum-C-8dV-An.cjs +0 -16
- package/lib/check-op.enum-C-8dV-An.cjs.map +0 -1
- package/lib/check-options.serializer-DUP1MOAn.cjs +0 -69
- package/lib/check-options.serializer-DUP1MOAn.cjs.map +0 -1
- package/lib/check-options.serializer-hi-dJNM4.d.cts +0 -9
- package/lib/check.interface-DPdIqzqP.d.cts +0 -88
- package/lib/check.interface-DatRG9HP.cjs +0 -33
- package/lib/check.interface-DatRG9HP.cjs.map +0 -1
- package/lib/common/crypto/crypto-provider.cjs +0 -3
- package/lib/common/crypto/crypto-provider.d.cts +0 -2
- package/lib/common/crypto/crypto-provider.d.ts +0 -75
- package/lib/common/crypto/crypto-provider.js +0 -12
- package/lib/common/crypto/crypto-provider.js.map +0 -1
- package/lib/common/crypto/seal.cjs +0 -4
- package/lib/common/crypto/seal.d.cts +0 -16
- package/lib/common/crypto/seal.d.ts +0 -16
- package/lib/common/crypto/seal.js +0 -43
- package/lib/common/crypto/seal.js.map +0 -1
- package/lib/common/crypto/signature-provider.cjs +0 -3
- package/lib/common/crypto/signature-provider.d.cts +0 -23
- package/lib/common/crypto/signature-provider.d.ts +0 -23
- package/lib/common/crypto/signature-provider.js +0 -33
- package/lib/common/crypto/signature-provider.js.map +0 -1
- package/lib/common/crypto/subtle-crypto-provider.cjs +0 -3
- package/lib/common/crypto/subtle-crypto-provider.d.cts +0 -29
- package/lib/common/crypto/subtle-crypto-provider.d.ts +0 -29
- package/lib/common/crypto/subtle-crypto-provider.js +0 -94
- package/lib/common/crypto/subtle-crypto-provider.js.map +0 -1
- package/lib/common/exceptions/api-key-required.exception.cjs +0 -3
- package/lib/common/exceptions/api-key-required.exception.d.cts +0 -2
- package/lib/common/exceptions/api-key-required.exception.d.ts +0 -10
- package/lib/common/exceptions/api-key-required.exception.js +0 -14
- package/lib/common/exceptions/api-key-required.exception.js.map +0 -1
- package/lib/common/exceptions/bad-request.exception.cjs +0 -3
- package/lib/common/exceptions/bad-request.exception.d.cts +0 -2
- package/lib/common/exceptions/bad-request.exception.d.ts +0 -25
- package/lib/common/exceptions/bad-request.exception.js +0 -20
- package/lib/common/exceptions/bad-request.exception.js.map +0 -1
- package/lib/common/exceptions/conflict.exception.cjs +0 -3
- package/lib/common/exceptions/conflict.exception.d.cts +0 -20
- package/lib/common/exceptions/conflict.exception.d.ts +0 -20
- package/lib/common/exceptions/conflict.exception.js +0 -17
- package/lib/common/exceptions/conflict.exception.js.map +0 -1
- package/lib/common/exceptions/generic-server.exception.cjs +0 -3
- package/lib/common/exceptions/generic-server.exception.d.cts +0 -2
- package/lib/common/exceptions/generic-server.exception.d.ts +0 -14
- package/lib/common/exceptions/generic-server.exception.js +0 -16
- package/lib/common/exceptions/generic-server.exception.js.map +0 -1
- package/lib/common/exceptions/index.cjs +0 -21
- package/lib/common/exceptions/index.d.cts +0 -11
- package/lib/common/exceptions/index.d.ts +0 -11
- package/lib/common/exceptions/index.js +0 -12
- package/lib/common/exceptions/no-api-key-provided.exception.cjs +0 -3
- package/lib/common/exceptions/no-api-key-provided.exception.d.cts +0 -2
- package/lib/common/exceptions/no-api-key-provided.exception.d.ts +0 -9
- package/lib/common/exceptions/no-api-key-provided.exception.js +0 -10
- package/lib/common/exceptions/no-api-key-provided.exception.js.map +0 -1
- package/lib/common/exceptions/not-found.exception.cjs +0 -3
- package/lib/common/exceptions/not-found.exception.d.cts +0 -2
- package/lib/common/exceptions/not-found.exception.d.ts +0 -24
- package/lib/common/exceptions/not-found.exception.js +0 -18
- package/lib/common/exceptions/not-found.exception.js.map +0 -1
- package/lib/common/exceptions/oauth.exception.cjs +0 -3
- package/lib/common/exceptions/oauth.exception.d.cts +0 -2
- package/lib/common/exceptions/oauth.exception.d.ts +0 -15
- package/lib/common/exceptions/oauth.exception.js +0 -19
- package/lib/common/exceptions/oauth.exception.js.map +0 -1
- package/lib/common/exceptions/parse-error.cjs +0 -3
- package/lib/common/exceptions/parse-error.d.cts +0 -24
- package/lib/common/exceptions/parse-error.d.ts +0 -24
- package/lib/common/exceptions/parse-error.js +0 -18
- package/lib/common/exceptions/parse-error.js.map +0 -1
- package/lib/common/exceptions/rate-limit-exceeded.exception.cjs +0 -3
- package/lib/common/exceptions/rate-limit-exceeded.exception.d.cts +0 -2
- package/lib/common/exceptions/rate-limit-exceeded.exception.d.ts +0 -18
- package/lib/common/exceptions/rate-limit-exceeded.exception.js +0 -14
- package/lib/common/exceptions/rate-limit-exceeded.exception.js.map +0 -1
- package/lib/common/exceptions/signature-verification.exception.cjs +0 -3
- package/lib/common/exceptions/signature-verification.exception.d.cts +0 -2
- package/lib/common/exceptions/signature-verification.exception.d.ts +0 -8
- package/lib/common/exceptions/signature-verification.exception.js +0 -11
- package/lib/common/exceptions/signature-verification.exception.js.map +0 -1
- package/lib/common/exceptions/unauthorized.exception.cjs +0 -3
- package/lib/common/exceptions/unauthorized.exception.d.cts +0 -2
- package/lib/common/exceptions/unauthorized.exception.d.ts +0 -13
- package/lib/common/exceptions/unauthorized.exception.js +0 -15
- package/lib/common/exceptions/unauthorized.exception.js.map +0 -1
- package/lib/common/exceptions/unprocessable-entity.exception.cjs +0 -3
- package/lib/common/exceptions/unprocessable-entity.exception.d.cts +0 -2
- package/lib/common/exceptions/unprocessable-entity.exception.d.ts +0 -25
- package/lib/common/exceptions/unprocessable-entity.exception.js +0 -22
- package/lib/common/exceptions/unprocessable-entity.exception.js.map +0 -1
- package/lib/common/interfaces/app-info.interface.cjs +0 -0
- package/lib/common/interfaces/app-info.interface.d.cts +0 -2
- package/lib/common/interfaces/app-info.interface.d.ts +0 -8
- package/lib/common/interfaces/app-info.interface.js +0 -1
- package/lib/common/interfaces/event.interface.cjs +0 -0
- package/lib/common/interfaces/event.interface.d.cts +0 -2
- package/lib/common/interfaces/event.interface.d.ts +0 -573
- package/lib/common/interfaces/event.interface.js +0 -1
- package/lib/common/interfaces/get-options.interface.cjs +0 -0
- package/lib/common/interfaces/get-options.interface.d.cts +0 -2
- package/lib/common/interfaces/get-options.interface.d.ts +0 -11
- package/lib/common/interfaces/get-options.interface.js +0 -1
- package/lib/common/interfaces/http-client.interface.cjs +0 -0
- package/lib/common/interfaces/http-client.interface.d.cts +0 -2
- package/lib/common/interfaces/http-client.interface.d.ts +0 -24
- package/lib/common/interfaces/http-client.interface.js +0 -1
- package/lib/common/interfaces/index.cjs +0 -0
- package/lib/common/interfaces/index.d.cts +0 -12
- package/lib/common/interfaces/index.d.ts +0 -12
- package/lib/common/interfaces/index.js +0 -1
- package/lib/common/interfaces/list.interface.cjs +0 -0
- package/lib/common/interfaces/list.interface.d.cts +0 -2
- package/lib/common/interfaces/list.interface.d.ts +0 -20
- package/lib/common/interfaces/list.interface.js +0 -1
- package/lib/common/interfaces/pagination-options.interface.cjs +0 -0
- package/lib/common/interfaces/pagination-options.interface.d.cts +0 -2
- package/lib/common/interfaces/pagination-options.interface.d.ts +0 -10
- package/lib/common/interfaces/pagination-options.interface.js +0 -1
- package/lib/common/interfaces/patch-options.interface.cjs +0 -0
- package/lib/common/interfaces/patch-options.interface.d.cts +0 -2
- package/lib/common/interfaces/patch-options.interface.d.ts +0 -12
- package/lib/common/interfaces/patch-options.interface.js +0 -1
- package/lib/common/interfaces/post-options.interface.cjs +0 -0
- package/lib/common/interfaces/post-options.interface.d.cts +0 -2
- package/lib/common/interfaces/post-options.interface.d.ts +0 -13
- package/lib/common/interfaces/post-options.interface.js +0 -1
- package/lib/common/interfaces/put-options.interface.cjs +0 -0
- package/lib/common/interfaces/put-options.interface.d.cts +0 -2
- package/lib/common/interfaces/put-options.interface.d.ts +0 -12
- package/lib/common/interfaces/put-options.interface.js +0 -1
- package/lib/common/interfaces/request-exception.interface.cjs +0 -0
- package/lib/common/interfaces/request-exception.interface.d.cts +0 -2
- package/lib/common/interfaces/request-exception.interface.d.ts +0 -9
- package/lib/common/interfaces/request-exception.interface.js +0 -1
- package/lib/common/interfaces/unknown-record.interface.cjs +0 -0
- package/lib/common/interfaces/unknown-record.interface.d.cts +0 -2
- package/lib/common/interfaces/unknown-record.interface.d.ts +0 -5
- package/lib/common/interfaces/unknown-record.interface.js +0 -1
- package/lib/common/interfaces/unprocessable-entity-error.interface.cjs +0 -0
- package/lib/common/interfaces/unprocessable-entity-error.interface.d.cts +0 -2
- package/lib/common/interfaces/unprocessable-entity-error.interface.d.ts +0 -8
- package/lib/common/interfaces/unprocessable-entity-error.interface.js +0 -1
- package/lib/common/interfaces/workos-options.interface.cjs +0 -0
- package/lib/common/interfaces/workos-options.interface.d.cts +0 -2
- package/lib/common/interfaces/workos-options.interface.d.ts +0 -17
- package/lib/common/interfaces/workos-options.interface.js +0 -1
- package/lib/common/interfaces/workos-response-error.interface.cjs +0 -0
- package/lib/common/interfaces/workos-response-error.interface.d.cts +0 -2
- package/lib/common/interfaces/workos-response-error.interface.d.ts +0 -13
- package/lib/common/interfaces/workos-response-error.interface.js +0 -1
- package/lib/common/net/fetch-client.cjs +0 -4
- package/lib/common/net/fetch-client.d.cts +0 -34
- package/lib/common/net/fetch-client.d.ts +0 -34
- package/lib/common/net/fetch-client.js +0 -189
- package/lib/common/net/fetch-client.js.map +0 -1
- package/lib/common/net/http-client.cjs +0 -5
- package/lib/common/net/http-client.d.cts +0 -2
- package/lib/common/net/http-client.d.ts +0 -56
- package/lib/common/net/http-client.js +0 -78
- package/lib/common/net/http-client.js.map +0 -1
- package/lib/common/serializers/event.serializer.cjs +0 -3
- package/lib/common/serializers/event.serializer.d.cts +0 -2
- package/lib/common/serializers/event.serializer.d.ts +0 -7
- package/lib/common/serializers/event.serializer.js +0 -200
- package/lib/common/serializers/event.serializer.js.map +0 -1
- package/lib/common/serializers/index.cjs +0 -7
- package/lib/common/serializers/index.d.cts +0 -4
- package/lib/common/serializers/index.d.ts +0 -4
- package/lib/common/serializers/index.js +0 -5
- package/lib/common/serializers/list.serializer.cjs +0 -3
- package/lib/common/serializers/list.serializer.d.cts +0 -2
- package/lib/common/serializers/list.serializer.d.ts +0 -7
- package/lib/common/serializers/list.serializer.js +0 -10
- package/lib/common/serializers/list.serializer.js.map +0 -1
- package/lib/common/serializers/pagination-options.serializer.cjs +0 -3
- package/lib/common/serializers/pagination-options.serializer.d.cts +0 -2
- package/lib/common/serializers/pagination-options.serializer.d.ts +0 -7
- package/lib/common/serializers/pagination-options.serializer.js +0 -11
- package/lib/common/serializers/pagination-options.serializer.js.map +0 -1
- package/lib/common/utils/base64.cjs +0 -4
- package/lib/common/utils/base64.d.cts +0 -16
- package/lib/common/utils/base64.d.ts +0 -16
- package/lib/common/utils/base64.js +0 -32
- package/lib/common/utils/base64.js.map +0 -1
- package/lib/common/utils/env.cjs +0 -4
- package/lib/common/utils/env.d.cts +0 -22
- package/lib/common/utils/env.d.ts +0 -22
- package/lib/common/utils/env.js +0 -50
- package/lib/common/utils/env.js.map +0 -1
- package/lib/common/utils/fetch-and-deserialize.cjs +0 -3
- package/lib/common/utils/fetch-and-deserialize.d.cts +0 -10
- package/lib/common/utils/fetch-and-deserialize.d.ts +0 -10
- package/lib/common/utils/fetch-and-deserialize.js +0 -20
- package/lib/common/utils/fetch-and-deserialize.js.map +0 -1
- package/lib/common/utils/fetch-error.cjs +0 -16
- package/lib/common/utils/fetch-error.cjs.map +0 -1
- package/lib/common/utils/fetch-error.d.cts +0 -20
- package/lib/common/utils/fetch-error.d.ts +0 -20
- package/lib/common/utils/fetch-error.js +0 -15
- package/lib/common/utils/fetch-error.js.map +0 -1
- package/lib/common/utils/leb128.cjs +0 -4
- package/lib/common/utils/leb128.d.cts +0 -26
- package/lib/common/utils/leb128.d.ts +0 -26
- package/lib/common/utils/leb128.js +0 -70
- package/lib/common/utils/leb128.js.map +0 -1
- package/lib/common/utils/pagination.cjs +0 -3
- package/lib/common/utils/pagination.d.cts +0 -2
- package/lib/common/utils/pagination.d.ts +0 -25
- package/lib/common/utils/pagination.js +0 -42
- package/lib/common/utils/pagination.js.map +0 -1
- package/lib/common/utils/query-string.cjs +0 -3
- package/lib/common/utils/query-string.d.cts +0 -13
- package/lib/common/utils/query-string.d.ts +0 -13
- package/lib/common/utils/query-string.js +0 -34
- package/lib/common/utils/query-string.js.map +0 -1
- package/lib/common/utils/runtime-info.cjs +0 -3
- package/lib/common/utils/runtime-info.d.cts +0 -24
- package/lib/common/utils/runtime-info.d.ts +0 -24
- package/lib/common/utils/runtime-info.js +0 -51
- package/lib/common/utils/runtime-info.js.map +0 -1
- package/lib/common/utils/unreachable.cjs +0 -3
- package/lib/common/utils/unreachable.d.cts +0 -14
- package/lib/common/utils/unreachable.d.ts +0 -14
- package/lib/common/utils/unreachable.js +0 -17
- package/lib/common/utils/unreachable.js.map +0 -1
- package/lib/common/utils/workos-mock-response.cjs +0 -13
- package/lib/common/utils/workos-mock-response.cjs.map +0 -1
- package/lib/common/utils/workos-mock-response.d.cts +0 -11
- package/lib/common/utils/workos-mock-response.d.ts +0 -11
- package/lib/common/utils/workos-mock-response.js +0 -12
- package/lib/common/utils/workos-mock-response.js.map +0 -1
- package/lib/conflict.exception-DNThkhe4.cjs +0 -23
- package/lib/conflict.exception-DNThkhe4.cjs.map +0 -1
- package/lib/connection-type.enum-5NICh5Uu.d.cts +0 -41
- package/lib/connection-type.enum-blH7z4Tf.cjs +0 -49
- package/lib/connection-type.enum-blH7z4Tf.cjs.map +0 -1
- package/lib/connection.interface-CYEbF9mD.d.cts +0 -33
- package/lib/connection.interface-CoV0tCTn.cjs +0 -0
- package/lib/connection.serializer-CGJCBj9L.d.cts +0 -7
- package/lib/connection.serializer-sFgaPd28.cjs +0 -22
- package/lib/connection.serializer-sFgaPd28.cjs.map +0 -1
- package/lib/create-audit-log-event-options.interface-AUzJbhUa.d.cts +0 -43
- package/lib/create-audit-log-event-options.interface-D99OX2xL.cjs +0 -0
- package/lib/create-audit-log-event-options.serializer-CPNm7TaF.cjs +0 -23
- package/lib/create-audit-log-event-options.serializer-CPNm7TaF.cjs.map +0 -1
- package/lib/create-audit-log-event-options.serializer-DGww7GcD.d.cts +0 -7
- package/lib/create-audit-log-schema-options.interface-CtvgGRaa.cjs +0 -0
- package/lib/create-audit-log-schema-options.interface-Df-CtTwA.d.cts +0 -67
- package/lib/create-audit-log-schema-options.serializer-BmI7ebQD.cjs +0 -38
- package/lib/create-audit-log-schema-options.serializer-BmI7ebQD.cjs.map +0 -1
- package/lib/create-audit-log-schema-options.serializer-CaSOIAav.d.cts +0 -7
- package/lib/create-audit-log-schema.serializer-BdNu3wTv.d.cts +0 -7
- package/lib/create-audit-log-schema.serializer-_Ku0Ixdh.cjs +0 -32
- package/lib/create-audit-log-schema.serializer-_Ku0Ixdh.cjs.map +0 -1
- package/lib/create-authorization-resource-options.serializer-BIbK4rxC.cjs +0 -23
- package/lib/create-authorization-resource-options.serializer-BIbK4rxC.cjs.map +0 -1
- package/lib/create-authorization-resource-options.serializer-CQtLzCwY.d.cts +0 -7
- package/lib/create-data-key.interface-CfdPFOII.d.cts +0 -15
- package/lib/create-data-key.interface-DUVzxo7g.cjs +0 -0
- package/lib/create-environment-role-options.interface-CLZHV12e.cjs +0 -0
- package/lib/create-environment-role-options.interface-D11JXavu.d.cts +0 -16
- package/lib/create-environment-role-options.serializer-D20r9n5i.cjs +0 -17
- package/lib/create-environment-role-options.serializer-D20r9n5i.cjs.map +0 -1
- package/lib/create-environment-role-options.serializer-D9jwEbsi.d.cts +0 -7
- package/lib/create-magic-auth-options.interface-B5PJndA3.cjs +0 -0
- package/lib/create-magic-auth-options.interface-Ducd6OEm.d.cts +0 -12
- package/lib/create-magic-auth-options.serializer-AED3cEHj.d.cts +0 -7
- package/lib/create-magic-auth-options.serializer-DN24SZEy.cjs +0 -15
- package/lib/create-magic-auth-options.serializer-DN24SZEy.cjs.map +0 -1
- package/lib/create-object.interface-BEWdAoAU.d.cts +0 -16
- package/lib/create-object.interface-VxKjDrqH.cjs +0 -0
- package/lib/create-organization-api-key-options.interface-BaxESpuJ.cjs +0 -0
- package/lib/create-organization-api-key-options.serializer-CEub4G8x.cjs +0 -17
- package/lib/create-organization-api-key-options.serializer-CEub4G8x.cjs.map +0 -1
- package/lib/create-organization-api-key-options.serializer-DHP7Y1L-.d.cts +0 -7
- package/lib/create-organization-domain-options.interface-BA0FNfqD.d.cts +0 -12
- package/lib/create-organization-domain-options.interface-SaQ1dv2w.cjs +0 -0
- package/lib/create-organization-domain-options.serializer-CmbATv0L.cjs +0 -15
- package/lib/create-organization-domain-options.serializer-CmbATv0L.cjs.map +0 -1
- package/lib/create-organization-membership-options.interface-BTNw3jC9.cjs +0 -0
- package/lib/create-organization-membership-options.interface-Ce6O3qzL.d.cts +0 -16
- package/lib/create-organization-membership-options.serializer-BdcjvCRS.cjs +0 -17
- package/lib/create-organization-membership-options.serializer-BdcjvCRS.cjs.map +0 -1
- package/lib/create-organization-options.interface-DtcOzvcJ.cjs +0 -0
- package/lib/create-organization-options.serializer-Bg38u3Y_.cjs +0 -17
- package/lib/create-organization-options.serializer-Bg38u3Y_.cjs.map +0 -1
- package/lib/create-organization-options.serializer-CvtIYKO8.d.cts +0 -7
- package/lib/create-organization-role-options.interface-Cl-_2QsZ.d.cts +0 -14
- package/lib/create-organization-role-options.interface-Dy65PU52.cjs +0 -0
- package/lib/create-organization-role-options.serializer-BSk0I9Yx.cjs +0 -16
- package/lib/create-organization-role-options.serializer-BSk0I9Yx.cjs.map +0 -1
- package/lib/create-organization-role-options.serializer-Dn8Za-db.d.cts +0 -7
- package/lib/create-password-reset-options.interface-CAxwaM5z.cjs +0 -0
- package/lib/create-password-reset-options.interface-_azhiyDG.d.cts +0 -10
- package/lib/create-password-reset-options.serializer-C9rwv-Gj.cjs +0 -12
- package/lib/create-password-reset-options.serializer-C9rwv-Gj.cjs.map +0 -1
- package/lib/create-password-reset-options.serializer-uVAM5C0R.d.cts +0 -7
- package/lib/create-passwordless-session-options.interface-Br1VMTUt.d.cts +0 -20
- package/lib/create-passwordless-session-options.interface-CmYSl_hB.cjs +0 -0
- package/lib/create-permission-options.interface-862O5uvJ.cjs +0 -0
- package/lib/create-permission-options.interface-y-mOu7Hr.d.cts +0 -16
- package/lib/create-permission-options.serializer-BEHbKULX.d.cts +0 -7
- package/lib/create-permission-options.serializer-CsTRgSuq.cjs +0 -17
- package/lib/create-permission-options.serializer-CsTRgSuq.cjs.map +0 -1
- package/lib/create-resource-options.serializer-BykgeGKC.cjs +0 -17
- package/lib/create-resource-options.serializer-BykgeGKC.cjs.map +0 -1
- package/lib/create-resource-options.serializer-CFYaAMS-.d.cts +0 -7
- package/lib/create-user-options.interface-BKkeTnvf.cjs +0 -0
- package/lib/create-user-options.interface-C5A9ZFXJ.d.cts +0 -28
- package/lib/create-user-options.serializer-CphvVoaV.cjs +0 -22
- package/lib/create-user-options.serializer-CphvVoaV.cjs.map +0 -1
- package/lib/create-user-options.serializer-emvIoxXk.d.cts +0 -7
- package/lib/created-api-key.interface-C1aPiShv.cjs +0 -0
- package/lib/created-api-key.interface-Dskf-Dpu.d.cts +0 -34
- package/lib/created-api-key.serializer-4hpzVn79.d.cts +0 -7
- package/lib/created-api-key.serializer-BPumuXR6.cjs +0 -25
- package/lib/created-api-key.serializer-BPumuXR6.cjs.map +0 -1
- package/lib/crypto-provider-Bhd3lKp3.cjs +0 -18
- package/lib/crypto-provider-Bhd3lKp3.cjs.map +0 -1
- package/lib/crypto-provider-EnxiazDt.d.cts +0 -75
- package/lib/decrypt-data-key.interface-COPJw2aD.d.cts +0 -11
- package/lib/decrypt-data-key.interface-D69Vb3ft.cjs +0 -0
- package/lib/delete-authorization-resource-by-external-id-options.interface-BiQ32Cns.cjs +0 -0
- package/lib/delete-authorization-resource-by-external-id-options.interface-BvZqYnwY.d.cts +0 -10
- package/lib/delete-authorization-resource-options.interface-BADx9Ibk.d.cts +0 -8
- package/lib/delete-authorization-resource-options.interface-BP6KZ1gG.cjs +0 -0
- package/lib/delete-object.interface-C9gnNWU-.d.cts +0 -7
- package/lib/delete-object.interface-DZ-xHmQu.cjs +0 -0
- package/lib/delete-resource-options.serializer-BNUcqHfb.d.cts +0 -7
- package/lib/delete-resource-options.serializer-DhOS6WiW.cjs +0 -16
- package/lib/delete-resource-options.serializer-DhOS6WiW.cjs.map +0 -1
- package/lib/directory-group.interface-Ds7hJJCb.d.cts +0 -24
- package/lib/directory-group.interface-Gjrl6Za6.cjs +0 -0
- package/lib/directory-group.serializer-BVxAKXJj.d.cts +0 -8
- package/lib/directory-group.serializer-DbTTdVPB.cjs +0 -38
- package/lib/directory-group.serializer-DbTTdVPB.cjs.map +0 -1
- package/lib/directory-sync/directory-sync.cjs +0 -3
- package/lib/directory-sync/directory-sync.d.cts +0 -2
- package/lib/directory-sync/directory-sync.d.ts +0 -24
- package/lib/directory-sync/directory-sync.js +0 -41
- package/lib/directory-sync/directory-sync.js.map +0 -1
- package/lib/directory-sync/interfaces/directory-group.interface.cjs +0 -0
- package/lib/directory-sync/interfaces/directory-group.interface.d.cts +0 -2
- package/lib/directory-sync/interfaces/directory-group.interface.d.ts +0 -24
- package/lib/directory-sync/interfaces/directory-group.interface.js +0 -1
- package/lib/directory-sync/interfaces/directory-user.interface.cjs +0 -0
- package/lib/directory-sync/interfaces/directory-user.interface.d.cts +0 -2
- package/lib/directory-sync/interfaces/directory-user.interface.d.ts +0 -48
- package/lib/directory-sync/interfaces/directory-user.interface.js +0 -1
- package/lib/directory-sync/interfaces/directory.interface.cjs +0 -0
- package/lib/directory-sync/interfaces/directory.interface.d.cts +0 -2
- package/lib/directory-sync/interfaces/directory.interface.d.ts +0 -60
- package/lib/directory-sync/interfaces/directory.interface.js +0 -1
- package/lib/directory-sync/interfaces/index.cjs +0 -0
- package/lib/directory-sync/interfaces/index.d.cts +0 -7
- package/lib/directory-sync/interfaces/index.d.ts +0 -7
- package/lib/directory-sync/interfaces/index.js +0 -1
- package/lib/directory-sync/interfaces/list-directories-options.interface.cjs +0 -0
- package/lib/directory-sync/interfaces/list-directories-options.interface.d.cts +0 -2
- package/lib/directory-sync/interfaces/list-directories-options.interface.d.ts +0 -14
- package/lib/directory-sync/interfaces/list-directories-options.interface.js +0 -1
- package/lib/directory-sync/interfaces/list-directory-users-options.interface.cjs +0 -0
- package/lib/directory-sync/interfaces/list-directory-users-options.interface.d.cts +0 -2
- package/lib/directory-sync/interfaces/list-directory-users-options.interface.d.ts +0 -10
- package/lib/directory-sync/interfaces/list-directory-users-options.interface.js +0 -1
- package/lib/directory-sync/interfaces/list-groups-options.interface.cjs +0 -0
- package/lib/directory-sync/interfaces/list-groups-options.interface.d.cts +0 -2
- package/lib/directory-sync/interfaces/list-groups-options.interface.d.ts +0 -10
- package/lib/directory-sync/interfaces/list-groups-options.interface.js +0 -1
- package/lib/directory-sync/serializers/directory-group.serializer.cjs +0 -4
- package/lib/directory-sync/serializers/directory-group.serializer.d.cts +0 -2
- package/lib/directory-sync/serializers/directory-group.serializer.d.ts +0 -8
- package/lib/directory-sync/serializers/directory-group.serializer.js +0 -26
- package/lib/directory-sync/serializers/directory-group.serializer.js.map +0 -1
- package/lib/directory-sync/serializers/directory-user.serializer.cjs +0 -5
- package/lib/directory-sync/serializers/directory-user.serializer.d.cts +0 -2
- package/lib/directory-sync/serializers/directory-user.serializer.d.ts +0 -9
- package/lib/directory-sync/serializers/directory-user.serializer.js +0 -46
- package/lib/directory-sync/serializers/directory-user.serializer.js.map +0 -1
- package/lib/directory-sync/serializers/directory.serializer.cjs +0 -6
- package/lib/directory-sync/serializers/directory.serializer.d.cts +0 -2
- package/lib/directory-sync/serializers/directory.serializer.d.ts +0 -10
- package/lib/directory-sync/serializers/directory.serializer.js +0 -44
- package/lib/directory-sync/serializers/directory.serializer.js.map +0 -1
- package/lib/directory-sync/serializers/index.cjs +0 -15
- package/lib/directory-sync/serializers/index.d.cts +0 -5
- package/lib/directory-sync/serializers/index.d.ts +0 -5
- package/lib/directory-sync/serializers/index.js +0 -6
- package/lib/directory-sync/serializers/list-directories-options.serializer.cjs +0 -3
- package/lib/directory-sync/serializers/list-directories-options.serializer.d.cts +0 -2
- package/lib/directory-sync/serializers/list-directories-options.serializer.d.ts +0 -7
- package/lib/directory-sync/serializers/list-directories-options.serializer.js +0 -13
- package/lib/directory-sync/serializers/list-directories-options.serializer.js.map +0 -1
- package/lib/directory-sync-DShb6WkQ.cjs +0 -46
- package/lib/directory-sync-DShb6WkQ.cjs.map +0 -1
- package/lib/directory-user.interface-jIKY1oa_.cjs +0 -0
- package/lib/directory-user.serializer-BSflXAKm.cjs +0 -63
- package/lib/directory-user.serializer-BSflXAKm.cjs.map +0 -1
- package/lib/directory-user.serializer-DdiSNHu_.d.cts +0 -9
- package/lib/directory.interface-Cx8RYw6k.cjs +0 -0
- package/lib/directory.interface-oSn1IaAq.d.cts +0 -60
- package/lib/directory.serializer-0ObI8z0b.d.cts +0 -10
- package/lib/directory.serializer-j1RV_J7z.cjs +0 -68
- package/lib/directory.serializer-j1RV_J7z.cjs.map +0 -1
- package/lib/domain-data.interface-D9PEhuHc.d.cts +0 -12
- package/lib/domain-data.interface-kHXPqpDJ.cjs +0 -16
- package/lib/domain-data.interface-kHXPqpDJ.cjs.map +0 -1
- package/lib/email-verification.interface-DoXRDBkX.d.cts +0 -42
- package/lib/email-verification.interface-eQIbonny.cjs +0 -0
- package/lib/email-verification.serializer-D3lfBeXl.d.cts +0 -8
- package/lib/email-verification.serializer-e6Mbvjvd.cjs +0 -36
- package/lib/email-verification.serializer-e6Mbvjvd.cjs.map +0 -1
- package/lib/enroll-auth-factor-options.serializer-BBfKN5IU.cjs +0 -17
- package/lib/enroll-auth-factor-options.serializer-BBfKN5IU.cjs.map +0 -1
- package/lib/enroll-auth-factor-options.serializer-h49b6m0i.d.cts +0 -7
- package/lib/enroll-auth-factor.interface-B3iA0f5-.cjs +0 -0
- package/lib/enroll-auth-factor.interface-BsXY6399.d.cts +0 -17
- package/lib/enroll-factor-options-BcgxXHrj.d.cts +0 -14
- package/lib/env-CFSscuz_.cjs +0 -62
- package/lib/env-CFSscuz_.cjs.map +0 -1
- package/lib/environment-role.interface-CF223Nhw.d.cts +0 -36
- package/lib/environment-role.interface-vp39mbJG.cjs +0 -0
- package/lib/environment-role.serializer-DbhO-b6n.cjs +0 -23
- package/lib/environment-role.serializer-DbhO-b6n.cjs.map +0 -1
- package/lib/environment-role.serializer-wsFAqA2X.d.cts +0 -7
- package/lib/event.interface-DTEEUV0a.cjs +0 -0
- package/lib/event.serializer-DQe8qLHH.cjs +0 -205
- package/lib/event.serializer-DQe8qLHH.cjs.map +0 -1
- package/lib/event.serializer-DxvBsrGU.d.cts +0 -7
- package/lib/events/events.cjs +0 -3
- package/lib/events/events.d.cts +0 -2
- package/lib/events/events.d.ts +0 -14
- package/lib/events/events.js +0 -18
- package/lib/events/events.js.map +0 -1
- package/lib/events/interfaces/index.cjs +0 -0
- package/lib/events/interfaces/index.d.cts +0 -2
- package/lib/events/interfaces/index.d.ts +0 -2
- package/lib/events/interfaces/index.js +0 -1
- package/lib/events/interfaces/list-events-options.interface.cjs +0 -0
- package/lib/events/interfaces/list-events-options.interface.d.cts +0 -2
- package/lib/events/interfaces/list-events-options.interface.d.ts +0 -22
- package/lib/events/interfaces/list-events-options.interface.js +0 -1
- package/lib/events/serializers/index.cjs +0 -3
- package/lib/events/serializers/index.d.cts +0 -2
- package/lib/events/serializers/index.d.ts +0 -2
- package/lib/events/serializers/index.js +0 -3
- package/lib/events/serializers/list-event-options.serializer.cjs +0 -3
- package/lib/events/serializers/list-event-options.serializer.d.cts +0 -2
- package/lib/events/serializers/list-event-options.serializer.d.ts +0 -7
- package/lib/events/serializers/list-event-options.serializer.js +0 -13
- package/lib/events/serializers/list-event-options.serializer.js.map +0 -1
- package/lib/events-CPdcLR1v.cjs +0 -23
- package/lib/events-CPdcLR1v.cjs.map +0 -1
- package/lib/exceptions-DHjMOdn0.cjs +0 -0
- package/lib/factor.interface-BhhyEdaN.d.cts +0 -44
- package/lib/factor.interface-Cr3vEd_Q.cjs +0 -0
- package/lib/factor.interface-TCY5UjaZ.d.cts +0 -42
- package/lib/factor.serializer-BTeTtrWD.d.cts +0 -8
- package/lib/factor.serializer-CRMo_hH_.d.cts +0 -8
- package/lib/factor.serializer-CiRgOFhH.cjs +0 -36
- package/lib/factor.serializer-CiRgOFhH.cjs.map +0 -1
- package/lib/factor.serializer-jvpYENTq.cjs +0 -37
- package/lib/factor.serializer-jvpYENTq.cjs.map +0 -1
- package/lib/factory-UI_uCpNc.cjs +0 -15
- package/lib/factory-UI_uCpNc.cjs.map +0 -1
- package/lib/factory.cjs +0 -8
- package/lib/factory.d.cts +0 -2
- package/lib/factory.d.ts +0 -83
- package/lib/factory.js +0 -10
- package/lib/factory.js.map +0 -1
- package/lib/feature-flag.interface-4Ikij0w0.d.cts +0 -28
- package/lib/feature-flag.interface-Bn_Jcnb4.cjs +0 -0
- package/lib/feature-flag.serializer-D6oOUHys.d.cts +0 -7
- package/lib/feature-flag.serializer-DqXUiZd4.cjs +0 -23
- package/lib/feature-flag.serializer-DqXUiZd4.cjs.map +0 -1
- package/lib/feature-flags/feature-flags.cjs +0 -3
- package/lib/feature-flags/feature-flags.d.cts +0 -2
- package/lib/feature-flags/feature-flags.d.ts +0 -21
- package/lib/feature-flags/feature-flags.js +0 -37
- package/lib/feature-flags/feature-flags.js.map +0 -1
- package/lib/feature-flags/interfaces/add-flag-target-options.interface.cjs +0 -0
- package/lib/feature-flags/interfaces/add-flag-target-options.interface.d.cts +0 -2
- package/lib/feature-flags/interfaces/add-flag-target-options.interface.d.ts +0 -8
- package/lib/feature-flags/interfaces/add-flag-target-options.interface.js +0 -1
- package/lib/feature-flags/interfaces/feature-flag.interface.cjs +0 -0
- package/lib/feature-flags/interfaces/feature-flag.interface.d.cts +0 -2
- package/lib/feature-flags/interfaces/feature-flag.interface.d.ts +0 -28
- package/lib/feature-flags/interfaces/feature-flag.interface.js +0 -1
- package/lib/feature-flags/interfaces/index.cjs +0 -0
- package/lib/feature-flags/interfaces/index.d.cts +0 -5
- package/lib/feature-flags/interfaces/index.d.ts +0 -5
- package/lib/feature-flags/interfaces/index.js +0 -1
- package/lib/feature-flags/interfaces/list-feature-flags-options.interface.cjs +0 -0
- package/lib/feature-flags/interfaces/list-feature-flags-options.interface.d.cts +0 -2
- package/lib/feature-flags/interfaces/list-feature-flags-options.interface.d.ts +0 -7
- package/lib/feature-flags/interfaces/list-feature-flags-options.interface.js +0 -1
- package/lib/feature-flags/interfaces/remove-flag-target-options.interface.cjs +0 -0
- package/lib/feature-flags/interfaces/remove-flag-target-options.interface.d.cts +0 -2
- package/lib/feature-flags/interfaces/remove-flag-target-options.interface.d.ts +0 -8
- package/lib/feature-flags/interfaces/remove-flag-target-options.interface.js +0 -1
- package/lib/feature-flags/serializers/feature-flag.serializer.cjs +0 -3
- package/lib/feature-flags/serializers/feature-flag.serializer.d.cts +0 -2
- package/lib/feature-flags/serializers/feature-flag.serializer.d.ts +0 -7
- package/lib/feature-flags/serializers/feature-flag.serializer.js +0 -17
- package/lib/feature-flags/serializers/feature-flag.serializer.js.map +0 -1
- package/lib/feature-flags/serializers/index.cjs +0 -3
- package/lib/feature-flags/serializers/index.d.cts +0 -2
- package/lib/feature-flags/serializers/index.d.ts +0 -2
- package/lib/feature-flags/serializers/index.js +0 -3
- package/lib/feature-flags-2wzyH7on.cjs +0 -42
- package/lib/feature-flags-2wzyH7on.cjs.map +0 -1
- package/lib/fetch-and-deserialize-list-DRAoVbMj.cjs +0 -19
- package/lib/fetch-and-deserialize-list-DRAoVbMj.cjs.map +0 -1
- package/lib/fetch-and-deserialize-wAuupni3.cjs +0 -25
- package/lib/fetch-and-deserialize-wAuupni3.cjs.map +0 -1
- package/lib/fetch-client-BGoo0snw.cjs +0 -200
- package/lib/fetch-client-BGoo0snw.cjs.map +0 -1
- package/lib/fga/fga.cjs +0 -3
- package/lib/fga/fga.d.cts +0 -2
- package/lib/fga/fga.d.ts +0 -33
- package/lib/fga/fga.js +0 -82
- package/lib/fga/fga.js.map +0 -1
- package/lib/fga/interfaces/check-op.enum.cjs +0 -3
- package/lib/fga/interfaces/check-op.enum.d.cts +0 -2
- package/lib/fga/interfaces/check-op.enum.d.ts +0 -8
- package/lib/fga/interfaces/check-op.enum.js +0 -10
- package/lib/fga/interfaces/check-op.enum.js.map +0 -1
- package/lib/fga/interfaces/check.interface.cjs +0 -3
- package/lib/fga/interfaces/check.interface.d.cts +0 -2
- package/lib/fga/interfaces/check.interface.d.ts +0 -88
- package/lib/fga/interfaces/check.interface.js +0 -28
- package/lib/fga/interfaces/check.interface.js.map +0 -1
- package/lib/fga/interfaces/index.cjs +0 -9
- package/lib/fga/interfaces/index.d.cts +0 -9
- package/lib/fga/interfaces/index.d.ts +0 -9
- package/lib/fga/interfaces/index.js +0 -6
- package/lib/fga/interfaces/list.interface.cjs +0 -0
- package/lib/fga/interfaces/list.interface.d.cts +0 -2
- package/lib/fga/interfaces/list.interface.d.ts +0 -13
- package/lib/fga/interfaces/list.interface.js +0 -1
- package/lib/fga/interfaces/query.interface.cjs +0 -0
- package/lib/fga/interfaces/query.interface.d.cts +0 -2
- package/lib/fga/interfaces/query.interface.d.ts +0 -35
- package/lib/fga/interfaces/query.interface.js +0 -1
- package/lib/fga/interfaces/resource-op.enum.cjs +0 -3
- package/lib/fga/interfaces/resource-op.enum.d.cts +0 -2
- package/lib/fga/interfaces/resource-op.enum.d.ts +0 -8
- package/lib/fga/interfaces/resource-op.enum.js +0 -10
- package/lib/fga/interfaces/resource-op.enum.js.map +0 -1
- package/lib/fga/interfaces/resource.interface.cjs +0 -0
- package/lib/fga/interfaces/resource.interface.d.cts +0 -2
- package/lib/fga/interfaces/resource.interface.d.ts +0 -77
- package/lib/fga/interfaces/resource.interface.js +0 -1
- package/lib/fga/interfaces/warning.interface.cjs +0 -0
- package/lib/fga/interfaces/warning.interface.d.cts +0 -2
- package/lib/fga/interfaces/warning.interface.d.ts +0 -13
- package/lib/fga/interfaces/warning.interface.js +0 -1
- package/lib/fga/interfaces/warrant-op.enum.cjs +0 -3
- package/lib/fga/interfaces/warrant-op.enum.d.cts +0 -2
- package/lib/fga/interfaces/warrant-op.enum.d.ts +0 -8
- package/lib/fga/interfaces/warrant-op.enum.js +0 -10
- package/lib/fga/interfaces/warrant-op.enum.js.map +0 -1
- package/lib/fga/interfaces/warrant-token.interface.cjs +0 -0
- package/lib/fga/interfaces/warrant-token.interface.d.cts +0 -2
- package/lib/fga/interfaces/warrant-token.interface.d.ts +0 -10
- package/lib/fga/interfaces/warrant-token.interface.js +0 -1
- package/lib/fga/interfaces/warrant.interface.cjs +0 -0
- package/lib/fga/interfaces/warrant.interface.d.cts +0 -2
- package/lib/fga/interfaces/warrant.interface.d.ts +0 -71
- package/lib/fga/interfaces/warrant.interface.js +0 -1
- package/lib/fga/serializers/batch-write-resources-options.serializer.cjs +0 -3
- package/lib/fga/serializers/batch-write-resources-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/batch-write-resources-options.serializer.d.ts +0 -7
- package/lib/fga/serializers/batch-write-resources-options.serializer.js +0 -18
- package/lib/fga/serializers/batch-write-resources-options.serializer.js.map +0 -1
- package/lib/fga/serializers/check-options.serializer.cjs +0 -5
- package/lib/fga/serializers/check-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/check-options.serializer.d.ts +0 -9
- package/lib/fga/serializers/check-options.serializer.js +0 -52
- package/lib/fga/serializers/check-options.serializer.js.map +0 -1
- package/lib/fga/serializers/create-resource-options.serializer.cjs +0 -3
- package/lib/fga/serializers/create-resource-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/create-resource-options.serializer.d.ts +0 -7
- package/lib/fga/serializers/create-resource-options.serializer.js +0 -12
- package/lib/fga/serializers/create-resource-options.serializer.js.map +0 -1
- package/lib/fga/serializers/delete-resource-options.serializer.cjs +0 -3
- package/lib/fga/serializers/delete-resource-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/delete-resource-options.serializer.d.ts +0 -7
- package/lib/fga/serializers/delete-resource-options.serializer.js +0 -11
- package/lib/fga/serializers/delete-resource-options.serializer.js.map +0 -1
- package/lib/fga/serializers/index.cjs +0 -30
- package/lib/fga/serializers/index.d.cts +0 -14
- package/lib/fga/serializers/index.d.ts +0 -14
- package/lib/fga/serializers/index.js +0 -15
- package/lib/fga/serializers/list-resources-options.serializer.cjs +0 -3
- package/lib/fga/serializers/list-resources-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/list-resources-options.serializer.d.ts +0 -7
- package/lib/fga/serializers/list-resources-options.serializer.js +0 -13
- package/lib/fga/serializers/list-resources-options.serializer.js.map +0 -1
- package/lib/fga/serializers/list-warrants-options.serializer.cjs +0 -3
- package/lib/fga/serializers/list-warrants-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/list-warrants-options.serializer.d.ts +0 -7
- package/lib/fga/serializers/list-warrants-options.serializer.js +0 -15
- package/lib/fga/serializers/list-warrants-options.serializer.js.map +0 -1
- package/lib/fga/serializers/list.serializer.cjs +0 -3
- package/lib/fga/serializers/list.serializer.d.cts +0 -2
- package/lib/fga/serializers/list.serializer.d.ts +0 -10
- package/lib/fga/serializers/list.serializer.js +0 -11
- package/lib/fga/serializers/list.serializer.js.map +0 -1
- package/lib/fga/serializers/query-options.serializer.cjs +0 -3
- package/lib/fga/serializers/query-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/query-options.serializer.d.ts +0 -7
- package/lib/fga/serializers/query-options.serializer.js +0 -13
- package/lib/fga/serializers/query-options.serializer.js.map +0 -1
- package/lib/fga/serializers/query-result.serializer.cjs +0 -3
- package/lib/fga/serializers/query-result.serializer.d.cts +0 -2
- package/lib/fga/serializers/query-result.serializer.d.ts +0 -12
- package/lib/fga/serializers/query-result.serializer.js +0 -22
- package/lib/fga/serializers/query-result.serializer.js.map +0 -1
- package/lib/fga/serializers/resource.serializer.cjs +0 -4
- package/lib/fga/serializers/resource.serializer.d.cts +0 -2
- package/lib/fga/serializers/resource.serializer.d.ts +0 -8
- package/lib/fga/serializers/resource.serializer.js +0 -13
- package/lib/fga/serializers/resource.serializer.js.map +0 -1
- package/lib/fga/serializers/warrant-token.serializer.cjs +0 -3
- package/lib/fga/serializers/warrant-token.serializer.d.cts +0 -2
- package/lib/fga/serializers/warrant-token.serializer.d.ts +0 -7
- package/lib/fga/serializers/warrant-token.serializer.js +0 -6
- package/lib/fga/serializers/warrant-token.serializer.js.map +0 -1
- package/lib/fga/serializers/warrant.serializer.cjs +0 -3
- package/lib/fga/serializers/warrant.serializer.d.cts +0 -2
- package/lib/fga/serializers/warrant.serializer.d.ts +0 -7
- package/lib/fga/serializers/warrant.serializer.js +0 -16
- package/lib/fga/serializers/warrant.serializer.js.map +0 -1
- package/lib/fga/serializers/write-warrant-options.serializer.cjs +0 -3
- package/lib/fga/serializers/write-warrant-options.serializer.d.cts +0 -2
- package/lib/fga/serializers/write-warrant-options.serializer.d.ts +0 -7
- package/lib/fga/serializers/write-warrant-options.serializer.js +0 -21
- package/lib/fga/serializers/write-warrant-options.serializer.js.map +0 -1
- package/lib/fga/utils/fetch-and-deserialize-list.cjs +0 -3
- package/lib/fga/utils/fetch-and-deserialize-list.d.cts +0 -10
- package/lib/fga/utils/fetch-and-deserialize-list.d.ts +0 -10
- package/lib/fga/utils/fetch-and-deserialize-list.js +0 -14
- package/lib/fga/utils/fetch-and-deserialize-list.js.map +0 -1
- package/lib/fga/utils/fga-paginatable.cjs +0 -3
- package/lib/fga/utils/fga-paginatable.d.cts +0 -2
- package/lib/fga/utils/fga-paginatable.d.ts +0 -14
- package/lib/fga/utils/fga-paginatable.js +0 -17
- package/lib/fga/utils/fga-paginatable.js.map +0 -1
- package/lib/fga/utils/interface-check.cjs +0 -4
- package/lib/fga/utils/interface-check.d.cts +0 -9
- package/lib/fga/utils/interface-check.d.ts +0 -9
- package/lib/fga/utils/interface-check.js +0 -11
- package/lib/fga/utils/interface-check.js.map +0 -1
- package/lib/fga-BPfLQ33S.cjs +0 -87
- package/lib/fga-BPfLQ33S.cjs.map +0 -1
- package/lib/fga-paginatable-C0a-1wD-.cjs +0 -22
- package/lib/fga-paginatable-C0a-1wD-.cjs.map +0 -1
- package/lib/fga-paginatable-DXVZwFzX.d.cts +0 -14
- package/lib/generate-portal-link-intent.interface-C2mac0-y.d.cts +0 -13
- package/lib/generate-portal-link-intent.interface-K2TgL9nP.cjs +0 -21
- package/lib/generate-portal-link-intent.interface-K2TgL9nP.cjs.map +0 -1
- package/lib/generic-server.exception-CQ1bI6ng.cjs +0 -22
- package/lib/generic-server.exception-CQ1bI6ng.cjs.map +0 -1
- package/lib/generic-server.exception-oSIJnqHy.d.cts +0 -14
- package/lib/get-access-token.interface-CC9W-m-U.d.cts +0 -32
- package/lib/get-access-token.serializer-BkuD5POO.cjs +0 -34
- package/lib/get-access-token.serializer-BkuD5POO.cjs.map +0 -1
- package/lib/get-authorization-resource-by-external-id-options.interface-DHwlk2AT.cjs +0 -0
- package/lib/get-authorization-resource-by-external-id-options.interface-Qnp6DQk8.d.cts +0 -9
- package/lib/get-options.interface-BsU2gWu0.d.cts +0 -11
- package/lib/get-options.interface-DjHw29Gw.cjs +0 -0
- package/lib/get-profile-and-token-options.interface-BTmM6245.d.cts +0 -14
- package/lib/get-profile-and-token-options.interface-D-t_N_S4.cjs +0 -0
- package/lib/get-profile-options.interface-BJLekz2p.d.cts +0 -7
- package/lib/get-profile-options.interface-CHz99jzH.cjs +0 -0
- package/lib/get-token-CVW25jmW.cjs +0 -23
- package/lib/get-token-CVW25jmW.cjs.map +0 -1
- package/lib/get-token-YoisQSFe.d.cts +0 -23
- package/lib/http-client-COq13zAE.d.cts +0 -56
- package/lib/http-client-DTfNcqaR.cjs +0 -96
- package/lib/http-client-DTfNcqaR.cjs.map +0 -1
- package/lib/http-client.interface-6Fw3v3Tg.d.cts +0 -24
- package/lib/http-client.interface-f2mgwQFE.cjs +0 -0
- package/lib/identity.interface-BwHBiRFv.d.cts +0 -14
- package/lib/identity.interface-CE-TyJpI.cjs +0 -0
- package/lib/identity.serializer-B-QbTGfi.cjs +0 -20
- package/lib/identity.serializer-B-QbTGfi.cjs.map +0 -1
- package/lib/impersonator.interface-CGlMZ9vr.d.cts +0 -12
- package/lib/impersonator.interface-DVfPFpHv.cjs +0 -0
- package/lib/index-1uLygO4P.d.cts +0 -1
- package/lib/index-C2USAKUY.d.cts +0 -1
- package/lib/index-CNyG9oqt.d.cts +0 -1
- package/lib/index-CTeAtTHc.d.cts +0 -1
- package/lib/index-CYPjsxnw.d.cts +0 -1
- package/lib/index-CgPSnPe-.d.cts +0 -1
- package/lib/index-ChDktAOS.d.cts +0 -1
- package/lib/index-Cj2mBhkk.d.cts +0 -1
- package/lib/index-DA_5qJSj.d.cts +0 -1
- package/lib/index-DITken1Q.d.cts +0 -1
- package/lib/index-zd2lGEmr.d.cts +0 -851
- package/lib/index.d.ts +0 -185
- package/lib/index.js +0 -68
- package/lib/index.js.map +0 -1
- package/lib/index.worker.d.ts +0 -167
- package/lib/index.worker.js +0 -63
- package/lib/index.worker.js.map +0 -1
- package/lib/interface-check-DXnd6tn3.cjs +0 -23
- package/lib/interface-check-DXnd6tn3.cjs.map +0 -1
- package/lib/interfaces-2RIrb9eZ.cjs +0 -0
- package/lib/interfaces-BhsLvV2I.cjs +0 -0
- package/lib/interfaces-Bo2cVn99.cjs +0 -0
- package/lib/interfaces-CMcTAErf.cjs +0 -0
- package/lib/interfaces-CQzl9vB6.cjs +0 -0
- package/lib/interfaces-CZMLFhDN.cjs +0 -0
- package/lib/invitation.interface-BwZhU4Nq.d.cts +0 -64
- package/lib/invitation.interface-CknczPqq.cjs +0 -0
- package/lib/invitation.serializer-B8q8nnmR.d.cts +0 -8
- package/lib/invitation.serializer-BEVUkLP9.cjs +0 -47
- package/lib/invitation.serializer-BEVUkLP9.cjs.map +0 -1
- package/lib/jose-BhyqkBqW.cjs +0 -27
- package/lib/jose-BhyqkBqW.cjs.map +0 -1
- package/lib/key.interface-CC2uD6p4.cjs +0 -0
- package/lib/key.interface-YLV_plqn.d.cts +0 -16
- package/lib/leb128-DvqSoSLE.cjs +0 -82
- package/lib/leb128-DvqSoSLE.cjs.map +0 -1
- package/lib/list-auth-factors-options.interface-BaWRr4HX.cjs +0 -0
- package/lib/list-authorization-resources-options.interface-B3sf3hOh.cjs +0 -0
- package/lib/list-authorization-resources-options.interface-Bi7-RuXa.d.cts +0 -22
- package/lib/list-authorization-resources-options.serializer-B2GBZjY-.d.cts +0 -7
- package/lib/list-authorization-resources-options.serializer-DvKRcWey.cjs +0 -21
- package/lib/list-authorization-resources-options.serializer-DvKRcWey.cjs.map +0 -1
- package/lib/list-connections-options.interface-B4o7Dg7E.cjs +0 -0
- package/lib/list-connections-options.interface-DMjyCQNt.d.cts +0 -17
- package/lib/list-connections-options.serializer-B9jyhBCh.cjs +0 -20
- package/lib/list-connections-options.serializer-B9jyhBCh.cjs.map +0 -1
- package/lib/list-connections-options.serializer-C2ETSFny.d.cts +0 -7
- package/lib/list-directories-options.interface-BQt9KBRx.d.cts +0 -14
- package/lib/list-directories-options.interface-CQga5gNx.cjs +0 -0
- package/lib/list-directories-options.serializer-C9gqK1ls.d.cts +0 -7
- package/lib/list-directories-options.serializer-DIkuNuJB.cjs +0 -19
- package/lib/list-directories-options.serializer-DIkuNuJB.cjs.map +0 -1
- package/lib/list-directory-users-options.interface-DoyU-KHK.d.cts +0 -10
- package/lib/list-directory-users-options.interface-bRKoi3uh.cjs +0 -0
- package/lib/list-event-options.serializer-BMuLbsuv.cjs +0 -19
- package/lib/list-event-options.serializer-BMuLbsuv.cjs.map +0 -1
- package/lib/list-event-options.serializer-URqDPrTi.d.cts +0 -7
- package/lib/list-events-options.interface-CT1WzVzZ.d.cts +0 -22
- package/lib/list-events-options.interface-DlD8hbg-.cjs +0 -0
- package/lib/list-feature-flags-options.interface-BuAGocb_.cjs +0 -0
- package/lib/list-groups-options.interface-BkzhnP23.cjs +0 -0
- package/lib/list-groups-options.interface-b3GVqSII.d.cts +0 -10
- package/lib/list-invitations-options.interface-ANMijoDj.cjs +0 -0
- package/lib/list-invitations-options.serializer-BjpU4ZDR.cjs +0 -19
- package/lib/list-invitations-options.serializer-BjpU4ZDR.cjs.map +0 -1
- package/lib/list-memberships-for-resource-by-external-id-options.interface-DVmCOuB-.cjs +0 -0
- package/lib/list-memberships-for-resource-by-external-id-options.interface-J1_qZirj.d.cts +0 -13
- package/lib/list-memberships-for-resource-options.interface-9ATHNNdH.cjs +0 -0
- package/lib/list-memberships-for-resource-options.interface-WKyR83kP.d.cts +0 -11
- package/lib/list-memberships-for-resource-options.serializer-aQpL3LF9.d.cts +0 -9
- package/lib/list-memberships-for-resource-options.serializer-iaykx8Lw.cjs +0 -17
- package/lib/list-memberships-for-resource-options.serializer-iaykx8Lw.cjs.map +0 -1
- package/lib/list-object-versions.interface-7bMXekXS.cjs +0 -0
- package/lib/list-object-versions.interface-CbrhRrmz.d.cts +0 -12
- package/lib/list-objects.interface-CtunUutg.d.cts +0 -9
- package/lib/list-objects.interface-Df3gsh5f.cjs +0 -0
- package/lib/list-organization-api-keys-options.interface-7oL0NhBo.cjs +0 -0
- package/lib/list-organization-api-keys-options.interface-CsxRRYj6.d.cts +0 -9
- package/lib/list-organization-feature-flags-options.interface-CS56ReAC.cjs +0 -0
- package/lib/list-organization-feature-flags-options.interface-PoBPTz4g.d.cts +0 -9
- package/lib/list-organization-memberships-options.interface-2VAVS67L.cjs +0 -0
- package/lib/list-organization-memberships-options.serializer-CLDG_9Kn.cjs +0 -20
- package/lib/list-organization-memberships-options.serializer-CLDG_9Kn.cjs.map +0 -1
- package/lib/list-organization-roles-options.interface-DejI9E8H.d.cts +0 -7
- package/lib/list-organizations-options.interface-B1M5Od_m.cjs +0 -0
- package/lib/list-organizations-options.interface-Bwx3In4U.d.cts +0 -9
- package/lib/list-permissions-options.interface-CgVHKqiN.cjs +0 -0
- package/lib/list-resources-for-membership-options.interface-1dSllzkH.cjs +0 -0
- package/lib/list-resources-for-membership-options.interface-CCuX2l-i.d.cts +0 -24
- package/lib/list-resources-for-membership-options.serializer-01hwgS6y.d.cts +0 -7
- package/lib/list-resources-for-membership-options.serializer-6TItLFPj.cjs +0 -21
- package/lib/list-resources-for-membership-options.serializer-6TItLFPj.cjs.map +0 -1
- package/lib/list-resources-options.serializer-DGVmkcZe.d.cts +0 -7
- package/lib/list-resources-options.serializer-iHnbemUA.cjs +0 -19
- package/lib/list-resources-options.serializer-iHnbemUA.cjs.map +0 -1
- package/lib/list-role-assignments-options.interface-DF9W0Crg.cjs +0 -0
- package/lib/list-role-assignments-options.interface-G1byAUOU.d.cts +0 -9
- package/lib/list-sessions-options.interface-BR3oWxBU.cjs +0 -0
- package/lib/list-sessions-options.interface-CZdBtY49.d.cts +0 -8
- package/lib/list-sessions-options.serializer-Cx_PvDl8.d.cts +0 -7
- package/lib/list-sessions-options.serializer-DXI2uV_8.cjs +0 -12
- package/lib/list-sessions-options.serializer-DXI2uV_8.cjs.map +0 -1
- package/lib/list-user-feature-flags-options.interface-BjORmo6E.cjs +0 -0
- package/lib/list-users-options.interface-BGH7eAhH.cjs +0 -0
- package/lib/list-users-options.interface-Bmgojx_R.d.cts +0 -14
- package/lib/list-users-options.serializer-4-_RN0tZ.cjs +0 -19
- package/lib/list-users-options.serializer-4-_RN0tZ.cjs.map +0 -1
- package/lib/list-warrants-options.serializer-CQnwwLKg.cjs +0 -21
- package/lib/list-warrants-options.serializer-CQnwwLKg.cjs.map +0 -1
- package/lib/list-warrants-options.serializer-DDlu-iU1.d.cts +0 -7
- package/lib/list.interface-Bbp2ZBpM.d.cts +0 -13
- package/lib/list.interface-Ch7SsnDq.cjs +0 -0
- package/lib/list.interface-I2r4xhuH.d.cts +0 -20
- package/lib/list.serializer-C0xM3Q5_.d.cts +0 -10
- package/lib/list.serializer-DIHSqY98.cjs +0 -17
- package/lib/list.serializer-DIHSqY98.cjs.map +0 -1
- package/lib/list.serializer-DILm4JiZ.d.cts +0 -7
- package/lib/list.serializer-DMdl1FBx.cjs +0 -16
- package/lib/list.serializer-DMdl1FBx.cjs.map +0 -1
- package/lib/locale.interface-BDuI7VXX.d.cts +0 -5
- package/lib/locale.interface-DwCivlkF.cjs +0 -0
- package/lib/logout-url-options.interface-BOLd7ZRi.d.cts +0 -8
- package/lib/logout-url-options.interface-CW7A-s1Y.cjs +0 -0
- package/lib/magic-auth.interface-CtOudjuJ.cjs +0 -0
- package/lib/magic-auth.interface-DGn4_Ctk.d.cts +0 -42
- package/lib/magic-auth.serializer-By4HyvgZ.cjs +0 -36
- package/lib/magic-auth.serializer-By4HyvgZ.cjs.map +0 -1
- package/lib/magic-auth.serializer-Cmv0WqFM.d.cts +0 -8
- package/lib/mfa/interfaces/challenge-factor-options.cjs +0 -0
- package/lib/mfa/interfaces/challenge-factor-options.d.cts +0 -2
- package/lib/mfa/interfaces/challenge-factor-options.d.ts +0 -10
- package/lib/mfa/interfaces/challenge-factor-options.js +0 -1
- package/lib/mfa/interfaces/challenge.interface.cjs +0 -0
- package/lib/mfa/interfaces/challenge.interface.d.cts +0 -2
- package/lib/mfa/interfaces/challenge.interface.d.ts +0 -22
- package/lib/mfa/interfaces/challenge.interface.js +0 -1
- package/lib/mfa/interfaces/enroll-factor-options.cjs +0 -0
- package/lib/mfa/interfaces/enroll-factor-options.d.cts +0 -2
- package/lib/mfa/interfaces/enroll-factor-options.d.ts +0 -14
- package/lib/mfa/interfaces/enroll-factor-options.js +0 -1
- package/lib/mfa/interfaces/factor.interface.cjs +0 -0
- package/lib/mfa/interfaces/factor.interface.d.cts +0 -2
- package/lib/mfa/interfaces/factor.interface.d.ts +0 -44
- package/lib/mfa/interfaces/factor.interface.js +0 -1
- package/lib/mfa/interfaces/index.cjs +0 -8
- package/lib/mfa/interfaces/index.d.cts +0 -9
- package/lib/mfa/interfaces/index.d.ts +0 -9
- package/lib/mfa/interfaces/index.js +0 -1
- package/lib/mfa/interfaces/sms.interface.cjs +0 -0
- package/lib/mfa/interfaces/sms.interface.d.cts +0 -2
- package/lib/mfa/interfaces/sms.interface.d.ts +0 -10
- package/lib/mfa/interfaces/sms.interface.js +0 -1
- package/lib/mfa/interfaces/totp.interface.cjs +0 -0
- package/lib/mfa/interfaces/totp.interface.d.cts +0 -2
- package/lib/mfa/interfaces/totp.interface.d.ts +0 -22
- package/lib/mfa/interfaces/totp.interface.js +0 -1
- package/lib/mfa/interfaces/verify-challenge-options.cjs +0 -0
- package/lib/mfa/interfaces/verify-challenge-options.d.cts +0 -2
- package/lib/mfa/interfaces/verify-challenge-options.d.ts +0 -8
- package/lib/mfa/interfaces/verify-challenge-options.js +0 -1
- package/lib/mfa/interfaces/verify-challenge-response.cjs +0 -0
- package/lib/mfa/interfaces/verify-challenge-response.d.cts +0 -2
- package/lib/mfa/interfaces/verify-challenge-response.d.ts +0 -14
- package/lib/mfa/interfaces/verify-challenge-response.js +0 -1
- package/lib/mfa/mfa.cjs +0 -3
- package/lib/mfa/mfa.d.cts +0 -2
- package/lib/mfa/mfa.d.ts +0 -21
- package/lib/mfa/mfa.js +0 -45
- package/lib/mfa/mfa.js.map +0 -1
- package/lib/mfa/serializers/challenge.serializer.cjs +0 -3
- package/lib/mfa/serializers/challenge.serializer.d.cts +0 -2
- package/lib/mfa/serializers/challenge.serializer.d.ts +0 -7
- package/lib/mfa/serializers/challenge.serializer.js +0 -14
- package/lib/mfa/serializers/challenge.serializer.js.map +0 -1
- package/lib/mfa/serializers/factor.serializer.cjs +0 -4
- package/lib/mfa/serializers/factor.serializer.d.cts +0 -2
- package/lib/mfa/serializers/factor.serializer.d.ts +0 -8
- package/lib/mfa/serializers/factor.serializer.js +0 -26
- package/lib/mfa/serializers/factor.serializer.js.map +0 -1
- package/lib/mfa/serializers/index.cjs +0 -8
- package/lib/mfa/serializers/index.d.cts +0 -4
- package/lib/mfa/serializers/index.d.ts +0 -4
- package/lib/mfa/serializers/index.js +0 -5
- package/lib/mfa/serializers/sms.serializer.cjs +0 -3
- package/lib/mfa/serializers/sms.serializer.d.cts +0 -7
- package/lib/mfa/serializers/sms.serializer.d.ts +0 -7
- package/lib/mfa/serializers/sms.serializer.js +0 -6
- package/lib/mfa/serializers/sms.serializer.js.map +0 -1
- package/lib/mfa/serializers/totp.serializer.cjs +0 -4
- package/lib/mfa/serializers/totp.serializer.d.cts +0 -8
- package/lib/mfa/serializers/totp.serializer.d.ts +0 -8
- package/lib/mfa/serializers/totp.serializer.js +0 -20
- package/lib/mfa/serializers/totp.serializer.js.map +0 -1
- package/lib/mfa/serializers/verify-response.serializer.cjs +0 -3
- package/lib/mfa/serializers/verify-response.serializer.d.cts +0 -2
- package/lib/mfa/serializers/verify-response.serializer.d.ts +0 -7
- package/lib/mfa/serializers/verify-response.serializer.js +0 -11
- package/lib/mfa/serializers/verify-response.serializer.js.map +0 -1
- package/lib/mfa-Ck3-dTm_.cjs +0 -50
- package/lib/mfa-Ck3-dTm_.cjs.map +0 -1
- package/lib/no-api-key-provided.exception-CAJnPlPr.cjs +0 -16
- package/lib/no-api-key-provided.exception-CAJnPlPr.cjs.map +0 -1
- package/lib/no-api-key-provided.exception-D4MBm8QH.d.cts +0 -9
- package/lib/not-found.exception-BcKq0hWv.cjs +0 -24
- package/lib/not-found.exception-BcKq0hWv.cjs.map +0 -1
- package/lib/not-found.exception-CTDvvvLQ.d.cts +0 -24
- package/lib/oauth-tokens.interface--rFwkKXb.d.cts +0 -16
- package/lib/oauth-tokens.interface-CxNP7L-L.cjs +0 -0
- package/lib/oauth-tokens.serializer-BmyyKwrh.cjs +0 -17
- package/lib/oauth-tokens.serializer-BmyyKwrh.cjs.map +0 -1
- package/lib/oauth.exception-BJAv3tg-.cjs +0 -25
- package/lib/oauth.exception-BJAv3tg-.cjs.map +0 -1
- package/lib/oauth.exception-DsPKFu_J.d.cts +0 -15
- package/lib/object.interface-CBgtGtyU.cjs +0 -0
- package/lib/object.interface-Do9xg7Zv.d.cts +0 -35
- package/lib/organization-domain.interface-D9DJtORe.cjs +0 -28
- package/lib/organization-domain.interface-D9DJtORe.cjs.map +0 -1
- package/lib/organization-domain.interface-DCWcsWrJ.d.cts +0 -35
- package/lib/organization-domain.serializer-DVylNcLm.cjs +0 -22
- package/lib/organization-domain.serializer-DVylNcLm.cjs.map +0 -1
- package/lib/organization-domains/interfaces/create-organization-domain-options.interface.cjs +0 -0
- package/lib/organization-domains/interfaces/create-organization-domain-options.interface.d.cts +0 -2
- package/lib/organization-domains/interfaces/create-organization-domain-options.interface.d.ts +0 -12
- package/lib/organization-domains/interfaces/create-organization-domain-options.interface.js +0 -1
- package/lib/organization-domains/interfaces/index.cjs +0 -4
- package/lib/organization-domains/interfaces/index.d.cts +0 -3
- package/lib/organization-domains/interfaces/index.d.ts +0 -3
- package/lib/organization-domains/interfaces/index.js +0 -3
- package/lib/organization-domains/interfaces/organization-domain.interface.cjs +0 -4
- package/lib/organization-domains/interfaces/organization-domain.interface.d.cts +0 -2
- package/lib/organization-domains/interfaces/organization-domain.interface.d.ts +0 -35
- package/lib/organization-domains/interfaces/organization-domain.interface.js +0 -16
- package/lib/organization-domains/interfaces/organization-domain.interface.js.map +0 -1
- package/lib/organization-domains/organization-domains.cjs +0 -3
- package/lib/organization-domains/organization-domains.d.cts +0 -2
- package/lib/organization-domains/organization-domains.d.ts +0 -16
- package/lib/organization-domains/organization-domains.js +0 -28
- package/lib/organization-domains/organization-domains.js.map +0 -1
- package/lib/organization-domains/serializers/create-organization-domain-options.serializer.cjs +0 -3
- package/lib/organization-domains/serializers/create-organization-domain-options.serializer.d.cts +0 -7
- package/lib/organization-domains/serializers/create-organization-domain-options.serializer.d.ts +0 -7
- package/lib/organization-domains/serializers/create-organization-domain-options.serializer.js +0 -9
- package/lib/organization-domains/serializers/create-organization-domain-options.serializer.js.map +0 -1
- package/lib/organization-domains/serializers/organization-domain.serializer.cjs +0 -3
- package/lib/organization-domains/serializers/organization-domain.serializer.d.cts +0 -7
- package/lib/organization-domains/serializers/organization-domain.serializer.d.ts +0 -7
- package/lib/organization-domains/serializers/organization-domain.serializer.js +0 -16
- package/lib/organization-domains/serializers/organization-domain.serializer.js.map +0 -1
- package/lib/organization-domains-DhcxuHzd.cjs +0 -33
- package/lib/organization-domains-DhcxuHzd.cjs.map +0 -1
- package/lib/organization-membership.interface-CUF7HzwC.cjs +0 -0
- package/lib/organization-membership.serializer-CgjS5BwK.cjs +0 -40
- package/lib/organization-membership.serializer-CgjS5BwK.cjs.map +0 -1
- package/lib/organization-role.interface-B3bzv4On.d.cts +0 -16
- package/lib/organization-role.interface-HnEQVE0J.cjs +0 -0
- package/lib/organization-role.serializer-6bXBqqj5.cjs +0 -58
- package/lib/organization-role.serializer-6bXBqqj5.cjs.map +0 -1
- package/lib/organization-role.serializer-hZNZRrOm.d.cts +0 -10
- package/lib/organization.interface-B_xvfP51.cjs +0 -0
- package/lib/organization.interface-Dxz3SLtZ.d.cts +0 -30
- package/lib/organization.serializer-CVNQSfQH.cjs +0 -24
- package/lib/organization.serializer-CVNQSfQH.cjs.map +0 -1
- package/lib/organization.serializer-DS1-IEd8.d.cts +0 -7
- package/lib/organizations/interfaces/create-organization-options.interface.cjs +0 -0
- package/lib/organizations/interfaces/create-organization-options.interface.d.cts +0 -2
- package/lib/organizations/interfaces/create-organization-options.interface.d.ts +0 -20
- package/lib/organizations/interfaces/create-organization-options.interface.js +0 -1
- package/lib/organizations/interfaces/domain-data.interface.cjs +0 -3
- package/lib/organizations/interfaces/domain-data.interface.d.cts +0 -2
- package/lib/organizations/interfaces/domain-data.interface.d.ts +0 -12
- package/lib/organizations/interfaces/domain-data.interface.js +0 -10
- package/lib/organizations/interfaces/domain-data.interface.js.map +0 -1
- package/lib/organizations/interfaces/index.cjs +0 -3
- package/lib/organizations/interfaces/index.d.cts +0 -7
- package/lib/organizations/interfaces/index.d.ts +0 -7
- package/lib/organizations/interfaces/index.js +0 -3
- package/lib/organizations/interfaces/list-organization-feature-flags-options.interface.cjs +0 -0
- package/lib/organizations/interfaces/list-organization-feature-flags-options.interface.d.cts +0 -2
- package/lib/organizations/interfaces/list-organization-feature-flags-options.interface.d.ts +0 -9
- package/lib/organizations/interfaces/list-organization-feature-flags-options.interface.js +0 -1
- package/lib/organizations/interfaces/list-organization-roles-options.interface.cjs +0 -0
- package/lib/organizations/interfaces/list-organization-roles-options.interface.d.cts +0 -2
- package/lib/organizations/interfaces/list-organization-roles-options.interface.d.ts +0 -7
- package/lib/organizations/interfaces/list-organization-roles-options.interface.js +0 -1
- package/lib/organizations/interfaces/list-organizations-options.interface.cjs +0 -0
- package/lib/organizations/interfaces/list-organizations-options.interface.d.cts +0 -2
- package/lib/organizations/interfaces/list-organizations-options.interface.d.ts +0 -9
- package/lib/organizations/interfaces/list-organizations-options.interface.js +0 -1
- package/lib/organizations/interfaces/organization.interface.cjs +0 -0
- package/lib/organizations/interfaces/organization.interface.d.cts +0 -2
- package/lib/organizations/interfaces/organization.interface.d.ts +0 -30
- package/lib/organizations/interfaces/organization.interface.js +0 -1
- package/lib/organizations/interfaces/update-organization-options.interface.cjs +0 -0
- package/lib/organizations/interfaces/update-organization-options.interface.d.cts +0 -2
- package/lib/organizations/interfaces/update-organization-options.interface.d.ts +0 -21
- package/lib/organizations/interfaces/update-organization-options.interface.js +0 -1
- package/lib/organizations/organizations.cjs +0 -3
- package/lib/organizations/organizations.d.cts +0 -2
- package/lib/organizations/organizations.d.ts +0 -33
- package/lib/organizations/organizations.js +0 -65
- package/lib/organizations/organizations.js.map +0 -1
- package/lib/organizations/serializers/create-organization-options.serializer.cjs +0 -3
- package/lib/organizations/serializers/create-organization-options.serializer.d.cts +0 -2
- package/lib/organizations/serializers/create-organization-options.serializer.d.ts +0 -7
- package/lib/organizations/serializers/create-organization-options.serializer.js +0 -11
- package/lib/organizations/serializers/create-organization-options.serializer.js.map +0 -1
- package/lib/organizations/serializers/index.cjs +0 -7
- package/lib/organizations/serializers/index.d.cts +0 -4
- package/lib/organizations/serializers/index.d.ts +0 -4
- package/lib/organizations/serializers/index.js +0 -5
- package/lib/organizations/serializers/organization.serializer.cjs +0 -3
- package/lib/organizations/serializers/organization.serializer.d.cts +0 -2
- package/lib/organizations/serializers/organization.serializer.d.ts +0 -7
- package/lib/organizations/serializers/organization.serializer.js +0 -19
- package/lib/organizations/serializers/organization.serializer.js.map +0 -1
- package/lib/organizations/serializers/update-organization-options.serializer.cjs +0 -3
- package/lib/organizations/serializers/update-organization-options.serializer.d.cts +0 -2
- package/lib/organizations/serializers/update-organization-options.serializer.d.ts +0 -7
- package/lib/organizations/serializers/update-organization-options.serializer.js +0 -12
- package/lib/organizations/serializers/update-organization-options.serializer.js.map +0 -1
- package/lib/organizations-Cj9rLRWq.cjs +0 -70
- package/lib/organizations-Cj9rLRWq.cjs.map +0 -1
- package/lib/package.js +0 -6
- package/lib/package.js.map +0 -1
- package/lib/pagination-B70j26ip.d.cts +0 -25
- package/lib/pagination-BG1uBuL4.cjs +0 -48
- package/lib/pagination-BG1uBuL4.cjs.map +0 -1
- package/lib/pagination-options.interface-865FT6y0.cjs +0 -0
- package/lib/pagination-options.interface-BzIEA3yY.d.cts +0 -10
- package/lib/pagination-options.serializer-1IbIwtWv.d.cts +0 -7
- package/lib/pagination-options.serializer-BpBYvO9v.cjs +0 -17
- package/lib/pagination-options.serializer-BpBYvO9v.cjs.map +0 -1
- package/lib/parse-error-Dr-zK4Ai.cjs +0 -24
- package/lib/parse-error-Dr-zK4Ai.cjs.map +0 -1
- package/lib/password-hash-type.interface-DjrfV612.d.cts +0 -5
- package/lib/password-reset.interface-5Hk5_t85.d.cts +0 -40
- package/lib/password-reset.interface-Cx8n6T9V.cjs +0 -0
- package/lib/password-reset.serializer-C_NzVwDv.d.cts +0 -8
- package/lib/password-reset.serializer-D8Kbnirv.cjs +0 -35
- package/lib/password-reset.serializer-D8Kbnirv.cjs.map +0 -1
- package/lib/passwordless/interfaces/create-passwordless-session-options.interface.cjs +0 -0
- package/lib/passwordless/interfaces/create-passwordless-session-options.interface.d.cts +0 -2
- package/lib/passwordless/interfaces/create-passwordless-session-options.interface.d.ts +0 -20
- package/lib/passwordless/interfaces/create-passwordless-session-options.interface.js +0 -1
- package/lib/passwordless/interfaces/index.cjs +0 -0
- package/lib/passwordless/interfaces/index.d.cts +0 -4
- package/lib/passwordless/interfaces/index.d.ts +0 -4
- package/lib/passwordless/interfaces/index.js +0 -1
- package/lib/passwordless/interfaces/passwordless-session.interface.cjs +0 -0
- package/lib/passwordless/interfaces/passwordless-session.interface.d.cts +0 -2
- package/lib/passwordless/interfaces/passwordless-session.interface.d.ts +0 -18
- package/lib/passwordless/interfaces/passwordless-session.interface.js +0 -1
- package/lib/passwordless/interfaces/send-session-response.interface.cjs +0 -0
- package/lib/passwordless/interfaces/send-session-response.interface.d.cts +0 -2
- package/lib/passwordless/interfaces/send-session-response.interface.d.ts +0 -8
- package/lib/passwordless/interfaces/send-session-response.interface.js +0 -1
- package/lib/passwordless/passwordless.cjs +0 -3
- package/lib/passwordless/passwordless.d.cts +0 -2
- package/lib/passwordless/passwordless.d.ts +0 -19
- package/lib/passwordless/passwordless.js +0 -24
- package/lib/passwordless/passwordless.js.map +0 -1
- package/lib/passwordless/serializers/index.cjs +0 -0
- package/lib/passwordless/serializers/index.d.cts +0 -1
- package/lib/passwordless/serializers/index.d.ts +0 -1
- package/lib/passwordless/serializers/index.js +0 -1
- package/lib/passwordless/serializers/passwordless-session.serializer.cjs +0 -3
- package/lib/passwordless/serializers/passwordless-session.serializer.d.cts +0 -7
- package/lib/passwordless/serializers/passwordless-session.serializer.d.ts +0 -7
- package/lib/passwordless/serializers/passwordless-session.serializer.js +0 -12
- package/lib/passwordless/serializers/passwordless-session.serializer.js.map +0 -1
- package/lib/passwordless-Cbbfvvgq.cjs +0 -29
- package/lib/passwordless-Cbbfvvgq.cjs.map +0 -1
- package/lib/passwordless-session.interface-BPmUhUA4.cjs +0 -0
- package/lib/passwordless-session.interface-BPynm7tz.d.cts +0 -18
- package/lib/passwordless-session.serializer-Buh50Btt.cjs +0 -18
- package/lib/passwordless-session.serializer-Buh50Btt.cjs.map +0 -1
- package/lib/patch-options.interface-CgLPAxTh.cjs +0 -0
- package/lib/patch-options.interface-sduP5vFr.d.cts +0 -12
- package/lib/permission.interface-D9G_Tf6C.cjs +0 -0
- package/lib/permission.interface-OPWiA8hK.d.cts +0 -42
- package/lib/permission.serializer-Bw7vv2Ur.d.cts +0 -7
- package/lib/permission.serializer-Cxa376w7.cjs +0 -22
- package/lib/permission.serializer-Cxa376w7.cjs.map +0 -1
- package/lib/pipes/interfaces/access-token.interface.cjs +0 -0
- package/lib/pipes/interfaces/access-token.interface.d.cts +0 -2
- package/lib/pipes/interfaces/access-token.interface.d.ts +0 -18
- package/lib/pipes/interfaces/access-token.interface.js +0 -1
- package/lib/pipes/interfaces/get-access-token.interface.cjs +0 -0
- package/lib/pipes/interfaces/get-access-token.interface.d.cts +0 -2
- package/lib/pipes/interfaces/get-access-token.interface.d.ts +0 -32
- package/lib/pipes/interfaces/get-access-token.interface.js +0 -1
- package/lib/pipes/pipes.cjs +0 -3
- package/lib/pipes/pipes.d.cts +0 -2
- package/lib/pipes/pipes.d.ts +0 -17
- package/lib/pipes/pipes.js +0 -16
- package/lib/pipes/pipes.js.map +0 -1
- package/lib/pipes/serializers/access-token.serializer.cjs +0 -3
- package/lib/pipes/serializers/access-token.serializer.d.cts +0 -7
- package/lib/pipes/serializers/access-token.serializer.d.ts +0 -7
- package/lib/pipes/serializers/access-token.serializer.js +0 -14
- package/lib/pipes/serializers/access-token.serializer.js.map +0 -1
- package/lib/pipes/serializers/get-access-token.serializer.cjs +0 -4
- package/lib/pipes/serializers/get-access-token.serializer.d.cts +0 -8
- package/lib/pipes/serializers/get-access-token.serializer.d.ts +0 -8
- package/lib/pipes/serializers/get-access-token.serializer.js +0 -23
- package/lib/pipes/serializers/get-access-token.serializer.js.map +0 -1
- package/lib/pipes-C6PJAgY4.cjs +0 -21
- package/lib/pipes-C6PJAgY4.cjs.map +0 -1
- package/lib/pkce/pkce.cjs +0 -3
- package/lib/pkce/pkce.d.cts +0 -2
- package/lib/pkce/pkce.d.ts +0 -38
- package/lib/pkce/pkce.js +0 -53
- package/lib/pkce/pkce.js.map +0 -1
- package/lib/pkce-BNs390-T.d.cts +0 -38
- package/lib/pkce-Bu_KcDMw.cjs +0 -59
- package/lib/pkce-Bu_KcDMw.cjs.map +0 -1
- package/lib/portal/interfaces/generate-portal-link-intent.interface.cjs +0 -3
- package/lib/portal/interfaces/generate-portal-link-intent.interface.d.cts +0 -2
- package/lib/portal/interfaces/generate-portal-link-intent.interface.d.ts +0 -13
- package/lib/portal/interfaces/generate-portal-link-intent.interface.js +0 -15
- package/lib/portal/interfaces/generate-portal-link-intent.interface.js.map +0 -1
- package/lib/portal/interfaces/index.cjs +0 -3
- package/lib/portal/interfaces/index.d.cts +0 -2
- package/lib/portal/interfaces/index.d.ts +0 -2
- package/lib/portal/interfaces/index.js +0 -3
- package/lib/portal/portal.cjs +0 -3
- package/lib/portal/portal.d.cts +0 -2
- package/lib/portal/portal.d.ts +0 -24
- package/lib/portal/portal.js +0 -19
- package/lib/portal/portal.js.map +0 -1
- package/lib/portal-Bw4FWwRi.cjs +0 -25
- package/lib/portal-Bw4FWwRi.cjs.map +0 -1
- package/lib/post-options.interface-8YBGzFMW.cjs +0 -0
- package/lib/post-options.interface-BR5jQA4x.d.cts +0 -13
- package/lib/profile-and-token.interface-B7LtTM4T.cjs +0 -0
- package/lib/profile-and-token.serializer-DfWI_L92.cjs +0 -18
- package/lib/profile-and-token.serializer-DfWI_L92.cjs.map +0 -1
- package/lib/profile-and-token.serializer-Zr1vKJjC.d.cts +0 -8
- package/lib/profile.interface-Ikyg1dXV.cjs +0 -0
- package/lib/profile.serializer-BjxW-2CT.d.cts +0 -8
- package/lib/profile.serializer-DM0Zpbrc.cjs +0 -26
- package/lib/profile.serializer-DM0Zpbrc.cjs.map +0 -1
- package/lib/put-options.interface-DyDiwQjk.cjs +0 -0
- package/lib/put-options.interface-VXax1_sR.d.cts +0 -12
- package/lib/query-options.serializer-B3PH3QRw.cjs +0 -19
- package/lib/query-options.serializer-B3PH3QRw.cjs.map +0 -1
- package/lib/query-options.serializer-DffmenXK.d.cts +0 -7
- package/lib/query-result.serializer-DFKCaIAe.d.cts +0 -12
- package/lib/query-result.serializer-DvOD-ib6.cjs +0 -28
- package/lib/query-result.serializer-DvOD-ib6.cjs.map +0 -1
- package/lib/query-string-DJDFy7sp.cjs +0 -40
- package/lib/query-string-DJDFy7sp.cjs.map +0 -1
- package/lib/query.interface-Bn03fUFS.d.cts +0 -35
- package/lib/query.interface-DtqCj1pM.cjs +0 -0
- package/lib/rate-limit-exceeded.exception-BkM54IsX.d.cts +0 -18
- package/lib/rate-limit-exceeded.exception-DwIKSjgt.cjs +0 -19
- package/lib/rate-limit-exceeded.exception-DwIKSjgt.cjs.map +0 -1
- package/lib/read-object.interface-DxLLeoRt.cjs +0 -0
- package/lib/read-object.interface-iqgpJxLj.d.cts +0 -25
- package/lib/refresh-and-seal-session-data.interface-BQRY5jDN.cjs +0 -19
- package/lib/refresh-and-seal-session-data.interface-BQRY5jDN.cjs.map +0 -1
- package/lib/refresh-and-seal-session-data.interface-CfKqrf2N.d.cts +0 -24
- package/lib/remove-flag-target-options.interface-D4j_miMD.d.cts +0 -8
- package/lib/remove-flag-target-options.interface-DyBUaupv.cjs +0 -0
- package/lib/remove-organization-role-permission-options.interface-B5nIrOvq.cjs +0 -0
- package/lib/remove-organization-role-permission-options.interface-wLcPXpuW.d.cts +0 -7
- package/lib/remove-role-assignment-options.interface-Bdsr91u1.cjs +0 -0
- package/lib/remove-role-assignment-options.interface-D0qpb2wr.d.cts +0 -8
- package/lib/remove-role-options.interface-C05Tjj04.d.cts +0 -19
- package/lib/remove-role-options.interface-aSK65AAy.cjs +0 -0
- package/lib/remove-role-options.serializer-D_YKoTt5.cjs +0 -19
- package/lib/remove-role-options.serializer-D_YKoTt5.cjs.map +0 -1
- package/lib/remove-role-options.serializer-MXH-zTEQ.d.cts +0 -7
- package/lib/request-exception.interface-CuuezHgg.d.cts +0 -9
- package/lib/resend-invitation-options.interface-5-DjRWwi.d.cts +0 -12
- package/lib/resend-invitation-options.interface-CRNqm7lR.cjs +0 -0
- package/lib/resend-invitation-options.serializer-Bm4mW-1L.cjs +0 -12
- package/lib/resend-invitation-options.serializer-Bm4mW-1L.cjs.map +0 -1
- package/lib/reset-password-options.interface-DAmF6JPe.cjs +0 -0
- package/lib/reset-password-options.interface-DR1PHcVr.d.cts +0 -12
- package/lib/reset-password-options.serializer-6VTahIzL.cjs +0 -15
- package/lib/reset-password-options.serializer-6VTahIzL.cjs.map +0 -1
- package/lib/reset-password-options.serializer-B-yKukZL.d.cts +0 -7
- package/lib/resource-op.enum-DpcuVeOX.d.cts +0 -8
- package/lib/resource-op.enum-lyCNZOG-.cjs +0 -16
- package/lib/resource-op.enum-lyCNZOG-.cjs.map +0 -1
- package/lib/resource.interface-1aq4-7ME.cjs +0 -0
- package/lib/resource.interface-DdilIYi7.d.cts +0 -77
- package/lib/resource.serializer-C3woPtVQ.cjs +0 -25
- package/lib/resource.serializer-C3woPtVQ.cjs.map +0 -1
- package/lib/resource.serializer-Das8RBBH.d.cts +0 -8
- package/lib/response-payload.interface-BxqIcrma.d.cts +0 -26
- package/lib/response-payload.interface-vwwiY4s6.cjs +0 -0
- package/lib/revoke-session-options.interface-BW7f0pb7.d.cts +0 -11
- package/lib/revoke-session-options.interface-DWpnqU2p.cjs +0 -12
- package/lib/revoke-session-options.interface-DWpnqU2p.cjs.map +0 -1
- package/lib/role-assignment.interface-CQVAgfeO.cjs +0 -0
- package/lib/role-assignment.interface-ChR_OANy.d.cts +0 -49
- package/lib/role-assignment.serializer-CNEsj7hN.d.cts +0 -7
- package/lib/role-assignment.serializer-D7MAb-zC.cjs +0 -23
- package/lib/role-assignment.serializer-D7MAb-zC.cjs.map +0 -1
- package/lib/role.interface-Bjkku_tB.cjs +0 -0
- package/lib/role.serializer-BmSjBq3i.cjs +0 -22
- package/lib/role.serializer-BmSjBq3i.cjs.map +0 -1
- package/lib/role.serializer-yTKLys-u.cjs +0 -18
- package/lib/role.serializer-yTKLys-u.cjs.map +0 -1
- package/lib/roles/interfaces/index.cjs +0 -0
- package/lib/roles/interfaces/index.d.cts +0 -2
- package/lib/roles/interfaces/index.d.ts +0 -2
- package/lib/roles/interfaces/index.js +0 -1
- package/lib/roles/interfaces/role.interface.cjs +0 -0
- package/lib/roles/interfaces/role.interface.d.cts +0 -2
- package/lib/roles/interfaces/role.interface.d.ts +0 -67
- package/lib/roles/interfaces/role.interface.js +0 -1
- package/lib/roles/serializers/role.serializer.cjs +0 -3
- package/lib/roles/serializers/role.serializer.d.cts +0 -7
- package/lib/roles/serializers/role.serializer.d.ts +0 -7
- package/lib/roles/serializers/role.serializer.js +0 -16
- package/lib/roles/serializers/role.serializer.js.map +0 -1
- package/lib/runtime-info-D11Gtx8I.cjs +0 -56
- package/lib/runtime-info-D11Gtx8I.cjs.map +0 -1
- package/lib/seal-BDnUayLx.cjs +0 -315
- package/lib/seal-BDnUayLx.cjs.map +0 -1
- package/lib/send-invitation-options.interface-CmHj_ls3.cjs +0 -0
- package/lib/send-invitation-options.interface-DtIC4uoS.d.cts +0 -22
- package/lib/send-invitation-options.serializer-DoSLFoca.cjs +0 -19
- package/lib/send-invitation-options.serializer-DoSLFoca.cjs.map +0 -1
- package/lib/send-session-response.interface-CnYzQ75X.cjs +0 -0
- package/lib/send-session-response.interface-DrY_UidP.d.cts +0 -8
- package/lib/send-verification-email-options.interface-IMaY7OHw.d.cts +0 -7
- package/lib/send-verification-email-options.interface-KE6HXoGl.cjs +0 -0
- package/lib/serializers-1DJGR2Bq.cjs +0 -0
- package/lib/serializers-AObKGeJ9.cjs +0 -0
- package/lib/serializers-BdASmY_9.cjs +0 -0
- package/lib/serializers-C_P8R3U5.cjs +0 -0
- package/lib/serializers-Cg02bBkh.cjs +0 -0
- package/lib/serializers-CzTjSkin.cjs +0 -0
- package/lib/serializers-D7IALzFJ.cjs +0 -0
- package/lib/serializers-DGbHryl9.cjs +0 -0
- package/lib/serializers-DMjnDh0k.cjs +0 -0
- package/lib/serializers-mApGhp2E.cjs +0 -0
- package/lib/serializers-trBM15Pj.cjs +0 -0
- package/lib/serializers-xzNg-6UC.cjs +0 -0
- package/lib/session-Beigw6Nc.cjs +0 -144
- package/lib/session-Beigw6Nc.cjs.map +0 -1
- package/lib/session-handler-options.interface-i1Q3y3CN.d.cts +0 -9
- package/lib/session.interface-DEkXnpLu.d.cts +0 -38
- package/lib/session.interface-DTlTOZpJ.cjs +0 -0
- package/lib/session.serializer-B63NxvRH.cjs +0 -26
- package/lib/session.serializer-B63NxvRH.cjs.map +0 -1
- package/lib/session.serializer-Cw08JZKf.d.cts +0 -7
- package/lib/set-environment-role-permissions-options.interface-BZKVKr61.d.cts +0 -7
- package/lib/set-environment-role-permissions-options.interface-DkP1-5Qw.cjs +0 -0
- package/lib/set-organization-role-permissions-options.interface-B5ETA0fj.d.cts +0 -7
- package/lib/set-organization-role-permissions-options.interface-C6GsAkHc.cjs +0 -0
- package/lib/signature-provider-DBHzmT8N.cjs +0 -38
- package/lib/signature-provider-DBHzmT8N.cjs.map +0 -1
- package/lib/signature-verification.exception-BGEX3tOK.d.cts +0 -8
- package/lib/signature-verification.exception-Dc1gSCYD.cjs +0 -17
- package/lib/signature-verification.exception-Dc1gSCYD.cjs.map +0 -1
- package/lib/sms.interface-CmOBSCNB.d.cts +0 -10
- package/lib/sms.serializer-D2a3LAEN.cjs +0 -12
- package/lib/sms.serializer-D2a3LAEN.cjs.map +0 -1
- package/lib/sso/interfaces/authorization-url-options.interface.cjs +0 -0
- package/lib/sso/interfaces/authorization-url-options.interface.d.cts +0 -2
- package/lib/sso/interfaces/authorization-url-options.interface.d.ts +0 -55
- package/lib/sso/interfaces/authorization-url-options.interface.js +0 -1
- package/lib/sso/interfaces/connection-type.enum.cjs +0 -3
- package/lib/sso/interfaces/connection-type.enum.d.cts +0 -2
- package/lib/sso/interfaces/connection-type.enum.d.ts +0 -41
- package/lib/sso/interfaces/connection-type.enum.js +0 -43
- package/lib/sso/interfaces/connection-type.enum.js.map +0 -1
- package/lib/sso/interfaces/connection.interface.cjs +0 -0
- package/lib/sso/interfaces/connection.interface.d.cts +0 -2
- package/lib/sso/interfaces/connection.interface.d.ts +0 -33
- package/lib/sso/interfaces/connection.interface.js +0 -1
- package/lib/sso/interfaces/get-profile-and-token-options.interface.cjs +0 -0
- package/lib/sso/interfaces/get-profile-and-token-options.interface.d.cts +0 -2
- package/lib/sso/interfaces/get-profile-and-token-options.interface.d.ts +0 -14
- package/lib/sso/interfaces/get-profile-and-token-options.interface.js +0 -1
- package/lib/sso/interfaces/get-profile-options.interface.cjs +0 -0
- package/lib/sso/interfaces/get-profile-options.interface.d.cts +0 -2
- package/lib/sso/interfaces/get-profile-options.interface.d.ts +0 -7
- package/lib/sso/interfaces/get-profile-options.interface.js +0 -1
- package/lib/sso/interfaces/index.cjs +0 -3
- package/lib/sso/interfaces/index.d.cts +0 -8
- package/lib/sso/interfaces/index.d.ts +0 -9
- package/lib/sso/interfaces/index.js +0 -3
- package/lib/sso/interfaces/list-connections-options.interface.cjs +0 -0
- package/lib/sso/interfaces/list-connections-options.interface.d.cts +0 -2
- package/lib/sso/interfaces/list-connections-options.interface.d.ts +0 -17
- package/lib/sso/interfaces/list-connections-options.interface.js +0 -1
- package/lib/sso/interfaces/profile-and-token.interface.cjs +0 -0
- package/lib/sso/interfaces/profile-and-token.interface.d.cts +0 -2
- package/lib/sso/interfaces/profile-and-token.interface.d.ts +0 -18
- package/lib/sso/interfaces/profile-and-token.interface.js +0 -1
- package/lib/sso/interfaces/profile.interface.cjs +0 -0
- package/lib/sso/interfaces/profile.interface.d.cts +0 -2
- package/lib/sso/interfaces/profile.interface.d.ts +0 -42
- package/lib/sso/interfaces/profile.interface.js +0 -1
- package/lib/sso/serializers/connection.serializer.cjs +0 -3
- package/lib/sso/serializers/connection.serializer.d.cts +0 -2
- package/lib/sso/serializers/connection.serializer.d.ts +0 -7
- package/lib/sso/serializers/connection.serializer.js +0 -16
- package/lib/sso/serializers/connection.serializer.js.map +0 -1
- package/lib/sso/serializers/index.cjs +0 -9
- package/lib/sso/serializers/index.d.cts +0 -5
- package/lib/sso/serializers/index.d.ts +0 -5
- package/lib/sso/serializers/index.js +0 -6
- package/lib/sso/serializers/list-connections-options.serializer.cjs +0 -3
- package/lib/sso/serializers/list-connections-options.serializer.d.cts +0 -2
- package/lib/sso/serializers/list-connections-options.serializer.d.ts +0 -7
- package/lib/sso/serializers/list-connections-options.serializer.js +0 -14
- package/lib/sso/serializers/list-connections-options.serializer.js.map +0 -1
- package/lib/sso/serializers/profile-and-token.serializer.cjs +0 -3
- package/lib/sso/serializers/profile-and-token.serializer.d.cts +0 -2
- package/lib/sso/serializers/profile-and-token.serializer.d.ts +0 -8
- package/lib/sso/serializers/profile-and-token.serializer.js +0 -13
- package/lib/sso/serializers/profile-and-token.serializer.js.map +0 -1
- package/lib/sso/serializers/profile.serializer.cjs +0 -3
- package/lib/sso/serializers/profile.serializer.d.cts +0 -2
- package/lib/sso/serializers/profile.serializer.d.ts +0 -8
- package/lib/sso/serializers/profile.serializer.js +0 -20
- package/lib/sso/serializers/profile.serializer.js.map +0 -1
- package/lib/sso/sso.cjs +0 -3
- package/lib/sso/sso.d.cts +0 -2
- package/lib/sso/sso.d.ts +0 -69
- package/lib/sso/sso.js +0 -130
- package/lib/sso/sso.js.map +0 -1
- package/lib/sso-D_9tMqlC.cjs +0 -135
- package/lib/sso-D_9tMqlC.cjs.map +0 -1
- package/lib/subtle-crypto-provider-RQC7QPlf.cjs +0 -99
- package/lib/subtle-crypto-provider-RQC7QPlf.cjs.map +0 -1
- package/lib/totp.interface-DPRsa_Dc.d.cts +0 -22
- package/lib/totp.serializer-DlQAVrBt.cjs +0 -32
- package/lib/totp.serializer-DlQAVrBt.cjs.map +0 -1
- package/lib/unauthorized.exception-D6PAzuDw.d.cts +0 -13
- package/lib/unauthorized.exception-hTKkIjP4.cjs +0 -21
- package/lib/unauthorized.exception-hTKkIjP4.cjs.map +0 -1
- package/lib/unknown-record.interface-KDwjwNHM.d.cts +0 -5
- package/lib/unprocessable-entity-error.interface-BYalF3nu.cjs +0 -0
- package/lib/unprocessable-entity-error.interface-sHivwO3Z.d.cts +0 -8
- package/lib/unprocessable-entity.exception-B6blaqq0.d.cts +0 -25
- package/lib/unprocessable-entity.exception-BdCyQCYX.cjs +0 -28
- package/lib/unprocessable-entity.exception-BdCyQCYX.cjs.map +0 -1
- package/lib/unreachable-BxbjIt8H.cjs +0 -23
- package/lib/unreachable-BxbjIt8H.cjs.map +0 -1
- package/lib/update-authorization-resource-by-external-id-options.interface-VdkOB-85.d.cts +0 -11
- package/lib/update-authorization-resource-by-external-id-options.interface-mN_nsHCu.cjs +0 -0
- package/lib/update-authorization-resource-by-external-id-options.serializer-CKKinNuy.d.cts +0 -8
- package/lib/update-authorization-resource-by-external-id-options.serializer-CY2Lbl7g.cjs +0 -15
- package/lib/update-authorization-resource-by-external-id-options.serializer-CY2Lbl7g.cjs.map +0 -1
- package/lib/update-authorization-resource-options.serializer-BGRYW1ci.d.cts +0 -7
- package/lib/update-authorization-resource-options.serializer-D-xkj_s1.cjs +0 -15
- package/lib/update-authorization-resource-options.serializer-D-xkj_s1.cjs.map +0 -1
- package/lib/update-environment-role-options.interface-B9n2iznD.cjs +0 -0
- package/lib/update-environment-role-options.interface-DmxJlvJj.d.cts +0 -12
- package/lib/update-environment-role-options.serializer-2Ov89Yww.d.cts +0 -7
- package/lib/update-environment-role-options.serializer-BQtOkLrr.cjs +0 -15
- package/lib/update-environment-role-options.serializer-BQtOkLrr.cjs.map +0 -1
- package/lib/update-object.interface-EhYczOkX.d.cts +0 -13
- package/lib/update-object.interface-nhE3xAFf.cjs +0 -0
- package/lib/update-organization-membership-options.interface-CBFTtRh2.d.cts +0 -12
- package/lib/update-organization-membership-options.interface-CjgSH1bc.cjs +0 -0
- package/lib/update-organization-membership-options.serializer-BlMg2vFm.cjs +0 -15
- package/lib/update-organization-membership-options.serializer-BlMg2vFm.cjs.map +0 -1
- package/lib/update-organization-options.interface-CL0f4NZm.cjs +0 -0
- package/lib/update-organization-options.interface-Dz9Iuz5W.d.cts +0 -21
- package/lib/update-organization-options.serializer-DWh4RlX3.cjs +0 -18
- package/lib/update-organization-options.serializer-DWh4RlX3.cjs.map +0 -1
- package/lib/update-organization-options.serializer-vLJg7x0x.d.cts +0 -7
- package/lib/update-organization-role-options.interface-B7y-X0Wq.cjs +0 -0
- package/lib/update-organization-role-options.interface-DmZR0gHw.d.cts +0 -12
- package/lib/update-organization-role-options.serializer-CCFmpMNA.cjs +0 -15
- package/lib/update-organization-role-options.serializer-CCFmpMNA.cjs.map +0 -1
- package/lib/update-organization-role-options.serializer-CbdE5-dZ.d.cts +0 -7
- package/lib/update-permission-options.interface-BUmoAwcY.d.cts +0 -12
- package/lib/update-permission-options.interface-DCG5a3S7.cjs +0 -0
- package/lib/update-permission-options.serializer-B2xClQjZ.cjs +0 -15
- package/lib/update-permission-options.serializer-B2xClQjZ.cjs.map +0 -1
- package/lib/update-permission-options.serializer-CvF0WPcI.d.cts +0 -7
- package/lib/update-user-options.interface-628EegED.cjs +0 -0
- package/lib/update-user-options.interface-CzrbRCX7.d.cts +0 -31
- package/lib/update-user-options.serializer-C7da_R08.d.cts +0 -7
- package/lib/update-user-options.serializer-H11lRdjH.cjs +0 -23
- package/lib/update-user-options.serializer-H11lRdjH.cjs.map +0 -1
- package/lib/update-user-password-options.interface-CN6_YJse.d.cts +0 -11
- package/lib/update-user-password-options.interface-MkvrPqTk.cjs +0 -0
- package/lib/update-user-password-options.serializer-CY9Ckmqw.cjs +0 -12
- package/lib/update-user-password-options.serializer-CY9Ckmqw.cjs.map +0 -1
- package/lib/update-user-password-options.serializer-D67Lr4m1.d.cts +0 -7
- package/lib/user-management/interfaces/authenticate-with-code-and-verifier-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-code-and-verifier-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-code-and-verifier-options.interface.d.ts +0 -17
- package/lib/user-management/interfaces/authenticate-with-code-and-verifier-options.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-code-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-code-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-code-options.interface.d.ts +0 -20
- package/lib/user-management/interfaces/authenticate-with-code-options.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-email-verification-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-email-verification-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-email-verification-options.interface.d.ts +0 -18
- package/lib/user-management/interfaces/authenticate-with-email-verification-options.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-magic-auth-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-magic-auth-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-magic-auth-options.interface.d.ts +0 -22
- package/lib/user-management/interfaces/authenticate-with-magic-auth-options.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-options-base.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-options-base.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-options-base.interface.d.ts +0 -41
- package/lib/user-management/interfaces/authenticate-with-options-base.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-organization-selection.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-organization-selection.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-organization-selection.interface.d.ts +0 -18
- package/lib/user-management/interfaces/authenticate-with-organization-selection.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-password-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-password-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-password-options.interface.d.ts +0 -20
- package/lib/user-management/interfaces/authenticate-with-password-options.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-refresh-token-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-refresh-token-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-refresh-token-options.interface.d.ts +0 -18
- package/lib/user-management/interfaces/authenticate-with-refresh-token-options.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-refresh-token-public-client-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-refresh-token-public-client-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-refresh-token-public-client-options.interface.d.ts +0 -16
- package/lib/user-management/interfaces/authenticate-with-refresh-token-public-client-options.interface.js +0 -1
- package/lib/user-management/interfaces/authenticate-with-session-cookie.interface.cjs +0 -3
- package/lib/user-management/interfaces/authenticate-with-session-cookie.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-session-cookie.interface.d.ts +0 -45
- package/lib/user-management/interfaces/authenticate-with-session-cookie.interface.js +0 -11
- package/lib/user-management/interfaces/authenticate-with-session-cookie.interface.js.map +0 -1
- package/lib/user-management/interfaces/authenticate-with-totp-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authenticate-with-totp-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authenticate-with-totp-options.interface.d.ts +0 -20
- package/lib/user-management/interfaces/authenticate-with-totp-options.interface.js +0 -1
- package/lib/user-management/interfaces/authentication-event.interface.cjs +0 -0
- package/lib/user-management/interfaces/authentication-event.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authentication-event.interface.d.ts +0 -28
- package/lib/user-management/interfaces/authentication-event.interface.js +0 -1
- package/lib/user-management/interfaces/authentication-radar-risk-detected-event.interface.cjs +0 -0
- package/lib/user-management/interfaces/authentication-radar-risk-detected-event.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authentication-radar-risk-detected-event.interface.d.ts +0 -24
- package/lib/user-management/interfaces/authentication-radar-risk-detected-event.interface.js +0 -1
- package/lib/user-management/interfaces/authentication-response.interface.cjs +0 -0
- package/lib/user-management/interfaces/authentication-response.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authentication-response.interface.d.ts +0 -28
- package/lib/user-management/interfaces/authentication-response.interface.js +0 -1
- package/lib/user-management/interfaces/authorization-url-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/authorization-url-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/authorization-url-options.interface.d.ts +0 -45
- package/lib/user-management/interfaces/authorization-url-options.interface.js +0 -1
- package/lib/user-management/interfaces/create-magic-auth-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/create-magic-auth-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/create-magic-auth-options.interface.d.ts +0 -12
- package/lib/user-management/interfaces/create-magic-auth-options.interface.js +0 -1
- package/lib/user-management/interfaces/create-organization-membership-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/create-organization-membership-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/create-organization-membership-options.interface.d.ts +0 -16
- package/lib/user-management/interfaces/create-organization-membership-options.interface.js +0 -1
- package/lib/user-management/interfaces/create-password-reset-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/create-password-reset-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/create-password-reset-options.interface.d.ts +0 -10
- package/lib/user-management/interfaces/create-password-reset-options.interface.js +0 -1
- package/lib/user-management/interfaces/create-user-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/create-user-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/create-user-options.interface.d.ts +0 -28
- package/lib/user-management/interfaces/create-user-options.interface.js +0 -1
- package/lib/user-management/interfaces/email-verification.interface.cjs +0 -0
- package/lib/user-management/interfaces/email-verification.interface.d.cts +0 -2
- package/lib/user-management/interfaces/email-verification.interface.d.ts +0 -42
- package/lib/user-management/interfaces/email-verification.interface.js +0 -1
- package/lib/user-management/interfaces/enroll-auth-factor.interface.cjs +0 -0
- package/lib/user-management/interfaces/enroll-auth-factor.interface.d.cts +0 -2
- package/lib/user-management/interfaces/enroll-auth-factor.interface.d.ts +0 -17
- package/lib/user-management/interfaces/enroll-auth-factor.interface.js +0 -1
- package/lib/user-management/interfaces/factor.interface.cjs +0 -0
- package/lib/user-management/interfaces/factor.interface.d.cts +0 -2
- package/lib/user-management/interfaces/factor.interface.d.ts +0 -42
- package/lib/user-management/interfaces/factor.interface.js +0 -1
- package/lib/user-management/interfaces/identity.interface.cjs +0 -0
- package/lib/user-management/interfaces/identity.interface.d.cts +0 -2
- package/lib/user-management/interfaces/identity.interface.d.ts +0 -14
- package/lib/user-management/interfaces/identity.interface.js +0 -1
- package/lib/user-management/interfaces/impersonator.interface.cjs +0 -0
- package/lib/user-management/interfaces/impersonator.interface.d.cts +0 -2
- package/lib/user-management/interfaces/impersonator.interface.d.ts +0 -12
- package/lib/user-management/interfaces/impersonator.interface.js +0 -1
- package/lib/user-management/interfaces/index.cjs +0 -7
- package/lib/user-management/interfaces/index.d.cts +0 -46
- package/lib/user-management/interfaces/index.d.ts +0 -50
- package/lib/user-management/interfaces/index.js +0 -5
- package/lib/user-management/interfaces/invitation.interface.cjs +0 -0
- package/lib/user-management/interfaces/invitation.interface.d.cts +0 -2
- package/lib/user-management/interfaces/invitation.interface.d.ts +0 -64
- package/lib/user-management/interfaces/invitation.interface.js +0 -1
- package/lib/user-management/interfaces/list-auth-factors-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/list-auth-factors-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/list-auth-factors-options.interface.d.ts +0 -9
- package/lib/user-management/interfaces/list-auth-factors-options.interface.js +0 -1
- package/lib/user-management/interfaces/list-invitations-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/list-invitations-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/list-invitations-options.interface.d.ts +0 -14
- package/lib/user-management/interfaces/list-invitations-options.interface.js +0 -1
- package/lib/user-management/interfaces/list-organization-memberships-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/list-organization-memberships-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/list-organization-memberships-options.interface.d.ts +0 -21
- package/lib/user-management/interfaces/list-organization-memberships-options.interface.js +0 -1
- package/lib/user-management/interfaces/list-sessions-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/list-sessions-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/list-sessions-options.interface.d.ts +0 -8
- package/lib/user-management/interfaces/list-sessions-options.interface.js +0 -1
- package/lib/user-management/interfaces/list-user-feature-flags-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/list-user-feature-flags-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/list-user-feature-flags-options.interface.d.ts +0 -9
- package/lib/user-management/interfaces/list-user-feature-flags-options.interface.js +0 -1
- package/lib/user-management/interfaces/list-users-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/list-users-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/list-users-options.interface.d.ts +0 -14
- package/lib/user-management/interfaces/list-users-options.interface.js +0 -1
- package/lib/user-management/interfaces/locale.interface.cjs +0 -0
- package/lib/user-management/interfaces/locale.interface.d.cts +0 -2
- package/lib/user-management/interfaces/locale.interface.d.ts +0 -5
- package/lib/user-management/interfaces/locale.interface.js +0 -1
- package/lib/user-management/interfaces/logout-url-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/logout-url-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/logout-url-options.interface.d.ts +0 -8
- package/lib/user-management/interfaces/logout-url-options.interface.js +0 -1
- package/lib/user-management/interfaces/magic-auth.interface.cjs +0 -0
- package/lib/user-management/interfaces/magic-auth.interface.d.cts +0 -2
- package/lib/user-management/interfaces/magic-auth.interface.d.ts +0 -42
- package/lib/user-management/interfaces/magic-auth.interface.js +0 -1
- package/lib/user-management/interfaces/oauth-tokens.interface.cjs +0 -0
- package/lib/user-management/interfaces/oauth-tokens.interface.d.cts +0 -2
- package/lib/user-management/interfaces/oauth-tokens.interface.d.ts +0 -16
- package/lib/user-management/interfaces/oauth-tokens.interface.js +0 -1
- package/lib/user-management/interfaces/organization-membership.interface.cjs +0 -0
- package/lib/user-management/interfaces/organization-membership.interface.d.cts +0 -2
- package/lib/user-management/interfaces/organization-membership.interface.d.ts +0 -55
- package/lib/user-management/interfaces/organization-membership.interface.js +0 -1
- package/lib/user-management/interfaces/password-hash-type.interface.cjs +0 -0
- package/lib/user-management/interfaces/password-hash-type.interface.d.cts +0 -2
- package/lib/user-management/interfaces/password-hash-type.interface.d.ts +0 -5
- package/lib/user-management/interfaces/password-hash-type.interface.js +0 -1
- package/lib/user-management/interfaces/password-reset.interface.cjs +0 -0
- package/lib/user-management/interfaces/password-reset.interface.d.cts +0 -2
- package/lib/user-management/interfaces/password-reset.interface.d.ts +0 -40
- package/lib/user-management/interfaces/password-reset.interface.js +0 -1
- package/lib/user-management/interfaces/refresh-and-seal-session-data.interface.cjs +0 -3
- package/lib/user-management/interfaces/refresh-and-seal-session-data.interface.d.cts +0 -2
- package/lib/user-management/interfaces/refresh-and-seal-session-data.interface.d.ts +0 -24
- package/lib/user-management/interfaces/refresh-and-seal-session-data.interface.js +0 -13
- package/lib/user-management/interfaces/refresh-and-seal-session-data.interface.js.map +0 -1
- package/lib/user-management/interfaces/resend-invitation-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/resend-invitation-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/resend-invitation-options.interface.d.ts +0 -12
- package/lib/user-management/interfaces/resend-invitation-options.interface.js +0 -1
- package/lib/user-management/interfaces/reset-password-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/reset-password-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/reset-password-options.interface.d.ts +0 -12
- package/lib/user-management/interfaces/reset-password-options.interface.js +0 -1
- package/lib/user-management/interfaces/revoke-session-options.interface.cjs +0 -3
- package/lib/user-management/interfaces/revoke-session-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/revoke-session-options.interface.d.ts +0 -11
- package/lib/user-management/interfaces/revoke-session-options.interface.js +0 -6
- package/lib/user-management/interfaces/revoke-session-options.interface.js.map +0 -1
- package/lib/user-management/interfaces/send-invitation-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/send-invitation-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/send-invitation-options.interface.d.ts +0 -22
- package/lib/user-management/interfaces/send-invitation-options.interface.js +0 -1
- package/lib/user-management/interfaces/send-verification-email-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/send-verification-email-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/send-verification-email-options.interface.d.ts +0 -7
- package/lib/user-management/interfaces/send-verification-email-options.interface.js +0 -1
- package/lib/user-management/interfaces/session-handler-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/session-handler-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/session-handler-options.interface.d.ts +0 -9
- package/lib/user-management/interfaces/session-handler-options.interface.js +0 -1
- package/lib/user-management/interfaces/session.interface.cjs +0 -0
- package/lib/user-management/interfaces/session.interface.d.cts +0 -2
- package/lib/user-management/interfaces/session.interface.d.ts +0 -38
- package/lib/user-management/interfaces/session.interface.js +0 -1
- package/lib/user-management/interfaces/update-organization-membership-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/update-organization-membership-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/update-organization-membership-options.interface.d.ts +0 -12
- package/lib/user-management/interfaces/update-organization-membership-options.interface.js +0 -1
- package/lib/user-management/interfaces/update-user-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/update-user-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/update-user-options.interface.d.ts +0 -31
- package/lib/user-management/interfaces/update-user-options.interface.js +0 -1
- package/lib/user-management/interfaces/update-user-password-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/update-user-password-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/update-user-password-options.interface.d.ts +0 -11
- package/lib/user-management/interfaces/update-user-password-options.interface.js +0 -1
- package/lib/user-management/interfaces/user.interface.cjs +0 -0
- package/lib/user-management/interfaces/user.interface.d.cts +0 -2
- package/lib/user-management/interfaces/user.interface.d.ts +0 -34
- package/lib/user-management/interfaces/user.interface.js +0 -1
- package/lib/user-management/interfaces/verify-email-options.interface.cjs +0 -0
- package/lib/user-management/interfaces/verify-email-options.interface.d.cts +0 -2
- package/lib/user-management/interfaces/verify-email-options.interface.d.ts +0 -11
- package/lib/user-management/interfaces/verify-email-options.interface.js +0 -1
- package/lib/user-management/serializers/authenticate-with-code-and-verifier-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-code-and-verifier-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authenticate-with-code-and-verifier-options.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-code-and-verifier-options.serializer.js +0 -14
- package/lib/user-management/serializers/authenticate-with-code-and-verifier-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-code-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-code-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authenticate-with-code-options.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-code-options.serializer.js +0 -15
- package/lib/user-management/serializers/authenticate-with-code-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-email-verification.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-email-verification.serializer.d.cts +0 -8
- package/lib/user-management/serializers/authenticate-with-email-verification.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-email-verification.serializer.js +0 -14
- package/lib/user-management/serializers/authenticate-with-email-verification.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-magic-auth-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-magic-auth-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authenticate-with-magic-auth-options.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-magic-auth-options.serializer.js +0 -16
- package/lib/user-management/serializers/authenticate-with-magic-auth-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-organization-selection-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-organization-selection-options.serializer.d.cts +0 -8
- package/lib/user-management/serializers/authenticate-with-organization-selection-options.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-organization-selection-options.serializer.js +0 -14
- package/lib/user-management/serializers/authenticate-with-organization-selection-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-password-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-password-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authenticate-with-password-options.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-password-options.serializer.js +0 -15
- package/lib/user-management/serializers/authenticate-with-password-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-refresh-token-public-client-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-refresh-token-public-client-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authenticate-with-refresh-token-public-client-options.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-refresh-token-public-client-options.serializer.js +0 -13
- package/lib/user-management/serializers/authenticate-with-refresh-token-public-client-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-refresh-token.options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-refresh-token.options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authenticate-with-refresh-token.options.serializer.d.ts +0 -9
- package/lib/user-management/serializers/authenticate-with-refresh-token.options.serializer.js +0 -14
- package/lib/user-management/serializers/authenticate-with-refresh-token.options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authenticate-with-totp-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/authenticate-with-totp-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authenticate-with-totp-options.serializer.d.ts +0 -8
- package/lib/user-management/serializers/authenticate-with-totp-options.serializer.js +0 -15
- package/lib/user-management/serializers/authenticate-with-totp-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/authentication-event.serializer.cjs +0 -3
- package/lib/user-management/serializers/authentication-event.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authentication-event.serializer.d.ts +0 -7
- package/lib/user-management/serializers/authentication-event.serializer.js +0 -14
- package/lib/user-management/serializers/authentication-event.serializer.js.map +0 -1
- package/lib/user-management/serializers/authentication-radar-risk-event-serializer.cjs +0 -3
- package/lib/user-management/serializers/authentication-radar-risk-event-serializer.d.cts +0 -7
- package/lib/user-management/serializers/authentication-radar-risk-event-serializer.d.ts +0 -7
- package/lib/user-management/serializers/authentication-radar-risk-event-serializer.js +0 -15
- package/lib/user-management/serializers/authentication-radar-risk-event-serializer.js.map +0 -1
- package/lib/user-management/serializers/authentication-response.serializer.cjs +0 -3
- package/lib/user-management/serializers/authentication-response.serializer.d.cts +0 -2
- package/lib/user-management/serializers/authentication-response.serializer.d.ts +0 -7
- package/lib/user-management/serializers/authentication-response.serializer.js +0 -21
- package/lib/user-management/serializers/authentication-response.serializer.js.map +0 -1
- package/lib/user-management/serializers/create-magic-auth-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/create-magic-auth-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/create-magic-auth-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/create-magic-auth-options.serializer.js +0 -9
- package/lib/user-management/serializers/create-magic-auth-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/create-organization-membership-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/create-organization-membership-options.serializer.d.cts +0 -7
- package/lib/user-management/serializers/create-organization-membership-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/create-organization-membership-options.serializer.js +0 -11
- package/lib/user-management/serializers/create-organization-membership-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/create-password-reset-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/create-password-reset-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/create-password-reset-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/create-password-reset-options.serializer.js +0 -6
- package/lib/user-management/serializers/create-password-reset-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/create-user-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/create-user-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/create-user-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/create-user-options.serializer.js +0 -16
- package/lib/user-management/serializers/create-user-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/email-verification.serializer.cjs +0 -4
- package/lib/user-management/serializers/email-verification.serializer.d.cts +0 -2
- package/lib/user-management/serializers/email-verification.serializer.d.ts +0 -8
- package/lib/user-management/serializers/email-verification.serializer.js +0 -24
- package/lib/user-management/serializers/email-verification.serializer.js.map +0 -1
- package/lib/user-management/serializers/enroll-auth-factor-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/enroll-auth-factor-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/enroll-auth-factor-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/enroll-auth-factor-options.serializer.js +0 -11
- package/lib/user-management/serializers/enroll-auth-factor-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/factor.serializer.cjs +0 -4
- package/lib/user-management/serializers/factor.serializer.d.cts +0 -2
- package/lib/user-management/serializers/factor.serializer.d.ts +0 -8
- package/lib/user-management/serializers/factor.serializer.js +0 -25
- package/lib/user-management/serializers/factor.serializer.js.map +0 -1
- package/lib/user-management/serializers/identity.serializer.cjs +0 -3
- package/lib/user-management/serializers/identity.serializer.d.cts +0 -7
- package/lib/user-management/serializers/identity.serializer.d.ts +0 -7
- package/lib/user-management/serializers/identity.serializer.js +0 -14
- package/lib/user-management/serializers/identity.serializer.js.map +0 -1
- package/lib/user-management/serializers/index.cjs +0 -54
- package/lib/user-management/serializers/index.d.cts +0 -25
- package/lib/user-management/serializers/index.d.ts +0 -25
- package/lib/user-management/serializers/index.js +0 -26
- package/lib/user-management/serializers/invitation.serializer.cjs +0 -4
- package/lib/user-management/serializers/invitation.serializer.d.cts +0 -2
- package/lib/user-management/serializers/invitation.serializer.d.ts +0 -8
- package/lib/user-management/serializers/invitation.serializer.js +0 -35
- package/lib/user-management/serializers/invitation.serializer.js.map +0 -1
- package/lib/user-management/serializers/list-invitations-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/list-invitations-options.serializer.d.cts +0 -7
- package/lib/user-management/serializers/list-invitations-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/list-invitations-options.serializer.js +0 -13
- package/lib/user-management/serializers/list-invitations-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/list-organization-memberships-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/list-organization-memberships-options.serializer.d.cts +0 -7
- package/lib/user-management/serializers/list-organization-memberships-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/list-organization-memberships-options.serializer.js +0 -14
- package/lib/user-management/serializers/list-organization-memberships-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/list-sessions-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/list-sessions-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/list-sessions-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/list-sessions-options.serializer.js +0 -6
- package/lib/user-management/serializers/list-sessions-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/list-users-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/list-users-options.serializer.d.cts +0 -7
- package/lib/user-management/serializers/list-users-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/list-users-options.serializer.js +0 -13
- package/lib/user-management/serializers/list-users-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/magic-auth.serializer.cjs +0 -4
- package/lib/user-management/serializers/magic-auth.serializer.d.cts +0 -2
- package/lib/user-management/serializers/magic-auth.serializer.d.ts +0 -8
- package/lib/user-management/serializers/magic-auth.serializer.js +0 -24
- package/lib/user-management/serializers/magic-auth.serializer.js.map +0 -1
- package/lib/user-management/serializers/oauth-tokens.serializer.cjs +0 -3
- package/lib/user-management/serializers/oauth-tokens.serializer.d.cts +0 -7
- package/lib/user-management/serializers/oauth-tokens.serializer.d.ts +0 -7
- package/lib/user-management/serializers/oauth-tokens.serializer.js +0 -11
- package/lib/user-management/serializers/oauth-tokens.serializer.js.map +0 -1
- package/lib/user-management/serializers/organization-membership.serializer.cjs +0 -4
- package/lib/user-management/serializers/organization-membership.serializer.d.cts +0 -8
- package/lib/user-management/serializers/organization-membership.serializer.d.ts +0 -8
- package/lib/user-management/serializers/organization-membership.serializer.js +0 -28
- package/lib/user-management/serializers/organization-membership.serializer.js.map +0 -1
- package/lib/user-management/serializers/password-reset.serializer.cjs +0 -4
- package/lib/user-management/serializers/password-reset.serializer.d.cts +0 -2
- package/lib/user-management/serializers/password-reset.serializer.d.ts +0 -8
- package/lib/user-management/serializers/password-reset.serializer.js +0 -23
- package/lib/user-management/serializers/password-reset.serializer.js.map +0 -1
- package/lib/user-management/serializers/resend-invitation-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/resend-invitation-options.serializer.d.cts +0 -7
- package/lib/user-management/serializers/resend-invitation-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/resend-invitation-options.serializer.js +0 -6
- package/lib/user-management/serializers/resend-invitation-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/reset-password-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/reset-password-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/reset-password-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/reset-password-options.serializer.js +0 -9
- package/lib/user-management/serializers/reset-password-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/role.serializer.cjs +0 -3
- package/lib/user-management/serializers/role.serializer.d.cts +0 -7
- package/lib/user-management/serializers/role.serializer.d.ts +0 -7
- package/lib/user-management/serializers/role.serializer.js +0 -12
- package/lib/user-management/serializers/role.serializer.js.map +0 -1
- package/lib/user-management/serializers/send-invitation-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/send-invitation-options.serializer.d.cts +0 -7
- package/lib/user-management/serializers/send-invitation-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/send-invitation-options.serializer.js +0 -13
- package/lib/user-management/serializers/send-invitation-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/session.serializer.cjs +0 -3
- package/lib/user-management/serializers/session.serializer.d.cts +0 -2
- package/lib/user-management/serializers/session.serializer.d.ts +0 -7
- package/lib/user-management/serializers/session.serializer.js +0 -20
- package/lib/user-management/serializers/session.serializer.js.map +0 -1
- package/lib/user-management/serializers/update-organization-membership-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/update-organization-membership-options.serializer.d.cts +0 -7
- package/lib/user-management/serializers/update-organization-membership-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/update-organization-membership-options.serializer.js +0 -9
- package/lib/user-management/serializers/update-organization-membership-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/update-user-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/update-user-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/update-user-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/update-user-options.serializer.js +0 -17
- package/lib/user-management/serializers/update-user-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/update-user-password-options.serializer.cjs +0 -3
- package/lib/user-management/serializers/update-user-password-options.serializer.d.cts +0 -2
- package/lib/user-management/serializers/update-user-password-options.serializer.d.ts +0 -7
- package/lib/user-management/serializers/update-user-password-options.serializer.js +0 -6
- package/lib/user-management/serializers/update-user-password-options.serializer.js.map +0 -1
- package/lib/user-management/serializers/user.serializer.cjs +0 -3
- package/lib/user-management/serializers/user.serializer.d.cts +0 -2
- package/lib/user-management/serializers/user.serializer.d.ts +0 -7
- package/lib/user-management/serializers/user.serializer.js +0 -20
- package/lib/user-management/serializers/user.serializer.js.map +0 -1
- package/lib/user-management/session.cjs +0 -4
- package/lib/user-management/session.d.cts +0 -2
- package/lib/user-management/session.d.ts +0 -44
- package/lib/user-management/session.js +0 -139
- package/lib/user-management/session.js.map +0 -1
- package/lib/user-management/user-management.cjs +0 -5
- package/lib/user-management/user-management.d.cts +0 -2
- package/lib/user-management/user-management.d.ts +0 -211
- package/lib/user-management/user-management.js +0 -534
- package/lib/user-management/user-management.js.map +0 -1
- package/lib/user-management-CJj1rMco.cjs +0 -539
- package/lib/user-management-CJj1rMco.cjs.map +0 -1
- package/lib/user.interface-CSksrToF.d.cts +0 -34
- package/lib/user.interface-v7V0JLDQ.cjs +0 -0
- package/lib/user.serializer-BFpDaajW.d.cts +0 -7
- package/lib/user.serializer-Y5EM8MeK.cjs +0 -26
- package/lib/user.serializer-Y5EM8MeK.cjs.map +0 -1
- package/lib/utils/jose.cjs +0 -3
- package/lib/utils/jose.d.cts +0 -20
- package/lib/utils/jose.d.ts +0 -20
- package/lib/utils/jose.js +0 -21
- package/lib/utils/jose.js.map +0 -1
- package/lib/validate-api-key.interface-BGq76tsL.cjs +0 -0
- package/lib/validate-api-key.interface-D_WJOvPm.d.cts +0 -15
- package/lib/validate-api-key.serializer-Cwpx9odk.cjs +0 -15
- package/lib/validate-api-key.serializer-Cwpx9odk.cjs.map +0 -1
- package/lib/validate-api-key.serializer-D5zYUCcH.d.cts +0 -7
- package/lib/vault/interfaces/index.cjs +0 -0
- package/lib/vault/interfaces/index.d.cts +0 -11
- package/lib/vault/interfaces/index.d.ts +0 -11
- package/lib/vault/interfaces/index.js +0 -1
- package/lib/vault/interfaces/key/create-data-key.interface.cjs +0 -0
- package/lib/vault/interfaces/key/create-data-key.interface.d.cts +0 -2
- package/lib/vault/interfaces/key/create-data-key.interface.d.ts +0 -15
- package/lib/vault/interfaces/key/create-data-key.interface.js +0 -1
- package/lib/vault/interfaces/key/decrypt-data-key.interface.cjs +0 -0
- package/lib/vault/interfaces/key/decrypt-data-key.interface.d.cts +0 -2
- package/lib/vault/interfaces/key/decrypt-data-key.interface.d.ts +0 -11
- package/lib/vault/interfaces/key/decrypt-data-key.interface.js +0 -1
- package/lib/vault/interfaces/key.interface.cjs +0 -0
- package/lib/vault/interfaces/key.interface.d.cts +0 -2
- package/lib/vault/interfaces/key.interface.d.ts +0 -16
- package/lib/vault/interfaces/key.interface.js +0 -1
- package/lib/vault/interfaces/object/create-object.interface.cjs +0 -0
- package/lib/vault/interfaces/object/create-object.interface.d.cts +0 -2
- package/lib/vault/interfaces/object/create-object.interface.d.ts +0 -16
- package/lib/vault/interfaces/object/create-object.interface.js +0 -1
- package/lib/vault/interfaces/object/delete-object.interface.cjs +0 -0
- package/lib/vault/interfaces/object/delete-object.interface.d.cts +0 -2
- package/lib/vault/interfaces/object/delete-object.interface.d.ts +0 -7
- package/lib/vault/interfaces/object/delete-object.interface.js +0 -1
- package/lib/vault/interfaces/object/list-object-versions.interface.cjs +0 -0
- package/lib/vault/interfaces/object/list-object-versions.interface.d.cts +0 -2
- package/lib/vault/interfaces/object/list-object-versions.interface.d.ts +0 -12
- package/lib/vault/interfaces/object/list-object-versions.interface.js +0 -1
- package/lib/vault/interfaces/object/list-objects.interface.cjs +0 -0
- package/lib/vault/interfaces/object/list-objects.interface.d.cts +0 -2
- package/lib/vault/interfaces/object/list-objects.interface.d.ts +0 -9
- package/lib/vault/interfaces/object/list-objects.interface.js +0 -1
- package/lib/vault/interfaces/object/read-object.interface.cjs +0 -0
- package/lib/vault/interfaces/object/read-object.interface.d.cts +0 -2
- package/lib/vault/interfaces/object/read-object.interface.d.ts +0 -25
- package/lib/vault/interfaces/object/read-object.interface.js +0 -1
- package/lib/vault/interfaces/object/update-object.interface.cjs +0 -0
- package/lib/vault/interfaces/object/update-object.interface.d.cts +0 -2
- package/lib/vault/interfaces/object/update-object.interface.d.ts +0 -13
- package/lib/vault/interfaces/object/update-object.interface.js +0 -1
- package/lib/vault/interfaces/object.interface.cjs +0 -0
- package/lib/vault/interfaces/object.interface.d.cts +0 -2
- package/lib/vault/interfaces/object.interface.d.ts +0 -35
- package/lib/vault/interfaces/object.interface.js +0 -1
- package/lib/vault/serializers/vault-key.serializer.cjs +0 -4
- package/lib/vault/serializers/vault-key.serializer.d.cts +0 -10
- package/lib/vault/serializers/vault-key.serializer.d.ts +0 -10
- package/lib/vault/serializers/vault-key.serializer.js +0 -17
- package/lib/vault/serializers/vault-key.serializer.js.map +0 -1
- package/lib/vault/serializers/vault-object.serializer.cjs +0 -8
- package/lib/vault/serializers/vault-object.serializer.d.cts +0 -18
- package/lib/vault/serializers/vault-object.serializer.d.ts +0 -18
- package/lib/vault/serializers/vault-object.serializer.js +0 -48
- package/lib/vault/serializers/vault-object.serializer.js.map +0 -1
- package/lib/vault/vault.cjs +0 -3
- package/lib/vault/vault.d.cts +0 -2
- package/lib/vault/vault.d.ts +0 -35
- package/lib/vault/vault.js +0 -101
- package/lib/vault/vault.js.map +0 -1
- package/lib/vault-BR8gbCEq.cjs +0 -106
- package/lib/vault-BR8gbCEq.cjs.map +0 -1
- package/lib/vault-key.serializer-D5WVcdFV.cjs +0 -29
- package/lib/vault-key.serializer-D5WVcdFV.cjs.map +0 -1
- package/lib/vault-object.serializer-Cx7rAuca.cjs +0 -84
- package/lib/vault-object.serializer-Cx7rAuca.cjs.map +0 -1
- package/lib/verify-challenge-options-CkbCUSJv.d.cts +0 -8
- package/lib/verify-challenge-response-Dlb5HPTC.d.cts +0 -14
- package/lib/verify-email-options.interface-6ZR-BxLC.cjs +0 -0
- package/lib/verify-email-options.interface-B8NOVqLy.d.cts +0 -11
- package/lib/verify-response.serializer-B_xSg0qN.cjs +0 -16
- package/lib/verify-response.serializer-B_xSg0qN.cjs.map +0 -1
- package/lib/verify-response.serializer-CFug_fb9.d.cts +0 -7
- package/lib/warning.interface-9qt63wBc.d.cts +0 -13
- package/lib/warrant-op.enum-CYwLWhRz.d.cts +0 -8
- package/lib/warrant-op.enum-CdLsJJCt.cjs +0 -16
- package/lib/warrant-op.enum-CdLsJJCt.cjs.map +0 -1
- package/lib/warrant-token.interface-BhaSf4pQ.d.cts +0 -10
- package/lib/warrant-token.interface-Ce-WGK9E.cjs +0 -0
- package/lib/warrant-token.serializer-DIzg-CmP.cjs +0 -12
- package/lib/warrant-token.serializer-DIzg-CmP.cjs.map +0 -1
- package/lib/warrant-token.serializer-ron-g41a.d.cts +0 -7
- package/lib/warrant.interface-5GMD1PlN.d.cts +0 -71
- package/lib/warrant.interface-Dv6nrxc-.cjs +0 -0
- package/lib/warrant.serializer-OpTafbUe.d.cts +0 -7
- package/lib/warrant.serializer-_TqpbD4I.cjs +0 -22
- package/lib/warrant.serializer-_TqpbD4I.cjs.map +0 -1
- package/lib/webhooks/webhooks.cjs +0 -3
- package/lib/webhooks/webhooks.d.cts +0 -2
- package/lib/webhooks/webhooks.d.ts +0 -35
- package/lib/webhooks/webhooks.js +0 -33
- package/lib/webhooks/webhooks.js.map +0 -1
- package/lib/webhooks-D2t2W-Z_.d.cts +0 -35
- package/lib/webhooks-wNAbF-1o.cjs +0 -38
- package/lib/webhooks-wNAbF-1o.cjs.map +0 -1
- package/lib/widgets/interfaces/get-token.cjs +0 -4
- package/lib/widgets/interfaces/get-token.d.cts +0 -2
- package/lib/widgets/interfaces/get-token.d.ts +0 -23
- package/lib/widgets/interfaces/get-token.js +0 -11
- package/lib/widgets/interfaces/get-token.js.map +0 -1
- package/lib/widgets/widgets.cjs +0 -3
- package/lib/widgets/widgets.d.cts +0 -2
- package/lib/widgets/widgets.d.ts +0 -12
- package/lib/widgets/widgets.js +0 -16
- package/lib/widgets/widgets.js.map +0 -1
- package/lib/widgets-BckzS1Py.cjs +0 -21
- package/lib/widgets-BckzS1Py.cjs.map +0 -1
- package/lib/workos-2uUDl0FZ.cjs +0 -347
- package/lib/workos-2uUDl0FZ.cjs.map +0 -1
- package/lib/workos-options.interface-BJncPCQs.d.cts +0 -17
- package/lib/workos-options.interface-Cszzjn_W.cjs +0 -0
- package/lib/workos-response-error.interface-D4GX2qD0.d.cts +0 -13
- package/lib/workos-response-error.interface-Div6tr1y.cjs +0 -0
- package/lib/workos.cjs +0 -7
- package/lib/workos.d.cts +0 -2
- package/lib/workos.d.ts +0 -108
- package/lib/workos.js +0 -339
- package/lib/workos.js.map +0 -1
- package/lib/write-warrant-options.serializer-BQP-4p5X.d.cts +0 -7
- package/lib/write-warrant-options.serializer-C4p0DqUx.cjs +0 -26
- package/lib/write-warrant-options.serializer-C4p0DqUx.cjs.map +0 -1
|
@@ -0,0 +1,4729 @@
|
|
|
1
|
+
//#region src/common/crypto/crypto-provider.ts
|
|
2
|
+
/**
|
|
3
|
+
* Interface encapsulating the various crypto computations used by the library,
|
|
4
|
+
* allowing pluggable underlying crypto implementations.
|
|
5
|
+
*/
|
|
6
|
+
var CryptoProvider = class {
|
|
7
|
+
encoder = new TextEncoder();
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/common/crypto/subtle-crypto-provider.ts
|
|
11
|
+
/**
|
|
12
|
+
* `CryptoProvider which uses the SubtleCrypto interface of the Web Crypto API.
|
|
13
|
+
*
|
|
14
|
+
* This only supports asynchronous operations.
|
|
15
|
+
*/
|
|
16
|
+
var SubtleCryptoProvider = class extends CryptoProvider {
|
|
17
|
+
subtleCrypto;
|
|
18
|
+
constructor(subtleCrypto) {
|
|
19
|
+
super();
|
|
20
|
+
this.subtleCrypto = subtleCrypto || crypto.subtle;
|
|
21
|
+
}
|
|
22
|
+
computeHMACSignature(_payload, _secret) {
|
|
23
|
+
throw new Error("SubleCryptoProvider cannot be used in a synchronous context.");
|
|
24
|
+
}
|
|
25
|
+
/** @override */
|
|
26
|
+
async computeHMACSignatureAsync(payload, secret) {
|
|
27
|
+
const encoder = new TextEncoder();
|
|
28
|
+
const key = await this.subtleCrypto.importKey("raw", encoder.encode(secret), {
|
|
29
|
+
name: "HMAC",
|
|
30
|
+
hash: { name: "SHA-256" }
|
|
31
|
+
}, false, ["sign"]);
|
|
32
|
+
const signatureBuffer = await this.subtleCrypto.sign("hmac", key, encoder.encode(payload));
|
|
33
|
+
const signatureBytes = new Uint8Array(signatureBuffer);
|
|
34
|
+
const signatureHexCodes = new Array(signatureBytes.length);
|
|
35
|
+
for (let i = 0; i < signatureBytes.length; i++) signatureHexCodes[i] = byteHexMapping[signatureBytes[i]];
|
|
36
|
+
return signatureHexCodes.join("");
|
|
37
|
+
}
|
|
38
|
+
/** @override */
|
|
39
|
+
async secureCompare(stringA, stringB) {
|
|
40
|
+
const bufferA = this.encoder.encode(stringA);
|
|
41
|
+
const bufferB = this.encoder.encode(stringB);
|
|
42
|
+
if (bufferA.length !== bufferB.length) return false;
|
|
43
|
+
const algorithm = {
|
|
44
|
+
name: "HMAC",
|
|
45
|
+
hash: "SHA-256"
|
|
46
|
+
};
|
|
47
|
+
const key = await crypto.subtle.generateKey(algorithm, false, ["sign", "verify"]);
|
|
48
|
+
const hmac = await crypto.subtle.sign(algorithm, key, bufferA);
|
|
49
|
+
return await crypto.subtle.verify(algorithm, key, hmac, bufferB);
|
|
50
|
+
}
|
|
51
|
+
async encrypt(plaintext, key, iv, aad) {
|
|
52
|
+
const actualIv = iv || crypto.getRandomValues(new Uint8Array(32));
|
|
53
|
+
const cryptoKey = await this.subtleCrypto.importKey("raw", key, { name: "AES-GCM" }, false, ["encrypt"]);
|
|
54
|
+
const encryptParams = {
|
|
55
|
+
name: "AES-GCM",
|
|
56
|
+
iv: actualIv
|
|
57
|
+
};
|
|
58
|
+
if (aad) encryptParams.additionalData = aad;
|
|
59
|
+
const encryptedData = await this.subtleCrypto.encrypt(encryptParams, cryptoKey, plaintext);
|
|
60
|
+
const encryptedBytes = new Uint8Array(encryptedData);
|
|
61
|
+
const tagStart = encryptedBytes.length - 16;
|
|
62
|
+
const tag = encryptedBytes.slice(tagStart);
|
|
63
|
+
return {
|
|
64
|
+
ciphertext: encryptedBytes.slice(0, tagStart),
|
|
65
|
+
iv: actualIv,
|
|
66
|
+
tag
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async decrypt(ciphertext, key, iv, tag, aad) {
|
|
70
|
+
const combinedData = new Uint8Array(ciphertext.length + tag.length);
|
|
71
|
+
combinedData.set(ciphertext, 0);
|
|
72
|
+
combinedData.set(tag, ciphertext.length);
|
|
73
|
+
const cryptoKey = await this.subtleCrypto.importKey("raw", key, { name: "AES-GCM" }, false, ["decrypt"]);
|
|
74
|
+
const decryptParams = {
|
|
75
|
+
name: "AES-GCM",
|
|
76
|
+
iv
|
|
77
|
+
};
|
|
78
|
+
if (aad) decryptParams.additionalData = aad;
|
|
79
|
+
const decryptedData = await this.subtleCrypto.decrypt(decryptParams, cryptoKey, combinedData);
|
|
80
|
+
return new Uint8Array(decryptedData);
|
|
81
|
+
}
|
|
82
|
+
randomBytes(length) {
|
|
83
|
+
const bytes = new Uint8Array(length);
|
|
84
|
+
crypto.getRandomValues(bytes);
|
|
85
|
+
return bytes;
|
|
86
|
+
}
|
|
87
|
+
randomUUID() {
|
|
88
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return crypto.randomUUID();
|
|
89
|
+
const bytes = this.randomBytes(16);
|
|
90
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
91
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
92
|
+
const hex = Array.from(bytes, (b) => byteHexMapping[b]).join("");
|
|
93
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const byteHexMapping = new Array(256);
|
|
97
|
+
for (let i = 0; i < byteHexMapping.length; i++) byteHexMapping[i] = i.toString(16).padStart(2, "0");
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/common/net/http-client.ts
|
|
100
|
+
var HttpClient = class HttpClient {
|
|
101
|
+
MAX_RETRY_ATTEMPTS = 3;
|
|
102
|
+
BACKOFF_MULTIPLIER = 1.5;
|
|
103
|
+
MINIMUM_SLEEP_TIME_IN_MILLISECONDS = 500;
|
|
104
|
+
RETRY_STATUS_CODES = [
|
|
105
|
+
408,
|
|
106
|
+
500,
|
|
107
|
+
502,
|
|
108
|
+
504
|
|
109
|
+
];
|
|
110
|
+
constructor(baseURL, options) {
|
|
111
|
+
this.baseURL = baseURL;
|
|
112
|
+
this.options = options;
|
|
113
|
+
}
|
|
114
|
+
/** The HTTP client name used for diagnostics */
|
|
115
|
+
getClientName() {
|
|
116
|
+
throw new Error("getClientName not implemented");
|
|
117
|
+
}
|
|
118
|
+
addClientToUserAgent(userAgent) {
|
|
119
|
+
if (userAgent.indexOf(" ") > -1) return userAgent.replace(/\b\s/, `/${this.getClientName()} `);
|
|
120
|
+
else return userAgent += `/${this.getClientName()}`;
|
|
121
|
+
}
|
|
122
|
+
static getResourceURL(baseURL, path, params) {
|
|
123
|
+
const queryString = HttpClient.getQueryString(params);
|
|
124
|
+
return new URL([path, queryString].filter(Boolean).join("?"), baseURL).toString();
|
|
125
|
+
}
|
|
126
|
+
static getQueryString(queryObj) {
|
|
127
|
+
if (!queryObj) return void 0;
|
|
128
|
+
const sanitizedQueryObj = {};
|
|
129
|
+
Object.entries(queryObj).forEach(([param, value]) => {
|
|
130
|
+
if (value !== null && value !== void 0 && value !== "") sanitizedQueryObj[param] = value;
|
|
131
|
+
});
|
|
132
|
+
return new URLSearchParams(sanitizedQueryObj).toString();
|
|
133
|
+
}
|
|
134
|
+
static getContentTypeHeader(entity) {
|
|
135
|
+
if (entity instanceof URLSearchParams) return { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8" };
|
|
136
|
+
}
|
|
137
|
+
static getBody(entity) {
|
|
138
|
+
if (entity === null || entity instanceof URLSearchParams) return entity;
|
|
139
|
+
return JSON.stringify(entity);
|
|
140
|
+
}
|
|
141
|
+
static isPathRetryable(path) {
|
|
142
|
+
return path.startsWith("/fga/") || path.startsWith("/vault/") || path.startsWith("/audit_logs/events");
|
|
143
|
+
}
|
|
144
|
+
getSleepTimeInMilliseconds(retryAttempt) {
|
|
145
|
+
return this.MINIMUM_SLEEP_TIME_IN_MILLISECONDS * Math.pow(this.BACKOFF_MULTIPLIER, retryAttempt) * (Math.random() + .5);
|
|
146
|
+
}
|
|
147
|
+
sleep = (retryAttempt) => new Promise((resolve) => setTimeout(resolve, this.getSleepTimeInMilliseconds(retryAttempt)));
|
|
148
|
+
};
|
|
149
|
+
var HttpClientResponse = class {
|
|
150
|
+
_statusCode;
|
|
151
|
+
_headers;
|
|
152
|
+
constructor(statusCode, headers) {
|
|
153
|
+
this._statusCode = statusCode;
|
|
154
|
+
this._headers = headers;
|
|
155
|
+
}
|
|
156
|
+
getStatusCode() {
|
|
157
|
+
return this._statusCode;
|
|
158
|
+
}
|
|
159
|
+
getHeaders() {
|
|
160
|
+
return this._headers;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
var HttpClientError = class extends Error {
|
|
164
|
+
name = "HttpClientError";
|
|
165
|
+
message = "The request could not be completed.";
|
|
166
|
+
response;
|
|
167
|
+
constructor({ message, response }) {
|
|
168
|
+
super(message);
|
|
169
|
+
this.message = message;
|
|
170
|
+
this.response = response;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/common/exceptions/parse-error.ts
|
|
175
|
+
var ParseError = class extends Error {
|
|
176
|
+
name = "ParseError";
|
|
177
|
+
status = 500;
|
|
178
|
+
rawBody;
|
|
179
|
+
rawStatus;
|
|
180
|
+
requestID;
|
|
181
|
+
constructor({ message, rawBody, rawStatus, requestID }) {
|
|
182
|
+
super(message);
|
|
183
|
+
this.rawBody = rawBody;
|
|
184
|
+
this.rawStatus = rawStatus;
|
|
185
|
+
this.requestID = requestID;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/common/net/fetch-client.ts
|
|
190
|
+
const DEFAULT_FETCH_TIMEOUT = 6e4;
|
|
191
|
+
var FetchHttpClient = class extends HttpClient {
|
|
192
|
+
_fetchFn;
|
|
193
|
+
constructor(baseURL, options, fetchFn) {
|
|
194
|
+
super(baseURL, options);
|
|
195
|
+
this.baseURL = baseURL;
|
|
196
|
+
this.options = options;
|
|
197
|
+
if (!fetchFn) {
|
|
198
|
+
if (!globalThis.fetch) throw new Error("Fetch function not defined in the global scope and no replacement was provided.");
|
|
199
|
+
fetchFn = globalThis.fetch;
|
|
200
|
+
}
|
|
201
|
+
this._fetchFn = fetchFn.bind(globalThis);
|
|
202
|
+
}
|
|
203
|
+
/** @override */
|
|
204
|
+
getClientName() {
|
|
205
|
+
return "fetch";
|
|
206
|
+
}
|
|
207
|
+
async get(path, options) {
|
|
208
|
+
const resourceURL = HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
209
|
+
if (HttpClient.isPathRetryable(path)) return await this.fetchRequestWithRetry(resourceURL, "GET", null, options.headers);
|
|
210
|
+
else return await this.fetchRequest(resourceURL, "GET", null, options.headers);
|
|
211
|
+
}
|
|
212
|
+
async post(path, entity, options) {
|
|
213
|
+
const resourceURL = HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
214
|
+
if (HttpClient.isPathRetryable(path)) return await this.fetchRequestWithRetry(resourceURL, "POST", HttpClient.getBody(entity), {
|
|
215
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
216
|
+
...options.headers
|
|
217
|
+
});
|
|
218
|
+
else return await this.fetchRequest(resourceURL, "POST", HttpClient.getBody(entity), {
|
|
219
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
220
|
+
...options.headers
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
async put(path, entity, options) {
|
|
224
|
+
const resourceURL = HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
225
|
+
if (HttpClient.isPathRetryable(path)) return await this.fetchRequestWithRetry(resourceURL, "PUT", HttpClient.getBody(entity), {
|
|
226
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
227
|
+
...options.headers
|
|
228
|
+
});
|
|
229
|
+
else return await this.fetchRequest(resourceURL, "PUT", HttpClient.getBody(entity), {
|
|
230
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
231
|
+
...options.headers
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
async patch(path, entity, options) {
|
|
235
|
+
const resourceURL = HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
236
|
+
if (HttpClient.isPathRetryable(path)) return await this.fetchRequestWithRetry(resourceURL, "PATCH", HttpClient.getBody(entity), {
|
|
237
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
238
|
+
...options.headers
|
|
239
|
+
});
|
|
240
|
+
else return await this.fetchRequest(resourceURL, "PATCH", HttpClient.getBody(entity), {
|
|
241
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
242
|
+
...options.headers
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
async delete(path, options) {
|
|
246
|
+
const resourceURL = HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
247
|
+
if (HttpClient.isPathRetryable(path)) return await this.fetchRequestWithRetry(resourceURL, "DELETE", null, options.headers);
|
|
248
|
+
else return await this.fetchRequest(resourceURL, "DELETE", null, options.headers);
|
|
249
|
+
}
|
|
250
|
+
async deleteWithBody(path, entity, options) {
|
|
251
|
+
const resourceURL = HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
252
|
+
if (HttpClient.isPathRetryable(path)) return await this.fetchRequestWithRetry(resourceURL, "DELETE", HttpClient.getBody(entity), {
|
|
253
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
254
|
+
...options.headers
|
|
255
|
+
});
|
|
256
|
+
else return await this.fetchRequest(resourceURL, "DELETE", HttpClient.getBody(entity), {
|
|
257
|
+
...HttpClient.getContentTypeHeader(entity),
|
|
258
|
+
...options.headers
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
async fetchRequest(url, method, body, headers) {
|
|
262
|
+
const requestBody = body || (method === "POST" || method === "PUT" || method === "PATCH" ? "" : void 0);
|
|
263
|
+
const { "User-Agent": userAgent } = this.options?.headers || {};
|
|
264
|
+
const timeout = this.options?.timeout ?? DEFAULT_FETCH_TIMEOUT;
|
|
265
|
+
const abortController = new AbortController();
|
|
266
|
+
const timeoutId = setTimeout(() => {
|
|
267
|
+
abortController?.abort();
|
|
268
|
+
}, timeout);
|
|
269
|
+
try {
|
|
270
|
+
const res = await this._fetchFn(url, {
|
|
271
|
+
method,
|
|
272
|
+
headers: {
|
|
273
|
+
Accept: "application/json, text/plain, */*",
|
|
274
|
+
"Content-Type": "application/json",
|
|
275
|
+
...this.options?.headers,
|
|
276
|
+
...headers,
|
|
277
|
+
"User-Agent": this.addClientToUserAgent((userAgent || "workos-node").toString())
|
|
278
|
+
},
|
|
279
|
+
body: requestBody,
|
|
280
|
+
signal: abortController?.signal
|
|
281
|
+
});
|
|
282
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
283
|
+
if (!res.ok) {
|
|
284
|
+
const requestID = res.headers.get("X-Request-ID") ?? "";
|
|
285
|
+
const rawBody = await res.text();
|
|
286
|
+
let responseJson;
|
|
287
|
+
try {
|
|
288
|
+
responseJson = JSON.parse(rawBody);
|
|
289
|
+
} catch (error) {
|
|
290
|
+
if (error instanceof SyntaxError) throw new ParseError({
|
|
291
|
+
message: error.message,
|
|
292
|
+
rawBody,
|
|
293
|
+
requestID,
|
|
294
|
+
rawStatus: res.status
|
|
295
|
+
});
|
|
296
|
+
throw error;
|
|
297
|
+
}
|
|
298
|
+
throw new HttpClientError({
|
|
299
|
+
message: res.statusText,
|
|
300
|
+
response: {
|
|
301
|
+
status: res.status,
|
|
302
|
+
headers: res.headers,
|
|
303
|
+
data: responseJson
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
return new FetchHttpClientResponse(res);
|
|
308
|
+
} catch (error) {
|
|
309
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
310
|
+
if (error instanceof Error && error.name === "AbortError") throw new HttpClientError({
|
|
311
|
+
message: `Request timeout after ${timeout}ms`,
|
|
312
|
+
response: {
|
|
313
|
+
status: 408,
|
|
314
|
+
headers: {},
|
|
315
|
+
data: { error: "Request timeout" }
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
throw error;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
async fetchRequestWithRetry(url, method, body, headers) {
|
|
322
|
+
let response;
|
|
323
|
+
let retryAttempts = 1;
|
|
324
|
+
const makeRequest = async () => {
|
|
325
|
+
let requestError = null;
|
|
326
|
+
try {
|
|
327
|
+
response = await this.fetchRequest(url, method, body, headers);
|
|
328
|
+
} catch (e) {
|
|
329
|
+
requestError = e;
|
|
330
|
+
}
|
|
331
|
+
if (this.shouldRetryRequest(requestError, retryAttempts)) {
|
|
332
|
+
retryAttempts++;
|
|
333
|
+
await this.sleep(retryAttempts);
|
|
334
|
+
return makeRequest();
|
|
335
|
+
}
|
|
336
|
+
if (requestError != null) throw requestError;
|
|
337
|
+
return response;
|
|
338
|
+
};
|
|
339
|
+
return makeRequest();
|
|
340
|
+
}
|
|
341
|
+
shouldRetryRequest(requestError, retryAttempt) {
|
|
342
|
+
if (retryAttempt > this.MAX_RETRY_ATTEMPTS) return false;
|
|
343
|
+
if (requestError != null) {
|
|
344
|
+
if (requestError instanceof TypeError) return true;
|
|
345
|
+
if (requestError instanceof HttpClientError && this.RETRY_STATUS_CODES.includes(requestError.response.status)) return true;
|
|
346
|
+
}
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
var FetchHttpClientResponse = class FetchHttpClientResponse extends HttpClientResponse {
|
|
351
|
+
_res;
|
|
352
|
+
constructor(res) {
|
|
353
|
+
super(res.status, FetchHttpClientResponse._transformHeadersToObject(res.headers));
|
|
354
|
+
this._res = res;
|
|
355
|
+
}
|
|
356
|
+
getRawResponse() {
|
|
357
|
+
return this._res;
|
|
358
|
+
}
|
|
359
|
+
toJSON() {
|
|
360
|
+
return this._res.headers.get("content-type")?.includes("application/json") ? this._res.json() : null;
|
|
361
|
+
}
|
|
362
|
+
static _transformHeadersToObject(headers) {
|
|
363
|
+
const headersObj = {};
|
|
364
|
+
for (const entry of Object.entries(headers)) {
|
|
365
|
+
if (!Array.isArray(entry) || entry.length !== 2) throw new Error("Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.");
|
|
366
|
+
headersObj[entry[0]] = entry[1];
|
|
367
|
+
}
|
|
368
|
+
return headersObj;
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/common/exceptions/api-key-required.exception.ts
|
|
373
|
+
var ApiKeyRequiredException = class extends Error {
|
|
374
|
+
status = 403;
|
|
375
|
+
name = "ApiKeyRequiredException";
|
|
376
|
+
path;
|
|
377
|
+
constructor(path) {
|
|
378
|
+
super(`API key required for "${path}". For server-side apps, initialize with: new WorkOS("sk_..."). For browser/mobile/CLI apps, use authenticateWithCodeAndVerifier() and authenticateWithRefreshToken() which work without an API key.`);
|
|
379
|
+
this.path = path;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/common/exceptions/generic-server.exception.ts
|
|
384
|
+
var GenericServerException = class extends Error {
|
|
385
|
+
name = "GenericServerException";
|
|
386
|
+
message = "The request could not be completed.";
|
|
387
|
+
constructor(status, message, rawData, requestID) {
|
|
388
|
+
super();
|
|
389
|
+
this.status = status;
|
|
390
|
+
this.rawData = rawData;
|
|
391
|
+
this.requestID = requestID;
|
|
392
|
+
if (message) this.message = message;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/common/exceptions/bad-request.exception.ts
|
|
397
|
+
var BadRequestException = class extends Error {
|
|
398
|
+
status = 400;
|
|
399
|
+
name = "BadRequestException";
|
|
400
|
+
message = "Bad request";
|
|
401
|
+
code;
|
|
402
|
+
errors;
|
|
403
|
+
requestID;
|
|
404
|
+
constructor({ code, errors, message, requestID }) {
|
|
405
|
+
super();
|
|
406
|
+
this.requestID = requestID;
|
|
407
|
+
if (message) this.message = message;
|
|
408
|
+
if (code) this.code = code;
|
|
409
|
+
if (errors) this.errors = errors;
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region src/common/exceptions/no-api-key-provided.exception.ts
|
|
414
|
+
var NoApiKeyProvidedException = class extends Error {
|
|
415
|
+
status = 500;
|
|
416
|
+
name = "NoApiKeyProvidedException";
|
|
417
|
+
message = "Missing API key. Pass it to the constructor (new WorkOS(\"sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU\")) or define it in the WORKOS_API_KEY environment variable.";
|
|
418
|
+
};
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/common/exceptions/not-found.exception.ts
|
|
421
|
+
var NotFoundException = class extends Error {
|
|
422
|
+
status = 404;
|
|
423
|
+
name = "NotFoundException";
|
|
424
|
+
message;
|
|
425
|
+
code;
|
|
426
|
+
requestID;
|
|
427
|
+
constructor({ code, message, path, requestID }) {
|
|
428
|
+
super();
|
|
429
|
+
this.code = code;
|
|
430
|
+
this.message = message ?? `The requested path '${path}' could not be found.`;
|
|
431
|
+
this.requestID = requestID;
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/common/exceptions/oauth.exception.ts
|
|
436
|
+
var OauthException = class extends Error {
|
|
437
|
+
name = "OauthException";
|
|
438
|
+
constructor(status, requestID, error, errorDescription, rawData) {
|
|
439
|
+
super();
|
|
440
|
+
this.status = status;
|
|
441
|
+
this.requestID = requestID;
|
|
442
|
+
this.error = error;
|
|
443
|
+
this.errorDescription = errorDescription;
|
|
444
|
+
this.rawData = rawData;
|
|
445
|
+
if (error && errorDescription) this.message = `Error: ${error}\nError Description: ${errorDescription}`;
|
|
446
|
+
else if (error) this.message = `Error: ${error}`;
|
|
447
|
+
else this.message = `An error has occurred.`;
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/common/exceptions/rate-limit-exceeded.exception.ts
|
|
452
|
+
var RateLimitExceededException = class extends GenericServerException {
|
|
453
|
+
name = "RateLimitExceededException";
|
|
454
|
+
constructor(message, requestID, retryAfter) {
|
|
455
|
+
super(429, message, {}, requestID);
|
|
456
|
+
this.retryAfter = retryAfter;
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/common/exceptions/signature-verification.exception.ts
|
|
461
|
+
var SignatureVerificationException = class extends Error {
|
|
462
|
+
name = "SignatureVerificationException";
|
|
463
|
+
constructor(message) {
|
|
464
|
+
super(message || "Signature verification failed.");
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/common/exceptions/unauthorized.exception.ts
|
|
469
|
+
var UnauthorizedException = class extends Error {
|
|
470
|
+
status = 401;
|
|
471
|
+
name = "UnauthorizedException";
|
|
472
|
+
message;
|
|
473
|
+
constructor(requestID) {
|
|
474
|
+
super();
|
|
475
|
+
this.requestID = requestID;
|
|
476
|
+
this.message = `Could not authorize the request. Maybe your API key is invalid?`;
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region src/common/exceptions/unprocessable-entity.exception.ts
|
|
481
|
+
var UnprocessableEntityException = class extends Error {
|
|
482
|
+
status = 422;
|
|
483
|
+
name = "UnprocessableEntityException";
|
|
484
|
+
message = "Unprocessable entity";
|
|
485
|
+
code;
|
|
486
|
+
requestID;
|
|
487
|
+
constructor({ code, errors, message, requestID }) {
|
|
488
|
+
super();
|
|
489
|
+
this.requestID = requestID;
|
|
490
|
+
if (message) this.message = message;
|
|
491
|
+
if (code) this.code = code;
|
|
492
|
+
if (errors) {
|
|
493
|
+
this.message = `The following ${errors.length === 1 ? "requirement" : "requirements"} must be met:\n`;
|
|
494
|
+
for (const { code } of errors) this.message = this.message.concat(`\t${code}\n`);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region src/common/crypto/signature-provider.ts
|
|
500
|
+
var SignatureProvider = class {
|
|
501
|
+
cryptoProvider;
|
|
502
|
+
constructor(cryptoProvider) {
|
|
503
|
+
this.cryptoProvider = cryptoProvider;
|
|
504
|
+
}
|
|
505
|
+
async verifyHeader({ payload, sigHeader, secret, tolerance = 18e4 }) {
|
|
506
|
+
const [timestamp, signatureHash] = this.getTimestampAndSignatureHash(sigHeader);
|
|
507
|
+
if (!signatureHash || Object.keys(signatureHash).length === 0) throw new SignatureVerificationException("No signature hash found with expected scheme v1");
|
|
508
|
+
if (parseInt(timestamp, 10) < Date.now() - tolerance) throw new SignatureVerificationException("Timestamp outside the tolerance zone");
|
|
509
|
+
const expectedSig = await this.computeSignature(timestamp, payload, secret);
|
|
510
|
+
if (await this.cryptoProvider.secureCompare(expectedSig, signatureHash) === false) throw new SignatureVerificationException("Signature hash does not match the expected signature hash for payload");
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
getTimestampAndSignatureHash(sigHeader) {
|
|
514
|
+
const [t, v1] = sigHeader.split(",");
|
|
515
|
+
if (typeof t === "undefined" || typeof v1 === "undefined") throw new SignatureVerificationException("Signature or timestamp missing");
|
|
516
|
+
const { 1: timestamp } = t.split("=");
|
|
517
|
+
const { 1: signatureHash } = v1.split("=");
|
|
518
|
+
return [timestamp, signatureHash];
|
|
519
|
+
}
|
|
520
|
+
async computeSignature(timestamp, payload, secret) {
|
|
521
|
+
payload = JSON.stringify(payload);
|
|
522
|
+
const signedPayload = `${timestamp}.${payload}`;
|
|
523
|
+
return await this.cryptoProvider.computeHMACSignatureAsync(signedPayload, secret);
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
//#endregion
|
|
527
|
+
//#region src/common/utils/unreachable.ts
|
|
528
|
+
/**
|
|
529
|
+
* Indicates that code is unreachable.
|
|
530
|
+
*
|
|
531
|
+
* This can be used for exhaustiveness checks in situations where the compiler
|
|
532
|
+
* would not otherwise check for exhaustiveness.
|
|
533
|
+
*
|
|
534
|
+
* If the determination that the code is unreachable proves incorrect, an
|
|
535
|
+
* exception is thrown.
|
|
536
|
+
*/
|
|
537
|
+
const unreachable = (condition, message = `Entered unreachable code. Received '${condition}'.`) => {
|
|
538
|
+
throw new TypeError(message);
|
|
539
|
+
};
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/organization-domains/serializers/organization-domain.serializer.ts
|
|
542
|
+
const deserializeOrganizationDomain = (organizationDomain) => ({
|
|
543
|
+
object: organizationDomain.object,
|
|
544
|
+
id: organizationDomain.id,
|
|
545
|
+
domain: organizationDomain.domain,
|
|
546
|
+
organizationId: organizationDomain.organization_id,
|
|
547
|
+
state: organizationDomain.state,
|
|
548
|
+
...organizationDomain.verification_token !== void 0 && { verificationToken: organizationDomain.verification_token },
|
|
549
|
+
verificationStrategy: organizationDomain.verification_strategy,
|
|
550
|
+
...organizationDomain.verification_prefix !== void 0 && { verificationPrefix: organizationDomain.verification_prefix },
|
|
551
|
+
createdAt: organizationDomain.created_at,
|
|
552
|
+
updatedAt: organizationDomain.updated_at
|
|
553
|
+
});
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region src/organizations/serializers/organization.serializer.ts
|
|
556
|
+
const deserializeOrganization = (organization) => ({
|
|
557
|
+
object: organization.object,
|
|
558
|
+
id: organization.id,
|
|
559
|
+
name: organization.name,
|
|
560
|
+
allowProfilesOutsideOrganization: organization.allow_profiles_outside_organization,
|
|
561
|
+
domains: organization.domains.map(deserializeOrganizationDomain),
|
|
562
|
+
...typeof organization.stripe_customer_id === "undefined" ? void 0 : { stripeCustomerId: organization.stripe_customer_id },
|
|
563
|
+
createdAt: organization.created_at,
|
|
564
|
+
updatedAt: organization.updated_at,
|
|
565
|
+
externalId: organization.external_id ?? null,
|
|
566
|
+
metadata: organization.metadata ?? {}
|
|
567
|
+
});
|
|
568
|
+
//#endregion
|
|
569
|
+
//#region src/user-management/serializers/authenticate-with-code-options.serializer.ts
|
|
570
|
+
const serializeAuthenticateWithCodeOptions = (options) => ({
|
|
571
|
+
grant_type: "authorization_code",
|
|
572
|
+
client_id: options.clientId,
|
|
573
|
+
client_secret: options.clientSecret,
|
|
574
|
+
code: options.code,
|
|
575
|
+
code_verifier: options.codeVerifier,
|
|
576
|
+
invitation_token: options.invitationToken,
|
|
577
|
+
ip_address: options.ipAddress,
|
|
578
|
+
user_agent: options.userAgent
|
|
579
|
+
});
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region src/user-management/serializers/authenticate-with-code-and-verifier-options.serializer.ts
|
|
582
|
+
const serializeAuthenticateWithCodeAndVerifierOptions = (options) => ({
|
|
583
|
+
grant_type: "authorization_code",
|
|
584
|
+
client_id: options.clientId,
|
|
585
|
+
code: options.code,
|
|
586
|
+
code_verifier: options.codeVerifier,
|
|
587
|
+
invitation_token: options.invitationToken,
|
|
588
|
+
ip_address: options.ipAddress,
|
|
589
|
+
user_agent: options.userAgent
|
|
590
|
+
});
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region src/user-management/serializers/authenticate-with-magic-auth-options.serializer.ts
|
|
593
|
+
const serializeAuthenticateWithMagicAuthOptions = (options) => ({
|
|
594
|
+
grant_type: "urn:workos:oauth:grant-type:magic-auth:code",
|
|
595
|
+
client_id: options.clientId,
|
|
596
|
+
client_secret: options.clientSecret,
|
|
597
|
+
code: options.code,
|
|
598
|
+
email: options.email,
|
|
599
|
+
invitation_token: options.invitationToken,
|
|
600
|
+
link_authorization_code: options.linkAuthorizationCode,
|
|
601
|
+
ip_address: options.ipAddress,
|
|
602
|
+
user_agent: options.userAgent
|
|
603
|
+
});
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region src/user-management/serializers/authenticate-with-password-options.serializer.ts
|
|
606
|
+
const serializeAuthenticateWithPasswordOptions = (options) => ({
|
|
607
|
+
grant_type: "password",
|
|
608
|
+
client_id: options.clientId,
|
|
609
|
+
client_secret: options.clientSecret,
|
|
610
|
+
email: options.email,
|
|
611
|
+
password: options.password,
|
|
612
|
+
invitation_token: options.invitationToken,
|
|
613
|
+
ip_address: options.ipAddress,
|
|
614
|
+
user_agent: options.userAgent
|
|
615
|
+
});
|
|
616
|
+
//#endregion
|
|
617
|
+
//#region src/user-management/serializers/authenticate-with-refresh-token.options.serializer.ts
|
|
618
|
+
const serializeAuthenticateWithRefreshTokenOptions = (options) => ({
|
|
619
|
+
grant_type: "refresh_token",
|
|
620
|
+
client_id: options.clientId,
|
|
621
|
+
client_secret: options.clientSecret,
|
|
622
|
+
refresh_token: options.refreshToken,
|
|
623
|
+
organization_id: options.organizationId,
|
|
624
|
+
ip_address: options.ipAddress,
|
|
625
|
+
user_agent: options.userAgent
|
|
626
|
+
});
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region src/user-management/serializers/authenticate-with-refresh-token-public-client-options.serializer.ts
|
|
629
|
+
const serializeAuthenticateWithRefreshTokenPublicClientOptions = (options) => ({
|
|
630
|
+
grant_type: "refresh_token",
|
|
631
|
+
client_id: options.clientId,
|
|
632
|
+
refresh_token: options.refreshToken,
|
|
633
|
+
organization_id: options.organizationId,
|
|
634
|
+
ip_address: options.ipAddress,
|
|
635
|
+
user_agent: options.userAgent
|
|
636
|
+
});
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/user-management/serializers/authenticate-with-totp-options.serializer.ts
|
|
639
|
+
const serializeAuthenticateWithTotpOptions = (options) => ({
|
|
640
|
+
grant_type: "urn:workos:oauth:grant-type:mfa-totp",
|
|
641
|
+
client_id: options.clientId,
|
|
642
|
+
client_secret: options.clientSecret,
|
|
643
|
+
code: options.code,
|
|
644
|
+
authentication_challenge_id: options.authenticationChallengeId,
|
|
645
|
+
pending_authentication_token: options.pendingAuthenticationToken,
|
|
646
|
+
ip_address: options.ipAddress,
|
|
647
|
+
user_agent: options.userAgent
|
|
648
|
+
});
|
|
649
|
+
//#endregion
|
|
650
|
+
//#region src/user-management/serializers/authentication-event.serializer.ts
|
|
651
|
+
const deserializeAuthenticationEventSso = (sso) => ({
|
|
652
|
+
connectionId: sso.connection_id,
|
|
653
|
+
organizationId: sso.organization_id,
|
|
654
|
+
...sso.session_id !== void 0 && { sessionId: sso.session_id }
|
|
655
|
+
});
|
|
656
|
+
const deserializeAuthenticationEvent = (authenticationEvent) => ({
|
|
657
|
+
email: authenticationEvent.email,
|
|
658
|
+
...authenticationEvent.error !== void 0 && { error: authenticationEvent.error },
|
|
659
|
+
ipAddress: authenticationEvent.ip_address,
|
|
660
|
+
...authenticationEvent.sso !== void 0 && { sso: deserializeAuthenticationEventSso(authenticationEvent.sso) },
|
|
661
|
+
status: authenticationEvent.status,
|
|
662
|
+
type: authenticationEvent.type,
|
|
663
|
+
userAgent: authenticationEvent.user_agent,
|
|
664
|
+
userId: authenticationEvent.user_id
|
|
665
|
+
});
|
|
666
|
+
//#endregion
|
|
667
|
+
//#region src/user-management/serializers/oauth-tokens.serializer.ts
|
|
668
|
+
const deserializeOauthTokens = (oauthTokens) => oauthTokens ? {
|
|
669
|
+
accessToken: oauthTokens.access_token,
|
|
670
|
+
refreshToken: oauthTokens.refresh_token,
|
|
671
|
+
expiresAt: oauthTokens.expires_at,
|
|
672
|
+
scopes: oauthTokens.scopes
|
|
673
|
+
} : void 0;
|
|
674
|
+
//#endregion
|
|
675
|
+
//#region src/user-management/serializers/user.serializer.ts
|
|
676
|
+
const deserializeUser = (user) => ({
|
|
677
|
+
object: user.object,
|
|
678
|
+
id: user.id,
|
|
679
|
+
email: user.email,
|
|
680
|
+
emailVerified: user.email_verified,
|
|
681
|
+
firstName: user.first_name,
|
|
682
|
+
profilePictureUrl: user.profile_picture_url,
|
|
683
|
+
lastName: user.last_name,
|
|
684
|
+
lastSignInAt: user.last_sign_in_at,
|
|
685
|
+
locale: user.locale,
|
|
686
|
+
createdAt: user.created_at,
|
|
687
|
+
updatedAt: user.updated_at,
|
|
688
|
+
externalId: user.external_id ?? null,
|
|
689
|
+
metadata: user.metadata ?? {}
|
|
690
|
+
});
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region src/user-management/serializers/authentication-response.serializer.ts
|
|
693
|
+
const deserializeAuthenticationResponse = (authenticationResponse) => {
|
|
694
|
+
const { user, organization_id, access_token, refresh_token, authentication_method, impersonator, oauth_tokens, ...rest } = authenticationResponse;
|
|
695
|
+
return {
|
|
696
|
+
user: deserializeUser(user),
|
|
697
|
+
organizationId: organization_id,
|
|
698
|
+
accessToken: access_token,
|
|
699
|
+
refreshToken: refresh_token,
|
|
700
|
+
impersonator,
|
|
701
|
+
authenticationMethod: authentication_method,
|
|
702
|
+
oauthTokens: deserializeOauthTokens(oauth_tokens),
|
|
703
|
+
...rest
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region src/user-management/serializers/create-magic-auth-options.serializer.ts
|
|
708
|
+
const serializeCreateMagicAuthOptions = (options) => ({
|
|
709
|
+
email: options.email,
|
|
710
|
+
invitation_token: options.invitationToken
|
|
711
|
+
});
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/user-management/serializers/create-password-reset-options.serializer.ts
|
|
714
|
+
const serializeCreatePasswordResetOptions = (options) => ({ email: options.email });
|
|
715
|
+
//#endregion
|
|
716
|
+
//#region src/user-management/serializers/email-verification.serializer.ts
|
|
717
|
+
const deserializeEmailVerification = (emailVerification) => ({
|
|
718
|
+
object: emailVerification.object,
|
|
719
|
+
id: emailVerification.id,
|
|
720
|
+
userId: emailVerification.user_id,
|
|
721
|
+
email: emailVerification.email,
|
|
722
|
+
expiresAt: emailVerification.expires_at,
|
|
723
|
+
code: emailVerification.code,
|
|
724
|
+
createdAt: emailVerification.created_at,
|
|
725
|
+
updatedAt: emailVerification.updated_at
|
|
726
|
+
});
|
|
727
|
+
const deserializeEmailVerificationEvent = (emailVerification) => ({
|
|
728
|
+
object: emailVerification.object,
|
|
729
|
+
id: emailVerification.id,
|
|
730
|
+
userId: emailVerification.user_id,
|
|
731
|
+
email: emailVerification.email,
|
|
732
|
+
expiresAt: emailVerification.expires_at,
|
|
733
|
+
createdAt: emailVerification.created_at,
|
|
734
|
+
updatedAt: emailVerification.updated_at
|
|
735
|
+
});
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/user-management/serializers/enroll-auth-factor-options.serializer.ts
|
|
738
|
+
const serializeEnrollAuthFactorOptions = (options) => ({
|
|
739
|
+
type: options.type,
|
|
740
|
+
totp_issuer: options.totpIssuer,
|
|
741
|
+
totp_user: options.totpUser,
|
|
742
|
+
totp_secret: options.totpSecret
|
|
743
|
+
});
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/mfa/serializers/totp.serializer.ts
|
|
746
|
+
const deserializeTotp = (totp) => {
|
|
747
|
+
return {
|
|
748
|
+
issuer: totp.issuer,
|
|
749
|
+
user: totp.user
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
const deserializeTotpWithSecrets = (totp) => {
|
|
753
|
+
return {
|
|
754
|
+
issuer: totp.issuer,
|
|
755
|
+
user: totp.user,
|
|
756
|
+
qrCode: totp.qr_code,
|
|
757
|
+
secret: totp.secret,
|
|
758
|
+
uri: totp.uri
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
//#endregion
|
|
762
|
+
//#region src/user-management/serializers/factor.serializer.ts
|
|
763
|
+
const deserializeFactor$1 = (factor) => ({
|
|
764
|
+
object: factor.object,
|
|
765
|
+
id: factor.id,
|
|
766
|
+
createdAt: factor.created_at,
|
|
767
|
+
updatedAt: factor.updated_at,
|
|
768
|
+
type: factor.type,
|
|
769
|
+
totp: deserializeTotp(factor.totp),
|
|
770
|
+
userId: factor.user_id
|
|
771
|
+
});
|
|
772
|
+
const deserializeFactorWithSecrets$1 = (factor) => ({
|
|
773
|
+
object: factor.object,
|
|
774
|
+
id: factor.id,
|
|
775
|
+
createdAt: factor.created_at,
|
|
776
|
+
updatedAt: factor.updated_at,
|
|
777
|
+
type: factor.type,
|
|
778
|
+
totp: deserializeTotpWithSecrets(factor.totp),
|
|
779
|
+
userId: factor.user_id
|
|
780
|
+
});
|
|
781
|
+
//#endregion
|
|
782
|
+
//#region src/user-management/serializers/invitation.serializer.ts
|
|
783
|
+
const deserializeInvitation = (invitation) => ({
|
|
784
|
+
object: invitation.object,
|
|
785
|
+
id: invitation.id,
|
|
786
|
+
email: invitation.email,
|
|
787
|
+
state: invitation.state,
|
|
788
|
+
acceptedAt: invitation.accepted_at,
|
|
789
|
+
revokedAt: invitation.revoked_at,
|
|
790
|
+
expiresAt: invitation.expires_at,
|
|
791
|
+
organizationId: invitation.organization_id,
|
|
792
|
+
inviterUserId: invitation.inviter_user_id,
|
|
793
|
+
acceptedUserId: invitation.accepted_user_id,
|
|
794
|
+
token: invitation.token,
|
|
795
|
+
acceptInvitationUrl: invitation.accept_invitation_url,
|
|
796
|
+
createdAt: invitation.created_at,
|
|
797
|
+
updatedAt: invitation.updated_at
|
|
798
|
+
});
|
|
799
|
+
const deserializeInvitationEvent = (invitation) => ({
|
|
800
|
+
object: invitation.object,
|
|
801
|
+
id: invitation.id,
|
|
802
|
+
email: invitation.email,
|
|
803
|
+
state: invitation.state,
|
|
804
|
+
acceptedAt: invitation.accepted_at,
|
|
805
|
+
revokedAt: invitation.revoked_at,
|
|
806
|
+
expiresAt: invitation.expires_at,
|
|
807
|
+
organizationId: invitation.organization_id,
|
|
808
|
+
inviterUserId: invitation.inviter_user_id,
|
|
809
|
+
acceptedUserId: invitation.accepted_user_id,
|
|
810
|
+
createdAt: invitation.created_at,
|
|
811
|
+
updatedAt: invitation.updated_at
|
|
812
|
+
});
|
|
813
|
+
//#endregion
|
|
814
|
+
//#region src/user-management/serializers/list-sessions-options.serializer.ts
|
|
815
|
+
const serializeListSessionsOptions = (options) => ({ ...options });
|
|
816
|
+
//#endregion
|
|
817
|
+
//#region src/user-management/serializers/magic-auth.serializer.ts
|
|
818
|
+
const deserializeMagicAuth = (magicAuth) => ({
|
|
819
|
+
object: magicAuth.object,
|
|
820
|
+
id: magicAuth.id,
|
|
821
|
+
userId: magicAuth.user_id,
|
|
822
|
+
email: magicAuth.email,
|
|
823
|
+
expiresAt: magicAuth.expires_at,
|
|
824
|
+
code: magicAuth.code,
|
|
825
|
+
createdAt: magicAuth.created_at,
|
|
826
|
+
updatedAt: magicAuth.updated_at
|
|
827
|
+
});
|
|
828
|
+
const deserializeMagicAuthEvent = (magicAuth) => ({
|
|
829
|
+
object: magicAuth.object,
|
|
830
|
+
id: magicAuth.id,
|
|
831
|
+
userId: magicAuth.user_id,
|
|
832
|
+
email: magicAuth.email,
|
|
833
|
+
expiresAt: magicAuth.expires_at,
|
|
834
|
+
createdAt: magicAuth.created_at,
|
|
835
|
+
updatedAt: magicAuth.updated_at
|
|
836
|
+
});
|
|
837
|
+
//#endregion
|
|
838
|
+
//#region src/user-management/serializers/password-reset.serializer.ts
|
|
839
|
+
const deserializePasswordReset = (passwordReset) => ({
|
|
840
|
+
object: passwordReset.object,
|
|
841
|
+
id: passwordReset.id,
|
|
842
|
+
userId: passwordReset.user_id,
|
|
843
|
+
email: passwordReset.email,
|
|
844
|
+
passwordResetToken: passwordReset.password_reset_token,
|
|
845
|
+
passwordResetUrl: passwordReset.password_reset_url,
|
|
846
|
+
expiresAt: passwordReset.expires_at,
|
|
847
|
+
createdAt: passwordReset.created_at
|
|
848
|
+
});
|
|
849
|
+
const deserializePasswordResetEvent = (passwordReset) => ({
|
|
850
|
+
object: passwordReset.object,
|
|
851
|
+
id: passwordReset.id,
|
|
852
|
+
userId: passwordReset.user_id,
|
|
853
|
+
email: passwordReset.email,
|
|
854
|
+
expiresAt: passwordReset.expires_at,
|
|
855
|
+
createdAt: passwordReset.created_at
|
|
856
|
+
});
|
|
857
|
+
//#endregion
|
|
858
|
+
//#region src/user-management/serializers/reset-password-options.serializer.ts
|
|
859
|
+
const serializeResetPasswordOptions = (options) => ({
|
|
860
|
+
token: options.token,
|
|
861
|
+
new_password: options.newPassword
|
|
862
|
+
});
|
|
863
|
+
//#endregion
|
|
864
|
+
//#region src/user-management/serializers/session.serializer.ts
|
|
865
|
+
const deserializeSession = (session) => ({
|
|
866
|
+
object: "session",
|
|
867
|
+
id: session.id,
|
|
868
|
+
userId: session.user_id,
|
|
869
|
+
ipAddress: session.ip_address,
|
|
870
|
+
userAgent: session.user_agent,
|
|
871
|
+
...session.organization_id !== void 0 && { organizationId: session.organization_id },
|
|
872
|
+
...session.impersonator !== void 0 && { impersonator: session.impersonator },
|
|
873
|
+
authMethod: session.auth_method,
|
|
874
|
+
status: session.status,
|
|
875
|
+
expiresAt: session.expires_at,
|
|
876
|
+
endedAt: session.ended_at,
|
|
877
|
+
createdAt: session.created_at,
|
|
878
|
+
updatedAt: session.updated_at
|
|
879
|
+
});
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region src/user-management/serializers/create-user-options.serializer.ts
|
|
882
|
+
const serializeCreateUserOptions = (options) => ({
|
|
883
|
+
email: options.email,
|
|
884
|
+
password: options.password,
|
|
885
|
+
password_hash: options.passwordHash,
|
|
886
|
+
password_hash_type: options.passwordHashType,
|
|
887
|
+
first_name: options.firstName,
|
|
888
|
+
last_name: options.lastName,
|
|
889
|
+
email_verified: options.emailVerified,
|
|
890
|
+
external_id: options.externalId,
|
|
891
|
+
metadata: options.metadata
|
|
892
|
+
});
|
|
893
|
+
//#endregion
|
|
894
|
+
//#region src/user-management/serializers/update-user-options.serializer.ts
|
|
895
|
+
const serializeUpdateUserOptions = (options) => ({
|
|
896
|
+
email: options.email,
|
|
897
|
+
email_verified: options.emailVerified,
|
|
898
|
+
first_name: options.firstName,
|
|
899
|
+
last_name: options.lastName,
|
|
900
|
+
password: options.password,
|
|
901
|
+
password_hash: options.passwordHash,
|
|
902
|
+
password_hash_type: options.passwordHashType,
|
|
903
|
+
external_id: options.externalId,
|
|
904
|
+
locale: options.locale,
|
|
905
|
+
metadata: options.metadata
|
|
906
|
+
});
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region src/user-management/serializers/organization-membership.serializer.ts
|
|
909
|
+
const deserializeOrganizationMembership = (organizationMembership) => ({
|
|
910
|
+
object: organizationMembership.object,
|
|
911
|
+
id: organizationMembership.id,
|
|
912
|
+
userId: organizationMembership.user_id,
|
|
913
|
+
organizationId: organizationMembership.organization_id,
|
|
914
|
+
organizationName: organizationMembership.organization_name,
|
|
915
|
+
status: organizationMembership.status,
|
|
916
|
+
directoryManaged: organizationMembership.directory_managed ?? false,
|
|
917
|
+
createdAt: organizationMembership.created_at,
|
|
918
|
+
updatedAt: organizationMembership.updated_at,
|
|
919
|
+
role: organizationMembership.role,
|
|
920
|
+
...organizationMembership.roles && { roles: organizationMembership.roles },
|
|
921
|
+
customAttributes: organizationMembership.custom_attributes ?? {}
|
|
922
|
+
});
|
|
923
|
+
const deserializeAuthorizationOrganizationMembership = (organizationMembership) => ({
|
|
924
|
+
object: organizationMembership.object,
|
|
925
|
+
id: organizationMembership.id,
|
|
926
|
+
userId: organizationMembership.user_id,
|
|
927
|
+
organizationId: organizationMembership.organization_id,
|
|
928
|
+
status: organizationMembership.status,
|
|
929
|
+
directoryManaged: organizationMembership.directory_managed ?? false,
|
|
930
|
+
createdAt: organizationMembership.created_at,
|
|
931
|
+
updatedAt: organizationMembership.updated_at,
|
|
932
|
+
customAttributes: organizationMembership.custom_attributes ?? {}
|
|
933
|
+
});
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/actions/serializers/action.serializer.ts
|
|
936
|
+
const deserializeUserData = (userData) => {
|
|
937
|
+
return {
|
|
938
|
+
object: userData.object,
|
|
939
|
+
email: userData.email,
|
|
940
|
+
firstName: userData.first_name,
|
|
941
|
+
lastName: userData.last_name
|
|
942
|
+
};
|
|
943
|
+
};
|
|
944
|
+
const deserializeAction = (actionPayload) => {
|
|
945
|
+
switch (actionPayload.object) {
|
|
946
|
+
case "user_registration_action_context": return {
|
|
947
|
+
id: actionPayload.id,
|
|
948
|
+
object: actionPayload.object,
|
|
949
|
+
userData: deserializeUserData(actionPayload.user_data),
|
|
950
|
+
invitation: actionPayload.invitation ? deserializeInvitation(actionPayload.invitation) : void 0,
|
|
951
|
+
ipAddress: actionPayload.ip_address,
|
|
952
|
+
userAgent: actionPayload.user_agent,
|
|
953
|
+
deviceFingerprint: actionPayload.device_fingerprint
|
|
954
|
+
};
|
|
955
|
+
case "authentication_action_context": return {
|
|
956
|
+
id: actionPayload.id,
|
|
957
|
+
object: actionPayload.object,
|
|
958
|
+
user: deserializeUser(actionPayload.user),
|
|
959
|
+
organization: actionPayload.organization ? deserializeOrganization(actionPayload.organization) : void 0,
|
|
960
|
+
organizationMembership: actionPayload.organization_membership ? deserializeOrganizationMembership(actionPayload.organization_membership) : void 0,
|
|
961
|
+
ipAddress: actionPayload.ip_address,
|
|
962
|
+
userAgent: actionPayload.user_agent,
|
|
963
|
+
deviceFingerprint: actionPayload.device_fingerprint,
|
|
964
|
+
issuer: actionPayload.issuer
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region src/actions/actions.ts
|
|
970
|
+
var Actions = class {
|
|
971
|
+
signatureProvider;
|
|
972
|
+
constructor(cryptoProvider) {
|
|
973
|
+
this.signatureProvider = new SignatureProvider(cryptoProvider);
|
|
974
|
+
}
|
|
975
|
+
get computeSignature() {
|
|
976
|
+
return this.signatureProvider.computeSignature.bind(this.signatureProvider);
|
|
977
|
+
}
|
|
978
|
+
get verifyHeader() {
|
|
979
|
+
return this.signatureProvider.verifyHeader.bind(this.signatureProvider);
|
|
980
|
+
}
|
|
981
|
+
serializeType(type) {
|
|
982
|
+
switch (type) {
|
|
983
|
+
case "authentication": return "authentication_action_response";
|
|
984
|
+
case "user_registration": return "user_registration_action_response";
|
|
985
|
+
default: return unreachable(type);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
async signResponse(data, secret) {
|
|
989
|
+
let errorMessage;
|
|
990
|
+
const { verdict, type } = data;
|
|
991
|
+
if (verdict === "Deny" && data.errorMessage) errorMessage = data.errorMessage;
|
|
992
|
+
const responsePayload = {
|
|
993
|
+
timestamp: Date.now(),
|
|
994
|
+
verdict,
|
|
995
|
+
...verdict === "Deny" && data.errorMessage && { error_message: errorMessage }
|
|
996
|
+
};
|
|
997
|
+
return {
|
|
998
|
+
object: this.serializeType(type),
|
|
999
|
+
payload: responsePayload,
|
|
1000
|
+
signature: await this.computeSignature(responsePayload.timestamp, responsePayload, secret)
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
async constructAction({ payload, sigHeader, secret, tolerance = 3e4 }) {
|
|
1004
|
+
const options = {
|
|
1005
|
+
payload,
|
|
1006
|
+
sigHeader,
|
|
1007
|
+
secret,
|
|
1008
|
+
tolerance
|
|
1009
|
+
};
|
|
1010
|
+
await this.verifyHeader(options);
|
|
1011
|
+
return deserializeAction(payload);
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region src/directory-sync/serializers/directory-group.serializer.ts
|
|
1016
|
+
const deserializeDirectoryGroup = (directoryGroup) => ({
|
|
1017
|
+
id: directoryGroup.id,
|
|
1018
|
+
idpId: directoryGroup.idp_id,
|
|
1019
|
+
directoryId: directoryGroup.directory_id,
|
|
1020
|
+
organizationId: directoryGroup.organization_id,
|
|
1021
|
+
name: directoryGroup.name,
|
|
1022
|
+
createdAt: directoryGroup.created_at,
|
|
1023
|
+
updatedAt: directoryGroup.updated_at,
|
|
1024
|
+
rawAttributes: directoryGroup.raw_attributes
|
|
1025
|
+
});
|
|
1026
|
+
const deserializeUpdatedEventDirectoryGroup = (directoryGroup) => ({
|
|
1027
|
+
id: directoryGroup.id,
|
|
1028
|
+
idpId: directoryGroup.idp_id,
|
|
1029
|
+
directoryId: directoryGroup.directory_id,
|
|
1030
|
+
organizationId: directoryGroup.organization_id,
|
|
1031
|
+
name: directoryGroup.name,
|
|
1032
|
+
createdAt: directoryGroup.created_at,
|
|
1033
|
+
updatedAt: directoryGroup.updated_at,
|
|
1034
|
+
rawAttributes: directoryGroup.raw_attributes,
|
|
1035
|
+
previousAttributes: directoryGroup.previous_attributes
|
|
1036
|
+
});
|
|
1037
|
+
//#endregion
|
|
1038
|
+
//#region src/directory-sync/serializers/directory-user.serializer.ts
|
|
1039
|
+
const deserializeDirectoryUser = (directoryUser) => ({
|
|
1040
|
+
object: directoryUser.object,
|
|
1041
|
+
id: directoryUser.id,
|
|
1042
|
+
directoryId: directoryUser.directory_id,
|
|
1043
|
+
organizationId: directoryUser.organization_id,
|
|
1044
|
+
rawAttributes: directoryUser.raw_attributes,
|
|
1045
|
+
customAttributes: directoryUser.custom_attributes,
|
|
1046
|
+
idpId: directoryUser.idp_id,
|
|
1047
|
+
firstName: directoryUser.first_name,
|
|
1048
|
+
email: directoryUser.email,
|
|
1049
|
+
lastName: directoryUser.last_name,
|
|
1050
|
+
state: directoryUser.state,
|
|
1051
|
+
...directoryUser.role !== void 0 && { role: directoryUser.role },
|
|
1052
|
+
...directoryUser.roles !== void 0 && { roles: directoryUser.roles },
|
|
1053
|
+
createdAt: directoryUser.created_at,
|
|
1054
|
+
updatedAt: directoryUser.updated_at
|
|
1055
|
+
});
|
|
1056
|
+
const deserializeDirectoryUserWithGroups = (directoryUserWithGroups) => ({
|
|
1057
|
+
...deserializeDirectoryUser(directoryUserWithGroups),
|
|
1058
|
+
groups: directoryUserWithGroups.groups.map(deserializeDirectoryGroup)
|
|
1059
|
+
});
|
|
1060
|
+
const deserializeUpdatedEventDirectoryUser = (directoryUser) => ({
|
|
1061
|
+
object: "directory_user",
|
|
1062
|
+
id: directoryUser.id,
|
|
1063
|
+
directoryId: directoryUser.directory_id,
|
|
1064
|
+
organizationId: directoryUser.organization_id,
|
|
1065
|
+
rawAttributes: directoryUser.raw_attributes,
|
|
1066
|
+
customAttributes: directoryUser.custom_attributes,
|
|
1067
|
+
idpId: directoryUser.idp_id,
|
|
1068
|
+
firstName: directoryUser.first_name,
|
|
1069
|
+
email: directoryUser.email,
|
|
1070
|
+
lastName: directoryUser.last_name,
|
|
1071
|
+
state: directoryUser.state,
|
|
1072
|
+
...directoryUser.role !== void 0 && { role: directoryUser.role },
|
|
1073
|
+
...directoryUser.roles !== void 0 && { roles: directoryUser.roles },
|
|
1074
|
+
createdAt: directoryUser.created_at,
|
|
1075
|
+
updatedAt: directoryUser.updated_at,
|
|
1076
|
+
previousAttributes: directoryUser.previous_attributes
|
|
1077
|
+
});
|
|
1078
|
+
//#endregion
|
|
1079
|
+
//#region src/directory-sync/serializers/directory.serializer.ts
|
|
1080
|
+
const deserializeDirectory = (directory) => ({
|
|
1081
|
+
object: directory.object,
|
|
1082
|
+
id: directory.id,
|
|
1083
|
+
domain: directory.domain,
|
|
1084
|
+
externalKey: directory.external_key,
|
|
1085
|
+
name: directory.name,
|
|
1086
|
+
organizationId: directory.organization_id,
|
|
1087
|
+
state: deserializeDirectoryState(directory.state),
|
|
1088
|
+
type: directory.type,
|
|
1089
|
+
createdAt: directory.created_at,
|
|
1090
|
+
updatedAt: directory.updated_at
|
|
1091
|
+
});
|
|
1092
|
+
const deserializeDirectoryState = (state) => {
|
|
1093
|
+
if (state === "linked") return "active";
|
|
1094
|
+
if (state === "unlinked") return "inactive";
|
|
1095
|
+
return state;
|
|
1096
|
+
};
|
|
1097
|
+
const deserializeEventDirectory = (directory) => ({
|
|
1098
|
+
object: directory.object,
|
|
1099
|
+
id: directory.id,
|
|
1100
|
+
externalKey: directory.external_key,
|
|
1101
|
+
type: directory.type,
|
|
1102
|
+
state: directory.state,
|
|
1103
|
+
name: directory.name,
|
|
1104
|
+
organizationId: directory.organization_id,
|
|
1105
|
+
domains: directory.domains,
|
|
1106
|
+
createdAt: directory.created_at,
|
|
1107
|
+
updatedAt: directory.updated_at
|
|
1108
|
+
});
|
|
1109
|
+
const deserializeDeletedEventDirectory = (directory) => ({
|
|
1110
|
+
object: directory.object,
|
|
1111
|
+
id: directory.id,
|
|
1112
|
+
type: directory.type,
|
|
1113
|
+
state: directory.state,
|
|
1114
|
+
name: directory.name,
|
|
1115
|
+
organizationId: directory.organization_id,
|
|
1116
|
+
createdAt: directory.created_at,
|
|
1117
|
+
updatedAt: directory.updated_at
|
|
1118
|
+
});
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/directory-sync/serializers/list-directories-options.serializer.ts
|
|
1121
|
+
const serializeListDirectoriesOptions = (options) => ({
|
|
1122
|
+
organization_id: options.organizationId,
|
|
1123
|
+
search: options.search,
|
|
1124
|
+
limit: options.limit,
|
|
1125
|
+
before: options.before,
|
|
1126
|
+
after: options.after,
|
|
1127
|
+
order: options.order
|
|
1128
|
+
});
|
|
1129
|
+
//#endregion
|
|
1130
|
+
//#region src/organizations/serializers/create-organization-options.serializer.ts
|
|
1131
|
+
const serializeCreateOrganizationOptions = (options) => ({
|
|
1132
|
+
name: options.name,
|
|
1133
|
+
domain_data: options.domainData,
|
|
1134
|
+
external_id: options.externalId,
|
|
1135
|
+
metadata: options.metadata
|
|
1136
|
+
});
|
|
1137
|
+
//#endregion
|
|
1138
|
+
//#region src/organizations/serializers/update-organization-options.serializer.ts
|
|
1139
|
+
const serializeUpdateOrganizationOptions = (options) => ({
|
|
1140
|
+
name: options.name,
|
|
1141
|
+
domain_data: options.domainData,
|
|
1142
|
+
stripe_customer_id: options.stripeCustomerId,
|
|
1143
|
+
external_id: options.externalId,
|
|
1144
|
+
metadata: options.metadata
|
|
1145
|
+
});
|
|
1146
|
+
//#endregion
|
|
1147
|
+
//#region src/sso/serializers/connection.serializer.ts
|
|
1148
|
+
const deserializeConnection = (connection) => ({
|
|
1149
|
+
object: connection.object,
|
|
1150
|
+
id: connection.id,
|
|
1151
|
+
...connection.organization_id !== void 0 && { organizationId: connection.organization_id },
|
|
1152
|
+
name: connection.name,
|
|
1153
|
+
type: connection.connection_type,
|
|
1154
|
+
state: connection.state,
|
|
1155
|
+
domains: connection.domains,
|
|
1156
|
+
createdAt: connection.created_at,
|
|
1157
|
+
updatedAt: connection.updated_at
|
|
1158
|
+
});
|
|
1159
|
+
//#endregion
|
|
1160
|
+
//#region src/sso/serializers/list-connections-options.serializer.ts
|
|
1161
|
+
const serializeListConnectionsOptions = (options) => ({
|
|
1162
|
+
connection_type: options.connectionType,
|
|
1163
|
+
domain: options.domain,
|
|
1164
|
+
organization_id: options.organizationId,
|
|
1165
|
+
limit: options.limit,
|
|
1166
|
+
before: options.before,
|
|
1167
|
+
after: options.after,
|
|
1168
|
+
order: options.order
|
|
1169
|
+
});
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region src/sso/serializers/profile.serializer.ts
|
|
1172
|
+
const deserializeProfile = (profile) => ({
|
|
1173
|
+
id: profile.id,
|
|
1174
|
+
idpId: profile.idp_id,
|
|
1175
|
+
...profile.organization_id !== void 0 && { organizationId: profile.organization_id },
|
|
1176
|
+
connectionId: profile.connection_id,
|
|
1177
|
+
connectionType: profile.connection_type,
|
|
1178
|
+
email: profile.email,
|
|
1179
|
+
...profile.first_name !== void 0 && { firstName: profile.first_name },
|
|
1180
|
+
...profile.last_name !== void 0 && { lastName: profile.last_name },
|
|
1181
|
+
...profile.role !== void 0 && { role: profile.role },
|
|
1182
|
+
...profile.roles !== void 0 && { roles: profile.roles },
|
|
1183
|
+
...profile.groups !== void 0 && { groups: profile.groups },
|
|
1184
|
+
...profile.custom_attributes !== void 0 && { customAttributes: profile.custom_attributes },
|
|
1185
|
+
...profile.raw_attributes !== void 0 && { rawAttributes: profile.raw_attributes }
|
|
1186
|
+
});
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region src/sso/serializers/profile-and-token.serializer.ts
|
|
1189
|
+
const deserializeProfileAndToken = (profileAndToken) => ({
|
|
1190
|
+
accessToken: profileAndToken.access_token,
|
|
1191
|
+
profile: deserializeProfile(profileAndToken.profile),
|
|
1192
|
+
oauthTokens: deserializeOauthTokens(profileAndToken.oauth_tokens)
|
|
1193
|
+
});
|
|
1194
|
+
//#endregion
|
|
1195
|
+
//#region src/user-management/serializers/role.serializer.ts
|
|
1196
|
+
const deserializeRoleEvent = (role) => ({
|
|
1197
|
+
object: "role",
|
|
1198
|
+
slug: role.slug,
|
|
1199
|
+
permissions: role.permissions,
|
|
1200
|
+
createdAt: role.created_at,
|
|
1201
|
+
updatedAt: role.updated_at
|
|
1202
|
+
});
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region src/user-management/serializers/authentication-radar-risk-event-serializer.ts
|
|
1205
|
+
const deserializeAuthenticationRadarRiskDetectedEvent = (authenticationRadarRiskDetectedEvent) => ({
|
|
1206
|
+
authMethod: authenticationRadarRiskDetectedEvent.auth_method,
|
|
1207
|
+
action: authenticationRadarRiskDetectedEvent.action,
|
|
1208
|
+
control: authenticationRadarRiskDetectedEvent.control,
|
|
1209
|
+
blocklistType: authenticationRadarRiskDetectedEvent.blocklist_type,
|
|
1210
|
+
ipAddress: authenticationRadarRiskDetectedEvent.ip_address,
|
|
1211
|
+
userAgent: authenticationRadarRiskDetectedEvent.user_agent,
|
|
1212
|
+
userId: authenticationRadarRiskDetectedEvent.user_id,
|
|
1213
|
+
email: authenticationRadarRiskDetectedEvent.email
|
|
1214
|
+
});
|
|
1215
|
+
//#endregion
|
|
1216
|
+
//#region src/api-keys/serializers/api-key.serializer.ts
|
|
1217
|
+
function deserializeApiKey(apiKey) {
|
|
1218
|
+
return {
|
|
1219
|
+
object: apiKey.object,
|
|
1220
|
+
id: apiKey.id,
|
|
1221
|
+
owner: apiKey.owner,
|
|
1222
|
+
name: apiKey.name,
|
|
1223
|
+
obfuscatedValue: apiKey.obfuscated_value,
|
|
1224
|
+
lastUsedAt: apiKey.last_used_at,
|
|
1225
|
+
permissions: apiKey.permissions,
|
|
1226
|
+
createdAt: apiKey.created_at,
|
|
1227
|
+
updatedAt: apiKey.updated_at
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/authorization/serializers/organization-role.serializer.ts
|
|
1232
|
+
const deserializeRole$1 = (role) => ({
|
|
1233
|
+
object: role.object,
|
|
1234
|
+
id: role.id,
|
|
1235
|
+
name: role.name,
|
|
1236
|
+
slug: role.slug,
|
|
1237
|
+
description: role.description,
|
|
1238
|
+
permissions: role.permissions,
|
|
1239
|
+
resourceTypeSlug: role.resource_type_slug,
|
|
1240
|
+
type: role.type,
|
|
1241
|
+
createdAt: role.created_at,
|
|
1242
|
+
updatedAt: role.updated_at
|
|
1243
|
+
});
|
|
1244
|
+
const deserializeOrganizationRole = (role) => ({
|
|
1245
|
+
object: role.object,
|
|
1246
|
+
id: role.id,
|
|
1247
|
+
name: role.name,
|
|
1248
|
+
slug: role.slug,
|
|
1249
|
+
description: role.description,
|
|
1250
|
+
permissions: role.permissions,
|
|
1251
|
+
resourceTypeSlug: role.resource_type_slug,
|
|
1252
|
+
type: "OrganizationRole",
|
|
1253
|
+
createdAt: role.created_at,
|
|
1254
|
+
updatedAt: role.updated_at
|
|
1255
|
+
});
|
|
1256
|
+
const deserializeOrganizationRoleEvent = (event) => ({
|
|
1257
|
+
object: event.object,
|
|
1258
|
+
organizationId: event.organization_id,
|
|
1259
|
+
slug: event.slug,
|
|
1260
|
+
name: event.name,
|
|
1261
|
+
description: event.description,
|
|
1262
|
+
resourceTypeSlug: event.resource_type_slug,
|
|
1263
|
+
permissions: event.permissions,
|
|
1264
|
+
createdAt: event.created_at,
|
|
1265
|
+
updatedAt: event.updated_at
|
|
1266
|
+
});
|
|
1267
|
+
//#endregion
|
|
1268
|
+
//#region src/authorization/serializers/permission.serializer.ts
|
|
1269
|
+
const deserializePermission = (permission) => ({
|
|
1270
|
+
object: permission.object,
|
|
1271
|
+
id: permission.id,
|
|
1272
|
+
slug: permission.slug,
|
|
1273
|
+
name: permission.name,
|
|
1274
|
+
description: permission.description,
|
|
1275
|
+
resourceTypeSlug: permission.resource_type_slug,
|
|
1276
|
+
system: permission.system,
|
|
1277
|
+
createdAt: permission.created_at,
|
|
1278
|
+
updatedAt: permission.updated_at
|
|
1279
|
+
});
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region src/feature-flags/serializers/feature-flag.serializer.ts
|
|
1282
|
+
const deserializeFeatureFlag = (featureFlag) => ({
|
|
1283
|
+
object: featureFlag.object,
|
|
1284
|
+
id: featureFlag.id,
|
|
1285
|
+
name: featureFlag.name,
|
|
1286
|
+
slug: featureFlag.slug,
|
|
1287
|
+
description: featureFlag.description,
|
|
1288
|
+
tags: featureFlag.tags,
|
|
1289
|
+
enabled: featureFlag.enabled,
|
|
1290
|
+
defaultValue: featureFlag.default_value,
|
|
1291
|
+
createdAt: featureFlag.created_at,
|
|
1292
|
+
updatedAt: featureFlag.updated_at
|
|
1293
|
+
});
|
|
1294
|
+
//#endregion
|
|
1295
|
+
//#region src/common/serializers/event.serializer.ts
|
|
1296
|
+
const deserializeEvent = (event) => {
|
|
1297
|
+
const eventBase = {
|
|
1298
|
+
id: event.id,
|
|
1299
|
+
createdAt: event.created_at,
|
|
1300
|
+
context: event.context
|
|
1301
|
+
};
|
|
1302
|
+
switch (event.event) {
|
|
1303
|
+
case "authentication.email_verification_succeeded":
|
|
1304
|
+
case "authentication.magic_auth_failed":
|
|
1305
|
+
case "authentication.magic_auth_succeeded":
|
|
1306
|
+
case "authentication.mfa_succeeded":
|
|
1307
|
+
case "authentication.oauth_failed":
|
|
1308
|
+
case "authentication.oauth_succeeded":
|
|
1309
|
+
case "authentication.passkey_failed":
|
|
1310
|
+
case "authentication.passkey_succeeded":
|
|
1311
|
+
case "authentication.password_failed":
|
|
1312
|
+
case "authentication.password_succeeded":
|
|
1313
|
+
case "authentication.sso_failed":
|
|
1314
|
+
case "authentication.sso_succeeded": return {
|
|
1315
|
+
...eventBase,
|
|
1316
|
+
event: event.event,
|
|
1317
|
+
data: deserializeAuthenticationEvent(event.data)
|
|
1318
|
+
};
|
|
1319
|
+
case "authentication.radar_risk_detected": return {
|
|
1320
|
+
...eventBase,
|
|
1321
|
+
event: event.event,
|
|
1322
|
+
data: deserializeAuthenticationRadarRiskDetectedEvent(event.data)
|
|
1323
|
+
};
|
|
1324
|
+
case "connection.activated":
|
|
1325
|
+
case "connection.deactivated":
|
|
1326
|
+
case "connection.deleted": return {
|
|
1327
|
+
...eventBase,
|
|
1328
|
+
event: event.event,
|
|
1329
|
+
data: deserializeConnection(event.data)
|
|
1330
|
+
};
|
|
1331
|
+
case "dsync.activated": return {
|
|
1332
|
+
...eventBase,
|
|
1333
|
+
event: event.event,
|
|
1334
|
+
data: deserializeEventDirectory(event.data)
|
|
1335
|
+
};
|
|
1336
|
+
case "dsync.deleted": return {
|
|
1337
|
+
...eventBase,
|
|
1338
|
+
event: event.event,
|
|
1339
|
+
data: deserializeDeletedEventDirectory(event.data)
|
|
1340
|
+
};
|
|
1341
|
+
case "dsync.group.created":
|
|
1342
|
+
case "dsync.group.deleted": return {
|
|
1343
|
+
...eventBase,
|
|
1344
|
+
event: event.event,
|
|
1345
|
+
data: deserializeDirectoryGroup(event.data)
|
|
1346
|
+
};
|
|
1347
|
+
case "dsync.group.updated": return {
|
|
1348
|
+
...eventBase,
|
|
1349
|
+
event: event.event,
|
|
1350
|
+
data: deserializeUpdatedEventDirectoryGroup(event.data)
|
|
1351
|
+
};
|
|
1352
|
+
case "dsync.group.user_added":
|
|
1353
|
+
case "dsync.group.user_removed": return {
|
|
1354
|
+
...eventBase,
|
|
1355
|
+
event: event.event,
|
|
1356
|
+
data: {
|
|
1357
|
+
directoryId: event.data.directory_id,
|
|
1358
|
+
user: deserializeDirectoryUser(event.data.user),
|
|
1359
|
+
group: deserializeDirectoryGroup(event.data.group)
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
case "dsync.user.created":
|
|
1363
|
+
case "dsync.user.deleted": return {
|
|
1364
|
+
...eventBase,
|
|
1365
|
+
event: event.event,
|
|
1366
|
+
data: deserializeDirectoryUser(event.data)
|
|
1367
|
+
};
|
|
1368
|
+
case "dsync.user.updated": return {
|
|
1369
|
+
...eventBase,
|
|
1370
|
+
event: event.event,
|
|
1371
|
+
data: deserializeUpdatedEventDirectoryUser(event.data)
|
|
1372
|
+
};
|
|
1373
|
+
case "email_verification.created": return {
|
|
1374
|
+
...eventBase,
|
|
1375
|
+
event: event.event,
|
|
1376
|
+
data: deserializeEmailVerificationEvent(event.data)
|
|
1377
|
+
};
|
|
1378
|
+
case "invitation.accepted":
|
|
1379
|
+
case "invitation.created":
|
|
1380
|
+
case "invitation.revoked":
|
|
1381
|
+
case "invitation.resent": return {
|
|
1382
|
+
...eventBase,
|
|
1383
|
+
event: event.event,
|
|
1384
|
+
data: deserializeInvitationEvent(event.data)
|
|
1385
|
+
};
|
|
1386
|
+
case "magic_auth.created": return {
|
|
1387
|
+
...eventBase,
|
|
1388
|
+
event: event.event,
|
|
1389
|
+
data: deserializeMagicAuthEvent(event.data)
|
|
1390
|
+
};
|
|
1391
|
+
case "password_reset.created":
|
|
1392
|
+
case "password_reset.succeeded": return {
|
|
1393
|
+
...eventBase,
|
|
1394
|
+
event: event.event,
|
|
1395
|
+
data: deserializePasswordResetEvent(event.data)
|
|
1396
|
+
};
|
|
1397
|
+
case "user.created":
|
|
1398
|
+
case "user.updated":
|
|
1399
|
+
case "user.deleted": return {
|
|
1400
|
+
...eventBase,
|
|
1401
|
+
event: event.event,
|
|
1402
|
+
data: deserializeUser(event.data)
|
|
1403
|
+
};
|
|
1404
|
+
case "organization_membership.created":
|
|
1405
|
+
case "organization_membership.deleted":
|
|
1406
|
+
case "organization_membership.updated": return {
|
|
1407
|
+
...eventBase,
|
|
1408
|
+
event: event.event,
|
|
1409
|
+
data: deserializeOrganizationMembership(event.data)
|
|
1410
|
+
};
|
|
1411
|
+
case "role.created":
|
|
1412
|
+
case "role.deleted":
|
|
1413
|
+
case "role.updated": return {
|
|
1414
|
+
...eventBase,
|
|
1415
|
+
event: event.event,
|
|
1416
|
+
data: deserializeRoleEvent(event.data)
|
|
1417
|
+
};
|
|
1418
|
+
case "organization_role.created":
|
|
1419
|
+
case "organization_role.updated":
|
|
1420
|
+
case "organization_role.deleted": return {
|
|
1421
|
+
...eventBase,
|
|
1422
|
+
event: event.event,
|
|
1423
|
+
data: deserializeOrganizationRoleEvent(event.data)
|
|
1424
|
+
};
|
|
1425
|
+
case "permission.created":
|
|
1426
|
+
case "permission.updated":
|
|
1427
|
+
case "permission.deleted": return {
|
|
1428
|
+
...eventBase,
|
|
1429
|
+
event: event.event,
|
|
1430
|
+
data: deserializePermission(event.data)
|
|
1431
|
+
};
|
|
1432
|
+
case "session.created":
|
|
1433
|
+
case "session.revoked": return {
|
|
1434
|
+
...eventBase,
|
|
1435
|
+
event: event.event,
|
|
1436
|
+
data: deserializeSession(event.data)
|
|
1437
|
+
};
|
|
1438
|
+
case "organization.created":
|
|
1439
|
+
case "organization.updated":
|
|
1440
|
+
case "organization.deleted": return {
|
|
1441
|
+
...eventBase,
|
|
1442
|
+
event: event.event,
|
|
1443
|
+
data: deserializeOrganization(event.data)
|
|
1444
|
+
};
|
|
1445
|
+
case "organization_domain.verified":
|
|
1446
|
+
case "organization_domain.verification_failed":
|
|
1447
|
+
case "organization_domain.created":
|
|
1448
|
+
case "organization_domain.updated":
|
|
1449
|
+
case "organization_domain.deleted": return {
|
|
1450
|
+
...eventBase,
|
|
1451
|
+
event: event.event,
|
|
1452
|
+
data: deserializeOrganizationDomain(event.data)
|
|
1453
|
+
};
|
|
1454
|
+
case "api_key.created":
|
|
1455
|
+
case "api_key.revoked": return {
|
|
1456
|
+
...eventBase,
|
|
1457
|
+
event: event.event,
|
|
1458
|
+
data: deserializeApiKey(event.data)
|
|
1459
|
+
};
|
|
1460
|
+
case "flag.created":
|
|
1461
|
+
case "flag.updated":
|
|
1462
|
+
case "flag.deleted":
|
|
1463
|
+
case "flag.rule_updated": return {
|
|
1464
|
+
...eventBase,
|
|
1465
|
+
event: event.event,
|
|
1466
|
+
data: deserializeFeatureFlag(event.data)
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
//#endregion
|
|
1471
|
+
//#region src/common/serializers/list.serializer.ts
|
|
1472
|
+
const deserializeList = (list, deserializer) => ({
|
|
1473
|
+
object: "list",
|
|
1474
|
+
data: list.data.map(deserializer),
|
|
1475
|
+
listMetadata: list.list_metadata
|
|
1476
|
+
});
|
|
1477
|
+
//#endregion
|
|
1478
|
+
//#region src/common/serializers/pagination-options.serializer.ts
|
|
1479
|
+
const serializePaginationOptions = (options) => ({
|
|
1480
|
+
...options.limit !== void 0 && { limit: options.limit },
|
|
1481
|
+
...options.after && { after: options.after },
|
|
1482
|
+
...options.before && { before: options.before },
|
|
1483
|
+
...options.order && { order: options.order }
|
|
1484
|
+
});
|
|
1485
|
+
//#endregion
|
|
1486
|
+
//#region src/webhooks/webhooks.ts
|
|
1487
|
+
var Webhooks = class {
|
|
1488
|
+
signatureProvider;
|
|
1489
|
+
constructor(cryptoProvider) {
|
|
1490
|
+
this.signatureProvider = new SignatureProvider(cryptoProvider);
|
|
1491
|
+
}
|
|
1492
|
+
get verifyHeader() {
|
|
1493
|
+
return this.signatureProvider.verifyHeader.bind(this.signatureProvider);
|
|
1494
|
+
}
|
|
1495
|
+
get computeSignature() {
|
|
1496
|
+
return this.signatureProvider.computeSignature.bind(this.signatureProvider);
|
|
1497
|
+
}
|
|
1498
|
+
get getTimestampAndSignatureHash() {
|
|
1499
|
+
return this.signatureProvider.getTimestampAndSignatureHash.bind(this.signatureProvider);
|
|
1500
|
+
}
|
|
1501
|
+
async constructEvent({ payload, sigHeader, secret, tolerance = 18e4 }) {
|
|
1502
|
+
const options = {
|
|
1503
|
+
payload,
|
|
1504
|
+
sigHeader,
|
|
1505
|
+
secret,
|
|
1506
|
+
tolerance
|
|
1507
|
+
};
|
|
1508
|
+
await this.verifyHeader(options);
|
|
1509
|
+
return deserializeEvent(payload);
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
//#endregion
|
|
1513
|
+
//#region src/pkce/pkce.ts
|
|
1514
|
+
/**
|
|
1515
|
+
* PKCE (Proof Key for Code Exchange) utilities for OAuth 2.0 public clients.
|
|
1516
|
+
*
|
|
1517
|
+
* Implements RFC 7636 for secure authorization code exchange without a client secret.
|
|
1518
|
+
* Used by Electron apps, React Native/mobile apps, CLI tools, and other public clients.
|
|
1519
|
+
*/
|
|
1520
|
+
var PKCE = class {
|
|
1521
|
+
/**
|
|
1522
|
+
* Generate a cryptographically random code verifier.
|
|
1523
|
+
*
|
|
1524
|
+
* @param length - Length of verifier (43-128, default 43)
|
|
1525
|
+
* @returns RFC 7636 compliant code verifier
|
|
1526
|
+
*/
|
|
1527
|
+
generateCodeVerifier(length = 43) {
|
|
1528
|
+
if (length < 43 || length > 128) throw new RangeError(`Code verifier length must be between 43 and 128, got ${length}`);
|
|
1529
|
+
const byteLength = Math.ceil(length * 3 / 4);
|
|
1530
|
+
const randomBytes = new Uint8Array(byteLength);
|
|
1531
|
+
crypto.getRandomValues(randomBytes);
|
|
1532
|
+
return this.base64UrlEncode(randomBytes).slice(0, length);
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Generate S256 code challenge from a verifier.
|
|
1536
|
+
*
|
|
1537
|
+
* @param verifier - The code verifier
|
|
1538
|
+
* @returns Base64URL-encoded SHA256 hash
|
|
1539
|
+
*/
|
|
1540
|
+
async generateCodeChallenge(verifier) {
|
|
1541
|
+
const data = new TextEncoder().encode(verifier);
|
|
1542
|
+
const hash = await crypto.subtle.digest("SHA-256", data);
|
|
1543
|
+
return this.base64UrlEncode(new Uint8Array(hash));
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Generate a complete PKCE pair (verifier + challenge).
|
|
1547
|
+
*
|
|
1548
|
+
* @returns Code verifier, challenge, and method ('S256')
|
|
1549
|
+
*/
|
|
1550
|
+
async generate() {
|
|
1551
|
+
const codeVerifier = this.generateCodeVerifier();
|
|
1552
|
+
return {
|
|
1553
|
+
codeVerifier,
|
|
1554
|
+
codeChallenge: await this.generateCodeChallenge(codeVerifier),
|
|
1555
|
+
codeChallengeMethod: "S256"
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
base64UrlEncode(buffer) {
|
|
1559
|
+
return btoa(String.fromCharCode(...buffer)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region src/api-keys/serializers/validate-api-key.serializer.ts
|
|
1564
|
+
function deserializeValidateApiKeyResponse(response) {
|
|
1565
|
+
return { apiKey: response.api_key ? deserializeApiKey(response.api_key) : null };
|
|
1566
|
+
}
|
|
1567
|
+
//#endregion
|
|
1568
|
+
//#region src/api-keys/api-keys.ts
|
|
1569
|
+
var ApiKeys = class {
|
|
1570
|
+
constructor(workos) {
|
|
1571
|
+
this.workos = workos;
|
|
1572
|
+
}
|
|
1573
|
+
async validateApiKey(payload) {
|
|
1574
|
+
const { data } = await this.workos.post("/api_keys/validations", payload);
|
|
1575
|
+
return deserializeValidateApiKeyResponse(data);
|
|
1576
|
+
}
|
|
1577
|
+
async deleteApiKey(id) {
|
|
1578
|
+
await this.workos.delete(`/api_keys/${id}`);
|
|
1579
|
+
}
|
|
1580
|
+
};
|
|
1581
|
+
//#endregion
|
|
1582
|
+
//#region src/common/utils/pagination.ts
|
|
1583
|
+
var AutoPaginatable = class {
|
|
1584
|
+
object = "list";
|
|
1585
|
+
options;
|
|
1586
|
+
constructor(list, apiCall, options) {
|
|
1587
|
+
this.list = list;
|
|
1588
|
+
this.apiCall = apiCall;
|
|
1589
|
+
this.options = options ?? {};
|
|
1590
|
+
}
|
|
1591
|
+
get data() {
|
|
1592
|
+
return this.list.data;
|
|
1593
|
+
}
|
|
1594
|
+
get listMetadata() {
|
|
1595
|
+
return this.list.listMetadata;
|
|
1596
|
+
}
|
|
1597
|
+
async *generatePages(params) {
|
|
1598
|
+
const result = await this.apiCall({
|
|
1599
|
+
...this.options,
|
|
1600
|
+
limit: 100,
|
|
1601
|
+
after: params.after
|
|
1602
|
+
});
|
|
1603
|
+
yield result.data;
|
|
1604
|
+
if (result.listMetadata.after) {
|
|
1605
|
+
await new Promise((resolve) => setTimeout(resolve, 350));
|
|
1606
|
+
yield* this.generatePages({ after: result.listMetadata.after });
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Automatically paginates over the list of results, returning the complete data set.
|
|
1611
|
+
* Returns the first result if `options.limit` is passed to the first request.
|
|
1612
|
+
*/
|
|
1613
|
+
async autoPagination() {
|
|
1614
|
+
if (this.options.limit) return this.data;
|
|
1615
|
+
const results = [];
|
|
1616
|
+
for await (const page of this.generatePages({ after: this.options.after })) results.push(...page);
|
|
1617
|
+
return results;
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
//#endregion
|
|
1621
|
+
//#region src/common/utils/fetch-and-deserialize.ts
|
|
1622
|
+
const setDefaultOptions = (options) => {
|
|
1623
|
+
return {
|
|
1624
|
+
...options,
|
|
1625
|
+
order: options?.order || "desc"
|
|
1626
|
+
};
|
|
1627
|
+
};
|
|
1628
|
+
const fetchAndDeserialize = async (workos, endpoint, deserializeFn, options, requestOptions) => {
|
|
1629
|
+
const { data } = await workos.get(endpoint, {
|
|
1630
|
+
query: setDefaultOptions(options),
|
|
1631
|
+
...requestOptions
|
|
1632
|
+
});
|
|
1633
|
+
return deserializeList(data, deserializeFn);
|
|
1634
|
+
};
|
|
1635
|
+
//#endregion
|
|
1636
|
+
//#region src/directory-sync/directory-sync.ts
|
|
1637
|
+
var DirectorySync = class {
|
|
1638
|
+
constructor(workos) {
|
|
1639
|
+
this.workos = workos;
|
|
1640
|
+
}
|
|
1641
|
+
async listDirectories(options) {
|
|
1642
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/directories", deserializeDirectory, options ? serializeListDirectoriesOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/directories", deserializeDirectory, params), options ? serializeListDirectoriesOptions(options) : void 0);
|
|
1643
|
+
}
|
|
1644
|
+
async getDirectory(id) {
|
|
1645
|
+
const { data } = await this.workos.get(`/directories/${id}`);
|
|
1646
|
+
return deserializeDirectory(data);
|
|
1647
|
+
}
|
|
1648
|
+
async deleteDirectory(id) {
|
|
1649
|
+
await this.workos.delete(`/directories/${id}`);
|
|
1650
|
+
}
|
|
1651
|
+
async listGroups(options) {
|
|
1652
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/directory_groups", deserializeDirectoryGroup, options), (params) => fetchAndDeserialize(this.workos, "/directory_groups", deserializeDirectoryGroup, params), options);
|
|
1653
|
+
}
|
|
1654
|
+
async listUsers(options) {
|
|
1655
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/directory_users", deserializeDirectoryUserWithGroups, options), (params) => fetchAndDeserialize(this.workos, "/directory_users", deserializeDirectoryUserWithGroups, params), options);
|
|
1656
|
+
}
|
|
1657
|
+
async getUser(user) {
|
|
1658
|
+
const { data } = await this.workos.get(`/directory_users/${user}`);
|
|
1659
|
+
return deserializeDirectoryUserWithGroups(data);
|
|
1660
|
+
}
|
|
1661
|
+
async getGroup(group) {
|
|
1662
|
+
const { data } = await this.workos.get(`/directory_groups/${group}`);
|
|
1663
|
+
return deserializeDirectoryGroup(data);
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1666
|
+
//#endregion
|
|
1667
|
+
//#region src/events/serializers/list-event-options.serializer.ts
|
|
1668
|
+
const serializeListEventOptions = (options) => ({
|
|
1669
|
+
events: options.events,
|
|
1670
|
+
organization_id: options.organizationId,
|
|
1671
|
+
range_start: options.rangeStart,
|
|
1672
|
+
range_end: options.rangeEnd,
|
|
1673
|
+
limit: options.limit,
|
|
1674
|
+
after: options.after
|
|
1675
|
+
});
|
|
1676
|
+
//#endregion
|
|
1677
|
+
//#region src/events/events.ts
|
|
1678
|
+
var Events = class {
|
|
1679
|
+
constructor(workos) {
|
|
1680
|
+
this.workos = workos;
|
|
1681
|
+
}
|
|
1682
|
+
async listEvents(options) {
|
|
1683
|
+
const { data } = await this.workos.get(`/events`, { query: options ? serializeListEventOptions(options) : void 0 });
|
|
1684
|
+
return deserializeList(data, deserializeEvent);
|
|
1685
|
+
}
|
|
1686
|
+
};
|
|
1687
|
+
//#endregion
|
|
1688
|
+
//#region src/roles/serializers/role.serializer.ts
|
|
1689
|
+
const deserializeRole = (role) => ({
|
|
1690
|
+
object: role.object,
|
|
1691
|
+
id: role.id,
|
|
1692
|
+
name: role.name,
|
|
1693
|
+
slug: role.slug,
|
|
1694
|
+
description: role.description,
|
|
1695
|
+
permissions: role.permissions,
|
|
1696
|
+
type: role.type,
|
|
1697
|
+
createdAt: role.created_at,
|
|
1698
|
+
updatedAt: role.updated_at
|
|
1699
|
+
});
|
|
1700
|
+
//#endregion
|
|
1701
|
+
//#region src/api-keys/serializers/create-organization-api-key-options.serializer.ts
|
|
1702
|
+
function serializeCreateOrganizationApiKeyOptions(options) {
|
|
1703
|
+
return {
|
|
1704
|
+
name: options.name,
|
|
1705
|
+
permissions: options.permissions
|
|
1706
|
+
};
|
|
1707
|
+
}
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region src/api-keys/serializers/created-api-key.serializer.ts
|
|
1710
|
+
function deserializeCreatedApiKey(apiKey) {
|
|
1711
|
+
return {
|
|
1712
|
+
object: apiKey.object,
|
|
1713
|
+
id: apiKey.id,
|
|
1714
|
+
owner: apiKey.owner,
|
|
1715
|
+
name: apiKey.name,
|
|
1716
|
+
obfuscatedValue: apiKey.obfuscated_value,
|
|
1717
|
+
value: apiKey.value,
|
|
1718
|
+
lastUsedAt: apiKey.last_used_at,
|
|
1719
|
+
permissions: apiKey.permissions,
|
|
1720
|
+
createdAt: apiKey.created_at,
|
|
1721
|
+
updatedAt: apiKey.updated_at
|
|
1722
|
+
};
|
|
1723
|
+
}
|
|
1724
|
+
//#endregion
|
|
1725
|
+
//#region src/organizations/organizations.ts
|
|
1726
|
+
var Organizations = class {
|
|
1727
|
+
constructor(workos) {
|
|
1728
|
+
this.workos = workos;
|
|
1729
|
+
}
|
|
1730
|
+
async listOrganizations(options) {
|
|
1731
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/organizations", deserializeOrganization, options), (params) => fetchAndDeserialize(this.workos, "/organizations", deserializeOrganization, params), options);
|
|
1732
|
+
}
|
|
1733
|
+
async createOrganization(payload, requestOptions = {}) {
|
|
1734
|
+
const { data } = await this.workos.post("/organizations", serializeCreateOrganizationOptions(payload), requestOptions);
|
|
1735
|
+
return deserializeOrganization(data);
|
|
1736
|
+
}
|
|
1737
|
+
async deleteOrganization(id) {
|
|
1738
|
+
await this.workos.delete(`/organizations/${id}`);
|
|
1739
|
+
}
|
|
1740
|
+
async getOrganization(id) {
|
|
1741
|
+
const { data } = await this.workos.get(`/organizations/${id}`);
|
|
1742
|
+
return deserializeOrganization(data);
|
|
1743
|
+
}
|
|
1744
|
+
async getOrganizationByExternalId(externalId) {
|
|
1745
|
+
const { data } = await this.workos.get(`/organizations/external_id/${externalId}`);
|
|
1746
|
+
return deserializeOrganization(data);
|
|
1747
|
+
}
|
|
1748
|
+
async updateOrganization(options) {
|
|
1749
|
+
const { organization: organizationId, ...payload } = options;
|
|
1750
|
+
const { data } = await this.workos.put(`/organizations/${organizationId}`, serializeUpdateOrganizationOptions(payload));
|
|
1751
|
+
return deserializeOrganization(data);
|
|
1752
|
+
}
|
|
1753
|
+
async listOrganizationRoles(options) {
|
|
1754
|
+
const { organizationId } = options;
|
|
1755
|
+
const { data: response } = await this.workos.get(`/organizations/${organizationId}/roles`);
|
|
1756
|
+
return {
|
|
1757
|
+
object: "list",
|
|
1758
|
+
data: response.data.map((role) => deserializeRole(role))
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
async listOrganizationFeatureFlags(options) {
|
|
1762
|
+
const { organizationId, ...paginationOptions } = options;
|
|
1763
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/organizations/${organizationId}/feature-flags`, deserializeFeatureFlag, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/organizations/${organizationId}/feature-flags`, deserializeFeatureFlag, params), paginationOptions);
|
|
1764
|
+
}
|
|
1765
|
+
async listOrganizationApiKeys(options) {
|
|
1766
|
+
const { organizationId, ...paginationOptions } = options;
|
|
1767
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/organizations/${organizationId}/api_keys`, deserializeApiKey, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/organizations/${organizationId}/api_keys`, deserializeApiKey, params), paginationOptions);
|
|
1768
|
+
}
|
|
1769
|
+
async createOrganizationApiKey(options, requestOptions = {}) {
|
|
1770
|
+
const { organizationId } = options;
|
|
1771
|
+
const { data } = await this.workos.post(`/organizations/${organizationId}/api_keys`, serializeCreateOrganizationApiKeyOptions(options), requestOptions);
|
|
1772
|
+
return deserializeCreatedApiKey(data);
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
//#endregion
|
|
1776
|
+
//#region src/organization-domains/serializers/create-organization-domain-options.serializer.ts
|
|
1777
|
+
const serializeCreateOrganizationDomainOptions = (options) => ({
|
|
1778
|
+
domain: options.domain,
|
|
1779
|
+
organization_id: options.organizationId
|
|
1780
|
+
});
|
|
1781
|
+
//#endregion
|
|
1782
|
+
//#region src/organization-domains/organization-domains.ts
|
|
1783
|
+
var OrganizationDomains = class {
|
|
1784
|
+
constructor(workos) {
|
|
1785
|
+
this.workos = workos;
|
|
1786
|
+
}
|
|
1787
|
+
async get(id) {
|
|
1788
|
+
const { data } = await this.workos.get(`/organization_domains/${id}`);
|
|
1789
|
+
return deserializeOrganizationDomain(data);
|
|
1790
|
+
}
|
|
1791
|
+
async verify(id) {
|
|
1792
|
+
const { data } = await this.workos.post(`/organization_domains/${id}/verify`, {});
|
|
1793
|
+
return deserializeOrganizationDomain(data);
|
|
1794
|
+
}
|
|
1795
|
+
async create(payload) {
|
|
1796
|
+
const { data } = await this.workos.post(`/organization_domains`, serializeCreateOrganizationDomainOptions(payload));
|
|
1797
|
+
return deserializeOrganizationDomain(data);
|
|
1798
|
+
}
|
|
1799
|
+
async delete(id) {
|
|
1800
|
+
await this.workos.delete(`/organization_domains/${id}`);
|
|
1801
|
+
}
|
|
1802
|
+
};
|
|
1803
|
+
//#endregion
|
|
1804
|
+
//#region src/passwordless/serializers/passwordless-session.serializer.ts
|
|
1805
|
+
const deserializePasswordlessSession = (passwordlessSession) => ({
|
|
1806
|
+
id: passwordlessSession.id,
|
|
1807
|
+
email: passwordlessSession.email,
|
|
1808
|
+
expiresAt: passwordlessSession.expires_at,
|
|
1809
|
+
link: passwordlessSession.link,
|
|
1810
|
+
object: passwordlessSession.object
|
|
1811
|
+
});
|
|
1812
|
+
//#endregion
|
|
1813
|
+
//#region src/passwordless/passwordless.ts
|
|
1814
|
+
var Passwordless = class {
|
|
1815
|
+
constructor(workos) {
|
|
1816
|
+
this.workos = workos;
|
|
1817
|
+
}
|
|
1818
|
+
async createSession({ redirectURI, expiresIn, ...options }) {
|
|
1819
|
+
const { data } = await this.workos.post("/passwordless/sessions", {
|
|
1820
|
+
...options,
|
|
1821
|
+
redirect_uri: redirectURI,
|
|
1822
|
+
expires_in: expiresIn
|
|
1823
|
+
});
|
|
1824
|
+
return deserializePasswordlessSession(data);
|
|
1825
|
+
}
|
|
1826
|
+
async sendSession(sessionId) {
|
|
1827
|
+
const { data } = await this.workos.post(`/passwordless/sessions/${sessionId}/send`, {});
|
|
1828
|
+
return data;
|
|
1829
|
+
}
|
|
1830
|
+
};
|
|
1831
|
+
//#endregion
|
|
1832
|
+
//#region src/pipes/serializers/access-token.serializer.ts
|
|
1833
|
+
function deserializeAccessToken(serialized) {
|
|
1834
|
+
return {
|
|
1835
|
+
object: "access_token",
|
|
1836
|
+
accessToken: serialized.access_token,
|
|
1837
|
+
expiresAt: serialized.expires_at ? new Date(Date.parse(serialized.expires_at)) : null,
|
|
1838
|
+
scopes: serialized.scopes,
|
|
1839
|
+
missingScopes: serialized.missing_scopes
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
//#endregion
|
|
1843
|
+
//#region src/pipes/serializers/get-access-token.serializer.ts
|
|
1844
|
+
function serializeGetAccessTokenOptions(options) {
|
|
1845
|
+
return {
|
|
1846
|
+
user_id: options.userId,
|
|
1847
|
+
organization_id: options.organizationId
|
|
1848
|
+
};
|
|
1849
|
+
}
|
|
1850
|
+
function deserializeGetAccessTokenResponse(response) {
|
|
1851
|
+
if (response.active) return {
|
|
1852
|
+
active: true,
|
|
1853
|
+
accessToken: deserializeAccessToken(response.access_token)
|
|
1854
|
+
};
|
|
1855
|
+
return {
|
|
1856
|
+
active: false,
|
|
1857
|
+
error: response.error
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1860
|
+
//#endregion
|
|
1861
|
+
//#region src/pipes/pipes.ts
|
|
1862
|
+
var Pipes = class {
|
|
1863
|
+
constructor(workos) {
|
|
1864
|
+
this.workos = workos;
|
|
1865
|
+
}
|
|
1866
|
+
async getAccessToken({ provider, ...options }) {
|
|
1867
|
+
const { data } = await this.workos.post(`data-integrations/${provider}/token`, serializeGetAccessTokenOptions(options));
|
|
1868
|
+
return deserializeGetAccessTokenResponse(data);
|
|
1869
|
+
}
|
|
1870
|
+
};
|
|
1871
|
+
//#endregion
|
|
1872
|
+
//#region src/portal/portal.ts
|
|
1873
|
+
var Portal = class {
|
|
1874
|
+
constructor(workos) {
|
|
1875
|
+
this.workos = workos;
|
|
1876
|
+
}
|
|
1877
|
+
async generateLink({ intent, organization, returnUrl, successUrl }) {
|
|
1878
|
+
const { data } = await this.workos.post("/portal/generate_link", {
|
|
1879
|
+
intent,
|
|
1880
|
+
organization,
|
|
1881
|
+
return_url: returnUrl,
|
|
1882
|
+
success_url: successUrl
|
|
1883
|
+
});
|
|
1884
|
+
return data;
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
//#endregion
|
|
1888
|
+
//#region src/common/utils/query-string.ts
|
|
1889
|
+
/**
|
|
1890
|
+
* Converts options to a query string.
|
|
1891
|
+
* - Arrays: scope=read&scope=write (repeat format)
|
|
1892
|
+
* - Objects: params[key]=value (bracket notation)
|
|
1893
|
+
* - Encoding: RFC1738 (space as +)
|
|
1894
|
+
* - Keys sorted alphabetically
|
|
1895
|
+
*/
|
|
1896
|
+
function toQueryString(options) {
|
|
1897
|
+
const params = [];
|
|
1898
|
+
const sortedKeys = Object.keys(options).sort((a, b) => a.localeCompare(b));
|
|
1899
|
+
for (const key of sortedKeys) {
|
|
1900
|
+
const value = options[key];
|
|
1901
|
+
if (value === void 0) continue;
|
|
1902
|
+
if (Array.isArray(value)) for (const item of value) params.push([key, String(item)]);
|
|
1903
|
+
else if (typeof value === "object" && value !== null) {
|
|
1904
|
+
const sortedSubKeys = Object.keys(value).sort((a, b) => a.localeCompare(b));
|
|
1905
|
+
for (const subKey of sortedSubKeys) {
|
|
1906
|
+
const subValue = value[subKey];
|
|
1907
|
+
if (subValue !== void 0) params.push([`${key}[${subKey}]`, String(subValue)]);
|
|
1908
|
+
}
|
|
1909
|
+
} else params.push([key, String(value)]);
|
|
1910
|
+
}
|
|
1911
|
+
return params.map(([key, value]) => {
|
|
1912
|
+
return `${encodeRFC1738(key)}=${encodeRFC1738(value)}`;
|
|
1913
|
+
}).join("&");
|
|
1914
|
+
}
|
|
1915
|
+
function encodeRFC1738(str) {
|
|
1916
|
+
return encodeURIComponent(str).replace(/%20/g, "+").replace(/[!'*]/g, (c) => "%" + c.charCodeAt(0).toString(16).toUpperCase());
|
|
1917
|
+
}
|
|
1918
|
+
//#endregion
|
|
1919
|
+
//#region src/sso/sso.ts
|
|
1920
|
+
var SSO = class {
|
|
1921
|
+
constructor(workos) {
|
|
1922
|
+
this.workos = workos;
|
|
1923
|
+
}
|
|
1924
|
+
async listConnections(options) {
|
|
1925
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/connections", deserializeConnection, options ? serializeListConnectionsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/connections", deserializeConnection, params), options ? serializeListConnectionsOptions(options) : void 0);
|
|
1926
|
+
}
|
|
1927
|
+
async deleteConnection(id) {
|
|
1928
|
+
await this.workos.delete(`/connections/${id}`);
|
|
1929
|
+
}
|
|
1930
|
+
getAuthorizationUrl(options) {
|
|
1931
|
+
const { codeChallenge, codeChallengeMethod, connection, clientId, domainHint, loginHint, organization, provider, providerQueryParams, providerScopes, redirectUri, state } = options;
|
|
1932
|
+
if (!provider && !connection && !organization) throw new TypeError(`Incomplete arguments. Need to specify either a 'connection', 'organization', or 'provider'.`);
|
|
1933
|
+
const query = toQueryString({
|
|
1934
|
+
code_challenge: codeChallenge,
|
|
1935
|
+
code_challenge_method: codeChallengeMethod,
|
|
1936
|
+
connection,
|
|
1937
|
+
organization,
|
|
1938
|
+
domain_hint: domainHint,
|
|
1939
|
+
login_hint: loginHint,
|
|
1940
|
+
provider,
|
|
1941
|
+
provider_query_params: providerQueryParams,
|
|
1942
|
+
provider_scopes: providerScopes,
|
|
1943
|
+
client_id: clientId,
|
|
1944
|
+
redirect_uri: redirectUri,
|
|
1945
|
+
response_type: "code",
|
|
1946
|
+
state
|
|
1947
|
+
});
|
|
1948
|
+
return `${this.workos.baseURL}/sso/authorize?${query}`;
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Generates an authorization URL with PKCE parameters automatically generated.
|
|
1952
|
+
* Use this for public clients (CLI apps, Electron, mobile) that cannot
|
|
1953
|
+
* securely store a client secret.
|
|
1954
|
+
*
|
|
1955
|
+
* @returns Object containing url, state, and codeVerifier
|
|
1956
|
+
*
|
|
1957
|
+
* @example
|
|
1958
|
+
* ```typescript
|
|
1959
|
+
* const { url, state, codeVerifier } = await workos.sso.getAuthorizationUrlWithPKCE({
|
|
1960
|
+
* connection: 'conn_123',
|
|
1961
|
+
* clientId: 'client_123',
|
|
1962
|
+
* redirectUri: 'myapp://callback',
|
|
1963
|
+
* });
|
|
1964
|
+
*
|
|
1965
|
+
* // Store state and codeVerifier securely, then redirect user to url
|
|
1966
|
+
* // After callback, exchange the code:
|
|
1967
|
+
* const { profile, accessToken } = await workos.sso.getProfileAndToken({
|
|
1968
|
+
* code: authorizationCode,
|
|
1969
|
+
* codeVerifier,
|
|
1970
|
+
* clientId: 'client_123',
|
|
1971
|
+
* });
|
|
1972
|
+
* ```
|
|
1973
|
+
*/
|
|
1974
|
+
async getAuthorizationUrlWithPKCE(options) {
|
|
1975
|
+
const { connection, clientId, domainHint, loginHint, organization, provider, providerQueryParams, providerScopes, redirectUri } = options;
|
|
1976
|
+
if (!provider && !connection && !organization) throw new TypeError(`Incomplete arguments. Need to specify either a 'connection', 'organization', or 'provider'.`);
|
|
1977
|
+
const pkce = await this.workos.pkce.generate();
|
|
1978
|
+
const state = this.workos.pkce.generateCodeVerifier(43);
|
|
1979
|
+
const query = toQueryString({
|
|
1980
|
+
code_challenge: pkce.codeChallenge,
|
|
1981
|
+
code_challenge_method: "S256",
|
|
1982
|
+
connection,
|
|
1983
|
+
organization,
|
|
1984
|
+
domain_hint: domainHint,
|
|
1985
|
+
login_hint: loginHint,
|
|
1986
|
+
provider,
|
|
1987
|
+
provider_query_params: providerQueryParams,
|
|
1988
|
+
provider_scopes: providerScopes,
|
|
1989
|
+
client_id: clientId,
|
|
1990
|
+
redirect_uri: redirectUri,
|
|
1991
|
+
response_type: "code",
|
|
1992
|
+
state
|
|
1993
|
+
});
|
|
1994
|
+
return {
|
|
1995
|
+
url: `${this.workos.baseURL}/sso/authorize?${query}`,
|
|
1996
|
+
state,
|
|
1997
|
+
codeVerifier: pkce.codeVerifier
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
async getConnection(id) {
|
|
2001
|
+
const { data } = await this.workos.get(`/connections/${id}`);
|
|
2002
|
+
return deserializeConnection(data);
|
|
2003
|
+
}
|
|
2004
|
+
/**
|
|
2005
|
+
* Exchange an authorization code for a profile and access token.
|
|
2006
|
+
*
|
|
2007
|
+
* Auto-detects public vs confidential client mode:
|
|
2008
|
+
* - If codeVerifier is provided: Uses PKCE flow (public client)
|
|
2009
|
+
* - If no codeVerifier: Uses client_secret from API key (confidential client)
|
|
2010
|
+
* - If both: Uses both client_secret AND codeVerifier (confidential client with PKCE)
|
|
2011
|
+
*
|
|
2012
|
+
* Using PKCE with confidential clients is recommended by OAuth 2.1 for defense
|
|
2013
|
+
* in depth and provides additional CSRF protection on the authorization flow.
|
|
2014
|
+
*
|
|
2015
|
+
* @throws Error if neither codeVerifier nor API key is available
|
|
2016
|
+
*/
|
|
2017
|
+
async getProfileAndToken({ code, clientId, codeVerifier }) {
|
|
2018
|
+
if (codeVerifier !== void 0 && codeVerifier.trim() === "") throw new TypeError("codeVerifier cannot be an empty string. Generate a valid PKCE pair using workos.pkce.generate().");
|
|
2019
|
+
const hasApiKey = !!this.workos.key;
|
|
2020
|
+
const hasPKCE = !!codeVerifier;
|
|
2021
|
+
if (!hasPKCE && !hasApiKey) throw new TypeError("getProfileAndToken requires either a codeVerifier (for public clients) or an API key configured on the WorkOS instance (for confidential clients).");
|
|
2022
|
+
const form = new URLSearchParams({
|
|
2023
|
+
client_id: clientId,
|
|
2024
|
+
grant_type: "authorization_code",
|
|
2025
|
+
code
|
|
2026
|
+
});
|
|
2027
|
+
if (hasPKCE) form.set("code_verifier", codeVerifier);
|
|
2028
|
+
if (hasApiKey) form.set("client_secret", this.workos.key);
|
|
2029
|
+
const { data } = await this.workos.post("/sso/token", form, { skipApiKeyCheck: !hasApiKey });
|
|
2030
|
+
return deserializeProfileAndToken(data);
|
|
2031
|
+
}
|
|
2032
|
+
async getProfile({ accessToken }) {
|
|
2033
|
+
const { data } = await this.workos.get("/sso/profile", { accessToken });
|
|
2034
|
+
return deserializeProfile(data);
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
//#endregion
|
|
2038
|
+
//#region src/mfa/serializers/challenge.serializer.ts
|
|
2039
|
+
const deserializeChallenge = (challenge) => ({
|
|
2040
|
+
object: challenge.object,
|
|
2041
|
+
id: challenge.id,
|
|
2042
|
+
createdAt: challenge.created_at,
|
|
2043
|
+
updatedAt: challenge.updated_at,
|
|
2044
|
+
expiresAt: challenge.expires_at,
|
|
2045
|
+
code: challenge.code,
|
|
2046
|
+
authenticationFactorId: challenge.authentication_factor_id
|
|
2047
|
+
});
|
|
2048
|
+
//#endregion
|
|
2049
|
+
//#region src/mfa/serializers/sms.serializer.ts
|
|
2050
|
+
const deserializeSms = (sms) => ({ phoneNumber: sms.phone_number });
|
|
2051
|
+
//#endregion
|
|
2052
|
+
//#region src/mfa/serializers/factor.serializer.ts
|
|
2053
|
+
const deserializeFactor = (factor) => ({
|
|
2054
|
+
object: factor.object,
|
|
2055
|
+
id: factor.id,
|
|
2056
|
+
createdAt: factor.created_at,
|
|
2057
|
+
updatedAt: factor.updated_at,
|
|
2058
|
+
type: factor.type,
|
|
2059
|
+
...factor.sms ? { sms: deserializeSms(factor.sms) } : {},
|
|
2060
|
+
...factor.totp ? { totp: deserializeTotp(factor.totp) } : {}
|
|
2061
|
+
});
|
|
2062
|
+
const deserializeFactorWithSecrets = (factor) => ({
|
|
2063
|
+
object: factor.object,
|
|
2064
|
+
id: factor.id,
|
|
2065
|
+
createdAt: factor.created_at,
|
|
2066
|
+
updatedAt: factor.updated_at,
|
|
2067
|
+
type: factor.type,
|
|
2068
|
+
...factor.sms ? { sms: deserializeSms(factor.sms) } : {},
|
|
2069
|
+
...factor.totp ? { totp: deserializeTotpWithSecrets(factor.totp) } : {}
|
|
2070
|
+
});
|
|
2071
|
+
//#endregion
|
|
2072
|
+
//#region src/mfa/serializers/verify-response.serializer.ts
|
|
2073
|
+
const deserializeVerifyResponse = (verifyResponse) => ({
|
|
2074
|
+
challenge: deserializeChallenge(verifyResponse.challenge),
|
|
2075
|
+
valid: verifyResponse.valid
|
|
2076
|
+
});
|
|
2077
|
+
//#endregion
|
|
2078
|
+
//#region src/mfa/mfa.ts
|
|
2079
|
+
var Mfa = class {
|
|
2080
|
+
constructor(workos) {
|
|
2081
|
+
this.workos = workos;
|
|
2082
|
+
}
|
|
2083
|
+
async deleteFactor(id) {
|
|
2084
|
+
await this.workos.delete(`/auth/factors/${id}`);
|
|
2085
|
+
}
|
|
2086
|
+
async getFactor(id) {
|
|
2087
|
+
const { data } = await this.workos.get(`/auth/factors/${id}`);
|
|
2088
|
+
return deserializeFactor(data);
|
|
2089
|
+
}
|
|
2090
|
+
async enrollFactor(options) {
|
|
2091
|
+
const { data } = await this.workos.post("/auth/factors/enroll", {
|
|
2092
|
+
type: options.type,
|
|
2093
|
+
...(() => {
|
|
2094
|
+
switch (options.type) {
|
|
2095
|
+
case "sms": return { phone_number: options.phoneNumber };
|
|
2096
|
+
case "totp": return {
|
|
2097
|
+
totp_issuer: options.issuer,
|
|
2098
|
+
totp_user: options.user
|
|
2099
|
+
};
|
|
2100
|
+
default: return {};
|
|
2101
|
+
}
|
|
2102
|
+
})()
|
|
2103
|
+
});
|
|
2104
|
+
return deserializeFactorWithSecrets(data);
|
|
2105
|
+
}
|
|
2106
|
+
async challengeFactor(options) {
|
|
2107
|
+
const { data } = await this.workos.post(`/auth/factors/${options.authenticationFactorId}/challenge`, { sms_template: "smsTemplate" in options ? options.smsTemplate : void 0 });
|
|
2108
|
+
return deserializeChallenge(data);
|
|
2109
|
+
}
|
|
2110
|
+
async verifyChallenge(options) {
|
|
2111
|
+
const { data } = await this.workos.post(`/auth/challenges/${options.authenticationChallengeId}/verify`, { code: options.code });
|
|
2112
|
+
return deserializeVerifyResponse(data);
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region src/audit-logs/serializers/audit-log-export.serializer.ts
|
|
2117
|
+
const deserializeAuditLogExport = (auditLogExport) => ({
|
|
2118
|
+
object: auditLogExport.object,
|
|
2119
|
+
id: auditLogExport.id,
|
|
2120
|
+
state: auditLogExport.state,
|
|
2121
|
+
url: auditLogExport.url,
|
|
2122
|
+
createdAt: auditLogExport.created_at,
|
|
2123
|
+
updatedAt: auditLogExport.updated_at
|
|
2124
|
+
});
|
|
2125
|
+
//#endregion
|
|
2126
|
+
//#region src/audit-logs/serializers/audit-log-export-options.serializer.ts
|
|
2127
|
+
const serializeAuditLogExportOptions = (options) => ({
|
|
2128
|
+
actions: options.actions,
|
|
2129
|
+
actor_names: options.actorNames,
|
|
2130
|
+
actor_ids: options.actorIds,
|
|
2131
|
+
organization_id: options.organizationId,
|
|
2132
|
+
range_end: options.rangeEnd.toISOString(),
|
|
2133
|
+
range_start: options.rangeStart.toISOString(),
|
|
2134
|
+
targets: options.targets
|
|
2135
|
+
});
|
|
2136
|
+
//#endregion
|
|
2137
|
+
//#region src/audit-logs/serializers/create-audit-log-event-options.serializer.ts
|
|
2138
|
+
const serializeCreateAuditLogEventOptions = (event) => ({
|
|
2139
|
+
action: event.action,
|
|
2140
|
+
version: event.version,
|
|
2141
|
+
occurred_at: event.occurredAt.toISOString(),
|
|
2142
|
+
actor: event.actor,
|
|
2143
|
+
targets: event.targets,
|
|
2144
|
+
context: {
|
|
2145
|
+
location: event.context.location,
|
|
2146
|
+
user_agent: event.context.userAgent
|
|
2147
|
+
},
|
|
2148
|
+
metadata: event.metadata
|
|
2149
|
+
});
|
|
2150
|
+
//#endregion
|
|
2151
|
+
//#region src/audit-logs/serializers/create-audit-log-schema-options.serializer.ts
|
|
2152
|
+
function serializeMetadata(metadata) {
|
|
2153
|
+
if (!metadata) return {};
|
|
2154
|
+
const serializedMetadata = {};
|
|
2155
|
+
Object.keys(metadata).forEach((key) => {
|
|
2156
|
+
serializedMetadata[key] = { type: metadata[key] };
|
|
2157
|
+
});
|
|
2158
|
+
return serializedMetadata;
|
|
2159
|
+
}
|
|
2160
|
+
const serializeCreateAuditLogSchemaOptions = (schema) => ({
|
|
2161
|
+
actor: { metadata: {
|
|
2162
|
+
type: "object",
|
|
2163
|
+
properties: serializeMetadata(schema.actor?.metadata)
|
|
2164
|
+
} },
|
|
2165
|
+
targets: schema.targets.map((target) => {
|
|
2166
|
+
return {
|
|
2167
|
+
type: target.type,
|
|
2168
|
+
metadata: target.metadata ? {
|
|
2169
|
+
type: "object",
|
|
2170
|
+
properties: serializeMetadata(target.metadata)
|
|
2171
|
+
} : void 0
|
|
2172
|
+
};
|
|
2173
|
+
}),
|
|
2174
|
+
metadata: schema.metadata ? {
|
|
2175
|
+
type: "object",
|
|
2176
|
+
properties: serializeMetadata(schema.metadata)
|
|
2177
|
+
} : void 0
|
|
2178
|
+
});
|
|
2179
|
+
//#endregion
|
|
2180
|
+
//#region src/audit-logs/serializers/create-audit-log-schema.serializer.ts
|
|
2181
|
+
function deserializeMetadata(metadata) {
|
|
2182
|
+
if (!metadata || !metadata.properties) return {};
|
|
2183
|
+
const deserializedMetadata = {};
|
|
2184
|
+
Object.keys(metadata.properties).forEach((key) => {
|
|
2185
|
+
if (metadata.properties) deserializedMetadata[key] = metadata.properties[key].type;
|
|
2186
|
+
});
|
|
2187
|
+
return deserializedMetadata;
|
|
2188
|
+
}
|
|
2189
|
+
const deserializeAuditLogSchema = (auditLogSchema) => ({
|
|
2190
|
+
object: auditLogSchema.object,
|
|
2191
|
+
version: auditLogSchema.version,
|
|
2192
|
+
targets: auditLogSchema.targets.map((target) => {
|
|
2193
|
+
return {
|
|
2194
|
+
type: target.type,
|
|
2195
|
+
metadata: target.metadata ? deserializeMetadata(target.metadata) : void 0
|
|
2196
|
+
};
|
|
2197
|
+
}),
|
|
2198
|
+
actor: { metadata: deserializeMetadata(auditLogSchema.actor?.metadata) },
|
|
2199
|
+
metadata: auditLogSchema.metadata ? deserializeMetadata(auditLogSchema.metadata) : void 0,
|
|
2200
|
+
createdAt: auditLogSchema.created_at
|
|
2201
|
+
});
|
|
2202
|
+
//#endregion
|
|
2203
|
+
//#region src/audit-logs/audit-logs.ts
|
|
2204
|
+
var AuditLogs = class {
|
|
2205
|
+
constructor(workos) {
|
|
2206
|
+
this.workos = workos;
|
|
2207
|
+
}
|
|
2208
|
+
async createEvent(organization, event, options = {}) {
|
|
2209
|
+
const optionsWithIdempotency = {
|
|
2210
|
+
...options,
|
|
2211
|
+
idempotencyKey: options.idempotencyKey || `workos-node-${globalThis.crypto.randomUUID()}`
|
|
2212
|
+
};
|
|
2213
|
+
await this.workos.post("/audit_logs/events", {
|
|
2214
|
+
event: serializeCreateAuditLogEventOptions(event),
|
|
2215
|
+
organization_id: organization
|
|
2216
|
+
}, optionsWithIdempotency);
|
|
2217
|
+
}
|
|
2218
|
+
async createExport(options) {
|
|
2219
|
+
const { data } = await this.workos.post("/audit_logs/exports", serializeAuditLogExportOptions(options));
|
|
2220
|
+
return deserializeAuditLogExport(data);
|
|
2221
|
+
}
|
|
2222
|
+
async getExport(auditLogExportId) {
|
|
2223
|
+
const { data } = await this.workos.get(`/audit_logs/exports/${auditLogExportId}`);
|
|
2224
|
+
return deserializeAuditLogExport(data);
|
|
2225
|
+
}
|
|
2226
|
+
async createSchema(schema, options = {}) {
|
|
2227
|
+
const { data } = await this.workos.post(`/audit_logs/actions/${schema.action}/schemas`, serializeCreateAuditLogSchemaOptions(schema), options);
|
|
2228
|
+
return deserializeAuditLogSchema(data);
|
|
2229
|
+
}
|
|
2230
|
+
};
|
|
2231
|
+
//#endregion
|
|
2232
|
+
//#region node_modules/uint8array-extras/index.js
|
|
2233
|
+
const objectToString = Object.prototype.toString;
|
|
2234
|
+
const uint8ArrayStringified = "[object Uint8Array]";
|
|
2235
|
+
function isType(value, typeConstructor, typeStringified) {
|
|
2236
|
+
if (!value) return false;
|
|
2237
|
+
if (value.constructor === typeConstructor) return true;
|
|
2238
|
+
return objectToString.call(value) === typeStringified;
|
|
2239
|
+
}
|
|
2240
|
+
function isUint8Array(value) {
|
|
2241
|
+
return isType(value, Uint8Array, uint8ArrayStringified);
|
|
2242
|
+
}
|
|
2243
|
+
function assertUint8Array(value) {
|
|
2244
|
+
if (!isUint8Array(value)) throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof value}\``);
|
|
2245
|
+
}
|
|
2246
|
+
new globalThis.TextDecoder("utf8");
|
|
2247
|
+
function assertString(value) {
|
|
2248
|
+
if (typeof value !== "string") throw new TypeError(`Expected \`string\`, got \`${typeof value}\``);
|
|
2249
|
+
}
|
|
2250
|
+
new globalThis.TextEncoder();
|
|
2251
|
+
function base64ToBase64Url(base64) {
|
|
2252
|
+
return base64.replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
2253
|
+
}
|
|
2254
|
+
function base64UrlToBase64(base64url) {
|
|
2255
|
+
const base64 = base64url.replaceAll("-", "+").replaceAll("_", "/");
|
|
2256
|
+
const padding = (4 - base64.length % 4) % 4;
|
|
2257
|
+
return base64 + "=".repeat(padding);
|
|
2258
|
+
}
|
|
2259
|
+
const MAX_BLOCK_SIZE = 65535;
|
|
2260
|
+
function uint8ArrayToBase64$1(array, { urlSafe = false } = {}) {
|
|
2261
|
+
assertUint8Array(array);
|
|
2262
|
+
let base64 = "";
|
|
2263
|
+
for (let index = 0; index < array.length; index += MAX_BLOCK_SIZE) {
|
|
2264
|
+
const chunk = array.subarray(index, index + MAX_BLOCK_SIZE);
|
|
2265
|
+
base64 += globalThis.btoa(String.fromCodePoint.apply(void 0, chunk));
|
|
2266
|
+
}
|
|
2267
|
+
return urlSafe ? base64ToBase64Url(base64) : base64;
|
|
2268
|
+
}
|
|
2269
|
+
function base64ToUint8Array$1(base64String) {
|
|
2270
|
+
assertString(base64String);
|
|
2271
|
+
return Uint8Array.from(globalThis.atob(base64UrlToBase64(base64String)), (x) => x.codePointAt(0));
|
|
2272
|
+
}
|
|
2273
|
+
const byteToHexLookupTable = Array.from({ length: 256 }, (_, index) => index.toString(16).padStart(2, "0"));
|
|
2274
|
+
function uint8ArrayToHex(array) {
|
|
2275
|
+
assertUint8Array(array);
|
|
2276
|
+
let hexString = "";
|
|
2277
|
+
for (let index = 0; index < array.length; index++) hexString += byteToHexLookupTable[array[index]];
|
|
2278
|
+
return hexString;
|
|
2279
|
+
}
|
|
2280
|
+
//#endregion
|
|
2281
|
+
//#region node_modules/iron-webcrypto/index.js
|
|
2282
|
+
function losslessJsonStringify(data) {
|
|
2283
|
+
try {
|
|
2284
|
+
if (isJson(data)) {
|
|
2285
|
+
let stringified = JSON.stringify(data);
|
|
2286
|
+
if (stringified) return stringified;
|
|
2287
|
+
}
|
|
2288
|
+
} catch {}
|
|
2289
|
+
throw Error("Data is not JSON serializable");
|
|
2290
|
+
}
|
|
2291
|
+
function jsonParse(string) {
|
|
2292
|
+
try {
|
|
2293
|
+
return JSON.parse(string);
|
|
2294
|
+
} catch (err) {
|
|
2295
|
+
throw Error("Failed parsing sealed object JSON: " + err.message);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
function isJson(val) {
|
|
2299
|
+
let stack = [], seen = /* @__PURE__ */ new WeakSet(), check = (val$1) => val$1 === null || typeof val$1 == "string" || typeof val$1 == "boolean" ? !0 : typeof val$1 == "number" ? Number.isFinite(val$1) : typeof val$1 == "object" ? seen.has(val$1) ? !0 : (seen.add(val$1), stack.push(val$1), !0) : !1;
|
|
2300
|
+
if (!check(val)) return !1;
|
|
2301
|
+
for (; stack.length;) {
|
|
2302
|
+
let obj = stack.pop();
|
|
2303
|
+
if (Array.isArray(obj)) {
|
|
2304
|
+
let i$1 = obj.length;
|
|
2305
|
+
for (; i$1--;) if (!check(obj[i$1])) return !1;
|
|
2306
|
+
continue;
|
|
2307
|
+
}
|
|
2308
|
+
let proto = Reflect.getPrototypeOf(obj);
|
|
2309
|
+
if (proto !== null && proto !== Object.prototype) return !1;
|
|
2310
|
+
let keys = Reflect.ownKeys(obj), i = keys.length;
|
|
2311
|
+
for (; i--;) {
|
|
2312
|
+
let key = keys[i];
|
|
2313
|
+
if (typeof key != "string" || Reflect.getOwnPropertyDescriptor(obj, key)?.enumerable === !1) return !1;
|
|
2314
|
+
let val$1 = obj[key];
|
|
2315
|
+
if (val$1 !== void 0 && !check(val$1)) return !1;
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
return !0;
|
|
2319
|
+
}
|
|
2320
|
+
const enc = /* @__PURE__ */ new TextEncoder(), dec = /* @__PURE__ */ new TextDecoder(), jsBase64Enabled = typeof Uint8Array.fromBase64 == "function" && typeof Uint8Array.prototype.toBase64 == "function" && typeof Uint8Array.prototype.toHex == "function";
|
|
2321
|
+
function b64ToU8(str) {
|
|
2322
|
+
return jsBase64Enabled ? Uint8Array.fromBase64(str, { alphabet: "base64url" }) : base64ToUint8Array$1(str);
|
|
2323
|
+
}
|
|
2324
|
+
function u8ToB64(arr) {
|
|
2325
|
+
return arr = arr instanceof ArrayBuffer ? new Uint8Array(arr) : arr, jsBase64Enabled ? arr.toBase64({
|
|
2326
|
+
alphabet: "base64url",
|
|
2327
|
+
omitPadding: !0
|
|
2328
|
+
}) : uint8ArrayToBase64$1(arr, { urlSafe: !0 });
|
|
2329
|
+
}
|
|
2330
|
+
function u8ToHex(arr) {
|
|
2331
|
+
return arr = arr instanceof ArrayBuffer ? new Uint8Array(arr) : arr, jsBase64Enabled ? arr.toHex() : uint8ArrayToHex(arr);
|
|
2332
|
+
}
|
|
2333
|
+
const defaults = /* @__PURE__ */ Object.freeze({
|
|
2334
|
+
encryption: /* @__PURE__ */ Object.freeze({
|
|
2335
|
+
algorithm: "aes-256-cbc",
|
|
2336
|
+
saltBits: 256,
|
|
2337
|
+
iterations: 1,
|
|
2338
|
+
minPasswordlength: 32
|
|
2339
|
+
}),
|
|
2340
|
+
integrity: /* @__PURE__ */ Object.freeze({
|
|
2341
|
+
algorithm: "sha256",
|
|
2342
|
+
saltBits: 256,
|
|
2343
|
+
iterations: 1,
|
|
2344
|
+
minPasswordlength: 32
|
|
2345
|
+
}),
|
|
2346
|
+
ttl: 0,
|
|
2347
|
+
timestampSkewSec: 60,
|
|
2348
|
+
localtimeOffsetMsec: 0
|
|
2349
|
+
}), algorithms = /* @__PURE__ */ Object.freeze({
|
|
2350
|
+
"aes-128-ctr": /* @__PURE__ */ Object.freeze({
|
|
2351
|
+
keyBits: 128,
|
|
2352
|
+
ivBits: 128,
|
|
2353
|
+
name: "AES-CTR"
|
|
2354
|
+
}),
|
|
2355
|
+
"aes-256-cbc": /* @__PURE__ */ Object.freeze({
|
|
2356
|
+
keyBits: 256,
|
|
2357
|
+
ivBits: 128,
|
|
2358
|
+
name: "AES-CBC"
|
|
2359
|
+
}),
|
|
2360
|
+
sha256: /* @__PURE__ */ Object.freeze({
|
|
2361
|
+
keyBits: 256,
|
|
2362
|
+
ivBits: void 0,
|
|
2363
|
+
name: "SHA-256"
|
|
2364
|
+
})
|
|
2365
|
+
}), macPrefix = "Fe26.2";
|
|
2366
|
+
function randomBits(bits) {
|
|
2367
|
+
return crypto.getRandomValues(new Uint8Array(bits / 8));
|
|
2368
|
+
}
|
|
2369
|
+
async function generateKey(password, options) {
|
|
2370
|
+
if (!password || !password.length) throw Error("Empty password");
|
|
2371
|
+
if (!options || typeof options != "object") throw Error("Bad options");
|
|
2372
|
+
let algorithm = algorithms[options.algorithm];
|
|
2373
|
+
if (!algorithm) throw Error("Unknown algorithm: " + options.algorithm);
|
|
2374
|
+
let isHmac = algorithm.name === "SHA-256", id = isHmac ? {
|
|
2375
|
+
name: "HMAC",
|
|
2376
|
+
hash: algorithm.name,
|
|
2377
|
+
length: algorithm.keyBits
|
|
2378
|
+
} : {
|
|
2379
|
+
name: algorithm.name,
|
|
2380
|
+
length: algorithm.keyBits
|
|
2381
|
+
}, usages = isHmac ? ["sign", "verify"] : ["encrypt", "decrypt"], iv = options.iv || (algorithm.ivBits ? randomBits(algorithm.ivBits) : void 0);
|
|
2382
|
+
if (typeof password == "string") {
|
|
2383
|
+
if (password.length < options.minPasswordlength) throw Error("Password string too short (min " + options.minPasswordlength + " characters required)");
|
|
2384
|
+
let salt = options.salt;
|
|
2385
|
+
if (!salt) {
|
|
2386
|
+
if (!options.saltBits) throw Error("Missing salt and saltBits options");
|
|
2387
|
+
salt = u8ToHex(randomBits(options.saltBits));
|
|
2388
|
+
}
|
|
2389
|
+
let baseKey = await crypto.subtle.importKey("raw", enc.encode(password), "PBKDF2", !1, ["deriveKey"]), algorithm$1 = {
|
|
2390
|
+
name: "PBKDF2",
|
|
2391
|
+
salt: enc.encode(salt),
|
|
2392
|
+
iterations: options.iterations,
|
|
2393
|
+
hash: "SHA-1"
|
|
2394
|
+
};
|
|
2395
|
+
return {
|
|
2396
|
+
key: await crypto.subtle.deriveKey(algorithm$1, baseKey, id, !1, usages),
|
|
2397
|
+
iv,
|
|
2398
|
+
salt
|
|
2399
|
+
};
|
|
2400
|
+
}
|
|
2401
|
+
if (password.length < algorithm.keyBits / 8) throw Error("Key buffer (password) too small");
|
|
2402
|
+
return {
|
|
2403
|
+
key: await crypto.subtle.importKey("raw", password.slice(), id, !1, usages),
|
|
2404
|
+
iv,
|
|
2405
|
+
salt: ""
|
|
2406
|
+
};
|
|
2407
|
+
}
|
|
2408
|
+
function getEncryptParams(algorithm, key, data) {
|
|
2409
|
+
return [
|
|
2410
|
+
algorithm === "aes-128-ctr" ? {
|
|
2411
|
+
name: "AES-CTR",
|
|
2412
|
+
counter: key.iv,
|
|
2413
|
+
length: 128
|
|
2414
|
+
} : {
|
|
2415
|
+
name: "AES-CBC",
|
|
2416
|
+
iv: key.iv
|
|
2417
|
+
},
|
|
2418
|
+
key.key,
|
|
2419
|
+
typeof data == "string" ? enc.encode(data) : data.slice()
|
|
2420
|
+
];
|
|
2421
|
+
}
|
|
2422
|
+
async function encrypt(password, options, data) {
|
|
2423
|
+
let key = await generateKey(password, options), encrypted = await crypto.subtle.encrypt(...getEncryptParams(options.algorithm, key, data));
|
|
2424
|
+
return {
|
|
2425
|
+
encrypted: new Uint8Array(encrypted),
|
|
2426
|
+
key
|
|
2427
|
+
};
|
|
2428
|
+
}
|
|
2429
|
+
async function decrypt(password, options, data) {
|
|
2430
|
+
let key = await generateKey(password, options), decrypted = await crypto.subtle.decrypt(...getEncryptParams(options.algorithm, key, data));
|
|
2431
|
+
return dec.decode(decrypted);
|
|
2432
|
+
}
|
|
2433
|
+
async function hmacWithPassword(password, options, data) {
|
|
2434
|
+
let key = await generateKey(password, options);
|
|
2435
|
+
return {
|
|
2436
|
+
digest: u8ToB64(await crypto.subtle.sign("HMAC", key.key, enc.encode(data))),
|
|
2437
|
+
salt: key.salt
|
|
2438
|
+
};
|
|
2439
|
+
}
|
|
2440
|
+
function normalizePassword(password) {
|
|
2441
|
+
let normalized = typeof password == "string" || password instanceof Uint8Array ? {
|
|
2442
|
+
encryption: password,
|
|
2443
|
+
integrity: password
|
|
2444
|
+
} : password && typeof password == "object" ? "secret" in password ? {
|
|
2445
|
+
id: password.id,
|
|
2446
|
+
encryption: password.secret,
|
|
2447
|
+
integrity: password.secret
|
|
2448
|
+
} : {
|
|
2449
|
+
id: password.id,
|
|
2450
|
+
encryption: password.encryption,
|
|
2451
|
+
integrity: password.integrity
|
|
2452
|
+
} : void 0;
|
|
2453
|
+
if (!normalized || !normalized.encryption || normalized.encryption.length === 0 || !normalized.integrity || normalized.integrity.length === 0) throw Error("Empty password");
|
|
2454
|
+
return normalized;
|
|
2455
|
+
}
|
|
2456
|
+
async function seal(object, password, options) {
|
|
2457
|
+
let now = Date.now() + (options.localtimeOffsetMsec || 0), { id = "", encryption, integrity } = normalizePassword(password);
|
|
2458
|
+
if (id && !/^\w+$/.test(id)) throw Error("Invalid password id");
|
|
2459
|
+
let { encrypted, key } = await encrypt(encryption, options.encryption, (options.encode || losslessJsonStringify)(object)), expiration = options.ttl ? now + options.ttl : "", macBaseString = macPrefix + "*" + id + "*" + key.salt + "*" + u8ToB64(key.iv) + "*" + u8ToB64(encrypted) + "*" + expiration, mac = await hmacWithPassword(integrity, options.integrity, macBaseString);
|
|
2460
|
+
return macBaseString + "*" + mac.salt + "*" + mac.digest;
|
|
2461
|
+
}
|
|
2462
|
+
async function unseal(sealed, password, options) {
|
|
2463
|
+
let now = Date.now() + (options.localtimeOffsetMsec || 0), parts = sealed.split("*");
|
|
2464
|
+
if (parts.length !== 8) throw Error("Incorrect number of sealed components");
|
|
2465
|
+
let [prefix, passwordId, encryptionSalt, ivB64, encryptedB64, expiration, hmacSalt, hmacDigestB64] = parts;
|
|
2466
|
+
if (prefix !== "Fe26.2") throw Error("Wrong mac prefix");
|
|
2467
|
+
if (expiration) {
|
|
2468
|
+
if (!/^[1-9]\d*$/.test(expiration)) throw Error("Invalid expiration");
|
|
2469
|
+
if (Number.parseInt(expiration, 10) <= now - options.timestampSkewSec * 1e3) throw Error("Expired seal");
|
|
2470
|
+
}
|
|
2471
|
+
let pass;
|
|
2472
|
+
if (typeof password == "string" || password instanceof Uint8Array) pass = password;
|
|
2473
|
+
else if (typeof password == "object" && password) {
|
|
2474
|
+
let passwordIdKey = passwordId || "default";
|
|
2475
|
+
if (pass = password[passwordIdKey], !pass) throw Error("Cannot find password: " + passwordIdKey);
|
|
2476
|
+
}
|
|
2477
|
+
pass = normalizePassword(pass);
|
|
2478
|
+
let key = await generateKey(pass.integrity, {
|
|
2479
|
+
...options.integrity,
|
|
2480
|
+
salt: hmacSalt
|
|
2481
|
+
}), macBaseString = prefix + "*" + passwordId + "*" + encryptionSalt + "*" + ivB64 + "*" + encryptedB64 + "*" + expiration;
|
|
2482
|
+
if (!await crypto.subtle.verify("HMAC", key.key, b64ToU8(hmacDigestB64), enc.encode(macBaseString))) throw Error("Bad hmac value");
|
|
2483
|
+
let decryptedString = await decrypt(pass.encryption, {
|
|
2484
|
+
...options.encryption,
|
|
2485
|
+
salt: encryptionSalt,
|
|
2486
|
+
iv: b64ToU8(ivB64)
|
|
2487
|
+
}, b64ToU8(encryptedB64));
|
|
2488
|
+
return (options.decode || jsonParse)(decryptedString);
|
|
2489
|
+
}
|
|
2490
|
+
//#endregion
|
|
2491
|
+
//#region src/common/crypto/seal.ts
|
|
2492
|
+
const VERSION_DELIMITER = "~";
|
|
2493
|
+
const CURRENT_MAJOR_VERSION = 2;
|
|
2494
|
+
function parseSeal(seal) {
|
|
2495
|
+
const [sealWithoutVersion = "", tokenVersionAsString] = seal.split(VERSION_DELIMITER);
|
|
2496
|
+
return {
|
|
2497
|
+
sealWithoutVersion,
|
|
2498
|
+
tokenVersion: tokenVersionAsString == null ? null : parseInt(tokenVersionAsString, 10)
|
|
2499
|
+
};
|
|
2500
|
+
}
|
|
2501
|
+
async function sealData(data, { password }) {
|
|
2502
|
+
return `${await seal(data, {
|
|
2503
|
+
id: "1",
|
|
2504
|
+
secret: password
|
|
2505
|
+
}, {
|
|
2506
|
+
...defaults,
|
|
2507
|
+
ttl: 0,
|
|
2508
|
+
encode: JSON.stringify
|
|
2509
|
+
})}${VERSION_DELIMITER}${CURRENT_MAJOR_VERSION}`;
|
|
2510
|
+
}
|
|
2511
|
+
async function unsealData(encryptedData, { password }) {
|
|
2512
|
+
const { sealWithoutVersion, tokenVersion } = parseSeal(encryptedData);
|
|
2513
|
+
const passwordMap = { 1: password };
|
|
2514
|
+
let data;
|
|
2515
|
+
try {
|
|
2516
|
+
data = await unseal(sealWithoutVersion, passwordMap, {
|
|
2517
|
+
...defaults,
|
|
2518
|
+
ttl: 0
|
|
2519
|
+
}) ?? {};
|
|
2520
|
+
} catch (error) {
|
|
2521
|
+
if (error instanceof Error && /^(Expired seal|Bad hmac value|Cannot find password|Incorrect number of sealed components|Wrong mac prefix)/.test(error.message)) return {};
|
|
2522
|
+
throw error;
|
|
2523
|
+
}
|
|
2524
|
+
if (tokenVersion === 2) return data;
|
|
2525
|
+
else if (tokenVersion !== null) return data.persistent ?? data;
|
|
2526
|
+
return data;
|
|
2527
|
+
}
|
|
2528
|
+
//#endregion
|
|
2529
|
+
//#region src/common/utils/env.ts
|
|
2530
|
+
let detectedRuntime = null;
|
|
2531
|
+
/**
|
|
2532
|
+
* Detect the current runtime environment.
|
|
2533
|
+
* This function checks for various runtime environments such as Node.js, Deno, Bun, Cloudflare Workers, Fastly, and Edge Light.
|
|
2534
|
+
* It returns a string representing the detected runtime and caches the result for future calls.
|
|
2535
|
+
* @returns The detected runtime environment as a string.
|
|
2536
|
+
*/
|
|
2537
|
+
function detectRuntime() {
|
|
2538
|
+
if (detectedRuntime) return detectedRuntime;
|
|
2539
|
+
const global = globalThis;
|
|
2540
|
+
if (typeof process !== "undefined" && process.release?.name === "node") detectedRuntime = "node";
|
|
2541
|
+
else if (typeof global.Deno !== "undefined") detectedRuntime = "deno";
|
|
2542
|
+
else if (typeof navigator !== "undefined" && navigator.userAgent?.includes("Bun")) detectedRuntime = "bun";
|
|
2543
|
+
else if (typeof navigator !== "undefined" && navigator.userAgent?.includes("Cloudflare")) detectedRuntime = "cloudflare";
|
|
2544
|
+
else if (typeof global !== "undefined" && "fastly" in global) detectedRuntime = "fastly";
|
|
2545
|
+
else if (typeof global !== "undefined" && "EdgeRuntime" in global) detectedRuntime = "edge-light";
|
|
2546
|
+
else detectedRuntime = "other";
|
|
2547
|
+
return detectedRuntime;
|
|
2548
|
+
}
|
|
2549
|
+
function getEnvironmentVariable(key) {
|
|
2550
|
+
const runtime = detectRuntime();
|
|
2551
|
+
const global = globalThis;
|
|
2552
|
+
try {
|
|
2553
|
+
switch (runtime) {
|
|
2554
|
+
case "node":
|
|
2555
|
+
case "bun":
|
|
2556
|
+
case "edge-light": return process.env[key];
|
|
2557
|
+
case "deno": return global.Deno.env.get(key);
|
|
2558
|
+
case "cloudflare": return global.env?.[key] ?? global[key];
|
|
2559
|
+
case "fastly": return global[key];
|
|
2560
|
+
default: return process?.env?.[key] ?? global.env?.[key] ?? global[key];
|
|
2561
|
+
}
|
|
2562
|
+
} catch {
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
/**
|
|
2567
|
+
* Get an environment variable value, trying to access it in different runtimes.
|
|
2568
|
+
* @param key - The name of the environment variable.
|
|
2569
|
+
* @param defaultValue - The default value to return if the variable is not found.
|
|
2570
|
+
* @return The value of the environment variable or the default value.
|
|
2571
|
+
*/
|
|
2572
|
+
function getEnv(key, defaultValue) {
|
|
2573
|
+
return getEnvironmentVariable(key) ?? defaultValue;
|
|
2574
|
+
}
|
|
2575
|
+
//#endregion
|
|
2576
|
+
//#region src/user-management/interfaces/authenticate-with-session-cookie.interface.ts
|
|
2577
|
+
let AuthenticateWithSessionCookieFailureReason = /* @__PURE__ */ function(AuthenticateWithSessionCookieFailureReason) {
|
|
2578
|
+
AuthenticateWithSessionCookieFailureReason["INVALID_JWT"] = "invalid_jwt";
|
|
2579
|
+
AuthenticateWithSessionCookieFailureReason["INVALID_SESSION_COOKIE"] = "invalid_session_cookie";
|
|
2580
|
+
AuthenticateWithSessionCookieFailureReason["NO_SESSION_COOKIE_PROVIDED"] = "no_session_cookie_provided";
|
|
2581
|
+
return AuthenticateWithSessionCookieFailureReason;
|
|
2582
|
+
}({});
|
|
2583
|
+
//#endregion
|
|
2584
|
+
//#region src/user-management/interfaces/revoke-session-options.interface.ts
|
|
2585
|
+
const serializeRevokeSessionOptions = (options) => ({ session_id: options.sessionId });
|
|
2586
|
+
//#endregion
|
|
2587
|
+
//#region src/user-management/serializers/authenticate-with-email-verification.serializer.ts
|
|
2588
|
+
const serializeAuthenticateWithEmailVerificationOptions = (options) => ({
|
|
2589
|
+
grant_type: "urn:workos:oauth:grant-type:email-verification:code",
|
|
2590
|
+
client_id: options.clientId,
|
|
2591
|
+
client_secret: options.clientSecret,
|
|
2592
|
+
pending_authentication_token: options.pendingAuthenticationToken,
|
|
2593
|
+
code: options.code,
|
|
2594
|
+
ip_address: options.ipAddress,
|
|
2595
|
+
user_agent: options.userAgent
|
|
2596
|
+
});
|
|
2597
|
+
//#endregion
|
|
2598
|
+
//#region src/user-management/serializers/authenticate-with-organization-selection-options.serializer.ts
|
|
2599
|
+
const serializeAuthenticateWithOrganizationSelectionOptions = (options) => ({
|
|
2600
|
+
grant_type: "urn:workos:oauth:grant-type:organization-selection",
|
|
2601
|
+
client_id: options.clientId,
|
|
2602
|
+
client_secret: options.clientSecret,
|
|
2603
|
+
pending_authentication_token: options.pendingAuthenticationToken,
|
|
2604
|
+
organization_id: options.organizationId,
|
|
2605
|
+
ip_address: options.ipAddress,
|
|
2606
|
+
user_agent: options.userAgent
|
|
2607
|
+
});
|
|
2608
|
+
//#endregion
|
|
2609
|
+
//#region src/user-management/serializers/create-organization-membership-options.serializer.ts
|
|
2610
|
+
const serializeCreateOrganizationMembershipOptions = (options) => ({
|
|
2611
|
+
organization_id: options.organizationId,
|
|
2612
|
+
user_id: options.userId,
|
|
2613
|
+
role_slug: options.roleSlug,
|
|
2614
|
+
role_slugs: options.roleSlugs
|
|
2615
|
+
});
|
|
2616
|
+
//#endregion
|
|
2617
|
+
//#region src/user-management/serializers/identity.serializer.ts
|
|
2618
|
+
const deserializeIdentities = (identities) => {
|
|
2619
|
+
return identities.map((identity) => {
|
|
2620
|
+
return {
|
|
2621
|
+
idpId: identity.idp_id,
|
|
2622
|
+
type: identity.type,
|
|
2623
|
+
provider: identity.provider
|
|
2624
|
+
};
|
|
2625
|
+
});
|
|
2626
|
+
};
|
|
2627
|
+
//#endregion
|
|
2628
|
+
//#region src/user-management/serializers/list-invitations-options.serializer.ts
|
|
2629
|
+
const serializeListInvitationsOptions = (options) => ({
|
|
2630
|
+
email: options.email,
|
|
2631
|
+
organization_id: options.organizationId,
|
|
2632
|
+
limit: options.limit,
|
|
2633
|
+
before: options.before,
|
|
2634
|
+
after: options.after,
|
|
2635
|
+
order: options.order
|
|
2636
|
+
});
|
|
2637
|
+
//#endregion
|
|
2638
|
+
//#region src/user-management/serializers/list-organization-memberships-options.serializer.ts
|
|
2639
|
+
const serializeListOrganizationMembershipsOptions = (options) => ({
|
|
2640
|
+
user_id: options.userId,
|
|
2641
|
+
organization_id: options.organizationId,
|
|
2642
|
+
statuses: options.statuses?.join(","),
|
|
2643
|
+
limit: options.limit,
|
|
2644
|
+
before: options.before,
|
|
2645
|
+
after: options.after,
|
|
2646
|
+
order: options.order
|
|
2647
|
+
});
|
|
2648
|
+
//#endregion
|
|
2649
|
+
//#region src/user-management/serializers/list-users-options.serializer.ts
|
|
2650
|
+
const serializeListUsersOptions = (options) => ({
|
|
2651
|
+
email: options.email,
|
|
2652
|
+
organization_id: options.organizationId,
|
|
2653
|
+
limit: options.limit,
|
|
2654
|
+
before: options.before,
|
|
2655
|
+
after: options.after,
|
|
2656
|
+
order: options.order
|
|
2657
|
+
});
|
|
2658
|
+
//#endregion
|
|
2659
|
+
//#region src/user-management/serializers/resend-invitation-options.serializer.ts
|
|
2660
|
+
const serializeResendInvitationOptions = (options) => ({ locale: options.locale });
|
|
2661
|
+
//#endregion
|
|
2662
|
+
//#region src/user-management/interfaces/refresh-and-seal-session-data.interface.ts
|
|
2663
|
+
let RefreshSessionFailureReason = /* @__PURE__ */ function(RefreshSessionFailureReason) {
|
|
2664
|
+
RefreshSessionFailureReason["INVALID_SESSION_COOKIE"] = "invalid_session_cookie";
|
|
2665
|
+
RefreshSessionFailureReason["NO_SESSION_COOKIE_PROVIDED"] = "no_session_cookie_provided";
|
|
2666
|
+
RefreshSessionFailureReason["INVALID_GRANT"] = "invalid_grant";
|
|
2667
|
+
RefreshSessionFailureReason["MFA_ENROLLMENT"] = "mfa_enrollment";
|
|
2668
|
+
RefreshSessionFailureReason["SSO_REQUIRED"] = "sso_required";
|
|
2669
|
+
return RefreshSessionFailureReason;
|
|
2670
|
+
}({});
|
|
2671
|
+
//#endregion
|
|
2672
|
+
//#region src/user-management/serializers/send-invitation-options.serializer.ts
|
|
2673
|
+
const serializeSendInvitationOptions = (options) => ({
|
|
2674
|
+
email: options.email,
|
|
2675
|
+
organization_id: options.organizationId,
|
|
2676
|
+
expires_in_days: options.expiresInDays,
|
|
2677
|
+
inviter_user_id: options.inviterUserId,
|
|
2678
|
+
role_slug: options.roleSlug,
|
|
2679
|
+
locale: options.locale
|
|
2680
|
+
});
|
|
2681
|
+
//#endregion
|
|
2682
|
+
//#region src/user-management/serializers/update-organization-membership-options.serializer.ts
|
|
2683
|
+
const serializeUpdateOrganizationMembershipOptions = (options) => ({
|
|
2684
|
+
role_slug: options.roleSlug,
|
|
2685
|
+
role_slugs: options.roleSlugs
|
|
2686
|
+
});
|
|
2687
|
+
//#endregion
|
|
2688
|
+
//#region src/utils/jose.ts
|
|
2689
|
+
let _josePromise;
|
|
2690
|
+
/**
|
|
2691
|
+
* Dynamically imports the jose library using import() to support Node.js 20.0-20.18.
|
|
2692
|
+
*
|
|
2693
|
+
* The jose library is ESM-only and cannot be loaded via require() in Node.js versions
|
|
2694
|
+
* before 20.19.0. This wrapper uses dynamic import() which works in both ESM and CJS
|
|
2695
|
+
* across all Node.js 20+ versions.
|
|
2696
|
+
*
|
|
2697
|
+
* This workaround can be removed when Node.js 20 reaches end-of-life (April 2026),
|
|
2698
|
+
* at which point we can bump to Node.js 22+ and use direct imports.
|
|
2699
|
+
*
|
|
2700
|
+
* @returns Promise that resolves to the jose module
|
|
2701
|
+
*/
|
|
2702
|
+
function getJose() {
|
|
2703
|
+
return _josePromise ??= import("./webapi-oTg8yaNv.mjs");
|
|
2704
|
+
}
|
|
2705
|
+
//#endregion
|
|
2706
|
+
//#region src/user-management/session.ts
|
|
2707
|
+
var CookieSession = class {
|
|
2708
|
+
userManagement;
|
|
2709
|
+
cookiePassword;
|
|
2710
|
+
sessionData;
|
|
2711
|
+
constructor(userManagement, sessionData, cookiePassword) {
|
|
2712
|
+
if (!cookiePassword) throw new Error("cookiePassword is required");
|
|
2713
|
+
this.userManagement = userManagement;
|
|
2714
|
+
this.cookiePassword = cookiePassword;
|
|
2715
|
+
this.sessionData = sessionData;
|
|
2716
|
+
}
|
|
2717
|
+
/**
|
|
2718
|
+
* Authenticates a user with a session cookie.
|
|
2719
|
+
*
|
|
2720
|
+
* @returns An object indicating whether the authentication was successful or not. If successful, it will include the user's session data.
|
|
2721
|
+
*/
|
|
2722
|
+
async authenticate() {
|
|
2723
|
+
if (!this.sessionData) return {
|
|
2724
|
+
authenticated: false,
|
|
2725
|
+
reason: AuthenticateWithSessionCookieFailureReason.NO_SESSION_COOKIE_PROVIDED
|
|
2726
|
+
};
|
|
2727
|
+
const session = await unsealData(this.sessionData, { password: this.cookiePassword });
|
|
2728
|
+
if (!session.accessToken) return {
|
|
2729
|
+
authenticated: false,
|
|
2730
|
+
reason: AuthenticateWithSessionCookieFailureReason.INVALID_SESSION_COOKIE
|
|
2731
|
+
};
|
|
2732
|
+
if (!await this.isValidJwt(session.accessToken)) return {
|
|
2733
|
+
authenticated: false,
|
|
2734
|
+
reason: AuthenticateWithSessionCookieFailureReason.INVALID_JWT
|
|
2735
|
+
};
|
|
2736
|
+
const { decodeJwt } = await getJose();
|
|
2737
|
+
const { sid: sessionId, org_id: organizationId, role, roles, permissions, entitlements, feature_flags: featureFlags } = decodeJwt(session.accessToken);
|
|
2738
|
+
return {
|
|
2739
|
+
authenticated: true,
|
|
2740
|
+
sessionId,
|
|
2741
|
+
organizationId,
|
|
2742
|
+
role,
|
|
2743
|
+
roles,
|
|
2744
|
+
permissions,
|
|
2745
|
+
entitlements,
|
|
2746
|
+
featureFlags,
|
|
2747
|
+
user: session.user,
|
|
2748
|
+
authenticationMethod: session.authenticationMethod,
|
|
2749
|
+
impersonator: session.impersonator,
|
|
2750
|
+
accessToken: session.accessToken
|
|
2751
|
+
};
|
|
2752
|
+
}
|
|
2753
|
+
/**
|
|
2754
|
+
* Refreshes the user's session.
|
|
2755
|
+
*
|
|
2756
|
+
* @param options - Optional options for refreshing the session.
|
|
2757
|
+
* @param options.cookiePassword - The password to use for the new session cookie.
|
|
2758
|
+
* @param options.organizationId - The organization ID to use for the new session cookie.
|
|
2759
|
+
* @returns An object indicating whether the refresh was successful or not. If successful, it will include the new sealed session data.
|
|
2760
|
+
*/
|
|
2761
|
+
async refresh(options = {}) {
|
|
2762
|
+
const { decodeJwt } = await getJose();
|
|
2763
|
+
const session = await unsealData(this.sessionData, { password: this.cookiePassword });
|
|
2764
|
+
if (!session.refreshToken || !session.user) return {
|
|
2765
|
+
authenticated: false,
|
|
2766
|
+
reason: RefreshSessionFailureReason.INVALID_SESSION_COOKIE
|
|
2767
|
+
};
|
|
2768
|
+
const { org_id: organizationIdFromAccessToken } = decodeJwt(session.accessToken);
|
|
2769
|
+
try {
|
|
2770
|
+
const cookiePassword = options.cookiePassword ?? this.cookiePassword;
|
|
2771
|
+
const authenticationResponse = await this.userManagement.authenticateWithRefreshToken({
|
|
2772
|
+
clientId: this.userManagement.clientId,
|
|
2773
|
+
refreshToken: session.refreshToken,
|
|
2774
|
+
organizationId: options.organizationId ?? organizationIdFromAccessToken,
|
|
2775
|
+
session: {
|
|
2776
|
+
sealSession: true,
|
|
2777
|
+
cookiePassword
|
|
2778
|
+
}
|
|
2779
|
+
});
|
|
2780
|
+
if (options.cookiePassword) this.cookiePassword = options.cookiePassword;
|
|
2781
|
+
this.sessionData = authenticationResponse.sealedSession;
|
|
2782
|
+
const { sid: sessionId, org_id: organizationId, role, roles, permissions, entitlements, feature_flags: featureFlags } = decodeJwt(authenticationResponse.accessToken);
|
|
2783
|
+
return {
|
|
2784
|
+
authenticated: true,
|
|
2785
|
+
sealedSession: authenticationResponse.sealedSession,
|
|
2786
|
+
session: authenticationResponse,
|
|
2787
|
+
authenticationMethod: authenticationResponse.authenticationMethod,
|
|
2788
|
+
sessionId,
|
|
2789
|
+
organizationId,
|
|
2790
|
+
role,
|
|
2791
|
+
roles,
|
|
2792
|
+
permissions,
|
|
2793
|
+
entitlements,
|
|
2794
|
+
featureFlags,
|
|
2795
|
+
user: session.user,
|
|
2796
|
+
impersonator: session.impersonator
|
|
2797
|
+
};
|
|
2798
|
+
} catch (error) {
|
|
2799
|
+
if (error instanceof OauthException && (error.error === RefreshSessionFailureReason.INVALID_GRANT || error.error === RefreshSessionFailureReason.MFA_ENROLLMENT || error.error === RefreshSessionFailureReason.SSO_REQUIRED)) return {
|
|
2800
|
+
authenticated: false,
|
|
2801
|
+
reason: error.error
|
|
2802
|
+
};
|
|
2803
|
+
throw error;
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
/**
|
|
2807
|
+
* Gets the URL to redirect the user to for logging out.
|
|
2808
|
+
*
|
|
2809
|
+
* @returns The URL to redirect the user to for logging out.
|
|
2810
|
+
*/
|
|
2811
|
+
async getLogoutUrl({ returnTo } = {}) {
|
|
2812
|
+
const authenticationResponse = await this.authenticate();
|
|
2813
|
+
if (!authenticationResponse.authenticated) {
|
|
2814
|
+
const { reason } = authenticationResponse;
|
|
2815
|
+
throw new Error(`Failed to extract session ID for logout URL: ${reason}`);
|
|
2816
|
+
}
|
|
2817
|
+
return this.userManagement.getLogoutUrl({
|
|
2818
|
+
sessionId: authenticationResponse.sessionId,
|
|
2819
|
+
returnTo
|
|
2820
|
+
});
|
|
2821
|
+
}
|
|
2822
|
+
async isValidJwt(accessToken) {
|
|
2823
|
+
const { jwtVerify } = await getJose();
|
|
2824
|
+
const jwks = await this.userManagement.getJWKS();
|
|
2825
|
+
if (!jwks) throw new Error("Missing client ID. Did you provide it when initializing WorkOS?");
|
|
2826
|
+
try {
|
|
2827
|
+
await jwtVerify(accessToken, jwks);
|
|
2828
|
+
return true;
|
|
2829
|
+
} catch (e) {
|
|
2830
|
+
if (e instanceof Error && "code" in e && typeof e.code === "string" && (e.code.startsWith("ERR_JWT_") || e.code.startsWith("ERR_JWS_"))) return false;
|
|
2831
|
+
throw e;
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
};
|
|
2835
|
+
//#endregion
|
|
2836
|
+
//#region src/user-management/user-management.ts
|
|
2837
|
+
var UserManagement = class {
|
|
2838
|
+
_jwks;
|
|
2839
|
+
clientId;
|
|
2840
|
+
constructor(workos) {
|
|
2841
|
+
this.workos = workos;
|
|
2842
|
+
const { clientId } = workos.options;
|
|
2843
|
+
this.clientId = clientId;
|
|
2844
|
+
}
|
|
2845
|
+
/**
|
|
2846
|
+
* Resolve clientId from method options or fall back to constructor-provided value.
|
|
2847
|
+
* @throws TypeError if clientId is not available from either source
|
|
2848
|
+
*/
|
|
2849
|
+
resolveClientId(clientId) {
|
|
2850
|
+
const resolved = clientId ?? this.clientId;
|
|
2851
|
+
if (!resolved) throw new TypeError("clientId is required. Provide it in method options or when initializing WorkOS.");
|
|
2852
|
+
return resolved;
|
|
2853
|
+
}
|
|
2854
|
+
async getJWKS() {
|
|
2855
|
+
const { createRemoteJWKSet } = await getJose();
|
|
2856
|
+
if (!this.clientId) return;
|
|
2857
|
+
this._jwks ??= createRemoteJWKSet(new URL(this.getJwksUrl(this.clientId)), { cooldownDuration: 1e3 * 60 * 5 });
|
|
2858
|
+
return this._jwks;
|
|
2859
|
+
}
|
|
2860
|
+
/**
|
|
2861
|
+
* Loads a sealed session using the provided session data and cookie password.
|
|
2862
|
+
*
|
|
2863
|
+
* @param options - The options for loading the sealed session.
|
|
2864
|
+
* @param options.sessionData - The sealed session data.
|
|
2865
|
+
* @param options.cookiePassword - The password used to encrypt the session data.
|
|
2866
|
+
* @returns The session class.
|
|
2867
|
+
*/
|
|
2868
|
+
loadSealedSession(options) {
|
|
2869
|
+
return new CookieSession(this, options.sessionData, options.cookiePassword);
|
|
2870
|
+
}
|
|
2871
|
+
async getUser(userId) {
|
|
2872
|
+
const { data } = await this.workos.get(`/user_management/users/${userId}`);
|
|
2873
|
+
return deserializeUser(data);
|
|
2874
|
+
}
|
|
2875
|
+
async getUserByExternalId(externalId) {
|
|
2876
|
+
const { data } = await this.workos.get(`/user_management/users/external_id/${externalId}`);
|
|
2877
|
+
return deserializeUser(data);
|
|
2878
|
+
}
|
|
2879
|
+
async listUsers(options) {
|
|
2880
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/user_management/users", deserializeUser, options ? serializeListUsersOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/user_management/users", deserializeUser, params), options ? serializeListUsersOptions(options) : void 0);
|
|
2881
|
+
}
|
|
2882
|
+
async createUser(payload) {
|
|
2883
|
+
const { data } = await this.workos.post("/user_management/users", serializeCreateUserOptions(payload));
|
|
2884
|
+
return deserializeUser(data);
|
|
2885
|
+
}
|
|
2886
|
+
async authenticateWithMagicAuth(payload) {
|
|
2887
|
+
const { session, clientId, ...remainingPayload } = payload;
|
|
2888
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
2889
|
+
const { data } = await this.workos.post("/user_management/authenticate", serializeAuthenticateWithMagicAuthOptions({
|
|
2890
|
+
...remainingPayload,
|
|
2891
|
+
clientId: resolvedClientId,
|
|
2892
|
+
clientSecret: this.workos.key
|
|
2893
|
+
}));
|
|
2894
|
+
return this.prepareAuthenticationResponse({
|
|
2895
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
2896
|
+
session
|
|
2897
|
+
});
|
|
2898
|
+
}
|
|
2899
|
+
async authenticateWithPassword(payload) {
|
|
2900
|
+
const { session, clientId, ...remainingPayload } = payload;
|
|
2901
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
2902
|
+
const { data } = await this.workos.post("/user_management/authenticate", serializeAuthenticateWithPasswordOptions({
|
|
2903
|
+
...remainingPayload,
|
|
2904
|
+
clientId: resolvedClientId,
|
|
2905
|
+
clientSecret: this.workos.key
|
|
2906
|
+
}));
|
|
2907
|
+
return this.prepareAuthenticationResponse({
|
|
2908
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
2909
|
+
session
|
|
2910
|
+
});
|
|
2911
|
+
}
|
|
2912
|
+
/**
|
|
2913
|
+
* Exchange an authorization code for tokens.
|
|
2914
|
+
*
|
|
2915
|
+
* Auto-detects public vs confidential client mode:
|
|
2916
|
+
* - If codeVerifier is provided: Uses PKCE flow (public client)
|
|
2917
|
+
* - If no codeVerifier: Uses client_secret from API key (confidential client)
|
|
2918
|
+
* - If both: Uses both client_secret AND codeVerifier (confidential client with PKCE)
|
|
2919
|
+
*
|
|
2920
|
+
* Using PKCE with confidential clients is recommended by OAuth 2.1 for defense
|
|
2921
|
+
* in depth and provides additional CSRF protection on the authorization flow.
|
|
2922
|
+
*
|
|
2923
|
+
* @throws Error if neither codeVerifier nor API key is available
|
|
2924
|
+
*/
|
|
2925
|
+
async authenticateWithCode(payload) {
|
|
2926
|
+
const { session, clientId, codeVerifier, ...remainingPayload } = payload;
|
|
2927
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
2928
|
+
if (codeVerifier !== void 0 && codeVerifier.trim() === "") throw new TypeError("codeVerifier cannot be an empty string. Generate a valid PKCE pair using workos.pkce.generate().");
|
|
2929
|
+
const hasApiKey = !!this.workos.key;
|
|
2930
|
+
if (!!!codeVerifier && !hasApiKey) throw new TypeError("authenticateWithCode requires either a codeVerifier (for public clients) or an API key configured on the WorkOS instance (for confidential clients).");
|
|
2931
|
+
const { data } = await this.workos.post("/user_management/authenticate", serializeAuthenticateWithCodeOptions({
|
|
2932
|
+
...remainingPayload,
|
|
2933
|
+
clientId: resolvedClientId,
|
|
2934
|
+
codeVerifier,
|
|
2935
|
+
clientSecret: hasApiKey ? this.workos.key : void 0
|
|
2936
|
+
}), { skipApiKeyCheck: !hasApiKey });
|
|
2937
|
+
return this.prepareAuthenticationResponse({
|
|
2938
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
2939
|
+
session
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2942
|
+
/**
|
|
2943
|
+
* Exchange an authorization code for tokens using PKCE (public client flow).
|
|
2944
|
+
* Use this instead of authenticateWithCode() when the client cannot securely
|
|
2945
|
+
* store a client_secret (browser, mobile, CLI, desktop apps).
|
|
2946
|
+
*
|
|
2947
|
+
* @param payload.clientId - Your WorkOS client ID
|
|
2948
|
+
* @param payload.code - The authorization code from the OAuth callback
|
|
2949
|
+
* @param payload.codeVerifier - The PKCE code verifier used to generate the code challenge
|
|
2950
|
+
*/
|
|
2951
|
+
async authenticateWithCodeAndVerifier(payload) {
|
|
2952
|
+
const { session, clientId, ...remainingPayload } = payload;
|
|
2953
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
2954
|
+
const { data } = await this.workos.post("/user_management/authenticate", serializeAuthenticateWithCodeAndVerifierOptions({
|
|
2955
|
+
...remainingPayload,
|
|
2956
|
+
clientId: resolvedClientId
|
|
2957
|
+
}), { skipApiKeyCheck: true });
|
|
2958
|
+
return this.prepareAuthenticationResponse({
|
|
2959
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
2960
|
+
session
|
|
2961
|
+
});
|
|
2962
|
+
}
|
|
2963
|
+
/**
|
|
2964
|
+
* Refresh an access token using a refresh token.
|
|
2965
|
+
* Automatically detects public client mode - if no API key is configured,
|
|
2966
|
+
* omits client_secret from the request.
|
|
2967
|
+
*/
|
|
2968
|
+
async authenticateWithRefreshToken(payload) {
|
|
2969
|
+
const { session, clientId, ...remainingPayload } = payload;
|
|
2970
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
2971
|
+
const isPublicClient = !this.workos.key;
|
|
2972
|
+
const body = isPublicClient ? serializeAuthenticateWithRefreshTokenPublicClientOptions({
|
|
2973
|
+
...remainingPayload,
|
|
2974
|
+
clientId: resolvedClientId
|
|
2975
|
+
}) : serializeAuthenticateWithRefreshTokenOptions({
|
|
2976
|
+
...remainingPayload,
|
|
2977
|
+
clientId: resolvedClientId,
|
|
2978
|
+
clientSecret: this.workos.key
|
|
2979
|
+
});
|
|
2980
|
+
const { data } = await this.workos.post("/user_management/authenticate", body, { skipApiKeyCheck: isPublicClient });
|
|
2981
|
+
return this.prepareAuthenticationResponse({
|
|
2982
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
2983
|
+
session
|
|
2984
|
+
});
|
|
2985
|
+
}
|
|
2986
|
+
async authenticateWithTotp(payload) {
|
|
2987
|
+
const { session, clientId, ...remainingPayload } = payload;
|
|
2988
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
2989
|
+
const { data } = await this.workos.post("/user_management/authenticate", serializeAuthenticateWithTotpOptions({
|
|
2990
|
+
...remainingPayload,
|
|
2991
|
+
clientId: resolvedClientId,
|
|
2992
|
+
clientSecret: this.workos.key
|
|
2993
|
+
}));
|
|
2994
|
+
return this.prepareAuthenticationResponse({
|
|
2995
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
2996
|
+
session
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
async authenticateWithEmailVerification(payload) {
|
|
3000
|
+
const { session, clientId, ...remainingPayload } = payload;
|
|
3001
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
3002
|
+
const { data } = await this.workos.post("/user_management/authenticate", serializeAuthenticateWithEmailVerificationOptions({
|
|
3003
|
+
...remainingPayload,
|
|
3004
|
+
clientId: resolvedClientId,
|
|
3005
|
+
clientSecret: this.workos.key
|
|
3006
|
+
}));
|
|
3007
|
+
return this.prepareAuthenticationResponse({
|
|
3008
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
3009
|
+
session
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
async authenticateWithOrganizationSelection(payload) {
|
|
3013
|
+
const { session, clientId, ...remainingPayload } = payload;
|
|
3014
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
3015
|
+
const { data } = await this.workos.post("/user_management/authenticate", serializeAuthenticateWithOrganizationSelectionOptions({
|
|
3016
|
+
...remainingPayload,
|
|
3017
|
+
clientId: resolvedClientId,
|
|
3018
|
+
clientSecret: this.workos.key
|
|
3019
|
+
}));
|
|
3020
|
+
return this.prepareAuthenticationResponse({
|
|
3021
|
+
authenticationResponse: deserializeAuthenticationResponse(data),
|
|
3022
|
+
session
|
|
3023
|
+
});
|
|
3024
|
+
}
|
|
3025
|
+
async authenticateWithSessionCookie({ sessionData, cookiePassword = getEnv("WORKOS_COOKIE_PASSWORD") }) {
|
|
3026
|
+
if (!cookiePassword) throw new Error("Cookie password is required");
|
|
3027
|
+
if (!await this.getJWKS()) throw new Error("Must provide clientId to initialize JWKS");
|
|
3028
|
+
const { decodeJwt } = await getJose();
|
|
3029
|
+
if (!sessionData) return {
|
|
3030
|
+
authenticated: false,
|
|
3031
|
+
reason: AuthenticateWithSessionCookieFailureReason.NO_SESSION_COOKIE_PROVIDED
|
|
3032
|
+
};
|
|
3033
|
+
const session = await unsealData(sessionData, { password: cookiePassword });
|
|
3034
|
+
if (!session.accessToken) return {
|
|
3035
|
+
authenticated: false,
|
|
3036
|
+
reason: AuthenticateWithSessionCookieFailureReason.INVALID_SESSION_COOKIE
|
|
3037
|
+
};
|
|
3038
|
+
if (!await this.isValidJwt(session.accessToken)) return {
|
|
3039
|
+
authenticated: false,
|
|
3040
|
+
reason: AuthenticateWithSessionCookieFailureReason.INVALID_JWT
|
|
3041
|
+
};
|
|
3042
|
+
const { sid: sessionId, org_id: organizationId, role, roles, permissions, entitlements, feature_flags: featureFlags } = decodeJwt(session.accessToken);
|
|
3043
|
+
return {
|
|
3044
|
+
authenticated: true,
|
|
3045
|
+
sessionId,
|
|
3046
|
+
organizationId,
|
|
3047
|
+
role,
|
|
3048
|
+
roles,
|
|
3049
|
+
user: session.user,
|
|
3050
|
+
permissions,
|
|
3051
|
+
entitlements,
|
|
3052
|
+
featureFlags,
|
|
3053
|
+
accessToken: session.accessToken,
|
|
3054
|
+
authenticationMethod: session.authenticationMethod
|
|
3055
|
+
};
|
|
3056
|
+
}
|
|
3057
|
+
async isValidJwt(accessToken) {
|
|
3058
|
+
const jwks = await this.getJWKS();
|
|
3059
|
+
const { jwtVerify } = await getJose();
|
|
3060
|
+
if (!jwks) throw new Error("Must provide clientId to initialize JWKS");
|
|
3061
|
+
try {
|
|
3062
|
+
await jwtVerify(accessToken, jwks);
|
|
3063
|
+
return true;
|
|
3064
|
+
} catch (e) {
|
|
3065
|
+
if (e instanceof Error && "code" in e && typeof e.code === "string" && (e.code.startsWith("ERR_JWT_") || e.code.startsWith("ERR_JWS_"))) return false;
|
|
3066
|
+
throw e;
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
async prepareAuthenticationResponse({ authenticationResponse, session }) {
|
|
3070
|
+
if (session?.sealSession) {
|
|
3071
|
+
if (!this.workos.key) throw new Error("Session sealing requires server-side usage with an API key. Public clients should store tokens directly (e.g., secure storage on mobile, keychain on desktop).");
|
|
3072
|
+
return {
|
|
3073
|
+
...authenticationResponse,
|
|
3074
|
+
sealedSession: await this.sealSessionDataFromAuthenticationResponse({
|
|
3075
|
+
authenticationResponse,
|
|
3076
|
+
cookiePassword: session.cookiePassword
|
|
3077
|
+
})
|
|
3078
|
+
};
|
|
3079
|
+
}
|
|
3080
|
+
return authenticationResponse;
|
|
3081
|
+
}
|
|
3082
|
+
async sealSessionDataFromAuthenticationResponse({ authenticationResponse, cookiePassword }) {
|
|
3083
|
+
if (!cookiePassword) throw new Error("Cookie password is required");
|
|
3084
|
+
const { decodeJwt } = await getJose();
|
|
3085
|
+
const { org_id: organizationIdFromAccessToken } = decodeJwt(authenticationResponse.accessToken);
|
|
3086
|
+
return sealData({
|
|
3087
|
+
organizationId: organizationIdFromAccessToken,
|
|
3088
|
+
user: authenticationResponse.user,
|
|
3089
|
+
accessToken: authenticationResponse.accessToken,
|
|
3090
|
+
refreshToken: authenticationResponse.refreshToken,
|
|
3091
|
+
authenticationMethod: authenticationResponse.authenticationMethod,
|
|
3092
|
+
impersonator: authenticationResponse.impersonator
|
|
3093
|
+
}, { password: cookiePassword });
|
|
3094
|
+
}
|
|
3095
|
+
async getSessionFromCookie({ sessionData, cookiePassword = getEnv("WORKOS_COOKIE_PASSWORD") }) {
|
|
3096
|
+
if (!cookiePassword) throw new Error("Cookie password is required");
|
|
3097
|
+
if (sessionData) return unsealData(sessionData, { password: cookiePassword });
|
|
3098
|
+
}
|
|
3099
|
+
async getEmailVerification(emailVerificationId) {
|
|
3100
|
+
const { data } = await this.workos.get(`/user_management/email_verification/${emailVerificationId}`);
|
|
3101
|
+
return deserializeEmailVerification(data);
|
|
3102
|
+
}
|
|
3103
|
+
async sendVerificationEmail({ userId }) {
|
|
3104
|
+
const { data } = await this.workos.post(`/user_management/users/${userId}/email_verification/send`, {});
|
|
3105
|
+
return { user: deserializeUser(data.user) };
|
|
3106
|
+
}
|
|
3107
|
+
async getMagicAuth(magicAuthId) {
|
|
3108
|
+
const { data } = await this.workos.get(`/user_management/magic_auth/${magicAuthId}`);
|
|
3109
|
+
return deserializeMagicAuth(data);
|
|
3110
|
+
}
|
|
3111
|
+
async createMagicAuth(options) {
|
|
3112
|
+
const { data } = await this.workos.post("/user_management/magic_auth", serializeCreateMagicAuthOptions({ ...options }));
|
|
3113
|
+
return deserializeMagicAuth(data);
|
|
3114
|
+
}
|
|
3115
|
+
async verifyEmail({ code, userId }) {
|
|
3116
|
+
const { data } = await this.workos.post(`/user_management/users/${userId}/email_verification/confirm`, { code });
|
|
3117
|
+
return { user: deserializeUser(data.user) };
|
|
3118
|
+
}
|
|
3119
|
+
async getPasswordReset(passwordResetId) {
|
|
3120
|
+
const { data } = await this.workos.get(`/user_management/password_reset/${passwordResetId}`);
|
|
3121
|
+
return deserializePasswordReset(data);
|
|
3122
|
+
}
|
|
3123
|
+
async createPasswordReset(options) {
|
|
3124
|
+
const { data } = await this.workos.post("/user_management/password_reset", serializeCreatePasswordResetOptions({ ...options }));
|
|
3125
|
+
return deserializePasswordReset(data);
|
|
3126
|
+
}
|
|
3127
|
+
async resetPassword(payload) {
|
|
3128
|
+
const { data } = await this.workos.post("/user_management/password_reset/confirm", serializeResetPasswordOptions(payload));
|
|
3129
|
+
return { user: deserializeUser(data.user) };
|
|
3130
|
+
}
|
|
3131
|
+
async updateUser(payload) {
|
|
3132
|
+
const { data } = await this.workos.put(`/user_management/users/${payload.userId}`, serializeUpdateUserOptions(payload));
|
|
3133
|
+
return deserializeUser(data);
|
|
3134
|
+
}
|
|
3135
|
+
async enrollAuthFactor(payload) {
|
|
3136
|
+
const { data } = await this.workos.post(`/user_management/users/${payload.userId}/auth_factors`, serializeEnrollAuthFactorOptions(payload));
|
|
3137
|
+
return {
|
|
3138
|
+
authenticationFactor: deserializeFactorWithSecrets$1(data.authentication_factor),
|
|
3139
|
+
authenticationChallenge: deserializeChallenge(data.authentication_challenge)
|
|
3140
|
+
};
|
|
3141
|
+
}
|
|
3142
|
+
async listAuthFactors(options) {
|
|
3143
|
+
const { userId, ...restOfOptions } = options;
|
|
3144
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${userId}/auth_factors`, deserializeFactor$1, restOfOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${userId}/auth_factors`, deserializeFactor$1, params), restOfOptions);
|
|
3145
|
+
}
|
|
3146
|
+
async listUserFeatureFlags(options) {
|
|
3147
|
+
const { userId, ...paginationOptions } = options;
|
|
3148
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${userId}/feature-flags`, deserializeFeatureFlag, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${userId}/feature-flags`, deserializeFeatureFlag, params), paginationOptions);
|
|
3149
|
+
}
|
|
3150
|
+
async listSessions(userId, options) {
|
|
3151
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${userId}/sessions`, deserializeSession, options ? serializeListSessionsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${userId}/sessions`, deserializeSession, params), options ? serializeListSessionsOptions(options) : void 0);
|
|
3152
|
+
}
|
|
3153
|
+
async deleteUser(userId) {
|
|
3154
|
+
await this.workos.delete(`/user_management/users/${userId}`);
|
|
3155
|
+
}
|
|
3156
|
+
async getUserIdentities(userId) {
|
|
3157
|
+
if (!userId) throw new TypeError(`Incomplete arguments. Need to specify 'userId'.`);
|
|
3158
|
+
const { data } = await this.workos.get(`/user_management/users/${userId}/identities`);
|
|
3159
|
+
return deserializeIdentities(data);
|
|
3160
|
+
}
|
|
3161
|
+
async getOrganizationMembership(organizationMembershipId) {
|
|
3162
|
+
const { data } = await this.workos.get(`/user_management/organization_memberships/${organizationMembershipId}`);
|
|
3163
|
+
return deserializeOrganizationMembership(data);
|
|
3164
|
+
}
|
|
3165
|
+
async listOrganizationMemberships(options) {
|
|
3166
|
+
const serializedOptions = serializeListOrganizationMembershipsOptions(options);
|
|
3167
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/user_management/organization_memberships", deserializeOrganizationMembership, serializedOptions), (params) => fetchAndDeserialize(this.workos, "/user_management/organization_memberships", deserializeOrganizationMembership, params), serializedOptions);
|
|
3168
|
+
}
|
|
3169
|
+
async createOrganizationMembership(options) {
|
|
3170
|
+
const { data } = await this.workos.post("/user_management/organization_memberships", serializeCreateOrganizationMembershipOptions(options));
|
|
3171
|
+
return deserializeOrganizationMembership(data);
|
|
3172
|
+
}
|
|
3173
|
+
async updateOrganizationMembership(organizationMembershipId, options) {
|
|
3174
|
+
const { data } = await this.workos.put(`/user_management/organization_memberships/${organizationMembershipId}`, serializeUpdateOrganizationMembershipOptions(options));
|
|
3175
|
+
return deserializeOrganizationMembership(data);
|
|
3176
|
+
}
|
|
3177
|
+
async deleteOrganizationMembership(organizationMembershipId) {
|
|
3178
|
+
await this.workos.delete(`/user_management/organization_memberships/${organizationMembershipId}`);
|
|
3179
|
+
}
|
|
3180
|
+
async deactivateOrganizationMembership(organizationMembershipId) {
|
|
3181
|
+
const { data } = await this.workos.put(`/user_management/organization_memberships/${organizationMembershipId}/deactivate`, {});
|
|
3182
|
+
return deserializeOrganizationMembership(data);
|
|
3183
|
+
}
|
|
3184
|
+
async reactivateOrganizationMembership(organizationMembershipId) {
|
|
3185
|
+
const { data } = await this.workos.put(`/user_management/organization_memberships/${organizationMembershipId}/reactivate`, {});
|
|
3186
|
+
return deserializeOrganizationMembership(data);
|
|
3187
|
+
}
|
|
3188
|
+
async getInvitation(invitationId) {
|
|
3189
|
+
const { data } = await this.workos.get(`/user_management/invitations/${invitationId}`);
|
|
3190
|
+
return deserializeInvitation(data);
|
|
3191
|
+
}
|
|
3192
|
+
async findInvitationByToken(invitationToken) {
|
|
3193
|
+
const { data } = await this.workos.get(`/user_management/invitations/by_token/${invitationToken}`);
|
|
3194
|
+
return deserializeInvitation(data);
|
|
3195
|
+
}
|
|
3196
|
+
async listInvitations(options) {
|
|
3197
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/user_management/invitations", deserializeInvitation, options ? serializeListInvitationsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/user_management/invitations", deserializeInvitation, params), options ? serializeListInvitationsOptions(options) : void 0);
|
|
3198
|
+
}
|
|
3199
|
+
async sendInvitation(payload) {
|
|
3200
|
+
const { data } = await this.workos.post("/user_management/invitations", serializeSendInvitationOptions({ ...payload }));
|
|
3201
|
+
return deserializeInvitation(data);
|
|
3202
|
+
}
|
|
3203
|
+
async acceptInvitation(invitationId) {
|
|
3204
|
+
const { data } = await this.workos.post(`/user_management/invitations/${invitationId}/accept`, null);
|
|
3205
|
+
return deserializeInvitation(data);
|
|
3206
|
+
}
|
|
3207
|
+
async revokeInvitation(invitationId) {
|
|
3208
|
+
const { data } = await this.workos.post(`/user_management/invitations/${invitationId}/revoke`, null);
|
|
3209
|
+
return deserializeInvitation(data);
|
|
3210
|
+
}
|
|
3211
|
+
async resendInvitation(invitationId, options) {
|
|
3212
|
+
const { data } = await this.workos.post(`/user_management/invitations/${invitationId}/resend`, options ? serializeResendInvitationOptions(options) : {});
|
|
3213
|
+
return deserializeInvitation(data);
|
|
3214
|
+
}
|
|
3215
|
+
async revokeSession(payload) {
|
|
3216
|
+
await this.workos.post("/user_management/sessions/revoke", serializeRevokeSessionOptions(payload));
|
|
3217
|
+
}
|
|
3218
|
+
/**
|
|
3219
|
+
* Generate an OAuth 2.0 authorization URL.
|
|
3220
|
+
*
|
|
3221
|
+
* For public clients (browser, mobile, CLI), include PKCE parameters:
|
|
3222
|
+
* - Generate PKCE using workos.pkce.generate()
|
|
3223
|
+
* - Pass codeChallenge and codeChallengeMethod here
|
|
3224
|
+
* - Store codeVerifier and pass to authenticateWithCode() later
|
|
3225
|
+
*
|
|
3226
|
+
* Or use getAuthorizationUrlWithPKCE() which handles PKCE automatically.
|
|
3227
|
+
*/
|
|
3228
|
+
getAuthorizationUrl(options) {
|
|
3229
|
+
const { claimNonce, connectionId, codeChallenge, codeChallengeMethod, clientId, domainHint, loginHint, organizationId, provider, providerQueryParams, providerScopes, prompt, redirectUri, state, screenHint } = options;
|
|
3230
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
3231
|
+
if (!provider && !connectionId && !organizationId) throw new TypeError(`Incomplete arguments. Need to specify either a 'connectionId', 'organizationId', or 'provider'.`);
|
|
3232
|
+
if (provider !== "authkit" && screenHint) throw new TypeError(`'screenHint' is only supported for 'authkit' provider`);
|
|
3233
|
+
const query = toQueryString({
|
|
3234
|
+
claim_nonce: claimNonce,
|
|
3235
|
+
connection_id: connectionId,
|
|
3236
|
+
code_challenge: codeChallenge,
|
|
3237
|
+
code_challenge_method: codeChallengeMethod,
|
|
3238
|
+
organization_id: organizationId,
|
|
3239
|
+
domain_hint: domainHint,
|
|
3240
|
+
login_hint: loginHint,
|
|
3241
|
+
provider,
|
|
3242
|
+
provider_query_params: providerQueryParams,
|
|
3243
|
+
provider_scopes: providerScopes,
|
|
3244
|
+
prompt,
|
|
3245
|
+
client_id: resolvedClientId,
|
|
3246
|
+
redirect_uri: redirectUri,
|
|
3247
|
+
response_type: "code",
|
|
3248
|
+
state,
|
|
3249
|
+
screen_hint: screenHint
|
|
3250
|
+
});
|
|
3251
|
+
return `${this.workos.baseURL}/user_management/authorize?${query}`;
|
|
3252
|
+
}
|
|
3253
|
+
/**
|
|
3254
|
+
* Generate an OAuth 2.0 authorization URL with automatic PKCE.
|
|
3255
|
+
*
|
|
3256
|
+
* This method generates PKCE parameters internally and returns them along with
|
|
3257
|
+
* the authorization URL. Use this for public clients (CLI apps, Electron, mobile)
|
|
3258
|
+
* that cannot securely store a client secret.
|
|
3259
|
+
*
|
|
3260
|
+
* @returns Object containing url, state, and codeVerifier
|
|
3261
|
+
*
|
|
3262
|
+
* @example
|
|
3263
|
+
* ```typescript
|
|
3264
|
+
* const { url, state, codeVerifier } = await workos.userManagement.getAuthorizationUrlWithPKCE({
|
|
3265
|
+
* provider: 'authkit',
|
|
3266
|
+
* clientId: 'client_123',
|
|
3267
|
+
* redirectUri: 'myapp://callback',
|
|
3268
|
+
* });
|
|
3269
|
+
*
|
|
3270
|
+
* // Store state and codeVerifier securely, then redirect user to url
|
|
3271
|
+
* // After callback, exchange the code:
|
|
3272
|
+
* const response = await workos.userManagement.authenticateWithCode({
|
|
3273
|
+
* code: authorizationCode,
|
|
3274
|
+
* codeVerifier,
|
|
3275
|
+
* clientId: 'client_123',
|
|
3276
|
+
* });
|
|
3277
|
+
* ```
|
|
3278
|
+
*/
|
|
3279
|
+
async getAuthorizationUrlWithPKCE(options) {
|
|
3280
|
+
const { clientId, connectionId, domainHint, loginHint, organizationId, provider, providerQueryParams, providerScopes, prompt, redirectUri, screenHint } = options;
|
|
3281
|
+
const resolvedClientId = this.resolveClientId(clientId);
|
|
3282
|
+
if (!provider && !connectionId && !organizationId) throw new TypeError(`Incomplete arguments. Need to specify either a 'connectionId', 'organizationId', or 'provider'.`);
|
|
3283
|
+
if (provider !== "authkit" && screenHint) throw new TypeError(`'screenHint' is only supported for 'authkit' provider`);
|
|
3284
|
+
const pkce = await this.workos.pkce.generate();
|
|
3285
|
+
const state = this.workos.pkce.generateCodeVerifier(43);
|
|
3286
|
+
const query = toQueryString({
|
|
3287
|
+
connection_id: connectionId,
|
|
3288
|
+
code_challenge: pkce.codeChallenge,
|
|
3289
|
+
code_challenge_method: "S256",
|
|
3290
|
+
organization_id: organizationId,
|
|
3291
|
+
domain_hint: domainHint,
|
|
3292
|
+
login_hint: loginHint,
|
|
3293
|
+
provider,
|
|
3294
|
+
provider_query_params: providerQueryParams,
|
|
3295
|
+
provider_scopes: providerScopes,
|
|
3296
|
+
prompt,
|
|
3297
|
+
client_id: resolvedClientId,
|
|
3298
|
+
redirect_uri: redirectUri,
|
|
3299
|
+
response_type: "code",
|
|
3300
|
+
state,
|
|
3301
|
+
screen_hint: screenHint
|
|
3302
|
+
});
|
|
3303
|
+
return {
|
|
3304
|
+
url: `${this.workos.baseURL}/user_management/authorize?${query}`,
|
|
3305
|
+
state,
|
|
3306
|
+
codeVerifier: pkce.codeVerifier
|
|
3307
|
+
};
|
|
3308
|
+
}
|
|
3309
|
+
getLogoutUrl(options) {
|
|
3310
|
+
const { sessionId, returnTo } = options;
|
|
3311
|
+
if (!sessionId) throw new TypeError(`Incomplete arguments. Need to specify 'sessionId'.`);
|
|
3312
|
+
const url = new URL("/user_management/sessions/logout", this.workos.baseURL);
|
|
3313
|
+
url.searchParams.set("session_id", sessionId);
|
|
3314
|
+
if (returnTo) url.searchParams.set("return_to", returnTo);
|
|
3315
|
+
return url.toString();
|
|
3316
|
+
}
|
|
3317
|
+
getJwksUrl(clientId) {
|
|
3318
|
+
if (!clientId) throw new TypeError("clientId must be a valid clientId");
|
|
3319
|
+
return `${this.workos.baseURL}/sso/jwks/${clientId}`;
|
|
3320
|
+
}
|
|
3321
|
+
};
|
|
3322
|
+
//#endregion
|
|
3323
|
+
//#region src/fga/interfaces/check-op.enum.ts
|
|
3324
|
+
let CheckOp = /* @__PURE__ */ function(CheckOp) {
|
|
3325
|
+
CheckOp["AllOf"] = "all_of";
|
|
3326
|
+
CheckOp["AnyOf"] = "any_of";
|
|
3327
|
+
return CheckOp;
|
|
3328
|
+
}({});
|
|
3329
|
+
//#endregion
|
|
3330
|
+
//#region src/fga/utils/interface-check.ts
|
|
3331
|
+
function isSubject(resource) {
|
|
3332
|
+
return Object.prototype.hasOwnProperty.call(resource, "resourceType") && Object.prototype.hasOwnProperty.call(resource, "resourceId");
|
|
3333
|
+
}
|
|
3334
|
+
function isResourceInterface(resource) {
|
|
3335
|
+
return !!resource && typeof resource === "object" && "getResouceType" in resource && "getResourceId" in resource;
|
|
3336
|
+
}
|
|
3337
|
+
//#endregion
|
|
3338
|
+
//#region src/fga/serializers/check-options.serializer.ts
|
|
3339
|
+
const serializeCheckOptions = (options) => ({
|
|
3340
|
+
op: options.op,
|
|
3341
|
+
checks: options.checks.map(serializeCheckWarrantOptions),
|
|
3342
|
+
debug: options.debug
|
|
3343
|
+
});
|
|
3344
|
+
const serializeCheckBatchOptions = (options) => ({
|
|
3345
|
+
op: "batch",
|
|
3346
|
+
checks: options.checks.map(serializeCheckWarrantOptions),
|
|
3347
|
+
debug: options.debug
|
|
3348
|
+
});
|
|
3349
|
+
const serializeCheckWarrantOptions = (warrant) => {
|
|
3350
|
+
return {
|
|
3351
|
+
resource_type: isResourceInterface(warrant.resource) ? warrant.resource.getResourceType() : warrant.resource.resourceType,
|
|
3352
|
+
resource_id: isResourceInterface(warrant.resource) ? warrant.resource.getResourceId() : warrant.resource.resourceId ? warrant.resource.resourceId : "",
|
|
3353
|
+
relation: warrant.relation,
|
|
3354
|
+
subject: isSubject(warrant.subject) ? {
|
|
3355
|
+
resource_type: warrant.subject.resourceType,
|
|
3356
|
+
resource_id: warrant.subject.resourceId
|
|
3357
|
+
} : {
|
|
3358
|
+
resource_type: warrant.subject.getResourceType(),
|
|
3359
|
+
resource_id: warrant.subject.getResourceId()
|
|
3360
|
+
},
|
|
3361
|
+
context: warrant.context ?? {}
|
|
3362
|
+
};
|
|
3363
|
+
};
|
|
3364
|
+
const deserializeDecisionTreeNode = (response) => {
|
|
3365
|
+
return {
|
|
3366
|
+
check: {
|
|
3367
|
+
resource: {
|
|
3368
|
+
resourceType: response.check.resource_type,
|
|
3369
|
+
resourceId: response.check.resource_id
|
|
3370
|
+
},
|
|
3371
|
+
relation: response.check.relation,
|
|
3372
|
+
subject: {
|
|
3373
|
+
resourceType: response.check.subject.resource_type,
|
|
3374
|
+
resourceId: response.check.subject.resource_id
|
|
3375
|
+
},
|
|
3376
|
+
context: response.check.context
|
|
3377
|
+
},
|
|
3378
|
+
policy: response.policy,
|
|
3379
|
+
decision: response.decision,
|
|
3380
|
+
processingTime: response.processing_time,
|
|
3381
|
+
children: response.children.map(deserializeDecisionTreeNode)
|
|
3382
|
+
};
|
|
3383
|
+
};
|
|
3384
|
+
//#endregion
|
|
3385
|
+
//#region src/fga/interfaces/check.interface.ts
|
|
3386
|
+
const CHECK_RESULT_AUTHORIZED = "authorized";
|
|
3387
|
+
var CheckResult = class {
|
|
3388
|
+
result;
|
|
3389
|
+
isImplicit;
|
|
3390
|
+
warrantToken;
|
|
3391
|
+
debugInfo;
|
|
3392
|
+
warnings;
|
|
3393
|
+
constructor(json) {
|
|
3394
|
+
this.result = json.result;
|
|
3395
|
+
this.isImplicit = json.is_implicit;
|
|
3396
|
+
this.warrantToken = json.warrant_token;
|
|
3397
|
+
this.debugInfo = json.debug_info ? {
|
|
3398
|
+
processingTime: json.debug_info.processing_time,
|
|
3399
|
+
decisionTree: deserializeDecisionTreeNode(json.debug_info.decision_tree)
|
|
3400
|
+
} : void 0;
|
|
3401
|
+
this.warnings = json.warnings;
|
|
3402
|
+
}
|
|
3403
|
+
isAuthorized() {
|
|
3404
|
+
return this.result === CHECK_RESULT_AUTHORIZED;
|
|
3405
|
+
}
|
|
3406
|
+
};
|
|
3407
|
+
//#endregion
|
|
3408
|
+
//#region src/fga/interfaces/resource-op.enum.ts
|
|
3409
|
+
let ResourceOp = /* @__PURE__ */ function(ResourceOp) {
|
|
3410
|
+
ResourceOp["Create"] = "create";
|
|
3411
|
+
ResourceOp["Delete"] = "delete";
|
|
3412
|
+
return ResourceOp;
|
|
3413
|
+
}({});
|
|
3414
|
+
//#endregion
|
|
3415
|
+
//#region src/fga/interfaces/warrant-op.enum.ts
|
|
3416
|
+
let WarrantOp = /* @__PURE__ */ function(WarrantOp) {
|
|
3417
|
+
WarrantOp["Create"] = "create";
|
|
3418
|
+
WarrantOp["Delete"] = "delete";
|
|
3419
|
+
return WarrantOp;
|
|
3420
|
+
}({});
|
|
3421
|
+
//#endregion
|
|
3422
|
+
//#region src/fga/serializers/create-resource-options.serializer.ts
|
|
3423
|
+
const serializeCreateResourceOptions$1 = (options) => ({
|
|
3424
|
+
resource_type: isResourceInterface(options.resource) ? options.resource.getResourceType() : options.resource.resourceType,
|
|
3425
|
+
resource_id: isResourceInterface(options.resource) ? options.resource.getResourceId() : options.resource.resourceId ? options.resource.resourceId : "",
|
|
3426
|
+
meta: options.meta
|
|
3427
|
+
});
|
|
3428
|
+
//#endregion
|
|
3429
|
+
//#region src/fga/serializers/delete-resource-options.serializer.ts
|
|
3430
|
+
const serializeDeleteResourceOptions = (options) => ({
|
|
3431
|
+
resource_type: isResourceInterface(options) ? options.getResourceType() : options.resourceType,
|
|
3432
|
+
resource_id: isResourceInterface(options) ? options.getResourceId() : options.resourceId ? options.resourceId : ""
|
|
3433
|
+
});
|
|
3434
|
+
//#endregion
|
|
3435
|
+
//#region src/fga/serializers/batch-write-resources-options.serializer.ts
|
|
3436
|
+
const serializeBatchWriteResourcesOptions = (options) => {
|
|
3437
|
+
let serializedResources = [];
|
|
3438
|
+
if (options.op === ResourceOp.Create) serializedResources = options.resources.map((options) => serializeCreateResourceOptions$1(options));
|
|
3439
|
+
else if (options.op === ResourceOp.Delete) serializedResources = options.resources.map((options) => serializeDeleteResourceOptions(options));
|
|
3440
|
+
return {
|
|
3441
|
+
op: options.op,
|
|
3442
|
+
resources: serializedResources
|
|
3443
|
+
};
|
|
3444
|
+
};
|
|
3445
|
+
//#endregion
|
|
3446
|
+
//#region src/fga/serializers/list-resources-options.serializer.ts
|
|
3447
|
+
const serializeListResourceOptions = (options) => ({
|
|
3448
|
+
resource_type: options.resourceType,
|
|
3449
|
+
search: options.search,
|
|
3450
|
+
limit: options.limit,
|
|
3451
|
+
before: options.before,
|
|
3452
|
+
after: options.after,
|
|
3453
|
+
order: options.order
|
|
3454
|
+
});
|
|
3455
|
+
//#endregion
|
|
3456
|
+
//#region src/fga/serializers/list-warrants-options.serializer.ts
|
|
3457
|
+
const serializeListWarrantsOptions = (options) => ({
|
|
3458
|
+
resource_type: options.resourceType,
|
|
3459
|
+
resource_id: options.resourceId,
|
|
3460
|
+
relation: options.relation,
|
|
3461
|
+
subject_type: options.subjectType,
|
|
3462
|
+
subject_id: options.subjectId,
|
|
3463
|
+
subject_relation: options.subjectRelation,
|
|
3464
|
+
limit: options.limit,
|
|
3465
|
+
after: options.after
|
|
3466
|
+
});
|
|
3467
|
+
//#endregion
|
|
3468
|
+
//#region src/fga/serializers/query-options.serializer.ts
|
|
3469
|
+
const serializeQueryOptions = (options) => ({
|
|
3470
|
+
q: options.q,
|
|
3471
|
+
context: JSON.stringify(options.context),
|
|
3472
|
+
limit: options.limit,
|
|
3473
|
+
before: options.before,
|
|
3474
|
+
after: options.after,
|
|
3475
|
+
order: options.order
|
|
3476
|
+
});
|
|
3477
|
+
//#endregion
|
|
3478
|
+
//#region src/fga/serializers/query-result.serializer.ts
|
|
3479
|
+
const deserializeQueryResult = (queryResult) => ({
|
|
3480
|
+
resourceType: queryResult.resource_type,
|
|
3481
|
+
resourceId: queryResult.resource_id,
|
|
3482
|
+
relation: queryResult.relation,
|
|
3483
|
+
warrant: {
|
|
3484
|
+
resourceType: queryResult.warrant.resource_type,
|
|
3485
|
+
resourceId: queryResult.warrant.resource_id,
|
|
3486
|
+
relation: queryResult.warrant.relation,
|
|
3487
|
+
subject: {
|
|
3488
|
+
resourceType: queryResult.warrant.subject.resource_type,
|
|
3489
|
+
resourceId: queryResult.warrant.subject.resource_id,
|
|
3490
|
+
relation: queryResult.warrant.subject.relation
|
|
3491
|
+
}
|
|
3492
|
+
},
|
|
3493
|
+
isImplicit: queryResult.is_implicit,
|
|
3494
|
+
meta: queryResult.meta
|
|
3495
|
+
});
|
|
3496
|
+
//#endregion
|
|
3497
|
+
//#region src/fga/serializers/resource.serializer.ts
|
|
3498
|
+
const deserializeResource = (response) => ({
|
|
3499
|
+
resourceType: response.resource_type,
|
|
3500
|
+
resourceId: response.resource_id,
|
|
3501
|
+
meta: response.meta
|
|
3502
|
+
});
|
|
3503
|
+
const deserializeBatchWriteResourcesResponse = (response) => {
|
|
3504
|
+
return response.data.map((resource) => deserializeResource(resource));
|
|
3505
|
+
};
|
|
3506
|
+
//#endregion
|
|
3507
|
+
//#region src/fga/serializers/warrant-token.serializer.ts
|
|
3508
|
+
const deserializeWarrantToken = (warrantToken) => ({ warrantToken: warrantToken.warrant_token });
|
|
3509
|
+
//#endregion
|
|
3510
|
+
//#region src/fga/serializers/warrant.serializer.ts
|
|
3511
|
+
const deserializeWarrant = (warrant) => ({
|
|
3512
|
+
resourceType: warrant.resource_type,
|
|
3513
|
+
resourceId: warrant.resource_id,
|
|
3514
|
+
relation: warrant.relation,
|
|
3515
|
+
subject: {
|
|
3516
|
+
resourceType: warrant.subject.resource_type,
|
|
3517
|
+
resourceId: warrant.subject.resource_id,
|
|
3518
|
+
relation: warrant.subject.relation
|
|
3519
|
+
},
|
|
3520
|
+
policy: warrant.policy
|
|
3521
|
+
});
|
|
3522
|
+
//#endregion
|
|
3523
|
+
//#region src/fga/serializers/write-warrant-options.serializer.ts
|
|
3524
|
+
const serializeWriteWarrantOptions = (warrant) => ({
|
|
3525
|
+
op: warrant.op,
|
|
3526
|
+
resource_type: isResourceInterface(warrant.resource) ? warrant.resource.getResourceType() : warrant.resource.resourceType,
|
|
3527
|
+
resource_id: isResourceInterface(warrant.resource) ? warrant.resource.getResourceId() : warrant.resource.resourceId ? warrant.resource.resourceId : "",
|
|
3528
|
+
relation: warrant.relation,
|
|
3529
|
+
subject: isSubject(warrant.subject) ? {
|
|
3530
|
+
resource_type: warrant.subject.resourceType,
|
|
3531
|
+
resource_id: warrant.subject.resourceId
|
|
3532
|
+
} : {
|
|
3533
|
+
resource_type: warrant.subject.getResourceType(),
|
|
3534
|
+
resource_id: warrant.subject.getResourceId()
|
|
3535
|
+
},
|
|
3536
|
+
policy: warrant.policy
|
|
3537
|
+
});
|
|
3538
|
+
//#endregion
|
|
3539
|
+
//#region src/fga/serializers/list.serializer.ts
|
|
3540
|
+
const deserializeFGAList = (response, deserializeFn) => ({
|
|
3541
|
+
object: "list",
|
|
3542
|
+
data: response.data.map(deserializeFn),
|
|
3543
|
+
listMetadata: response.list_metadata,
|
|
3544
|
+
warnings: response.warnings
|
|
3545
|
+
});
|
|
3546
|
+
//#endregion
|
|
3547
|
+
//#region src/fga/utils/fga-paginatable.ts
|
|
3548
|
+
var FgaPaginatable = class extends AutoPaginatable {
|
|
3549
|
+
list;
|
|
3550
|
+
constructor(list, apiCall, options) {
|
|
3551
|
+
super(list, apiCall, options);
|
|
3552
|
+
this.list = list;
|
|
3553
|
+
}
|
|
3554
|
+
get warnings() {
|
|
3555
|
+
return this.list.warnings;
|
|
3556
|
+
}
|
|
3557
|
+
};
|
|
3558
|
+
//#endregion
|
|
3559
|
+
//#region src/fga/utils/fetch-and-deserialize-list.ts
|
|
3560
|
+
const fetchAndDeserializeFGAList = async (workos, endpoint, deserializeFn, options, requestOptions) => {
|
|
3561
|
+
const { data: response } = await workos.get(endpoint, {
|
|
3562
|
+
query: options,
|
|
3563
|
+
...requestOptions
|
|
3564
|
+
});
|
|
3565
|
+
return deserializeFGAList(response, deserializeFn);
|
|
3566
|
+
};
|
|
3567
|
+
//#endregion
|
|
3568
|
+
//#region src/fga/fga.ts
|
|
3569
|
+
/**
|
|
3570
|
+
* @deprecated The FGA module is deprecated. Use the Authorization module instead.
|
|
3571
|
+
* @see src/authorization/authorization.ts
|
|
3572
|
+
*/
|
|
3573
|
+
var FGA = class {
|
|
3574
|
+
constructor(workos) {
|
|
3575
|
+
this.workos = workos;
|
|
3576
|
+
}
|
|
3577
|
+
async check(checkOptions, options = {}) {
|
|
3578
|
+
const { data } = await this.workos.post(`/fga/v1/check`, serializeCheckOptions(checkOptions), options);
|
|
3579
|
+
return new CheckResult(data);
|
|
3580
|
+
}
|
|
3581
|
+
async checkBatch(checkOptions, options = {}) {
|
|
3582
|
+
const { data } = await this.workos.post(`/fga/v1/check`, serializeCheckBatchOptions(checkOptions), options);
|
|
3583
|
+
return data.map((checkResult) => new CheckResult(checkResult));
|
|
3584
|
+
}
|
|
3585
|
+
async createResource(resource) {
|
|
3586
|
+
const { data } = await this.workos.post("/fga/v1/resources", serializeCreateResourceOptions$1(resource));
|
|
3587
|
+
return deserializeResource(data);
|
|
3588
|
+
}
|
|
3589
|
+
async getResource(resource) {
|
|
3590
|
+
const resourceType = isResourceInterface(resource) ? resource.getResourceType() : resource.resourceType;
|
|
3591
|
+
const resourceId = isResourceInterface(resource) ? resource.getResourceId() : resource.resourceId;
|
|
3592
|
+
const { data } = await this.workos.get(`/fga/v1/resources/${resourceType}/${resourceId}`);
|
|
3593
|
+
return deserializeResource(data);
|
|
3594
|
+
}
|
|
3595
|
+
async listResources(options) {
|
|
3596
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/fga/v1/resources", deserializeResource, options ? serializeListResourceOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/fga/v1/resources", deserializeResource, params), options ? serializeListResourceOptions(options) : void 0);
|
|
3597
|
+
}
|
|
3598
|
+
async updateResource(options) {
|
|
3599
|
+
const resourceType = isResourceInterface(options.resource) ? options.resource.getResourceType() : options.resource.resourceType;
|
|
3600
|
+
const resourceId = isResourceInterface(options.resource) ? options.resource.getResourceId() : options.resource.resourceId;
|
|
3601
|
+
const { data } = await this.workos.put(`/fga/v1/resources/${resourceType}/${resourceId}`, { meta: options.meta });
|
|
3602
|
+
return deserializeResource(data);
|
|
3603
|
+
}
|
|
3604
|
+
async deleteResource(resource) {
|
|
3605
|
+
const resourceType = isResourceInterface(resource) ? resource.getResourceType() : resource.resourceType;
|
|
3606
|
+
const resourceId = isResourceInterface(resource) ? resource.getResourceId() : resource.resourceId;
|
|
3607
|
+
await this.workos.delete(`/fga/v1/resources/${resourceType}/${resourceId}`);
|
|
3608
|
+
}
|
|
3609
|
+
async batchWriteResources(options) {
|
|
3610
|
+
const { data } = await this.workos.post("/fga/v1/resources/batch", serializeBatchWriteResourcesOptions(options));
|
|
3611
|
+
return deserializeBatchWriteResourcesResponse(data);
|
|
3612
|
+
}
|
|
3613
|
+
async writeWarrant(options) {
|
|
3614
|
+
const { data } = await this.workos.post("/fga/v1/warrants", serializeWriteWarrantOptions(options));
|
|
3615
|
+
return deserializeWarrantToken(data);
|
|
3616
|
+
}
|
|
3617
|
+
async batchWriteWarrants(options) {
|
|
3618
|
+
const { data: warrantToken } = await this.workos.post("/fga/v1/warrants", options.map(serializeWriteWarrantOptions));
|
|
3619
|
+
return deserializeWarrantToken(warrantToken);
|
|
3620
|
+
}
|
|
3621
|
+
async listWarrants(options, requestOptions) {
|
|
3622
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/fga/v1/warrants", deserializeWarrant, options ? serializeListWarrantsOptions(options) : void 0, requestOptions), (params) => fetchAndDeserialize(this.workos, "/fga/v1/warrants", deserializeWarrant, params, requestOptions), options ? serializeListWarrantsOptions(options) : void 0);
|
|
3623
|
+
}
|
|
3624
|
+
async query(options, requestOptions = {}) {
|
|
3625
|
+
return new FgaPaginatable(await fetchAndDeserializeFGAList(this.workos, "/fga/v1/query", deserializeQueryResult, serializeQueryOptions(options), requestOptions), (params) => fetchAndDeserializeFGAList(this.workos, "/fga/v1/query", deserializeQueryResult, params, requestOptions), serializeQueryOptions(options));
|
|
3626
|
+
}
|
|
3627
|
+
};
|
|
3628
|
+
//#endregion
|
|
3629
|
+
//#region src/feature-flags/feature-flags.ts
|
|
3630
|
+
var FeatureFlags = class {
|
|
3631
|
+
constructor(workos) {
|
|
3632
|
+
this.workos = workos;
|
|
3633
|
+
}
|
|
3634
|
+
async listFeatureFlags(options) {
|
|
3635
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/feature-flags", deserializeFeatureFlag, options), (params) => fetchAndDeserialize(this.workos, "/feature-flags", deserializeFeatureFlag, params), options);
|
|
3636
|
+
}
|
|
3637
|
+
async getFeatureFlag(slug) {
|
|
3638
|
+
const { data } = await this.workos.get(`/feature-flags/${slug}`);
|
|
3639
|
+
return deserializeFeatureFlag(data);
|
|
3640
|
+
}
|
|
3641
|
+
async enableFeatureFlag(slug) {
|
|
3642
|
+
const { data } = await this.workos.put(`/feature-flags/${slug}/enable`, {});
|
|
3643
|
+
return deserializeFeatureFlag(data);
|
|
3644
|
+
}
|
|
3645
|
+
async disableFeatureFlag(slug) {
|
|
3646
|
+
const { data } = await this.workos.put(`/feature-flags/${slug}/disable`, {});
|
|
3647
|
+
return deserializeFeatureFlag(data);
|
|
3648
|
+
}
|
|
3649
|
+
async addFlagTarget(options) {
|
|
3650
|
+
const { slug, targetId } = options;
|
|
3651
|
+
await this.workos.post(`/feature-flags/${slug}/targets/${targetId}`, {});
|
|
3652
|
+
}
|
|
3653
|
+
async removeFlagTarget(options) {
|
|
3654
|
+
const { slug, targetId } = options;
|
|
3655
|
+
await this.workos.delete(`/feature-flags/${slug}/targets/${targetId}`);
|
|
3656
|
+
}
|
|
3657
|
+
};
|
|
3658
|
+
//#endregion
|
|
3659
|
+
//#region src/widgets/interfaces/get-token.ts
|
|
3660
|
+
const serializeGetTokenOptions = (options) => ({
|
|
3661
|
+
organization_id: options.organizationId,
|
|
3662
|
+
user_id: options.userId,
|
|
3663
|
+
scopes: options.scopes
|
|
3664
|
+
});
|
|
3665
|
+
const deserializeGetTokenResponse = (data) => ({ token: data.token });
|
|
3666
|
+
//#endregion
|
|
3667
|
+
//#region src/widgets/widgets.ts
|
|
3668
|
+
var Widgets = class {
|
|
3669
|
+
constructor(workos) {
|
|
3670
|
+
this.workos = workos;
|
|
3671
|
+
}
|
|
3672
|
+
async getToken(payload) {
|
|
3673
|
+
const { data } = await this.workos.post("/widgets/token", serializeGetTokenOptions(payload));
|
|
3674
|
+
return deserializeGetTokenResponse(data).token;
|
|
3675
|
+
}
|
|
3676
|
+
};
|
|
3677
|
+
//#endregion
|
|
3678
|
+
//#region src/authorization/serializers/environment-role.serializer.ts
|
|
3679
|
+
const deserializeEnvironmentRole = (role) => ({
|
|
3680
|
+
object: role.object,
|
|
3681
|
+
id: role.id,
|
|
3682
|
+
name: role.name,
|
|
3683
|
+
slug: role.slug,
|
|
3684
|
+
description: role.description,
|
|
3685
|
+
permissions: role.permissions,
|
|
3686
|
+
resourceTypeSlug: role.resource_type_slug,
|
|
3687
|
+
type: role.type,
|
|
3688
|
+
createdAt: role.created_at,
|
|
3689
|
+
updatedAt: role.updated_at
|
|
3690
|
+
});
|
|
3691
|
+
//#endregion
|
|
3692
|
+
//#region src/authorization/serializers/create-environment-role-options.serializer.ts
|
|
3693
|
+
const serializeCreateEnvironmentRoleOptions = (options) => ({
|
|
3694
|
+
slug: options.slug,
|
|
3695
|
+
name: options.name,
|
|
3696
|
+
description: options.description,
|
|
3697
|
+
resource_type_slug: options.resourceTypeSlug
|
|
3698
|
+
});
|
|
3699
|
+
//#endregion
|
|
3700
|
+
//#region src/authorization/serializers/update-environment-role-options.serializer.ts
|
|
3701
|
+
const serializeUpdateEnvironmentRoleOptions = (options) => ({
|
|
3702
|
+
name: options.name,
|
|
3703
|
+
description: options.description
|
|
3704
|
+
});
|
|
3705
|
+
//#endregion
|
|
3706
|
+
//#region src/authorization/serializers/create-organization-role-options.serializer.ts
|
|
3707
|
+
const serializeCreateOrganizationRoleOptions = (options) => ({
|
|
3708
|
+
slug: options.slug,
|
|
3709
|
+
name: options.name,
|
|
3710
|
+
description: options.description
|
|
3711
|
+
});
|
|
3712
|
+
//#endregion
|
|
3713
|
+
//#region src/authorization/serializers/update-organization-role-options.serializer.ts
|
|
3714
|
+
const serializeUpdateOrganizationRoleOptions = (options) => ({
|
|
3715
|
+
name: options.name,
|
|
3716
|
+
description: options.description
|
|
3717
|
+
});
|
|
3718
|
+
//#endregion
|
|
3719
|
+
//#region src/authorization/serializers/create-permission-options.serializer.ts
|
|
3720
|
+
const serializeCreatePermissionOptions = (options) => ({
|
|
3721
|
+
slug: options.slug,
|
|
3722
|
+
name: options.name,
|
|
3723
|
+
description: options.description,
|
|
3724
|
+
resource_type_slug: options.resourceTypeSlug
|
|
3725
|
+
});
|
|
3726
|
+
//#endregion
|
|
3727
|
+
//#region src/authorization/serializers/update-permission-options.serializer.ts
|
|
3728
|
+
const serializeUpdatePermissionOptions = (options) => ({
|
|
3729
|
+
name: options.name,
|
|
3730
|
+
description: options.description
|
|
3731
|
+
});
|
|
3732
|
+
//#endregion
|
|
3733
|
+
//#region src/authorization/serializers/authorization-resource.serializer.ts
|
|
3734
|
+
const deserializeAuthorizationResource = (resource) => ({
|
|
3735
|
+
object: resource.object,
|
|
3736
|
+
id: resource.id,
|
|
3737
|
+
externalId: resource.external_id,
|
|
3738
|
+
name: resource.name,
|
|
3739
|
+
description: resource.description,
|
|
3740
|
+
resourceTypeSlug: resource.resource_type_slug,
|
|
3741
|
+
organizationId: resource.organization_id,
|
|
3742
|
+
parentResourceId: resource.parent_resource_id,
|
|
3743
|
+
createdAt: resource.created_at,
|
|
3744
|
+
updatedAt: resource.updated_at
|
|
3745
|
+
});
|
|
3746
|
+
//#endregion
|
|
3747
|
+
//#region src/authorization/serializers/create-authorization-resource-options.serializer.ts
|
|
3748
|
+
const serializeCreateResourceOptions = (options) => ({
|
|
3749
|
+
organization_id: options.organizationId,
|
|
3750
|
+
resource_type_slug: options.resourceTypeSlug,
|
|
3751
|
+
external_id: options.externalId,
|
|
3752
|
+
name: options.name,
|
|
3753
|
+
...options.description !== void 0 && { description: options.description },
|
|
3754
|
+
..."parentResourceId" in options && { parent_resource_id: options.parentResourceId },
|
|
3755
|
+
..."parentResourceExternalId" in options && {
|
|
3756
|
+
parent_resource_external_id: options.parentResourceExternalId,
|
|
3757
|
+
parent_resource_type_slug: options.parentResourceTypeSlug
|
|
3758
|
+
}
|
|
3759
|
+
});
|
|
3760
|
+
//#endregion
|
|
3761
|
+
//#region src/authorization/serializers/update-authorization-resource-options.serializer.ts
|
|
3762
|
+
const serializeUpdateResourceOptions = (options) => ({
|
|
3763
|
+
...options.name !== void 0 && { name: options.name },
|
|
3764
|
+
...options.description !== void 0 && { description: options.description }
|
|
3765
|
+
});
|
|
3766
|
+
//#endregion
|
|
3767
|
+
//#region src/authorization/serializers/update-authorization-resource-by-external-id-options.serializer.ts
|
|
3768
|
+
const serializeUpdateResourceByExternalIdOptions = (options) => ({
|
|
3769
|
+
...options.name !== void 0 && { name: options.name },
|
|
3770
|
+
...options.description !== void 0 && { description: options.description }
|
|
3771
|
+
});
|
|
3772
|
+
//#endregion
|
|
3773
|
+
//#region src/authorization/serializers/list-authorization-resources-options.serializer.ts
|
|
3774
|
+
const serializeListAuthorizationResourcesOptions = (options) => ({
|
|
3775
|
+
...options.organizationId && { organization_id: options.organizationId },
|
|
3776
|
+
...options.resourceTypeSlug && { resource_type_slug: options.resourceTypeSlug },
|
|
3777
|
+
...options.parentResourceId && { parent_resource_id: options.parentResourceId },
|
|
3778
|
+
...options.parentResourceTypeSlug && { parent_resource_type_slug: options.parentResourceTypeSlug },
|
|
3779
|
+
...options.parentExternalId && { parent_external_id: options.parentExternalId },
|
|
3780
|
+
...options.search && { search: options.search },
|
|
3781
|
+
...serializePaginationOptions(options)
|
|
3782
|
+
});
|
|
3783
|
+
//#endregion
|
|
3784
|
+
//#region src/authorization/serializers/authorization-check-options.serializer.ts
|
|
3785
|
+
const serializeAuthorizationCheckOptions = (options) => ({
|
|
3786
|
+
permission_slug: options.permissionSlug,
|
|
3787
|
+
..."resourceId" in options && { resource_id: options.resourceId },
|
|
3788
|
+
..."resourceExternalId" in options && {
|
|
3789
|
+
resource_external_id: options.resourceExternalId,
|
|
3790
|
+
resource_type_slug: options.resourceTypeSlug
|
|
3791
|
+
}
|
|
3792
|
+
});
|
|
3793
|
+
//#endregion
|
|
3794
|
+
//#region src/authorization/serializers/list-resources-for-membership-options.serializer.ts
|
|
3795
|
+
const serializeListResourcesForMembershipOptions = (options) => ({
|
|
3796
|
+
permission_slug: options.permissionSlug,
|
|
3797
|
+
...serializePaginationOptions(options),
|
|
3798
|
+
..."parentResourceId" in options && { parent_resource_id: options.parentResourceId },
|
|
3799
|
+
..."parentResourceExternalId" in options && {
|
|
3800
|
+
parent_resource_type_slug: options.parentResourceTypeSlug,
|
|
3801
|
+
parent_resource_external_id: options.parentResourceExternalId
|
|
3802
|
+
}
|
|
3803
|
+
});
|
|
3804
|
+
//#endregion
|
|
3805
|
+
//#region src/authorization/serializers/list-memberships-for-resource-options.serializer.ts
|
|
3806
|
+
const serializeListMembershipsForResourceOptions = (options) => ({
|
|
3807
|
+
permission_slug: options.permissionSlug,
|
|
3808
|
+
...options.assignment && { assignment: options.assignment },
|
|
3809
|
+
...serializePaginationOptions(options)
|
|
3810
|
+
});
|
|
3811
|
+
//#endregion
|
|
3812
|
+
//#region src/authorization/serializers/role-assignment.serializer.ts
|
|
3813
|
+
const deserializeRoleAssignment = (response) => ({
|
|
3814
|
+
object: response.object,
|
|
3815
|
+
id: response.id,
|
|
3816
|
+
role: response.role,
|
|
3817
|
+
resource: {
|
|
3818
|
+
id: response.resource.id,
|
|
3819
|
+
externalId: response.resource.external_id,
|
|
3820
|
+
resourceTypeSlug: response.resource.resource_type_slug
|
|
3821
|
+
},
|
|
3822
|
+
createdAt: response.created_at,
|
|
3823
|
+
updatedAt: response.updated_at
|
|
3824
|
+
});
|
|
3825
|
+
//#endregion
|
|
3826
|
+
//#region src/authorization/serializers/assign-role-options.serializer.ts
|
|
3827
|
+
const serializeAssignRoleOptions = (options) => ({
|
|
3828
|
+
role_slug: options.roleSlug,
|
|
3829
|
+
..."resourceId" in options && { resource_id: options.resourceId },
|
|
3830
|
+
..."resourceExternalId" in options && {
|
|
3831
|
+
resource_external_id: options.resourceExternalId,
|
|
3832
|
+
resource_type_slug: options.resourceTypeSlug
|
|
3833
|
+
}
|
|
3834
|
+
});
|
|
3835
|
+
//#endregion
|
|
3836
|
+
//#region src/authorization/serializers/remove-role-options.serializer.ts
|
|
3837
|
+
const serializeRemoveRoleOptions = (options) => ({
|
|
3838
|
+
role_slug: options.roleSlug,
|
|
3839
|
+
..."resourceId" in options && { resource_id: options.resourceId },
|
|
3840
|
+
..."resourceExternalId" in options && {
|
|
3841
|
+
resource_external_id: options.resourceExternalId,
|
|
3842
|
+
resource_type_slug: options.resourceTypeSlug
|
|
3843
|
+
}
|
|
3844
|
+
});
|
|
3845
|
+
//#endregion
|
|
3846
|
+
//#region src/authorization/authorization.ts
|
|
3847
|
+
var Authorization = class {
|
|
3848
|
+
constructor(workos) {
|
|
3849
|
+
this.workos = workos;
|
|
3850
|
+
}
|
|
3851
|
+
async createEnvironmentRole(options) {
|
|
3852
|
+
const { data } = await this.workos.post("/authorization/roles", serializeCreateEnvironmentRoleOptions(options));
|
|
3853
|
+
return deserializeEnvironmentRole(data);
|
|
3854
|
+
}
|
|
3855
|
+
async listEnvironmentRoles() {
|
|
3856
|
+
const { data } = await this.workos.get("/authorization/roles");
|
|
3857
|
+
return {
|
|
3858
|
+
object: "list",
|
|
3859
|
+
data: data.data.map(deserializeEnvironmentRole)
|
|
3860
|
+
};
|
|
3861
|
+
}
|
|
3862
|
+
async getEnvironmentRole(slug) {
|
|
3863
|
+
const { data } = await this.workos.get(`/authorization/roles/${slug}`);
|
|
3864
|
+
return deserializeEnvironmentRole(data);
|
|
3865
|
+
}
|
|
3866
|
+
async updateEnvironmentRole(slug, options) {
|
|
3867
|
+
const { data } = await this.workos.patch(`/authorization/roles/${slug}`, serializeUpdateEnvironmentRoleOptions(options));
|
|
3868
|
+
return deserializeEnvironmentRole(data);
|
|
3869
|
+
}
|
|
3870
|
+
async setEnvironmentRolePermissions(slug, options) {
|
|
3871
|
+
const { data } = await this.workos.put(`/authorization/roles/${slug}/permissions`, { permissions: options.permissions });
|
|
3872
|
+
return deserializeEnvironmentRole(data);
|
|
3873
|
+
}
|
|
3874
|
+
async addEnvironmentRolePermission(slug, options) {
|
|
3875
|
+
const { data } = await this.workos.post(`/authorization/roles/${slug}/permissions`, { slug: options.permissionSlug });
|
|
3876
|
+
return deserializeEnvironmentRole(data);
|
|
3877
|
+
}
|
|
3878
|
+
async createOrganizationRole(organizationId, options) {
|
|
3879
|
+
const { data } = await this.workos.post(`/authorization/organizations/${organizationId}/roles`, serializeCreateOrganizationRoleOptions(options));
|
|
3880
|
+
return deserializeOrganizationRole(data);
|
|
3881
|
+
}
|
|
3882
|
+
async listOrganizationRoles(organizationId) {
|
|
3883
|
+
const { data } = await this.workos.get(`/authorization/organizations/${organizationId}/roles`);
|
|
3884
|
+
return {
|
|
3885
|
+
object: "list",
|
|
3886
|
+
data: data.data.map(deserializeRole$1)
|
|
3887
|
+
};
|
|
3888
|
+
}
|
|
3889
|
+
async getOrganizationRole(organizationId, slug) {
|
|
3890
|
+
const { data } = await this.workos.get(`/authorization/organizations/${organizationId}/roles/${slug}`);
|
|
3891
|
+
return deserializeRole$1(data);
|
|
3892
|
+
}
|
|
3893
|
+
async updateOrganizationRole(organizationId, slug, options) {
|
|
3894
|
+
const { data } = await this.workos.patch(`/authorization/organizations/${organizationId}/roles/${slug}`, serializeUpdateOrganizationRoleOptions(options));
|
|
3895
|
+
return deserializeOrganizationRole(data);
|
|
3896
|
+
}
|
|
3897
|
+
async deleteOrganizationRole(organizationId, slug) {
|
|
3898
|
+
await this.workos.delete(`/authorization/organizations/${organizationId}/roles/${slug}`);
|
|
3899
|
+
}
|
|
3900
|
+
async setOrganizationRolePermissions(organizationId, slug, options) {
|
|
3901
|
+
const { data } = await this.workos.put(`/authorization/organizations/${organizationId}/roles/${slug}/permissions`, { permissions: options.permissions });
|
|
3902
|
+
return deserializeOrganizationRole(data);
|
|
3903
|
+
}
|
|
3904
|
+
async addOrganizationRolePermission(organizationId, slug, options) {
|
|
3905
|
+
const { data } = await this.workos.post(`/authorization/organizations/${organizationId}/roles/${slug}/permissions`, { slug: options.permissionSlug });
|
|
3906
|
+
return deserializeOrganizationRole(data);
|
|
3907
|
+
}
|
|
3908
|
+
async removeOrganizationRolePermission(organizationId, slug, options) {
|
|
3909
|
+
await this.workos.delete(`/authorization/organizations/${organizationId}/roles/${slug}/permissions/${options.permissionSlug}`);
|
|
3910
|
+
}
|
|
3911
|
+
async createPermission(options) {
|
|
3912
|
+
const { data } = await this.workos.post("/authorization/permissions", serializeCreatePermissionOptions(options));
|
|
3913
|
+
return deserializePermission(data);
|
|
3914
|
+
}
|
|
3915
|
+
async listPermissions(options) {
|
|
3916
|
+
const { data } = await this.workos.get("/authorization/permissions", { query: options });
|
|
3917
|
+
return {
|
|
3918
|
+
object: "list",
|
|
3919
|
+
data: data.data.map(deserializePermission),
|
|
3920
|
+
listMetadata: {
|
|
3921
|
+
before: data.list_metadata.before,
|
|
3922
|
+
after: data.list_metadata.after
|
|
3923
|
+
}
|
|
3924
|
+
};
|
|
3925
|
+
}
|
|
3926
|
+
async getPermission(slug) {
|
|
3927
|
+
const { data } = await this.workos.get(`/authorization/permissions/${slug}`);
|
|
3928
|
+
return deserializePermission(data);
|
|
3929
|
+
}
|
|
3930
|
+
async updatePermission(slug, options) {
|
|
3931
|
+
const { data } = await this.workos.patch(`/authorization/permissions/${slug}`, serializeUpdatePermissionOptions(options));
|
|
3932
|
+
return deserializePermission(data);
|
|
3933
|
+
}
|
|
3934
|
+
async deletePermission(slug) {
|
|
3935
|
+
await this.workos.delete(`/authorization/permissions/${slug}`);
|
|
3936
|
+
}
|
|
3937
|
+
async getResource(resourceId) {
|
|
3938
|
+
const { data } = await this.workos.get(`/authorization/resources/${resourceId}`);
|
|
3939
|
+
return deserializeAuthorizationResource(data);
|
|
3940
|
+
}
|
|
3941
|
+
async createResource(options) {
|
|
3942
|
+
const { data } = await this.workos.post("/authorization/resources", serializeCreateResourceOptions(options));
|
|
3943
|
+
return deserializeAuthorizationResource(data);
|
|
3944
|
+
}
|
|
3945
|
+
async updateResource(options) {
|
|
3946
|
+
const { data } = await this.workos.patch(`/authorization/resources/${options.resourceId}`, serializeUpdateResourceOptions(options));
|
|
3947
|
+
return deserializeAuthorizationResource(data);
|
|
3948
|
+
}
|
|
3949
|
+
async deleteResource(options) {
|
|
3950
|
+
const { resourceId, cascadeDelete } = options;
|
|
3951
|
+
const query = cascadeDelete !== void 0 ? { cascade_delete: cascadeDelete.toString() } : void 0;
|
|
3952
|
+
await this.workos.delete(`/authorization/resources/${resourceId}`, query);
|
|
3953
|
+
}
|
|
3954
|
+
async listResources(options = {}) {
|
|
3955
|
+
const { data } = await this.workos.get("/authorization/resources", { query: serializeListAuthorizationResourcesOptions(options) });
|
|
3956
|
+
return {
|
|
3957
|
+
object: "list",
|
|
3958
|
+
data: data.data.map(deserializeAuthorizationResource),
|
|
3959
|
+
listMetadata: {
|
|
3960
|
+
before: data.list_metadata.before,
|
|
3961
|
+
after: data.list_metadata.after
|
|
3962
|
+
}
|
|
3963
|
+
};
|
|
3964
|
+
}
|
|
3965
|
+
async getResourceByExternalId(options) {
|
|
3966
|
+
const { organizationId, resourceTypeSlug, externalId } = options;
|
|
3967
|
+
const { data } = await this.workos.get(`/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}`);
|
|
3968
|
+
return deserializeAuthorizationResource(data);
|
|
3969
|
+
}
|
|
3970
|
+
async updateResourceByExternalId(options) {
|
|
3971
|
+
const { organizationId, resourceTypeSlug, externalId } = options;
|
|
3972
|
+
const { data } = await this.workos.patch(`/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}`, serializeUpdateResourceByExternalIdOptions(options));
|
|
3973
|
+
return deserializeAuthorizationResource(data);
|
|
3974
|
+
}
|
|
3975
|
+
async deleteResourceByExternalId(options) {
|
|
3976
|
+
const { organizationId, resourceTypeSlug, externalId, cascadeDelete } = options;
|
|
3977
|
+
const query = cascadeDelete !== void 0 ? { cascade_delete: cascadeDelete.toString() } : void 0;
|
|
3978
|
+
await this.workos.delete(`/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}`, query);
|
|
3979
|
+
}
|
|
3980
|
+
async check(options) {
|
|
3981
|
+
const { data } = await this.workos.post(`/authorization/organization_memberships/${options.organizationMembershipId}/check`, serializeAuthorizationCheckOptions(options));
|
|
3982
|
+
return data;
|
|
3983
|
+
}
|
|
3984
|
+
async listRoleAssignments(options) {
|
|
3985
|
+
const { organizationMembershipId, ...queryOptions } = options;
|
|
3986
|
+
const { data } = await this.workos.get(`/authorization/organization_memberships/${organizationMembershipId}/role_assignments`, { query: queryOptions });
|
|
3987
|
+
return {
|
|
3988
|
+
object: "list",
|
|
3989
|
+
data: data.data.map(deserializeRoleAssignment),
|
|
3990
|
+
listMetadata: {
|
|
3991
|
+
before: data.list_metadata.before,
|
|
3992
|
+
after: data.list_metadata.after
|
|
3993
|
+
}
|
|
3994
|
+
};
|
|
3995
|
+
}
|
|
3996
|
+
async assignRole(options) {
|
|
3997
|
+
const { data } = await this.workos.post(`/authorization/organization_memberships/${options.organizationMembershipId}/role_assignments`, serializeAssignRoleOptions(options));
|
|
3998
|
+
return deserializeRoleAssignment(data);
|
|
3999
|
+
}
|
|
4000
|
+
async removeRole(options) {
|
|
4001
|
+
await this.workos.deleteWithBody(`/authorization/organization_memberships/${options.organizationMembershipId}/role_assignments`, serializeRemoveRoleOptions(options));
|
|
4002
|
+
}
|
|
4003
|
+
async removeRoleAssignment(options) {
|
|
4004
|
+
await this.workos.delete(`/authorization/organization_memberships/${options.organizationMembershipId}/role_assignments/${options.roleAssignmentId}`);
|
|
4005
|
+
}
|
|
4006
|
+
async listResourcesForMembership(options) {
|
|
4007
|
+
const { organizationMembershipId } = options;
|
|
4008
|
+
const { data } = await this.workos.get(`/authorization/organization_memberships/${organizationMembershipId}/resources`, { query: serializeListResourcesForMembershipOptions(options) });
|
|
4009
|
+
return {
|
|
4010
|
+
object: "list",
|
|
4011
|
+
data: data.data.map(deserializeAuthorizationResource),
|
|
4012
|
+
listMetadata: {
|
|
4013
|
+
before: data.list_metadata.before,
|
|
4014
|
+
after: data.list_metadata.after
|
|
4015
|
+
}
|
|
4016
|
+
};
|
|
4017
|
+
}
|
|
4018
|
+
async listMembershipsForResource(options) {
|
|
4019
|
+
const { resourceId } = options;
|
|
4020
|
+
const { data } = await this.workos.get(`/authorization/resources/${resourceId}/organization_memberships`, { query: serializeListMembershipsForResourceOptions(options) });
|
|
4021
|
+
return {
|
|
4022
|
+
object: "list",
|
|
4023
|
+
data: data.data.map(deserializeAuthorizationOrganizationMembership),
|
|
4024
|
+
listMetadata: {
|
|
4025
|
+
before: data.list_metadata.before,
|
|
4026
|
+
after: data.list_metadata.after
|
|
4027
|
+
}
|
|
4028
|
+
};
|
|
4029
|
+
}
|
|
4030
|
+
async listMembershipsForResourceByExternalId(options) {
|
|
4031
|
+
const { organizationId, resourceTypeSlug, externalId } = options;
|
|
4032
|
+
const { data } = await this.workos.get(`/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}/organization_memberships`, { query: serializeListMembershipsForResourceOptions(options) });
|
|
4033
|
+
return {
|
|
4034
|
+
object: "list",
|
|
4035
|
+
data: data.data.map(deserializeAuthorizationOrganizationMembership),
|
|
4036
|
+
listMetadata: {
|
|
4037
|
+
before: data.list_metadata.before,
|
|
4038
|
+
after: data.list_metadata.after
|
|
4039
|
+
}
|
|
4040
|
+
};
|
|
4041
|
+
}
|
|
4042
|
+
};
|
|
4043
|
+
//#endregion
|
|
4044
|
+
//#region src/common/utils/leb128.ts
|
|
4045
|
+
/**
|
|
4046
|
+
* LEB128 (Little Endian Base 128) encoding for unsigned 32-bit integers.
|
|
4047
|
+
* Variable-length encoding: each byte stores 7 bits of data, bit 7 is continuation flag.
|
|
4048
|
+
*/
|
|
4049
|
+
const MAX_UINT32 = 4294967295;
|
|
4050
|
+
const CONTINUATION_BIT = 128;
|
|
4051
|
+
const DATA_BITS_MASK = 127;
|
|
4052
|
+
const DATA_BITS_PER_BYTE = 7;
|
|
4053
|
+
const MAX_BYTES_FOR_UINT32 = 5;
|
|
4054
|
+
/**
|
|
4055
|
+
* Encodes an unsigned 32-bit integer into LEB128 format.
|
|
4056
|
+
*
|
|
4057
|
+
* @param value - Unsigned 32-bit integer (0 to 4,294,967,295)
|
|
4058
|
+
* @returns Encoded bytes (1-5 bytes depending on value)
|
|
4059
|
+
*/
|
|
4060
|
+
function encodeUInt32(value) {
|
|
4061
|
+
validateUInt32(value);
|
|
4062
|
+
if (value === 0) return new Uint8Array([0]);
|
|
4063
|
+
const bytes = [];
|
|
4064
|
+
do {
|
|
4065
|
+
let byte = value & DATA_BITS_MASK;
|
|
4066
|
+
value >>>= DATA_BITS_PER_BYTE;
|
|
4067
|
+
if (value !== 0) byte |= CONTINUATION_BIT;
|
|
4068
|
+
bytes.push(byte);
|
|
4069
|
+
} while (value !== 0);
|
|
4070
|
+
return new Uint8Array(bytes);
|
|
4071
|
+
}
|
|
4072
|
+
/**
|
|
4073
|
+
* Decodes an unsigned 32-bit integer from LEB128 format.
|
|
4074
|
+
*
|
|
4075
|
+
* @param data - Buffer containing LEB128 encoded data
|
|
4076
|
+
* @param offset - Starting position in buffer (default: 0)
|
|
4077
|
+
* @returns Decoded value and index after last byte read
|
|
4078
|
+
*/
|
|
4079
|
+
function decodeUInt32(data, offset = 0) {
|
|
4080
|
+
validateOffset(data, offset);
|
|
4081
|
+
let result = 0;
|
|
4082
|
+
let shift = 0;
|
|
4083
|
+
let index = offset;
|
|
4084
|
+
let bytesRead = 0;
|
|
4085
|
+
while (index < data.length) {
|
|
4086
|
+
const byte = data[index++];
|
|
4087
|
+
bytesRead++;
|
|
4088
|
+
if (bytesRead > MAX_BYTES_FOR_UINT32) throw new Error("LEB128 sequence exceeds maximum length for uint32");
|
|
4089
|
+
result |= (byte & DATA_BITS_MASK) << shift;
|
|
4090
|
+
if (!hasContinuationBit(byte)) return {
|
|
4091
|
+
value: result >>> 0,
|
|
4092
|
+
nextIndex: index
|
|
4093
|
+
};
|
|
4094
|
+
shift += DATA_BITS_PER_BYTE;
|
|
4095
|
+
}
|
|
4096
|
+
throw new Error("Truncated LEB128 encoding");
|
|
4097
|
+
}
|
|
4098
|
+
function validateUInt32(value) {
|
|
4099
|
+
if (!Number.isFinite(value)) throw new Error("Value must be a finite number");
|
|
4100
|
+
if (!Number.isInteger(value)) throw new Error("Value must be an integer");
|
|
4101
|
+
if (value < 0) throw new Error("Value must be non-negative");
|
|
4102
|
+
if (value > MAX_UINT32) throw new Error(`Value must not exceed ${MAX_UINT32} (MAX_UINT32)`);
|
|
4103
|
+
}
|
|
4104
|
+
function validateOffset(data, offset) {
|
|
4105
|
+
if (offset < 0 || offset >= data.length) throw new Error(`Offset ${offset} is out of bounds (buffer length: ${data.length})`);
|
|
4106
|
+
}
|
|
4107
|
+
function hasContinuationBit(byte) {
|
|
4108
|
+
return (byte & CONTINUATION_BIT) !== 0;
|
|
4109
|
+
}
|
|
4110
|
+
//#endregion
|
|
4111
|
+
//#region src/common/utils/base64.ts
|
|
4112
|
+
/**
|
|
4113
|
+
* Cross-runtime compatible base64 encoding/decoding utilities
|
|
4114
|
+
* that work in both Node.js and browser environments
|
|
4115
|
+
*/
|
|
4116
|
+
/**
|
|
4117
|
+
* Converts a base64 string to a Uint8Array
|
|
4118
|
+
*/
|
|
4119
|
+
function base64ToUint8Array(base64) {
|
|
4120
|
+
if (typeof atob === "function") {
|
|
4121
|
+
const binary = atob(base64);
|
|
4122
|
+
const bytes = new Uint8Array(binary.length);
|
|
4123
|
+
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
4124
|
+
return bytes;
|
|
4125
|
+
} else if (typeof Buffer !== "undefined") return new Uint8Array(Buffer.from(base64, "base64"));
|
|
4126
|
+
else throw new Error("No base64 decoding implementation available");
|
|
4127
|
+
}
|
|
4128
|
+
/**
|
|
4129
|
+
* Converts a Uint8Array to a base64 string
|
|
4130
|
+
*/
|
|
4131
|
+
function uint8ArrayToBase64(bytes) {
|
|
4132
|
+
if (typeof btoa === "function") {
|
|
4133
|
+
let binary = "";
|
|
4134
|
+
for (let i = 0; i < bytes.byteLength; i++) binary += String.fromCharCode(bytes[i]);
|
|
4135
|
+
return btoa(binary);
|
|
4136
|
+
} else if (typeof Buffer !== "undefined") return Buffer.from(bytes).toString("base64");
|
|
4137
|
+
else throw new Error("No base64 encoding implementation available");
|
|
4138
|
+
}
|
|
4139
|
+
//#endregion
|
|
4140
|
+
//#region src/vault/serializers/vault-key.serializer.ts
|
|
4141
|
+
const deserializeCreateDataKeyResponse = (key) => ({
|
|
4142
|
+
context: key.context,
|
|
4143
|
+
dataKey: {
|
|
4144
|
+
key: key.data_key,
|
|
4145
|
+
id: key.id
|
|
4146
|
+
},
|
|
4147
|
+
encryptedKeys: key.encrypted_keys
|
|
4148
|
+
});
|
|
4149
|
+
const deserializeDecryptDataKeyResponse = (key) => ({
|
|
4150
|
+
key: key.data_key,
|
|
4151
|
+
id: key.id
|
|
4152
|
+
});
|
|
4153
|
+
//#endregion
|
|
4154
|
+
//#region src/vault/serializers/vault-object.serializer.ts
|
|
4155
|
+
const deserializeObjectMetadata = (metadata) => ({
|
|
4156
|
+
context: metadata.context,
|
|
4157
|
+
environmentId: metadata.environment_id,
|
|
4158
|
+
id: metadata.id,
|
|
4159
|
+
keyId: metadata.key_id,
|
|
4160
|
+
updatedAt: new Date(Date.parse(metadata.updated_at)),
|
|
4161
|
+
updatedBy: metadata.updated_by,
|
|
4162
|
+
versionId: metadata.version_id
|
|
4163
|
+
});
|
|
4164
|
+
const deserializeObject = (object) => ({
|
|
4165
|
+
id: object.id,
|
|
4166
|
+
name: object.name,
|
|
4167
|
+
...object.value !== void 0 && { value: object.value },
|
|
4168
|
+
metadata: deserializeObjectMetadata(object.metadata)
|
|
4169
|
+
});
|
|
4170
|
+
const deserializeObjectDigest = (digest) => ({
|
|
4171
|
+
id: digest.id,
|
|
4172
|
+
name: digest.name,
|
|
4173
|
+
updatedAt: new Date(Date.parse(digest.updated_at))
|
|
4174
|
+
});
|
|
4175
|
+
const deserializeListObjects = (list) => ({
|
|
4176
|
+
object: "list",
|
|
4177
|
+
data: list.data.map(deserializeObjectDigest),
|
|
4178
|
+
listMetadata: {
|
|
4179
|
+
...list.list_metadata.after !== void 0 && { after: list.list_metadata.after },
|
|
4180
|
+
...list.list_metadata.before !== void 0 && { before: list.list_metadata.before }
|
|
4181
|
+
}
|
|
4182
|
+
});
|
|
4183
|
+
const desrializeListObjectVersions = (list) => list.data.map(deserializeObjectVersion);
|
|
4184
|
+
const deserializeObjectVersion = (version) => ({
|
|
4185
|
+
createdAt: new Date(Date.parse(version.created_at)),
|
|
4186
|
+
currentVersion: version.current_version,
|
|
4187
|
+
id: version.id
|
|
4188
|
+
});
|
|
4189
|
+
const serializeCreateObjectEntity = (options) => ({
|
|
4190
|
+
name: options.name,
|
|
4191
|
+
value: options.value,
|
|
4192
|
+
key_context: options.context
|
|
4193
|
+
});
|
|
4194
|
+
const serializeUpdateObjectEntity = (options) => ({
|
|
4195
|
+
value: options.value,
|
|
4196
|
+
version_check: options.versionCheck
|
|
4197
|
+
});
|
|
4198
|
+
//#endregion
|
|
4199
|
+
//#region src/vault/vault.ts
|
|
4200
|
+
var Vault = class {
|
|
4201
|
+
cryptoProvider;
|
|
4202
|
+
constructor(workos) {
|
|
4203
|
+
this.workos = workos;
|
|
4204
|
+
this.cryptoProvider = workos.getCryptoProvider();
|
|
4205
|
+
}
|
|
4206
|
+
decode(payload) {
|
|
4207
|
+
const inputData = base64ToUint8Array(payload);
|
|
4208
|
+
const iv = new Uint8Array(inputData.subarray(0, 12));
|
|
4209
|
+
const tag = new Uint8Array(inputData.subarray(12, 28));
|
|
4210
|
+
const { value: keyLen, nextIndex } = decodeUInt32(inputData, 28);
|
|
4211
|
+
return {
|
|
4212
|
+
iv,
|
|
4213
|
+
tag,
|
|
4214
|
+
keys: uint8ArrayToBase64(inputData.subarray(nextIndex, nextIndex + keyLen)),
|
|
4215
|
+
ciphertext: new Uint8Array(inputData.subarray(nextIndex + keyLen))
|
|
4216
|
+
};
|
|
4217
|
+
}
|
|
4218
|
+
async createObject(options) {
|
|
4219
|
+
const { data } = await this.workos.post(`/vault/v1/kv`, serializeCreateObjectEntity(options));
|
|
4220
|
+
return deserializeObjectMetadata(data);
|
|
4221
|
+
}
|
|
4222
|
+
async listObjects(options) {
|
|
4223
|
+
const url = new URL("/vault/v1/kv", this.workos.baseURL);
|
|
4224
|
+
if (options?.after) url.searchParams.set("after", options.after);
|
|
4225
|
+
if (options?.limit) url.searchParams.set("limit", options.limit.toString());
|
|
4226
|
+
const { data } = await this.workos.get(url.toString());
|
|
4227
|
+
return deserializeListObjects(data);
|
|
4228
|
+
}
|
|
4229
|
+
async listObjectVersions(options) {
|
|
4230
|
+
const { data } = await this.workos.get(`/vault/v1/kv/${encodeURIComponent(options.id)}/versions`);
|
|
4231
|
+
return desrializeListObjectVersions(data);
|
|
4232
|
+
}
|
|
4233
|
+
async readObject(options) {
|
|
4234
|
+
const { data } = await this.workos.get(`/vault/v1/kv/${encodeURIComponent(options.id)}`);
|
|
4235
|
+
return deserializeObject(data);
|
|
4236
|
+
}
|
|
4237
|
+
async readObjectByName(name) {
|
|
4238
|
+
const { data } = await this.workos.get(`/vault/v1/kv/name/${encodeURIComponent(name)}`);
|
|
4239
|
+
return deserializeObject(data);
|
|
4240
|
+
}
|
|
4241
|
+
async describeObject(options) {
|
|
4242
|
+
const { data } = await this.workos.get(`/vault/v1/kv/${encodeURIComponent(options.id)}/metadata`);
|
|
4243
|
+
return deserializeObject(data);
|
|
4244
|
+
}
|
|
4245
|
+
async updateObject(options) {
|
|
4246
|
+
const { data } = await this.workos.put(`/vault/v1/kv/${encodeURIComponent(options.id)}`, serializeUpdateObjectEntity(options));
|
|
4247
|
+
return deserializeObject(data);
|
|
4248
|
+
}
|
|
4249
|
+
async deleteObject(options) {
|
|
4250
|
+
return this.workos.delete(`/vault/v1/kv/${encodeURIComponent(options.id)}`);
|
|
4251
|
+
}
|
|
4252
|
+
async createDataKey(options) {
|
|
4253
|
+
const { data } = await this.workos.post(`/vault/v1/keys/data-key`, options);
|
|
4254
|
+
return deserializeCreateDataKeyResponse(data);
|
|
4255
|
+
}
|
|
4256
|
+
async decryptDataKey(options) {
|
|
4257
|
+
const { data } = await this.workos.post(`/vault/v1/keys/decrypt`, options);
|
|
4258
|
+
return deserializeDecryptDataKeyResponse(data);
|
|
4259
|
+
}
|
|
4260
|
+
async encrypt(data, context, associatedData) {
|
|
4261
|
+
const keyPair = await this.createDataKey({ context });
|
|
4262
|
+
const encoder = new TextEncoder();
|
|
4263
|
+
const key = base64ToUint8Array(keyPair.dataKey.key);
|
|
4264
|
+
const keyBlob = base64ToUint8Array(keyPair.encryptedKeys);
|
|
4265
|
+
const prefixLenBuffer = encodeUInt32(keyBlob.length);
|
|
4266
|
+
const aadBuffer = associatedData ? encoder.encode(associatedData) : void 0;
|
|
4267
|
+
const iv = this.cryptoProvider.randomBytes(12);
|
|
4268
|
+
const { ciphertext, iv: resultIv, tag } = await this.cryptoProvider.encrypt(encoder.encode(data), key, iv, aadBuffer);
|
|
4269
|
+
const resultArray = new Uint8Array(resultIv.length + tag.length + prefixLenBuffer.length + keyBlob.length + ciphertext.length);
|
|
4270
|
+
let offset = 0;
|
|
4271
|
+
resultArray.set(resultIv, offset);
|
|
4272
|
+
offset += resultIv.length;
|
|
4273
|
+
resultArray.set(tag, offset);
|
|
4274
|
+
offset += tag.length;
|
|
4275
|
+
resultArray.set(new Uint8Array(prefixLenBuffer), offset);
|
|
4276
|
+
offset += prefixLenBuffer.length;
|
|
4277
|
+
resultArray.set(keyBlob, offset);
|
|
4278
|
+
offset += keyBlob.length;
|
|
4279
|
+
resultArray.set(ciphertext, offset);
|
|
4280
|
+
return uint8ArrayToBase64(resultArray);
|
|
4281
|
+
}
|
|
4282
|
+
async decrypt(encryptedData, associatedData) {
|
|
4283
|
+
const decoded = this.decode(encryptedData);
|
|
4284
|
+
const key = base64ToUint8Array((await this.decryptDataKey({ keys: decoded.keys })).key);
|
|
4285
|
+
const encoder = new TextEncoder();
|
|
4286
|
+
const aadBuffer = associatedData ? encoder.encode(associatedData) : void 0;
|
|
4287
|
+
const decrypted = await this.cryptoProvider.decrypt(decoded.ciphertext, key, decoded.iv, decoded.tag, aadBuffer);
|
|
4288
|
+
return new TextDecoder().decode(decrypted);
|
|
4289
|
+
}
|
|
4290
|
+
};
|
|
4291
|
+
//#endregion
|
|
4292
|
+
//#region src/common/exceptions/conflict.exception.ts
|
|
4293
|
+
var ConflictException = class extends Error {
|
|
4294
|
+
status = 409;
|
|
4295
|
+
name = "ConflictException";
|
|
4296
|
+
requestID;
|
|
4297
|
+
constructor({ error, message, requestID }) {
|
|
4298
|
+
super();
|
|
4299
|
+
this.requestID = requestID;
|
|
4300
|
+
if (message) this.message = message;
|
|
4301
|
+
else if (error) this.message = `Error: ${error}`;
|
|
4302
|
+
else this.message = `An conflict has occurred on the server.`;
|
|
4303
|
+
}
|
|
4304
|
+
};
|
|
4305
|
+
//#endregion
|
|
4306
|
+
//#region src/common/utils/runtime-info.ts
|
|
4307
|
+
/**
|
|
4308
|
+
* Get runtime information including name and version.
|
|
4309
|
+
* Safely extracts version information for different JavaScript runtimes.
|
|
4310
|
+
* @returns RuntimeInfo object with name and optional version
|
|
4311
|
+
*/
|
|
4312
|
+
function getRuntimeInfo() {
|
|
4313
|
+
const name = detectRuntime();
|
|
4314
|
+
let version;
|
|
4315
|
+
try {
|
|
4316
|
+
switch (name) {
|
|
4317
|
+
case "node":
|
|
4318
|
+
version = typeof process !== "undefined" ? process.version : void 0;
|
|
4319
|
+
break;
|
|
4320
|
+
case "deno":
|
|
4321
|
+
version = globalThis.Deno?.version?.deno;
|
|
4322
|
+
break;
|
|
4323
|
+
case "bun":
|
|
4324
|
+
version = globalThis.Bun?.version || extractBunVersionFromUserAgent();
|
|
4325
|
+
break;
|
|
4326
|
+
default:
|
|
4327
|
+
version = void 0;
|
|
4328
|
+
break;
|
|
4329
|
+
}
|
|
4330
|
+
} catch {
|
|
4331
|
+
version = void 0;
|
|
4332
|
+
}
|
|
4333
|
+
return {
|
|
4334
|
+
name,
|
|
4335
|
+
version
|
|
4336
|
+
};
|
|
4337
|
+
}
|
|
4338
|
+
/**
|
|
4339
|
+
* Extract Bun version from navigator.userAgent as fallback.
|
|
4340
|
+
* @returns Bun version string or undefined
|
|
4341
|
+
*/
|
|
4342
|
+
function extractBunVersionFromUserAgent() {
|
|
4343
|
+
try {
|
|
4344
|
+
if (typeof navigator !== "undefined" && navigator.userAgent) return navigator.userAgent.match(/Bun\/(\d+\.\d+\.\d+)/)?.[1];
|
|
4345
|
+
} catch {}
|
|
4346
|
+
}
|
|
4347
|
+
//#endregion
|
|
4348
|
+
//#region package.json
|
|
4349
|
+
var version = "8.9.0";
|
|
4350
|
+
//#endregion
|
|
4351
|
+
//#region src/workos.ts
|
|
4352
|
+
const DEFAULT_HOSTNAME = "api.workos.com";
|
|
4353
|
+
const HEADER_AUTHORIZATION = "Authorization";
|
|
4354
|
+
const HEADER_IDEMPOTENCY_KEY = "Idempotency-Key";
|
|
4355
|
+
const HEADER_WARRANT_TOKEN = "Warrant-Token";
|
|
4356
|
+
var WorkOS = class {
|
|
4357
|
+
baseURL;
|
|
4358
|
+
client;
|
|
4359
|
+
clientId;
|
|
4360
|
+
key;
|
|
4361
|
+
options;
|
|
4362
|
+
pkce;
|
|
4363
|
+
hasApiKey;
|
|
4364
|
+
actions;
|
|
4365
|
+
apiKeys = new ApiKeys(this);
|
|
4366
|
+
auditLogs = new AuditLogs(this);
|
|
4367
|
+
authorization = new Authorization(this);
|
|
4368
|
+
directorySync = new DirectorySync(this);
|
|
4369
|
+
events = new Events(this);
|
|
4370
|
+
featureFlags = new FeatureFlags(this);
|
|
4371
|
+
fga = new FGA(this);
|
|
4372
|
+
mfa = new Mfa(this);
|
|
4373
|
+
organizations = new Organizations(this);
|
|
4374
|
+
organizationDomains = new OrganizationDomains(this);
|
|
4375
|
+
passwordless = new Passwordless(this);
|
|
4376
|
+
pipes = new Pipes(this);
|
|
4377
|
+
portal = new Portal(this);
|
|
4378
|
+
sso = new SSO(this);
|
|
4379
|
+
userManagement;
|
|
4380
|
+
vault = new Vault(this);
|
|
4381
|
+
webhooks;
|
|
4382
|
+
widgets = new Widgets(this);
|
|
4383
|
+
/**
|
|
4384
|
+
* Create a new WorkOS client.
|
|
4385
|
+
*
|
|
4386
|
+
* @param keyOrOptions - API key string, or options object
|
|
4387
|
+
* @param maybeOptions - Options when first argument is API key
|
|
4388
|
+
*
|
|
4389
|
+
* @example
|
|
4390
|
+
* // Server-side with API key (string)
|
|
4391
|
+
* const workos = new WorkOS('sk_...');
|
|
4392
|
+
*
|
|
4393
|
+
* @example
|
|
4394
|
+
* // Server-side with API key (object)
|
|
4395
|
+
* const workos = new WorkOS({ apiKey: 'sk_...', clientId: 'client_...' });
|
|
4396
|
+
*
|
|
4397
|
+
* @example
|
|
4398
|
+
* // PKCE/public client (no API key)
|
|
4399
|
+
* const workos = new WorkOS({ clientId: 'client_...' });
|
|
4400
|
+
*/
|
|
4401
|
+
constructor(keyOrOptions, maybeOptions) {
|
|
4402
|
+
if (typeof keyOrOptions === "object") {
|
|
4403
|
+
this.key = keyOrOptions.apiKey;
|
|
4404
|
+
this.options = keyOrOptions;
|
|
4405
|
+
} else {
|
|
4406
|
+
this.key = keyOrOptions;
|
|
4407
|
+
this.options = maybeOptions ?? {};
|
|
4408
|
+
}
|
|
4409
|
+
if (!this.key) this.key = getEnv("WORKOS_API_KEY");
|
|
4410
|
+
this.hasApiKey = !!this.key;
|
|
4411
|
+
if (this.options.https === void 0) this.options.https = true;
|
|
4412
|
+
this.clientId = this.options.clientId;
|
|
4413
|
+
if (!this.clientId) this.clientId = getEnv("WORKOS_CLIENT_ID");
|
|
4414
|
+
if (!this.hasApiKey && !this.clientId) throw new Error("WorkOS requires either an API key or a clientId. For server-side: new WorkOS(\"sk_...\") or new WorkOS({ apiKey: \"sk_...\" }). For PKCE/public clients: new WorkOS({ clientId: \"client_...\" })");
|
|
4415
|
+
const protocol = this.options.https ? "https" : "http";
|
|
4416
|
+
const apiHostname = this.options.apiHostname || DEFAULT_HOSTNAME;
|
|
4417
|
+
const port = this.options.port;
|
|
4418
|
+
this.baseURL = `${protocol}://${apiHostname}`;
|
|
4419
|
+
if (port) this.baseURL = this.baseURL + `:${port}`;
|
|
4420
|
+
this.pkce = new PKCE();
|
|
4421
|
+
this.webhooks = this.createWebhookClient();
|
|
4422
|
+
this.actions = this.createActionsClient();
|
|
4423
|
+
this.userManagement = new UserManagement(this);
|
|
4424
|
+
const userAgent = this.createUserAgent(this.options);
|
|
4425
|
+
this.client = this.createHttpClient(this.options, userAgent);
|
|
4426
|
+
}
|
|
4427
|
+
createUserAgent(options) {
|
|
4428
|
+
let userAgent = `workos-node/${version}`;
|
|
4429
|
+
const { name: runtimeName, version: runtimeVersion } = getRuntimeInfo();
|
|
4430
|
+
userAgent += ` (${runtimeName}${runtimeVersion ? `/${runtimeVersion}` : ""})`;
|
|
4431
|
+
if (options.appInfo) {
|
|
4432
|
+
const { name, version } = options.appInfo;
|
|
4433
|
+
userAgent += ` ${name}: ${version}`;
|
|
4434
|
+
}
|
|
4435
|
+
return userAgent;
|
|
4436
|
+
}
|
|
4437
|
+
createWebhookClient() {
|
|
4438
|
+
return new Webhooks(this.getCryptoProvider());
|
|
4439
|
+
}
|
|
4440
|
+
createActionsClient() {
|
|
4441
|
+
return new Actions(this.getCryptoProvider());
|
|
4442
|
+
}
|
|
4443
|
+
getCryptoProvider() {
|
|
4444
|
+
return new SubtleCryptoProvider();
|
|
4445
|
+
}
|
|
4446
|
+
createHttpClient(options, userAgent) {
|
|
4447
|
+
const headers = { "User-Agent": userAgent };
|
|
4448
|
+
const configHeaders = options.config?.headers;
|
|
4449
|
+
if (configHeaders && typeof configHeaders === "object" && !Array.isArray(configHeaders) && !(configHeaders instanceof Headers)) Object.assign(headers, configHeaders);
|
|
4450
|
+
if (this.key) headers["Authorization"] = `Bearer ${this.key}`;
|
|
4451
|
+
return new FetchHttpClient(this.baseURL, {
|
|
4452
|
+
...options.config,
|
|
4453
|
+
timeout: options.timeout,
|
|
4454
|
+
headers
|
|
4455
|
+
});
|
|
4456
|
+
}
|
|
4457
|
+
get version() {
|
|
4458
|
+
return version;
|
|
4459
|
+
}
|
|
4460
|
+
/**
|
|
4461
|
+
* Require API key for methods that need it.
|
|
4462
|
+
* @param methodName - Name of the method requiring API key (for error message)
|
|
4463
|
+
* @throws ApiKeyRequiredException if no API key was provided
|
|
4464
|
+
*/
|
|
4465
|
+
requireApiKey(methodName) {
|
|
4466
|
+
if (!this.hasApiKey) throw new ApiKeyRequiredException(methodName);
|
|
4467
|
+
}
|
|
4468
|
+
async post(path, entity, options = {}) {
|
|
4469
|
+
if (!options.skipApiKeyCheck) this.requireApiKey(path);
|
|
4470
|
+
const requestHeaders = {};
|
|
4471
|
+
if (options.idempotencyKey) requestHeaders[HEADER_IDEMPOTENCY_KEY] = options.idempotencyKey;
|
|
4472
|
+
if (options.warrantToken) requestHeaders[HEADER_WARRANT_TOKEN] = options.warrantToken;
|
|
4473
|
+
let res;
|
|
4474
|
+
try {
|
|
4475
|
+
res = await this.client.post(path, entity, {
|
|
4476
|
+
params: options.query,
|
|
4477
|
+
headers: requestHeaders
|
|
4478
|
+
});
|
|
4479
|
+
} catch (error) {
|
|
4480
|
+
this.handleHttpError({
|
|
4481
|
+
path,
|
|
4482
|
+
error
|
|
4483
|
+
});
|
|
4484
|
+
throw error;
|
|
4485
|
+
}
|
|
4486
|
+
try {
|
|
4487
|
+
return { data: await res.toJSON() };
|
|
4488
|
+
} catch (error) {
|
|
4489
|
+
await this.handleParseError(error, res);
|
|
4490
|
+
throw error;
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
async get(path, options = {}) {
|
|
4494
|
+
if (!options.skipApiKeyCheck) this.requireApiKey(path);
|
|
4495
|
+
const requestHeaders = {};
|
|
4496
|
+
if (options.accessToken) requestHeaders[HEADER_AUTHORIZATION] = `Bearer ${options.accessToken}`;
|
|
4497
|
+
if (options.warrantToken) requestHeaders[HEADER_WARRANT_TOKEN] = options.warrantToken;
|
|
4498
|
+
let res;
|
|
4499
|
+
try {
|
|
4500
|
+
res = await this.client.get(path, {
|
|
4501
|
+
params: options.query,
|
|
4502
|
+
headers: requestHeaders
|
|
4503
|
+
});
|
|
4504
|
+
} catch (error) {
|
|
4505
|
+
this.handleHttpError({
|
|
4506
|
+
path,
|
|
4507
|
+
error
|
|
4508
|
+
});
|
|
4509
|
+
throw error;
|
|
4510
|
+
}
|
|
4511
|
+
try {
|
|
4512
|
+
return { data: await res.toJSON() };
|
|
4513
|
+
} catch (error) {
|
|
4514
|
+
await this.handleParseError(error, res);
|
|
4515
|
+
throw error;
|
|
4516
|
+
}
|
|
4517
|
+
}
|
|
4518
|
+
async put(path, entity, options = {}) {
|
|
4519
|
+
if (!options.skipApiKeyCheck) this.requireApiKey(path);
|
|
4520
|
+
const requestHeaders = {};
|
|
4521
|
+
if (options.idempotencyKey) requestHeaders[HEADER_IDEMPOTENCY_KEY] = options.idempotencyKey;
|
|
4522
|
+
let res;
|
|
4523
|
+
try {
|
|
4524
|
+
res = await this.client.put(path, entity, {
|
|
4525
|
+
params: options.query,
|
|
4526
|
+
headers: requestHeaders
|
|
4527
|
+
});
|
|
4528
|
+
} catch (error) {
|
|
4529
|
+
this.handleHttpError({
|
|
4530
|
+
path,
|
|
4531
|
+
error
|
|
4532
|
+
});
|
|
4533
|
+
throw error;
|
|
4534
|
+
}
|
|
4535
|
+
try {
|
|
4536
|
+
return { data: await res.toJSON() };
|
|
4537
|
+
} catch (error) {
|
|
4538
|
+
await this.handleParseError(error, res);
|
|
4539
|
+
throw error;
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
async patch(path, entity, options = {}) {
|
|
4543
|
+
if (!options.skipApiKeyCheck) this.requireApiKey(path);
|
|
4544
|
+
const requestHeaders = {};
|
|
4545
|
+
if (options.idempotencyKey) requestHeaders[HEADER_IDEMPOTENCY_KEY] = options.idempotencyKey;
|
|
4546
|
+
let res;
|
|
4547
|
+
try {
|
|
4548
|
+
res = await this.client.patch(path, entity, {
|
|
4549
|
+
params: options.query,
|
|
4550
|
+
headers: requestHeaders
|
|
4551
|
+
});
|
|
4552
|
+
} catch (error) {
|
|
4553
|
+
this.handleHttpError({
|
|
4554
|
+
path,
|
|
4555
|
+
error
|
|
4556
|
+
});
|
|
4557
|
+
throw error;
|
|
4558
|
+
}
|
|
4559
|
+
try {
|
|
4560
|
+
return { data: await res.toJSON() };
|
|
4561
|
+
} catch (error) {
|
|
4562
|
+
await this.handleParseError(error, res);
|
|
4563
|
+
throw error;
|
|
4564
|
+
}
|
|
4565
|
+
}
|
|
4566
|
+
async delete(path, query) {
|
|
4567
|
+
this.requireApiKey(path);
|
|
4568
|
+
try {
|
|
4569
|
+
await this.client.delete(path, { params: query });
|
|
4570
|
+
} catch (error) {
|
|
4571
|
+
this.handleHttpError({
|
|
4572
|
+
path,
|
|
4573
|
+
error
|
|
4574
|
+
});
|
|
4575
|
+
throw error;
|
|
4576
|
+
}
|
|
4577
|
+
}
|
|
4578
|
+
async deleteWithBody(path, entity) {
|
|
4579
|
+
this.requireApiKey(path);
|
|
4580
|
+
try {
|
|
4581
|
+
await this.client.deleteWithBody(path, entity, {});
|
|
4582
|
+
} catch (error) {
|
|
4583
|
+
this.handleHttpError({
|
|
4584
|
+
path,
|
|
4585
|
+
error
|
|
4586
|
+
});
|
|
4587
|
+
throw error;
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
emitWarning(warning) {
|
|
4591
|
+
console.warn(`WorkOS: ${warning}`);
|
|
4592
|
+
}
|
|
4593
|
+
async handleParseError(error, res) {
|
|
4594
|
+
if (error instanceof SyntaxError) {
|
|
4595
|
+
const rawResponse = res.getRawResponse();
|
|
4596
|
+
const requestID = rawResponse.headers.get("X-Request-ID") ?? "";
|
|
4597
|
+
const rawStatus = rawResponse.status;
|
|
4598
|
+
const rawBody = await rawResponse.text();
|
|
4599
|
+
throw new ParseError({
|
|
4600
|
+
message: error.message,
|
|
4601
|
+
rawBody,
|
|
4602
|
+
rawStatus,
|
|
4603
|
+
requestID
|
|
4604
|
+
});
|
|
4605
|
+
}
|
|
4606
|
+
}
|
|
4607
|
+
handleHttpError({ path, error }) {
|
|
4608
|
+
if (!(error instanceof HttpClientError)) throw new Error(`Unexpected error: ${error}`, { cause: error });
|
|
4609
|
+
const { response } = error;
|
|
4610
|
+
if (response) {
|
|
4611
|
+
const { status, data, headers } = response;
|
|
4612
|
+
const requestID = headers["X-Request-ID"] ?? "";
|
|
4613
|
+
const { code, error_description: errorDescription, error, errors, message } = data;
|
|
4614
|
+
switch (status) {
|
|
4615
|
+
case 401: throw new UnauthorizedException(requestID);
|
|
4616
|
+
case 409: throw new ConflictException({
|
|
4617
|
+
requestID,
|
|
4618
|
+
message,
|
|
4619
|
+
error
|
|
4620
|
+
});
|
|
4621
|
+
case 422: throw new UnprocessableEntityException({
|
|
4622
|
+
code,
|
|
4623
|
+
errors,
|
|
4624
|
+
message,
|
|
4625
|
+
requestID
|
|
4626
|
+
});
|
|
4627
|
+
case 404: throw new NotFoundException({
|
|
4628
|
+
code,
|
|
4629
|
+
message,
|
|
4630
|
+
path,
|
|
4631
|
+
requestID
|
|
4632
|
+
});
|
|
4633
|
+
case 429: {
|
|
4634
|
+
const retryAfter = headers.get("Retry-After");
|
|
4635
|
+
throw new RateLimitExceededException(data.message, requestID, retryAfter ? Number(retryAfter) : null);
|
|
4636
|
+
}
|
|
4637
|
+
default: if (error || errorDescription) throw new OauthException(status, requestID, error, errorDescription, data);
|
|
4638
|
+
else if (code && errors) throw new BadRequestException({
|
|
4639
|
+
code,
|
|
4640
|
+
errors,
|
|
4641
|
+
message,
|
|
4642
|
+
requestID
|
|
4643
|
+
});
|
|
4644
|
+
else throw new GenericServerException(status, data.message, data, requestID);
|
|
4645
|
+
}
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
};
|
|
4649
|
+
//#endregion
|
|
4650
|
+
//#region src/organizations/interfaces/domain-data.interface.ts
|
|
4651
|
+
let DomainDataState = /* @__PURE__ */ function(DomainDataState) {
|
|
4652
|
+
DomainDataState["Verified"] = "verified";
|
|
4653
|
+
DomainDataState["Pending"] = "pending";
|
|
4654
|
+
return DomainDataState;
|
|
4655
|
+
}({});
|
|
4656
|
+
//#endregion
|
|
4657
|
+
//#region src/organization-domains/interfaces/organization-domain.interface.ts
|
|
4658
|
+
let OrganizationDomainState = /* @__PURE__ */ function(OrganizationDomainState) {
|
|
4659
|
+
OrganizationDomainState["Verified"] = "verified";
|
|
4660
|
+
OrganizationDomainState["Pending"] = "pending";
|
|
4661
|
+
OrganizationDomainState["Failed"] = "failed";
|
|
4662
|
+
return OrganizationDomainState;
|
|
4663
|
+
}({});
|
|
4664
|
+
let OrganizationDomainVerificationStrategy = /* @__PURE__ */ function(OrganizationDomainVerificationStrategy) {
|
|
4665
|
+
OrganizationDomainVerificationStrategy["Dns"] = "dns";
|
|
4666
|
+
OrganizationDomainVerificationStrategy["Manual"] = "manual";
|
|
4667
|
+
return OrganizationDomainVerificationStrategy;
|
|
4668
|
+
}({});
|
|
4669
|
+
//#endregion
|
|
4670
|
+
//#region src/portal/interfaces/generate-portal-link-intent.interface.ts
|
|
4671
|
+
let GeneratePortalLinkIntent = /* @__PURE__ */ function(GeneratePortalLinkIntent) {
|
|
4672
|
+
GeneratePortalLinkIntent["AuditLogs"] = "audit_logs";
|
|
4673
|
+
GeneratePortalLinkIntent["DomainVerification"] = "domain_verification";
|
|
4674
|
+
GeneratePortalLinkIntent["DSync"] = "dsync";
|
|
4675
|
+
GeneratePortalLinkIntent["LogStreams"] = "log_streams";
|
|
4676
|
+
GeneratePortalLinkIntent["SSO"] = "sso";
|
|
4677
|
+
GeneratePortalLinkIntent["CertificateRenewal"] = "certificate_renewal";
|
|
4678
|
+
GeneratePortalLinkIntent["BringYourOwnKey"] = "bring_your_own_key";
|
|
4679
|
+
return GeneratePortalLinkIntent;
|
|
4680
|
+
}({});
|
|
4681
|
+
//#endregion
|
|
4682
|
+
//#region src/sso/interfaces/connection-type.enum.ts
|
|
4683
|
+
let ConnectionType = /* @__PURE__ */ function(ConnectionType) {
|
|
4684
|
+
ConnectionType["ADFSSAML"] = "ADFSSAML";
|
|
4685
|
+
ConnectionType["AdpOidc"] = "AdpOidc";
|
|
4686
|
+
ConnectionType["AppleOAuth"] = "AppleOAuth";
|
|
4687
|
+
ConnectionType["Auth0SAML"] = "Auth0SAML";
|
|
4688
|
+
ConnectionType["AzureSAML"] = "AzureSAML";
|
|
4689
|
+
ConnectionType["CasSAML"] = "CasSAML";
|
|
4690
|
+
ConnectionType["ClassLinkSAML"] = "ClassLinkSAML";
|
|
4691
|
+
ConnectionType["CloudflareSAML"] = "CloudflareSAML";
|
|
4692
|
+
ConnectionType["CyberArkSAML"] = "CyberArkSAML";
|
|
4693
|
+
ConnectionType["DuoSAML"] = "DuoSAML";
|
|
4694
|
+
ConnectionType["GenericOIDC"] = "GenericOIDC";
|
|
4695
|
+
ConnectionType["GenericSAML"] = "GenericSAML";
|
|
4696
|
+
ConnectionType["GitHubOAuth"] = "GitHubOAuth";
|
|
4697
|
+
ConnectionType["GoogleOAuth"] = "GoogleOAuth";
|
|
4698
|
+
ConnectionType["GoogleSAML"] = "GoogleSAML";
|
|
4699
|
+
ConnectionType["JumpCloudSAML"] = "JumpCloudSAML";
|
|
4700
|
+
ConnectionType["KeycloakSAML"] = "KeycloakSAML";
|
|
4701
|
+
ConnectionType["LastPassSAML"] = "LastPassSAML";
|
|
4702
|
+
ConnectionType["LoginGovOidc"] = "LoginGovOidc";
|
|
4703
|
+
ConnectionType["MagicLink"] = "MagicLink";
|
|
4704
|
+
ConnectionType["MicrosoftOAuth"] = "MicrosoftOAuth";
|
|
4705
|
+
ConnectionType["MiniOrangeSAML"] = "MiniOrangeSAML";
|
|
4706
|
+
ConnectionType["NetIqSAML"] = "NetIqSAML";
|
|
4707
|
+
ConnectionType["OktaSAML"] = "OktaSAML";
|
|
4708
|
+
ConnectionType["OneLoginSAML"] = "OneLoginSAML";
|
|
4709
|
+
ConnectionType["OracleSAML"] = "OracleSAML";
|
|
4710
|
+
ConnectionType["PingFederateSAML"] = "PingFederateSAML";
|
|
4711
|
+
ConnectionType["PingOneSAML"] = "PingOneSAML";
|
|
4712
|
+
ConnectionType["RipplingSAML"] = "RipplingSAML";
|
|
4713
|
+
ConnectionType["SalesforceOAuth"] = "SalesforceOAuth";
|
|
4714
|
+
ConnectionType["SalesforceSAML"] = "SalesforceSAML";
|
|
4715
|
+
ConnectionType["ShibbolethGenericSAML"] = "ShibbolethGenericSAML";
|
|
4716
|
+
ConnectionType["ShibbolethSAML"] = "ShibbolethSAML";
|
|
4717
|
+
ConnectionType["SimpleSamlPhpSAML"] = "SimpleSamlPhpSAML";
|
|
4718
|
+
ConnectionType["VMwareSAML"] = "VMwareSAML";
|
|
4719
|
+
return ConnectionType;
|
|
4720
|
+
}({});
|
|
4721
|
+
//#endregion
|
|
4722
|
+
//#region src/factory.ts
|
|
4723
|
+
function createWorkOS(options) {
|
|
4724
|
+
return new WorkOS(options);
|
|
4725
|
+
}
|
|
4726
|
+
//#endregion
|
|
4727
|
+
export { FetchHttpClient as A, RateLimitExceededException as C, BadRequestException as D, NoApiKeyProvidedException as E, GenericServerException as O, SignatureVerificationException as S, NotFoundException as T, PKCE as _, OrganizationDomainVerificationStrategy as a, UnprocessableEntityException as b, WarrantOp as c, CheckOp as d, CookieSession as f, AutoPaginatable as g, AuthenticateWithSessionCookieFailureReason as h, OrganizationDomainState as i, SubtleCryptoProvider as j, ApiKeyRequiredException as k, ResourceOp as l, serializeRevokeSessionOptions as m, ConnectionType as n, DomainDataState as o, RefreshSessionFailureReason as p, GeneratePortalLinkIntent as r, WorkOS as s, createWorkOS as t, CheckResult as u, Webhooks as v, OauthException as w, UnauthorizedException as x, Actions as y };
|
|
4728
|
+
|
|
4729
|
+
//# sourceMappingURL=factory-ClnPnWTz.mjs.map
|