@workos-inc/node 8.0.0-rc.1 → 8.0.0-rc.3
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/cjs/api-keys/api-keys.cjs +45 -0
- package/lib/cjs/api-keys/api-keys.cjs.map +1 -0
- package/lib/cjs/api-keys/api-keys.d.cts +130 -0
- package/lib/cjs/api-keys/interfaces/api-key.interface.cjs +17 -0
- package/lib/cjs/api-keys/interfaces/api-key.interface.cjs.map +1 -0
- package/lib/cjs/api-keys/interfaces/api-key.interface.d.cts +30 -0
- package/lib/cjs/api-keys/interfaces/validate-api-key.interface.cjs +17 -0
- package/lib/cjs/api-keys/interfaces/validate-api-key.interface.cjs.map +1 -0
- package/lib/cjs/api-keys/interfaces/validate-api-key.interface.d.cts +13 -0
- package/lib/cjs/api-keys/serializers/api-key.serializer.cjs +43 -0
- package/lib/cjs/api-keys/serializers/api-key.serializer.cjs.map +1 -0
- package/lib/cjs/api-keys/serializers/api-key.serializer.d.cts +5 -0
- package/lib/cjs/api-keys/serializers/validate-api-key.serializer.cjs +36 -0
- package/lib/cjs/api-keys/serializers/validate-api-key.serializer.cjs.map +1 -0
- package/lib/cjs/api-keys/serializers/validate-api-key.serializer.d.cts +6 -0
- package/lib/cjs/audit-logs/audit-logs.d.cts +11 -9
- package/lib/cjs/client/sso.cjs +2 -2
- package/lib/cjs/client/sso.cjs.map +1 -1
- package/lib/cjs/client/user-management.cjs +2 -2
- package/lib/cjs/client/user-management.cjs.map +1 -1
- package/lib/cjs/common/exceptions/unprocessable-entity.exception.cjs +1 -12
- package/lib/cjs/common/exceptions/unprocessable-entity.exception.cjs.map +1 -1
- package/lib/cjs/common/net/fetch-client.cjs +4 -4
- package/lib/cjs/common/net/fetch-client.cjs.map +1 -1
- package/lib/cjs/common/net/http-client.cjs +4 -1
- package/lib/cjs/common/net/http-client.cjs.map +1 -1
- package/lib/cjs/common/net/http-client.d.cts +1 -0
- package/lib/cjs/common/utils/fetch-and-deserialize.d.cts +9 -7
- package/lib/cjs/common/utils/leb128.cjs +101 -0
- package/lib/cjs/common/utils/leb128.cjs.map +1 -0
- package/lib/cjs/common/utils/leb128.d.cts +24 -0
- package/lib/cjs/common/utils/query-string.cjs +66 -0
- package/lib/cjs/common/utils/query-string.cjs.map +1 -0
- package/lib/cjs/common/utils/query-string.d.cts +11 -0
- package/lib/cjs/directory-sync/directory-sync.d.cts +3 -1
- package/lib/cjs/events/events.d.cts +10 -8
- package/lib/cjs/fga/fga.d.cts +9 -7
- package/lib/cjs/fga/utils/fetch-and-deserialize-list.d.cts +10 -8
- package/lib/cjs/index.d.cts +3 -1
- package/lib/cjs/index.worker.d.cts +3 -1
- package/lib/cjs/mfa/mfa.d.cts +11 -9
- package/lib/cjs/organization-domains/organization-domains.d.cts +11 -9
- package/lib/cjs/organizations/organizations.d.cts +8 -6
- package/lib/cjs/passwordless/passwordless.d.cts +11 -9
- package/lib/cjs/portal/portal.d.cts +11 -9
- package/lib/cjs/sso/sso.d.cts +8 -6
- package/lib/cjs/user-management/session.cjs +10 -8
- package/lib/cjs/user-management/session.cjs.map +1 -1
- package/lib/cjs/user-management/session.d.cts +11 -9
- package/lib/cjs/user-management/user-management.cjs +14 -8
- package/lib/cjs/user-management/user-management.cjs.map +1 -1
- package/lib/cjs/user-management/user-management.d.cts +8 -6
- package/lib/cjs/{client/utils.cjs → utils/jose.cjs} +11 -16
- package/lib/cjs/utils/jose.cjs.map +1 -0
- package/lib/cjs/utils/jose.d.cts +17 -0
- package/lib/cjs/vault/vault.cjs +3 -3
- package/lib/cjs/vault/vault.cjs.map +1 -1
- package/lib/cjs/vault/vault.d.cts +9 -7
- package/lib/cjs/widgets/interfaces/get-token.cjs.map +1 -1
- package/lib/cjs/widgets/interfaces/get-token.d.cts +1 -1
- package/lib/cjs/widgets/widgets.d.cts +11 -9
- package/lib/cjs/{workos-BcNRiAbw.d.cts → workos-X1cDErJB.d.cts} +18 -11
- package/lib/cjs/workos.cjs +3 -1
- package/lib/cjs/workos.cjs.map +1 -1
- package/lib/cjs/workos.d.cts +11 -9
- package/lib/esm/api-keys/api-keys.d.ts +130 -0
- package/lib/esm/api-keys/api-keys.js +22 -0
- package/lib/esm/api-keys/api-keys.js.map +1 -0
- package/lib/esm/api-keys/interfaces/api-key.interface.d.ts +30 -0
- package/lib/esm/api-keys/interfaces/api-key.interface.js +1 -0
- package/lib/esm/api-keys/interfaces/api-key.interface.js.map +1 -0
- package/lib/esm/api-keys/interfaces/validate-api-key.interface.d.ts +13 -0
- package/lib/esm/api-keys/interfaces/validate-api-key.interface.js +1 -0
- package/lib/esm/api-keys/interfaces/validate-api-key.interface.js.map +1 -0
- package/lib/esm/api-keys/serializers/api-key.serializer.d.ts +5 -0
- package/lib/esm/api-keys/serializers/api-key.serializer.js +20 -0
- package/lib/esm/api-keys/serializers/api-key.serializer.js.map +1 -0
- package/lib/esm/api-keys/serializers/validate-api-key.serializer.d.ts +6 -0
- package/lib/esm/api-keys/serializers/validate-api-key.serializer.js +13 -0
- package/lib/esm/api-keys/serializers/validate-api-key.serializer.js.map +1 -0
- package/lib/esm/audit-logs/audit-logs.d.ts +11 -9
- package/lib/esm/client/sso.js +1 -1
- package/lib/esm/client/sso.js.map +1 -1
- package/lib/esm/client/user-management.js +1 -1
- package/lib/esm/client/user-management.js.map +1 -1
- package/lib/esm/common/exceptions/unprocessable-entity.exception.js +1 -2
- package/lib/esm/common/exceptions/unprocessable-entity.exception.js.map +1 -1
- package/lib/esm/common/net/fetch-client.js +4 -4
- package/lib/esm/common/net/fetch-client.js.map +1 -1
- package/lib/esm/common/net/http-client.d.ts +1 -0
- package/lib/esm/common/net/http-client.js +4 -1
- package/lib/esm/common/net/http-client.js.map +1 -1
- package/lib/esm/common/utils/fetch-and-deserialize.d.ts +9 -7
- package/lib/esm/common/utils/leb128.d.ts +24 -0
- package/lib/esm/common/utils/leb128.js +77 -0
- package/lib/esm/common/utils/leb128.js.map +1 -0
- package/lib/esm/common/utils/query-string.d.ts +11 -0
- package/lib/esm/common/utils/query-string.js +43 -0
- package/lib/esm/common/utils/query-string.js.map +1 -0
- package/lib/esm/directory-sync/directory-sync.d.ts +3 -1
- package/lib/esm/events/events.d.ts +10 -8
- package/lib/esm/fga/fga.d.ts +9 -7
- package/lib/esm/fga/utils/fetch-and-deserialize-list.d.ts +10 -8
- package/lib/esm/index.d.ts +3 -1
- package/lib/esm/index.worker.d.ts +3 -1
- package/lib/esm/mfa/mfa.d.ts +11 -9
- package/lib/esm/organization-domains/organization-domains.d.ts +11 -9
- package/lib/esm/organizations/organizations.d.ts +8 -6
- package/lib/esm/passwordless/passwordless.d.ts +11 -9
- package/lib/esm/portal/portal.d.ts +11 -9
- package/lib/esm/sso/sso.d.ts +8 -6
- package/lib/esm/user-management/session.d.ts +11 -9
- package/lib/esm/user-management/session.js +7 -5
- package/lib/esm/user-management/session.js.map +1 -1
- package/lib/esm/user-management/user-management.d.ts +8 -6
- package/lib/esm/user-management/user-management.js +11 -5
- package/lib/esm/user-management/user-management.js.map +1 -1
- package/lib/esm/utils/jose.d.ts +17 -0
- package/lib/esm/utils/jose.js +11 -0
- package/lib/esm/utils/jose.js.map +1 -0
- package/lib/esm/vault/vault.d.ts +9 -7
- package/lib/esm/vault/vault.js +1 -1
- package/lib/esm/vault/vault.js.map +1 -1
- package/lib/esm/widgets/interfaces/get-token.d.ts +1 -1
- package/lib/esm/widgets/interfaces/get-token.js.map +1 -1
- package/lib/esm/widgets/widgets.d.ts +11 -9
- package/lib/esm/{workos-e5MfmByv.d.ts → workos-DLj13cxf.d.ts} +18 -11
- package/lib/esm/workos.d.ts +11 -9
- package/lib/esm/workos.js +3 -1
- package/lib/esm/workos.js.map +1 -1
- package/package.json +7 -7
- package/lib/cjs/client/utils.cjs.map +0 -1
- package/lib/cjs/client/utils.d.cts +0 -7
- package/lib/esm/client/utils.d.ts +0 -7
- package/lib/esm/client/utils.js +0 -16
- package/lib/esm/client/utils.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var api_keys_exports = {};
|
|
21
|
+
__export(api_keys_exports, {
|
|
22
|
+
ApiKeys: () => ApiKeys
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(api_keys_exports);
|
|
25
|
+
var import_validate_api_key2 = require('./serializers/validate-api-key.serializer.cjs');
|
|
26
|
+
class ApiKeys {
|
|
27
|
+
constructor(workos) {
|
|
28
|
+
this.workos = workos;
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
__name(this, "ApiKeys");
|
|
32
|
+
}
|
|
33
|
+
async validateApiKey(payload) {
|
|
34
|
+
const { data } = await this.workos.post(
|
|
35
|
+
"/api_keys/validations",
|
|
36
|
+
payload
|
|
37
|
+
);
|
|
38
|
+
return (0, import_validate_api_key2.deserializeValidateApiKeyResponse)(data);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
ApiKeys
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=api-keys.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/api-keys/api-keys.ts"],"sourcesContent":["import { WorkOS } from '../workos';\nimport {\n SerializedValidateApiKeyResponse,\n ValidateApiKeyOptions,\n ValidateApiKeyResponse,\n} from './interfaces/validate-api-key.interface';\nimport { deserializeValidateApiKeyResponse } from './serializers/validate-api-key.serializer';\n\nexport class ApiKeys {\n constructor(private readonly workos: WorkOS) {}\n\n async validateApiKey(\n payload: ValidateApiKeyOptions,\n ): Promise<ValidateApiKeyResponse> {\n const { data } = await this.workos.post<SerializedValidateApiKeyResponse>(\n '/api_keys/validations',\n payload,\n );\n\n return deserializeValidateApiKeyResponse(data);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAAA,2BAAkD;AAE3C,MAAM,QAAQ;AAAA,EACnB,YAA6B,QAAgB;AAAhB;AAAA,EAAiB;AAAA,EAThD,OAQqB;AAAA;AAAA;AAAA,EAGnB,MAAM,eACJ,SACiC;AACjC,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,OAAO;AAAA,MACjC;AAAA,MACA;AAAA,IACF;AAEA,eAAO,4DAAkC,IAAI;AAAA,EAC/C;AACF;","names":["import_validate_api_key"]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export { A as ApiKeys } from '../workos-X1cDErJB.cjs';
|
|
2
|
+
import './interfaces/validate-api-key.interface.cjs';
|
|
3
|
+
import '../common/interfaces/get-options.interface.cjs';
|
|
4
|
+
import '../common/interfaces/post-options.interface.cjs';
|
|
5
|
+
import '../common/interfaces/put-options.interface.cjs';
|
|
6
|
+
import '../common/interfaces/workos-options.interface.cjs';
|
|
7
|
+
import '../common/interfaces/app-info.interface.cjs';
|
|
8
|
+
import '../common/utils/pagination.cjs';
|
|
9
|
+
import '../common/interfaces/pagination-options.interface.cjs';
|
|
10
|
+
import '../common/interfaces/list.interface.cjs';
|
|
11
|
+
import '../directory-sync/interfaces/directory.interface.cjs';
|
|
12
|
+
import '../directory-sync/interfaces/directory-group.interface.cjs';
|
|
13
|
+
import '../directory-sync/interfaces/list-directories-options.interface.cjs';
|
|
14
|
+
import '../directory-sync/interfaces/list-groups-options.interface.cjs';
|
|
15
|
+
import '../directory-sync/interfaces/list-directory-users-options.interface.cjs';
|
|
16
|
+
import '../directory-sync/interfaces/directory-user.interface.cjs';
|
|
17
|
+
import '../roles/interfaces/role.interface.cjs';
|
|
18
|
+
import '../events/interfaces/list-events-options.interface.cjs';
|
|
19
|
+
import '../common/interfaces/event.interface.cjs';
|
|
20
|
+
import '../organizations/interfaces/organization.interface.cjs';
|
|
21
|
+
import '../organization-domains/interfaces/organization-domain.interface.cjs';
|
|
22
|
+
import '../sso/interfaces/connection.interface.cjs';
|
|
23
|
+
import '../sso/interfaces/connection-type.enum.cjs';
|
|
24
|
+
import '../user-management/interfaces/user.interface.cjs';
|
|
25
|
+
import '../user-management/interfaces/authentication-event.interface.cjs';
|
|
26
|
+
import '../user-management/interfaces/authentication-radar-risk-detected-event.interface.cjs';
|
|
27
|
+
import '../user-management/interfaces/email-verification.interface.cjs';
|
|
28
|
+
import '../user-management/interfaces/invitation.interface.cjs';
|
|
29
|
+
import '../user-management/interfaces/organization-membership.interface.cjs';
|
|
30
|
+
import '../user-management/interfaces/magic-auth.interface.cjs';
|
|
31
|
+
import '../user-management/interfaces/password-reset.interface.cjs';
|
|
32
|
+
import '../user-management/interfaces/session.interface.cjs';
|
|
33
|
+
import '../user-management/interfaces/impersonator.interface.cjs';
|
|
34
|
+
import '../organizations/interfaces/create-organization-options.interface.cjs';
|
|
35
|
+
import '../organizations/interfaces/domain-data.interface.cjs';
|
|
36
|
+
import '../organizations/interfaces/list-organization-feature-flags-options.interface.cjs';
|
|
37
|
+
import '../organizations/interfaces/list-organizations-options.interface.cjs';
|
|
38
|
+
import '../organizations/interfaces/update-organization-options.interface.cjs';
|
|
39
|
+
import '../feature-flags/interfaces/feature-flag.interface.cjs';
|
|
40
|
+
import '../organizations/interfaces/list-organization-roles-options.interface.cjs';
|
|
41
|
+
import '../organization-domains/interfaces/create-organization-domain-options.interface.cjs';
|
|
42
|
+
import '../passwordless/interfaces/passwordless-session.interface.cjs';
|
|
43
|
+
import '../passwordless/interfaces/create-passwordless-session-options.interface.cjs';
|
|
44
|
+
import '../passwordless/interfaces/send-session-response.interface.cjs';
|
|
45
|
+
import '../portal/interfaces/generate-portal-link-intent.interface.cjs';
|
|
46
|
+
import '../common/interfaces/unknown-record.interface.cjs';
|
|
47
|
+
import '../sso/interfaces/authorization-url-options.interface.cjs';
|
|
48
|
+
import '../sso/interfaces/get-profile-options.interface.cjs';
|
|
49
|
+
import '../sso/interfaces/get-profile-and-token-options.interface.cjs';
|
|
50
|
+
import '../sso/interfaces/list-connections-options.interface.cjs';
|
|
51
|
+
import '../sso/interfaces/profile-and-token.interface.cjs';
|
|
52
|
+
import '../user-management/interfaces/oauth-tokens.interface.cjs';
|
|
53
|
+
import '../sso/interfaces/profile.interface.cjs';
|
|
54
|
+
import '../webhooks/webhooks.cjs';
|
|
55
|
+
import '../common/crypto/crypto-provider.cjs';
|
|
56
|
+
import '../mfa/interfaces/challenge-factor-options.cjs';
|
|
57
|
+
import '../mfa/interfaces/challenge.interface.cjs';
|
|
58
|
+
import '../mfa/interfaces/enroll-factor-options.cjs';
|
|
59
|
+
import '../mfa/interfaces/factor.interface.cjs';
|
|
60
|
+
import '../mfa/interfaces/sms.interface.cjs';
|
|
61
|
+
import '../mfa/interfaces/totp.interface.cjs';
|
|
62
|
+
import '../mfa/interfaces/verify-challenge-options.cjs';
|
|
63
|
+
import '../mfa/interfaces/verify-challenge-response.cjs';
|
|
64
|
+
import '../audit-logs/interfaces/audit-log-export-options.interface.cjs';
|
|
65
|
+
import '../audit-logs/interfaces/audit-log-export.interface.cjs';
|
|
66
|
+
import '../audit-logs/interfaces/create-audit-log-event-options.interface.cjs';
|
|
67
|
+
import '../audit-logs/interfaces/create-audit-log-schema-options.interface.cjs';
|
|
68
|
+
import 'jose';
|
|
69
|
+
import '../user-management-qKHMGyQi.cjs';
|
|
70
|
+
import '../user-management/interfaces/authenticate-with-code-options.interface.cjs';
|
|
71
|
+
import '../user-management/interfaces/authenticate-with-options-base.interface.cjs';
|
|
72
|
+
import '../user-management/interfaces/authenticate-with-code-and-verifier-options.interface.cjs';
|
|
73
|
+
import '../user-management/interfaces/authenticate-with-email-verification-options.interface.cjs';
|
|
74
|
+
import '../user-management/interfaces/authenticate-with-magic-auth-options.interface.cjs';
|
|
75
|
+
import '../user-management/interfaces/authenticate-with-organization-selection.interface.cjs';
|
|
76
|
+
import '../user-management/interfaces/authenticate-with-password-options.interface.cjs';
|
|
77
|
+
import '../user-management/interfaces/authenticate-with-refresh-token-options.interface.cjs';
|
|
78
|
+
import '../user-management/interfaces/authenticate-with-session-cookie.interface.cjs';
|
|
79
|
+
import '../user-management/interfaces/authentication-response.interface.cjs';
|
|
80
|
+
import '../user-management/interfaces/authenticate-with-totp-options.interface.cjs';
|
|
81
|
+
import '../user-management/interfaces/authorization-url-options.interface.cjs';
|
|
82
|
+
import '../user-management/interfaces/create-magic-auth-options.interface.cjs';
|
|
83
|
+
import '../user-management/interfaces/create-organization-membership-options.interface.cjs';
|
|
84
|
+
import '../user-management/interfaces/create-password-reset-options.interface.cjs';
|
|
85
|
+
import '../user-management/interfaces/create-user-options.interface.cjs';
|
|
86
|
+
import '../user-management/interfaces/password-hash-type.interface.cjs';
|
|
87
|
+
import '../user-management/interfaces/enroll-auth-factor.interface.cjs';
|
|
88
|
+
import '../user-management/interfaces/factor.interface.cjs';
|
|
89
|
+
import '../user-management/interfaces/identity.interface.cjs';
|
|
90
|
+
import '../user-management/interfaces/list-auth-factors-options.interface.cjs';
|
|
91
|
+
import '../user-management/interfaces/list-invitations-options.interface.cjs';
|
|
92
|
+
import '../user-management/interfaces/list-organization-memberships-options.interface.cjs';
|
|
93
|
+
import '../user-management/interfaces/list-sessions-options.interface.cjs';
|
|
94
|
+
import '../user-management/interfaces/list-user-feature-flags-options.interface.cjs';
|
|
95
|
+
import '../user-management/interfaces/list-users-options.interface.cjs';
|
|
96
|
+
import '../user-management/interfaces/reset-password-options.interface.cjs';
|
|
97
|
+
import '../user-management/interfaces/revoke-session-options.interface.cjs';
|
|
98
|
+
import '../user-management/interfaces/send-invitation-options.interface.cjs';
|
|
99
|
+
import '../user-management/interfaces/send-verification-email-options.interface.cjs';
|
|
100
|
+
import '../user-management/interfaces/update-organization-membership-options.interface.cjs';
|
|
101
|
+
import '../user-management/interfaces/update-user-options.interface.cjs';
|
|
102
|
+
import '../user-management/interfaces/verify-email-options.interface.cjs';
|
|
103
|
+
import '../user-management/interfaces/session-handler-options.interface.cjs';
|
|
104
|
+
import '../user-management/interfaces/refresh-and-seal-session-data.interface.cjs';
|
|
105
|
+
import '../fga/interfaces/check.interface.cjs';
|
|
106
|
+
import '../fga/interfaces/resource.interface.cjs';
|
|
107
|
+
import '../fga/interfaces/resource-op.enum.cjs';
|
|
108
|
+
import '../fga/interfaces/warrant.interface.cjs';
|
|
109
|
+
import '../fga/interfaces/warrant-op.enum.cjs';
|
|
110
|
+
import '../fga/interfaces/check-op.enum.cjs';
|
|
111
|
+
import '../fga/interfaces/warning.interface.cjs';
|
|
112
|
+
import '../fga/interfaces/query.interface.cjs';
|
|
113
|
+
import '../fga/interfaces/warrant-token.interface.cjs';
|
|
114
|
+
import '../fga/utils/fga-paginatable.cjs';
|
|
115
|
+
import '../fga/interfaces/list.interface.cjs';
|
|
116
|
+
import '../common/net/http-client.cjs';
|
|
117
|
+
import '../common/interfaces/http-client.interface.cjs';
|
|
118
|
+
import '../widgets/interfaces/get-token.cjs';
|
|
119
|
+
import '../actions/actions.cjs';
|
|
120
|
+
import '../actions/interfaces/action.interface.cjs';
|
|
121
|
+
import '../actions/interfaces/response-payload.interface.cjs';
|
|
122
|
+
import '../vault/interfaces/key/create-data-key.interface.cjs';
|
|
123
|
+
import '../vault/interfaces/key.interface.cjs';
|
|
124
|
+
import '../vault/interfaces/key/decrypt-data-key.interface.cjs';
|
|
125
|
+
import '../vault/interfaces/object/create-object.interface.cjs';
|
|
126
|
+
import '../vault/interfaces/object/delete-object.interface.cjs';
|
|
127
|
+
import '../vault/interfaces/object/read-object.interface.cjs';
|
|
128
|
+
import '../vault/interfaces/object.interface.cjs';
|
|
129
|
+
import '../vault/interfaces/object/update-object.interface.cjs';
|
|
130
|
+
import './interfaces/api-key.interface.cjs';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var api_key_interface_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(api_key_interface_exports);
|
|
17
|
+
//# sourceMappingURL=api-key.interface.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/api-keys/interfaces/api-key.interface.ts"],"sourcesContent":["export interface ApiKey {\n object: 'api_key';\n id: string;\n owner: {\n type: 'organization';\n id: string;\n };\n name: string;\n obfuscatedValue: string;\n lastUsedAt: string | null;\n permissions: string[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SerializedApiKey {\n object: 'api_key';\n id: string;\n owner: {\n type: 'organization';\n id: string;\n };\n name: string;\n obfuscated_value: string;\n last_used_at: string | null;\n permissions: string[];\n created_at: string;\n updated_at: string;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
interface ApiKey {
|
|
2
|
+
object: 'api_key';
|
|
3
|
+
id: string;
|
|
4
|
+
owner: {
|
|
5
|
+
type: 'organization';
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
name: string;
|
|
9
|
+
obfuscatedValue: string;
|
|
10
|
+
lastUsedAt: string | null;
|
|
11
|
+
permissions: string[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
interface SerializedApiKey {
|
|
16
|
+
object: 'api_key';
|
|
17
|
+
id: string;
|
|
18
|
+
owner: {
|
|
19
|
+
type: 'organization';
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
name: string;
|
|
23
|
+
obfuscated_value: string;
|
|
24
|
+
last_used_at: string | null;
|
|
25
|
+
permissions: string[];
|
|
26
|
+
created_at: string;
|
|
27
|
+
updated_at: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type { ApiKey, SerializedApiKey };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var validate_api_key_interface_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(validate_api_key_interface_exports);
|
|
17
|
+
//# sourceMappingURL=validate-api-key.interface.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/api-keys/interfaces/validate-api-key.interface.ts"],"sourcesContent":["import { ApiKey, SerializedApiKey } from './api-key.interface';\n\nexport interface ValidateApiKeyOptions {\n value: string;\n}\n\nexport interface ValidateApiKeyResponse {\n apiKey: ApiKey | null;\n}\n\nexport interface SerializedValidateApiKeyResponse {\n api_key: SerializedApiKey | null;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiKey, SerializedApiKey } from './api-key.interface.cjs';
|
|
2
|
+
|
|
3
|
+
interface ValidateApiKeyOptions {
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
interface ValidateApiKeyResponse {
|
|
7
|
+
apiKey: ApiKey | null;
|
|
8
|
+
}
|
|
9
|
+
interface SerializedValidateApiKeyResponse {
|
|
10
|
+
api_key: SerializedApiKey | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type { SerializedValidateApiKeyResponse, ValidateApiKeyOptions, ValidateApiKeyResponse };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var api_key_serializer_exports = {};
|
|
21
|
+
__export(api_key_serializer_exports, {
|
|
22
|
+
deserializeApiKey: () => deserializeApiKey
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(api_key_serializer_exports);
|
|
25
|
+
function deserializeApiKey(apiKey) {
|
|
26
|
+
return {
|
|
27
|
+
object: apiKey.object,
|
|
28
|
+
id: apiKey.id,
|
|
29
|
+
owner: apiKey.owner,
|
|
30
|
+
name: apiKey.name,
|
|
31
|
+
obfuscatedValue: apiKey.obfuscated_value,
|
|
32
|
+
lastUsedAt: apiKey.last_used_at,
|
|
33
|
+
permissions: apiKey.permissions,
|
|
34
|
+
createdAt: apiKey.created_at,
|
|
35
|
+
updatedAt: apiKey.updated_at
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
__name(deserializeApiKey, "deserializeApiKey");
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
deserializeApiKey
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=api-key.serializer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/api-keys/serializers/api-key.serializer.ts"],"sourcesContent":["import { ApiKey, SerializedApiKey } from '../interfaces/api-key.interface';\n\nexport function deserializeApiKey(apiKey: SerializedApiKey): ApiKey {\n return {\n object: apiKey.object,\n id: apiKey.id,\n owner: apiKey.owner,\n name: apiKey.name,\n obfuscatedValue: apiKey.obfuscated_value,\n lastUsedAt: apiKey.last_used_at,\n permissions: apiKey.permissions,\n createdAt: apiKey.created_at,\n updatedAt: apiKey.updated_at,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,kBAAkB,QAAkC;AAClE,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,IAAI,OAAO;AAAA,IACX,OAAO,OAAO;AAAA,IACd,MAAM,OAAO;AAAA,IACb,iBAAiB,OAAO;AAAA,IACxB,YAAY,OAAO;AAAA,IACnB,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,WAAW,OAAO;AAAA,EACpB;AACF;AAZgB;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var validate_api_key_serializer_exports = {};
|
|
21
|
+
__export(validate_api_key_serializer_exports, {
|
|
22
|
+
deserializeValidateApiKeyResponse: () => deserializeValidateApiKeyResponse
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(validate_api_key_serializer_exports);
|
|
25
|
+
var import_api_key = require('./api-key.serializer.cjs');
|
|
26
|
+
function deserializeValidateApiKeyResponse(response) {
|
|
27
|
+
return {
|
|
28
|
+
apiKey: response.api_key ? (0, import_api_key.deserializeApiKey)(response.api_key) : null
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
__name(deserializeValidateApiKeyResponse, "deserializeValidateApiKeyResponse");
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
deserializeValidateApiKeyResponse
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=validate-api-key.serializer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/api-keys/serializers/validate-api-key.serializer.ts"],"sourcesContent":["import {\n SerializedValidateApiKeyResponse,\n ValidateApiKeyResponse,\n} from '../interfaces/validate-api-key.interface';\nimport { deserializeApiKey } from './api-key.serializer';\n\nexport function deserializeValidateApiKeyResponse(\n response: SerializedValidateApiKeyResponse,\n): ValidateApiKeyResponse {\n return {\n apiKey: response.api_key ? deserializeApiKey(response.api_key) : null,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAAkC;AAE3B,SAAS,kCACd,UACwB;AACxB,SAAO;AAAA,IACL,QAAQ,SAAS,cAAU,kCAAkB,SAAS,OAAO,IAAI;AAAA,EACnE;AACF;AANgB;","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SerializedValidateApiKeyResponse, ValidateApiKeyResponse } from '../interfaces/validate-api-key.interface.cjs';
|
|
2
|
+
import '../interfaces/api-key.interface.cjs';
|
|
3
|
+
|
|
4
|
+
declare function deserializeValidateApiKeyResponse(response: SerializedValidateApiKeyResponse): ValidateApiKeyResponse;
|
|
5
|
+
|
|
6
|
+
export { deserializeValidateApiKeyResponse };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { c as AuditLogs } from '../workos-X1cDErJB.cjs';
|
|
2
2
|
import './interfaces/audit-log-export-options.interface.cjs';
|
|
3
3
|
import './interfaces/audit-log-export.interface.cjs';
|
|
4
4
|
import './interfaces/create-audit-log-event-options.interface.cjs';
|
|
@@ -8,12 +8,18 @@ import '../common/interfaces/post-options.interface.cjs';
|
|
|
8
8
|
import '../common/interfaces/put-options.interface.cjs';
|
|
9
9
|
import '../common/interfaces/workos-options.interface.cjs';
|
|
10
10
|
import '../common/interfaces/app-info.interface.cjs';
|
|
11
|
-
import '../
|
|
12
|
-
import '../common/interfaces/
|
|
11
|
+
import '../common/utils/pagination.cjs';
|
|
12
|
+
import '../common/interfaces/pagination-options.interface.cjs';
|
|
13
|
+
import '../common/interfaces/list.interface.cjs';
|
|
13
14
|
import '../directory-sync/interfaces/directory.interface.cjs';
|
|
14
15
|
import '../directory-sync/interfaces/directory-group.interface.cjs';
|
|
16
|
+
import '../directory-sync/interfaces/list-directories-options.interface.cjs';
|
|
17
|
+
import '../directory-sync/interfaces/list-groups-options.interface.cjs';
|
|
18
|
+
import '../directory-sync/interfaces/list-directory-users-options.interface.cjs';
|
|
15
19
|
import '../directory-sync/interfaces/directory-user.interface.cjs';
|
|
16
20
|
import '../roles/interfaces/role.interface.cjs';
|
|
21
|
+
import '../events/interfaces/list-events-options.interface.cjs';
|
|
22
|
+
import '../common/interfaces/event.interface.cjs';
|
|
17
23
|
import '../organizations/interfaces/organization.interface.cjs';
|
|
18
24
|
import '../organization-domains/interfaces/organization-domain.interface.cjs';
|
|
19
25
|
import '../sso/interfaces/connection.interface.cjs';
|
|
@@ -28,9 +34,6 @@ import '../user-management/interfaces/magic-auth.interface.cjs';
|
|
|
28
34
|
import '../user-management/interfaces/password-reset.interface.cjs';
|
|
29
35
|
import '../user-management/interfaces/session.interface.cjs';
|
|
30
36
|
import '../user-management/interfaces/impersonator.interface.cjs';
|
|
31
|
-
import '../common/interfaces/list.interface.cjs';
|
|
32
|
-
import '../common/utils/pagination.cjs';
|
|
33
|
-
import '../common/interfaces/pagination-options.interface.cjs';
|
|
34
37
|
import '../organizations/interfaces/create-organization-options.interface.cjs';
|
|
35
38
|
import '../organizations/interfaces/domain-data.interface.cjs';
|
|
36
39
|
import '../organizations/interfaces/list-organization-feature-flags-options.interface.cjs';
|
|
@@ -123,6 +126,5 @@ import '../vault/interfaces/object/delete-object.interface.cjs';
|
|
|
123
126
|
import '../vault/interfaces/object/read-object.interface.cjs';
|
|
124
127
|
import '../vault/interfaces/object.interface.cjs';
|
|
125
128
|
import '../vault/interfaces/object/update-object.interface.cjs';
|
|
126
|
-
import '../
|
|
127
|
-
import '../
|
|
128
|
-
import '../directory-sync/interfaces/list-directory-users-options.interface.cjs';
|
|
129
|
+
import '../api-keys/interfaces/validate-api-key.interface.cjs';
|
|
130
|
+
import '../api-keys/interfaces/api-key.interface.cjs';
|
package/lib/cjs/client/sso.cjs
CHANGED
|
@@ -22,7 +22,7 @@ __export(sso_exports, {
|
|
|
22
22
|
getAuthorizationUrl: () => getAuthorizationUrl
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(sso_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_query_string = require('../common/utils/query-string.cjs');
|
|
26
26
|
function getAuthorizationUrl(options) {
|
|
27
27
|
const {
|
|
28
28
|
connection,
|
|
@@ -42,7 +42,7 @@ function getAuthorizationUrl(options) {
|
|
|
42
42
|
`Incomplete arguments. Need to specify either a 'connection', 'organization', or 'provider'.`
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
-
const query = (0,
|
|
45
|
+
const query = (0, import_query_string.toQueryString)({
|
|
46
46
|
connection,
|
|
47
47
|
organization,
|
|
48
48
|
domain_hint: domainHint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/sso.ts"],"sourcesContent":["import { toQueryString } from '
|
|
1
|
+
{"version":3,"sources":["../../../src/client/sso.ts"],"sourcesContent":["import { toQueryString } from '../common/utils/query-string';\nimport type { SSOAuthorizationURLOptions as BaseSSOAuthorizationURLOptions } from '../sso/interfaces';\n\n// Extend the base options to include baseURL for internal use\nexport type SSOAuthorizationURLOptions = BaseSSOAuthorizationURLOptions & {\n baseURL?: string;\n};\n\n/**\n * Generates the authorization URL for SSO authentication.\n * Does not require an API key, suitable for OAuth client operations.\n *\n * @param options - SSO authorization URL options\n * @returns The authorization URL as a string\n * @throws Error if required arguments are missing\n */\nexport function getAuthorizationUrl(\n options: SSOAuthorizationURLOptions,\n): string {\n const {\n connection,\n clientId,\n domainHint,\n loginHint,\n organization,\n provider,\n providerQueryParams,\n providerScopes,\n redirectUri,\n state,\n baseURL = 'https://api.workos.com',\n } = options;\n\n if (!provider && !connection && !organization) {\n throw new Error(\n `Incomplete arguments. Need to specify either a 'connection', 'organization', or 'provider'.`,\n );\n }\n\n const query = toQueryString({\n connection,\n organization,\n domain_hint: domainHint,\n login_hint: loginHint,\n provider,\n provider_query_params: providerQueryParams,\n provider_scopes: providerScopes,\n client_id: clientId,\n redirect_uri: redirectUri,\n response_type: 'code',\n state,\n });\n\n return `${baseURL}/sso/authorize?${query}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA8B;AAgBvB,SAAS,oBACd,SACQ;AACR,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,EACZ,IAAI;AAEJ,MAAI,CAAC,YAAY,CAAC,cAAc,CAAC,cAAc;AAC7C,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,YAAQ,mCAAc;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,YAAY;AAAA,IACZ;AAAA,IACA,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,cAAc;AAAA,IACd,eAAe;AAAA,IACf;AAAA,EACF,CAAC;AAED,SAAO,GAAG,OAAO,kBAAkB,KAAK;AAC1C;AAtCgB;","names":[]}
|
|
@@ -24,7 +24,7 @@ __export(user_management_exports, {
|
|
|
24
24
|
getLogoutUrl: () => getLogoutUrl
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(user_management_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_query_string = require('../common/utils/query-string.cjs');
|
|
28
28
|
function getAuthorizationUrl(options) {
|
|
29
29
|
const {
|
|
30
30
|
connectionId,
|
|
@@ -53,7 +53,7 @@ function getAuthorizationUrl(options) {
|
|
|
53
53
|
`'screenHint' is only supported for 'authkit' provider`
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
const query = (0,
|
|
56
|
+
const query = (0, import_query_string.toQueryString)({
|
|
57
57
|
connection_id: connectionId,
|
|
58
58
|
code_challenge: codeChallenge,
|
|
59
59
|
code_challenge_method: codeChallengeMethod,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/user-management.ts"],"sourcesContent":["import { toQueryString } from '
|
|
1
|
+
{"version":3,"sources":["../../../src/client/user-management.ts"],"sourcesContent":["import { toQueryString } from '../common/utils/query-string';\n\n// Re-export necessary interfaces for client use\nexport interface AuthorizationURLOptions {\n clientId: string;\n codeChallenge?: string;\n codeChallengeMethod?: 'S256';\n connectionId?: string;\n organizationId?: string;\n domainHint?: string;\n loginHint?: string;\n provider?: string;\n providerQueryParams?: Record<string, string | boolean | number>;\n providerScopes?: string[];\n prompt?: string;\n redirectUri: string;\n state?: string;\n screenHint?: 'sign-up' | 'sign-in';\n}\n\nexport interface LogoutURLOptions {\n sessionId: string;\n returnTo?: string;\n}\n\n/**\n * Generates the authorization URL for OAuth client authentication.\n * Suitable for PKCE flows and other OAuth client operations that don't require an API key.\n *\n * @param options - Authorization URL options\n * @returns The authorization URL as a string\n * @throws TypeError if required arguments are missing\n */\nexport function getAuthorizationUrl(\n options: AuthorizationURLOptions & { baseURL?: string },\n): string {\n const {\n connectionId,\n codeChallenge,\n codeChallengeMethod,\n clientId,\n domainHint,\n loginHint,\n organizationId,\n provider,\n providerQueryParams,\n providerScopes,\n prompt,\n redirectUri,\n state,\n screenHint,\n baseURL = 'https://api.workos.com',\n } = options;\n\n if (!provider && !connectionId && !organizationId) {\n throw new TypeError(\n `Incomplete arguments. Need to specify either a 'connectionId', 'organizationId', or 'provider'.`,\n );\n }\n\n if (provider !== 'authkit' && screenHint) {\n throw new TypeError(\n `'screenHint' is only supported for 'authkit' provider`,\n );\n }\n\n const query = toQueryString({\n connection_id: connectionId,\n code_challenge: codeChallenge,\n code_challenge_method: codeChallengeMethod,\n organization_id: organizationId,\n domain_hint: domainHint,\n login_hint: loginHint,\n provider,\n provider_query_params: providerQueryParams,\n provider_scopes: providerScopes,\n prompt,\n client_id: clientId,\n redirect_uri: redirectUri,\n response_type: 'code',\n state,\n screen_hint: screenHint,\n });\n\n return `${baseURL}/user_management/authorize?${query}`;\n}\n\n/**\n * Generates the logout URL for ending a user session.\n * This method is safe to use in browser environments as it doesn't require an API key.\n *\n * @param options - Logout URL options\n * @returns The logout URL as a string\n * @throws TypeError if sessionId is not provided\n */\nexport function getLogoutUrl(\n options: LogoutURLOptions & { baseURL?: string },\n): string {\n const { sessionId, returnTo, baseURL = 'https://api.workos.com' } = options;\n\n if (!sessionId) {\n throw new TypeError(`Incomplete arguments. Need to specify 'sessionId'.`);\n }\n\n const url = new URL('/user_management/sessions/logout', baseURL);\n\n url.searchParams.set('session_id', sessionId);\n if (returnTo) {\n url.searchParams.set('return_to', returnTo);\n }\n\n return url.toString();\n}\n\n/**\n * Gets the JWKS (JSON Web Key Set) URL for a given client ID.\n * Does not require an API key, returns the public JWKS endpoint.\n *\n * @param clientId - The WorkOS client ID\n * @param baseURL - Optional base URL for the API (defaults to https://api.workos.com)\n * @returns The JWKS URL as a string\n * @throws TypeError if clientId is not provided\n */\nexport function getJwksUrl(\n clientId: string,\n baseURL = 'https://api.workos.com',\n): string {\n if (!clientId) {\n throw new TypeError('clientId must be a valid clientId');\n }\n\n return `${baseURL}/sso/jwks/${clientId}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA8B;AAiCvB,SAAS,oBACd,SACQ;AACR,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,EACZ,IAAI;AAEJ,MAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,gBAAgB;AACjD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,MAAI,aAAa,aAAa,YAAY;AACxC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,YAAQ,mCAAc;AAAA,IAC1B,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,YAAY;AAAA,IACZ;AAAA,IACA,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB;AAAA,IACA,WAAW;AAAA,IACX,cAAc;AAAA,IACd,eAAe;AAAA,IACf;AAAA,IACA,aAAa;AAAA,EACf,CAAC;AAED,SAAO,GAAG,OAAO,8BAA8B,KAAK;AACtD;AApDgB;AA8DT,SAAS,aACd,SACQ;AACR,QAAM,EAAE,WAAW,UAAU,UAAU,yBAAyB,IAAI;AAEpE,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,UAAU,oDAAoD;AAAA,EAC1E;AAEA,QAAM,MAAM,IAAI,IAAI,oCAAoC,OAAO;AAE/D,MAAI,aAAa,IAAI,cAAc,SAAS;AAC5C,MAAI,UAAU;AACZ,QAAI,aAAa,IAAI,aAAa,QAAQ;AAAA,EAC5C;AAEA,SAAO,IAAI,SAAS;AACtB;AAjBgB;AA4BT,SAAS,WACd,UACA,UAAU,0BACF;AACR,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,UAAU,mCAAmC;AAAA,EACzD;AAEA,SAAO,GAAG,OAAO,aAAa,QAAQ;AACxC;AATgB;","names":[]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
7
|
var __export = (target, all) => {
|
|
@@ -18,21 +16,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
var unprocessable_entity_exception_exports = {};
|
|
31
21
|
__export(unprocessable_entity_exception_exports, {
|
|
32
22
|
UnprocessableEntityException: () => UnprocessableEntityException
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(unprocessable_entity_exception_exports);
|
|
35
|
-
var import_pluralize = __toESM(require("pluralize"), 1);
|
|
36
25
|
class UnprocessableEntityException extends Error {
|
|
37
26
|
static {
|
|
38
27
|
__name(this, "UnprocessableEntityException");
|
|
@@ -57,7 +46,7 @@ class UnprocessableEntityException extends Error {
|
|
|
57
46
|
this.code = code;
|
|
58
47
|
}
|
|
59
48
|
if (errors) {
|
|
60
|
-
const requirement =
|
|
49
|
+
const requirement = errors.length === 1 ? "requirement" : "requirements";
|
|
61
50
|
this.message = `The following ${requirement} must be met:
|
|
62
51
|
`;
|
|
63
52
|
for (const { code: code2 } of errors) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/common/exceptions/unprocessable-entity.exception.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../../src/common/exceptions/unprocessable-entity.exception.ts"],"sourcesContent":["import { UnprocessableEntityError } from '../interfaces';\nimport { RequestException } from '../interfaces/request-exception.interface';\n\nexport class UnprocessableEntityException\n extends Error\n implements RequestException\n{\n readonly status = 422;\n readonly name = 'UnprocessableEntityException';\n readonly message: string = 'Unprocessable entity';\n readonly code?: string;\n readonly requestID: string;\n\n constructor({\n code,\n errors,\n message,\n requestID,\n }: {\n code?: string;\n errors?: UnprocessableEntityError[];\n message?: string;\n requestID: string;\n }) {\n super();\n\n this.requestID = requestID;\n\n if (message) {\n this.message = message;\n }\n\n if (code) {\n this.code = code;\n }\n\n if (errors) {\n const requirement = errors.length === 1 ? 'requirement' : 'requirements';\n\n this.message = `The following ${requirement} must be met:\\n`;\n\n for (const { code } of errors) {\n this.message = this.message.concat(`\\t${code}\\n`);\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,qCACH,MAEV;AAAA,EANA,OAMA;AAAA;AAAA;AAAA,EACW,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EAET,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAKG;AACD,UAAM;AAEN,SAAK,YAAY;AAEjB,QAAI,SAAS;AACX,WAAK,UAAU;AAAA,IACjB;AAEA,QAAI,MAAM;AACR,WAAK,OAAO;AAAA,IACd;AAEA,QAAI,QAAQ;AACV,YAAM,cAAc,OAAO,WAAW,IAAI,gBAAgB;AAE1D,WAAK,UAAU,iBAAiB,WAAW;AAAA;AAE3C,iBAAW,EAAE,MAAAA,MAAK,KAAK,QAAQ;AAC7B,aAAK,UAAU,KAAK,QAAQ,OAAO,IAAKA,KAAI;AAAA,CAAI;AAAA,MAClD;AAAA,IACF;AAAA,EACF;AACF;","names":["code"]}
|
|
@@ -55,7 +55,7 @@ class FetchHttpClient extends import_http_client2.HttpClient {
|
|
|
55
55
|
path,
|
|
56
56
|
options.params
|
|
57
57
|
);
|
|
58
|
-
if (
|
|
58
|
+
if (import_http_client2.HttpClient.isPathRetryable(path)) {
|
|
59
59
|
return await this.fetchRequestWithRetry(
|
|
60
60
|
resourceURL,
|
|
61
61
|
"GET",
|
|
@@ -72,7 +72,7 @@ class FetchHttpClient extends import_http_client2.HttpClient {
|
|
|
72
72
|
path,
|
|
73
73
|
options.params
|
|
74
74
|
);
|
|
75
|
-
if (
|
|
75
|
+
if (import_http_client2.HttpClient.isPathRetryable(path)) {
|
|
76
76
|
return await this.fetchRequestWithRetry(
|
|
77
77
|
resourceURL,
|
|
78
78
|
"POST",
|
|
@@ -100,7 +100,7 @@ class FetchHttpClient extends import_http_client2.HttpClient {
|
|
|
100
100
|
path,
|
|
101
101
|
options.params
|
|
102
102
|
);
|
|
103
|
-
if (
|
|
103
|
+
if (import_http_client2.HttpClient.isPathRetryable(path)) {
|
|
104
104
|
return await this.fetchRequestWithRetry(
|
|
105
105
|
resourceURL,
|
|
106
106
|
"PUT",
|
|
@@ -128,7 +128,7 @@ class FetchHttpClient extends import_http_client2.HttpClient {
|
|
|
128
128
|
path,
|
|
129
129
|
options.params
|
|
130
130
|
);
|
|
131
|
-
if (
|
|
131
|
+
if (import_http_client2.HttpClient.isPathRetryable(path)) {
|
|
132
132
|
return await this.fetchRequestWithRetry(
|
|
133
133
|
resourceURL,
|
|
134
134
|
"DELETE",
|