auth0 5.5.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/cjs/management/Client.d.ts +12 -0
  2. package/dist/cjs/management/Client.js +67 -0
  3. package/dist/cjs/management/api/requests/requests.d.ts +181 -24
  4. package/dist/cjs/management/api/resources/actions/client/Client.d.ts +2 -2
  5. package/dist/cjs/management/api/resources/actions/client/Client.js +3 -3
  6. package/dist/cjs/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.d.ts +2 -2
  7. package/dist/cjs/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.js +2 -2
  8. package/dist/cjs/management/api/resources/clientGrants/client/Client.d.ts +2 -2
  9. package/dist/cjs/management/api/resources/clientGrants/client/Client.js +4 -3
  10. package/dist/cjs/management/api/resources/clients/client/Client.d.ts +46 -0
  11. package/dist/cjs/management/api/resources/clients/client/Client.js +146 -1
  12. package/dist/cjs/management/api/resources/connections/resources/directoryProvisioning/client/Client.d.ts +43 -0
  13. package/dist/cjs/management/api/resources/connections/resources/directoryProvisioning/client/Client.js +152 -0
  14. package/dist/cjs/management/api/resources/customDomains/client/Client.d.ts +30 -0
  15. package/dist/cjs/management/api/resources/customDomains/client/Client.js +115 -0
  16. package/dist/cjs/management/api/resources/eventStreams/client/Client.d.ts +1 -1
  17. package/dist/cjs/management/api/resources/eventStreams/client/Client.js +1 -1
  18. package/dist/cjs/management/api/resources/groups/client/Client.d.ts +16 -0
  19. package/dist/cjs/management/api/resources/groups/client/Client.js +57 -0
  20. package/dist/cjs/management/api/resources/networkAcls/client/Client.d.ts +0 -2
  21. package/dist/cjs/management/api/resources/networkAcls/client/Client.js +0 -2
  22. package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +3 -0
  23. package/dist/cjs/management/api/resources/organizations/client/Client.js +13 -8
  24. package/dist/cjs/management/api/resources/organizations/resources/connections/client/Client.d.ts +95 -0
  25. package/dist/cjs/management/api/resources/organizations/resources/connections/client/Client.js +383 -0
  26. package/dist/cjs/management/api/resources/organizations/resources/connections/client/index.d.ts +1 -0
  27. package/dist/cjs/management/api/resources/organizations/resources/connections/client/index.js +2 -0
  28. package/dist/cjs/management/api/resources/organizations/resources/connections/index.d.ts +1 -0
  29. package/dist/cjs/management/api/resources/organizations/resources/connections/index.js +17 -0
  30. package/dist/cjs/management/api/resources/organizations/resources/discoveryDomains/client/Client.d.ts +3 -1
  31. package/dist/cjs/management/api/resources/organizations/resources/discoveryDomains/client/Client.js +3 -1
  32. package/dist/cjs/management/api/resources/organizations/resources/index.d.ts +1 -0
  33. package/dist/cjs/management/api/resources/organizations/resources/index.js +2 -1
  34. package/dist/cjs/management/api/resources/refreshTokens/client/Client.d.ts +23 -0
  35. package/dist/cjs/management/api/resources/refreshTokens/client/Client.js +88 -0
  36. package/dist/cjs/management/api/types/types.d.ts +673 -322
  37. package/dist/cjs/management/api/types/types.js +180 -134
  38. package/dist/cjs/management/core/auth/BasicAuth.d.ts +2 -2
  39. package/dist/cjs/management/core/auth/BasicAuth.js +7 -1
  40. package/dist/cjs/management/core/fetcher/BinaryResponse.d.ts +1 -1
  41. package/dist/cjs/management/core/fetcher/Fetcher.d.ts +2 -0
  42. package/dist/cjs/management/core/fetcher/Fetcher.js +5 -1
  43. package/dist/cjs/management/core/fetcher/index.d.ts +2 -0
  44. package/dist/cjs/management/core/fetcher/index.js +3 -1
  45. package/dist/cjs/management/core/fetcher/makePassthroughRequest.d.ts +49 -0
  46. package/dist/cjs/management/core/fetcher/makePassthroughRequest.js +135 -0
  47. package/dist/cjs/management/core/fetcher/makeRequest.d.ts +6 -1
  48. package/dist/cjs/management/core/fetcher/makeRequest.js +30 -9
  49. package/dist/cjs/management/core/pagination/Page.d.ts +1 -1
  50. package/dist/cjs/management/core/pagination/index.d.ts +0 -1
  51. package/dist/cjs/management/core/pagination/index.js +1 -4
  52. package/dist/cjs/management/core/runtime/runtime.js +8 -7
  53. package/dist/cjs/management/errors/ManagementError.d.ts +3 -1
  54. package/dist/cjs/management/errors/ManagementError.js +4 -1
  55. package/dist/cjs/management/errors/ManagementTimeoutError.d.ts +4 -1
  56. package/dist/cjs/management/errors/ManagementTimeoutError.js +4 -1
  57. package/dist/cjs/management/errors/handleNonStatusCodeError.js +4 -1
  58. package/dist/cjs/management/version.d.ts +1 -1
  59. package/dist/cjs/management/version.js +1 -1
  60. package/dist/esm/management/Client.d.mts +12 -0
  61. package/dist/esm/management/Client.mjs +34 -0
  62. package/dist/esm/management/api/requests/requests.d.mts +181 -24
  63. package/dist/esm/management/api/resources/actions/client/Client.d.mts +2 -2
  64. package/dist/esm/management/api/resources/actions/client/Client.mjs +3 -3
  65. package/dist/esm/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.d.mts +2 -2
  66. package/dist/esm/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.mjs +2 -2
  67. package/dist/esm/management/api/resources/clientGrants/client/Client.d.mts +2 -2
  68. package/dist/esm/management/api/resources/clientGrants/client/Client.mjs +4 -3
  69. package/dist/esm/management/api/resources/clients/client/Client.d.mts +46 -0
  70. package/dist/esm/management/api/resources/clients/client/Client.mjs +146 -1
  71. package/dist/esm/management/api/resources/connections/resources/directoryProvisioning/client/Client.d.mts +43 -0
  72. package/dist/esm/management/api/resources/connections/resources/directoryProvisioning/client/Client.mjs +152 -0
  73. package/dist/esm/management/api/resources/customDomains/client/Client.d.mts +30 -0
  74. package/dist/esm/management/api/resources/customDomains/client/Client.mjs +115 -0
  75. package/dist/esm/management/api/resources/eventStreams/client/Client.d.mts +1 -1
  76. package/dist/esm/management/api/resources/eventStreams/client/Client.mjs +1 -1
  77. package/dist/esm/management/api/resources/groups/client/Client.d.mts +16 -0
  78. package/dist/esm/management/api/resources/groups/client/Client.mjs +57 -0
  79. package/dist/esm/management/api/resources/networkAcls/client/Client.d.mts +0 -2
  80. package/dist/esm/management/api/resources/networkAcls/client/Client.mjs +0 -2
  81. package/dist/esm/management/api/resources/organizations/client/Client.d.mts +3 -0
  82. package/dist/esm/management/api/resources/organizations/client/Client.mjs +5 -0
  83. package/dist/esm/management/api/resources/organizations/resources/connections/client/Client.d.mts +95 -0
  84. package/dist/esm/management/api/resources/organizations/resources/connections/client/Client.mjs +346 -0
  85. package/dist/esm/management/api/resources/organizations/resources/connections/client/index.d.mts +1 -0
  86. package/dist/esm/management/api/resources/organizations/resources/connections/client/index.mjs +1 -0
  87. package/dist/esm/management/api/resources/organizations/resources/connections/index.d.mts +1 -0
  88. package/dist/esm/management/api/resources/organizations/resources/connections/index.mjs +1 -0
  89. package/dist/esm/management/api/resources/organizations/resources/discoveryDomains/client/Client.d.mts +3 -1
  90. package/dist/esm/management/api/resources/organizations/resources/discoveryDomains/client/Client.mjs +3 -1
  91. package/dist/esm/management/api/resources/organizations/resources/index.d.mts +1 -0
  92. package/dist/esm/management/api/resources/organizations/resources/index.mjs +1 -0
  93. package/dist/esm/management/api/resources/refreshTokens/client/Client.d.mts +23 -0
  94. package/dist/esm/management/api/resources/refreshTokens/client/Client.mjs +88 -0
  95. package/dist/esm/management/api/types/types.d.mts +673 -322
  96. package/dist/esm/management/api/types/types.mjs +170 -124
  97. package/dist/esm/management/core/auth/BasicAuth.d.mts +2 -2
  98. package/dist/esm/management/core/auth/BasicAuth.mjs +7 -1
  99. package/dist/esm/management/core/fetcher/BinaryResponse.d.mts +1 -1
  100. package/dist/esm/management/core/fetcher/Fetcher.d.mts +2 -0
  101. package/dist/esm/management/core/fetcher/Fetcher.mjs +5 -1
  102. package/dist/esm/management/core/fetcher/index.d.mts +2 -0
  103. package/dist/esm/management/core/fetcher/index.mjs +1 -0
  104. package/dist/esm/management/core/fetcher/makePassthroughRequest.d.mts +49 -0
  105. package/dist/esm/management/core/fetcher/makePassthroughRequest.mjs +132 -0
  106. package/dist/esm/management/core/fetcher/makeRequest.d.mts +6 -1
  107. package/dist/esm/management/core/fetcher/makeRequest.mjs +28 -9
  108. package/dist/esm/management/core/pagination/Page.d.mts +1 -1
  109. package/dist/esm/management/core/pagination/index.d.mts +0 -1
  110. package/dist/esm/management/core/pagination/index.mjs +0 -1
  111. package/dist/esm/management/core/runtime/runtime.mjs +8 -7
  112. package/dist/esm/management/errors/ManagementError.d.mts +3 -1
  113. package/dist/esm/management/errors/ManagementError.mjs +4 -1
  114. package/dist/esm/management/errors/ManagementTimeoutError.d.mts +4 -1
  115. package/dist/esm/management/errors/ManagementTimeoutError.mjs +4 -1
  116. package/dist/esm/management/errors/handleNonStatusCodeError.mjs +4 -1
  117. package/dist/esm/management/version.d.mts +1 -1
  118. package/dist/esm/management/version.mjs +1 -1
  119. package/package.json +5 -6
  120. package/reference.md +958 -68
  121. package/dist/cjs/management/core/pagination/CustomPager.d.ts +0 -67
  122. package/dist/cjs/management/core/pagination/CustomPager.js +0 -194
  123. package/dist/esm/management/core/pagination/CustomPager.d.mts +0 -67
  124. package/dist/esm/management/core/pagination/CustomPager.mjs +0 -189
@@ -0,0 +1,383 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.ConnectionsClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
48
+ const core = __importStar(require("../../../../../../core/index.js"));
49
+ const headers_js_1 = require("../../../../../../core/headers.js");
50
+ const environments = __importStar(require("../../../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../../../errors/index.js"));
53
+ const Management = __importStar(require("../../../../../index.js"));
54
+ class ConnectionsClient {
55
+ constructor(options) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * @param {string} id - Organization identifier.
60
+ * @param {Management.ListOrganizationAllConnectionsRequestParameters} request
61
+ * @param {ConnectionsClient.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link Management.BadRequestError}
64
+ * @throws {@link Management.UnauthorizedError}
65
+ * @throws {@link Management.ForbiddenError}
66
+ * @throws {@link Management.TooManyRequestsError}
67
+ *
68
+ * @example
69
+ * await client.organizations.connections.list("id", {
70
+ * page: 1,
71
+ * per_page: 1,
72
+ * include_totals: true,
73
+ * is_enabled: true
74
+ * })
75
+ */
76
+ list(id_1) {
77
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
78
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
79
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
80
+ const { page = 0, per_page: perPage = 50, include_totals: includeTotals = true, is_enabled: isEnabled, } = request;
81
+ const _queryParams = {
82
+ page,
83
+ per_page: perPage,
84
+ include_totals: includeTotals,
85
+ is_enabled: isEnabled,
86
+ };
87
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
88
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
89
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
90
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `organizations/${core.url.encodePathParam(id)}/connections`),
91
+ method: "GET",
92
+ headers: _headers,
93
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
94
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
95
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
96
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
97
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
98
+ logging: this._options.logging,
99
+ });
100
+ if (_response.ok) {
101
+ return {
102
+ data: _response.body,
103
+ rawResponse: _response.rawResponse,
104
+ };
105
+ }
106
+ if (_response.error.reason === "status-code") {
107
+ switch (_response.error.statusCode) {
108
+ case 400:
109
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
110
+ case 401:
111
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
112
+ case 403:
113
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
114
+ case 429:
115
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
116
+ default:
117
+ throw new errors.ManagementError({
118
+ statusCode: _response.error.statusCode,
119
+ body: _response.error.body,
120
+ rawResponse: _response.rawResponse,
121
+ });
122
+ }
123
+ }
124
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/organizations/{id}/connections");
125
+ }));
126
+ let _offset = (request === null || request === void 0 ? void 0 : request.page) != null ? request === null || request === void 0 ? void 0 : request.page : 0;
127
+ const dataWithRawResponse = yield list(request).withRawResponse();
128
+ return new core.Page({
129
+ response: dataWithRawResponse.data,
130
+ rawResponse: dataWithRawResponse.rawResponse,
131
+ hasNextPage: (response) => { var _a, _b; return ((_a = response === null || response === void 0 ? void 0 : response.connections) !== null && _a !== void 0 ? _a : []).length >= Math.floor((_b = request === null || request === void 0 ? void 0 : request.per_page) !== null && _b !== void 0 ? _b : 50); },
132
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.connections) !== null && _a !== void 0 ? _a : []; },
133
+ loadPage: (_response) => {
134
+ _offset += 1;
135
+ return list(core.setObjectProperty(request, "page", _offset));
136
+ },
137
+ });
138
+ });
139
+ }
140
+ /**
141
+ * @param {string} id - Organization identifier.
142
+ * @param {Management.CreateOrganizationAllConnectionRequestParameters} request
143
+ * @param {ConnectionsClient.RequestOptions} requestOptions - Request-specific configuration.
144
+ *
145
+ * @throws {@link Management.BadRequestError}
146
+ * @throws {@link Management.UnauthorizedError}
147
+ * @throws {@link Management.ForbiddenError}
148
+ * @throws {@link Management.ConflictError}
149
+ * @throws {@link Management.TooManyRequestsError}
150
+ *
151
+ * @example
152
+ * await client.organizations.connections.create("id", {
153
+ * connection_id: "connection_id"
154
+ * })
155
+ */
156
+ create(id, request, requestOptions) {
157
+ return core.HttpResponsePromise.fromPromise(this.__create(id, request, requestOptions));
158
+ }
159
+ __create(id, request, requestOptions) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
162
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
163
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
164
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
165
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `organizations/${core.url.encodePathParam(id)}/connections`),
166
+ method: "POST",
167
+ headers: _headers,
168
+ contentType: "application/json",
169
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
170
+ requestType: "json",
171
+ body: request,
172
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
173
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
174
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
175
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
176
+ logging: this._options.logging,
177
+ });
178
+ if (_response.ok) {
179
+ return {
180
+ data: _response.body,
181
+ rawResponse: _response.rawResponse,
182
+ };
183
+ }
184
+ if (_response.error.reason === "status-code") {
185
+ switch (_response.error.statusCode) {
186
+ case 400:
187
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
188
+ case 401:
189
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
190
+ case 403:
191
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
192
+ case 409:
193
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
194
+ case 429:
195
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
196
+ default:
197
+ throw new errors.ManagementError({
198
+ statusCode: _response.error.statusCode,
199
+ body: _response.error.body,
200
+ rawResponse: _response.rawResponse,
201
+ });
202
+ }
203
+ }
204
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/organizations/{id}/connections");
205
+ });
206
+ }
207
+ /**
208
+ * @param {string} id - Organization identifier.
209
+ * @param {string} connection_id - Connection identifier.
210
+ * @param {ConnectionsClient.RequestOptions} requestOptions - Request-specific configuration.
211
+ *
212
+ * @throws {@link Management.UnauthorizedError}
213
+ * @throws {@link Management.ForbiddenError}
214
+ * @throws {@link Management.NotFoundError}
215
+ * @throws {@link Management.TooManyRequestsError}
216
+ *
217
+ * @example
218
+ * await client.organizations.connections.get("id", "connection_id")
219
+ */
220
+ get(id, connection_id, requestOptions) {
221
+ return core.HttpResponsePromise.fromPromise(this.__get(id, connection_id, requestOptions));
222
+ }
223
+ __get(id, connection_id, requestOptions) {
224
+ return __awaiter(this, void 0, void 0, function* () {
225
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
226
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
227
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
228
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
229
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `organizations/${core.url.encodePathParam(id)}/connections/${core.url.encodePathParam(connection_id)}`),
230
+ method: "GET",
231
+ headers: _headers,
232
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
233
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
234
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
235
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
236
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
237
+ logging: this._options.logging,
238
+ });
239
+ if (_response.ok) {
240
+ return {
241
+ data: _response.body,
242
+ rawResponse: _response.rawResponse,
243
+ };
244
+ }
245
+ if (_response.error.reason === "status-code") {
246
+ switch (_response.error.statusCode) {
247
+ case 401:
248
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
249
+ case 403:
250
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
251
+ case 404:
252
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
253
+ case 429:
254
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
255
+ default:
256
+ throw new errors.ManagementError({
257
+ statusCode: _response.error.statusCode,
258
+ body: _response.error.body,
259
+ rawResponse: _response.rawResponse,
260
+ });
261
+ }
262
+ }
263
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/organizations/{id}/connections/{connection_id}");
264
+ });
265
+ }
266
+ /**
267
+ * @param {string} id - Organization identifier.
268
+ * @param {string} connection_id - Connection identifier.
269
+ * @param {ConnectionsClient.RequestOptions} requestOptions - Request-specific configuration.
270
+ *
271
+ * @throws {@link Management.UnauthorizedError}
272
+ * @throws {@link Management.ForbiddenError}
273
+ * @throws {@link Management.TooManyRequestsError}
274
+ *
275
+ * @example
276
+ * await client.organizations.connections.delete("id", "connection_id")
277
+ */
278
+ delete(id, connection_id, requestOptions) {
279
+ return core.HttpResponsePromise.fromPromise(this.__delete(id, connection_id, requestOptions));
280
+ }
281
+ __delete(id, connection_id, requestOptions) {
282
+ return __awaiter(this, void 0, void 0, function* () {
283
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
284
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
285
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
286
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
287
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `organizations/${core.url.encodePathParam(id)}/connections/${core.url.encodePathParam(connection_id)}`),
288
+ method: "DELETE",
289
+ headers: _headers,
290
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
291
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
292
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
293
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
294
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
295
+ logging: this._options.logging,
296
+ });
297
+ if (_response.ok) {
298
+ return { data: undefined, rawResponse: _response.rawResponse };
299
+ }
300
+ if (_response.error.reason === "status-code") {
301
+ switch (_response.error.statusCode) {
302
+ case 401:
303
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
304
+ case 403:
305
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
306
+ case 429:
307
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
308
+ default:
309
+ throw new errors.ManagementError({
310
+ statusCode: _response.error.statusCode,
311
+ body: _response.error.body,
312
+ rawResponse: _response.rawResponse,
313
+ });
314
+ }
315
+ }
316
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/organizations/{id}/connections/{connection_id}");
317
+ });
318
+ }
319
+ /**
320
+ * @param {string} id - Organization identifier.
321
+ * @param {string} connection_id - Connection identifier.
322
+ * @param {Management.UpdateOrganizationConnectionRequestParameters} request
323
+ * @param {ConnectionsClient.RequestOptions} requestOptions - Request-specific configuration.
324
+ *
325
+ * @throws {@link Management.BadRequestError}
326
+ * @throws {@link Management.UnauthorizedError}
327
+ * @throws {@link Management.ForbiddenError}
328
+ * @throws {@link Management.TooManyRequestsError}
329
+ *
330
+ * @example
331
+ * await client.organizations.connections.update("id", "connection_id")
332
+ */
333
+ update(id, connection_id, request = {}, requestOptions) {
334
+ return core.HttpResponsePromise.fromPromise(this.__update(id, connection_id, request, requestOptions));
335
+ }
336
+ __update(id_1, connection_id_1) {
337
+ return __awaiter(this, arguments, void 0, function* (id, connection_id, request = {}, requestOptions) {
338
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
339
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
340
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
341
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
342
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, `organizations/${core.url.encodePathParam(id)}/connections/${core.url.encodePathParam(connection_id)}`),
343
+ method: "PATCH",
344
+ headers: _headers,
345
+ contentType: "application/json",
346
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
347
+ requestType: "json",
348
+ body: request,
349
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
350
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
351
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
352
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
353
+ logging: this._options.logging,
354
+ });
355
+ if (_response.ok) {
356
+ return {
357
+ data: _response.body,
358
+ rawResponse: _response.rawResponse,
359
+ };
360
+ }
361
+ if (_response.error.reason === "status-code") {
362
+ switch (_response.error.statusCode) {
363
+ case 400:
364
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
365
+ case 401:
366
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
367
+ case 403:
368
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
369
+ case 429:
370
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
371
+ default:
372
+ throw new errors.ManagementError({
373
+ statusCode: _response.error.statusCode,
374
+ body: _response.error.body,
375
+ rawResponse: _response.rawResponse,
376
+ });
377
+ }
378
+ }
379
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/organizations/{id}/connections/{connection_id}");
380
+ });
381
+ }
382
+ }
383
+ exports.ConnectionsClient = ConnectionsClient;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -12,6 +12,7 @@ export declare class DiscoveryDomainsClient {
12
12
  constructor(options: DiscoveryDomainsClient.Options);
13
13
  /**
14
14
  * Retrieve list of all organization discovery domains associated with the specified organization.
15
+ * This endpoint is subject to eventual consistency; newly created, updated, or deleted discovery domains may not immediately appear in the response.
15
16
  *
16
17
  * @param {string} id - ID of the organization.
17
18
  * @param {Management.ListOrganizationDiscoveryDomainsRequestParameters} request
@@ -53,7 +54,7 @@ export declare class DiscoveryDomainsClient {
53
54
  private __create;
54
55
  /**
55
56
  * Retrieve details about a single organization discovery domain specified by domain name.
56
- *
57
+ * This endpoint is subject to eventual consistency; newly created, updated, or deleted discovery domains may not immediately appear in the response.
57
58
  *
58
59
  * @param {string} id - ID of the organization.
59
60
  * @param {string} discovery_domain - Domain name of the discovery domain.
@@ -72,6 +73,7 @@ export declare class DiscoveryDomainsClient {
72
73
  private __getByName;
73
74
  /**
74
75
  * Retrieve details about a single organization discovery domain specified by ID.
76
+ * This endpoint is subject to eventual consistency; newly created, updated, or deleted discovery domains may not immediately appear in the response.
75
77
  *
76
78
  * @param {string} id - ID of the organization.
77
79
  * @param {string} discovery_domain_id - ID of the discovery domain.
@@ -57,6 +57,7 @@ class DiscoveryDomainsClient {
57
57
  }
58
58
  /**
59
59
  * Retrieve list of all organization discovery domains associated with the specified organization.
60
+ * This endpoint is subject to eventual consistency; newly created, updated, or deleted discovery domains may not immediately appear in the response.
60
61
  *
61
62
  * @param {string} id - ID of the organization.
62
63
  * @param {Management.ListOrganizationDiscoveryDomainsRequestParameters} request
@@ -210,7 +211,7 @@ class DiscoveryDomainsClient {
210
211
  }
211
212
  /**
212
213
  * Retrieve details about a single organization discovery domain specified by domain name.
213
- *
214
+ * This endpoint is subject to eventual consistency; newly created, updated, or deleted discovery domains may not immediately appear in the response.
214
215
  *
215
216
  * @param {string} id - ID of the organization.
216
217
  * @param {string} discovery_domain - Domain name of the discovery domain.
@@ -275,6 +276,7 @@ class DiscoveryDomainsClient {
275
276
  }
276
277
  /**
277
278
  * Retrieve details about a single organization discovery domain specified by ID.
279
+ * This endpoint is subject to eventual consistency; newly created, updated, or deleted discovery domains may not immediately appear in the response.
278
280
  *
279
281
  * @param {string} id - ID of the organization.
280
282
  * @param {string} discovery_domain_id - ID of the discovery domain.
@@ -1,4 +1,5 @@
1
1
  export * as clientGrants from "./clientGrants/index.js";
2
+ export * as connections from "./connections/index.js";
2
3
  export * as discoveryDomains from "./discoveryDomains/index.js";
3
4
  export * as enabledConnections from "./enabledConnections/index.js";
4
5
  export * as invitations from "./invitations/index.js";
@@ -33,8 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.members = exports.invitations = exports.enabledConnections = exports.discoveryDomains = exports.clientGrants = void 0;
36
+ exports.members = exports.invitations = exports.enabledConnections = exports.discoveryDomains = exports.connections = exports.clientGrants = void 0;
37
37
  exports.clientGrants = __importStar(require("./clientGrants/index.js"));
38
+ exports.connections = __importStar(require("./connections/index.js"));
38
39
  exports.discoveryDomains = __importStar(require("./discoveryDomains/index.js"));
39
40
  exports.enabledConnections = __importStar(require("./enabledConnections/index.js"));
40
41
  exports.invitations = __importStar(require("./invitations/index.js"));
@@ -10,6 +10,29 @@ export declare namespace RefreshTokensClient {
10
10
  export declare class RefreshTokensClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<RefreshTokensClient.Options>;
12
12
  constructor(options: RefreshTokensClient.Options);
13
+ /**
14
+ * Retrieve a paginated list of refresh tokens for a specific user, with optional filtering by client ID. Results are sorted by credential_id ascending.
15
+ *
16
+ * @param {Management.GetRefreshTokensRequestParameters} request
17
+ * @param {RefreshTokensClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Management.BadRequestError}
20
+ * @throws {@link Management.UnauthorizedError}
21
+ * @throws {@link Management.ForbiddenError}
22
+ * @throws {@link Management.NotFoundError}
23
+ * @throws {@link Management.TooManyRequestsError}
24
+ *
25
+ * @example
26
+ * await client.refreshTokens.list({
27
+ * user_id: "user_id",
28
+ * client_id: "client_id",
29
+ * from: "from",
30
+ * take: 1,
31
+ * fields: "fields",
32
+ * include_fields: true
33
+ * })
34
+ */
35
+ list(request: Management.GetRefreshTokensRequestParameters, requestOptions?: RefreshTokensClient.RequestOptions): Promise<core.Page<Management.RefreshTokenResponseContent, Management.GetRefreshTokensPaginatedResponseContent>>;
13
36
  /**
14
37
  * Retrieve refresh token information.
15
38
  *
@@ -55,6 +55,94 @@ class RefreshTokensClient {
55
55
  constructor(options) {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
+ /**
59
+ * Retrieve a paginated list of refresh tokens for a specific user, with optional filtering by client ID. Results are sorted by credential_id ascending.
60
+ *
61
+ * @param {Management.GetRefreshTokensRequestParameters} request
62
+ * @param {RefreshTokensClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Management.BadRequestError}
65
+ * @throws {@link Management.UnauthorizedError}
66
+ * @throws {@link Management.ForbiddenError}
67
+ * @throws {@link Management.NotFoundError}
68
+ * @throws {@link Management.TooManyRequestsError}
69
+ *
70
+ * @example
71
+ * await client.refreshTokens.list({
72
+ * user_id: "user_id",
73
+ * client_id: "client_id",
74
+ * from: "from",
75
+ * take: 1,
76
+ * fields: "fields",
77
+ * include_fields: true
78
+ * })
79
+ */
80
+ list(request, requestOptions) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
83
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
84
+ const { user_id: userId, client_id: clientId, from: from_, take = 50, fields, include_fields: includeFields, } = request;
85
+ const _queryParams = {
86
+ user_id: userId,
87
+ client_id: clientId,
88
+ from: from_,
89
+ take,
90
+ fields,
91
+ include_fields: includeFields,
92
+ };
93
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
94
+ let _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
95
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
96
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ManagementEnvironment.Default, "refresh-tokens"),
97
+ method: "GET",
98
+ headers: _headers,
99
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
100
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
101
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
102
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
103
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
104
+ logging: this._options.logging,
105
+ });
106
+ if (_response.ok) {
107
+ return {
108
+ data: _response.body,
109
+ rawResponse: _response.rawResponse,
110
+ };
111
+ }
112
+ if (_response.error.reason === "status-code") {
113
+ switch (_response.error.statusCode) {
114
+ case 400:
115
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
116
+ case 401:
117
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
118
+ case 403:
119
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
120
+ case 404:
121
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
122
+ case 429:
123
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
124
+ default:
125
+ throw new errors.ManagementError({
126
+ statusCode: _response.error.statusCode,
127
+ body: _response.error.body,
128
+ rawResponse: _response.rawResponse,
129
+ });
130
+ }
131
+ }
132
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/refresh-tokens");
133
+ }));
134
+ const dataWithRawResponse = yield list(request).withRawResponse();
135
+ return new core.Page({
136
+ response: dataWithRawResponse.data,
137
+ rawResponse: dataWithRawResponse.rawResponse,
138
+ hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.next) != null && !(typeof (response === null || response === void 0 ? void 0 : response.next) === "string" && (response === null || response === void 0 ? void 0 : response.next) === ""),
139
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.refresh_tokens) !== null && _a !== void 0 ? _a : []; },
140
+ loadPage: (response) => {
141
+ return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
142
+ },
143
+ });
144
+ });
145
+ }
58
146
  /**
59
147
  * Retrieve refresh token information.
60
148
  *