auth0 7.1.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.
- package/dist/cjs/management/api/requests/requests.d.ts +213 -4
- package/dist/cjs/management/api/resources/experimentation/client/Client.d.ts +6 -0
- package/dist/cjs/management/api/resources/experimentation/client/Client.js +10 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.d.ts +133 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.js +485 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/client/Client.d.ts +126 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/client/Client.js +471 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/exports.d.ts +3 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/exports.js +22 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/index.d.ts +2 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/index.js +18 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/index.js +37 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.d.ts +109 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.js +390 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/index.js +2 -0
- package/dist/cjs/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/exports.js +2 -2
- package/dist/cjs/management/api/resources/experimentation/resources/index.d.ts +2 -0
- package/dist/cjs/management/api/resources/experimentation/resources/index.js +3 -1
- package/dist/cjs/management/api/resources/experimentation/resources/segments/client/Client.d.ts +104 -0
- package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/segments}/client/Client.js +205 -39
- package/dist/cjs/management/api/resources/experimentation/resources/segments/client/index.js +2 -0
- package/dist/cjs/management/api/resources/experimentation/resources/segments/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/experimentation/resources/segments/exports.js +21 -0
- package/dist/cjs/management/api/resources/experimentation/resources/segments/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/experimentation/resources/segments/index.js +17 -0
- package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +0 -3
- package/dist/cjs/management/api/resources/organizations/client/Client.js +2 -7
- package/dist/cjs/management/api/resources/organizations/resources/index.d.ts +0 -1
- package/dist/cjs/management/api/resources/organizations/resources/index.js +1 -2
- package/dist/cjs/management/api/resources/users/client/Client.d.ts +8 -10
- package/dist/cjs/management/api/resources/users/client/Client.js +8 -10
- package/dist/cjs/management/api/types/types.d.ts +568 -91
- package/dist/cjs/management/api/types/types.js +113 -50
- package/dist/cjs/management/version.d.ts +1 -1
- package/dist/cjs/management/version.js +1 -1
- package/dist/esm/management/api/requests/requests.d.mts +213 -4
- package/dist/esm/management/api/resources/experimentation/client/Client.d.mts +6 -0
- package/dist/esm/management/api/resources/experimentation/client/Client.mjs +10 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.d.mts +133 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.mjs +485 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/Client.d.mts +126 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/Client.mjs +434 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/exports.d.mts +3 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/exports.mjs +4 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/index.d.mts +2 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/index.mjs +2 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.d.mts +109 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/Client.mjs +353 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/featureFlags/resources/variations/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/exports.mjs +1 -1
- package/dist/esm/management/api/resources/experimentation/resources/index.d.mts +2 -0
- package/dist/esm/management/api/resources/experimentation/resources/index.mjs +2 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/client/Client.d.mts +104 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/client/Client.mjs +361 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/exports.mjs +3 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/segments/index.mjs +1 -0
- package/dist/esm/management/api/resources/organizations/client/Client.d.mts +0 -3
- package/dist/esm/management/api/resources/organizations/client/Client.mjs +0 -5
- package/dist/esm/management/api/resources/organizations/resources/index.d.mts +0 -1
- package/dist/esm/management/api/resources/organizations/resources/index.mjs +0 -1
- package/dist/esm/management/api/resources/users/client/Client.d.mts +8 -10
- package/dist/esm/management/api/resources/users/client/Client.mjs +8 -10
- package/dist/esm/management/api/types/types.d.mts +568 -91
- package/dist/esm/management/api/types/types.mjs +92 -29
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/package.json +34 -12
- package/reference.md +1635 -220
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.ts +0 -63
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/exports.d.ts +0 -2
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.mts +0 -63
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.mjs +0 -195
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/exports.d.mts +0 -2
- /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags}/client/index.d.ts +0 -0
- /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags}/client/index.js +0 -0
- /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
- /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.d.ts +0 -0
- /package/dist/cjs/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.js +0 -0
- /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
- /package/dist/esm/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.d.mts +0 -0
- /package/dist/esm/management/api/resources/{organizations/resources/organizationTemplate → experimentation/resources/featureFlags/resources/variations}/index.mjs +0 -0
package/dist/esm/management/api/resources/experimentation/resources/segments/client/Client.mjs
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
13
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
import * as Management from "../../../../../index.mjs";
|
|
18
|
+
export class SegmentsClient {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a paginated list of segments for the tenant.
|
|
24
|
+
*
|
|
25
|
+
* @param {Management.ListSegmentsRequestParameters} request
|
|
26
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Management.BadRequestError}
|
|
29
|
+
* @throws {@link Management.UnauthorizedError}
|
|
30
|
+
* @throws {@link Management.ForbiddenError}
|
|
31
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.experimentation.segments.list({
|
|
35
|
+
* from: "from",
|
|
36
|
+
* take: 1,
|
|
37
|
+
* type: "auth0"
|
|
38
|
+
* })
|
|
39
|
+
*/
|
|
40
|
+
list() {
|
|
41
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
42
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
44
|
+
const { from: from_, take = 50, type: type_ } = request;
|
|
45
|
+
const _queryParams = {
|
|
46
|
+
from: from_,
|
|
47
|
+
take,
|
|
48
|
+
type: type_ !== undefined ? type_ : undefined,
|
|
49
|
+
};
|
|
50
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
51
|
+
let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
52
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
53
|
+
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"),
|
|
54
|
+
method: "GET",
|
|
55
|
+
headers: _headers,
|
|
56
|
+
queryString: core.url
|
|
57
|
+
.queryBuilder()
|
|
58
|
+
.addMany(_queryParams)
|
|
59
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
60
|
+
.build(),
|
|
61
|
+
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,
|
|
62
|
+
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,
|
|
63
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
64
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
65
|
+
logging: this._options.logging,
|
|
66
|
+
});
|
|
67
|
+
if (_response.ok) {
|
|
68
|
+
return {
|
|
69
|
+
data: _response.body,
|
|
70
|
+
rawResponse: _response.rawResponse,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (_response.error.reason === "status-code") {
|
|
74
|
+
switch (_response.error.statusCode) {
|
|
75
|
+
case 400:
|
|
76
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
77
|
+
case 401:
|
|
78
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 403:
|
|
80
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
81
|
+
case 429:
|
|
82
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
83
|
+
default:
|
|
84
|
+
throw new errors.ManagementError({
|
|
85
|
+
statusCode: _response.error.statusCode,
|
|
86
|
+
body: _response.error.body,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/experimentation/segments");
|
|
92
|
+
}));
|
|
93
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
94
|
+
return new core.Page({
|
|
95
|
+
response: dataWithRawResponse.data,
|
|
96
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
97
|
+
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) === ""),
|
|
98
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.segments) !== null && _a !== void 0 ? _a : []; },
|
|
99
|
+
loadPage: (response) => {
|
|
100
|
+
return list(core.setObjectProperty(request, "from", response === null || response === void 0 ? void 0 : response.next));
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Create a new segment with rule-based membership criteria for use in experiments.
|
|
107
|
+
*
|
|
108
|
+
* @param {Management.CreateSegmentRequestContent} request
|
|
109
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
110
|
+
*
|
|
111
|
+
* @throws {@link Management.BadRequestError}
|
|
112
|
+
* @throws {@link Management.UnauthorizedError}
|
|
113
|
+
* @throws {@link Management.ForbiddenError}
|
|
114
|
+
* @throws {@link Management.ConflictError}
|
|
115
|
+
* @throws {@link Management.UnprocessableEntityError}
|
|
116
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* await client.experimentation.segments.create({
|
|
120
|
+
* name: "name",
|
|
121
|
+
* rules: [{}]
|
|
122
|
+
* })
|
|
123
|
+
*/
|
|
124
|
+
create(request, requestOptions) {
|
|
125
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
126
|
+
}
|
|
127
|
+
__create(request, requestOptions) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
130
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
131
|
+
let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
132
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
133
|
+
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"),
|
|
134
|
+
method: "POST",
|
|
135
|
+
headers: _headers,
|
|
136
|
+
contentType: "application/json",
|
|
137
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
138
|
+
requestType: "json",
|
|
139
|
+
body: request,
|
|
140
|
+
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,
|
|
141
|
+
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,
|
|
142
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
143
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
144
|
+
logging: this._options.logging,
|
|
145
|
+
});
|
|
146
|
+
if (_response.ok) {
|
|
147
|
+
return {
|
|
148
|
+
data: _response.body,
|
|
149
|
+
rawResponse: _response.rawResponse,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (_response.error.reason === "status-code") {
|
|
153
|
+
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
|
+
case 403:
|
|
159
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
160
|
+
case 409:
|
|
161
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
162
|
+
case 422:
|
|
163
|
+
throw new Management.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
164
|
+
case 429:
|
|
165
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
166
|
+
default:
|
|
167
|
+
throw new errors.ManagementError({
|
|
168
|
+
statusCode: _response.error.statusCode,
|
|
169
|
+
body: _response.error.body,
|
|
170
|
+
rawResponse: _response.rawResponse,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/experimentation/segments");
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Retrieve a single segment by its ID.
|
|
179
|
+
*
|
|
180
|
+
* @param {string} id - The ID of the segment to retrieve.
|
|
181
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
182
|
+
*
|
|
183
|
+
* @throws {@link Management.UnauthorizedError}
|
|
184
|
+
* @throws {@link Management.ForbiddenError}
|
|
185
|
+
* @throws {@link Management.NotFoundError}
|
|
186
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* await client.experimentation.segments.get("id")
|
|
190
|
+
*/
|
|
191
|
+
get(id, requestOptions) {
|
|
192
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
193
|
+
}
|
|
194
|
+
__get(id, requestOptions) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
197
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
198
|
+
let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
199
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
200
|
+
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)}`),
|
|
201
|
+
method: "GET",
|
|
202
|
+
headers: _headers,
|
|
203
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
204
|
+
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,
|
|
205
|
+
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,
|
|
206
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
207
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
208
|
+
logging: this._options.logging,
|
|
209
|
+
});
|
|
210
|
+
if (_response.ok) {
|
|
211
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
212
|
+
}
|
|
213
|
+
if (_response.error.reason === "status-code") {
|
|
214
|
+
switch (_response.error.statusCode) {
|
|
215
|
+
case 401:
|
|
216
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
217
|
+
case 403:
|
|
218
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
219
|
+
case 404:
|
|
220
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
221
|
+
case 429:
|
|
222
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
223
|
+
default:
|
|
224
|
+
throw new errors.ManagementError({
|
|
225
|
+
statusCode: _response.error.statusCode,
|
|
226
|
+
body: _response.error.body,
|
|
227
|
+
rawResponse: _response.rawResponse,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/experimentation/segments/{id}");
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Delete a segment by ID. Idempotent: returns 204 even if segment does not exist.
|
|
236
|
+
*
|
|
237
|
+
* @param {string} id - The ID of the segment to delete.
|
|
238
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
239
|
+
*
|
|
240
|
+
* @throws {@link Management.ForbiddenError}
|
|
241
|
+
* @throws {@link Management.ConflictError}
|
|
242
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* await client.experimentation.segments.delete("id")
|
|
246
|
+
*/
|
|
247
|
+
delete(id, requestOptions) {
|
|
248
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
249
|
+
}
|
|
250
|
+
__delete(id, requestOptions) {
|
|
251
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
252
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
253
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
254
|
+
let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
255
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
256
|
+
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)}`),
|
|
257
|
+
method: "DELETE",
|
|
258
|
+
headers: _headers,
|
|
259
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
260
|
+
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,
|
|
261
|
+
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,
|
|
262
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
263
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
264
|
+
logging: this._options.logging,
|
|
265
|
+
});
|
|
266
|
+
if (_response.ok) {
|
|
267
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
268
|
+
}
|
|
269
|
+
if (_response.error.reason === "status-code") {
|
|
270
|
+
switch (_response.error.statusCode) {
|
|
271
|
+
case 403:
|
|
272
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
273
|
+
case 409:
|
|
274
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
275
|
+
case 429:
|
|
276
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
277
|
+
default:
|
|
278
|
+
throw new errors.ManagementError({
|
|
279
|
+
statusCode: _response.error.statusCode,
|
|
280
|
+
body: _response.error.body,
|
|
281
|
+
rawResponse: _response.rawResponse,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/experimentation/segments/{id}");
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Partially update a segment by ID. Only provided fields are updated. Sending rules replaces the entire rules array.
|
|
290
|
+
*
|
|
291
|
+
* @param {string} id - The ID of the segment to update.
|
|
292
|
+
* @param {Management.UpdateSegmentRequestContent} request
|
|
293
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
|
+
*
|
|
295
|
+
* @throws {@link Management.BadRequestError}
|
|
296
|
+
* @throws {@link Management.UnauthorizedError}
|
|
297
|
+
* @throws {@link Management.ForbiddenError}
|
|
298
|
+
* @throws {@link Management.NotFoundError}
|
|
299
|
+
* @throws {@link Management.ConflictError}
|
|
300
|
+
* @throws {@link Management.UnprocessableEntityError}
|
|
301
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* await client.experimentation.segments.update("id")
|
|
305
|
+
*/
|
|
306
|
+
update(id, request = {}, requestOptions) {
|
|
307
|
+
return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
308
|
+
}
|
|
309
|
+
__update(id_1) {
|
|
310
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
311
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
312
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
313
|
+
let _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
314
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
315
|
+
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)}`),
|
|
316
|
+
method: "PATCH",
|
|
317
|
+
headers: _headers,
|
|
318
|
+
contentType: "application/json",
|
|
319
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
320
|
+
requestType: "json",
|
|
321
|
+
body: request,
|
|
322
|
+
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,
|
|
323
|
+
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,
|
|
324
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
325
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
326
|
+
logging: this._options.logging,
|
|
327
|
+
});
|
|
328
|
+
if (_response.ok) {
|
|
329
|
+
return {
|
|
330
|
+
data: _response.body,
|
|
331
|
+
rawResponse: _response.rawResponse,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
if (_response.error.reason === "status-code") {
|
|
335
|
+
switch (_response.error.statusCode) {
|
|
336
|
+
case 400:
|
|
337
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
338
|
+
case 401:
|
|
339
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
340
|
+
case 403:
|
|
341
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
342
|
+
case 404:
|
|
343
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
344
|
+
case 409:
|
|
345
|
+
throw new Management.ConflictError(_response.error.body, _response.rawResponse);
|
|
346
|
+
case 422:
|
|
347
|
+
throw new Management.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
348
|
+
case 429:
|
|
349
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
350
|
+
default:
|
|
351
|
+
throw new errors.ManagementError({
|
|
352
|
+
statusCode: _response.error.statusCode,
|
|
353
|
+
body: _response.error.body,
|
|
354
|
+
rawResponse: _response.rawResponse,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/experimentation/segments/{id}");
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
}
|
package/dist/esm/management/api/resources/experimentation/resources/segments/client/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -10,7 +10,6 @@ import { EnabledConnectionsClient } from "../resources/enabledConnections/client
|
|
|
10
10
|
import { GroupsClient } from "../resources/groups/client/Client.mjs";
|
|
11
11
|
import { InvitationsClient } from "../resources/invitations/client/Client.mjs";
|
|
12
12
|
import { MembersClient } from "../resources/members/client/Client.mjs";
|
|
13
|
-
import { OrganizationTemplateClient } from "../resources/organizationTemplate/client/Client.mjs";
|
|
14
13
|
import { RolesClient } from "../resources/roles/client/Client.mjs";
|
|
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
|
/**
|
|
@@ -23,7 +23,6 @@ import { EnabledConnectionsClient } from "../resources/enabledConnections/client
|
|
|
23
23
|
import { GroupsClient } from "../resources/groups/client/Client.mjs";
|
|
24
24
|
import { InvitationsClient } from "../resources/invitations/client/Client.mjs";
|
|
25
25
|
import { MembersClient } from "../resources/members/client/Client.mjs";
|
|
26
|
-
import { OrganizationTemplateClient } from "../resources/organizationTemplate/client/Client.mjs";
|
|
27
26
|
import { RolesClient } from "../resources/roles/client/Client.mjs";
|
|
28
27
|
export class OrganizationsClient {
|
|
29
28
|
constructor(options) {
|
|
@@ -57,10 +56,6 @@ export class OrganizationsClient {
|
|
|
57
56
|
var _a;
|
|
58
57
|
return ((_a = this._members) !== null && _a !== void 0 ? _a : (this._members = new MembersClient(this._options)));
|
|
59
58
|
}
|
|
60
|
-
get organizationTemplate() {
|
|
61
|
-
var _a;
|
|
62
|
-
return ((_a = this._organizationTemplate) !== null && _a !== void 0 ? _a : (this._organizationTemplate = new OrganizationTemplateClient(this._options)));
|
|
63
|
-
}
|
|
64
59
|
get groups() {
|
|
65
60
|
var _a;
|
|
66
61
|
return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new GroupsClient(this._options)));
|
|
@@ -6,5 +6,4 @@ export * as enabledConnections from "./enabledConnections/index.mjs";
|
|
|
6
6
|
export * as groups from "./groups/index.mjs";
|
|
7
7
|
export * as invitations from "./invitations/index.mjs";
|
|
8
8
|
export * as members from "./members/index.mjs";
|
|
9
|
-
export * as organizationTemplate from "./organizationTemplate/index.mjs";
|
|
10
9
|
export * as roles from "./roles/index.mjs";
|
|
@@ -6,5 +6,4 @@ export * as enabledConnections from "./enabledConnections/index.mjs";
|
|
|
6
6
|
export * as groups from "./groups/index.mjs";
|
|
7
7
|
export * as invitations from "./invitations/index.mjs";
|
|
8
8
|
export * as members from "./members/index.mjs";
|
|
9
|
-
export * as organizationTemplate from "./organizationTemplate/index.mjs";
|
|
10
9
|
export * as roles from "./roles/index.mjs";
|
|
@@ -59,24 +59,22 @@ export declare class UsersClient {
|
|
|
59
59
|
get refreshToken(): RefreshTokenClient;
|
|
60
60
|
get sessions(): SessionsClient;
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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.
|
|
@@ -100,24 +100,22 @@ export class UsersClient {
|
|
|
100
100
|
return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new SessionsClient(this._options)));
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
103
|
+
* 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:
|
|
104
104
|
*
|
|
105
|
-
* - Specify
|
|
105
|
+
* - Specify search criteria for users
|
|
106
106
|
* - Sort the users to be returned
|
|
107
107
|
* - Select the fields to be returned
|
|
108
108
|
* - Specify the number of users to retrieve per page and the page index
|
|
109
109
|
*
|
|
110
|
+
* 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.
|
|
110
111
|
*
|
|
112
|
+
* - 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.
|
|
113
|
+
* - 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.
|
|
114
|
+
* - 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.
|
|
111
115
|
*
|
|
112
|
-
*
|
|
116
|
+
* 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).
|
|
113
117
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API endpoints for retrieving users.
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* 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.
|
|
118
|
+
* 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.
|
|
121
119
|
*
|
|
122
120
|
* @param {Management.ListUsersRequestParameters} request
|
|
123
121
|
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|