auth0
Version:
Auth0 Node.js SDK for the Management API v2.
294 lines (293 loc) • 15.5 kB
JavaScript
"use strict";
// This file was auto-generated by Fern from our API Definition.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagementClient = void 0;
const Client_js_1 = require("./api/resources/actions/client/Client.js");
const Client_js_2 = require("./api/resources/anomaly/client/Client.js");
const Client_js_3 = require("./api/resources/attackProtection/client/Client.js");
const Client_js_4 = require("./api/resources/branding/client/Client.js");
const Client_js_5 = require("./api/resources/clientGrants/client/Client.js");
const Client_js_6 = require("./api/resources/clients/client/Client.js");
const Client_js_7 = require("./api/resources/connectionProfiles/client/Client.js");
const Client_js_8 = require("./api/resources/connections/client/Client.js");
const Client_js_9 = require("./api/resources/customDomains/client/Client.js");
const Client_js_10 = require("./api/resources/deviceCredentials/client/Client.js");
const Client_js_11 = require("./api/resources/emails/client/Client.js");
const Client_js_12 = require("./api/resources/emailTemplates/client/Client.js");
const Client_js_13 = require("./api/resources/eventStreams/client/Client.js");
const Client_js_14 = require("./api/resources/flows/client/Client.js");
const Client_js_15 = require("./api/resources/forms/client/Client.js");
const Client_js_16 = require("./api/resources/groups/client/Client.js");
const Client_js_17 = require("./api/resources/guardian/client/Client.js");
const Client_js_18 = require("./api/resources/hooks/client/Client.js");
const Client_js_19 = require("./api/resources/jobs/client/Client.js");
const Client_js_20 = require("./api/resources/keys/client/Client.js");
const Client_js_21 = require("./api/resources/logs/client/Client.js");
const Client_js_22 = require("./api/resources/logStreams/client/Client.js");
const Client_js_23 = require("./api/resources/networkAcls/client/Client.js");
const Client_js_24 = require("./api/resources/organizations/client/Client.js");
const Client_js_25 = require("./api/resources/prompts/client/Client.js");
const Client_js_26 = require("./api/resources/refreshTokens/client/Client.js");
const Client_js_27 = require("./api/resources/resourceServers/client/Client.js");
const Client_js_28 = require("./api/resources/riskAssessments/client/Client.js");
const Client_js_29 = require("./api/resources/roles/client/Client.js");
const Client_js_30 = require("./api/resources/rules/client/Client.js");
const Client_js_31 = require("./api/resources/rulesConfigs/client/Client.js");
const Client_js_32 = require("./api/resources/selfServiceProfiles/client/Client.js");
const Client_js_33 = require("./api/resources/sessions/client/Client.js");
const Client_js_34 = require("./api/resources/stats/client/Client.js");
const Client_js_35 = require("./api/resources/supplementalSignals/client/Client.js");
const Client_js_36 = require("./api/resources/tenants/client/Client.js");
const Client_js_37 = require("./api/resources/tickets/client/Client.js");
const Client_js_38 = require("./api/resources/tokenExchangeProfiles/client/Client.js");
const Client_js_39 = require("./api/resources/userAttributeProfiles/client/Client.js");
const Client_js_40 = require("./api/resources/userBlocks/client/Client.js");
const Client_js_41 = require("./api/resources/userGrants/client/Client.js");
const Client_js_42 = require("./api/resources/users/client/Client.js");
const Client_js_43 = require("./api/resources/verifiableCredentials/client/Client.js");
const BaseClient_js_1 = require("./BaseClient.js");
const core = __importStar(require("./core/index.js"));
class ManagementClient {
constructor(options) {
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
}
get actions() {
var _a;
return ((_a = this._actions) !== null && _a !== void 0 ? _a : (this._actions = new Client_js_1.ActionsClient(this._options)));
}
get branding() {
var _a;
return ((_a = this._branding) !== null && _a !== void 0 ? _a : (this._branding = new Client_js_4.BrandingClient(this._options)));
}
get clientGrants() {
var _a;
return ((_a = this._clientGrants) !== null && _a !== void 0 ? _a : (this._clientGrants = new Client_js_5.ClientGrantsClient(this._options)));
}
get clients() {
var _a;
return ((_a = this._clients) !== null && _a !== void 0 ? _a : (this._clients = new Client_js_6.ClientsClient(this._options)));
}
get connectionProfiles() {
var _a;
return ((_a = this._connectionProfiles) !== null && _a !== void 0 ? _a : (this._connectionProfiles = new Client_js_7.ConnectionProfilesClient(this._options)));
}
get connections() {
var _a;
return ((_a = this._connections) !== null && _a !== void 0 ? _a : (this._connections = new Client_js_8.ConnectionsClient(this._options)));
}
get customDomains() {
var _a;
return ((_a = this._customDomains) !== null && _a !== void 0 ? _a : (this._customDomains = new Client_js_9.CustomDomainsClient(this._options)));
}
get deviceCredentials() {
var _a;
return ((_a = this._deviceCredentials) !== null && _a !== void 0 ? _a : (this._deviceCredentials = new Client_js_10.DeviceCredentialsClient(this._options)));
}
get emailTemplates() {
var _a;
return ((_a = this._emailTemplates) !== null && _a !== void 0 ? _a : (this._emailTemplates = new Client_js_12.EmailTemplatesClient(this._options)));
}
get eventStreams() {
var _a;
return ((_a = this._eventStreams) !== null && _a !== void 0 ? _a : (this._eventStreams = new Client_js_13.EventStreamsClient(this._options)));
}
get flows() {
var _a;
return ((_a = this._flows) !== null && _a !== void 0 ? _a : (this._flows = new Client_js_14.FlowsClient(this._options)));
}
get forms() {
var _a;
return ((_a = this._forms) !== null && _a !== void 0 ? _a : (this._forms = new Client_js_15.FormsClient(this._options)));
}
get userGrants() {
var _a;
return ((_a = this._userGrants) !== null && _a !== void 0 ? _a : (this._userGrants = new Client_js_41.UserGrantsClient(this._options)));
}
get groups() {
var _a;
return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new Client_js_16.GroupsClient(this._options)));
}
get hooks() {
var _a;
return ((_a = this._hooks) !== null && _a !== void 0 ? _a : (this._hooks = new Client_js_18.HooksClient(this._options)));
}
get jobs() {
var _a;
return ((_a = this._jobs) !== null && _a !== void 0 ? _a : (this._jobs = new Client_js_19.JobsClient(this._options)));
}
get logStreams() {
var _a;
return ((_a = this._logStreams) !== null && _a !== void 0 ? _a : (this._logStreams = new Client_js_22.LogStreamsClient(this._options)));
}
get logs() {
var _a;
return ((_a = this._logs) !== null && _a !== void 0 ? _a : (this._logs = new Client_js_21.LogsClient(this._options)));
}
get networkAcls() {
var _a;
return ((_a = this._networkAcls) !== null && _a !== void 0 ? _a : (this._networkAcls = new Client_js_23.NetworkAclsClient(this._options)));
}
get organizations() {
var _a;
return ((_a = this._organizations) !== null && _a !== void 0 ? _a : (this._organizations = new Client_js_24.OrganizationsClient(this._options)));
}
get prompts() {
var _a;
return ((_a = this._prompts) !== null && _a !== void 0 ? _a : (this._prompts = new Client_js_25.PromptsClient(this._options)));
}
get refreshTokens() {
var _a;
return ((_a = this._refreshTokens) !== null && _a !== void 0 ? _a : (this._refreshTokens = new Client_js_26.RefreshTokensClient(this._options)));
}
get resourceServers() {
var _a;
return ((_a = this._resourceServers) !== null && _a !== void 0 ? _a : (this._resourceServers = new Client_js_27.ResourceServersClient(this._options)));
}
get roles() {
var _a;
return ((_a = this._roles) !== null && _a !== void 0 ? _a : (this._roles = new Client_js_29.RolesClient(this._options)));
}
get rules() {
var _a;
return ((_a = this._rules) !== null && _a !== void 0 ? _a : (this._rules = new Client_js_30.RulesClient(this._options)));
}
get rulesConfigs() {
var _a;
return ((_a = this._rulesConfigs) !== null && _a !== void 0 ? _a : (this._rulesConfigs = new Client_js_31.RulesConfigsClient(this._options)));
}
get selfServiceProfiles() {
var _a;
return ((_a = this._selfServiceProfiles) !== null && _a !== void 0 ? _a : (this._selfServiceProfiles = new Client_js_32.SelfServiceProfilesClient(this._options)));
}
get sessions() {
var _a;
return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new Client_js_33.SessionsClient(this._options)));
}
get stats() {
var _a;
return ((_a = this._stats) !== null && _a !== void 0 ? _a : (this._stats = new Client_js_34.StatsClient(this._options)));
}
get supplementalSignals() {
var _a;
return ((_a = this._supplementalSignals) !== null && _a !== void 0 ? _a : (this._supplementalSignals = new Client_js_35.SupplementalSignalsClient(this._options)));
}
get tickets() {
var _a;
return ((_a = this._tickets) !== null && _a !== void 0 ? _a : (this._tickets = new Client_js_37.TicketsClient(this._options)));
}
get tokenExchangeProfiles() {
var _a;
return ((_a = this._tokenExchangeProfiles) !== null && _a !== void 0 ? _a : (this._tokenExchangeProfiles = new Client_js_38.TokenExchangeProfilesClient(this._options)));
}
get userAttributeProfiles() {
var _a;
return ((_a = this._userAttributeProfiles) !== null && _a !== void 0 ? _a : (this._userAttributeProfiles = new Client_js_39.UserAttributeProfilesClient(this._options)));
}
get userBlocks() {
var _a;
return ((_a = this._userBlocks) !== null && _a !== void 0 ? _a : (this._userBlocks = new Client_js_40.UserBlocksClient(this._options)));
}
get users() {
var _a;
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_42.UsersClient(this._options)));
}
get anomaly() {
var _a;
return ((_a = this._anomaly) !== null && _a !== void 0 ? _a : (this._anomaly = new Client_js_2.AnomalyClient(this._options)));
}
get attackProtection() {
var _a;
return ((_a = this._attackProtection) !== null && _a !== void 0 ? _a : (this._attackProtection = new Client_js_3.AttackProtectionClient(this._options)));
}
get emails() {
var _a;
return ((_a = this._emails) !== null && _a !== void 0 ? _a : (this._emails = new Client_js_11.EmailsClient(this._options)));
}
get guardian() {
var _a;
return ((_a = this._guardian) !== null && _a !== void 0 ? _a : (this._guardian = new Client_js_17.GuardianClient(this._options)));
}
get keys() {
var _a;
return ((_a = this._keys) !== null && _a !== void 0 ? _a : (this._keys = new Client_js_20.KeysClient(this._options)));
}
get riskAssessments() {
var _a;
return ((_a = this._riskAssessments) !== null && _a !== void 0 ? _a : (this._riskAssessments = new Client_js_28.RiskAssessmentsClient(this._options)));
}
get tenants() {
var _a;
return ((_a = this._tenants) !== null && _a !== void 0 ? _a : (this._tenants = new Client_js_36.TenantsClient(this._options)));
}
get verifiableCredentials() {
var _a;
return ((_a = this._verifiableCredentials) !== null && _a !== void 0 ? _a : (this._verifiableCredentials = new Client_js_43.VerifiableCredentialsClient(this._options)));
}
/**
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
* This is useful for making requests to endpoints not yet supported in the SDK.
* The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
*
* @param {Request | string | URL} input - The URL, path, or Request object.
* @param {RequestInit} init - Standard fetch RequestInit options.
* @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
* @returns {Promise<Response>} A standard Response object.
*/
fetch(input, init, requestOptions) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
return core.makePassthroughRequest(input, init, {
baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : this._options.environment,
headers: this._options.headers,
timeoutInSeconds: this._options.timeoutInSeconds,
maxRetries: this._options.maxRetries,
fetch: this._options.fetch,
logging: this._options.logging,
getAuthHeaders: () => __awaiter(this, void 0, void 0, function* () { return (yield this._options.authProvider.getAuthRequest()).headers; }),
}, requestOptions);
});
}
}
exports.ManagementClient = ManagementClient;