@atlasauth/backend 0.5.0 → 0.6.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/README.md +187 -0
- package/dist/client/activity.d.ts +104 -0
- package/dist/client/activity.js +29 -0
- package/dist/client/activity.js.map +1 -0
- package/dist/client/audit-events.d.ts +103 -0
- package/dist/client/audit-events.js +43 -0
- package/dist/client/audit-events.js.map +1 -0
- package/dist/client/billing-plans.d.ts +43 -0
- package/dist/client/billing-plans.js +26 -0
- package/dist/client/billing-plans.js.map +1 -1
- package/dist/client/connectors.d.ts +174 -0
- package/dist/client/connectors.js +54 -0
- package/dist/client/connectors.js.map +1 -0
- package/dist/client/data-subject-requests.d.ts +21 -0
- package/dist/client/data-subject-requests.js +15 -0
- package/dist/client/data-subject-requests.js.map +1 -1
- package/dist/client/design.d.ts +295 -0
- package/dist/client/design.js +76 -0
- package/dist/client/design.js.map +1 -0
- package/dist/client/diagnostics.d.ts +53 -0
- package/dist/client/diagnostics.js +24 -0
- package/dist/client/diagnostics.js.map +1 -0
- package/dist/client/email-addresses.d.ts +22 -0
- package/dist/client/email-addresses.js +17 -0
- package/dist/client/email-addresses.js.map +1 -0
- package/dist/client/entitlement-overrides.d.ts +50 -0
- package/dist/client/entitlement-overrides.js +20 -0
- package/dist/client/entitlement-overrides.js.map +1 -0
- package/dist/client/error.d.ts +28 -0
- package/dist/client/error.js +27 -1
- package/dist/client/error.js.map +1 -1
- package/dist/client/index.d.ts +458 -16
- package/dist/client/index.js +76 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/instance.d.ts +54 -0
- package/dist/client/instance.js +18 -0
- package/dist/client/instance.js.map +1 -1
- package/dist/client/invitations.d.ts +14 -0
- package/dist/client/invitations.js +9 -0
- package/dist/client/invitations.js.map +1 -1
- package/dist/client/legacy-auth.d.ts +45 -0
- package/dist/client/legacy-auth.js +18 -0
- package/dist/client/legacy-auth.js.map +1 -0
- package/dist/client/mcp.d.ts +86 -0
- package/dist/client/mcp.js +47 -0
- package/dist/client/mcp.js.map +1 -0
- package/dist/client/notifications.d.ts +92 -0
- package/dist/client/notifications.js +55 -0
- package/dist/client/notifications.js.map +1 -0
- package/dist/client/oauth-clients.d.ts +46 -2
- package/dist/client/oauth-clients.js +4 -0
- package/dist/client/oauth-clients.js.map +1 -1
- package/dist/client/oauth-providers.d.ts +67 -7
- package/dist/client/oauth-providers.js +7 -2
- package/dist/client/oauth-providers.js.map +1 -1
- package/dist/client/openfga.d.ts +137 -0
- package/dist/client/openfga.js +72 -0
- package/dist/client/openfga.js.map +1 -0
- package/dist/client/org-ldap-connections.d.ts +75 -0
- package/dist/client/org-ldap-connections.js +36 -0
- package/dist/client/org-ldap-connections.js.map +1 -0
- package/dist/client/organization-settings-schema.d.ts +24 -0
- package/dist/client/organization-settings-schema.js +30 -0
- package/dist/client/organization-settings-schema.js.map +1 -0
- package/dist/client/organizations.d.ts +205 -4
- package/dist/client/organizations.js +109 -0
- package/dist/client/organizations.js.map +1 -1
- package/dist/client/pca.d.ts +59 -0
- package/dist/client/pca.js +40 -0
- package/dist/client/pca.js.map +1 -0
- package/dist/client/platform.d.ts +328 -0
- package/dist/client/platform.js +187 -0
- package/dist/client/platform.js.map +1 -0
- package/dist/client/redirect-urls.d.ts +23 -0
- package/dist/client/redirect-urls.js +22 -0
- package/dist/client/redirect-urls.js.map +1 -0
- package/dist/client/request.d.ts +45 -0
- package/dist/client/request.js +35 -2
- package/dist/client/request.js.map +1 -1
- package/dist/client/session-exchange-apps.d.ts +43 -0
- package/dist/client/session-exchange-apps.js +25 -0
- package/dist/client/session-exchange-apps.js.map +1 -0
- package/dist/client/sessions.d.ts +12 -0
- package/dist/client/sessions.js +10 -0
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/sign-in-tokens.d.ts +13 -1
- package/dist/client/sign-in-tokens.js +11 -0
- package/dist/client/sign-in-tokens.js.map +1 -1
- package/dist/client/test-mode.d.ts +44 -0
- package/dist/client/test-mode.js +26 -0
- package/dist/client/test-mode.js.map +1 -0
- package/dist/client/tickets.d.ts +49 -0
- package/dist/client/tickets.js +19 -0
- package/dist/client/tickets.js.map +1 -0
- package/dist/client/users.d.ts +346 -0
- package/dist/client/users.js +228 -0
- package/dist/client/users.js.map +1 -1
- package/dist/client/waitlist.d.ts +21 -0
- package/dist/client/waitlist.js +16 -0
- package/dist/client/waitlist.js.map +1 -1
- package/dist/client/webhooks.d.ts +60 -6
- package/dist/client/webhooks.js +36 -2
- package/dist/client/webhooks.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/logout-token.d.ts +97 -0
- package/dist/logout-token.js +182 -0
- package/dist/logout-token.js.map +1 -0
- package/dist/verify.d.ts +7 -0
- package/dist/verify.js +13 -0
- package/dist/verify.js.map +1 -1
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.collect = exports.paginate = exports.AtlasApiError = exports.DEFAULT_API_URL = void 0;
|
|
17
|
+
exports.collect = exports.paginate = exports.AtlasApiError = exports.createAtlasPlatformClient = exports.AtlasErrorCodes = exports.DEFAULT_API_URL = void 0;
|
|
18
18
|
exports.createAtlasClient = createAtlasClient;
|
|
19
19
|
const request_1 = require("./request");
|
|
20
20
|
const users_1 = require("./users");
|
|
@@ -62,6 +62,24 @@ const instance_1 = require("./instance");
|
|
|
62
62
|
const instance_security_1 = require("./instance-security");
|
|
63
63
|
const tokens_1 = require("./tokens");
|
|
64
64
|
const captcha_1 = require("./captcha");
|
|
65
|
+
const design_1 = require("./design");
|
|
66
|
+
const entitlement_overrides_1 = require("./entitlement-overrides");
|
|
67
|
+
const org_ldap_connections_1 = require("./org-ldap-connections");
|
|
68
|
+
const organization_settings_schema_1 = require("./organization-settings-schema");
|
|
69
|
+
const email_addresses_1 = require("./email-addresses");
|
|
70
|
+
const openfga_1 = require("./openfga");
|
|
71
|
+
const connectors_1 = require("./connectors");
|
|
72
|
+
const notifications_1 = require("./notifications");
|
|
73
|
+
const audit_events_1 = require("./audit-events");
|
|
74
|
+
const activity_1 = require("./activity");
|
|
75
|
+
const pca_1 = require("./pca");
|
|
76
|
+
const mcp_1 = require("./mcp");
|
|
77
|
+
const legacy_auth_1 = require("./legacy-auth");
|
|
78
|
+
const redirect_urls_1 = require("./redirect-urls");
|
|
79
|
+
const session_exchange_apps_1 = require("./session-exchange-apps");
|
|
80
|
+
const tickets_1 = require("./tickets");
|
|
81
|
+
const test_mode_1 = require("./test-mode");
|
|
82
|
+
const diagnostics_1 = require("./diagnostics");
|
|
65
83
|
/**
|
|
66
84
|
* The typed management client for the Atlas Backend API — the secret-key
|
|
67
85
|
* surface, the peer of `@clerk/backend`'s `createClerkClient`.
|
|
@@ -73,6 +91,14 @@ const captcha_1 = require("./captcha");
|
|
|
73
91
|
*/
|
|
74
92
|
function createAtlasClient(config) {
|
|
75
93
|
const request = (0, request_1.createRequest)(config);
|
|
94
|
+
return {
|
|
95
|
+
...buildNamespaces(request),
|
|
96
|
+
withOptions(overrides) {
|
|
97
|
+
return createAtlasClient({ ...config, ...overrides });
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function buildNamespaces(request) {
|
|
76
102
|
return {
|
|
77
103
|
users: (0, users_1.usersResource)(request),
|
|
78
104
|
sessions: (0, sessions_1.sessionsResource)(request),
|
|
@@ -124,12 +150,41 @@ function createAtlasClient(config) {
|
|
|
124
150
|
// §5 "captcha anywhere" — verify any CAPTCHA token against the instance's
|
|
125
151
|
// centrally-configured provider, server-side, with the secret held by Atlas.
|
|
126
152
|
captcha: (0, captcha_1.captchaResource)(request),
|
|
153
|
+
// Sign-in page design: instance + per-organization overrides, images, catalog.
|
|
154
|
+
design: (0, design_1.designResource)(request),
|
|
155
|
+
entitlementOverrides: (0, entitlement_overrides_1.entitlementOverridesResource)(request),
|
|
156
|
+
orgLdapConnections: (0, org_ldap_connections_1.orgLdapConnectionsResource)(request),
|
|
157
|
+
organizationSettingsSchema: (0, organization_settings_schema_1.organizationSettingsSchemaResource)(request),
|
|
158
|
+
emailAddresses: (0, email_addresses_1.emailAddressesResource)(request),
|
|
159
|
+
// OpenFGA-wire ReBAC stores, models and tuples.
|
|
160
|
+
openfga: (0, openfga_1.openfgaResource)(request),
|
|
161
|
+
connectors: (0, connectors_1.connectorsResource)(request),
|
|
162
|
+
notifications: (0, notifications_1.notificationsResource)(request),
|
|
163
|
+
// The tenant's own custom audit events (distinct from Atlas's auditLogs).
|
|
164
|
+
auditEvents: (0, audit_events_1.auditEventsResource)(request),
|
|
165
|
+
events: (0, activity_1.eventsResource)(request),
|
|
166
|
+
usage: (0, activity_1.usageResource)(request),
|
|
167
|
+
configChangelog: (0, activity_1.configChangelogResource)(request),
|
|
168
|
+
pca: (0, pca_1.pcaResource)(request),
|
|
169
|
+
mcp: (0, mcp_1.mcpResource)(request),
|
|
170
|
+
mcpConnector: (0, mcp_1.mcpConnectorResource)(request),
|
|
171
|
+
legacyAuthConnection: (0, legacy_auth_1.legacyAuthConnectionResource)(request),
|
|
172
|
+
redirectUrls: (0, redirect_urls_1.redirectUrlsResource)(request),
|
|
173
|
+
sessionExchangeApps: (0, session_exchange_apps_1.sessionExchangeAppsResource)(request),
|
|
174
|
+
tickets: (0, tickets_1.ticketsResource)(request),
|
|
175
|
+
// Development-instance helpers: the paired test instance, test users, testing tokens.
|
|
176
|
+
testMode: (0, test_mode_1.testModeResource)(request),
|
|
177
|
+
diagnostics: (0, diagnostics_1.diagnosticsResource)(request),
|
|
127
178
|
};
|
|
128
179
|
}
|
|
129
180
|
var request_2 = require("./request");
|
|
130
181
|
Object.defineProperty(exports, "DEFAULT_API_URL", { enumerable: true, get: function () { return request_2.DEFAULT_API_URL; } });
|
|
131
182
|
var error_1 = require("./error");
|
|
132
|
-
Object.defineProperty(exports, "
|
|
183
|
+
Object.defineProperty(exports, "AtlasErrorCodes", { enumerable: true, get: function () { return error_1.AtlasErrorCodes; } });
|
|
184
|
+
var platform_1 = require("./platform");
|
|
185
|
+
Object.defineProperty(exports, "createAtlasPlatformClient", { enumerable: true, get: function () { return platform_1.createAtlasPlatformClient; } });
|
|
186
|
+
var error_2 = require("./error");
|
|
187
|
+
Object.defineProperty(exports, "AtlasApiError", { enumerable: true, get: function () { return error_2.AtlasApiError; } });
|
|
133
188
|
var paginate_1 = require("./paginate");
|
|
134
189
|
Object.defineProperty(exports, "paginate", { enumerable: true, get: function () { return paginate_1.paginate; } });
|
|
135
190
|
Object.defineProperty(exports, "collect", { enumerable: true, get: function () { return paginate_1.collect; } });
|
|
@@ -180,4 +235,23 @@ __exportStar(require("./instance"), exports);
|
|
|
180
235
|
__exportStar(require("./instance-security"), exports);
|
|
181
236
|
__exportStar(require("./tokens"), exports);
|
|
182
237
|
__exportStar(require("./captcha"), exports);
|
|
238
|
+
__exportStar(require("./design"), exports);
|
|
239
|
+
__exportStar(require("./entitlement-overrides"), exports);
|
|
240
|
+
__exportStar(require("./org-ldap-connections"), exports);
|
|
241
|
+
__exportStar(require("./organization-settings-schema"), exports);
|
|
242
|
+
__exportStar(require("./email-addresses"), exports);
|
|
243
|
+
__exportStar(require("./openfga"), exports);
|
|
244
|
+
__exportStar(require("./connectors"), exports);
|
|
245
|
+
__exportStar(require("./notifications"), exports);
|
|
246
|
+
__exportStar(require("./audit-events"), exports);
|
|
247
|
+
__exportStar(require("./activity"), exports);
|
|
248
|
+
__exportStar(require("./pca"), exports);
|
|
249
|
+
__exportStar(require("./mcp"), exports);
|
|
250
|
+
__exportStar(require("./legacy-auth"), exports);
|
|
251
|
+
__exportStar(require("./redirect-urls"), exports);
|
|
252
|
+
__exportStar(require("./session-exchange-apps"), exports);
|
|
253
|
+
__exportStar(require("./tickets"), exports);
|
|
254
|
+
__exportStar(require("./test-mode"), exports);
|
|
255
|
+
__exportStar(require("./diagnostics"), exports);
|
|
256
|
+
__exportStar(require("./platform"), exports);
|
|
183
257
|
//# sourceMappingURL=index.js.map
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA2EA,8CAQC;AAnFD,uCAA6F;AAC7F,mCAAwC;AACxC,yCAA8C;AAC9C,mDAAwD;AACxD,mCAA6D;AAC7D,mDAAuD;AACvD,yDAA6D;AAC7D,uDAA2D;AAC3D,+CAAmD;AACnD,uCAA4C;AAC5C,yCAA8C;AAC9C,iDAAsE;AACtE,2DAA+D;AAC/D,iDAAqD;AACrD,+CAAoD;AACpD,yCAA8C;AAC9C,qDAAwD;AACxD,6CAAiD;AACjD,mDAAuD;AACvD,yCAA6C;AAC7C,yCAA8C;AAC9C,uDAA2D;AAC3D,qDAAyD;AACzD,2DAA+D;AAC/D,+BAAoC;AACpC,6CAAuD;AACvD,qDAAwD;AACxD,+CAAmD;AACnD,iDAAqD;AACrD,+CAAmD;AACnD,+CAAmD;AACnD,yCAA8C;AAC9C,uDAA2D;AAC3D,mDAAuD;AACvD,mDAAwD;AACxD,uCAA4C;AAC5C,mDAAkD;AAClD,2CAAgD;AAChD,mDAAuD;AACvD,mEAAsE;AACtE,qDAAyD;AACzD,mDAAuD;AACvD,yCAA8C;AAC9C,2DAA+D;AAC/D,qCAA0C;AAC1C,uCAA4C;AAC5C,qCAA0C;AAC1C,mEAAuE;AACvE,iEAAoE;AACpE,iFAAoF;AACpF,uDAA2D;AAC3D,uCAA4C;AAC5C,6CAAkD;AAClD,mDAAwD;AACxD,iDAAqD;AAC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C,0DAAwC;AACxC,mDAAiC;AACjC,kDAAgC;AAChC,6CAA2B;AAC3B,sDAAoC;AACpC,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,0DAAwC;AACxC,yDAAuC;AACvC,iEAA+C;AAC/C,oDAAkC;AAClC,4CAA0B;AAC1B,+CAA6B;AAC7B,kDAAgC;AAChC,iDAA+B;AAC/B,6CAA2B;AAC3B,wCAAsB;AACtB,wCAAsB;AACtB,gDAA8B;AAC9B,kDAAgC;AAChC,0DAAwC;AACxC,4CAA0B;AAC1B,8CAA4B;AAC5B,gDAA8B;AAC9B,6CAA2B"}
|
|
@@ -28,7 +28,61 @@ export interface InstanceUpdateResult {
|
|
|
28
28
|
allowed_origins: string[];
|
|
29
29
|
auth_config: Metadata;
|
|
30
30
|
}
|
|
31
|
+
/** One problem (or note) the setup check found. */
|
|
32
|
+
export interface PreflightFinding {
|
|
33
|
+
severity: 'error' | 'warning' | 'info';
|
|
34
|
+
/** Stable snake_case identifier, e.g. `oauth_provider_missing_credentials`. */
|
|
35
|
+
code: string;
|
|
36
|
+
/** What is wrong, in a plain sentence. */
|
|
37
|
+
message: string;
|
|
38
|
+
/** What to do about it, in a plain sentence. */
|
|
39
|
+
fix: string;
|
|
40
|
+
/** Ids of what the finding is about (provider, client_id, domain, …). */
|
|
41
|
+
subject?: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
export interface PreflightReport {
|
|
44
|
+
object: 'preflight';
|
|
45
|
+
/** True when there are no error-severity findings. */
|
|
46
|
+
ok: boolean;
|
|
47
|
+
/** When the check ran (epoch ms). */
|
|
48
|
+
checked_at: number;
|
|
49
|
+
/** Ordered error, then warning, then info. */
|
|
50
|
+
findings: PreflightFinding[];
|
|
51
|
+
}
|
|
52
|
+
/** The cookie-consent script injected into the hosted sign-in, sign-up and account pages. */
|
|
53
|
+
export interface CookieConsent {
|
|
54
|
+
object: 'cookie_consent';
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
/** The consent script URL (https). */
|
|
57
|
+
script_url?: string;
|
|
58
|
+
script_id?: string | null;
|
|
59
|
+
site_id?: string | null;
|
|
60
|
+
blocking_mode?: string | null;
|
|
61
|
+
extra_origins?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface SetCookieConsentBody {
|
|
64
|
+
/** Your consent script URL. Must be https; its origin is added to the page CSP. */
|
|
65
|
+
script_url: string;
|
|
66
|
+
/** The `<script id>` some consent tools need. */
|
|
67
|
+
script_id?: string | null;
|
|
68
|
+
/** Your consent site id (sent as `data-cbid`). */
|
|
69
|
+
site_id?: string | null;
|
|
70
|
+
/** The prior-blocking mode, e.g. `"auto"` (sent as `data-blockingmode`). */
|
|
71
|
+
blocking_mode?: string | null;
|
|
72
|
+
/** Other https URLs the script loads from or calls; each origin is added to the CSP. */
|
|
73
|
+
extra_origins?: string[];
|
|
74
|
+
}
|
|
31
75
|
export declare function instanceResource(request: RequestFn): {
|
|
32
76
|
get(): Promise<Instance>;
|
|
33
77
|
update(body: UpdateInstanceBody): Promise<InstanceUpdateResult>;
|
|
78
|
+
/** Check your setup in one call: configuration the server can see is broken or risky. */
|
|
79
|
+
preflight(): Promise<PreflightReport>;
|
|
80
|
+
/** The cookie-consent script on the hosted pages (any provider). */
|
|
81
|
+
cookieConsent: {
|
|
82
|
+
get(): Promise<CookieConsent>;
|
|
83
|
+
/** Replaces the whole setting. */
|
|
84
|
+
set(body: SetCookieConsentBody): Promise<CookieConsent>;
|
|
85
|
+
/** Turn it off: no script is injected and the CSP goes back to the default. */
|
|
86
|
+
delete(): Promise<CookieConsent>;
|
|
87
|
+
};
|
|
34
88
|
};
|
package/dist/client/instance.js
CHANGED
|
@@ -9,6 +9,24 @@ function instanceResource(request) {
|
|
|
9
9
|
update(body) {
|
|
10
10
|
return request({ method: 'PATCH', path: '/v1/instance', body });
|
|
11
11
|
},
|
|
12
|
+
/** Check your setup in one call: configuration the server can see is broken or risky. */
|
|
13
|
+
preflight() {
|
|
14
|
+
return request({ method: 'GET', path: '/v1/instance/preflight' });
|
|
15
|
+
},
|
|
16
|
+
/** The cookie-consent script on the hosted pages (any provider). */
|
|
17
|
+
cookieConsent: {
|
|
18
|
+
get() {
|
|
19
|
+
return request({ method: 'GET', path: '/v1/instance/cookie_consent' });
|
|
20
|
+
},
|
|
21
|
+
/** Replaces the whole setting. */
|
|
22
|
+
set(body) {
|
|
23
|
+
return request({ method: 'PUT', path: '/v1/instance/cookie_consent', body });
|
|
24
|
+
},
|
|
25
|
+
/** Turn it off: no script is injected and the CSP goes back to the default. */
|
|
26
|
+
delete() {
|
|
27
|
+
return request({ method: 'DELETE', path: '/v1/instance/cookie_consent' });
|
|
28
|
+
},
|
|
29
|
+
},
|
|
12
30
|
};
|
|
13
31
|
}
|
|
14
32
|
//# sourceMappingURL=instance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/client/instance.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/client/instance.ts"],"names":[],"mappings":";;AAmFA,4CA2BC;AA3BD,SAAgB,gBAAgB,CAAC,OAAkB;IACjD,OAAO;QACL,GAAG;YACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,MAAM,CAAC,IAAwB;YAC7B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,yFAAyF;QACzF,SAAS;YACP,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,oEAAoE;QACpE,aAAa,EAAE;YACb,GAAG;gBACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC,CAAC;YACzE,CAAC;YACD,kCAAkC;YAClC,GAAG,CAAC,IAA0B;gBAC5B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/E,CAAC;YACD,+EAA+E;YAC/E,MAAM;gBACJ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC,CAAC;YAC5E,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,21 @@ export interface CreateInvitationBody {
|
|
|
14
14
|
email_address: string;
|
|
15
15
|
public_metadata?: Metadata;
|
|
16
16
|
}
|
|
17
|
+
/** A per-entry failure from a bulk create; `index` points into the request array. */
|
|
18
|
+
export interface BulkInvitationError {
|
|
19
|
+
index: number;
|
|
20
|
+
email_address: string | null;
|
|
21
|
+
code: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface BulkInvitationsResult {
|
|
25
|
+
object: 'list';
|
|
26
|
+
data: Invitation[];
|
|
27
|
+
errors: BulkInvitationError[];
|
|
28
|
+
}
|
|
17
29
|
export declare function invitationsResource(request: RequestFn): {
|
|
30
|
+
/** Create up to 100 invitations; each entry is validated and de-duplicated on its own. */
|
|
31
|
+
bulkCreate(invitations: CreateInvitationBody[], idempotencyKey?: string): Promise<BulkInvitationsResult>;
|
|
18
32
|
list(params?: CursorParams): Promise<CursorPage<Invitation>>;
|
|
19
33
|
create(body: CreateInvitationBody, idempotencyKey?: string): Promise<Invitation>;
|
|
20
34
|
revoke(id: string): Promise<Invitation>;
|
|
@@ -4,6 +4,15 @@ exports.invitationsResource = invitationsResource;
|
|
|
4
4
|
const request_1 = require("./request");
|
|
5
5
|
function invitationsResource(request) {
|
|
6
6
|
return {
|
|
7
|
+
/** Create up to 100 invitations; each entry is validated and de-duplicated on its own. */
|
|
8
|
+
bulkCreate(invitations, idempotencyKey) {
|
|
9
|
+
return request({
|
|
10
|
+
method: 'POST',
|
|
11
|
+
path: '/v1/invitations/bulk',
|
|
12
|
+
body: { invitations },
|
|
13
|
+
idempotencyKey,
|
|
14
|
+
});
|
|
15
|
+
},
|
|
7
16
|
list(params = {}) {
|
|
8
17
|
return request({ method: 'GET', path: '/v1/invitations', query: { ...params } });
|
|
9
18
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations.js","sourceRoot":"","sources":["../../src/client/invitations.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"invitations.js","sourceRoot":"","sources":["../../src/client/invitations.ts"],"names":[],"mappings":";;AAiCA,kDAwBC;AAzDD,uCAAgD;AAiChD,SAAgB,mBAAmB,CAAC,OAAkB;IACpD,OAAO;QACL,0FAA0F;QAC1F,UAAU,CACR,WAAmC,EACnC,cAAuB;YAEvB,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,sBAAsB;gBAC5B,IAAI,EAAE,EAAE,WAAW,EAAE;gBACrB,cAAc;aACf,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,SAAuB,EAAE;YAC5B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,CAAC,IAA0B,EAAE,cAAuB;YACxD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,IAAA,aAAG,EAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QAChF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { RequestFn } from './request';
|
|
2
|
+
/**
|
|
3
|
+
* The instance's lazy-migration connection: on sign-in, Atlas can verify a
|
|
4
|
+
* password against your legacy user store and (optionally) import the user.
|
|
5
|
+
* The signing secret is never returned — only `has_signing_secret`.
|
|
6
|
+
*/
|
|
7
|
+
export interface LegacyAuthConnection {
|
|
8
|
+
object: 'legacy_auth_connection';
|
|
9
|
+
id?: string;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
verify_url?: string;
|
|
12
|
+
has_signing_secret?: boolean;
|
|
13
|
+
import_on_login?: boolean;
|
|
14
|
+
timeout_ms?: number;
|
|
15
|
+
strategy?: string;
|
|
16
|
+
/** Epoch ms. */
|
|
17
|
+
created_at?: number;
|
|
18
|
+
/** Epoch ms. */
|
|
19
|
+
updated_at?: number;
|
|
20
|
+
/** Present and `false` when no connection exists yet. */
|
|
21
|
+
configured?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** `PUT /v1/legacy_auth_connection` — create or replace the connection. */
|
|
24
|
+
export interface PutLegacyAuthConnectionBody {
|
|
25
|
+
/** Your HTTPS verify endpoint (public https on a production instance). */
|
|
26
|
+
verify_url: string;
|
|
27
|
+
/** Whether sign-in consults the legacy store. Default false. */
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
/** HMAC signing secret. Write-only; required on create, omit on edit to keep the stored one. */
|
|
30
|
+
signing_secret?: string;
|
|
31
|
+
/** Create the user locally on a successful verify. Default true. */
|
|
32
|
+
import_on_login?: boolean;
|
|
33
|
+
/** Fail-closed call budget, 1–30000 ms. Default 5000. */
|
|
34
|
+
timeout_ms?: number;
|
|
35
|
+
strategy?: 'password';
|
|
36
|
+
}
|
|
37
|
+
export declare function legacyAuthConnectionResource(request: RequestFn): {
|
|
38
|
+
/** Returns `{ configured: false }` when none exists. */
|
|
39
|
+
get(): Promise<LegacyAuthConnection>;
|
|
40
|
+
set(body: PutLegacyAuthConnectionBody, idempotencyKey?: string): Promise<LegacyAuthConnection>;
|
|
41
|
+
delete(): Promise<{
|
|
42
|
+
object: "legacy_auth_connection";
|
|
43
|
+
deleted: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.legacyAuthConnectionResource = legacyAuthConnectionResource;
|
|
4
|
+
function legacyAuthConnectionResource(request) {
|
|
5
|
+
return {
|
|
6
|
+
/** Returns `{ configured: false }` when none exists. */
|
|
7
|
+
get() {
|
|
8
|
+
return request({ method: 'GET', path: '/v1/legacy_auth_connection' });
|
|
9
|
+
},
|
|
10
|
+
set(body, idempotencyKey) {
|
|
11
|
+
return request({ method: 'PUT', path: '/v1/legacy_auth_connection', body, idempotencyKey });
|
|
12
|
+
},
|
|
13
|
+
delete() {
|
|
14
|
+
return request({ method: 'DELETE', path: '/v1/legacy_auth_connection' });
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=legacy-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-auth.js","sourceRoot":"","sources":["../../src/client/legacy-auth.ts"],"names":[],"mappings":";;AAuCA,oEAaC;AAbD,SAAgB,4BAA4B,CAAC,OAAkB;IAC7D,OAAO;QACL,wDAAwD;QACxD,GAAG;YACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,GAAG,CAAC,IAAiC,EAAE,cAAuB;YAC5D,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,4BAA4B,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QAC9F,CAAC;QACD,MAAM;YACJ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { RequestFn } from './request';
|
|
2
|
+
/** `GET /v1/mcp` — the MCP server descriptor and the tools this key may call. */
|
|
3
|
+
export interface McpServerDescriptor {
|
|
4
|
+
object: 'mcp_server';
|
|
5
|
+
protocol_version: string;
|
|
6
|
+
server: {
|
|
7
|
+
name?: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
};
|
|
10
|
+
capabilities: Record<string, unknown>;
|
|
11
|
+
/** MCP tool definitions (name, description, inputSchema, annotations…). */
|
|
12
|
+
tools: Array<Record<string, unknown>>;
|
|
13
|
+
rate_limit?: unknown;
|
|
14
|
+
recommended_agent_scopes?: string[];
|
|
15
|
+
}
|
|
16
|
+
/** The JSON-RPC 2.0 envelope `POST /v1/mcp` answers with. */
|
|
17
|
+
export interface McpJsonRpcResponse<R = Record<string, unknown>> {
|
|
18
|
+
jsonrpc: '2.0';
|
|
19
|
+
id: string | number | null;
|
|
20
|
+
result?: R;
|
|
21
|
+
error?: {
|
|
22
|
+
code: number;
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** A `tools/call` result. A refused call is a result with `isError: true`, not a JSON-RPC error. */
|
|
27
|
+
export interface McpToolCallResult {
|
|
28
|
+
content: Array<{
|
|
29
|
+
type: string;
|
|
30
|
+
text?: string;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}>;
|
|
33
|
+
isError?: boolean;
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
/** The instance's remote MCP connector (OAuth-protected MCP for end users). */
|
|
37
|
+
export interface McpConnector {
|
|
38
|
+
object: 'mcp_connector';
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
name: string | null;
|
|
41
|
+
exposed_scopes: string[];
|
|
42
|
+
dynamic_registration: boolean;
|
|
43
|
+
allowed_redirect_hosts: string[];
|
|
44
|
+
/** The RFC 9728 protected-resource metadata URL. */
|
|
45
|
+
discovery_url: string | null;
|
|
46
|
+
/** The RFC 8707 resource identifier (token audience). */
|
|
47
|
+
resource: string | null;
|
|
48
|
+
/** Whether the MCP resource server has been provisioned. */
|
|
49
|
+
resource_server_exists: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** User-scoped tool groups the connector can expose. */
|
|
52
|
+
export type McpConnectorScope = 'profile' | 'email' | 'mfa' | 'sessions' | 'organizations';
|
|
53
|
+
/** `PUT /v1/mcp_connector` — only the fields you send change. */
|
|
54
|
+
export interface UpdateMcpConnectorBody {
|
|
55
|
+
/** Master switch. Enabling provisions the MCP resource server and needs a frontend API host. */
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
/** Display name on the consent screen (max 80 chars). */
|
|
58
|
+
name?: string;
|
|
59
|
+
exposed_scopes?: McpConnectorScope[];
|
|
60
|
+
/** Let MCP clients self-register an OAuth client (RFC 7591). */
|
|
61
|
+
dynamic_registration?: boolean;
|
|
62
|
+
/** Extra redirect-URI hostnames allowed for dynamic registration. */
|
|
63
|
+
allowed_redirect_hosts?: string[];
|
|
64
|
+
}
|
|
65
|
+
export declare function mcpResource(request: RequestFn): {
|
|
66
|
+
/** The server descriptor and the tools this secret key may call. */
|
|
67
|
+
describe(): Promise<McpServerDescriptor>;
|
|
68
|
+
/**
|
|
69
|
+
* Send one JSON-RPC call (`initialize`, `tools/list`, `tools/call`, `ping`).
|
|
70
|
+
* A JSON-RPC error comes back in `error`, not as a thrown exception.
|
|
71
|
+
*/
|
|
72
|
+
rpc: <R = Record<string, unknown>>(method: string, params?: unknown, id?: string | number) => Promise<McpJsonRpcResponse<R>>;
|
|
73
|
+
/** `tools/list` — the tools this key may call. */
|
|
74
|
+
listTools(): Promise<McpJsonRpcResponse<{
|
|
75
|
+
tools: Array<Record<string, unknown>>;
|
|
76
|
+
}>>;
|
|
77
|
+
/** `tools/call` — run one tool with its arguments. */
|
|
78
|
+
callTool(name: string, args?: Record<string, unknown>): Promise<McpJsonRpcResponse<McpToolCallResult>>;
|
|
79
|
+
};
|
|
80
|
+
export declare function mcpConnectorResource(request: RequestFn): {
|
|
81
|
+
get(): Promise<McpConnector>;
|
|
82
|
+
/** Configure the connector. Only the fields you send change; an unknown scope is a 422. */
|
|
83
|
+
update(body: UpdateMcpConnectorBody, idempotencyKey?: string): Promise<McpConnector>;
|
|
84
|
+
/** Disable it. Preferences are kept for a later re-enable; issued tokens stop working at once. */
|
|
85
|
+
disable(): Promise<McpConnector>;
|
|
86
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mcpResource = mcpResource;
|
|
4
|
+
exports.mcpConnectorResource = mcpConnectorResource;
|
|
5
|
+
function mcpResource(request) {
|
|
6
|
+
let nextId = 1;
|
|
7
|
+
const rpc = (method, params, id) => request({
|
|
8
|
+
method: 'POST',
|
|
9
|
+
path: '/v1/mcp',
|
|
10
|
+
body: { jsonrpc: '2.0', id: id ?? nextId++, method, ...(params !== undefined ? { params } : {}) },
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
/** The server descriptor and the tools this secret key may call. */
|
|
14
|
+
describe() {
|
|
15
|
+
return request({ method: 'GET', path: '/v1/mcp' });
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Send one JSON-RPC call (`initialize`, `tools/list`, `tools/call`, `ping`).
|
|
19
|
+
* A JSON-RPC error comes back in `error`, not as a thrown exception.
|
|
20
|
+
*/
|
|
21
|
+
rpc,
|
|
22
|
+
/** `tools/list` — the tools this key may call. */
|
|
23
|
+
listTools() {
|
|
24
|
+
return rpc('tools/list');
|
|
25
|
+
},
|
|
26
|
+
/** `tools/call` — run one tool with its arguments. */
|
|
27
|
+
callTool(name, args = {}) {
|
|
28
|
+
return rpc('tools/call', { name, arguments: args });
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function mcpConnectorResource(request) {
|
|
33
|
+
return {
|
|
34
|
+
get() {
|
|
35
|
+
return request({ method: 'GET', path: '/v1/mcp_connector' });
|
|
36
|
+
},
|
|
37
|
+
/** Configure the connector. Only the fields you send change; an unknown scope is a 422. */
|
|
38
|
+
update(body, idempotencyKey) {
|
|
39
|
+
return request({ method: 'PUT', path: '/v1/mcp_connector', body, idempotencyKey });
|
|
40
|
+
},
|
|
41
|
+
/** Disable it. Preferences are kept for a later re-enable; issued tokens stop working at once. */
|
|
42
|
+
disable() {
|
|
43
|
+
return request({ method: 'DELETE', path: '/v1/mcp_connector' });
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/client/mcp.ts"],"names":[],"mappings":";;AA6DA,kCAmCC;AAED,oDAcC;AAnDD,SAAgB,WAAW,CAAC,OAAkB;IAC5C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,MAAM,GAAG,GAAG,CACV,MAAc,EACd,MAAgB,EAChB,EAAoB,EACY,EAAE,CAClC,OAAO,CAAC;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;KAClG,CAAC,CAAC;IAEL,OAAO;QACL,oEAAoE;QACpE,QAAQ;YACN,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC;QACD;;;WAGG;QACH,GAAG;QACH,kDAAkD;QAClD,SAAS;YACP,OAAO,GAAG,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC;QACD,sDAAsD;QACtD,QAAQ,CACN,IAAY,EACZ,OAAgC,EAAE;YAElC,OAAO,GAAG,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAAC,OAAkB;IACrD,OAAO;QACL,GAAG;YACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,2FAA2F;QAC3F,MAAM,CAAC,IAA4B,EAAE,cAAuB;YAC1D,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,kGAAkG;QAClG,OAAO;YACL,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAClE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type RequestFn } from './request';
|
|
2
|
+
/** Built-in notification templates `send` falls back to when no tenant template has the name. */
|
|
3
|
+
export type BuiltInNotificationTemplate = 'new_device' | 'unattended_access' | 'password_changed' | 'mfa_changed';
|
|
4
|
+
export interface SendNotificationBody {
|
|
5
|
+
/** The end-user to notify. */
|
|
6
|
+
user_id: string;
|
|
7
|
+
/** A template name you defined, or a built-in one. */
|
|
8
|
+
template: BuiltInNotificationTemplate | (string & {});
|
|
9
|
+
/** Variables interpolated into the template (e.g. device, location, when, url). */
|
|
10
|
+
data?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
/** `suppressed` when the user opted out of the template's (optional) category. */
|
|
13
|
+
export interface SentNotification {
|
|
14
|
+
object: 'notification';
|
|
15
|
+
id: string;
|
|
16
|
+
status: 'sent' | 'suppressed';
|
|
17
|
+
}
|
|
18
|
+
/** A category you defined; users can turn it off on their preference page. */
|
|
19
|
+
export interface NotificationCategory {
|
|
20
|
+
object: 'notification_category';
|
|
21
|
+
id: string;
|
|
22
|
+
/** The key templates and preferences reference. */
|
|
23
|
+
key: string;
|
|
24
|
+
/** The user-facing label on the preference toggle. */
|
|
25
|
+
label: string;
|
|
26
|
+
/** Always true for a tenant-defined category. */
|
|
27
|
+
optional: boolean;
|
|
28
|
+
created_at: number;
|
|
29
|
+
}
|
|
30
|
+
export interface NotificationTemplate {
|
|
31
|
+
object: 'notification_template';
|
|
32
|
+
id: string;
|
|
33
|
+
/** The `template` a send passes. */
|
|
34
|
+
name: string;
|
|
35
|
+
subject: string;
|
|
36
|
+
/** Body with `{{variables}}` interpolated at send. */
|
|
37
|
+
body: string;
|
|
38
|
+
/** The category whose per-user preference gates this template. */
|
|
39
|
+
category: string;
|
|
40
|
+
created_at: number;
|
|
41
|
+
updated_at: number;
|
|
42
|
+
}
|
|
43
|
+
export interface UpdateNotificationTemplateBody {
|
|
44
|
+
subject: string;
|
|
45
|
+
/** Email body with `{{variables}}`. */
|
|
46
|
+
body: string;
|
|
47
|
+
/** A built-in category (new_device, unattended_access, credential_change) or one you defined. */
|
|
48
|
+
category: string;
|
|
49
|
+
}
|
|
50
|
+
export interface CreateNotificationTemplateBody extends UpdateNotificationTemplateBody {
|
|
51
|
+
/** Unique per instance. */
|
|
52
|
+
name: string;
|
|
53
|
+
}
|
|
54
|
+
export declare function notificationsResource(request: RequestFn): {
|
|
55
|
+
/** Send a templated, instance-branded security email, honouring the user's preferences. */
|
|
56
|
+
send(body: SendNotificationBody, idempotencyKey?: string): Promise<SentNotification>;
|
|
57
|
+
categories: {
|
|
58
|
+
list(): Promise<{
|
|
59
|
+
object: "list";
|
|
60
|
+
data: NotificationCategory[];
|
|
61
|
+
}>;
|
|
62
|
+
/** A duplicate or built-in key is a 409. */
|
|
63
|
+
create(body: {
|
|
64
|
+
key: string;
|
|
65
|
+
label: string;
|
|
66
|
+
}): Promise<NotificationCategory>;
|
|
67
|
+
update(key: string, body: {
|
|
68
|
+
label: string;
|
|
69
|
+
}): Promise<NotificationCategory>;
|
|
70
|
+
/** Refused with a 409 while a template still uses it. */
|
|
71
|
+
delete(key: string): Promise<{
|
|
72
|
+
object: "notification_category";
|
|
73
|
+
key: string;
|
|
74
|
+
deleted: boolean;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
templates: {
|
|
78
|
+
list(): Promise<{
|
|
79
|
+
object: "list";
|
|
80
|
+
data: NotificationTemplate[];
|
|
81
|
+
}>;
|
|
82
|
+
/** A duplicate name is a 409. */
|
|
83
|
+
create(body: CreateNotificationTemplateBody): Promise<NotificationTemplate>;
|
|
84
|
+
get(name: string): Promise<NotificationTemplate>;
|
|
85
|
+
update(name: string, body: UpdateNotificationTemplateBody): Promise<NotificationTemplate>;
|
|
86
|
+
delete(name: string): Promise<{
|
|
87
|
+
object: "notification_template";
|
|
88
|
+
name: string;
|
|
89
|
+
deleted: boolean;
|
|
90
|
+
}>;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notificationsResource = notificationsResource;
|
|
4
|
+
const request_1 = require("./request");
|
|
5
|
+
function notificationsResource(request) {
|
|
6
|
+
return {
|
|
7
|
+
/** Send a templated, instance-branded security email, honouring the user's preferences. */
|
|
8
|
+
send(body, idempotencyKey) {
|
|
9
|
+
return request({ method: 'POST', path: '/v1/notifications', body, idempotencyKey });
|
|
10
|
+
},
|
|
11
|
+
categories: {
|
|
12
|
+
list() {
|
|
13
|
+
return request({ method: 'GET', path: '/v1/notification_categories' });
|
|
14
|
+
},
|
|
15
|
+
/** A duplicate or built-in key is a 409. */
|
|
16
|
+
create(body) {
|
|
17
|
+
return request({ method: 'POST', path: '/v1/notification_categories', body });
|
|
18
|
+
},
|
|
19
|
+
update(key, body) {
|
|
20
|
+
return request({
|
|
21
|
+
method: 'PUT',
|
|
22
|
+
path: `/v1/notification_categories/${(0, request_1.enc)(key)}`,
|
|
23
|
+
body,
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
/** Refused with a 409 while a template still uses it. */
|
|
27
|
+
delete(key) {
|
|
28
|
+
return request({ method: 'DELETE', path: `/v1/notification_categories/${(0, request_1.enc)(key)}` });
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
templates: {
|
|
32
|
+
list() {
|
|
33
|
+
return request({ method: 'GET', path: '/v1/notification_templates' });
|
|
34
|
+
},
|
|
35
|
+
/** A duplicate name is a 409. */
|
|
36
|
+
create(body) {
|
|
37
|
+
return request({ method: 'POST', path: '/v1/notification_templates', body });
|
|
38
|
+
},
|
|
39
|
+
get(name) {
|
|
40
|
+
return request({ method: 'GET', path: `/v1/notification_templates/${(0, request_1.enc)(name)}` });
|
|
41
|
+
},
|
|
42
|
+
update(name, body) {
|
|
43
|
+
return request({
|
|
44
|
+
method: 'PUT',
|
|
45
|
+
path: `/v1/notification_templates/${(0, request_1.enc)(name)}`,
|
|
46
|
+
body,
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
delete(name) {
|
|
50
|
+
return request({ method: 'DELETE', path: `/v1/notification_templates/${(0, request_1.enc)(name)}` });
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/client/notifications.ts"],"names":[],"mappings":";;AAiEA,sDAqDC;AAtHD,uCAAgD;AAiEhD,SAAgB,qBAAqB,CAAC,OAAkB;IACtD,OAAO;QACL,2FAA2F;QAC3F,IAAI,CAAC,IAA0B,EAAE,cAAuB;YACtD,OAAO,OAAO,CAAC,EAAE,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