@workos-inc/node 8.0.0-beta.3 → 8.0.0-beta.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/lib/cjs/audit-logs/audit-logs.d.cts +3 -2
- package/lib/cjs/client/index.cjs +42 -0
- package/lib/cjs/client/index.cjs.map +1 -0
- package/lib/cjs/client/index.d.cts +3 -0
- package/lib/cjs/client/sso.cjs +65 -0
- package/lib/cjs/client/sso.cjs.map +1 -0
- package/lib/cjs/client/sso.d.cts +2 -0
- package/lib/cjs/client/user-management.cjs +110 -0
- package/lib/cjs/client/user-management.cjs.map +1 -0
- package/lib/cjs/client/user-management.d.cts +1 -0
- package/lib/cjs/client/utils.cjs +49 -0
- package/lib/cjs/client/utils.cjs.map +1 -0
- package/lib/cjs/client/utils.d.cts +7 -0
- package/lib/cjs/common/decorators/public-method.cjs +48 -0
- package/lib/cjs/common/decorators/public-method.cjs.map +1 -0
- package/lib/cjs/common/decorators/public-method.d.cts +12 -0
- package/lib/cjs/common/interfaces/event.interface.cjs.map +1 -1
- package/lib/cjs/common/interfaces/event.interface.d.cts +19 -3
- package/lib/cjs/common/interfaces/index.d.cts +1 -1
- package/lib/cjs/common/interfaces/workos-options.interface.cjs.map +1 -1
- package/lib/cjs/common/interfaces/workos-options.interface.d.cts +1 -0
- package/lib/cjs/common/net/fetch-client.cjs +67 -36
- package/lib/cjs/common/net/fetch-client.cjs.map +1 -1
- package/lib/cjs/common/net/fetch-client.d.cts +5 -2
- package/lib/cjs/common/serializers/event.serializer.cjs +2 -0
- package/lib/cjs/common/serializers/event.serializer.cjs.map +1 -1
- package/lib/cjs/common/utils/fetch-and-deserialize.d.cts +3 -2
- package/lib/cjs/common/utils/pagination.cjs +2 -4
- package/lib/cjs/common/utils/pagination.cjs.map +1 -1
- package/lib/cjs/common/utils/runtime-info.cjs +73 -0
- package/lib/cjs/common/utils/runtime-info.cjs.map +1 -0
- package/lib/cjs/common/utils/runtime-info.d.cts +22 -0
- package/lib/cjs/directory-sync/directory-sync.d.cts +4 -3
- package/lib/cjs/events/events.d.cts +3 -2
- package/lib/cjs/fga/fga.d.cts +4 -3
- package/lib/cjs/fga/utils/fetch-and-deserialize-list.d.cts +3 -2
- package/lib/cjs/index.cjs +2 -0
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/index.client.cjs +42 -0
- package/lib/cjs/index.client.cjs.map +1 -0
- package/lib/cjs/index.client.d.cts +3 -0
- package/lib/cjs/index.d.cts +3 -2
- package/lib/cjs/index.public.cjs +52 -0
- package/lib/cjs/index.public.cjs.map +1 -0
- package/lib/cjs/index.public.d.cts +36 -0
- package/lib/cjs/index.worker.d.cts +3 -2
- package/lib/cjs/mfa/mfa.d.cts +3 -2
- package/lib/cjs/organization-domains/organization-domains.d.cts +3 -2
- package/lib/cjs/organizations/interfaces/list-organization-feature-flags-options.interface.cjs.map +1 -1
- package/lib/cjs/organizations/interfaces/list-organization-feature-flags-options.interface.d.cts +3 -1
- package/lib/cjs/organizations/organizations.cjs +15 -5
- package/lib/cjs/organizations/organizations.cjs.map +1 -1
- package/lib/cjs/organizations/organizations.d.cts +4 -3
- package/lib/cjs/passwordless/passwordless.d.cts +3 -2
- package/lib/cjs/portal/portal.d.cts +3 -2
- package/lib/cjs/public/index.cjs +42 -0
- package/lib/cjs/public/index.cjs.map +1 -0
- package/lib/cjs/public/index.d.cts +2 -0
- package/lib/cjs/public/sso.cjs +65 -0
- package/lib/cjs/public/sso.cjs.map +1 -0
- package/lib/cjs/public/sso.d.cts +1 -0
- package/lib/cjs/public/user-management.cjs +110 -0
- package/lib/cjs/public/user-management.cjs.map +1 -0
- package/lib/cjs/public/user-management.d.cts +1 -0
- package/lib/cjs/public/utils.cjs +49 -0
- package/lib/cjs/public/utils.cjs.map +1 -0
- package/lib/cjs/public/utils.d.cts +7 -0
- package/lib/cjs/sso/interfaces/authorization-url-options.interface.cjs.map +1 -1
- package/lib/cjs/sso/interfaces/authorization-url-options.interface.d.cts +19 -4
- package/lib/cjs/sso/interfaces/connection-type.enum.cjs +1 -0
- package/lib/cjs/sso/interfaces/connection-type.enum.cjs.map +1 -1
- package/lib/cjs/sso/interfaces/connection-type.enum.d.cts +1 -0
- package/lib/cjs/sso/interfaces/index.d.cts +1 -0
- package/lib/cjs/sso/interfaces/profile-and-token.interface.cjs.map +1 -1
- package/lib/cjs/sso/interfaces/profile-and-token.interface.d.cts +3 -0
- package/lib/cjs/sso/serializers/index.d.cts +1 -0
- package/lib/cjs/sso/serializers/profile-and-token.serializer.cjs +3 -1
- package/lib/cjs/sso/serializers/profile-and-token.serializer.cjs.map +1 -1
- package/lib/cjs/sso/serializers/profile-and-token.serializer.d.cts +1 -0
- package/lib/cjs/sso/sso.cjs +15 -37
- package/lib/cjs/sso/sso.cjs.map +1 -1
- package/lib/cjs/sso/sso.d.cts +2 -1
- package/lib/cjs/sso-BkBnkcTC.d.cts +22 -0
- package/lib/cjs/sso-Cdnhezcz.d.cts +31 -0
- package/lib/cjs/sso-DwRz-nPM.d.cts +31 -0
- package/lib/cjs/user-management/interfaces/authenticate-with-session-cookie.interface.cjs.map +1 -1
- package/lib/cjs/user-management/interfaces/authenticate-with-session-cookie.interface.d.cts +2 -0
- package/lib/cjs/user-management/interfaces/authentication-response.interface.cjs.map +1 -1
- package/lib/cjs/user-management/interfaces/authentication-response.interface.d.cts +1 -1
- package/lib/cjs/user-management/interfaces/create-organization-membership-options.interface.cjs.map +1 -1
- package/lib/cjs/user-management/interfaces/create-organization-membership-options.interface.d.cts +2 -0
- package/lib/cjs/user-management/interfaces/identity.interface.cjs.map +1 -1
- package/lib/cjs/user-management/interfaces/identity.interface.d.cts +2 -2
- package/lib/cjs/user-management/interfaces/list-sessions-options.interface.cjs.map +1 -1
- package/lib/cjs/user-management/interfaces/organization-membership.interface.cjs.map +1 -1
- package/lib/cjs/user-management/interfaces/organization-membership.interface.d.cts +2 -0
- package/lib/cjs/user-management/interfaces/update-organization-membership-options.interface.cjs.map +1 -1
- package/lib/cjs/user-management/interfaces/update-organization-membership-options.interface.d.cts +2 -0
- package/lib/cjs/user-management/serializers/create-organization-membership-options.serializer.cjs +2 -1
- package/lib/cjs/user-management/serializers/create-organization-membership-options.serializer.cjs.map +1 -1
- package/lib/cjs/user-management/serializers/organization-membership.serializer.cjs +2 -1
- package/lib/cjs/user-management/serializers/organization-membership.serializer.cjs.map +1 -1
- package/lib/cjs/user-management/serializers/update-organization-membership-options.serializer.cjs +2 -1
- package/lib/cjs/user-management/serializers/update-organization-membership-options.serializer.cjs.map +1 -1
- package/lib/cjs/user-management/session.cjs +4 -0
- package/lib/cjs/user-management/session.cjs.map +1 -1
- package/lib/cjs/user-management/session.d.cts +2 -1
- package/lib/cjs/user-management/user-management.cjs +13 -81
- package/lib/cjs/user-management/user-management.cjs.map +1 -1
- package/lib/cjs/user-management/user-management.d.cts +3 -2
- package/lib/cjs/user-management-B-71OTAR.d.cts +401 -0
- package/lib/cjs/user-management-B38wNrIN.d.cts +68 -0
- package/lib/cjs/user-management-Dh73wyCr.d.cts +68 -0
- package/lib/cjs/vault/vault.d.cts +3 -2
- package/lib/cjs/widgets/interfaces/get-token.cjs.map +1 -1
- package/lib/cjs/widgets/interfaces/get-token.d.cts +5 -5
- package/lib/cjs/widgets/widgets.d.cts +3 -2
- package/lib/cjs/workos-BEHZtxw8.d.cts +401 -0
- package/lib/cjs/workos-Bt8QqzZV.d.cts +395 -0
- package/lib/cjs/workos-C6IZ2mAH.d.cts +402 -0
- package/lib/cjs/workos-C7eLbzyK.d.cts +398 -0
- package/lib/cjs/workos-C9Z7mAdD.d.cts +399 -0
- package/lib/cjs/workos-CUh2oD_o.d.cts +396 -0
- package/lib/cjs/workos-Cuegztvg.d.cts +397 -0
- package/lib/cjs/workos-DiEirbod.d.cts +397 -0
- package/lib/cjs/workos-jsQjZHfV.d.cts +395 -0
- package/lib/cjs/workos.cjs +2 -1
- package/lib/cjs/workos.cjs.map +1 -1
- package/lib/cjs/workos.d.cts +3 -2
- package/lib/common/interfaces/event.interface.d.ts +18 -2
- package/lib/common/interfaces/workos-options.interface.d.ts +1 -0
- package/lib/common/net/fetch-client.d.ts +6 -2
- package/lib/common/net/fetch-client.js +67 -31
- package/lib/common/net/fetch-client.spec.js +71 -0
- package/lib/common/serializers/event.serializer.js +2 -0
- package/lib/common/utils/pagination.js +1 -1
- package/lib/esm/audit-logs/audit-logs.d.ts +3 -2
- package/lib/esm/client/index.d.ts +3 -0
- package/lib/esm/client/index.js +7 -0
- package/lib/esm/client/index.js.map +1 -0
- package/lib/esm/client/sso.d.ts +2 -0
- package/lib/esm/client/sso.js +42 -0
- package/lib/esm/client/sso.js.map +1 -0
- package/lib/esm/client/user-management.d.ts +1 -0
- package/lib/esm/client/user-management.js +85 -0
- package/lib/esm/client/user-management.js.map +1 -0
- package/lib/esm/client/utils.d.ts +7 -0
- package/lib/esm/client/utils.js +16 -0
- package/lib/esm/client/utils.js.map +1 -0
- package/lib/esm/common/interfaces/event.interface.d.ts +19 -3
- package/lib/esm/common/interfaces/index.d.ts +1 -1
- package/lib/esm/common/interfaces/workos-options.interface.d.ts +1 -0
- package/lib/esm/common/net/fetch-client.d.ts +5 -2
- package/lib/esm/common/net/fetch-client.js +67 -36
- package/lib/esm/common/net/fetch-client.js.map +1 -1
- package/lib/esm/common/serializers/event.serializer.js +2 -0
- package/lib/esm/common/serializers/event.serializer.js.map +1 -1
- package/lib/esm/common/utils/fetch-and-deserialize.d.ts +3 -2
- package/lib/esm/common/utils/pagination.js +2 -4
- package/lib/esm/common/utils/pagination.js.map +1 -1
- package/lib/esm/directory-sync/directory-sync.d.ts +4 -3
- package/lib/esm/events/events.d.ts +3 -2
- package/lib/esm/fga/fga.d.ts +4 -3
- package/lib/esm/fga/utils/fetch-and-deserialize-list.d.ts +3 -2
- package/lib/esm/index.client.d.ts +3 -0
- package/lib/esm/index.client.js +7 -0
- package/lib/esm/index.client.js.map +1 -0
- package/lib/esm/index.d.ts +3 -2
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/index.worker.d.ts +3 -2
- package/lib/esm/mfa/mfa.d.ts +3 -2
- package/lib/esm/organization-domains/organization-domains.d.ts +3 -2
- package/lib/esm/organizations/interfaces/list-organization-feature-flags-options.interface.d.ts +3 -1
- package/lib/esm/organizations/organizations.d.ts +4 -3
- package/lib/esm/organizations/organizations.js +15 -5
- package/lib/esm/organizations/organizations.js.map +1 -1
- package/lib/esm/passwordless/passwordless.d.ts +3 -2
- package/lib/esm/portal/portal.d.ts +3 -2
- package/lib/esm/sso/interfaces/authorization-url-options.interface.d.ts +19 -4
- package/lib/esm/sso/interfaces/connection-type.enum.d.ts +1 -0
- package/lib/esm/sso/interfaces/connection-type.enum.js +1 -0
- package/lib/esm/sso/interfaces/connection-type.enum.js.map +1 -1
- package/lib/esm/sso/interfaces/index.d.ts +1 -0
- package/lib/esm/sso/interfaces/profile-and-token.interface.d.ts +3 -0
- package/lib/esm/sso/serializers/index.d.ts +1 -0
- package/lib/esm/sso/serializers/profile-and-token.serializer.d.ts +1 -0
- package/lib/esm/sso/serializers/profile-and-token.serializer.js +3 -1
- package/lib/esm/sso/serializers/profile-and-token.serializer.js.map +1 -1
- package/lib/esm/sso/sso.d.ts +2 -1
- package/lib/esm/sso/sso.js +5 -37
- package/lib/esm/sso/sso.js.map +1 -1
- package/lib/esm/sso-nFEQz_Js.d.ts +22 -0
- package/lib/esm/user-management/interfaces/authenticate-with-session-cookie.interface.d.ts +2 -0
- package/lib/esm/user-management/interfaces/authenticate-with-session-cookie.interface.js.map +1 -1
- package/lib/esm/user-management/interfaces/authentication-response.interface.d.ts +1 -1
- package/lib/esm/user-management/interfaces/create-organization-membership-options.interface.d.ts +2 -0
- package/lib/esm/user-management/interfaces/identity.interface.d.ts +2 -2
- package/lib/esm/user-management/interfaces/organization-membership.interface.d.ts +2 -0
- package/lib/esm/user-management/interfaces/update-organization-membership-options.interface.d.ts +2 -0
- package/lib/esm/user-management/serializers/create-organization-membership-options.serializer.js +2 -1
- package/lib/esm/user-management/serializers/create-organization-membership-options.serializer.js.map +1 -1
- package/lib/esm/user-management/serializers/organization-membership.serializer.js +2 -1
- package/lib/esm/user-management/serializers/organization-membership.serializer.js.map +1 -1
- package/lib/esm/user-management/serializers/update-organization-membership-options.serializer.js +2 -1
- package/lib/esm/user-management/serializers/update-organization-membership-options.serializer.js.map +1 -1
- package/lib/esm/user-management/session.d.ts +2 -1
- package/lib/esm/user-management/session.js +4 -0
- package/lib/esm/user-management/session.js.map +1 -1
- package/lib/esm/user-management/user-management.d.ts +3 -2
- package/lib/esm/user-management/user-management.js +13 -81
- package/lib/esm/user-management/user-management.js.map +1 -1
- package/lib/esm/user-management-B38wNrIN.d.ts +68 -0
- package/lib/esm/vault/vault.d.ts +3 -2
- package/lib/esm/widgets/interfaces/get-token.d.ts +5 -5
- package/lib/esm/widgets/interfaces/get-token.js.map +1 -1
- package/lib/esm/widgets/widgets.d.ts +3 -2
- package/lib/esm/{workos-DGRMJ65Z.d.ts → workos-EX3jNkYH.d.ts} +5 -7
- package/lib/esm/workos.d.ts +3 -2
- package/lib/esm/workos.js +2 -1
- package/lib/esm/workos.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/organizations/interfaces/list-organization-feature-flags-options.interface.d.ts +2 -1
- package/lib/organizations/organizations.d.ts +1 -2
- package/lib/organizations/organizations.js +2 -4
- package/lib/organizations/organizations.spec.js +46 -1
- package/lib/sso/interfaces/authorization-url-options.interface.d.ts +2 -0
- package/lib/sso/interfaces/profile-and-token.interface.d.ts +3 -0
- package/lib/sso/serializers/profile-and-token.serializer.js +2 -0
- package/lib/sso/sso.d.ts +1 -1
- package/lib/sso/sso.js +14 -10
- package/lib/sso/sso.spec.js +131 -0
- package/lib/user-management/interfaces/authenticate-with-session-cookie.interface.d.ts +2 -0
- package/lib/user-management/interfaces/create-organization-membership-options.interface.d.ts +2 -0
- package/lib/user-management/interfaces/organization-membership.interface.d.ts +2 -0
- package/lib/user-management/interfaces/update-organization-membership-options.interface.d.ts +2 -0
- package/lib/user-management/serializers/create-organization-membership-options.serializer.js +1 -0
- package/lib/user-management/serializers/organization-membership.serializer.js +1 -11
- package/lib/user-management/serializers/update-organization-membership-options.serializer.js +1 -0
- package/lib/user-management/session.js +4 -2
- package/lib/user-management/session.spec.js +4 -2
- package/lib/user-management/user-management.js +2 -1
- package/lib/user-management/user-management.spec.js +33 -0
- package/lib/widgets/interfaces/get-token.d.ts +5 -5
- package/lib/workos.js +2 -2
- package/package.json +10 -5
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.FetchHttpClientResponse = exports.FetchHttpClient = void 0;
|
|
13
13
|
const http_client_1 = require("./http-client");
|
|
14
14
|
const parse_error_1 = require("../exceptions/parse-error");
|
|
15
|
+
const DEFAULT_FETCH_TIMEOUT = 60000; // 60 seconds
|
|
15
16
|
class FetchHttpClient extends http_client_1.HttpClient {
|
|
16
17
|
constructor(baseURL, options, fetchFn) {
|
|
17
18
|
super(baseURL, options);
|
|
@@ -75,47 +76,82 @@ class FetchHttpClient extends http_client_1.HttpClient {
|
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
fetchRequest(url, method, body, headers) {
|
|
78
|
-
var _a, _b, _c;
|
|
79
|
+
var _a, _b, _c, _d, _e;
|
|
79
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
81
|
// For methods which expect payloads, we should always pass a body value
|
|
81
82
|
// even when it is empty. Without this, some JS runtimes (eg. Deno) will
|
|
82
83
|
// inject a second Content-Length header.
|
|
83
84
|
const methodHasPayload = method === 'POST' || method === 'PUT' || method === 'PATCH';
|
|
84
85
|
const requestBody = body || (methodHasPayload ? '' : undefined);
|
|
85
|
-
const { 'User-Agent': userAgent } = (_a = this.options) === null || _a === void 0 ? void 0 : _a.headers
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
const { 'User-Agent': userAgent } = (((_a = this.options) === null || _a === void 0 ? void 0 : _a.headers) ||
|
|
87
|
+
{});
|
|
88
|
+
// Create AbortController for timeout if configured
|
|
89
|
+
let abortController;
|
|
90
|
+
let timeoutId;
|
|
91
|
+
// Access timeout from the options with default of 60 seconds
|
|
92
|
+
const timeout = (_c = (_b = this.options) === null || _b === void 0 ? void 0 : _b.timeout) !== null && _c !== void 0 ? _c : DEFAULT_FETCH_TIMEOUT; // Default 60 seconds
|
|
93
|
+
abortController = new AbortController();
|
|
94
|
+
timeoutId = setTimeout(() => {
|
|
95
|
+
abortController === null || abortController === void 0 ? void 0 : abortController.abort();
|
|
96
|
+
}, timeout);
|
|
97
|
+
try {
|
|
98
|
+
const res = yield this._fetchFn(url, {
|
|
99
|
+
method,
|
|
100
|
+
headers: Object.assign(Object.assign(Object.assign({ Accept: 'application/json, text/plain, */*', 'Content-Type': 'application/json' }, (_d = this.options) === null || _d === void 0 ? void 0 : _d.headers), headers), { 'User-Agent': this.addClientToUserAgent((userAgent || 'workos-node').toString()) }),
|
|
101
|
+
body: requestBody,
|
|
102
|
+
signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
|
|
103
|
+
});
|
|
104
|
+
// Clear timeout if request completed successfully
|
|
105
|
+
if (timeoutId) {
|
|
106
|
+
clearTimeout(timeoutId);
|
|
97
107
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
if (!res.ok) {
|
|
109
|
+
const requestID = (_e = res.headers.get('X-Request-ID')) !== null && _e !== void 0 ? _e : '';
|
|
110
|
+
const rawBody = yield res.text();
|
|
111
|
+
let responseJson;
|
|
112
|
+
try {
|
|
113
|
+
responseJson = JSON.parse(rawBody);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (error instanceof SyntaxError) {
|
|
117
|
+
throw new parse_error_1.ParseError({
|
|
118
|
+
message: error.message,
|
|
119
|
+
rawBody,
|
|
120
|
+
requestID,
|
|
121
|
+
rawStatus: res.status,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
throw error;
|
|
106
125
|
}
|
|
107
|
-
throw
|
|
126
|
+
throw new http_client_1.HttpClientError({
|
|
127
|
+
message: res.statusText,
|
|
128
|
+
response: {
|
|
129
|
+
status: res.status,
|
|
130
|
+
headers: res.headers,
|
|
131
|
+
data: responseJson,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
108
134
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
135
|
+
return new FetchHttpClientResponse(res);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
// Clear timeout if request failed
|
|
139
|
+
if (timeoutId) {
|
|
140
|
+
clearTimeout(timeoutId);
|
|
141
|
+
}
|
|
142
|
+
// Handle timeout errors
|
|
143
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
144
|
+
throw new http_client_1.HttpClientError({
|
|
145
|
+
message: `Request timeout after ${timeout}ms`,
|
|
146
|
+
response: {
|
|
147
|
+
status: 408,
|
|
148
|
+
headers: {},
|
|
149
|
+
data: { error: 'Request timeout' },
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
throw error;
|
|
117
154
|
}
|
|
118
|
-
return new FetchHttpClientResponse(res);
|
|
119
155
|
});
|
|
120
156
|
}
|
|
121
157
|
fetchRequestWithRetry(url, method, body, headers) {
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const jest_fetch_mock_1 = __importDefault(require("jest-fetch-mock"));
|
|
16
16
|
const test_utils_1 = require("../../common/utils/test-utils");
|
|
17
17
|
const fetch_client_1 = require("./fetch-client");
|
|
18
|
+
const http_client_1 = require("./http-client");
|
|
18
19
|
const parse_error_1 = require("../exceptions/parse-error");
|
|
19
20
|
const fetchClient = new fetch_client_1.FetchHttpClient('https://test.workos.com', {
|
|
20
21
|
headers: {
|
|
@@ -205,3 +206,73 @@ describe('Fetch client', () => {
|
|
|
205
206
|
}));
|
|
206
207
|
});
|
|
207
208
|
});
|
|
209
|
+
describe('FetchHttpClient with timeout', () => {
|
|
210
|
+
let client;
|
|
211
|
+
let mockFetch;
|
|
212
|
+
beforeEach(() => {
|
|
213
|
+
mockFetch = jest.fn();
|
|
214
|
+
client = new fetch_client_1.FetchHttpClient('https://api.example.com', { timeout: 100 }, mockFetch);
|
|
215
|
+
});
|
|
216
|
+
it('should timeout requests that take too long', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
217
|
+
// Mock a fetch that respects AbortController
|
|
218
|
+
mockFetch.mockImplementation((_, options) => {
|
|
219
|
+
return new Promise((_, reject) => {
|
|
220
|
+
if (options.signal) {
|
|
221
|
+
options.signal.addEventListener('abort', () => {
|
|
222
|
+
const error = new Error('AbortError');
|
|
223
|
+
error.name = 'AbortError';
|
|
224
|
+
reject(error);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
// Never resolve - let the timeout trigger
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
yield expect(client.post('/test', { data: 'test' }, {})).rejects.toThrow(http_client_1.HttpClientError);
|
|
231
|
+
// Reset the mock for the second test
|
|
232
|
+
mockFetch.mockClear();
|
|
233
|
+
mockFetch.mockImplementation((_, options) => {
|
|
234
|
+
return new Promise((_, reject) => {
|
|
235
|
+
if (options.signal) {
|
|
236
|
+
options.signal.addEventListener('abort', () => {
|
|
237
|
+
const error = new Error('AbortError');
|
|
238
|
+
error.name = 'AbortError';
|
|
239
|
+
reject(error);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
// Never resolve - let the timeout trigger
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
yield expect(client.post('/test', { data: 'test' }, {})).rejects.toMatchObject({
|
|
246
|
+
message: 'Request timeout after 100ms',
|
|
247
|
+
response: {
|
|
248
|
+
status: 408,
|
|
249
|
+
data: { error: 'Request timeout' },
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
}));
|
|
253
|
+
it('should not timeout requests that complete quickly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
254
|
+
const mockResponse = {
|
|
255
|
+
ok: true,
|
|
256
|
+
status: 200,
|
|
257
|
+
headers: new Map(),
|
|
258
|
+
json: () => Promise.resolve({ success: true }),
|
|
259
|
+
text: () => Promise.resolve('{"success": true}'),
|
|
260
|
+
};
|
|
261
|
+
mockFetch.mockResolvedValue(mockResponse);
|
|
262
|
+
const result = yield client.post('/test', { data: 'test' }, {});
|
|
263
|
+
expect(result).toBeDefined();
|
|
264
|
+
}));
|
|
265
|
+
it('should work without timeout configured', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
266
|
+
const clientWithoutTimeout = new fetch_client_1.FetchHttpClient('https://api.example.com', {}, mockFetch);
|
|
267
|
+
const mockResponse = {
|
|
268
|
+
ok: true,
|
|
269
|
+
status: 200,
|
|
270
|
+
headers: new Map(),
|
|
271
|
+
json: () => Promise.resolve({ success: true }),
|
|
272
|
+
text: () => Promise.resolve('{"success": true}'),
|
|
273
|
+
};
|
|
274
|
+
mockFetch.mockResolvedValue(mockResponse);
|
|
275
|
+
const result = yield clientWithoutTimeout.post('/test', { data: 'test' }, {});
|
|
276
|
+
expect(result).toBeDefined();
|
|
277
|
+
}));
|
|
278
|
+
});
|
|
@@ -57,7 +57,9 @@ const deserializeEvent = (event) => {
|
|
|
57
57
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_1.deserializeUpdatedEventDirectoryUser)(event.data) });
|
|
58
58
|
case 'email_verification.created':
|
|
59
59
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_4.deserializeEmailVerificationEvent)(event.data) });
|
|
60
|
+
case 'invitation.accepted':
|
|
60
61
|
case 'invitation.created':
|
|
62
|
+
case 'invitation.revoked':
|
|
61
63
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_4.deserializeInvitationEvent)(event.data) });
|
|
62
64
|
case 'magic_auth.created':
|
|
63
65
|
return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_4.deserializeMagicAuthEvent)(event.data) });
|
|
@@ -53,7 +53,7 @@ class AutoPaginatable {
|
|
|
53
53
|
yield yield __await(result.data);
|
|
54
54
|
if (result.listMetadata.after) {
|
|
55
55
|
// Delay of 4rps to respect list users rate limits
|
|
56
|
-
yield __await(new Promise((resolve) => setTimeout(resolve,
|
|
56
|
+
yield __await(new Promise((resolve) => setTimeout(resolve, 350)));
|
|
57
57
|
yield __await(yield* __asyncDelegator(__asyncValues(this.generatePages({ after: result.listMetadata.after }))));
|
|
58
58
|
}
|
|
59
59
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AuditLogs } from '../workos-
|
|
1
|
+
export { A as AuditLogs } from '../workos-EX3jNkYH.js';
|
|
2
2
|
import './interfaces/audit-log-export-options.interface.js';
|
|
3
3
|
import './interfaces/audit-log-export.interface.js';
|
|
4
4
|
import './interfaces/create-audit-log-event-options.interface.js';
|
|
@@ -49,6 +49,7 @@ import '../sso/interfaces/get-profile-options.interface.js';
|
|
|
49
49
|
import '../sso/interfaces/get-profile-and-token-options.interface.js';
|
|
50
50
|
import '../sso/interfaces/list-connections-options.interface.js';
|
|
51
51
|
import '../sso/interfaces/profile-and-token.interface.js';
|
|
52
|
+
import '../user-management/interfaces/oauth-tokens.interface.js';
|
|
52
53
|
import '../sso/interfaces/profile.interface.js';
|
|
53
54
|
import '../webhooks/webhooks.js';
|
|
54
55
|
import '../common/crypto/crypto-provider.js';
|
|
@@ -61,6 +62,7 @@ import '../mfa/interfaces/totp.interface.js';
|
|
|
61
62
|
import '../mfa/interfaces/verify-challenge-options.js';
|
|
62
63
|
import '../mfa/interfaces/verify-challenge-response.js';
|
|
63
64
|
import 'jose';
|
|
65
|
+
import '../user-management-B38wNrIN.js';
|
|
64
66
|
import '../user-management/interfaces/authenticate-with-code-options.interface.js';
|
|
65
67
|
import '../user-management/interfaces/authenticate-with-options-base.interface.js';
|
|
66
68
|
import '../user-management/interfaces/authenticate-with-code-and-verifier-options.interface.js';
|
|
@@ -71,7 +73,6 @@ import '../user-management/interfaces/authenticate-with-password-options.interfa
|
|
|
71
73
|
import '../user-management/interfaces/authenticate-with-refresh-token-options.interface.js';
|
|
72
74
|
import '../user-management/interfaces/authenticate-with-session-cookie.interface.js';
|
|
73
75
|
import '../user-management/interfaces/authentication-response.interface.js';
|
|
74
|
-
import '../user-management/interfaces/oauth-tokens.interface.js';
|
|
75
76
|
import '../user-management/interfaces/authenticate-with-totp-options.interface.js';
|
|
76
77
|
import '../user-management/interfaces/authorization-url-options.interface.js';
|
|
77
78
|
import '../user-management/interfaces/create-magic-auth-options.interface.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { L as LogoutURLOptions, A as UserManagementAuthorizationURLOptions, u as userManagement } from '../user-management-B38wNrIN.js';
|
|
2
|
+
export { S as SSOAuthorizationURLOptions, s as sso } from '../sso-nFEQz_Js.js';
|
|
3
|
+
import '../sso/interfaces/authorization-url-options.interface.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/index.ts"],"sourcesContent":["/**\n * Client methods that can be used without a WorkOS API key.\n * These are OAuth client operations suitable for PKCE flows.\n */\n\n// User Management client methods and types\nexport * as userManagement from './user-management';\n\n// SSO client methods and types\nexport * as sso from './sso';\n\n// Re-export specific types for convenience\nexport type {\n AuthorizationURLOptions as UserManagementAuthorizationURLOptions,\n LogoutURLOptions,\n} from './user-management';\n\nexport type { SSOAuthorizationURLOptions } from './sso';\n"],"mappings":"AAMA,YAAY,oBAAoB;AAGhC,YAAY,SAAS;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { toQueryString } from "./utils.js";
|
|
4
|
+
function getAuthorizationUrl(options) {
|
|
5
|
+
const {
|
|
6
|
+
connection,
|
|
7
|
+
clientId,
|
|
8
|
+
domainHint,
|
|
9
|
+
loginHint,
|
|
10
|
+
organization,
|
|
11
|
+
provider,
|
|
12
|
+
providerQueryParams,
|
|
13
|
+
providerScopes,
|
|
14
|
+
redirectUri,
|
|
15
|
+
state,
|
|
16
|
+
baseURL = "https://api.workos.com"
|
|
17
|
+
} = options;
|
|
18
|
+
if (!provider && !connection && !organization) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Incomplete arguments. Need to specify either a 'connection', 'organization', or 'provider'.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
const query = toQueryString({
|
|
24
|
+
connection,
|
|
25
|
+
organization,
|
|
26
|
+
domain_hint: domainHint,
|
|
27
|
+
login_hint: loginHint,
|
|
28
|
+
provider,
|
|
29
|
+
provider_query_params: providerQueryParams,
|
|
30
|
+
provider_scopes: providerScopes,
|
|
31
|
+
client_id: clientId,
|
|
32
|
+
redirect_uri: redirectUri,
|
|
33
|
+
response_type: "code",
|
|
34
|
+
state
|
|
35
|
+
});
|
|
36
|
+
return `${baseURL}/sso/authorize?${query}`;
|
|
37
|
+
}
|
|
38
|
+
__name(getAuthorizationUrl, "getAuthorizationUrl");
|
|
39
|
+
export {
|
|
40
|
+
getAuthorizationUrl
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=sso.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/sso.ts"],"sourcesContent":["import { toQueryString } from './utils';\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,SAAS,qBAAqB;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,QAAQ,cAAc;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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { A as AuthorizationURLOptions, L as LogoutURLOptions, g as getAuthorizationUrl, b as getJwksUrl, a as getLogoutUrl } from '../user-management-B38wNrIN.js';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { toQueryString } from "./utils.js";
|
|
4
|
+
function getAuthorizationUrl(options) {
|
|
5
|
+
const {
|
|
6
|
+
connectionId,
|
|
7
|
+
codeChallenge,
|
|
8
|
+
codeChallengeMethod,
|
|
9
|
+
context,
|
|
10
|
+
clientId,
|
|
11
|
+
domainHint,
|
|
12
|
+
loginHint,
|
|
13
|
+
organizationId,
|
|
14
|
+
provider,
|
|
15
|
+
providerQueryParams,
|
|
16
|
+
providerScopes,
|
|
17
|
+
prompt,
|
|
18
|
+
redirectUri,
|
|
19
|
+
state,
|
|
20
|
+
screenHint,
|
|
21
|
+
baseURL = "https://api.workos.com"
|
|
22
|
+
} = options;
|
|
23
|
+
if (!provider && !connectionId && !organizationId) {
|
|
24
|
+
throw new TypeError(
|
|
25
|
+
`Incomplete arguments. Need to specify either a 'connectionId', 'organizationId', or 'provider'.`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
if (provider !== "authkit" && screenHint) {
|
|
29
|
+
throw new TypeError(
|
|
30
|
+
`'screenHint' is only supported for 'authkit' provider`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
if (context) {
|
|
34
|
+
console.warn(
|
|
35
|
+
`WorkOS: \`context\` is deprecated. We previously required initiate login endpoints to return the
|
|
36
|
+
\`context\` query parameter when getting the authorization URL. This is no longer necessary.`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
const query = toQueryString({
|
|
40
|
+
connection_id: connectionId,
|
|
41
|
+
code_challenge: codeChallenge,
|
|
42
|
+
code_challenge_method: codeChallengeMethod,
|
|
43
|
+
context,
|
|
44
|
+
organization_id: organizationId,
|
|
45
|
+
domain_hint: domainHint,
|
|
46
|
+
login_hint: loginHint,
|
|
47
|
+
provider,
|
|
48
|
+
provider_query_params: providerQueryParams,
|
|
49
|
+
provider_scopes: providerScopes,
|
|
50
|
+
prompt,
|
|
51
|
+
client_id: clientId,
|
|
52
|
+
redirect_uri: redirectUri,
|
|
53
|
+
response_type: "code",
|
|
54
|
+
state,
|
|
55
|
+
screen_hint: screenHint
|
|
56
|
+
});
|
|
57
|
+
return `${baseURL}/user_management/authorize?${query}`;
|
|
58
|
+
}
|
|
59
|
+
__name(getAuthorizationUrl, "getAuthorizationUrl");
|
|
60
|
+
function getLogoutUrl(options) {
|
|
61
|
+
const { sessionId, returnTo, baseURL = "https://api.workos.com" } = options;
|
|
62
|
+
if (!sessionId) {
|
|
63
|
+
throw new TypeError(`Incomplete arguments. Need to specify 'sessionId'.`);
|
|
64
|
+
}
|
|
65
|
+
const url = new URL("/user_management/sessions/logout", baseURL);
|
|
66
|
+
url.searchParams.set("session_id", sessionId);
|
|
67
|
+
if (returnTo) {
|
|
68
|
+
url.searchParams.set("return_to", returnTo);
|
|
69
|
+
}
|
|
70
|
+
return url.toString();
|
|
71
|
+
}
|
|
72
|
+
__name(getLogoutUrl, "getLogoutUrl");
|
|
73
|
+
function getJwksUrl(clientId, baseURL = "https://api.workos.com") {
|
|
74
|
+
if (!clientId) {
|
|
75
|
+
throw new TypeError("clientId must be a valid clientId");
|
|
76
|
+
}
|
|
77
|
+
return `${baseURL}/sso/jwks/${clientId}`;
|
|
78
|
+
}
|
|
79
|
+
__name(getJwksUrl, "getJwksUrl");
|
|
80
|
+
export {
|
|
81
|
+
getAuthorizationUrl,
|
|
82
|
+
getJwksUrl,
|
|
83
|
+
getLogoutUrl
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=user-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/user-management.ts"],"sourcesContent":["import { toQueryString } from './utils';\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 /**\n * @deprecated We previously required initiate login endpoints to return the `context`\n * query parameter when getting the authorization URL. This is no longer necessary.\n */\n context?: 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 context,\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 if (context) {\n console.warn(\n `WorkOS: \\`context\\` is deprecated. We previously required initiate login endpoints to return the\n\\`context\\` query parameter when getting the authorization URL. This is no longer necessary.`,\n );\n }\n\n const query = toQueryString({\n connection_id: connectionId,\n code_challenge: codeChallenge,\n code_challenge_method: codeChallengeMethod,\n context,\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,SAAS,qBAAqB;AAsCvB,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;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,MAAI,SAAS;AACX,YAAQ;AAAA,MACN;AAAA;AAAA,IAEF;AAAA,EACF;AAEA,QAAM,QAAQ,cAAc;AAAA,IAC1B,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,IACvB;AAAA,IACA,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;AA7DgB;AAuET,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":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts an options object to a query string using qs library.
|
|
3
|
+
* Maintains backwards compatibility with existing URL formatting.
|
|
4
|
+
*/
|
|
5
|
+
declare const toQueryString: (options: Record<string, string | string[] | Record<string, string | boolean | number> | undefined>) => string;
|
|
6
|
+
|
|
7
|
+
export { toQueryString };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import qs from "qs";
|
|
4
|
+
const toQueryString = /* @__PURE__ */ __name((options) => {
|
|
5
|
+
return qs.stringify(options, {
|
|
6
|
+
arrayFormat: "repeat",
|
|
7
|
+
// sorts the keys alphabetically to maintain backwards compatibility
|
|
8
|
+
sort: /* @__PURE__ */ __name((a, b) => a.localeCompare(b), "sort"),
|
|
9
|
+
// encodes space as + instead of %20 to maintain backwards compatibility
|
|
10
|
+
format: "RFC1738"
|
|
11
|
+
});
|
|
12
|
+
}, "toQueryString");
|
|
13
|
+
export {
|
|
14
|
+
toQueryString
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/client/utils.ts"],"sourcesContent":["import qs from 'qs';\n\n/**\n * Converts an options object to a query string using qs library.\n * Maintains backwards compatibility with existing URL formatting.\n */\nexport const toQueryString = (\n options: Record<\n string,\n string | string[] | Record<string, string | boolean | number> | undefined\n >,\n): string => {\n return qs.stringify(options, {\n arrayFormat: 'repeat',\n // sorts the keys alphabetically to maintain backwards compatibility\n sort: (a, b) => a.localeCompare(b),\n // encodes space as + instead of %20 to maintain backwards compatibility\n format: 'RFC1738',\n });\n};\n"],"mappings":";;AAAA,OAAO,QAAQ;AAMR,MAAM,gBAAgB,wBAC3B,YAIW;AACX,SAAO,GAAG,UAAU,SAAS;AAAA,IAC3B,aAAa;AAAA;AAAA,IAEb,MAAM,wBAAC,GAAG,MAAM,EAAE,cAAc,CAAC,GAA3B;AAAA;AAAA,IAEN,QAAQ;AAAA,EACV,CAAC;AACH,GAb6B;","names":[]}
|
|
@@ -241,14 +241,30 @@ interface EmailVerificationCreatedEventResponse extends EventResponseBase {
|
|
|
241
241
|
event: 'email_verification.created';
|
|
242
242
|
data: EmailVerificationEventResponse;
|
|
243
243
|
}
|
|
244
|
+
interface InvitationAcceptedEvent extends EventBase {
|
|
245
|
+
event: 'invitation.accepted';
|
|
246
|
+
data: InvitationEvent;
|
|
247
|
+
}
|
|
244
248
|
interface InvitationCreatedEvent extends EventBase {
|
|
245
249
|
event: 'invitation.created';
|
|
246
250
|
data: InvitationEvent;
|
|
247
251
|
}
|
|
252
|
+
interface InvitationRevokedEvent extends EventBase {
|
|
253
|
+
event: 'invitation.revoked';
|
|
254
|
+
data: InvitationEvent;
|
|
255
|
+
}
|
|
256
|
+
interface InvitationAcceptedEventResponse extends EventResponseBase {
|
|
257
|
+
event: 'invitation.accepted';
|
|
258
|
+
data: InvitationEventResponse;
|
|
259
|
+
}
|
|
248
260
|
interface InvitationCreatedEventResponse extends EventResponseBase {
|
|
249
261
|
event: 'invitation.created';
|
|
250
262
|
data: InvitationEventResponse;
|
|
251
263
|
}
|
|
264
|
+
interface InvitationRevokedEventResponse extends EventResponseBase {
|
|
265
|
+
event: 'invitation.revoked';
|
|
266
|
+
data: InvitationEventResponse;
|
|
267
|
+
}
|
|
252
268
|
interface MagicAuthCreatedEvent extends EventBase {
|
|
253
269
|
event: 'magic_auth.created';
|
|
254
270
|
data: MagicAuthEvent;
|
|
@@ -425,8 +441,8 @@ interface OrganizationDomainDeletedEventResponse extends EventResponseBase {
|
|
|
425
441
|
event: 'organization_domain.deleted';
|
|
426
442
|
data: OrganizationDomainResponse;
|
|
427
443
|
}
|
|
428
|
-
type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | AuthenticationRadarRiskDetectedEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationCreatedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | PasswordResetSucceededEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | SessionRevokedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent | OrganizationDomainCreatedEvent | OrganizationDomainUpdatedEvent | OrganizationDomainDeletedEvent;
|
|
429
|
-
type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | AuthenticationRadarRiskDetectedEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationCreatedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | PasswordResetSucceededEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | SessionRevokedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse | OrganizationDomainCreatedEventResponse | OrganizationDomainUpdatedEventResponse | OrganizationDomainDeletedEventResponse;
|
|
444
|
+
type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | AuthenticationRadarRiskDetectedEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationAcceptedEvent | InvitationCreatedEvent | InvitationRevokedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | PasswordResetSucceededEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | SessionRevokedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent | OrganizationDomainCreatedEvent | OrganizationDomainUpdatedEvent | OrganizationDomainDeletedEvent;
|
|
445
|
+
type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | AuthenticationRadarRiskDetectedEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationAcceptedEventResponse | InvitationCreatedEventResponse | InvitationRevokedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | PasswordResetSucceededEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | SessionRevokedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse | OrganizationDomainCreatedEventResponse | OrganizationDomainUpdatedEventResponse | OrganizationDomainDeletedEventResponse;
|
|
430
446
|
type EventName = Event['event'];
|
|
431
447
|
|
|
432
|
-
export type { AuthenticationEmailVerificationSucceededEvent, AuthenticationEmailVerificationSucceededEventResponse, AuthenticationMagicAuthFailedEvent, AuthenticationMagicAuthFailedEventResponse, AuthenticationMagicAuthSucceededEvent, AuthenticationMagicAuthSucceededEventResponse, AuthenticationMfaSucceededEvent, AuthenticationMfaSucceededEventResponse, AuthenticationOAuthFailedEvent, AuthenticationOAuthFailedEventResponse, AuthenticationOAuthSucceededEvent, AuthenticationOAuthSucceededEventResponse, AuthenticationPasswordFailedEvent, AuthenticationPasswordFailedEventResponse, AuthenticationPasswordSucceededEvent, AuthenticationPasswordSucceededEventResponse, AuthenticationRadarRiskDetectedEvent, AuthenticationRadarRiskDetectedEventResponse, AuthenticationSSOFailedEvent, AuthenticationSSOFailedEventResponse, AuthenticationSSOSucceededEvent, AuthenticationSSOSucceededEventResponse, ConnectionActivatedEvent, ConnectionActivatedEventResponse, ConnectionDeactivatedEvent, ConnectionDeactivatedEventResponse, ConnectionDeletedEvent, ConnectionDeletedEventResponse, DsyncActivatedEvent, DsyncActivatedEventResponse, DsyncDeletedEvent, DsyncDeletedEventResponse, DsyncGroupCreatedEvent, DsyncGroupCreatedEventResponse, DsyncGroupDeletedEvent, DsyncGroupDeletedEventResponse, DsyncGroupUpdatedEvent, DsyncGroupUpdatedEventResponse, DsyncGroupUserAddedEvent, DsyncGroupUserAddedEventResponse, DsyncGroupUserRemovedEvent, DsyncGroupUserRemovedEventResponse, DsyncUserCreatedEvent, DsyncUserCreatedEventResponse, DsyncUserDeletedEvent, DsyncUserDeletedEventResponse, DsyncUserUpdatedEvent, DsyncUserUpdatedEventResponse, EmailVerificationCreatedEvent, EmailVerificationCreatedEventResponse, Event, EventBase, EventName, EventResponse, InvitationCreatedEvent, InvitationCreatedEventResponse, MagicAuthCreatedEvent, MagicAuthCreatedEventResponse, OrganizationCreatedEvent, OrganizationCreatedResponse, OrganizationDeletedEvent, OrganizationDeletedResponse, OrganizationDomainCreatedEvent, OrganizationDomainCreatedEventResponse, OrganizationDomainDeletedEvent, OrganizationDomainDeletedEventResponse, OrganizationDomainUpdatedEvent, OrganizationDomainUpdatedEventResponse, OrganizationDomainVerificationFailedEvent, OrganizationDomainVerificationFailedEventResponse, OrganizationDomainVerifiedEvent, OrganizationDomainVerifiedEventResponse, OrganizationMembershipCreated, OrganizationMembershipCreatedResponse, OrganizationMembershipDeleted, OrganizationMembershipDeletedResponse, OrganizationMembershipUpdated, OrganizationMembershipUpdatedResponse, OrganizationUpdatedEvent, OrganizationUpdatedResponse, PasswordResetCreatedEvent, PasswordResetCreatedEventResponse, PasswordResetSucceededEvent, PasswordResetSucceededEventResponse, RoleCreatedEvent, RoleCreatedEventResponse, RoleDeletedEvent, RoleDeletedEventResponse, RoleUpdatedEvent, RoleUpdatedEventResponse, SessionCreatedEvent, SessionCreatedEventResponse, SessionRevokedEvent, SessionRevokedEventResponse, UserCreatedEvent, UserCreatedEventResponse, UserDeletedEvent, UserDeletedEventResponse, UserUpdatedEvent, UserUpdatedEventResponse };
|
|
448
|
+
export type { AuthenticationEmailVerificationSucceededEvent, AuthenticationEmailVerificationSucceededEventResponse, AuthenticationMagicAuthFailedEvent, AuthenticationMagicAuthFailedEventResponse, AuthenticationMagicAuthSucceededEvent, AuthenticationMagicAuthSucceededEventResponse, AuthenticationMfaSucceededEvent, AuthenticationMfaSucceededEventResponse, AuthenticationOAuthFailedEvent, AuthenticationOAuthFailedEventResponse, AuthenticationOAuthSucceededEvent, AuthenticationOAuthSucceededEventResponse, AuthenticationPasswordFailedEvent, AuthenticationPasswordFailedEventResponse, AuthenticationPasswordSucceededEvent, AuthenticationPasswordSucceededEventResponse, AuthenticationRadarRiskDetectedEvent, AuthenticationRadarRiskDetectedEventResponse, AuthenticationSSOFailedEvent, AuthenticationSSOFailedEventResponse, AuthenticationSSOSucceededEvent, AuthenticationSSOSucceededEventResponse, ConnectionActivatedEvent, ConnectionActivatedEventResponse, ConnectionDeactivatedEvent, ConnectionDeactivatedEventResponse, ConnectionDeletedEvent, ConnectionDeletedEventResponse, DsyncActivatedEvent, DsyncActivatedEventResponse, DsyncDeletedEvent, DsyncDeletedEventResponse, DsyncGroupCreatedEvent, DsyncGroupCreatedEventResponse, DsyncGroupDeletedEvent, DsyncGroupDeletedEventResponse, DsyncGroupUpdatedEvent, DsyncGroupUpdatedEventResponse, DsyncGroupUserAddedEvent, DsyncGroupUserAddedEventResponse, DsyncGroupUserRemovedEvent, DsyncGroupUserRemovedEventResponse, DsyncUserCreatedEvent, DsyncUserCreatedEventResponse, DsyncUserDeletedEvent, DsyncUserDeletedEventResponse, DsyncUserUpdatedEvent, DsyncUserUpdatedEventResponse, EmailVerificationCreatedEvent, EmailVerificationCreatedEventResponse, Event, EventBase, EventName, EventResponse, InvitationAcceptedEvent, InvitationAcceptedEventResponse, InvitationCreatedEvent, InvitationCreatedEventResponse, InvitationRevokedEvent, InvitationRevokedEventResponse, MagicAuthCreatedEvent, MagicAuthCreatedEventResponse, OrganizationCreatedEvent, OrganizationCreatedResponse, OrganizationDeletedEvent, OrganizationDeletedResponse, OrganizationDomainCreatedEvent, OrganizationDomainCreatedEventResponse, OrganizationDomainDeletedEvent, OrganizationDomainDeletedEventResponse, OrganizationDomainUpdatedEvent, OrganizationDomainUpdatedEventResponse, OrganizationDomainVerificationFailedEvent, OrganizationDomainVerificationFailedEventResponse, OrganizationDomainVerifiedEvent, OrganizationDomainVerifiedEventResponse, OrganizationMembershipCreated, OrganizationMembershipCreatedResponse, OrganizationMembershipDeleted, OrganizationMembershipDeletedResponse, OrganizationMembershipUpdated, OrganizationMembershipUpdatedResponse, OrganizationUpdatedEvent, OrganizationUpdatedResponse, PasswordResetCreatedEvent, PasswordResetCreatedEventResponse, PasswordResetSucceededEvent, PasswordResetSucceededEventResponse, RoleCreatedEvent, RoleCreatedEventResponse, RoleDeletedEvent, RoleDeletedEventResponse, RoleUpdatedEvent, RoleUpdatedEventResponse, SessionCreatedEvent, SessionCreatedEventResponse, SessionRevokedEvent, SessionRevokedEventResponse, UserCreatedEvent, UserCreatedEventResponse, UserDeletedEvent, UserDeletedEventResponse, UserUpdatedEvent, UserUpdatedEventResponse };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AuthenticationEmailVerificationSucceededEvent, AuthenticationEmailVerificationSucceededEventResponse, AuthenticationMagicAuthFailedEvent, AuthenticationMagicAuthFailedEventResponse, AuthenticationMagicAuthSucceededEvent, AuthenticationMagicAuthSucceededEventResponse, AuthenticationMfaSucceededEvent, AuthenticationMfaSucceededEventResponse, AuthenticationOAuthFailedEvent, AuthenticationOAuthFailedEventResponse, AuthenticationOAuthSucceededEvent, AuthenticationOAuthSucceededEventResponse, AuthenticationPasswordFailedEvent, AuthenticationPasswordFailedEventResponse, AuthenticationPasswordSucceededEvent, AuthenticationPasswordSucceededEventResponse, AuthenticationRadarRiskDetectedEvent, AuthenticationRadarRiskDetectedEventResponse, AuthenticationSSOFailedEvent, AuthenticationSSOFailedEventResponse, AuthenticationSSOSucceededEvent, AuthenticationSSOSucceededEventResponse, ConnectionActivatedEvent, ConnectionActivatedEventResponse, ConnectionDeactivatedEvent, ConnectionDeactivatedEventResponse, ConnectionDeletedEvent, ConnectionDeletedEventResponse, DsyncActivatedEvent, DsyncActivatedEventResponse, DsyncDeletedEvent, DsyncDeletedEventResponse, DsyncGroupCreatedEvent, DsyncGroupCreatedEventResponse, DsyncGroupDeletedEvent, DsyncGroupDeletedEventResponse, DsyncGroupUpdatedEvent, DsyncGroupUpdatedEventResponse, DsyncGroupUserAddedEvent, DsyncGroupUserAddedEventResponse, DsyncGroupUserRemovedEvent, DsyncGroupUserRemovedEventResponse, DsyncUserCreatedEvent, DsyncUserCreatedEventResponse, DsyncUserDeletedEvent, DsyncUserDeletedEventResponse, DsyncUserUpdatedEvent, DsyncUserUpdatedEventResponse, EmailVerificationCreatedEvent, EmailVerificationCreatedEventResponse, Event, EventBase, EventName, EventResponse, InvitationCreatedEvent, InvitationCreatedEventResponse, MagicAuthCreatedEvent, MagicAuthCreatedEventResponse, OrganizationCreatedEvent, OrganizationCreatedResponse, OrganizationDeletedEvent, OrganizationDeletedResponse, OrganizationDomainCreatedEvent, OrganizationDomainCreatedEventResponse, OrganizationDomainDeletedEvent, OrganizationDomainDeletedEventResponse, OrganizationDomainUpdatedEvent, OrganizationDomainUpdatedEventResponse, OrganizationDomainVerificationFailedEvent, OrganizationDomainVerificationFailedEventResponse, OrganizationDomainVerifiedEvent, OrganizationDomainVerifiedEventResponse, OrganizationMembershipCreated, OrganizationMembershipCreatedResponse, OrganizationMembershipDeleted, OrganizationMembershipDeletedResponse, OrganizationMembershipUpdated, OrganizationMembershipUpdatedResponse, OrganizationUpdatedEvent, OrganizationUpdatedResponse, PasswordResetCreatedEvent, PasswordResetCreatedEventResponse, PasswordResetSucceededEvent, PasswordResetSucceededEventResponse, RoleCreatedEvent, RoleCreatedEventResponse, RoleDeletedEvent, RoleDeletedEventResponse, RoleUpdatedEvent, RoleUpdatedEventResponse, SessionCreatedEvent, SessionCreatedEventResponse, SessionRevokedEvent, SessionRevokedEventResponse, UserCreatedEvent, UserCreatedEventResponse, UserDeletedEvent, UserDeletedEventResponse, UserUpdatedEvent, UserUpdatedEventResponse } from './event.interface.js';
|
|
1
|
+
export { AuthenticationEmailVerificationSucceededEvent, AuthenticationEmailVerificationSucceededEventResponse, AuthenticationMagicAuthFailedEvent, AuthenticationMagicAuthFailedEventResponse, AuthenticationMagicAuthSucceededEvent, AuthenticationMagicAuthSucceededEventResponse, AuthenticationMfaSucceededEvent, AuthenticationMfaSucceededEventResponse, AuthenticationOAuthFailedEvent, AuthenticationOAuthFailedEventResponse, AuthenticationOAuthSucceededEvent, AuthenticationOAuthSucceededEventResponse, AuthenticationPasswordFailedEvent, AuthenticationPasswordFailedEventResponse, AuthenticationPasswordSucceededEvent, AuthenticationPasswordSucceededEventResponse, AuthenticationRadarRiskDetectedEvent, AuthenticationRadarRiskDetectedEventResponse, AuthenticationSSOFailedEvent, AuthenticationSSOFailedEventResponse, AuthenticationSSOSucceededEvent, AuthenticationSSOSucceededEventResponse, ConnectionActivatedEvent, ConnectionActivatedEventResponse, ConnectionDeactivatedEvent, ConnectionDeactivatedEventResponse, ConnectionDeletedEvent, ConnectionDeletedEventResponse, DsyncActivatedEvent, DsyncActivatedEventResponse, DsyncDeletedEvent, DsyncDeletedEventResponse, DsyncGroupCreatedEvent, DsyncGroupCreatedEventResponse, DsyncGroupDeletedEvent, DsyncGroupDeletedEventResponse, DsyncGroupUpdatedEvent, DsyncGroupUpdatedEventResponse, DsyncGroupUserAddedEvent, DsyncGroupUserAddedEventResponse, DsyncGroupUserRemovedEvent, DsyncGroupUserRemovedEventResponse, DsyncUserCreatedEvent, DsyncUserCreatedEventResponse, DsyncUserDeletedEvent, DsyncUserDeletedEventResponse, DsyncUserUpdatedEvent, DsyncUserUpdatedEventResponse, EmailVerificationCreatedEvent, EmailVerificationCreatedEventResponse, Event, EventBase, EventName, EventResponse, InvitationAcceptedEvent, InvitationAcceptedEventResponse, InvitationCreatedEvent, InvitationCreatedEventResponse, InvitationRevokedEvent, InvitationRevokedEventResponse, MagicAuthCreatedEvent, MagicAuthCreatedEventResponse, OrganizationCreatedEvent, OrganizationCreatedResponse, OrganizationDeletedEvent, OrganizationDeletedResponse, OrganizationDomainCreatedEvent, OrganizationDomainCreatedEventResponse, OrganizationDomainDeletedEvent, OrganizationDomainDeletedEventResponse, OrganizationDomainUpdatedEvent, OrganizationDomainUpdatedEventResponse, OrganizationDomainVerificationFailedEvent, OrganizationDomainVerificationFailedEventResponse, OrganizationDomainVerifiedEvent, OrganizationDomainVerifiedEventResponse, OrganizationMembershipCreated, OrganizationMembershipCreatedResponse, OrganizationMembershipDeleted, OrganizationMembershipDeletedResponse, OrganizationMembershipUpdated, OrganizationMembershipUpdatedResponse, OrganizationUpdatedEvent, OrganizationUpdatedResponse, PasswordResetCreatedEvent, PasswordResetCreatedEventResponse, PasswordResetSucceededEvent, PasswordResetSucceededEventResponse, RoleCreatedEvent, RoleCreatedEventResponse, RoleDeletedEvent, RoleDeletedEventResponse, RoleUpdatedEvent, RoleUpdatedEventResponse, SessionCreatedEvent, SessionCreatedEventResponse, SessionRevokedEvent, SessionRevokedEventResponse, UserCreatedEvent, UserCreatedEventResponse, UserDeletedEvent, UserDeletedEventResponse, UserUpdatedEvent, UserUpdatedEventResponse } from './event.interface.js';
|
|
2
2
|
export { GetOptions } from './get-options.interface.js';
|
|
3
3
|
export { List, ListResponse } from './list.interface.js';
|
|
4
4
|
export { PostOptions } from './post-options.interface.js';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { HttpClientInterface, RequestOptions, HttpClientResponseInterface, ResponseHeaders } from '../interfaces/http-client.interface.js';
|
|
2
2
|
import { HttpClient, HttpClientResponse } from './http-client.js';
|
|
3
3
|
|
|
4
|
+
interface FetchHttpClientOptions extends RequestInit {
|
|
5
|
+
timeout?: number;
|
|
6
|
+
}
|
|
4
7
|
declare class FetchHttpClient extends HttpClient implements HttpClientInterface {
|
|
5
8
|
readonly baseURL: string;
|
|
6
|
-
readonly options?:
|
|
9
|
+
readonly options?: FetchHttpClientOptions | undefined;
|
|
7
10
|
private readonly _fetchFn;
|
|
8
|
-
constructor(baseURL: string, options?:
|
|
11
|
+
constructor(baseURL: string, options?: FetchHttpClientOptions | undefined, fetchFn?: typeof fetch);
|
|
9
12
|
/** @override */
|
|
10
13
|
getClientName(): string;
|
|
11
14
|
get(path: string, options: RequestOptions): Promise<HttpClientResponseInterface>;
|