@atlasauth/backend 0.17.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/backchannel-handlers.d.ts +87 -0
  3. package/dist/backchannel-handlers.js +137 -0
  4. package/dist/backchannel-handlers.js.map +1 -0
  5. package/dist/client/activity.d.ts +13 -2
  6. package/dist/client/activity.js.map +1 -1
  7. package/dist/client/audit-logs.d.ts +7 -0
  8. package/dist/client/audit-logs.js.map +1 -1
  9. package/dist/client/compliance.d.ts +216 -0
  10. package/dist/client/compliance.js +77 -0
  11. package/dist/client/compliance.js.map +1 -0
  12. package/dist/client/credentials.d.ts +409 -0
  13. package/dist/client/credentials.js +158 -0
  14. package/dist/client/credentials.js.map +1 -0
  15. package/dist/client/data-subject-requests.d.ts +36 -1
  16. package/dist/client/data-subject-requests.js.map +1 -1
  17. package/dist/client/design.d.ts +48 -0
  18. package/dist/client/design.js +9 -0
  19. package/dist/client/design.js.map +1 -1
  20. package/dist/client/entitlement-overrides.d.ts +30 -0
  21. package/dist/client/entitlement-overrides.js +9 -0
  22. package/dist/client/entitlement-overrides.js.map +1 -1
  23. package/dist/client/env.d.ts +16 -0
  24. package/dist/client/env.js +38 -0
  25. package/dist/client/env.js.map +1 -0
  26. package/dist/client/error.d.ts +10 -0
  27. package/dist/client/error.js +4 -0
  28. package/dist/client/error.js.map +1 -1
  29. package/dist/client/index.d.ts +382 -7
  30. package/dist/client/index.js +44 -1
  31. package/dist/client/index.js.map +1 -1
  32. package/dist/client/instance.d.ts +401 -3
  33. package/dist/client/instance.js +77 -3
  34. package/dist/client/instance.js.map +1 -1
  35. package/dist/client/integrations.d.ts +107 -0
  36. package/dist/client/integrations.js +25 -0
  37. package/dist/client/integrations.js.map +1 -0
  38. package/dist/client/messaging.d.ts +18 -4
  39. package/dist/client/messaging.js +6 -2
  40. package/dist/client/messaging.js.map +1 -1
  41. package/dist/client/oauth-clients.d.ts +11 -3
  42. package/dist/client/oauth-clients.js +4 -2
  43. package/dist/client/oauth-clients.js.map +1 -1
  44. package/dist/client/operator.d.ts +100 -0
  45. package/dist/client/operator.js +132 -0
  46. package/dist/client/operator.js.map +1 -0
  47. package/dist/client/platform.d.ts +233 -9
  48. package/dist/client/platform.js +74 -6
  49. package/dist/client/platform.js.map +1 -1
  50. package/dist/client/policies.d.ts +316 -0
  51. package/dist/client/policies.js +103 -0
  52. package/dist/client/policies.js.map +1 -0
  53. package/dist/client/privacy.d.ts +127 -0
  54. package/dist/client/privacy.js +44 -0
  55. package/dist/client/privacy.js.map +1 -0
  56. package/dist/client/referrals.d.ts +53 -6
  57. package/dist/client/referrals.js +9 -0
  58. package/dist/client/referrals.js.map +1 -1
  59. package/dist/client/request.d.ts +38 -1
  60. package/dist/client/request.js +6 -2
  61. package/dist/client/request.js.map +1 -1
  62. package/dist/client/sealed-box.d.ts +7 -0
  63. package/dist/client/sealed-box.js +62 -0
  64. package/dist/client/sealed-box.js.map +1 -0
  65. package/dist/client/sessions.d.ts +16 -5
  66. package/dist/client/sessions.js +7 -10
  67. package/dist/client/sessions.js.map +1 -1
  68. package/dist/client/status.d.ts +200 -0
  69. package/dist/client/status.js +54 -0
  70. package/dist/client/status.js.map +1 -0
  71. package/dist/client/users.d.ts +15 -0
  72. package/dist/client/webhooks.d.ts +244 -11
  73. package/dist/client/webhooks.js +52 -3
  74. package/dist/client/webhooks.js.map +1 -1
  75. package/dist/index.d.ts +9 -6
  76. package/dist/index.js +20 -4
  77. package/dist/index.js.map +1 -1
  78. package/dist/oidc.d.ts +65 -1
  79. package/dist/oidc.js +46 -0
  80. package/dist/oidc.js.map +1 -1
  81. package/dist/policy-source.d.ts +104 -0
  82. package/dist/policy-source.js +99 -0
  83. package/dist/policy-source.js.map +1 -0
  84. package/dist/referral-test-calls.d.ts +26 -13
  85. package/dist/referral-test-calls.js +40 -14
  86. package/dist/referral-test-calls.js.map +1 -1
  87. package/dist/testing.d.ts +41 -6
  88. package/dist/testing.js +34 -2
  89. package/dist/testing.js.map +1 -1
  90. package/dist/webhooks.d.ts +8 -0
  91. package/dist/webhooks.js +13 -4
  92. package/dist/webhooks.js.map +1 -1
  93. package/package.json +6 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @atlasauth/backend changelog
2
2
 
3
+ ## 0.19.0 — 2026-10-24
4
+
5
+ ### Added
6
+
7
+ - `createAtlasClientFromEnv()`, `atlasConfigFromEnv()` and `apiBaseFromEnv()`: configure from `ATLAS_SECRET_KEY` and `ATLAS_API_BASE` or `ATLAS_API_URL`.
8
+ - `fx.referalliCall` signs v1 and v2 and sends both header spellings; `requestId` option; `referalliSignatureV2`. `fx.referallyCall` stays as a deprecated alias.
9
+ - Referral settings: `context_cookie` accepts a name or a list, `context_cookies`, `provider_aliases`, `capabilities`, `one_click` / `one_click_presets`, `providers[].aliases`.
10
+ - `client.referrals` can start a one-click install: `POST /v1/instance/referrals/{preset}/install`.
11
+ - `GET /v1/entitlements` (the standard entitlements shape) and `internal` on entitlement overrides.
12
+
13
+ - Data rights: `privacy` — the data-rights executor protocol any DSAR orchestrator calls (`discover`, `preset`, `lookup`, `createRequest`, `getRequest`, `cancelRequest`) and the instance's orchestrator settings (`orchestrator.get/set/delete`).
14
+ - `dataSubjectRequests.create` accepts the canonical data-rights types (`access`, `deletion`, `closure`, `restriction`, `rectification`, and the alias `erase`); `DataSubjectRequest` carries `canonical_type`, `source`, `case_id`, `external_case`, `trace_id`, `steps`, `retention` and `deletion_effective_at`.
15
+ - `withOptions({ dryRun: true })`: every write is sent with `?dry_run=true` and resolves to a `DryRunResult` (`changes[{ section, before, after }]`) without changing anything.
16
+ - Provisioning fields: `external_ref` and `metadata` on app, instance, secret key, OAuth client, webhook endpoint and Sign in with Atlas app creates (a repeat with the same ref returns the existing object, `idempotent_replay: true`); `metadata` filters on `oauthClients.list`, `webhooks.endpoints.list`, platform `apps.list`, `apps.secretKeys`, `atlasIdApps.list`; `metadataQuery()`.
17
+ - Platform: `apps.sandboxTeardown()` (hard delete of sandbox-tagged resources, with a dry run), `apps.bulkDelete({ metadata, dry_run })`, `apps.cloneConfig()`, `apps.createSecretKey()`.
18
+ - `notices` (`list`, `acknowledge`), `securityAdvisories` (`list`, `acknowledge`, `catalog`), `subProcessors.get()`, and `auditExports` (`list`, `get`, `create`, `update`, `delete`, `test`, `rotateSecret`) with the `AuditCloudEvent` type.
19
+ - `AuditLog.actor` (`type`, `id`, `key_name`, `key_prefix`).
20
+ - Atlas service status: `status` (`service` for the public `GET /v1/status` with component groups, regions and open incidents; `getSubscription`, `updateSubscription`, `disableSubscription`, `rotateFeed` for the incident subscription; `listIncidents`; `listDependencies`, `createDependency`, `getDependency`, `updateDependency`, `deleteDependency`, `refreshDependency` for upstream status pages), with the `StatusSubscription`, `StatusIncident`, `StatusIncidentEventData` and `StatusDependency` types.
21
+ - Webhook events `status_incident.created`, `status_incident.updated` and `status_incident.resolved`.
22
+ - `instance.integrationHealth({ only?, probe? })`, `instance.integrationHealthProviders()`, `instance.embed({ instance, origin?, shape? })`, `design.importBrand({ brandUrl } | { brand })`. `DesignSettings` gains `brand`, `precedence`, `sources`, `ignored`; `AtlasIdAppPreflight` gains `button_rendered_origins`, `authorize_requests_7d`, `fallback_origins`, `homepage_includes_script`.
23
+ - Back-channel logout receivers: `handleBackchannelLogout()` (framework-agnostic), `expressBackchannelLogout()`, `fastifyBackchannelLogout()` / `fastifyBackchannelLogoutPlugin`, and `nextBackchannelLogout()` (also `fetchBackchannelLogout()` for any Fetch-API runtime). They verify the `logout_token`, call your `onLogout({ sub, sid })`, and answer 200, 400 (bad token, not retried) or 503 with `Retry-After` (retried).
24
+ - `instance.preflight({ min_severity, include_suppressed })`, with the `suppressed` and `integrations` fields and the `security_posture` finding group.
25
+ - `instance.unknownFieldsReport({ days })`: the unknown body fields your writes sent, per route, field and key.
26
+ - `instance.openapiDiff({ since })`: operations added, deprecated and removed since a date.
27
+ - `messaging.channel('email' | 'sms')`, and `NotConfigured`: unconfigured singletons now read as `{ configured: false }` instead of a 404 (`messaging.managedEmail.get()`, `messaging.developmentEmail.get()`).
28
+ - `require_pkce` on `oauthClients.create` (new clients default to true).
29
+ - `AtlasErrorCodes.ROUTE_NOT_FOUND`, and `docs_url`, `did_you_mean`, `allowed_methods` on `AtlasErrorItem`.
30
+
31
+ ### Changed
32
+
33
+ - `ConfigChangelogEntry.changes` is always present (with `values_recorded`), plus `no_op` and `recorded`; `fields` is deprecated. `include_no_op` on `configChangelog.list`.
34
+
35
+ ## 0.18.0 — 2026-10-24
36
+
37
+ ### Added
38
+
39
+ - Policy acceptance: `policies` (`list`, `create`, `get`, `update`, `delete`, `versions.list/create/get/update/delete/publish/retire`, `listAcceptances`, `exportAcceptancesCsv`, `forUser`, `settings.get/update` for the `pol` session claim) and `policySource` (`get`, `update`, `delete`, `test`, `sync`, `listDeliveries`) for the external policy source.
40
+ - Policy source protocol v1 helpers for the system that serves policies: `verifyPolicyFeedRequest()` (Atlas's signed `GET {endpoint}/policies`) and `signPolicySourceEvent()` (`policy.published` / `policy.retired`), with the `PolicyFeed` types.
41
+ - `RecordUserConsentBody` / `UserConsent`: `policy_version_id`, `content_sha256`, `display`, `scrolled_to_end`, `view_ms`, `locale`.
42
+
3
43
  ## 0.17.0 — 2026-10-24
4
44
 
5
45
  ### Added
@@ -0,0 +1,87 @@
1
+ import { LogoutTokenVerifier, type LogoutTokenClaims, type LogoutTokenVerifierOptions } from './logout-token';
2
+ /**
3
+ * Ready-made receivers for OIDC Back-Channel Logout: Atlas POSTs a signed
4
+ * `logout_token` (form-encoded) to your client's `backchannel_logout_uri` when
5
+ * a session ends (signed out elsewhere, revoked, the user banned or deleted).
6
+ * Each handler verifies the token, calls your `onLogout` with whose session to
7
+ * end, and answers the way the spec and Atlas's retries expect:
8
+ *
9
+ * 200 verified and handled (also for a replayed token you already handled)
10
+ * 400 the token is bad: Atlas does not retry
11
+ * 503 your side could not check it right now (keys unreachable, or
12
+ * `onLogout` threw): `Retry-After` is set and Atlas retries
13
+ *
14
+ * Every response carries `Cache-Control: no-store`. Framework-agnostic core:
15
+ * {@link handleBackchannelLogout}; adapters for Express, Fastify and Next.js
16
+ * (App Router route handlers, or any Fetch-API runtime) below.
17
+ */
18
+ export interface BackchannelLogoutOptions extends LogoutTokenVerifierOptions {
19
+ /**
20
+ * End the matching session(s) in your app. `sid` names one session (the
21
+ * `sid` of the id_token you got at sign-in), `sub` the user (end all of
22
+ * them when there is no `sid`). Throwing answers 503, so Atlas retries.
23
+ */
24
+ onLogout(claims: LogoutTokenClaims): void | Promise<void>;
25
+ /** Reuse a verifier you already have (keeps its key cache). Built from the options otherwise. */
26
+ verifier?: LogoutTokenVerifier;
27
+ /** Seconds in Retry-After on a 503. Default 30. */
28
+ retryAfterSeconds?: number;
29
+ }
30
+ export interface BackchannelLogoutResponse {
31
+ status: 200 | 400 | 503;
32
+ headers: Record<string, string>;
33
+ body: string;
34
+ }
35
+ /** Pull `logout_token` out of whatever body the framework handed over. */
36
+ export declare function readLogoutToken(body: unknown): string | undefined;
37
+ /** Verify one back-channel logout request body and run `onLogout`. Never throws. */
38
+ export declare function handleBackchannelLogout(body: unknown, options: BackchannelLogoutOptions): Promise<BackchannelLogoutResponse>;
39
+ interface ExpressLikeRequest {
40
+ body?: unknown;
41
+ on?(event: string, cb: (chunk?: unknown) => void): unknown;
42
+ }
43
+ interface ExpressLikeResponse {
44
+ status(code: number): ExpressLikeResponse;
45
+ set?(headers: Record<string, string>): unknown;
46
+ setHeader?(name: string, value: string): unknown;
47
+ send(body: string): unknown;
48
+ }
49
+ /**
50
+ * Express route handler: `app.post('/auth/backchannel-logout', expressBackchannelLogout({...}))`.
51
+ * Works with or without `express.urlencoded()` in front of it.
52
+ */
53
+ export declare function expressBackchannelLogout(options: BackchannelLogoutOptions): (req: ExpressLikeRequest, res: ExpressLikeResponse) => Promise<void>;
54
+ interface FastifyLikeReply {
55
+ code(status: number): FastifyLikeReply;
56
+ headers(values: Record<string, string>): FastifyLikeReply;
57
+ send(body: string): unknown;
58
+ }
59
+ interface FastifyLikeInstance {
60
+ addContentTypeParser(type: string, opts: {
61
+ parseAs: 'string';
62
+ }, parser: (req: unknown, body: string, done: (err: Error | null, body?: unknown) => void) => void): void;
63
+ hasContentTypeParser?(type: string): boolean;
64
+ post(path: string, handler: (request: {
65
+ body?: unknown;
66
+ }, reply: FastifyLikeReply) => unknown): unknown;
67
+ }
68
+ /** Fastify route handler, for a route whose body is already parsed (or a raw string). */
69
+ export declare function fastifyBackchannelLogout(options: BackchannelLogoutOptions): (request: {
70
+ body?: unknown;
71
+ }, reply: FastifyLikeReply) => Promise<unknown>;
72
+ /**
73
+ * Fastify plugin: registers `POST <path>` (default `/auth/backchannel-logout`)
74
+ * with a form-body parser in its own scope, so nothing else in your app changes:
75
+ * `app.register(fastifyBackchannelLogoutPlugin, { issuer, clientId, onLogout })`.
76
+ */
77
+ export declare function fastifyBackchannelLogoutPlugin(app: FastifyLikeInstance, options: BackchannelLogoutOptions & {
78
+ path?: string;
79
+ }, done?: (err?: Error) => void): void;
80
+ /**
81
+ * A Fetch-API handler: in `app/api/auth/backchannel-logout/route.ts`,
82
+ * `export const POST = nextBackchannelLogout({ issuer, clientId, onLogout })`.
83
+ */
84
+ export declare function nextBackchannelLogout(options: BackchannelLogoutOptions): (request: Request) => Promise<Response>;
85
+ /** Alias of {@link nextBackchannelLogout} for other Fetch-API frameworks. */
86
+ export declare const fetchBackchannelLogout: typeof nextBackchannelLogout;
87
+ export {};
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchBackchannelLogout = void 0;
4
+ exports.readLogoutToken = readLogoutToken;
5
+ exports.handleBackchannelLogout = handleBackchannelLogout;
6
+ exports.expressBackchannelLogout = expressBackchannelLogout;
7
+ exports.fastifyBackchannelLogout = fastifyBackchannelLogout;
8
+ exports.fastifyBackchannelLogoutPlugin = fastifyBackchannelLogoutPlugin;
9
+ exports.nextBackchannelLogout = nextBackchannelLogout;
10
+ const logout_token_1 = require("./logout-token");
11
+ /** Pull `logout_token` out of whatever body the framework handed over. */
12
+ function readLogoutToken(body) {
13
+ if (typeof body === 'string')
14
+ return new URLSearchParams(body).get('logout_token') ?? undefined;
15
+ if (body instanceof URLSearchParams)
16
+ return body.get('logout_token') ?? undefined;
17
+ if (typeof Buffer !== 'undefined' && Buffer.isBuffer(body))
18
+ return readLogoutToken(body.toString('utf8'));
19
+ if (body && typeof body === 'object') {
20
+ const v = body.logout_token;
21
+ if (typeof v === 'string')
22
+ return v;
23
+ if (Array.isArray(v) && typeof v[0] === 'string')
24
+ return v[0];
25
+ }
26
+ return undefined;
27
+ }
28
+ const verifiers = new WeakMap();
29
+ function verifierFor(options) {
30
+ if (options.verifier)
31
+ return options.verifier;
32
+ let v = verifiers.get(options);
33
+ if (!v) {
34
+ v = new logout_token_1.LogoutTokenVerifier(options);
35
+ verifiers.set(options, v);
36
+ }
37
+ return v;
38
+ }
39
+ const json = (status, payload, extra = {}) => ({
40
+ status,
41
+ headers: { 'content-type': 'application/json', 'cache-control': 'no-store', ...extra },
42
+ body: JSON.stringify(payload),
43
+ });
44
+ /** Verify one back-channel logout request body and run `onLogout`. Never throws. */
45
+ async function handleBackchannelLogout(body, options) {
46
+ const token = readLogoutToken(body);
47
+ if (!token)
48
+ return json(400, { error: 'invalid_request', error_description: 'logout_token is missing.' });
49
+ const result = await verifierFor(options).verify(token);
50
+ const retryAfter = String(options.retryAfterSeconds ?? 30);
51
+ if (!result.ok) {
52
+ // A replay of a token already handled is not an error for the sender.
53
+ if (result.reason === 'replayed')
54
+ return json(200, { ok: true, replayed: true });
55
+ if (result.retryable) {
56
+ return json(503, { error: 'temporarily_unavailable', error_description: result.detail ?? result.reason }, { 'retry-after': retryAfter });
57
+ }
58
+ return json(400, { error: 'invalid_request', error_description: result.detail ?? result.reason });
59
+ }
60
+ try {
61
+ await options.onLogout(result.claims);
62
+ }
63
+ catch {
64
+ return json(503, { error: 'temporarily_unavailable', error_description: 'The session could not be ended.' }, { 'retry-after': retryAfter });
65
+ }
66
+ return json(200, { ok: true });
67
+ }
68
+ function readStream(req) {
69
+ return new Promise((resolve, reject) => {
70
+ if (!req.on)
71
+ return resolve('');
72
+ let data = '';
73
+ req.on('data', (chunk) => {
74
+ data += String(chunk);
75
+ if (data.length > 64 * 1024)
76
+ reject(new Error('body too large'));
77
+ });
78
+ req.on('end', () => resolve(data));
79
+ req.on('error', (err) => reject(err));
80
+ });
81
+ }
82
+ /**
83
+ * Express route handler: `app.post('/auth/backchannel-logout', expressBackchannelLogout({...}))`.
84
+ * Works with or without `express.urlencoded()` in front of it.
85
+ */
86
+ function expressBackchannelLogout(options) {
87
+ return async (req, res) => {
88
+ let body = req.body;
89
+ if (body === undefined || (body && typeof body === 'object' && Object.keys(body).length === 0 && req.on)) {
90
+ body = await readStream(req).catch(() => '');
91
+ }
92
+ const out = await handleBackchannelLogout(body, options);
93
+ res.status(out.status);
94
+ for (const [k, v] of Object.entries(out.headers)) {
95
+ if (res.setHeader)
96
+ res.setHeader(k, v);
97
+ else
98
+ res.set?.({ [k]: v });
99
+ }
100
+ res.send(out.body);
101
+ };
102
+ }
103
+ /** Fastify route handler, for a route whose body is already parsed (or a raw string). */
104
+ function fastifyBackchannelLogout(options) {
105
+ return async (request, reply) => {
106
+ const out = await handleBackchannelLogout(request.body, options);
107
+ return reply.code(out.status).headers(out.headers).send(out.body);
108
+ };
109
+ }
110
+ /**
111
+ * Fastify plugin: registers `POST <path>` (default `/auth/backchannel-logout`)
112
+ * with a form-body parser in its own scope, so nothing else in your app changes:
113
+ * `app.register(fastifyBackchannelLogoutPlugin, { issuer, clientId, onLogout })`.
114
+ */
115
+ function fastifyBackchannelLogoutPlugin(app, options, done) {
116
+ if (!app.hasContentTypeParser?.('application/x-www-form-urlencoded')) {
117
+ app.addContentTypeParser('application/x-www-form-urlencoded', { parseAs: 'string' }, (_req, body, cb) => cb(null, body));
118
+ }
119
+ app.post(options.path ?? '/auth/backchannel-logout', fastifyBackchannelLogout(options));
120
+ done?.();
121
+ }
122
+ // ---------------------------------------------------------------------------
123
+ // Next.js App Router (and any Fetch-API runtime: Remix, Hono, Workers, Bun, Deno)
124
+ /**
125
+ * A Fetch-API handler: in `app/api/auth/backchannel-logout/route.ts`,
126
+ * `export const POST = nextBackchannelLogout({ issuer, clientId, onLogout })`.
127
+ */
128
+ function nextBackchannelLogout(options) {
129
+ return async (request) => {
130
+ const text = await request.text().catch(() => '');
131
+ const out = await handleBackchannelLogout(text, options);
132
+ return new Response(out.body, { status: out.status, headers: out.headers });
133
+ };
134
+ }
135
+ /** Alias of {@link nextBackchannelLogout} for other Fetch-API frameworks. */
136
+ exports.fetchBackchannelLogout = nextBackchannelLogout;
137
+ //# sourceMappingURL=backchannel-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backchannel-handlers.js","sourceRoot":"","sources":["../src/backchannel-handlers.ts"],"names":[],"mappings":";;;AAuCA,0CAUC;AAqBD,0DAmBC;AAiCD,4DAcC;AAqBD,4DAKC;AAOD,wEAUC;AASD,sDAMC;AAlMD,iDAA8G;AAsC9G,0EAA0E;AAC1E,SAAgB,eAAe,CAAC,IAAa;IAC3C,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC;IAChG,IAAI,IAAI,YAAY,eAAe;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC;IAClF,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1G,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACrC,MAAM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AC;AAED,8EAA8E;AAC9E,kFAAkF;AAElF;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,OAAiC;IACrE,OAAO,KAAK,EAAE,OAAgB,EAAqB,EAAE;QACnD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,GAAG,GAAG,MAAM,uBAAuB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzD,OAAO,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC,CAAC;AACJ,CAAC;AAED,6EAA6E;AAChE,QAAA,sBAAsB,GAAG,qBAAqB,CAAC"}
@@ -75,12 +75,21 @@ export interface ConfigChangelogEntry {
75
75
  type: string;
76
76
  id: string | null;
77
77
  } | null;
78
- changes?: Array<{
78
+ /**
79
+ * Always present: one entry per changed field. On an older entry that recorded
80
+ * only field names, `values_recorded` is false and before/after are null.
81
+ */
82
+ changes: Array<{
79
83
  section: string;
80
84
  before: unknown;
81
85
  after: unknown;
86
+ values_recorded: boolean;
82
87
  }>;
83
- /** Changed field names, when no before/after was recorded. */
88
+ /** True when the write changed nothing. */
89
+ no_op: boolean;
90
+ /** What the source recorded: before/after values, field names only, or nothing. */
91
+ recorded: 'diff' | 'fields' | 'none';
92
+ /** @deprecated read `changes[].section`. */
84
93
  fields?: string[];
85
94
  }
86
95
  export interface ListConfigChangelogParams extends CursorParams {
@@ -88,6 +97,8 @@ export interface ListConfigChangelogParams extends CursorParams {
88
97
  action?: string;
89
98
  /** Only changes at or after this ISO-8601 date. */
90
99
  since?: string;
100
+ /** false = leave out writes that changed nothing. */
101
+ include_no_op?: boolean;
91
102
  }
92
103
  export declare function eventsResource(request: RequestFn): {
93
104
  /** The activity feed, newest first, cursor-paginated (limit up to 100). */
@@ -1 +1 @@
1
- {"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/client/activity.ts"],"names":[],"mappings":";;AA8EA,wCAOC;AAED,sCAOC;AAED,0DAaC;AA/BD,SAAgB,cAAc,CAAC,OAAkB;IAC/C,OAAO;QACL,2EAA2E;QAC3E,IAAI,CAAC,SAAmC,EAAE;YACxC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9E,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAAC,OAAkB;IAC9C,OAAO;QACL,0FAA0F;QAC1F,GAAG,CAAC,SAA4B,EAAE;YAChC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAAkB;IACxD,OAAO;QACL,IAAI,CACF,SAAoC,EAAE;YAOtC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QACxF,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/client/activity.ts"],"names":[],"mappings":";;AAwFA,wCAOC;AAED,sCAOC;AAED,0DAaC;AA/BD,SAAgB,cAAc,CAAC,OAAkB;IAC/C,OAAO;QACL,2EAA2E;QAC3E,IAAI,CAAC,SAAmC,EAAE;YACxC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9E,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAAC,OAAkB;IAC9C,OAAO;QACL,0FAA0F;QAC1F,GAAG,CAAC,SAA4B,EAAE;YAChC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAAkB;IACxD,OAAO;QACL,IAAI,CACF,SAAoC,EAAE;YAOtC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QACxF,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -3,6 +3,13 @@ import type { CursorPage, CursorParams } from './types';
3
3
  export interface AuditLog {
4
4
  object: 'audit_log';
5
5
  id: string;
6
+ /** Who acted; `key_name` names the secret or platform key when a key did. */
7
+ actor?: {
8
+ type: string;
9
+ id: string | null;
10
+ key_name: string | null;
11
+ key_prefix: string | null;
12
+ };
6
13
  actor_type: string;
7
14
  actor_id: string | null;
8
15
  action: string;
@@ -1 +1 @@
1
- {"version":3,"file":"audit-logs.js","sourceRoot":"","sources":["../../src/client/audit-logs.ts"],"names":[],"mappings":";;AAoBA,8CAMC;AAND,SAAgB,iBAAiB,CAAC,OAAkB;IAClD,OAAO;QACL,IAAI,CAAC,SAA8B,EAAE;YACnC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"audit-logs.js","sourceRoot":"","sources":["../../src/client/audit-logs.ts"],"names":[],"mappings":";;AAsBA,8CAMC;AAND,SAAgB,iBAAiB,CAAC,OAAkB;IAClD,OAAO;QACL,IAAI,CAAC,SAA8B,EAAE;YACnC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,216 @@
1
+ import { type QueryParams, type RequestFn } from './request';
2
+ import type { ListPage } from './types';
3
+ /** Provisioning tags on a resource (`?metadata[key]=value` filters lists). */
4
+ export type ProvisioningMetadata = Record<string, string | number | boolean>;
5
+ /** The provisioning fields every tagged resource carries. */
6
+ export interface ProvisioningFields {
7
+ metadata?: Record<string, unknown>;
8
+ /** Your idempotent-create key. */
9
+ external_ref?: string | null;
10
+ /** On a create that sent a ref: true when the existing object was returned (200, no secret). */
11
+ idempotent_replay?: boolean;
12
+ }
13
+ /** The create-body fields any provisioning create accepts. */
14
+ export interface ProvisioningInput {
15
+ metadata?: ProvisioningMetadata;
16
+ /** A stable key of your own: a repeat create with it returns the existing object. */
17
+ external_ref?: string;
18
+ }
19
+ /** `{ product: 'x' }` → `{ 'metadata[product]': 'x' }` for a list query. */
20
+ export declare function metadataQuery(filter: Record<string, string | number | boolean> | undefined): QueryParams;
21
+ export interface InstanceNotice {
22
+ object: 'instance_notice';
23
+ id: string;
24
+ date: string;
25
+ type: 'behavior_change' | 'deprecation' | 'new';
26
+ tags: Array<'breaking' | 'behaviour' | 'security'>;
27
+ title: string;
28
+ summary: string;
29
+ affects: string[];
30
+ docs_url: string;
31
+ changelog_id: string;
32
+ applies: boolean;
33
+ /** One sentence about this instance. */
34
+ detail: string | null;
35
+ count: number | null;
36
+ first_seen_at: number | null;
37
+ emailed_at: number | null;
38
+ acknowledged_at: number | null;
39
+ }
40
+ export interface SecurityAdvisory {
41
+ object: 'security_advisory';
42
+ id: string;
43
+ published: string;
44
+ severity: 'low' | 'medium' | 'high' | 'critical';
45
+ title: string;
46
+ summary: string;
47
+ affects: string[];
48
+ fixed_on: string;
49
+ action: string;
50
+ docs_url: string;
51
+ /** Absent on the public catalog. */
52
+ applies?: boolean;
53
+ detail?: string | null;
54
+ count?: number | null;
55
+ first_seen_at?: number | null;
56
+ emailed_at?: number | null;
57
+ acknowledged_at?: number | null;
58
+ }
59
+ export declare function noticesResource(request: RequestFn): {
60
+ /** Behaviour changes that affect this instance; `all: true` includes ones that do not apply. */
61
+ list(params?: {
62
+ all?: boolean;
63
+ }): Promise<ListPage<InstanceNotice> & {
64
+ unacknowledged: number;
65
+ changelog_url: string;
66
+ }>;
67
+ acknowledge(id: string): Promise<InstanceNotice>;
68
+ };
69
+ export declare function securityAdvisoriesResource(request: RequestFn): {
70
+ /** Every advisory, with whether it applies to this instance. */
71
+ list(): Promise<ListPage<SecurityAdvisory> & {
72
+ applying: number;
73
+ }>;
74
+ acknowledge(id: string): Promise<SecurityAdvisory>;
75
+ /** The public catalog (no instance data). */
76
+ catalog(): Promise<ListPage<SecurityAdvisory>>;
77
+ };
78
+ export interface SubProcessor {
79
+ object: 'sub_processor';
80
+ id: string;
81
+ name: string;
82
+ role: 'atlas_sub_processor' | 'engaged_by_you';
83
+ source: 'atlas' | 'integration' | 'referral_platform' | 'consent_manager' | 'email_provider' | 'sms_provider' | 'log_stream' | 'audit_export' | 'webhook_endpoint';
84
+ purpose: string;
85
+ data: string[];
86
+ location: string | null;
87
+ enabled_by: string | null;
88
+ url: string | null;
89
+ }
90
+ export interface SubProcessorList {
91
+ object: 'sub_processor_view';
92
+ instance_id: string;
93
+ roles: Record<string, string>;
94
+ data_region: string | null;
95
+ processor: {
96
+ name: string;
97
+ role: string;
98
+ url: string;
99
+ };
100
+ atlas_sub_processors: SubProcessor[];
101
+ engaged_by_you: SubProcessor[];
102
+ dpa_url: string;
103
+ }
104
+ export declare function subProcessorsResource(request: RequestFn): {
105
+ /** Who processes this instance's end-user data, and in which role. */
106
+ get(): Promise<SubProcessorList>;
107
+ };
108
+ export type AuditExportType = 'webhook' | 's3';
109
+ export interface AuditExport {
110
+ object: 'audit_export';
111
+ id: string;
112
+ name: string;
113
+ type: AuditExportType;
114
+ enabled: boolean;
115
+ status: 'active' | 'failing';
116
+ action_filter: string[] | null;
117
+ /** Non-secret fields plus has_* markers. */
118
+ destination: Record<string, string | boolean>;
119
+ cursor: {
120
+ id: string | null;
121
+ created_at: number | null;
122
+ };
123
+ consecutive_failures: number;
124
+ last_error: string | null;
125
+ last_delivered_at: number | null;
126
+ exported_count: number;
127
+ mandatory_actions: string[];
128
+ /** Webhook exports, on create and rotateSecret only. */
129
+ secret?: string;
130
+ created_at: number;
131
+ updated_at: number;
132
+ }
133
+ export type AuditExportDestination = {
134
+ url: string;
135
+ } | {
136
+ endpoint: string;
137
+ bucket: string;
138
+ region?: string;
139
+ prefix?: string;
140
+ access_key_id: string;
141
+ secret_access_key: string;
142
+ };
143
+ export interface CreateAuditExportBody {
144
+ name: string;
145
+ type: AuditExportType;
146
+ destination: AuditExportDestination;
147
+ /** Action names or prefixes; key and data-rights events are always exported. null = everything. */
148
+ action_filter?: string[] | null;
149
+ enabled?: boolean;
150
+ /** Also export the last N hours (0–720). */
151
+ backfill_hours?: number;
152
+ }
153
+ export interface UpdateAuditExportBody {
154
+ name?: string;
155
+ /** Merged; a secret left out is kept. */
156
+ destination?: Partial<Record<string, string>>;
157
+ action_filter?: string[] | null;
158
+ enabled?: boolean;
159
+ }
160
+ /** An audit entry as the export sends it (CloudEvents 1.0, structured JSON). */
161
+ export interface AuditCloudEvent {
162
+ specversion: '1.0';
163
+ id: string;
164
+ source: string;
165
+ /** `net.atlasauth.audit.<action>` */
166
+ type: string;
167
+ subject?: string;
168
+ time: string;
169
+ datacontenttype: 'application/json';
170
+ atlasinstance: string;
171
+ data: {
172
+ actor: {
173
+ type: string;
174
+ id: string | null;
175
+ key_name: string | null;
176
+ key_prefix: string | null;
177
+ };
178
+ action: string;
179
+ resource: {
180
+ type: string | null;
181
+ id: string | null;
182
+ } | null;
183
+ org: {
184
+ id: string;
185
+ } | null;
186
+ trace: string | null;
187
+ ip: string | null;
188
+ metadata: Record<string, unknown>;
189
+ };
190
+ }
191
+ export interface AuditExportTestResult {
192
+ object: 'audit_export_test';
193
+ id: string;
194
+ ok: boolean;
195
+ status: number | null;
196
+ error: string | null;
197
+ location: string | null;
198
+ event: AuditCloudEvent;
199
+ }
200
+ export declare function auditExportsResource(request: RequestFn): {
201
+ list(): Promise<ListPage<AuditExport> & {
202
+ mandatory_actions: string[];
203
+ }>;
204
+ get(id: string): Promise<AuditExport>;
205
+ /** A webhook export's signing secret is in this response only. */
206
+ create(body: CreateAuditExportBody, idempotencyKey?: string): Promise<AuditExport>;
207
+ update(id: string, body: UpdateAuditExportBody): Promise<AuditExport>;
208
+ delete(id: string): Promise<{
209
+ object: "audit_export";
210
+ id: string;
211
+ deleted: true;
212
+ }>;
213
+ /** Send one synthetic `audit_export.test` event now. */
214
+ test(id: string): Promise<AuditExportTestResult>;
215
+ rotateSecret(id: string): Promise<AuditExport>;
216
+ };
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.metadataQuery = metadataQuery;
4
+ exports.noticesResource = noticesResource;
5
+ exports.securityAdvisoriesResource = securityAdvisoriesResource;
6
+ exports.subProcessorsResource = subProcessorsResource;
7
+ exports.auditExportsResource = auditExportsResource;
8
+ const request_1 = require("./request");
9
+ /** `{ product: 'x' }` → `{ 'metadata[product]': 'x' }` for a list query. */
10
+ function metadataQuery(filter) {
11
+ const out = {};
12
+ for (const [k, v] of Object.entries(filter ?? {}))
13
+ out[`metadata[${k}]`] = String(v);
14
+ return out;
15
+ }
16
+ function noticesResource(request) {
17
+ return {
18
+ /** Behaviour changes that affect this instance; `all: true` includes ones that do not apply. */
19
+ list(params = {}) {
20
+ return request({ method: 'GET', path: '/v1/instance/notices', query: params.all ? { all: 'true' } : undefined });
21
+ },
22
+ acknowledge(id) {
23
+ return request({ method: 'POST', path: `/v1/instance/notices/${(0, request_1.enc)(id)}/acknowledge` });
24
+ },
25
+ };
26
+ }
27
+ function securityAdvisoriesResource(request) {
28
+ return {
29
+ /** Every advisory, with whether it applies to this instance. */
30
+ list() {
31
+ return request({ method: 'GET', path: '/v1/security_advisories' });
32
+ },
33
+ acknowledge(id) {
34
+ return request({ method: 'POST', path: `/v1/security_advisories/${(0, request_1.enc)(id)}/acknowledge` });
35
+ },
36
+ /** The public catalog (no instance data). */
37
+ catalog() {
38
+ return request({ method: 'GET', path: '/v1/public/security_advisories' });
39
+ },
40
+ };
41
+ }
42
+ function subProcessorsResource(request) {
43
+ return {
44
+ /** Who processes this instance's end-user data, and in which role. */
45
+ get() {
46
+ return request({ method: 'GET', path: '/v1/instance/sub_processors' });
47
+ },
48
+ };
49
+ }
50
+ function auditExportsResource(request) {
51
+ return {
52
+ list() {
53
+ return request({ method: 'GET', path: '/v1/audit_exports' });
54
+ },
55
+ get(id) {
56
+ return request({ method: 'GET', path: `/v1/audit_exports/${(0, request_1.enc)(id)}` });
57
+ },
58
+ /** A webhook export's signing secret is in this response only. */
59
+ create(body, idempotencyKey) {
60
+ return request({ method: 'POST', path: '/v1/audit_exports', body, idempotencyKey });
61
+ },
62
+ update(id, body) {
63
+ return request({ method: 'PATCH', path: `/v1/audit_exports/${(0, request_1.enc)(id)}`, body });
64
+ },
65
+ delete(id) {
66
+ return request({ method: 'DELETE', path: `/v1/audit_exports/${(0, request_1.enc)(id)}` });
67
+ },
68
+ /** Send one synthetic `audit_export.test` event now. */
69
+ test(id) {
70
+ return request({ method: 'POST', path: `/v1/audit_exports/${(0, request_1.enc)(id)}/test` });
71
+ },
72
+ rotateSecret(id) {
73
+ return request({ method: 'POST', path: `/v1/audit_exports/${(0, request_1.enc)(id)}/rotate_secret` });
74
+ },
75
+ };
76
+ }
77
+ //# sourceMappingURL=compliance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compliance.js","sourceRoot":"","sources":["../../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