auth0 7.2.0 → 7.3.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 (93) hide show
  1. package/dist/cjs/management/api/requests/requests.d.ts +208 -4
  2. package/dist/cjs/management/api/resources/experimentation/client/Client.d.ts +6 -0
  3. package/dist/cjs/management/api/resources/experimentation/client/Client.js +10 -0
  4. package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.d.ts +133 -0
  5. package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.js +485 -0
  6. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/client/Client.d.ts +126 -0
  7. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/client/Client.js +471 -0
  8. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/exports.d.ts +3 -0
  9. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/exports.js +22 -0
  10. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/index.d.ts +2 -0
  11. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/index.js +18 -0
  12. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/index.d.ts +1 -0
  13. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/index.js +37 -0
  14. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.d.ts +109 -0
  15. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.js +390 -0
  16. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/index.js +2 -0
  17. package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.d.ts +2 -0
  18. package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/exports.js +2 -2
  19. package/dist/cjs/management/api/resources/experimentation/resources/index.d.ts +2 -0
  20. package/dist/cjs/management/api/resources/experimentation/resources/index.js +3 -1
  21. package/dist/cjs/management/api/resources/experimentation/resources/segments/client/Client.d.ts +104 -0
  22. package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/segments}/client/Client.js +205 -39
  23. package/dist/cjs/management/api/resources/experimentation/resources/segments/client/index.js +2 -0
  24. package/dist/cjs/management/api/resources/experimentation/resources/segments/exports.d.ts +2 -0
  25. package/dist/cjs/management/api/resources/experimentation/resources/segments/exports.js +21 -0
  26. package/dist/cjs/management/api/resources/experimentation/resources/segments/index.d.ts +1 -0
  27. package/dist/cjs/management/api/resources/experimentation/resources/segments/index.js +17 -0
  28. package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +0 -3
  29. package/dist/cjs/management/api/resources/organizations/client/Client.js +2 -7
  30. package/dist/cjs/management/api/resources/organizations/resources/index.d.ts +0 -1
  31. package/dist/cjs/management/api/resources/organizations/resources/index.js +1 -2
  32. package/dist/cjs/management/api/resources/users/client/Client.d.ts +8 -10
  33. package/dist/cjs/management/api/resources/users/client/Client.js +8 -10
  34. package/dist/cjs/management/api/types/types.d.ts +507 -91
  35. package/dist/cjs/management/api/types/types.js +99 -50
  36. package/dist/cjs/management/version.d.ts +1 -1
  37. package/dist/cjs/management/version.js +1 -1
  38. package/dist/esm/management/api/requests/requests.d.mts +208 -4
  39. package/dist/esm/management/api/resources/experimentation/client/Client.d.mts +6 -0
  40. package/dist/esm/management/api/resources/experimentation/client/Client.mjs +10 -0
  41. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.d.mts +133 -0
  42. package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.mjs +485 -0
  43. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/Client.d.mts +126 -0
  44. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/Client.mjs +434 -0
  45. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/index.d.mts +1 -0
  46. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/index.mjs +1 -0
  47. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/exports.d.mts +3 -0
  48. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/exports.mjs +4 -0
  49. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/index.d.mts +2 -0
  50. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/index.mjs +2 -0
  51. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/index.d.mts +1 -0
  52. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/index.mjs +1 -0
  53. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.d.mts +109 -0
  54. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.mjs +353 -0
  55. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/index.d.mts +1 -0
  56. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/index.mjs +1 -0
  57. package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.d.mts +2 -0
  58. package/dist/esm/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/exports.mjs +1 -1
  59. package/dist/esm/management/api/resources/experimentation/resources/index.d.mts +2 -0
  60. package/dist/esm/management/api/resources/experimentation/resources/index.mjs +2 -0
  61. package/dist/esm/management/api/resources/experimentation/resources/segments/client/Client.d.mts +104 -0
  62. package/dist/esm/management/api/resources/experimentation/resources/segments/client/Client.mjs +361 -0
  63. package/dist/esm/management/api/resources/experimentation/resources/segments/client/index.d.mts +1 -0
  64. package/dist/esm/management/api/resources/experimentation/resources/segments/client/index.mjs +1 -0
  65. package/dist/esm/management/api/resources/experimentation/resources/segments/exports.d.mts +2 -0
  66. package/dist/esm/management/api/resources/experimentation/resources/segments/exports.mjs +3 -0
  67. package/dist/esm/management/api/resources/experimentation/resources/segments/index.d.mts +1 -0
  68. package/dist/esm/management/api/resources/experimentation/resources/segments/index.mjs +1 -0
  69. package/dist/esm/management/api/resources/organizations/client/Client.d.mts +0 -3
  70. package/dist/esm/management/api/resources/organizations/client/Client.mjs +0 -5
  71. package/dist/esm/management/api/resources/organizations/resources/index.d.mts +0 -1
  72. package/dist/esm/management/api/resources/organizations/resources/index.mjs +0 -1
  73. package/dist/esm/management/api/resources/users/client/Client.d.mts +8 -10
  74. package/dist/esm/management/api/resources/users/client/Client.mjs +8 -10
  75. package/dist/esm/management/api/types/types.d.mts +507 -91
  76. package/dist/esm/management/api/types/types.mjs +78 -29
  77. package/dist/esm/management/version.d.mts +1 -1
  78. package/dist/esm/management/version.mjs +1 -1
  79. package/package.json +34 -12
  80. package/reference.md +1635 -220
  81. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.ts +0 -63
  82. package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/exports.d.ts +0 -2
  83. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.mts +0 -63
  84. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.mjs +0 -195
  85. package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/exports.d.mts +0 -2
  86. /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags}/client/index.d.ts +0 -0
  87. /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags}/client/index.js +0 -0
  88. /package/dist/{esm/management/api/resources/organizations/resources/organizationTemplate/client/index.d.mts → cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/index.d.ts} +0 -0
  89. /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.d.ts +0 -0
  90. /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.js +0 -0
  91. /package/dist/{esm/management/api/resources/organizations/resources/organizationTemplate/client/index.mjs → cjs/management/api/resources/experimentation/resources/segments/client/index.d.ts} +0 -0
  92. /package/dist/esm/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.d.mts +0 -0
  93. /package/dist/esm/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.mjs +0 -0
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.OrganizationTemplateClient = void 0;
46
+ exports.SegmentsClient = void 0;
47
47
  const BaseClient_js_1 = require("../../../../../../BaseClient.js");
48
48
  const core = __importStar(require("../../../../../../core/index.js"));
49
49
  const headers_js_1 = require("../../../../../../core/headers.js");
@@ -51,15 +51,170 @@ const environments = __importStar(require("../../../../../../environments.js"));
51
51
  const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
52
52
  const errors = __importStar(require("../../../../../../errors/index.js"));
53
53
  const Management = __importStar(require("../../../../../index.js"));
54
- class OrganizationTemplateClient {
54
+ class SegmentsClient {
55
55
  constructor(options) {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
58
  /**
59
- * Retrieve the organization template assigned to a specific organization. Returns the template object if one is explicitly assigned, or a 404 if no template is assigned.
59
+ * Retrieve a paginated list of segments for the tenant.
60
60
  *
61
- * @param {string} id - ID of the organization.
62
- * @param {OrganizationTemplateClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ * @param {Management.ListSegmentsRequestParameters} request
62
+ * @param {SegmentsClient.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.TooManyRequestsError}
68
+ *
69
+ * @example
70
+ * await client.experimentation.segments.list({
71
+ * from: "from",
72
+ * take: 1,
73
+ * type: "auth0"
74
+ * })
75
+ */
76
+ list() {
77
+ return __awaiter(this, arguments, void 0, function* (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 { from: from_, take = 50, type: type_ } = request;
81
+ const _queryParams = {
82
+ from: from_,
83
+ take,
84
+ type: type_ !== undefined ? type_ : undefined,
85
+ };
86
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
87
+ 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);
88
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
89
+ 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, "experimentation/segments"),
90
+ method: "GET",
91
+ headers: _headers,
92
+ queryString: core.url
93
+ .queryBuilder()
94
+ .addMany(_queryParams)
95
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
96
+ .build(),
97
+ 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,
98
+ 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,
99
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
100
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
101
+ logging: this._options.logging,
102
+ });
103
+ if (_response.ok) {
104
+ return {
105
+ data: _response.body,
106
+ rawResponse: _response.rawResponse,
107
+ };
108
+ }
109
+ if (_response.error.reason === "status-code") {
110
+ switch (_response.error.statusCode) {
111
+ case 400:
112
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
113
+ case 401:
114
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
115
+ case 403:
116
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
117
+ case 429:
118
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
119
+ default:
120
+ throw new errors.ManagementError({
121
+ statusCode: _response.error.statusCode,
122
+ body: _response.error.body,
123
+ rawResponse: _response.rawResponse,
124
+ });
125
+ }
126
+ }
127
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/experimentation/segments");
128
+ }));
129
+ const dataWithRawResponse = yield list(request).withRawResponse();
130
+ return new core.Page({
131
+ response: dataWithRawResponse.data,
132
+ rawResponse: dataWithRawResponse.rawResponse,
133
+ 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) === ""),
134
+ getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.segments) !== null && _a !== void 0 ? _a : []; },
135
+ loadPage: (response) => {
136
+ return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
137
+ },
138
+ });
139
+ });
140
+ }
141
+ /**
142
+ * Create a new segment with rule-based membership criteria for use in experiments.
143
+ *
144
+ * @param {Management.CreateSegmentRequestContent} request
145
+ * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link Management.BadRequestError}
148
+ * @throws {@link Management.UnauthorizedError}
149
+ * @throws {@link Management.ForbiddenError}
150
+ * @throws {@link Management.ConflictError}
151
+ * @throws {@link Management.UnprocessableEntityError}
152
+ * @throws {@link Management.TooManyRequestsError}
153
+ *
154
+ * @example
155
+ * await client.experimentation.segments.create({
156
+ * name: "name",
157
+ * rules: [{}]
158
+ * })
159
+ */
160
+ create(request, requestOptions) {
161
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
162
+ }
163
+ __create(request, requestOptions) {
164
+ return __awaiter(this, void 0, void 0, function* () {
165
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
166
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
167
+ 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);
168
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
169
+ 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, "experimentation/segments"),
170
+ method: "POST",
171
+ headers: _headers,
172
+ contentType: "application/json",
173
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
174
+ requestType: "json",
175
+ body: request,
176
+ 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,
177
+ 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,
178
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
179
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
180
+ logging: this._options.logging,
181
+ });
182
+ if (_response.ok) {
183
+ return {
184
+ data: _response.body,
185
+ rawResponse: _response.rawResponse,
186
+ };
187
+ }
188
+ if (_response.error.reason === "status-code") {
189
+ switch (_response.error.statusCode) {
190
+ case 400:
191
+ throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
192
+ case 401:
193
+ throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
194
+ case 403:
195
+ throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
196
+ case 409:
197
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
198
+ case 422:
199
+ throw new Management.UnprocessableEntityError(_response.error.body, _response.rawResponse);
200
+ case 429:
201
+ throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
202
+ default:
203
+ throw new errors.ManagementError({
204
+ statusCode: _response.error.statusCode,
205
+ body: _response.error.body,
206
+ rawResponse: _response.rawResponse,
207
+ });
208
+ }
209
+ }
210
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/experimentation/segments");
211
+ });
212
+ }
213
+ /**
214
+ * Retrieve a single segment by its ID.
215
+ *
216
+ * @param {string} id - The ID of the segment to retrieve.
217
+ * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
63
218
  *
64
219
  * @throws {@link Management.UnauthorizedError}
65
220
  * @throws {@link Management.ForbiddenError}
@@ -67,7 +222,7 @@ class OrganizationTemplateClient {
67
222
  * @throws {@link Management.TooManyRequestsError}
68
223
  *
69
224
  * @example
70
- * await client.organizations.organizationTemplate.get("id")
225
+ * await client.experimentation.segments.get("id")
71
226
  */
72
227
  get(id, requestOptions) {
73
228
  return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
@@ -78,7 +233,7 @@ class OrganizationTemplateClient {
78
233
  const _authRequest = yield this._options.authProvider.getAuthRequest();
79
234
  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);
80
235
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
81
- 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)}/organization-templates`),
236
+ 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, `experimentation/segments/${core.url.encodePathParam(id)}`),
82
237
  method: "GET",
83
238
  headers: _headers,
84
239
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
@@ -109,35 +264,33 @@ class OrganizationTemplateClient {
109
264
  });
110
265
  }
111
266
  }
112
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/organizations/{id}/organization-templates");
267
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/experimentation/segments/{id}");
113
268
  });
114
269
  }
115
270
  /**
116
- * Assign an Organization Template to an organization.
271
+ * Delete a segment by ID. Idempotent: returns 204 even if segment does not exist.
117
272
  *
118
- * @param {string} id - The ID of the organization.
119
- * @param {string} template_id - The ID of the organization template to assign.
120
- * @param {OrganizationTemplateClient.RequestOptions} requestOptions - Request-specific configuration.
273
+ * @param {string} id - The ID of the segment to delete.
274
+ * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
121
275
  *
122
- * @throws {@link Management.BadRequestError}
123
- * @throws {@link Management.UnauthorizedError}
124
276
  * @throws {@link Management.ForbiddenError}
277
+ * @throws {@link Management.ConflictError}
125
278
  * @throws {@link Management.TooManyRequestsError}
126
279
  *
127
280
  * @example
128
- * await client.organizations.organizationTemplate.assignOrganizationTemplate("id", "template_id")
281
+ * await client.experimentation.segments.delete("id")
129
282
  */
130
- assignOrganizationTemplate(id, template_id, requestOptions) {
131
- return core.HttpResponsePromise.fromPromise(this.__assignOrganizationTemplate(id, template_id, requestOptions));
283
+ delete(id, requestOptions) {
284
+ return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
132
285
  }
133
- __assignOrganizationTemplate(id, template_id, requestOptions) {
286
+ __delete(id, requestOptions) {
134
287
  return __awaiter(this, void 0, void 0, function* () {
135
288
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
136
289
  const _authRequest = yield this._options.authProvider.getAuthRequest();
137
290
  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);
138
291
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
139
- 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)}/organization-templates/${core.url.encodePathParam(template_id)}`),
140
- method: "PUT",
292
+ 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, `experimentation/segments/${core.url.encodePathParam(id)}`),
293
+ method: "DELETE",
141
294
  headers: _headers,
142
295
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
143
296
  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,
@@ -151,12 +304,10 @@ class OrganizationTemplateClient {
151
304
  }
152
305
  if (_response.error.reason === "status-code") {
153
306
  switch (_response.error.statusCode) {
154
- case 400:
155
- throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
156
- case 401:
157
- throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
158
307
  case 403:
159
308
  throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
309
+ case 409:
310
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
160
311
  case 429:
161
312
  throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
162
313
  default:
@@ -167,37 +318,43 @@ class OrganizationTemplateClient {
167
318
  });
168
319
  }
169
320
  }
170
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/organizations/{id}/organization-templates/{template_id}");
321
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/experimentation/segments/{id}");
171
322
  });
172
323
  }
173
324
  /**
174
- * Remove an Organization Template assignment from an organization.
325
+ * Partially update a segment by ID. Only provided fields are updated. Sending rules replaces the entire rules array.
175
326
  *
176
- * @param {string} id - The ID of the organization.
177
- * @param {string} template_id - The ID of the organization template to unassign.
178
- * @param {OrganizationTemplateClient.RequestOptions} requestOptions - Request-specific configuration.
327
+ * @param {string} id - The ID of the segment to update.
328
+ * @param {Management.UpdateSegmentRequestContent} request
329
+ * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
179
330
  *
180
331
  * @throws {@link Management.BadRequestError}
181
332
  * @throws {@link Management.UnauthorizedError}
182
333
  * @throws {@link Management.ForbiddenError}
334
+ * @throws {@link Management.NotFoundError}
335
+ * @throws {@link Management.ConflictError}
336
+ * @throws {@link Management.UnprocessableEntityError}
183
337
  * @throws {@link Management.TooManyRequestsError}
184
338
  *
185
339
  * @example
186
- * await client.organizations.organizationTemplate.unassignOrganizationTemplate("id", "template_id")
340
+ * await client.experimentation.segments.update("id")
187
341
  */
188
- unassignOrganizationTemplate(id, template_id, requestOptions) {
189
- return core.HttpResponsePromise.fromPromise(this.__unassignOrganizationTemplate(id, template_id, requestOptions));
342
+ update(id, request = {}, requestOptions) {
343
+ return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
190
344
  }
191
- __unassignOrganizationTemplate(id, template_id, requestOptions) {
192
- return __awaiter(this, void 0, void 0, function* () {
345
+ __update(id_1) {
346
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
193
347
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
194
348
  const _authRequest = yield this._options.authProvider.getAuthRequest();
195
349
  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);
196
350
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
197
- 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)}/organization-templates/${core.url.encodePathParam(template_id)}`),
198
- method: "DELETE",
351
+ 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, `experimentation/segments/${core.url.encodePathParam(id)}`),
352
+ method: "PATCH",
199
353
  headers: _headers,
354
+ contentType: "application/json",
200
355
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
356
+ requestType: "json",
357
+ body: request,
201
358
  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,
202
359
  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,
203
360
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -205,7 +362,10 @@ class OrganizationTemplateClient {
205
362
  logging: this._options.logging,
206
363
  });
207
364
  if (_response.ok) {
208
- return { data: undefined, rawResponse: _response.rawResponse };
365
+ return {
366
+ data: _response.body,
367
+ rawResponse: _response.rawResponse,
368
+ };
209
369
  }
210
370
  if (_response.error.reason === "status-code") {
211
371
  switch (_response.error.statusCode) {
@@ -215,6 +375,12 @@ class OrganizationTemplateClient {
215
375
  throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
216
376
  case 403:
217
377
  throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
378
+ case 404:
379
+ throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
380
+ case 409:
381
+ throw new Management.ConflictError(_response.error.body, _response.rawResponse);
382
+ case 422:
383
+ throw new Management.UnprocessableEntityError(_response.error.body, _response.rawResponse);
218
384
  case 429:
219
385
  throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
220
386
  default:
@@ -225,8 +391,8 @@ class OrganizationTemplateClient {
225
391
  });
226
392
  }
227
393
  }
228
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/organizations/{id}/organization-templates/{template_id}");
394
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/experimentation/segments/{id}");
229
395
  });
230
396
  }
231
397
  }
232
- exports.OrganizationTemplateClient = OrganizationTemplateClient;
398
+ exports.SegmentsClient = SegmentsClient;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { SegmentsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.SegmentsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "SegmentsClient", { enumerable: true, get: function () { return Client_js_1.SegmentsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -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);
@@ -10,7 +10,6 @@ import { EnabledConnectionsClient } from "../resources/enabledConnections/client
10
10
  import { GroupsClient } from "../resources/groups/client/Client.js";
11
11
  import { InvitationsClient } from "../resources/invitations/client/Client.js";
12
12
  import { MembersClient } from "../resources/members/client/Client.js";
13
- import { OrganizationTemplateClient } from "../resources/organizationTemplate/client/Client.js";
14
13
  import { RolesClient } from "../resources/roles/client/Client.js";
15
14
  export declare namespace OrganizationsClient {
16
15
  type Options = BaseClientOptions;
@@ -26,7 +25,6 @@ export declare class OrganizationsClient {
26
25
  protected _enabledConnections: EnabledConnectionsClient | undefined;
27
26
  protected _invitations: InvitationsClient | undefined;
28
27
  protected _members: MembersClient | undefined;
29
- protected _organizationTemplate: OrganizationTemplateClient | undefined;
30
28
  protected _groups: GroupsClient | undefined;
31
29
  protected _roles: RolesClient | undefined;
32
30
  constructor(options: OrganizationsClient.Options);
@@ -37,7 +35,6 @@ export declare class OrganizationsClient {
37
35
  get enabledConnections(): EnabledConnectionsClient;
38
36
  get invitations(): InvitationsClient;
39
37
  get members(): MembersClient;
40
- get organizationTemplate(): OrganizationTemplateClient;
41
38
  get groups(): GroupsClient;
42
39
  get roles(): RolesClient;
43
40
  /**
@@ -59,8 +59,7 @@ const Client_js_5 = require("../resources/enabledConnections/client/Client.js");
59
59
  const Client_js_6 = require("../resources/groups/client/Client.js");
60
60
  const Client_js_7 = require("../resources/invitations/client/Client.js");
61
61
  const Client_js_8 = require("../resources/members/client/Client.js");
62
- const Client_js_9 = require("../resources/organizationTemplate/client/Client.js");
63
- const Client_js_10 = require("../resources/roles/client/Client.js");
62
+ const Client_js_9 = require("../resources/roles/client/Client.js");
64
63
  class OrganizationsClient {
65
64
  constructor(options) {
66
65
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
@@ -93,17 +92,13 @@ class OrganizationsClient {
93
92
  var _a;
94
93
  return ((_a = this._members) !== null && _a !== void 0 ? _a : (this._members = new Client_js_8.MembersClient(this._options)));
95
94
  }
96
- get organizationTemplate() {
97
- var _a;
98
- return ((_a = this._organizationTemplate) !== null && _a !== void 0 ? _a : (this._organizationTemplate = new Client_js_9.OrganizationTemplateClient(this._options)));
99
- }
100
95
  get groups() {
101
96
  var _a;
102
97
  return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new Client_js_6.GroupsClient(this._options)));
103
98
  }
104
99
  get roles() {
105
100
  var _a;
106
- return ((_a = this._roles) !== null && _a !== void 0 ? _a : (this._roles = new Client_js_10.RolesClient(this._options)));
101
+ return ((_a = this._roles) !== null && _a !== void 0 ? _a : (this._roles = new Client_js_9.RolesClient(this._options)));
107
102
  }
108
103
  /**
109
104
  * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations.
@@ -6,5 +6,4 @@ export * as enabledConnections from "./enabledConnections/index.js";
6
6
  export * as groups from "./groups/index.js";
7
7
  export * as invitations from "./invitations/index.js";
8
8
  export * as members from "./members/index.js";
9
- export * as organizationTemplate from "./organizationTemplate/index.js";
10
9
  export * as roles from "./roles/index.js";
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.roles = exports.organizationTemplate = exports.members = exports.invitations = exports.groups = exports.enabledConnections = exports.discoveryDomains = exports.connections = exports.clients = exports.clientGrants = void 0;
36
+ exports.roles = exports.members = exports.invitations = exports.groups = exports.enabledConnections = exports.discoveryDomains = exports.connections = exports.clients = exports.clientGrants = void 0;
37
37
  exports.clientGrants = __importStar(require("./clientGrants/index.js"));
38
38
  exports.clients = __importStar(require("./clients/index.js"));
39
39
  exports.connections = __importStar(require("./connections/index.js"));
@@ -42,5 +42,4 @@ exports.enabledConnections = __importStar(require("./enabledConnections/index.js
42
42
  exports.groups = __importStar(require("./groups/index.js"));
43
43
  exports.invitations = __importStar(require("./invitations/index.js"));
44
44
  exports.members = __importStar(require("./members/index.js"));
45
- exports.organizationTemplate = __importStar(require("./organizationTemplate/index.js"));
46
45
  exports.roles = __importStar(require("./roles/index.js"));
@@ -59,24 +59,22 @@ export declare class UsersClient {
59
59
  get refreshToken(): RefreshTokenClient;
60
60
  get sessions(): SessionsClient;
61
61
  /**
62
- * Retrieve details of users. It is possible to:
62
+ * This endpoint retrieves details of users. It's best suited to interactive, best-effort search and lookups where slightly stale results are acceptable. With it, you can:
63
63
  *
64
- * - Specify a search criteria for users
64
+ * - Specify search criteria for users
65
65
  * - Sort the users to be returned
66
66
  * - Select the fields to be returned
67
67
  * - Specify the number of users to retrieve per page and the page index
68
68
  *
69
+ * This endpoint is **not suited for use in critical paths**. It is eventually consistent and runs under a short (~2 second) query time limit, so results can be stale and heavy queries can return a 503.
69
70
  *
71
+ * - Do not use this endpoint for authentication, account linking, or logic inside login-flow Actions. Instead, [look users up directly by ID or email](https://auth0.com/docs/manage-users/user-search/get-users-by-id-or-email#management-api) to get their current state.
72
+ * - Do not use this endpoint to keep an external system in sync with user data. Instead, subscribe to [Event Streams](https://auth0.com/docs/customize/events/sync-data-across-systems) to receive every change as it happens.
73
+ * - Do not use this endpoint to enumerate or export your entire user base. Instead, run a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports) to retrieve the full set.
70
74
  *
71
- * The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax)
75
+ * Use the `q` query parameter to match users with [query string syntax](https://auth0.com/docs/manage-users/user-search/user-search-query-syntax). For full instructions and guidance, see [How to List and Search Users](https://auth0.com/docs/manage-users/user-search/list-and-search-users).
72
76
  *
73
- * [Learn more about searching for users.](https://auth0.com/docs/users/search/v3)
74
- *
75
- * Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users.
76
- *
77
- *
78
- *
79
- * Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension.
77
+ * For efficient queries, prefer indexed top-level fields and exact matches. Certain kinds of queries can be slow and may time out, such as filtering on freeform or multi-value fields (like user-defined attributes in `app_metadata` or `user_metadata`) or using leading wildcards.
80
78
  *
81
79
  * @param {Management.ListUsersRequestParameters} request
82
80
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -136,24 +136,22 @@ class UsersClient {
136
136
  return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new Client_js_16.SessionsClient(this._options)));
137
137
  }
138
138
  /**
139
- * Retrieve details of users. It is possible to:
139
+ * This endpoint retrieves details of users. It's best suited to interactive, best-effort search and lookups where slightly stale results are acceptable. With it, you can:
140
140
  *
141
- * - Specify a search criteria for users
141
+ * - Specify search criteria for users
142
142
  * - Sort the users to be returned
143
143
  * - Select the fields to be returned
144
144
  * - Specify the number of users to retrieve per page and the page index
145
145
  *
146
+ * This endpoint is **not suited for use in critical paths**. It is eventually consistent and runs under a short (~2 second) query time limit, so results can be stale and heavy queries can return a 503.
146
147
  *
148
+ * - Do not use this endpoint for authentication, account linking, or logic inside login-flow Actions. Instead, [look users up directly by ID or email](https://auth0.com/docs/manage-users/user-search/get-users-by-id-or-email#management-api) to get their current state.
149
+ * - Do not use this endpoint to keep an external system in sync with user data. Instead, subscribe to [Event Streams](https://auth0.com/docs/customize/events/sync-data-across-systems) to receive every change as it happens.
150
+ * - Do not use this endpoint to enumerate or export your entire user base. Instead, run a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports) to retrieve the full set.
147
151
  *
148
- * The `q` query parameter can be used to get users that match the specified criteria [using query string syntax.](https://auth0.com/docs/users/search/v3/query-syntax)
152
+ * Use the `q` query parameter to match users with [query string syntax](https://auth0.com/docs/manage-users/user-search/user-search-query-syntax). For full instructions and guidance, see [How to List and Search Users](https://auth0.com/docs/manage-users/user-search/list-and-search-users).
149
153
  *
150
- * [Learn more about searching for users.](https://auth0.com/docs/users/search/v3)
151
- *
152
- * Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users.
153
- *
154
- *
155
- *
156
- * Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / Export](https://auth0.com/docs/extensions/user-import-export) extension.
154
+ * For efficient queries, prefer indexed top-level fields and exact matches. Certain kinds of queries can be slow and may time out, such as filtering on freeform or multi-value fields (like user-defined attributes in `app_metadata` or `user_metadata`) or using leading wildcards.
157
155
  *
158
156
  * @param {Management.ListUsersRequestParameters} request
159
157
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.