auth0 6.2.0 → 6.4.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/Client.d.ts +3 -0
- package/dist/cjs/management/Client.js +45 -40
- package/dist/cjs/management/api/errors/UnprocessableEntityError.d.ts +5 -0
- package/dist/cjs/management/api/errors/UnprocessableEntityError.js +54 -0
- package/dist/cjs/management/api/errors/index.d.ts +1 -0
- package/dist/cjs/management/api/errors/index.js +1 -0
- package/dist/cjs/management/api/requests/requests.d.ts +119 -11
- package/dist/cjs/management/api/resources/clients/client/Client.d.ts +2 -2
- package/dist/cjs/management/api/resources/clients/client/Client.js +2 -2
- package/dist/cjs/management/api/resources/connections/client/Client.d.ts +3 -1
- package/dist/cjs/management/api/resources/connections/client/Client.js +7 -1
- package/dist/cjs/management/api/resources/connections/resources/scimConfiguration/client/Client.d.ts +1 -0
- package/dist/cjs/management/api/resources/connections/resources/scimConfiguration/client/Client.js +3 -0
- package/dist/cjs/management/api/resources/flows/client/Client.d.ts +2 -0
- package/dist/cjs/management/api/resources/flows/client/Client.js +6 -0
- package/dist/cjs/management/api/resources/flows/resources/executions/client/Client.d.ts +2 -0
- package/dist/cjs/management/api/resources/flows/resources/executions/client/Client.js +6 -0
- package/dist/cjs/management/api/resources/forms/client/Client.d.ts +2 -0
- package/dist/cjs/management/api/resources/forms/client/Client.js +6 -0
- package/dist/cjs/management/api/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/index.js +2 -1
- package/dist/cjs/management/api/resources/keys/client/Client.d.ts +3 -0
- package/dist/cjs/management/api/resources/keys/client/Client.js +7 -2
- package/dist/cjs/management/api/resources/keys/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/keys/resources/index.js +2 -1
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/client/Client.d.ts +84 -0
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/client/Client.js +311 -0
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/client/index.js +2 -0
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/exports.js +21 -0
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/keys/resources/networkAcls/index.js +17 -0
- package/dist/cjs/management/api/resources/organizationTemplates/client/Client.d.ts +106 -0
- package/dist/cjs/management/api/resources/organizationTemplates/client/Client.js +411 -0
- package/dist/cjs/management/api/resources/organizationTemplates/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/organizationTemplates/client/index.js +2 -0
- package/dist/cjs/management/api/resources/organizationTemplates/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/organizationTemplates/exports.js +21 -0
- package/dist/cjs/management/api/resources/organizationTemplates/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/organizationTemplates/index.js +17 -0
- package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +3 -0
- package/dist/cjs/management/api/resources/organizations/client/Client.js +7 -2
- package/dist/cjs/management/api/resources/organizations/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/organizations/resources/index.js +2 -1
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.ts +63 -0
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/Client.js +232 -0
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/client/index.js +2 -0
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/exports.js +21 -0
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/index.js +17 -0
- package/dist/cjs/management/api/resources/users/resources/organizations/client/Client.d.ts +17 -0
- package/dist/cjs/management/api/resources/users/resources/organizations/client/Client.js +19 -0
- package/dist/cjs/management/api/types/types.d.ts +9066 -2089
- package/dist/cjs/management/api/types/types.js +1478 -160
- package/dist/cjs/management/version.d.ts +1 -1
- package/dist/cjs/management/version.js +1 -1
- package/dist/cjs/management/wrapper/token-provider.js +1 -1
- package/dist/esm/management/Client.d.mts +3 -0
- package/dist/esm/management/Client.mjs +5 -0
- package/dist/esm/management/api/errors/UnprocessableEntityError.d.mts +5 -0
- package/dist/esm/management/api/errors/UnprocessableEntityError.mjs +17 -0
- package/dist/esm/management/api/errors/index.d.mts +1 -0
- package/dist/esm/management/api/errors/index.mjs +1 -0
- package/dist/esm/management/api/requests/requests.d.mts +119 -11
- package/dist/esm/management/api/resources/clients/client/Client.d.mts +2 -2
- package/dist/esm/management/api/resources/clients/client/Client.mjs +2 -2
- package/dist/esm/management/api/resources/connections/client/Client.d.mts +3 -1
- package/dist/esm/management/api/resources/connections/client/Client.mjs +7 -1
- package/dist/esm/management/api/resources/connections/resources/scimConfiguration/client/Client.d.mts +1 -0
- package/dist/esm/management/api/resources/connections/resources/scimConfiguration/client/Client.mjs +3 -0
- package/dist/esm/management/api/resources/flows/client/Client.d.mts +2 -0
- package/dist/esm/management/api/resources/flows/client/Client.mjs +6 -0
- package/dist/esm/management/api/resources/flows/resources/executions/client/Client.d.mts +2 -0
- package/dist/esm/management/api/resources/flows/resources/executions/client/Client.mjs +6 -0
- package/dist/esm/management/api/resources/forms/client/Client.d.mts +2 -0
- package/dist/esm/management/api/resources/forms/client/Client.mjs +6 -0
- package/dist/esm/management/api/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/keys/client/Client.d.mts +3 -0
- package/dist/esm/management/api/resources/keys/client/Client.mjs +5 -0
- package/dist/esm/management/api/resources/keys/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/keys/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/client/Client.d.mts +84 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/client/Client.mjs +274 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/exports.mjs +3 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/index.d.mts +1 -0
- package/dist/esm/management/api/resources/keys/resources/networkAcls/index.mjs +1 -0
- package/dist/esm/management/api/resources/organizationTemplates/client/Client.d.mts +106 -0
- package/dist/esm/management/api/resources/organizationTemplates/client/Client.mjs +374 -0
- package/dist/esm/management/api/resources/organizationTemplates/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/organizationTemplates/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/organizationTemplates/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/organizationTemplates/exports.mjs +3 -0
- package/dist/esm/management/api/resources/organizationTemplates/index.d.mts +1 -0
- package/dist/esm/management/api/resources/organizationTemplates/index.mjs +1 -0
- package/dist/esm/management/api/resources/organizations/client/Client.d.mts +3 -0
- package/dist/esm/management/api/resources/organizations/client/Client.mjs +5 -0
- package/dist/esm/management/api/resources/organizations/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/organizations/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.d.mts +63 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/Client.mjs +195 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/exports.mjs +3 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/index.d.mts +1 -0
- package/dist/esm/management/api/resources/organizations/resources/organizationTemplate/index.mjs +1 -0
- package/dist/esm/management/api/resources/users/resources/organizations/client/Client.d.mts +17 -0
- package/dist/esm/management/api/resources/users/resources/organizations/client/Client.mjs +19 -0
- package/dist/esm/management/api/types/types.d.mts +9066 -2089
- package/dist/esm/management/api/types/types.mjs +1457 -144
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/dist/esm/management/wrapper/token-provider.mjs +1 -1
- package/package.json +34 -1
- package/reference.md +886 -39
|
@@ -6,4 +6,5 @@ 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";
|
|
9
10
|
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.members = exports.invitations = exports.groups = exports.enabledConnections = exports.discoveryDomains = exports.connections = exports.clients = exports.clientGrants = void 0;
|
|
36
|
+
exports.roles = exports.organizationTemplate = 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,4 +42,5 @@ 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"));
|
|
45
46
|
exports.roles = __importStar(require("./roles/index.js"));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import * as Management from "../../../../../index.js";
|
|
5
|
+
export declare namespace OrganizationTemplateClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class OrganizationTemplateClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationTemplateClient.Options>;
|
|
12
|
+
constructor(options: OrganizationTemplateClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* 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.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} id - ID of the organization.
|
|
17
|
+
* @param {OrganizationTemplateClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Management.UnauthorizedError}
|
|
20
|
+
* @throws {@link Management.ForbiddenError}
|
|
21
|
+
* @throws {@link Management.NotFoundError}
|
|
22
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.organizations.organizationTemplate.get("id")
|
|
26
|
+
*/
|
|
27
|
+
get(id: string, requestOptions?: OrganizationTemplateClient.RequestOptions): core.HttpResponsePromise<Management.OrganizationTemplate>;
|
|
28
|
+
private __get;
|
|
29
|
+
/**
|
|
30
|
+
* Assign an Organization Template to an organization.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} id - The ID of the organization.
|
|
33
|
+
* @param {string} template_id - The ID of the organization template to assign.
|
|
34
|
+
* @param {OrganizationTemplateClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link Management.BadRequestError}
|
|
37
|
+
* @throws {@link Management.UnauthorizedError}
|
|
38
|
+
* @throws {@link Management.ForbiddenError}
|
|
39
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.organizations.organizationTemplate.assignOrganizationTemplate("id", "template_id")
|
|
43
|
+
*/
|
|
44
|
+
assignOrganizationTemplate(id: string, template_id: string, requestOptions?: OrganizationTemplateClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
45
|
+
private __assignOrganizationTemplate;
|
|
46
|
+
/**
|
|
47
|
+
* Remove an Organization Template assignment from an organization.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} id - The ID of the organization.
|
|
50
|
+
* @param {string} template_id - The ID of the organization template to unassign.
|
|
51
|
+
* @param {OrganizationTemplateClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link Management.BadRequestError}
|
|
54
|
+
* @throws {@link Management.UnauthorizedError}
|
|
55
|
+
* @throws {@link Management.ForbiddenError}
|
|
56
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* await client.organizations.organizationTemplate.unassignOrganizationTemplate("id", "template_id")
|
|
60
|
+
*/
|
|
61
|
+
unassignOrganizationTemplate(id: string, template_id: string, requestOptions?: OrganizationTemplateClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
62
|
+
private __unassignOrganizationTemplate;
|
|
63
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
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.OrganizationTemplateClient = 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 OrganizationTemplateClient {
|
|
55
|
+
constructor(options) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
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.
|
|
60
|
+
*
|
|
61
|
+
* @param {string} id - ID of the organization.
|
|
62
|
+
* @param {OrganizationTemplateClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Management.UnauthorizedError}
|
|
65
|
+
* @throws {@link Management.ForbiddenError}
|
|
66
|
+
* @throws {@link Management.NotFoundError}
|
|
67
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await client.organizations.organizationTemplate.get("id")
|
|
71
|
+
*/
|
|
72
|
+
get(id, requestOptions) {
|
|
73
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
74
|
+
}
|
|
75
|
+
__get(id, requestOptions) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
78
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
79
|
+
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
|
+
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`),
|
|
82
|
+
method: "GET",
|
|
83
|
+
headers: _headers,
|
|
84
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
85
|
+
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,
|
|
86
|
+
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,
|
|
87
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
89
|
+
logging: this._options.logging,
|
|
90
|
+
});
|
|
91
|
+
if (_response.ok) {
|
|
92
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
93
|
+
}
|
|
94
|
+
if (_response.error.reason === "status-code") {
|
|
95
|
+
switch (_response.error.statusCode) {
|
|
96
|
+
case 401:
|
|
97
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
98
|
+
case 403:
|
|
99
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
100
|
+
case 404:
|
|
101
|
+
throw new Management.NotFoundError(_response.error.body, _response.rawResponse);
|
|
102
|
+
case 429:
|
|
103
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.ManagementError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/organizations/{id}/organization-templates");
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Assign an Organization Template to an organization.
|
|
117
|
+
*
|
|
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.
|
|
121
|
+
*
|
|
122
|
+
* @throws {@link Management.BadRequestError}
|
|
123
|
+
* @throws {@link Management.UnauthorizedError}
|
|
124
|
+
* @throws {@link Management.ForbiddenError}
|
|
125
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* await client.organizations.organizationTemplate.assignOrganizationTemplate("id", "template_id")
|
|
129
|
+
*/
|
|
130
|
+
assignOrganizationTemplate(id, template_id, requestOptions) {
|
|
131
|
+
return core.HttpResponsePromise.fromPromise(this.__assignOrganizationTemplate(id, template_id, requestOptions));
|
|
132
|
+
}
|
|
133
|
+
__assignOrganizationTemplate(id, template_id, requestOptions) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
136
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
137
|
+
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
|
+
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",
|
|
141
|
+
headers: _headers,
|
|
142
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
143
|
+
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,
|
|
144
|
+
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,
|
|
145
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
146
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
147
|
+
logging: this._options.logging,
|
|
148
|
+
});
|
|
149
|
+
if (_response.ok) {
|
|
150
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
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 429:
|
|
161
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
162
|
+
default:
|
|
163
|
+
throw new errors.ManagementError({
|
|
164
|
+
statusCode: _response.error.statusCode,
|
|
165
|
+
body: _response.error.body,
|
|
166
|
+
rawResponse: _response.rawResponse,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/organizations/{id}/organization-templates/{template_id}");
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Remove an Organization Template assignment from an organization.
|
|
175
|
+
*
|
|
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.
|
|
179
|
+
*
|
|
180
|
+
* @throws {@link Management.BadRequestError}
|
|
181
|
+
* @throws {@link Management.UnauthorizedError}
|
|
182
|
+
* @throws {@link Management.ForbiddenError}
|
|
183
|
+
* @throws {@link Management.TooManyRequestsError}
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* await client.organizations.organizationTemplate.unassignOrganizationTemplate("id", "template_id")
|
|
187
|
+
*/
|
|
188
|
+
unassignOrganizationTemplate(id, template_id, requestOptions) {
|
|
189
|
+
return core.HttpResponsePromise.fromPromise(this.__unassignOrganizationTemplate(id, template_id, requestOptions));
|
|
190
|
+
}
|
|
191
|
+
__unassignOrganizationTemplate(id, template_id, requestOptions) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
194
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
195
|
+
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
|
+
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",
|
|
199
|
+
headers: _headers,
|
|
200
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
201
|
+
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
|
+
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
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
204
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
205
|
+
logging: this._options.logging,
|
|
206
|
+
});
|
|
207
|
+
if (_response.ok) {
|
|
208
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
209
|
+
}
|
|
210
|
+
if (_response.error.reason === "status-code") {
|
|
211
|
+
switch (_response.error.statusCode) {
|
|
212
|
+
case 400:
|
|
213
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
214
|
+
case 401:
|
|
215
|
+
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
216
|
+
case 403:
|
|
217
|
+
throw new Management.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
218
|
+
case 429:
|
|
219
|
+
throw new Management.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
220
|
+
default:
|
|
221
|
+
throw new errors.ManagementError({
|
|
222
|
+
statusCode: _response.error.statusCode,
|
|
223
|
+
body: _response.error.body,
|
|
224
|
+
rawResponse: _response.rawResponse,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/organizations/{id}/organization-templates/{template_id}");
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.OrganizationTemplateClient = OrganizationTemplateClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/exports.js
ADDED
|
@@ -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.OrganizationTemplateClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "OrganizationTemplateClient", { enumerable: true, get: function () { return Client_js_1.OrganizationTemplateClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
package/dist/cjs/management/api/resources/organizations/resources/organizationTemplate/index.js
ADDED
|
@@ -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);
|
|
@@ -13,10 +13,27 @@ export declare class OrganizationsClient {
|
|
|
13
13
|
/**
|
|
14
14
|
* Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations).
|
|
15
15
|
*
|
|
16
|
+
* This endpoint supports two types of pagination:
|
|
17
|
+
*
|
|
18
|
+
* - Offset pagination
|
|
19
|
+
* - Checkpoint pagination
|
|
20
|
+
*
|
|
21
|
+
* Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.
|
|
22
|
+
*
|
|
23
|
+
* **Checkpoint Pagination**
|
|
24
|
+
*
|
|
25
|
+
* To search by checkpoint, use the following parameters:
|
|
26
|
+
*
|
|
27
|
+
* - `from`: Optional id from which to start selection.
|
|
28
|
+
* - `take`: The total number of entries to retrieve when using the `from` parameter. Defaults to 50.
|
|
29
|
+
*
|
|
30
|
+
* **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining.
|
|
31
|
+
*
|
|
16
32
|
* @param {string} id - ID of the user to retrieve the organizations for.
|
|
17
33
|
* @param {Management.ListUserOrganizationsRequestParameters} request
|
|
18
34
|
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
35
|
*
|
|
36
|
+
* @throws {@link Management.BadRequestError}
|
|
20
37
|
* @throws {@link Management.UnauthorizedError}
|
|
21
38
|
* @throws {@link Management.ForbiddenError}
|
|
22
39
|
* @throws {@link Management.NotFoundError}
|
|
@@ -58,10 +58,27 @@ class OrganizationsClient {
|
|
|
58
58
|
/**
|
|
59
59
|
* Retrieve list of the specified user's current Organization memberships. User must be specified by user ID. For more information, review [Auth0 Organizations](https://auth0.com/docs/manage-users/organizations).
|
|
60
60
|
*
|
|
61
|
+
* This endpoint supports two types of pagination:
|
|
62
|
+
*
|
|
63
|
+
* - Offset pagination
|
|
64
|
+
* - Checkpoint pagination
|
|
65
|
+
*
|
|
66
|
+
* Checkpoint pagination must be used if you need to retrieve more than 1000 organizations.
|
|
67
|
+
*
|
|
68
|
+
* **Checkpoint Pagination**
|
|
69
|
+
*
|
|
70
|
+
* To search by checkpoint, use the following parameters:
|
|
71
|
+
*
|
|
72
|
+
* - `from`: Optional id from which to start selection.
|
|
73
|
+
* - `take`: The total number of entries to retrieve when using the `from` parameter. Defaults to 50.
|
|
74
|
+
*
|
|
75
|
+
* **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining.
|
|
76
|
+
*
|
|
61
77
|
* @param {string} id - ID of the user to retrieve the organizations for.
|
|
62
78
|
* @param {Management.ListUserOrganizationsRequestParameters} request
|
|
63
79
|
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
80
|
*
|
|
81
|
+
* @throws {@link Management.BadRequestError}
|
|
65
82
|
* @throws {@link Management.UnauthorizedError}
|
|
66
83
|
* @throws {@link Management.ForbiddenError}
|
|
67
84
|
* @throws {@link Management.NotFoundError}
|
|
@@ -109,6 +126,8 @@ class OrganizationsClient {
|
|
|
109
126
|
}
|
|
110
127
|
if (_response.error.reason === "status-code") {
|
|
111
128
|
switch (_response.error.statusCode) {
|
|
129
|
+
case 400:
|
|
130
|
+
throw new Management.BadRequestError(_response.error.body, _response.rawResponse);
|
|
112
131
|
case 401:
|
|
113
132
|
throw new Management.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
114
133
|
case 403:
|