@unkey/api 2.3.2 → 2.3.4
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/FUNCTIONS.md +2 -2
- package/README.md +13 -6
- package/dist/commonjs/funcs/analyticsGetVerifications.d.ts +2 -0
- package/dist/commonjs/funcs/analyticsGetVerifications.d.ts.map +1 -1
- package/dist/commonjs/funcs/analyticsGetVerifications.js +5 -13
- package/dist/commonjs/funcs/analyticsGetVerifications.js.map +1 -1
- package/dist/commonjs/funcs/apisCreateApi.d.ts +2 -0
- package/dist/commonjs/funcs/apisCreateApi.d.ts.map +1 -1
- package/dist/commonjs/funcs/apisCreateApi.js +5 -2
- package/dist/commonjs/funcs/apisCreateApi.js.map +1 -1
- package/dist/commonjs/funcs/apisDeleteApi.d.ts +2 -0
- package/dist/commonjs/funcs/apisDeleteApi.d.ts.map +1 -1
- package/dist/commonjs/funcs/apisDeleteApi.js +5 -2
- package/dist/commonjs/funcs/apisDeleteApi.js.map +1 -1
- package/dist/commonjs/funcs/apisGetApi.d.ts +2 -0
- package/dist/commonjs/funcs/apisGetApi.d.ts.map +1 -1
- package/dist/commonjs/funcs/apisGetApi.js +5 -2
- package/dist/commonjs/funcs/apisGetApi.js.map +1 -1
- package/dist/commonjs/funcs/apisListKeys.d.ts +2 -0
- package/dist/commonjs/funcs/apisListKeys.d.ts.map +1 -1
- package/dist/commonjs/funcs/apisListKeys.js +5 -2
- package/dist/commonjs/funcs/apisListKeys.js.map +1 -1
- package/dist/commonjs/funcs/identitiesCreateIdentity.d.ts +2 -0
- package/dist/commonjs/funcs/identitiesCreateIdentity.d.ts.map +1 -1
- package/dist/commonjs/funcs/identitiesCreateIdentity.js +5 -2
- package/dist/commonjs/funcs/identitiesCreateIdentity.js.map +1 -1
- package/dist/commonjs/funcs/identitiesDeleteIdentity.d.ts +2 -0
- package/dist/commonjs/funcs/identitiesDeleteIdentity.d.ts.map +1 -1
- package/dist/commonjs/funcs/identitiesDeleteIdentity.js +5 -2
- package/dist/commonjs/funcs/identitiesDeleteIdentity.js.map +1 -1
- package/dist/commonjs/funcs/identitiesGetIdentity.d.ts +2 -0
- package/dist/commonjs/funcs/identitiesGetIdentity.d.ts.map +1 -1
- package/dist/commonjs/funcs/identitiesGetIdentity.js +5 -2
- package/dist/commonjs/funcs/identitiesGetIdentity.js.map +1 -1
- package/dist/commonjs/funcs/identitiesListIdentities.d.ts +2 -0
- package/dist/commonjs/funcs/identitiesListIdentities.d.ts.map +1 -1
- package/dist/commonjs/funcs/identitiesListIdentities.js +5 -2
- package/dist/commonjs/funcs/identitiesListIdentities.js.map +1 -1
- package/dist/commonjs/funcs/identitiesUpdateIdentity.d.ts +2 -0
- package/dist/commonjs/funcs/identitiesUpdateIdentity.d.ts.map +1 -1
- package/dist/commonjs/funcs/identitiesUpdateIdentity.js +5 -2
- package/dist/commonjs/funcs/identitiesUpdateIdentity.js.map +1 -1
- package/dist/commonjs/funcs/internalCreateDeployment.d.ts +2 -0
- package/dist/commonjs/funcs/internalCreateDeployment.d.ts.map +1 -1
- package/dist/commonjs/funcs/internalCreateDeployment.js +5 -2
- package/dist/commonjs/funcs/internalCreateDeployment.js.map +1 -1
- package/dist/commonjs/funcs/internalGetDeployment.d.ts +2 -0
- package/dist/commonjs/funcs/internalGetDeployment.d.ts.map +1 -1
- package/dist/commonjs/funcs/internalGetDeployment.js +5 -2
- package/dist/commonjs/funcs/internalGetDeployment.js.map +1 -1
- package/dist/commonjs/funcs/keysAddPermissions.d.ts +2 -0
- package/dist/commonjs/funcs/keysAddPermissions.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysAddPermissions.js +5 -2
- package/dist/commonjs/funcs/keysAddPermissions.js.map +1 -1
- package/dist/commonjs/funcs/keysAddRoles.d.ts +2 -0
- package/dist/commonjs/funcs/keysAddRoles.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysAddRoles.js +5 -2
- package/dist/commonjs/funcs/keysAddRoles.js.map +1 -1
- package/dist/commonjs/funcs/keysCreateKey.d.ts +2 -0
- package/dist/commonjs/funcs/keysCreateKey.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysCreateKey.js +5 -2
- package/dist/commonjs/funcs/keysCreateKey.js.map +1 -1
- package/dist/commonjs/funcs/keysDeleteKey.d.ts +2 -0
- package/dist/commonjs/funcs/keysDeleteKey.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysDeleteKey.js +5 -2
- package/dist/commonjs/funcs/keysDeleteKey.js.map +1 -1
- package/dist/commonjs/funcs/keysGetKey.d.ts +2 -0
- package/dist/commonjs/funcs/keysGetKey.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysGetKey.js +5 -2
- package/dist/commonjs/funcs/keysGetKey.js.map +1 -1
- package/dist/commonjs/funcs/keysMigrateKeys.d.ts +2 -0
- package/dist/commonjs/funcs/keysMigrateKeys.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysMigrateKeys.js +5 -2
- package/dist/commonjs/funcs/keysMigrateKeys.js.map +1 -1
- package/dist/commonjs/funcs/keysRemovePermissions.d.ts +2 -0
- package/dist/commonjs/funcs/keysRemovePermissions.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysRemovePermissions.js +5 -2
- package/dist/commonjs/funcs/keysRemovePermissions.js.map +1 -1
- package/dist/commonjs/funcs/keysRemoveRoles.d.ts +2 -0
- package/dist/commonjs/funcs/keysRemoveRoles.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysRemoveRoles.js +5 -2
- package/dist/commonjs/funcs/keysRemoveRoles.js.map +1 -1
- package/dist/commonjs/funcs/keysRerollKey.d.ts +2 -0
- package/dist/commonjs/funcs/keysRerollKey.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysRerollKey.js +5 -2
- package/dist/commonjs/funcs/keysRerollKey.js.map +1 -1
- package/dist/commonjs/funcs/keysSetPermissions.d.ts +2 -0
- package/dist/commonjs/funcs/keysSetPermissions.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysSetPermissions.js +5 -2
- package/dist/commonjs/funcs/keysSetPermissions.js.map +1 -1
- package/dist/commonjs/funcs/keysSetRoles.d.ts +2 -0
- package/dist/commonjs/funcs/keysSetRoles.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysSetRoles.js +5 -2
- package/dist/commonjs/funcs/keysSetRoles.js.map +1 -1
- package/dist/commonjs/funcs/keysUpdateCredits.d.ts +2 -0
- package/dist/commonjs/funcs/keysUpdateCredits.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysUpdateCredits.js +5 -2
- package/dist/commonjs/funcs/keysUpdateCredits.js.map +1 -1
- package/dist/commonjs/funcs/keysUpdateKey.d.ts +2 -0
- package/dist/commonjs/funcs/keysUpdateKey.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysUpdateKey.js +5 -2
- package/dist/commonjs/funcs/keysUpdateKey.js.map +1 -1
- package/dist/commonjs/funcs/keysVerifyKey.d.ts +2 -0
- package/dist/commonjs/funcs/keysVerifyKey.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysVerifyKey.js +5 -2
- package/dist/commonjs/funcs/keysVerifyKey.js.map +1 -1
- package/dist/commonjs/funcs/keysWhoami.d.ts +2 -0
- package/dist/commonjs/funcs/keysWhoami.d.ts.map +1 -1
- package/dist/commonjs/funcs/keysWhoami.js +5 -2
- package/dist/commonjs/funcs/keysWhoami.js.map +1 -1
- package/dist/commonjs/funcs/permissionsCreatePermission.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsCreatePermission.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsCreatePermission.js +5 -2
- package/dist/commonjs/funcs/permissionsCreatePermission.js.map +1 -1
- package/dist/commonjs/funcs/permissionsCreateRole.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsCreateRole.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsCreateRole.js +5 -2
- package/dist/commonjs/funcs/permissionsCreateRole.js.map +1 -1
- package/dist/commonjs/funcs/permissionsDeletePermission.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsDeletePermission.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsDeletePermission.js +5 -2
- package/dist/commonjs/funcs/permissionsDeletePermission.js.map +1 -1
- package/dist/commonjs/funcs/permissionsDeleteRole.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsDeleteRole.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsDeleteRole.js +5 -2
- package/dist/commonjs/funcs/permissionsDeleteRole.js.map +1 -1
- package/dist/commonjs/funcs/permissionsGetPermission.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsGetPermission.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsGetPermission.js +5 -2
- package/dist/commonjs/funcs/permissionsGetPermission.js.map +1 -1
- package/dist/commonjs/funcs/permissionsGetRole.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsGetRole.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsGetRole.js +5 -2
- package/dist/commonjs/funcs/permissionsGetRole.js.map +1 -1
- package/dist/commonjs/funcs/permissionsListPermissions.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsListPermissions.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsListPermissions.js +5 -2
- package/dist/commonjs/funcs/permissionsListPermissions.js.map +1 -1
- package/dist/commonjs/funcs/permissionsListRoles.d.ts +2 -0
- package/dist/commonjs/funcs/permissionsListRoles.d.ts.map +1 -1
- package/dist/commonjs/funcs/permissionsListRoles.js +5 -2
- package/dist/commonjs/funcs/permissionsListRoles.js.map +1 -1
- package/dist/commonjs/funcs/portalCreateSession.d.ts +29 -0
- package/dist/commonjs/funcs/portalCreateSession.d.ts.map +1 -0
- package/dist/commonjs/funcs/portalCreateSession.js +145 -0
- package/dist/commonjs/funcs/portalCreateSession.js.map +1 -0
- package/dist/commonjs/funcs/portalExchangeSession.d.ts +25 -0
- package/dist/commonjs/funcs/portalExchangeSession.d.ts.map +1 -0
- package/dist/commonjs/funcs/portalExchangeSession.js +136 -0
- package/dist/commonjs/funcs/portalExchangeSession.js.map +1 -0
- package/dist/commonjs/funcs/ratelimitDeleteOverride.d.ts +2 -0
- package/dist/commonjs/funcs/ratelimitDeleteOverride.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitDeleteOverride.js +5 -2
- package/dist/commonjs/funcs/ratelimitDeleteOverride.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitGetOverride.d.ts +2 -0
- package/dist/commonjs/funcs/ratelimitGetOverride.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitGetOverride.js +5 -2
- package/dist/commonjs/funcs/ratelimitGetOverride.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.d.ts +2 -0
- package/dist/commonjs/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.js +5 -2
- package/dist/commonjs/funcs/ratelimitLimit.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitListOverrides.d.ts +2 -0
- package/dist/commonjs/funcs/ratelimitListOverrides.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitListOverrides.js +5 -2
- package/dist/commonjs/funcs/ratelimitListOverrides.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitMultiLimit.d.ts +2 -0
- package/dist/commonjs/funcs/ratelimitMultiLimit.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitMultiLimit.js +5 -2
- package/dist/commonjs/funcs/ratelimitMultiLimit.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitSetOverride.d.ts +2 -0
- package/dist/commonjs/funcs/ratelimitSetOverride.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitSetOverride.js +5 -2
- package/dist/commonjs/funcs/ratelimitSetOverride.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/encodings.d.ts +1 -0
- package/dist/commonjs/lib/encodings.d.ts.map +1 -1
- package/dist/commonjs/lib/encodings.js +27 -5
- package/dist/commonjs/lib/encodings.js.map +1 -1
- package/dist/commonjs/lib/sdks.d.ts +1 -1
- package/dist/commonjs/lib/sdks.d.ts.map +1 -1
- package/dist/commonjs/lib/sdks.js +10 -8
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +19 -8
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/lib/url.d.ts.map +1 -1
- package/dist/commonjs/lib/url.js +4 -2
- package/dist/commonjs/lib/url.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +6 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +6 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/v2deploygetdeploymentresponsedata.d.ts +3 -0
- package/dist/commonjs/models/components/v2deploygetdeploymentresponsedata.d.ts.map +1 -1
- package/dist/commonjs/models/components/v2deploygetdeploymentresponsedata.js +3 -0
- package/dist/commonjs/models/components/v2deploygetdeploymentresponsedata.js.map +1 -1
- package/dist/commonjs/models/components/v2portalcreatesessionrequestbody.d.ts +49 -0
- package/dist/commonjs/models/components/v2portalcreatesessionrequestbody.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2portalcreatesessionrequestbody.js +52 -0
- package/dist/commonjs/models/components/v2portalcreatesessionrequestbody.js.map +1 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsebody.d.ts +16 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsebody.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsebody.js +53 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsebody.js.map +1 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsedata.d.ts +21 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsedata.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsedata.js +51 -0
- package/dist/commonjs/models/components/v2portalcreatesessionresponsedata.js.map +1 -0
- package/dist/commonjs/models/components/v2portalexchangesessionrequestbody.d.ts +18 -0
- package/dist/commonjs/models/components/v2portalexchangesessionrequestbody.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2portalexchangesessionrequestbody.js +49 -0
- package/dist/commonjs/models/components/v2portalexchangesessionrequestbody.js.map +1 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsebody.d.ts +16 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsebody.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsebody.js +53 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsebody.js.map +1 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsedata.d.ts +21 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsedata.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsedata.js +51 -0
- package/dist/commonjs/models/components/v2portalexchangesessionresponsedata.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/portalcreatesession.d.ts +14 -0
- package/dist/commonjs/models/operations/portalcreatesession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/portalcreatesession.js +58 -0
- package/dist/commonjs/models/operations/portalcreatesession.js.map +1 -0
- package/dist/commonjs/models/operations/portalexchangesession.d.ts +14 -0
- package/dist/commonjs/models/operations/portalexchangesession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/portalexchangesession.js +58 -0
- package/dist/commonjs/models/operations/portalexchangesession.js.map +1 -0
- package/dist/commonjs/sdk/portal.d.ts +34 -0
- package/dist/commonjs/sdk/portal.d.ts.map +1 -0
- package/dist/commonjs/sdk/portal.js +46 -0
- package/dist/commonjs/sdk/portal.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/analyticsGetVerifications.d.ts +2 -0
- package/dist/esm/funcs/analyticsGetVerifications.d.ts.map +1 -1
- package/dist/esm/funcs/analyticsGetVerifications.js +5 -13
- package/dist/esm/funcs/analyticsGetVerifications.js.map +1 -1
- package/dist/esm/funcs/apisCreateApi.d.ts +2 -0
- package/dist/esm/funcs/apisCreateApi.d.ts.map +1 -1
- package/dist/esm/funcs/apisCreateApi.js +5 -2
- package/dist/esm/funcs/apisCreateApi.js.map +1 -1
- package/dist/esm/funcs/apisDeleteApi.d.ts +2 -0
- package/dist/esm/funcs/apisDeleteApi.d.ts.map +1 -1
- package/dist/esm/funcs/apisDeleteApi.js +5 -2
- package/dist/esm/funcs/apisDeleteApi.js.map +1 -1
- package/dist/esm/funcs/apisGetApi.d.ts +2 -0
- package/dist/esm/funcs/apisGetApi.d.ts.map +1 -1
- package/dist/esm/funcs/apisGetApi.js +5 -2
- package/dist/esm/funcs/apisGetApi.js.map +1 -1
- package/dist/esm/funcs/apisListKeys.d.ts +2 -0
- package/dist/esm/funcs/apisListKeys.d.ts.map +1 -1
- package/dist/esm/funcs/apisListKeys.js +5 -2
- package/dist/esm/funcs/apisListKeys.js.map +1 -1
- package/dist/esm/funcs/identitiesCreateIdentity.d.ts +2 -0
- package/dist/esm/funcs/identitiesCreateIdentity.d.ts.map +1 -1
- package/dist/esm/funcs/identitiesCreateIdentity.js +5 -2
- package/dist/esm/funcs/identitiesCreateIdentity.js.map +1 -1
- package/dist/esm/funcs/identitiesDeleteIdentity.d.ts +2 -0
- package/dist/esm/funcs/identitiesDeleteIdentity.d.ts.map +1 -1
- package/dist/esm/funcs/identitiesDeleteIdentity.js +5 -2
- package/dist/esm/funcs/identitiesDeleteIdentity.js.map +1 -1
- package/dist/esm/funcs/identitiesGetIdentity.d.ts +2 -0
- package/dist/esm/funcs/identitiesGetIdentity.d.ts.map +1 -1
- package/dist/esm/funcs/identitiesGetIdentity.js +5 -2
- package/dist/esm/funcs/identitiesGetIdentity.js.map +1 -1
- package/dist/esm/funcs/identitiesListIdentities.d.ts +2 -0
- package/dist/esm/funcs/identitiesListIdentities.d.ts.map +1 -1
- package/dist/esm/funcs/identitiesListIdentities.js +5 -2
- package/dist/esm/funcs/identitiesListIdentities.js.map +1 -1
- package/dist/esm/funcs/identitiesUpdateIdentity.d.ts +2 -0
- package/dist/esm/funcs/identitiesUpdateIdentity.d.ts.map +1 -1
- package/dist/esm/funcs/identitiesUpdateIdentity.js +5 -2
- package/dist/esm/funcs/identitiesUpdateIdentity.js.map +1 -1
- package/dist/esm/funcs/internalCreateDeployment.d.ts +2 -0
- package/dist/esm/funcs/internalCreateDeployment.d.ts.map +1 -1
- package/dist/esm/funcs/internalCreateDeployment.js +5 -2
- package/dist/esm/funcs/internalCreateDeployment.js.map +1 -1
- package/dist/esm/funcs/internalGetDeployment.d.ts +2 -0
- package/dist/esm/funcs/internalGetDeployment.d.ts.map +1 -1
- package/dist/esm/funcs/internalGetDeployment.js +5 -2
- package/dist/esm/funcs/internalGetDeployment.js.map +1 -1
- package/dist/esm/funcs/keysAddPermissions.d.ts +2 -0
- package/dist/esm/funcs/keysAddPermissions.d.ts.map +1 -1
- package/dist/esm/funcs/keysAddPermissions.js +5 -2
- package/dist/esm/funcs/keysAddPermissions.js.map +1 -1
- package/dist/esm/funcs/keysAddRoles.d.ts +2 -0
- package/dist/esm/funcs/keysAddRoles.d.ts.map +1 -1
- package/dist/esm/funcs/keysAddRoles.js +5 -2
- package/dist/esm/funcs/keysAddRoles.js.map +1 -1
- package/dist/esm/funcs/keysCreateKey.d.ts +2 -0
- package/dist/esm/funcs/keysCreateKey.d.ts.map +1 -1
- package/dist/esm/funcs/keysCreateKey.js +5 -2
- package/dist/esm/funcs/keysCreateKey.js.map +1 -1
- package/dist/esm/funcs/keysDeleteKey.d.ts +2 -0
- package/dist/esm/funcs/keysDeleteKey.d.ts.map +1 -1
- package/dist/esm/funcs/keysDeleteKey.js +5 -2
- package/dist/esm/funcs/keysDeleteKey.js.map +1 -1
- package/dist/esm/funcs/keysGetKey.d.ts +2 -0
- package/dist/esm/funcs/keysGetKey.d.ts.map +1 -1
- package/dist/esm/funcs/keysGetKey.js +5 -2
- package/dist/esm/funcs/keysGetKey.js.map +1 -1
- package/dist/esm/funcs/keysMigrateKeys.d.ts +2 -0
- package/dist/esm/funcs/keysMigrateKeys.d.ts.map +1 -1
- package/dist/esm/funcs/keysMigrateKeys.js +5 -2
- package/dist/esm/funcs/keysMigrateKeys.js.map +1 -1
- package/dist/esm/funcs/keysRemovePermissions.d.ts +2 -0
- package/dist/esm/funcs/keysRemovePermissions.d.ts.map +1 -1
- package/dist/esm/funcs/keysRemovePermissions.js +5 -2
- package/dist/esm/funcs/keysRemovePermissions.js.map +1 -1
- package/dist/esm/funcs/keysRemoveRoles.d.ts +2 -0
- package/dist/esm/funcs/keysRemoveRoles.d.ts.map +1 -1
- package/dist/esm/funcs/keysRemoveRoles.js +5 -2
- package/dist/esm/funcs/keysRemoveRoles.js.map +1 -1
- package/dist/esm/funcs/keysRerollKey.d.ts +2 -0
- package/dist/esm/funcs/keysRerollKey.d.ts.map +1 -1
- package/dist/esm/funcs/keysRerollKey.js +5 -2
- package/dist/esm/funcs/keysRerollKey.js.map +1 -1
- package/dist/esm/funcs/keysSetPermissions.d.ts +2 -0
- package/dist/esm/funcs/keysSetPermissions.d.ts.map +1 -1
- package/dist/esm/funcs/keysSetPermissions.js +5 -2
- package/dist/esm/funcs/keysSetPermissions.js.map +1 -1
- package/dist/esm/funcs/keysSetRoles.d.ts +2 -0
- package/dist/esm/funcs/keysSetRoles.d.ts.map +1 -1
- package/dist/esm/funcs/keysSetRoles.js +5 -2
- package/dist/esm/funcs/keysSetRoles.js.map +1 -1
- package/dist/esm/funcs/keysUpdateCredits.d.ts +2 -0
- package/dist/esm/funcs/keysUpdateCredits.d.ts.map +1 -1
- package/dist/esm/funcs/keysUpdateCredits.js +5 -2
- package/dist/esm/funcs/keysUpdateCredits.js.map +1 -1
- package/dist/esm/funcs/keysUpdateKey.d.ts +2 -0
- package/dist/esm/funcs/keysUpdateKey.d.ts.map +1 -1
- package/dist/esm/funcs/keysUpdateKey.js +5 -2
- package/dist/esm/funcs/keysUpdateKey.js.map +1 -1
- package/dist/esm/funcs/keysVerifyKey.d.ts +2 -0
- package/dist/esm/funcs/keysVerifyKey.d.ts.map +1 -1
- package/dist/esm/funcs/keysVerifyKey.js +5 -2
- package/dist/esm/funcs/keysVerifyKey.js.map +1 -1
- package/dist/esm/funcs/keysWhoami.d.ts +2 -0
- package/dist/esm/funcs/keysWhoami.d.ts.map +1 -1
- package/dist/esm/funcs/keysWhoami.js +5 -2
- package/dist/esm/funcs/keysWhoami.js.map +1 -1
- package/dist/esm/funcs/permissionsCreatePermission.d.ts +2 -0
- package/dist/esm/funcs/permissionsCreatePermission.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsCreatePermission.js +5 -2
- package/dist/esm/funcs/permissionsCreatePermission.js.map +1 -1
- package/dist/esm/funcs/permissionsCreateRole.d.ts +2 -0
- package/dist/esm/funcs/permissionsCreateRole.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsCreateRole.js +5 -2
- package/dist/esm/funcs/permissionsCreateRole.js.map +1 -1
- package/dist/esm/funcs/permissionsDeletePermission.d.ts +2 -0
- package/dist/esm/funcs/permissionsDeletePermission.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsDeletePermission.js +5 -2
- package/dist/esm/funcs/permissionsDeletePermission.js.map +1 -1
- package/dist/esm/funcs/permissionsDeleteRole.d.ts +2 -0
- package/dist/esm/funcs/permissionsDeleteRole.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsDeleteRole.js +5 -2
- package/dist/esm/funcs/permissionsDeleteRole.js.map +1 -1
- package/dist/esm/funcs/permissionsGetPermission.d.ts +2 -0
- package/dist/esm/funcs/permissionsGetPermission.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsGetPermission.js +5 -2
- package/dist/esm/funcs/permissionsGetPermission.js.map +1 -1
- package/dist/esm/funcs/permissionsGetRole.d.ts +2 -0
- package/dist/esm/funcs/permissionsGetRole.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsGetRole.js +5 -2
- package/dist/esm/funcs/permissionsGetRole.js.map +1 -1
- package/dist/esm/funcs/permissionsListPermissions.d.ts +2 -0
- package/dist/esm/funcs/permissionsListPermissions.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsListPermissions.js +5 -2
- package/dist/esm/funcs/permissionsListPermissions.js.map +1 -1
- package/dist/esm/funcs/permissionsListRoles.d.ts +2 -0
- package/dist/esm/funcs/permissionsListRoles.d.ts.map +1 -1
- package/dist/esm/funcs/permissionsListRoles.js +5 -2
- package/dist/esm/funcs/permissionsListRoles.js.map +1 -1
- package/dist/esm/funcs/portalCreateSession.d.ts +29 -0
- package/dist/esm/funcs/portalCreateSession.d.ts.map +1 -0
- package/dist/esm/funcs/portalCreateSession.js +109 -0
- package/dist/esm/funcs/portalCreateSession.js.map +1 -0
- package/dist/esm/funcs/portalExchangeSession.d.ts +25 -0
- package/dist/esm/funcs/portalExchangeSession.d.ts.map +1 -0
- package/dist/esm/funcs/portalExchangeSession.js +100 -0
- package/dist/esm/funcs/portalExchangeSession.js.map +1 -0
- package/dist/esm/funcs/ratelimitDeleteOverride.d.ts +2 -0
- package/dist/esm/funcs/ratelimitDeleteOverride.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitDeleteOverride.js +5 -2
- package/dist/esm/funcs/ratelimitDeleteOverride.js.map +1 -1
- package/dist/esm/funcs/ratelimitGetOverride.d.ts +2 -0
- package/dist/esm/funcs/ratelimitGetOverride.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitGetOverride.js +5 -2
- package/dist/esm/funcs/ratelimitGetOverride.js.map +1 -1
- package/dist/esm/funcs/ratelimitLimit.d.ts +2 -0
- package/dist/esm/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitLimit.js +5 -2
- package/dist/esm/funcs/ratelimitLimit.js.map +1 -1
- package/dist/esm/funcs/ratelimitListOverrides.d.ts +2 -0
- package/dist/esm/funcs/ratelimitListOverrides.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitListOverrides.js +5 -2
- package/dist/esm/funcs/ratelimitListOverrides.js.map +1 -1
- package/dist/esm/funcs/ratelimitMultiLimit.d.ts +2 -0
- package/dist/esm/funcs/ratelimitMultiLimit.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitMultiLimit.js +5 -2
- package/dist/esm/funcs/ratelimitMultiLimit.js.map +1 -1
- package/dist/esm/funcs/ratelimitSetOverride.d.ts +2 -0
- package/dist/esm/funcs/ratelimitSetOverride.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitSetOverride.js +5 -2
- package/dist/esm/funcs/ratelimitSetOverride.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/encodings.d.ts +1 -0
- package/dist/esm/lib/encodings.d.ts.map +1 -1
- package/dist/esm/lib/encodings.js +26 -5
- package/dist/esm/lib/encodings.js.map +1 -1
- package/dist/esm/lib/sdks.d.ts +1 -1
- package/dist/esm/lib/sdks.d.ts.map +1 -1
- package/dist/esm/lib/sdks.js +11 -9
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/lib/security.d.ts +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +19 -8
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/lib/url.d.ts.map +1 -1
- package/dist/esm/lib/url.js +4 -2
- package/dist/esm/lib/url.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +6 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +6 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/v2deploygetdeploymentresponsedata.d.ts +3 -0
- package/dist/esm/models/components/v2deploygetdeploymentresponsedata.d.ts.map +1 -1
- package/dist/esm/models/components/v2deploygetdeploymentresponsedata.js +3 -0
- package/dist/esm/models/components/v2deploygetdeploymentresponsedata.js.map +1 -1
- package/dist/esm/models/components/v2portalcreatesessionrequestbody.d.ts +49 -0
- package/dist/esm/models/components/v2portalcreatesessionrequestbody.d.ts.map +1 -0
- package/dist/esm/models/components/v2portalcreatesessionrequestbody.js +15 -0
- package/dist/esm/models/components/v2portalcreatesessionrequestbody.js.map +1 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsebody.d.ts +16 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsebody.d.ts.map +1 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsebody.js +16 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsebody.js.map +1 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsedata.d.ts +21 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsedata.d.ts.map +1 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsedata.js +14 -0
- package/dist/esm/models/components/v2portalcreatesessionresponsedata.js.map +1 -0
- package/dist/esm/models/components/v2portalexchangesessionrequestbody.d.ts +18 -0
- package/dist/esm/models/components/v2portalexchangesessionrequestbody.d.ts.map +1 -0
- package/dist/esm/models/components/v2portalexchangesessionrequestbody.js +12 -0
- package/dist/esm/models/components/v2portalexchangesessionrequestbody.js.map +1 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsebody.d.ts +16 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsebody.d.ts.map +1 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsebody.js +16 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsebody.js.map +1 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsedata.d.ts +21 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsedata.d.ts.map +1 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsedata.js +14 -0
- package/dist/esm/models/components/v2portalexchangesessionresponsedata.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/portalcreatesession.d.ts +14 -0
- package/dist/esm/models/operations/portalcreatesession.d.ts.map +1 -0
- package/dist/esm/models/operations/portalcreatesession.js +21 -0
- package/dist/esm/models/operations/portalcreatesession.js.map +1 -0
- package/dist/esm/models/operations/portalexchangesession.d.ts +14 -0
- package/dist/esm/models/operations/portalexchangesession.d.ts.map +1 -0
- package/dist/esm/models/operations/portalexchangesession.js +21 -0
- package/dist/esm/models/operations/portalexchangesession.js.map +1 -0
- package/dist/esm/sdk/portal.d.ts +34 -0
- package/dist/esm/sdk/portal.d.ts.map +1 -0
- package/dist/esm/sdk/portal.js +42 -0
- package/dist/esm/sdk/portal.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/analyticsGetVerifications.ts +6 -13
- package/src/funcs/apisCreateApi.ts +6 -2
- package/src/funcs/apisDeleteApi.ts +6 -2
- package/src/funcs/apisGetApi.ts +6 -2
- package/src/funcs/apisListKeys.ts +6 -2
- package/src/funcs/identitiesCreateIdentity.ts +6 -2
- package/src/funcs/identitiesDeleteIdentity.ts +6 -2
- package/src/funcs/identitiesGetIdentity.ts +6 -2
- package/src/funcs/identitiesListIdentities.ts +6 -2
- package/src/funcs/identitiesUpdateIdentity.ts +6 -2
- package/src/funcs/internalCreateDeployment.ts +6 -2
- package/src/funcs/internalGetDeployment.ts +6 -2
- package/src/funcs/keysAddPermissions.ts +6 -2
- package/src/funcs/keysAddRoles.ts +6 -2
- package/src/funcs/keysCreateKey.ts +6 -2
- package/src/funcs/keysDeleteKey.ts +6 -2
- package/src/funcs/keysGetKey.ts +6 -2
- package/src/funcs/keysMigrateKeys.ts +6 -2
- package/src/funcs/keysRemovePermissions.ts +6 -2
- package/src/funcs/keysRemoveRoles.ts +6 -2
- package/src/funcs/keysRerollKey.ts +6 -2
- package/src/funcs/keysSetPermissions.ts +6 -2
- package/src/funcs/keysSetRoles.ts +6 -2
- package/src/funcs/keysUpdateCredits.ts +6 -2
- package/src/funcs/keysUpdateKey.ts +6 -2
- package/src/funcs/keysVerifyKey.ts +6 -2
- package/src/funcs/keysWhoami.ts +6 -2
- package/src/funcs/permissionsCreatePermission.ts +6 -2
- package/src/funcs/permissionsCreateRole.ts +6 -2
- package/src/funcs/permissionsDeletePermission.ts +6 -2
- package/src/funcs/permissionsDeleteRole.ts +6 -2
- package/src/funcs/permissionsGetPermission.ts +6 -2
- package/src/funcs/permissionsGetRole.ts +6 -2
- package/src/funcs/permissionsListPermissions.ts +6 -2
- package/src/funcs/permissionsListRoles.ts +6 -2
- package/src/funcs/portalCreateSession.ts +218 -0
- package/src/funcs/portalExchangeSession.ts +200 -0
- package/src/funcs/ratelimitDeleteOverride.ts +6 -2
- package/src/funcs/ratelimitGetOverride.ts +6 -2
- package/src/funcs/ratelimitLimit.ts +6 -2
- package/src/funcs/ratelimitListOverrides.ts +6 -2
- package/src/funcs/ratelimitMultiLimit.ts +6 -2
- package/src/funcs/ratelimitSetOverride.ts +6 -2
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +32 -4
- package/src/lib/sdks.ts +10 -11
- package/src/lib/security.ts +14 -2
- package/src/lib/url.ts +16 -14
- package/src/models/components/index.ts +6 -0
- package/src/models/components/v2deploygetdeploymentresponsedata.ts +3 -0
- package/src/models/components/v2portalcreatesessionrequestbody.ts +73 -0
- package/src/models/components/v2portalcreatesessionresponsebody.ts +41 -0
- package/src/models/components/v2portalcreatesessionresponsedata.ts +43 -0
- package/src/models/components/v2portalexchangesessionrequestbody.ts +39 -0
- package/src/models/components/v2portalexchangesessionresponsebody.ts +42 -0
- package/src/models/components/v2portalexchangesessionresponsedata.ts +44 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/portalcreatesession.ts +40 -0
- package/src/models/operations/portalexchangesession.ts +40 -0
- package/src/sdk/portal.ts +60 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -35,6 +36,8 @@ import { Result } from "../types/fp.js";
|
|
|
35
36
|
* Your root key must have one of the following permissions for basic key information:
|
|
36
37
|
* - `api.*.create_key` (to migrate keys to any API)
|
|
37
38
|
* - `api.<api_id>.create_key` (to migrate keys to a specific API)
|
|
39
|
+
*
|
|
40
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
38
41
|
*/
|
|
39
42
|
export function keysMigrateKeys(
|
|
40
43
|
client: UnkeyCore,
|
|
@@ -113,7 +116,7 @@ async function $do(
|
|
|
113
116
|
|
|
114
117
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
115
118
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
116
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
117
120
|
|
|
118
121
|
const context = {
|
|
119
122
|
options: client._options,
|
|
@@ -157,7 +160,8 @@ async function $do(
|
|
|
157
160
|
|
|
158
161
|
const doResult = await client._do(req, {
|
|
159
162
|
context,
|
|
160
|
-
|
|
163
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
164
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
161
165
|
retryConfig: context.retryConfig,
|
|
162
166
|
retryCodes: context.retryCodes,
|
|
163
167
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -44,6 +45,8 @@ import { Result } from "../types/fp.js";
|
|
|
44
45
|
* **Side Effects**
|
|
45
46
|
*
|
|
46
47
|
* Invalidates the key cache for immediate effect, and makes permission changes available for verification within 30 seconds across all regions.
|
|
48
|
+
*
|
|
49
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
47
50
|
*/
|
|
48
51
|
export function keysRemovePermissions(
|
|
49
52
|
client: UnkeyCore,
|
|
@@ -122,7 +125,7 @@ async function $do(
|
|
|
122
125
|
|
|
123
126
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
124
127
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
125
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
126
129
|
|
|
127
130
|
const context = {
|
|
128
131
|
options: client._options,
|
|
@@ -166,7 +169,8 @@ async function $do(
|
|
|
166
169
|
|
|
167
170
|
const doResult = await client._do(req, {
|
|
168
171
|
context,
|
|
169
|
-
|
|
172
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
173
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
170
174
|
retryConfig: context.retryConfig,
|
|
171
175
|
retryCodes: context.retryCodes,
|
|
172
176
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -44,6 +45,8 @@ import { Result } from "../types/fp.js";
|
|
|
44
45
|
* **Side Effects**
|
|
45
46
|
*
|
|
46
47
|
* Invalidates the key cache for immediate effect, and makes role changes available for verification within 30 seconds across all regions.
|
|
48
|
+
*
|
|
49
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
47
50
|
*/
|
|
48
51
|
export function keysRemoveRoles(
|
|
49
52
|
client: UnkeyCore,
|
|
@@ -122,7 +125,7 @@ async function $do(
|
|
|
122
125
|
|
|
123
126
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
124
127
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
125
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
126
129
|
|
|
127
130
|
const context = {
|
|
128
131
|
options: client._options,
|
|
@@ -166,7 +169,8 @@ async function $do(
|
|
|
166
169
|
|
|
167
170
|
const doResult = await client._do(req, {
|
|
168
171
|
context,
|
|
169
|
-
|
|
172
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
173
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
170
174
|
retryConfig: context.retryConfig,
|
|
171
175
|
retryCodes: context.retryCodes,
|
|
172
176
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -61,6 +62,8 @@ import { Result } from "../types/fp.js";
|
|
|
61
62
|
* Your root key must have:
|
|
62
63
|
* - `api.*.create_key` or `api.<api_id>.create_key`
|
|
63
64
|
* - `api.*.encrypt_key` or `api.<api_id>.encrypt_key` (only when the original key is recoverable)
|
|
65
|
+
*
|
|
66
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
64
67
|
*/
|
|
65
68
|
export function keysRerollKey(
|
|
66
69
|
client: UnkeyCore,
|
|
@@ -139,7 +142,7 @@ async function $do(
|
|
|
139
142
|
|
|
140
143
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
141
144
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
142
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
145
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
143
146
|
|
|
144
147
|
const context = {
|
|
145
148
|
options: client._options,
|
|
@@ -183,7 +186,8 @@ async function $do(
|
|
|
183
186
|
|
|
184
187
|
const doResult = await client._do(req, {
|
|
185
188
|
context,
|
|
186
|
-
|
|
189
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
190
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
187
191
|
retryConfig: context.retryConfig,
|
|
188
192
|
retryCodes: context.retryCodes,
|
|
189
193
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -44,6 +45,8 @@ import { Result } from "../types/fp.js";
|
|
|
44
45
|
* **Side Effects**
|
|
45
46
|
*
|
|
46
47
|
* Invalidates the key cache for immediate effect, and makes permission changes available for verification within 30 seconds across all regions.
|
|
48
|
+
*
|
|
49
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
47
50
|
*/
|
|
48
51
|
export function keysSetPermissions(
|
|
49
52
|
client: UnkeyCore,
|
|
@@ -122,7 +125,7 @@ async function $do(
|
|
|
122
125
|
|
|
123
126
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
124
127
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
125
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
126
129
|
|
|
127
130
|
const context = {
|
|
128
131
|
options: client._options,
|
|
@@ -166,7 +169,8 @@ async function $do(
|
|
|
166
169
|
|
|
167
170
|
const doResult = await client._do(req, {
|
|
168
171
|
context,
|
|
169
|
-
|
|
172
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
173
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
170
174
|
retryConfig: context.retryConfig,
|
|
171
175
|
retryCodes: context.retryCodes,
|
|
172
176
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -44,6 +45,8 @@ import { Result } from "../types/fp.js";
|
|
|
44
45
|
* **Side Effects**
|
|
45
46
|
*
|
|
46
47
|
* Invalidates the key cache for immediate effect, and makes role changes available for verification within 30 seconds across all regions.
|
|
48
|
+
*
|
|
49
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
47
50
|
*/
|
|
48
51
|
export function keysSetRoles(
|
|
49
52
|
client: UnkeyCore,
|
|
@@ -121,7 +124,7 @@ async function $do(
|
|
|
121
124
|
|
|
122
125
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
123
126
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
124
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
127
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
125
128
|
|
|
126
129
|
const context = {
|
|
127
130
|
options: client._options,
|
|
@@ -165,7 +168,8 @@ async function $do(
|
|
|
165
168
|
|
|
166
169
|
const doResult = await client._do(req, {
|
|
167
170
|
context,
|
|
168
|
-
|
|
171
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
172
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
169
173
|
retryConfig: context.retryConfig,
|
|
170
174
|
retryCodes: context.retryCodes,
|
|
171
175
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -44,6 +45,8 @@ import { Result } from "../types/fp.js";
|
|
|
44
45
|
* **Side Effects**
|
|
45
46
|
*
|
|
46
47
|
* Credit updates remove the key from cache immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes take effect instantly but may take up to 30 seconds to propagate to all edge regions.
|
|
48
|
+
*
|
|
49
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
47
50
|
*/
|
|
48
51
|
export function keysUpdateCredits(
|
|
49
52
|
client: UnkeyCore,
|
|
@@ -122,7 +125,7 @@ async function $do(
|
|
|
122
125
|
|
|
123
126
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
124
127
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
125
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
126
129
|
|
|
127
130
|
const context = {
|
|
128
131
|
options: client._options,
|
|
@@ -166,7 +169,8 @@ async function $do(
|
|
|
166
169
|
|
|
167
170
|
const doResult = await client._do(req, {
|
|
168
171
|
context,
|
|
169
|
-
|
|
172
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
173
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
170
174
|
retryConfig: context.retryConfig,
|
|
171
175
|
retryCodes: context.retryCodes,
|
|
172
176
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -44,6 +45,8 @@ import { Result } from "../types/fp.js";
|
|
|
44
45
|
* **Side Effects**
|
|
45
46
|
*
|
|
46
47
|
* If you specify an `externalId` that doesn't exist, a new identity will be automatically created and linked to the key. Permission updates will auto-create any permissions that don't exist in your workspace. Changes take effect immediately but may take up to 30 seconds to propagate to all edge regions due to cache invalidation.
|
|
48
|
+
*
|
|
49
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
47
50
|
*/
|
|
48
51
|
export function keysUpdateKey(
|
|
49
52
|
client: UnkeyCore,
|
|
@@ -122,7 +125,7 @@ async function $do(
|
|
|
122
125
|
|
|
123
126
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
124
127
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
125
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
126
129
|
|
|
127
130
|
const context = {
|
|
128
131
|
options: client._options,
|
|
@@ -166,7 +169,8 @@ async function $do(
|
|
|
166
169
|
|
|
167
170
|
const doResult = await client._do(req, {
|
|
168
171
|
context,
|
|
169
|
-
|
|
172
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
173
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
170
174
|
retryConfig: context.retryConfig,
|
|
171
175
|
retryCodes: context.retryCodes,
|
|
172
176
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -47,6 +48,8 @@ import { Result } from "../types/fp.js";
|
|
|
47
48
|
* - `api.<api_id>.verify_key` (verify keys in specific API)
|
|
48
49
|
*
|
|
49
50
|
* **Note**: If your root key has no verify permissions at all, you will receive a `403 Forbidden` error. If your root key has verify permissions for a different API than the key you're verifying, you will receive a `200` response with `code: NOT_FOUND` to avoid leaking key existence.
|
|
51
|
+
*
|
|
52
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
50
53
|
*/
|
|
51
54
|
export function keysVerifyKey(
|
|
52
55
|
client: UnkeyCore,
|
|
@@ -125,7 +128,7 @@ async function $do(
|
|
|
125
128
|
|
|
126
129
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
127
130
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
128
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
131
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
129
132
|
|
|
130
133
|
const context = {
|
|
131
134
|
options: client._options,
|
|
@@ -169,7 +172,8 @@ async function $do(
|
|
|
169
172
|
|
|
170
173
|
const doResult = await client._do(req, {
|
|
171
174
|
context,
|
|
172
|
-
|
|
175
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
176
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
173
177
|
retryConfig: context.retryConfig,
|
|
174
178
|
retryCodes: context.retryCodes,
|
|
175
179
|
});
|
package/src/funcs/keysWhoami.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -38,6 +39,8 @@ import { Result } from "../types/fp.js";
|
|
|
38
39
|
* - `api.<api_id>.read_key` (to read keys from a specific API)
|
|
39
40
|
*
|
|
40
41
|
* If your rootkey lacks permissions but the key exists, we may return a 404 status here to prevent leaking the existance of a key to unauthorized clients. If you believe that a key should exist, but receive a 404, please double check your root key has the correct permissions.
|
|
42
|
+
*
|
|
43
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
41
44
|
*/
|
|
42
45
|
export function keysWhoami(
|
|
43
46
|
client: UnkeyCore,
|
|
@@ -115,7 +118,7 @@ async function $do(
|
|
|
115
118
|
|
|
116
119
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
117
120
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
118
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
119
122
|
|
|
120
123
|
const context = {
|
|
121
124
|
options: client._options,
|
|
@@ -159,7 +162,8 @@ async function $do(
|
|
|
159
162
|
|
|
160
163
|
const doResult = await client._do(req, {
|
|
161
164
|
context,
|
|
162
|
-
|
|
165
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
166
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
163
167
|
retryConfig: context.retryConfig,
|
|
164
168
|
retryCodes: context.retryCodes,
|
|
165
169
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -39,6 +40,8 @@ import { Result } from "../types/fp.js";
|
|
|
39
40
|
*
|
|
40
41
|
* Your root key must have the following permission:
|
|
41
42
|
* - `rbac.*.create_permission`
|
|
43
|
+
*
|
|
44
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
42
45
|
*/
|
|
43
46
|
export function permissionsCreatePermission(
|
|
44
47
|
client: UnkeyCore,
|
|
@@ -119,7 +122,7 @@ async function $do(
|
|
|
119
122
|
|
|
120
123
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
121
124
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
122
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
125
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
123
126
|
|
|
124
127
|
const context = {
|
|
125
128
|
options: client._options,
|
|
@@ -163,7 +166,8 @@ async function $do(
|
|
|
163
166
|
|
|
164
167
|
const doResult = await client._do(req, {
|
|
165
168
|
context,
|
|
166
|
-
|
|
169
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
170
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
167
171
|
retryConfig: context.retryConfig,
|
|
168
172
|
retryCodes: context.retryCodes,
|
|
169
173
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -37,6 +38,8 @@ import { Result } from "../types/fp.js";
|
|
|
37
38
|
*
|
|
38
39
|
* Your root key must have the following permission:
|
|
39
40
|
* - `rbac.*.create_role`
|
|
41
|
+
*
|
|
42
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
40
43
|
*/
|
|
41
44
|
export function permissionsCreateRole(
|
|
42
45
|
client: UnkeyCore,
|
|
@@ -115,7 +118,7 @@ async function $do(
|
|
|
115
118
|
|
|
116
119
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
117
120
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
118
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
119
122
|
|
|
120
123
|
const context = {
|
|
121
124
|
options: client._options,
|
|
@@ -159,7 +162,8 @@ async function $do(
|
|
|
159
162
|
|
|
160
163
|
const doResult = await client._do(req, {
|
|
161
164
|
context,
|
|
162
|
-
|
|
165
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
166
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
163
167
|
retryConfig: context.retryConfig,
|
|
164
168
|
retryCodes: context.retryCodes,
|
|
165
169
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -37,6 +38,8 @@ import { Result } from "../types/fp.js";
|
|
|
37
38
|
*
|
|
38
39
|
* Your root key must have the following permission:
|
|
39
40
|
* - `rbac.*.delete_permission`
|
|
41
|
+
*
|
|
42
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
40
43
|
*/
|
|
41
44
|
export function permissionsDeletePermission(
|
|
42
45
|
client: UnkeyCore,
|
|
@@ -117,7 +120,7 @@ async function $do(
|
|
|
117
120
|
|
|
118
121
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
119
122
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
120
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
123
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
121
124
|
|
|
122
125
|
const context = {
|
|
123
126
|
options: client._options,
|
|
@@ -161,7 +164,8 @@ async function $do(
|
|
|
161
164
|
|
|
162
165
|
const doResult = await client._do(req, {
|
|
163
166
|
context,
|
|
164
|
-
|
|
167
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
168
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
165
169
|
retryConfig: context.retryConfig,
|
|
166
170
|
retryCodes: context.retryCodes,
|
|
167
171
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -37,6 +38,8 @@ import { Result } from "../types/fp.js";
|
|
|
37
38
|
*
|
|
38
39
|
* Your root key must have the following permission:
|
|
39
40
|
* - `rbac.*.delete_role`
|
|
41
|
+
*
|
|
42
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
40
43
|
*/
|
|
41
44
|
export function permissionsDeleteRole(
|
|
42
45
|
client: UnkeyCore,
|
|
@@ -113,7 +116,7 @@ async function $do(
|
|
|
113
116
|
|
|
114
117
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
115
118
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
116
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
117
120
|
|
|
118
121
|
const context = {
|
|
119
122
|
options: client._options,
|
|
@@ -157,7 +160,8 @@ async function $do(
|
|
|
157
160
|
|
|
158
161
|
const doResult = await client._do(req, {
|
|
159
162
|
context,
|
|
160
|
-
|
|
163
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
164
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
161
165
|
retryConfig: context.retryConfig,
|
|
162
166
|
retryCodes: context.retryCodes,
|
|
163
167
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -35,6 +36,8 @@ import { Result } from "../types/fp.js";
|
|
|
35
36
|
*
|
|
36
37
|
* Your root key must have the following permission:
|
|
37
38
|
* - `rbac.*.read_permission`
|
|
39
|
+
*
|
|
40
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
38
41
|
*/
|
|
39
42
|
export function permissionsGetPermission(
|
|
40
43
|
client: UnkeyCore,
|
|
@@ -115,7 +118,7 @@ async function $do(
|
|
|
115
118
|
|
|
116
119
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
117
120
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
118
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
119
122
|
|
|
120
123
|
const context = {
|
|
121
124
|
options: client._options,
|
|
@@ -159,7 +162,8 @@ async function $do(
|
|
|
159
162
|
|
|
160
163
|
const doResult = await client._do(req, {
|
|
161
164
|
context,
|
|
162
|
-
|
|
165
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
166
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
163
167
|
retryConfig: context.retryConfig,
|
|
164
168
|
retryCodes: context.retryCodes,
|
|
165
169
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -35,6 +36,8 @@ import { Result } from "../types/fp.js";
|
|
|
35
36
|
*
|
|
36
37
|
* Your root key must have the following permission:
|
|
37
38
|
* - `rbac.*.read_role`
|
|
39
|
+
*
|
|
40
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
38
41
|
*/
|
|
39
42
|
export function permissionsGetRole(
|
|
40
43
|
client: UnkeyCore,
|
|
@@ -113,7 +116,7 @@ async function $do(
|
|
|
113
116
|
|
|
114
117
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
115
118
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
116
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
117
120
|
|
|
118
121
|
const context = {
|
|
119
122
|
options: client._options,
|
|
@@ -157,7 +160,8 @@ async function $do(
|
|
|
157
160
|
|
|
158
161
|
const doResult = await client._do(req, {
|
|
159
162
|
context,
|
|
160
|
-
|
|
163
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
164
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
161
165
|
retryConfig: context.retryConfig,
|
|
162
166
|
retryCodes: context.retryCodes,
|
|
163
167
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -36,6 +37,8 @@ import { Result } from "../types/fp.js";
|
|
|
36
37
|
*
|
|
37
38
|
* Your root key must have the following permission:
|
|
38
39
|
* - `rbac.*.read_permission`
|
|
40
|
+
*
|
|
41
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
39
42
|
*/
|
|
40
43
|
export function permissionsListPermissions(
|
|
41
44
|
client: UnkeyCore,
|
|
@@ -114,7 +117,7 @@ async function $do(
|
|
|
114
117
|
|
|
115
118
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
116
119
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
117
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
120
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
118
121
|
|
|
119
122
|
const context = {
|
|
120
123
|
options: client._options,
|
|
@@ -158,7 +161,8 @@ async function $do(
|
|
|
158
161
|
|
|
159
162
|
const doResult = await client._do(req, {
|
|
160
163
|
context,
|
|
161
|
-
|
|
164
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
165
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
162
166
|
retryConfig: context.retryConfig,
|
|
163
167
|
retryCodes: context.retryCodes,
|
|
164
168
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { UnkeyCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -36,6 +37,8 @@ import { Result } from "../types/fp.js";
|
|
|
36
37
|
*
|
|
37
38
|
* Your root key must have the following permission:
|
|
38
39
|
* - `rbac.*.read_role`
|
|
40
|
+
*
|
|
41
|
+
* If set, this operation will use {@link Security.rootKey} from the global security.
|
|
39
42
|
*/
|
|
40
43
|
export function permissionsListRoles(
|
|
41
44
|
client: UnkeyCore,
|
|
@@ -114,7 +117,7 @@ async function $do(
|
|
|
114
117
|
|
|
115
118
|
const secConfig = await extractSecurity(client._options.rootKey);
|
|
116
119
|
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
117
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
120
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
118
121
|
|
|
119
122
|
const context = {
|
|
120
123
|
options: client._options,
|
|
@@ -158,7 +161,8 @@ async function $do(
|
|
|
158
161
|
|
|
159
162
|
const doResult = await client._do(req, {
|
|
160
163
|
context,
|
|
161
|
-
|
|
164
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
165
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
162
166
|
retryConfig: context.retryConfig,
|
|
163
167
|
retryCodes: context.retryCodes,
|
|
164
168
|
});
|