@atlasauth/backend 0.18.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.
- package/CHANGELOG.md +32 -0
- package/dist/backchannel-handlers.d.ts +87 -0
- package/dist/backchannel-handlers.js +137 -0
- package/dist/backchannel-handlers.js.map +1 -0
- package/dist/client/activity.d.ts +13 -2
- package/dist/client/activity.js.map +1 -1
- package/dist/client/audit-logs.d.ts +7 -0
- package/dist/client/audit-logs.js.map +1 -1
- package/dist/client/compliance.d.ts +216 -0
- package/dist/client/compliance.js +77 -0
- package/dist/client/compliance.js.map +1 -0
- package/dist/client/credentials.d.ts +409 -0
- package/dist/client/credentials.js +158 -0
- package/dist/client/credentials.js.map +1 -0
- package/dist/client/data-subject-requests.d.ts +36 -1
- package/dist/client/data-subject-requests.js.map +1 -1
- package/dist/client/design.d.ts +48 -0
- package/dist/client/design.js +9 -0
- package/dist/client/design.js.map +1 -1
- package/dist/client/entitlement-overrides.d.ts +30 -0
- package/dist/client/entitlement-overrides.js +9 -0
- package/dist/client/entitlement-overrides.js.map +1 -1
- package/dist/client/env.d.ts +16 -0
- package/dist/client/env.js +38 -0
- package/dist/client/env.js.map +1 -0
- package/dist/client/error.d.ts +10 -0
- package/dist/client/error.js +4 -0
- package/dist/client/error.js.map +1 -1
- package/dist/client/index.d.ts +312 -7
- package/dist/client/index.js +39 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/instance.d.ts +401 -3
- package/dist/client/instance.js +77 -3
- package/dist/client/instance.js.map +1 -1
- package/dist/client/integrations.d.ts +107 -0
- package/dist/client/integrations.js +25 -0
- package/dist/client/integrations.js.map +1 -0
- package/dist/client/messaging.d.ts +18 -4
- package/dist/client/messaging.js +6 -2
- package/dist/client/messaging.js.map +1 -1
- package/dist/client/oauth-clients.d.ts +11 -3
- package/dist/client/oauth-clients.js +4 -2
- package/dist/client/oauth-clients.js.map +1 -1
- package/dist/client/operator.d.ts +100 -0
- package/dist/client/operator.js +132 -0
- package/dist/client/operator.js.map +1 -0
- package/dist/client/platform.d.ts +233 -9
- package/dist/client/platform.js +74 -6
- package/dist/client/platform.js.map +1 -1
- package/dist/client/privacy.d.ts +127 -0
- package/dist/client/privacy.js +44 -0
- package/dist/client/privacy.js.map +1 -0
- package/dist/client/referrals.d.ts +53 -6
- package/dist/client/referrals.js +9 -0
- package/dist/client/referrals.js.map +1 -1
- package/dist/client/request.d.ts +38 -1
- package/dist/client/request.js +6 -2
- package/dist/client/request.js.map +1 -1
- package/dist/client/sealed-box.d.ts +7 -0
- package/dist/client/sealed-box.js +62 -0
- package/dist/client/sealed-box.js.map +1 -0
- package/dist/client/sessions.d.ts +16 -5
- package/dist/client/sessions.js +7 -10
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/status.d.ts +200 -0
- package/dist/client/status.js +54 -0
- package/dist/client/status.js.map +1 -0
- package/dist/client/webhooks.d.ts +244 -11
- package/dist/client/webhooks.js +52 -3
- package/dist/client/webhooks.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/oidc.d.ts +65 -1
- package/dist/oidc.js +46 -0
- package/dist/oidc.js.map +1 -1
- package/dist/referral-test-calls.d.ts +26 -13
- package/dist/referral-test-calls.js +40 -14
- package/dist/referral-test-calls.js.map +1 -1
- package/dist/testing.d.ts +41 -6
- package/dist/testing.js +34 -2
- package/dist/testing.js.map +1 -1
- package/dist/webhooks.d.ts +8 -0
- package/dist/webhooks.js +13 -4
- package/dist/webhooks.js.map +1 -1
- package/package.json +6 -3
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type ProvisioningFields, type ProvisioningInput, type ProvisioningMetadata } from './compliance';
|
|
2
|
+
import type { KeyKind, StandardKey, Whoami } from './credentials';
|
|
1
3
|
import { type AtlasRequestSettings, type RequestFn, type UnknownFieldsEvent } from './request';
|
|
2
4
|
import type { ListPage } from './types';
|
|
3
5
|
import type { BackchannelDeliveriesQuery, BackchannelLogoutDeliveryPage, BackchannelLogoutTest } from './oauth-clients';
|
|
@@ -13,6 +15,28 @@ export interface AtlasIdAppPreflight {
|
|
|
13
15
|
checked_at: number;
|
|
14
16
|
user_count: number;
|
|
15
17
|
findings: PreflightFinding[];
|
|
18
|
+
/** The page origins the Sign in with Atlas button script ran on in the last 7 days. */
|
|
19
|
+
button_rendered_origins?: {
|
|
20
|
+
origin: string;
|
|
21
|
+
last_seen_at: number;
|
|
22
|
+
requests: number;
|
|
23
|
+
}[];
|
|
24
|
+
/** How the last 7 days' sign-ins started: the rendered button, the script API, One Tap, the no-script fallback, or unmarked. */
|
|
25
|
+
authorize_requests_7d?: {
|
|
26
|
+
button: number;
|
|
27
|
+
js: number;
|
|
28
|
+
fedcm: number;
|
|
29
|
+
fallback: number;
|
|
30
|
+
unmarked: number;
|
|
31
|
+
};
|
|
32
|
+
/** Origins of sign-ins that came through the no-script fallback link (`?atlasid_fallback=1`). */
|
|
33
|
+
fallback_origins?: {
|
|
34
|
+
origin: string;
|
|
35
|
+
last_seen_at: number;
|
|
36
|
+
requests: number;
|
|
37
|
+
}[];
|
|
38
|
+
/** Whether the app's homepage references the button script (null = could not check). */
|
|
39
|
+
homepage_includes_script?: boolean | null;
|
|
16
40
|
}
|
|
17
41
|
/**
|
|
18
42
|
* The platform client: the platform-key (`psk_...`) surface for provisioning and
|
|
@@ -22,8 +46,14 @@ export interface AtlasIdAppPreflight {
|
|
|
22
46
|
* platform key manages many apps, a secret key manages exactly one instance.
|
|
23
47
|
*/
|
|
24
48
|
export interface AtlasPlatformClientConfig {
|
|
25
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The platform key (`atlas_live_psk_…` or legacy `psk_…`), or a one-hour
|
|
51
|
+
* platform-bound access token from `exchangeOperatorToken`. Sent as
|
|
52
|
+
* `Authorization: Bearer <key>`; never logged.
|
|
53
|
+
*/
|
|
26
54
|
platformKey: string;
|
|
55
|
+
/** Sealed secret delivery (`x25519:<public key>`); see AtlasClientConfig.secretRecipient. */
|
|
56
|
+
secretRecipient?: string;
|
|
27
57
|
/** Base URL of the API, e.g. `https://api.atlasauth.net`. */
|
|
28
58
|
apiUrl?: string;
|
|
29
59
|
/** Injectable `fetch`, for tests and non-global-fetch runtimes. */
|
|
@@ -34,7 +64,7 @@ export interface AtlasPlatformClientConfig {
|
|
|
34
64
|
onUnknownFields?: (event: UnknownFieldsEvent) => void;
|
|
35
65
|
}
|
|
36
66
|
/** An app (instance) a platform owns. Never carries a secret. */
|
|
37
|
-
export interface PlatformApp {
|
|
67
|
+
export interface PlatformApp extends ProvisioningFields {
|
|
38
68
|
object: 'app';
|
|
39
69
|
id: string;
|
|
40
70
|
name: string;
|
|
@@ -86,12 +116,17 @@ export interface CreatePlatformAppBody {
|
|
|
86
116
|
/** Default true: also provision a test-mode sibling instance. */
|
|
87
117
|
create_development_sibling?: boolean;
|
|
88
118
|
tags?: string[];
|
|
119
|
+
metadata?: ProvisioningMetadata;
|
|
120
|
+
/** A stable key of your own: a repeat create with it returns the existing app (200, no secret). */
|
|
121
|
+
external_ref?: string;
|
|
89
122
|
}
|
|
90
123
|
export interface UpdatePlatformAppBody {
|
|
91
124
|
name?: string;
|
|
92
125
|
/** Origin strings, or `{ origin, integration }` entries (`redirect` | `embedded` | `auto`). */
|
|
93
126
|
allowed_origins?: AllowedOriginInput[];
|
|
94
127
|
tags?: string[];
|
|
128
|
+
/** Replaces the provisioning metadata. */
|
|
129
|
+
metadata?: ProvisioningMetadata;
|
|
95
130
|
}
|
|
96
131
|
export interface ListPlatformAppsParams {
|
|
97
132
|
/** Only apps carrying this tag. */
|
|
@@ -100,8 +135,10 @@ export interface ListPlatformAppsParams {
|
|
|
100
135
|
archived?: boolean;
|
|
101
136
|
/** `true`: include archived apps alongside active ones. */
|
|
102
137
|
include_archived?: boolean;
|
|
138
|
+
/** Only apps whose provisioning metadata matches every pair. */
|
|
139
|
+
metadata?: ProvisioningMetadata;
|
|
103
140
|
}
|
|
104
|
-
export interface CreatePlatformInstanceBody {
|
|
141
|
+
export interface CreatePlatformInstanceBody extends ProvisioningInput {
|
|
105
142
|
environment?: 'production' | 'development';
|
|
106
143
|
/** Origin strings, or `{ origin, integration }` entries (`redirect` | `embedded` | `auto`). */
|
|
107
144
|
allowed_origins?: AllowedOriginInput[];
|
|
@@ -145,9 +182,10 @@ export interface RotateAtlasIdAppSecretBody {
|
|
|
145
182
|
overlap_seconds?: number;
|
|
146
183
|
}
|
|
147
184
|
/** Metadata of a currently-valid secret key. Never the secret itself. */
|
|
148
|
-
export interface PlatformSecretKey {
|
|
185
|
+
export interface PlatformSecretKey extends ProvisioningFields {
|
|
149
186
|
object: 'secret_key';
|
|
150
187
|
id: string;
|
|
188
|
+
name?: string | null;
|
|
151
189
|
prefix: string;
|
|
152
190
|
created_at: number;
|
|
153
191
|
expires_at?: number | null;
|
|
@@ -162,11 +200,70 @@ export interface PlatformAppTransfer {
|
|
|
162
200
|
}
|
|
163
201
|
export interface PlatformAppBulkDeleteResult {
|
|
164
202
|
object: 'bulk_delete_result';
|
|
203
|
+
/** `disable` (ids) or `hard_delete` (a sandbox metadata selection). */
|
|
204
|
+
mode?: 'disable' | 'hard_delete';
|
|
205
|
+
dry_run?: boolean;
|
|
165
206
|
results: Array<{
|
|
166
207
|
id: string;
|
|
208
|
+
type?: string;
|
|
209
|
+
instance_id?: string;
|
|
167
210
|
deleted: boolean;
|
|
168
211
|
reason?: string;
|
|
169
212
|
}>;
|
|
213
|
+
changes?: Array<{
|
|
214
|
+
section: string;
|
|
215
|
+
before: unknown;
|
|
216
|
+
after: unknown;
|
|
217
|
+
}>;
|
|
218
|
+
}
|
|
219
|
+
/** A sandbox teardown selection: must carry `sandbox: true`. */
|
|
220
|
+
export interface SandboxTeardownBody {
|
|
221
|
+
metadata: ProvisioningMetadata;
|
|
222
|
+
dry_run?: boolean;
|
|
223
|
+
}
|
|
224
|
+
/** A named, tagged extra secret key for an app. */
|
|
225
|
+
export interface CreatePlatformSecretKeyBody extends ProvisioningInput {
|
|
226
|
+
name?: string;
|
|
227
|
+
/** Any instance of the same app; default the app's own. */
|
|
228
|
+
instance_id?: string;
|
|
229
|
+
}
|
|
230
|
+
export interface CreatedPlatformSecretKey extends PlatformSecretKey {
|
|
231
|
+
app_id: string;
|
|
232
|
+
instance_id: string;
|
|
233
|
+
/** Present only on a fresh create (never on an idempotent replay). */
|
|
234
|
+
secret?: string;
|
|
235
|
+
note?: string;
|
|
236
|
+
}
|
|
237
|
+
export interface CloneConfigBody {
|
|
238
|
+
/** Default `development`. */
|
|
239
|
+
to_environment?: 'development' | 'production';
|
|
240
|
+
target_instance_id?: string;
|
|
241
|
+
/** Default auth_config, roles, redirect_urls. */
|
|
242
|
+
sections?: Array<'auth_config' | 'allowed_origins' | 'roles' | 'redirect_urls'>;
|
|
243
|
+
include_origins?: boolean;
|
|
244
|
+
dry_run?: boolean;
|
|
245
|
+
}
|
|
246
|
+
export interface CloneConfigResult {
|
|
247
|
+
object: 'clone_config_result' | 'dry_run';
|
|
248
|
+
source_instance_id: string;
|
|
249
|
+
target_instance_id: string | null;
|
|
250
|
+
to_environment: string;
|
|
251
|
+
created_target: boolean;
|
|
252
|
+
sections: string[];
|
|
253
|
+
excluded: Array<{
|
|
254
|
+
path: string;
|
|
255
|
+
reason: 'secret' | 'instance_specific';
|
|
256
|
+
}>;
|
|
257
|
+
never_copied: string[];
|
|
258
|
+
changes: Array<{
|
|
259
|
+
section: string;
|
|
260
|
+
before: unknown;
|
|
261
|
+
after: unknown;
|
|
262
|
+
}>;
|
|
263
|
+
target?: PlatformApp | null;
|
|
264
|
+
/** When a new instance was created for the clone: its secret key, shown once. */
|
|
265
|
+
secret?: string;
|
|
266
|
+
note?: string;
|
|
170
267
|
}
|
|
171
268
|
export interface AccountlessApp {
|
|
172
269
|
object: 'accountless_app';
|
|
@@ -231,7 +328,7 @@ export interface AtlasIdAppBrandingInput {
|
|
|
231
328
|
copy?: AtlasIdAppCopy;
|
|
232
329
|
}
|
|
233
330
|
/** A Sign in with Atlas app: an OpenID Connect client on the Atlas issuer. */
|
|
234
|
-
export interface AtlasIdApp {
|
|
331
|
+
export interface AtlasIdApp extends ProvisioningFields {
|
|
235
332
|
object: 'atlas_id_app';
|
|
236
333
|
id: string;
|
|
237
334
|
client_id: string;
|
|
@@ -346,7 +443,7 @@ interface AtlasIdAppFields {
|
|
|
346
443
|
allowed_scopes?: string[];
|
|
347
444
|
branding?: AtlasIdAppBrandingInput | null;
|
|
348
445
|
}
|
|
349
|
-
export interface CreateAtlasIdAppBody extends AtlasIdAppFields {
|
|
446
|
+
export interface CreateAtlasIdAppBody extends AtlasIdAppFields, ProvisioningInput {
|
|
350
447
|
name: string;
|
|
351
448
|
redirect_uris: string[];
|
|
352
449
|
/** Default `confidential`. */
|
|
@@ -354,6 +451,8 @@ export interface CreateAtlasIdAppBody extends AtlasIdAppFields {
|
|
|
354
451
|
}
|
|
355
452
|
export interface UpdateAtlasIdAppBody extends AtlasIdAppFields {
|
|
356
453
|
name?: string;
|
|
454
|
+
/** Replaces the provisioning metadata. */
|
|
455
|
+
metadata?: ProvisioningMetadata;
|
|
357
456
|
redirect_uris?: string[];
|
|
358
457
|
/**
|
|
359
458
|
* Per-app webhook (public https): user.updated, user.deleted and grant.revoked for
|
|
@@ -361,7 +460,117 @@ export interface UpdateAtlasIdAppBody extends AtlasIdAppFields {
|
|
|
361
460
|
*/
|
|
362
461
|
webhook_url?: string | null;
|
|
363
462
|
}
|
|
463
|
+
export interface AccountAuditRecord {
|
|
464
|
+
object: 'account_audit_log';
|
|
465
|
+
id: string;
|
|
466
|
+
account_id: string;
|
|
467
|
+
actor: {
|
|
468
|
+
type: string;
|
|
469
|
+
id: string | null;
|
|
470
|
+
};
|
|
471
|
+
action: string;
|
|
472
|
+
target: {
|
|
473
|
+
type: string | null;
|
|
474
|
+
id: string | null;
|
|
475
|
+
};
|
|
476
|
+
instance_id: string | null;
|
|
477
|
+
ip: string | null;
|
|
478
|
+
user_agent: string | null;
|
|
479
|
+
metadata: Record<string, unknown>;
|
|
480
|
+
created_at: number;
|
|
481
|
+
}
|
|
482
|
+
export interface AccountAuditStream {
|
|
483
|
+
object: 'account_audit_stream';
|
|
484
|
+
id: string;
|
|
485
|
+
url: string;
|
|
486
|
+
format: 'atlas' | 'cloudevents';
|
|
487
|
+
active: boolean;
|
|
488
|
+
has_secret: true;
|
|
489
|
+
cursor: string | null;
|
|
490
|
+
consecutive_failures: number;
|
|
491
|
+
failing_since: number | null;
|
|
492
|
+
next_attempt_at: number | null;
|
|
493
|
+
last_delivered_at: number | null;
|
|
494
|
+
last_error: string | null;
|
|
495
|
+
created_at: number;
|
|
496
|
+
updated_at: number;
|
|
497
|
+
}
|
|
364
498
|
declare function platformNamespaces(request: RequestFn): {
|
|
499
|
+
/** Introspect the platform key / token this client uses. */
|
|
500
|
+
whoami(): Promise<Whoami>;
|
|
501
|
+
/** Every credential on the account (incl. revoked), and minting/revoking them. */
|
|
502
|
+
keys: {
|
|
503
|
+
list(params?: {
|
|
504
|
+
kind?: KeyKind;
|
|
505
|
+
status?: StandardKey["status"];
|
|
506
|
+
instance_id?: string;
|
|
507
|
+
}): Promise<ListPage<StandardKey>>;
|
|
508
|
+
/** Scopes ⊆ the caller's; per-app grant scopes `atlas_id_apps:<app id>:grants:read|write` allowed. */
|
|
509
|
+
create(body: {
|
|
510
|
+
scopes: string[];
|
|
511
|
+
name?: string;
|
|
512
|
+
application_ids?: string[];
|
|
513
|
+
expires_at?: number | string;
|
|
514
|
+
ip_allowlist?: string[];
|
|
515
|
+
owner?: string;
|
|
516
|
+
key_format?: "atlas" | "legacy";
|
|
517
|
+
}): Promise<{
|
|
518
|
+
object: "platform_api_key";
|
|
519
|
+
id: string;
|
|
520
|
+
prefix: string;
|
|
521
|
+
scopes: string[];
|
|
522
|
+
secret?: string;
|
|
523
|
+
sealed_secret?: string;
|
|
524
|
+
}>;
|
|
525
|
+
update(id: string, body: {
|
|
526
|
+
name?: string | null;
|
|
527
|
+
owner?: string | null;
|
|
528
|
+
expires_at?: number | string | null;
|
|
529
|
+
}): Promise<{
|
|
530
|
+
object: "platform_api_key";
|
|
531
|
+
id: string;
|
|
532
|
+
}>;
|
|
533
|
+
revoke(id: string): Promise<{
|
|
534
|
+
object: "key";
|
|
535
|
+
id: string;
|
|
536
|
+
kind: KeyKind;
|
|
537
|
+
revoked: true;
|
|
538
|
+
}>;
|
|
539
|
+
};
|
|
540
|
+
/** The account audit log and its streams. */
|
|
541
|
+
audit: {
|
|
542
|
+
list(params?: {
|
|
543
|
+
limit?: number;
|
|
544
|
+
starting_after?: string;
|
|
545
|
+
action?: string;
|
|
546
|
+
}): Promise<ListPage<AccountAuditRecord>>;
|
|
547
|
+
streams: {
|
|
548
|
+
list(): Promise<ListPage<AccountAuditStream>>;
|
|
549
|
+
create(body: {
|
|
550
|
+
url: string;
|
|
551
|
+
format?: "atlas" | "cloudevents";
|
|
552
|
+
}): Promise<AccountAuditStream & {
|
|
553
|
+
secret?: string;
|
|
554
|
+
sealed_secret?: string;
|
|
555
|
+
}>;
|
|
556
|
+
update(id: string, body: {
|
|
557
|
+
url?: string;
|
|
558
|
+
format?: "atlas" | "cloudevents";
|
|
559
|
+
active?: boolean;
|
|
560
|
+
}): Promise<AccountAuditStream>;
|
|
561
|
+
delete(id: string): Promise<{
|
|
562
|
+
object: "account_audit_stream";
|
|
563
|
+
id: string;
|
|
564
|
+
deleted: true;
|
|
565
|
+
}>;
|
|
566
|
+
test(id: string): Promise<{
|
|
567
|
+
id: string;
|
|
568
|
+
ok: boolean;
|
|
569
|
+
status: number | null;
|
|
570
|
+
error?: string;
|
|
571
|
+
}>;
|
|
572
|
+
};
|
|
573
|
+
};
|
|
365
574
|
apps: {
|
|
366
575
|
/** Archived apps are hidden unless `include_archived` or `archived` is set. */
|
|
367
576
|
list(params?: ListPlatformAppsParams): Promise<ListPage<PlatformApp>>;
|
|
@@ -377,7 +586,18 @@ declare function platformNamespaces(request: RequestFn): {
|
|
|
377
586
|
note: string;
|
|
378
587
|
}>;
|
|
379
588
|
/** Disable up to 100 apps; ids you do not own are skipped as `not_found`. */
|
|
380
|
-
bulkDelete(ids: string[]): Promise<PlatformAppBulkDeleteResult>;
|
|
589
|
+
bulkDelete(ids: string[] | SandboxTeardownBody): Promise<PlatformAppBulkDeleteResult>;
|
|
590
|
+
/**
|
|
591
|
+
* Hard delete every sandbox-tagged app and resource of this platform
|
|
592
|
+
* (`{ sandbox: true }` must be in the selection). `dry_run` lists what would go.
|
|
593
|
+
*/
|
|
594
|
+
sandboxTeardown(metadata?: ProvisioningMetadata, opts?: {
|
|
595
|
+
dryRun?: boolean;
|
|
596
|
+
}): Promise<PlatformAppBulkDeleteResult>;
|
|
597
|
+
/** Copy an app's configuration into its development (or another) instance, secrets excluded. */
|
|
598
|
+
cloneConfig(id: string, body?: CloneConfigBody, idempotencyKey?: string): Promise<CloneConfigResult>;
|
|
599
|
+
/** Mint an additional named, taggable secret key (shown once; `external_ref` makes it idempotent). */
|
|
600
|
+
createSecretKey(id: string, body?: CreatePlatformSecretKeyBody, idempotencyKey?: string): Promise<CreatedPlatformSecretKey>;
|
|
381
601
|
/** Hide from the default listing. Does not disable the app. */
|
|
382
602
|
archive(id: string): Promise<PlatformApp>;
|
|
383
603
|
unarchive(id: string): Promise<PlatformApp>;
|
|
@@ -387,7 +607,9 @@ declare function platformNamespaces(request: RequestFn): {
|
|
|
387
607
|
*/
|
|
388
608
|
rotateSecret(id: string, body?: RotatePlatformSecretBody, idempotencyKey?: string): Promise<PlatformAppSecretRotation>;
|
|
389
609
|
/** Currently-valid secret keys (metadata only). */
|
|
390
|
-
secretKeys(id: string
|
|
610
|
+
secretKeys(id: string, params?: {
|
|
611
|
+
metadata?: ProvisioningMetadata;
|
|
612
|
+
}): Promise<ListPage<PlatformSecretKey>>;
|
|
391
613
|
instances: {
|
|
392
614
|
list(appId: string): Promise<ListPage<PlatformApp>>;
|
|
393
615
|
/** Add an instance (e.g. development beside production); secret revealed once. */
|
|
@@ -415,7 +637,9 @@ declare function platformNamespaces(request: RequestFn): {
|
|
|
415
637
|
};
|
|
416
638
|
/** Sign in with Atlas apps registered to the platform's account. */
|
|
417
639
|
atlasIdApps: {
|
|
418
|
-
list(
|
|
640
|
+
list(params?: {
|
|
641
|
+
metadata?: ProvisioningMetadata;
|
|
642
|
+
}): Promise<AtlasIdAppList>;
|
|
419
643
|
/** Register an app. A confidential app's `client_secret` is returned exactly once. */
|
|
420
644
|
create(body: CreateAtlasIdAppBody, idempotencyKey?: string): Promise<AtlasIdAppWithSecret>;
|
|
421
645
|
get(id: string): Promise<AtlasIdApp>;
|
package/dist/client/platform.js
CHANGED
|
@@ -1,14 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAtlasPlatformClient = createAtlasPlatformClient;
|
|
4
|
+
const compliance_1 = require("./compliance");
|
|
4
5
|
const request_1 = require("./request");
|
|
5
6
|
// ---- the client ----------------------------------------------------------------
|
|
6
7
|
function platformNamespaces(request) {
|
|
7
8
|
return {
|
|
9
|
+
/** Introspect the platform key / token this client uses. */
|
|
10
|
+
whoami() {
|
|
11
|
+
return request({ method: 'GET', path: '/v1/platform/whoami' });
|
|
12
|
+
},
|
|
13
|
+
/** Every credential on the account (incl. revoked), and minting/revoking them. */
|
|
14
|
+
keys: {
|
|
15
|
+
list(params = {}) {
|
|
16
|
+
return request({ method: 'GET', path: '/v1/platform/keys', query: { ...params } });
|
|
17
|
+
},
|
|
18
|
+
/** Scopes ⊆ the caller's; per-app grant scopes `atlas_id_apps:<app id>:grants:read|write` allowed. */
|
|
19
|
+
create(body) {
|
|
20
|
+
return request({ method: 'POST', path: '/v1/platform/keys', body });
|
|
21
|
+
},
|
|
22
|
+
update(id, body) {
|
|
23
|
+
return request({ method: 'PATCH', path: `/v1/platform/keys/${(0, request_1.enc)(id)}`, body });
|
|
24
|
+
},
|
|
25
|
+
revoke(id) {
|
|
26
|
+
return request({ method: 'POST', path: `/v1/platform/keys/${(0, request_1.enc)(id)}/revoke` });
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
/** The account audit log and its streams. */
|
|
30
|
+
audit: {
|
|
31
|
+
list(params = {}) {
|
|
32
|
+
return request({ method: 'GET', path: '/v1/platform/audit_logs', query: { ...params } });
|
|
33
|
+
},
|
|
34
|
+
streams: {
|
|
35
|
+
list() {
|
|
36
|
+
return request({ method: 'GET', path: '/v1/platform/audit_streams' });
|
|
37
|
+
},
|
|
38
|
+
create(body) {
|
|
39
|
+
return request({ method: 'POST', path: '/v1/platform/audit_streams', body });
|
|
40
|
+
},
|
|
41
|
+
update(id, body) {
|
|
42
|
+
return request({ method: 'PATCH', path: `/v1/platform/audit_streams/${(0, request_1.enc)(id)}`, body });
|
|
43
|
+
},
|
|
44
|
+
delete(id) {
|
|
45
|
+
return request({ method: 'DELETE', path: `/v1/platform/audit_streams/${(0, request_1.enc)(id)}` });
|
|
46
|
+
},
|
|
47
|
+
test(id) {
|
|
48
|
+
return request({ method: 'POST', path: `/v1/platform/audit_streams/${(0, request_1.enc)(id)}/test` });
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
8
52
|
apps: {
|
|
9
53
|
/** Archived apps are hidden unless `include_archived` or `archived` is set. */
|
|
10
54
|
list(params = {}) {
|
|
11
|
-
|
|
55
|
+
const { metadata, ...rest } = params;
|
|
56
|
+
return request({ method: 'GET', path: '/v1/platform/apps', query: { ...rest, ...(0, compliance_1.metadataQuery)(metadata) } });
|
|
12
57
|
},
|
|
13
58
|
/** Provision an app; its secret key is revealed exactly once. */
|
|
14
59
|
create(body = {}, idempotencyKey) {
|
|
@@ -26,7 +71,30 @@ function platformNamespaces(request) {
|
|
|
26
71
|
},
|
|
27
72
|
/** Disable up to 100 apps; ids you do not own are skipped as `not_found`. */
|
|
28
73
|
bulkDelete(ids) {
|
|
29
|
-
return request({
|
|
74
|
+
return request({
|
|
75
|
+
method: 'POST',
|
|
76
|
+
path: '/v1/platform/apps/bulk_delete',
|
|
77
|
+
body: Array.isArray(ids) ? { ids } : ids,
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Hard delete every sandbox-tagged app and resource of this platform
|
|
82
|
+
* (`{ sandbox: true }` must be in the selection). `dry_run` lists what would go.
|
|
83
|
+
*/
|
|
84
|
+
sandboxTeardown(metadata = { sandbox: true }, opts = {}) {
|
|
85
|
+
return request({
|
|
86
|
+
method: 'POST',
|
|
87
|
+
path: '/v1/platform/apps/bulk_delete',
|
|
88
|
+
body: { metadata, ...(opts.dryRun ? { dry_run: true } : {}) },
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
/** Copy an app's configuration into its development (or another) instance, secrets excluded. */
|
|
92
|
+
cloneConfig(id, body = {}, idempotencyKey) {
|
|
93
|
+
return request({ method: 'POST', path: `/v1/platform/apps/${(0, request_1.enc)(id)}/clone_config`, body, idempotencyKey });
|
|
94
|
+
},
|
|
95
|
+
/** Mint an additional named, taggable secret key (shown once; `external_ref` makes it idempotent). */
|
|
96
|
+
createSecretKey(id, body = {}, idempotencyKey) {
|
|
97
|
+
return request({ method: 'POST', path: `/v1/platform/apps/${(0, request_1.enc)(id)}/secret_keys`, body, idempotencyKey });
|
|
30
98
|
},
|
|
31
99
|
/** Hide from the default listing. Does not disable the app. */
|
|
32
100
|
archive(id) {
|
|
@@ -48,8 +116,8 @@ function platformNamespaces(request) {
|
|
|
48
116
|
});
|
|
49
117
|
},
|
|
50
118
|
/** Currently-valid secret keys (metadata only). */
|
|
51
|
-
secretKeys(id) {
|
|
52
|
-
return request({ method: 'GET', path: `/v1/platform/apps/${(0, request_1.enc)(id)}/secret_keys
|
|
119
|
+
secretKeys(id, params = {}) {
|
|
120
|
+
return request({ method: 'GET', path: `/v1/platform/apps/${(0, request_1.enc)(id)}/secret_keys`, query: (0, compliance_1.metadataQuery)(params.metadata) });
|
|
53
121
|
},
|
|
54
122
|
instances: {
|
|
55
123
|
list(appId) {
|
|
@@ -120,8 +188,8 @@ function platformNamespaces(request) {
|
|
|
120
188
|
},
|
|
121
189
|
/** Sign in with Atlas apps registered to the platform's account. */
|
|
122
190
|
atlasIdApps: {
|
|
123
|
-
list() {
|
|
124
|
-
return request({ method: 'GET', path: '/v1/platform/atlas_id_apps' });
|
|
191
|
+
list(params = {}) {
|
|
192
|
+
return request({ method: 'GET', path: '/v1/platform/atlas_id_apps', query: (0, compliance_1.metadataQuery)(params.metadata) });
|
|
125
193
|
},
|
|
126
194
|
/** Register an app. A confidential app's `client_secret` is returned exactly once. */
|
|
127
195
|
create(body, idempotencyKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/client/platform.ts"],"names":[],"mappings":";;AAwsBA,8DAWC;AAntBD,uCAMmB;AAoZnB,mFAAmF;AAEnF,SAAS,kBAAkB,CAAC,OAAkB;IAC5C,OAAO;QACL,IAAI,EAAE;YACJ,+EAA+E;YAC/E,IAAI,CAAC,SAAiC,EAAE;gBACtC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;YACrF,CAAC;YACD,iEAAiE;YACjE,MAAM,CAAC,OAA8B,EAAE,EAAE,cAAuB;gBAC9D,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;YACtF,CAAC;YACD,GAAG,CAAC,EAAU;gBACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1E,CAAC;YACD,MAAM,CAAC,EAAU,EAAE,IAA2B;gBAC5C,OAAO,OAAO,CAAC,EAAE,MAAM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AAC,IAAqB,EAAE,UAAoC,EAAE;gBAClE,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,4BAA4B;oBAClC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;oBAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE;iBACpD,CAAC,CAAC;YACL,CAAC;YACD,IAAI;gBACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC,CAAC;YACxE,CAAC;YACD,+DAA+D;YAC/D,MAAM,CAAC,OAAe;gBACpB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,8BAA8B,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3F,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAUD,SAAgB,yBAAyB,CAAC,MAAiC;IACzE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,4BAAkB,EAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/D,OAAO;QACL,GAAG,kBAAkB,CAAC,OAAO,CAAC;QAC9B,WAAW,CAAC,SAA+B;YACzC,OAAO,yBAAyB,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type RequestFn } from './request';
|
|
2
|
+
/**
|
|
3
|
+
* The data-rights executor protocol (v2) — the routes any DSAR orchestrator
|
|
4
|
+
* calls to find a person and carry out a request against their identity data
|
|
5
|
+
* (needs a key with `privacy:execute`) — and the instance's own data-rights
|
|
6
|
+
* orchestrator, where Atlas opens a case when an account deletion is scheduled
|
|
7
|
+
* (needs `instance:read` / `instance:write`).
|
|
8
|
+
*/
|
|
9
|
+
export type PrivacyCanonicalType = 'access' | 'deletion' | 'closure' | 'restriction' | 'rectification';
|
|
10
|
+
export type PrivacyRequestStatus = 'pending' | 'scheduled' | 'processing' | 'completed' | 'completed_with_retention' | 'rejected' | 'no_match' | 'cancelled';
|
|
11
|
+
export interface PrivacySubject {
|
|
12
|
+
iss?: string;
|
|
13
|
+
sub?: string;
|
|
14
|
+
ext?: string;
|
|
15
|
+
principal?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PrivacyLookupResult {
|
|
18
|
+
object: 'privacy_lookup';
|
|
19
|
+
status: 'found' | 'no_match';
|
|
20
|
+
subjectId: string | null;
|
|
21
|
+
matchedBy: 'atlas.sub' | 'atlas.ext' | 'email' | 'email_unverified' | null;
|
|
22
|
+
detail: string | null;
|
|
23
|
+
principal?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface PrivacyRequest {
|
|
26
|
+
object: 'privacy_request';
|
|
27
|
+
id: string;
|
|
28
|
+
type: PrivacyCanonicalType;
|
|
29
|
+
canonicalType: PrivacyCanonicalType;
|
|
30
|
+
requestedType: string;
|
|
31
|
+
status: PrivacyRequestStatus;
|
|
32
|
+
subjectId: string;
|
|
33
|
+
caseId: string | null;
|
|
34
|
+
executeAfter: string | null;
|
|
35
|
+
eta: string | null;
|
|
36
|
+
detail: string | null;
|
|
37
|
+
retention: Array<{
|
|
38
|
+
category: string;
|
|
39
|
+
basis: string;
|
|
40
|
+
until: string;
|
|
41
|
+
}>;
|
|
42
|
+
steps: Array<{
|
|
43
|
+
name: string;
|
|
44
|
+
status: string;
|
|
45
|
+
reason?: string;
|
|
46
|
+
at?: number;
|
|
47
|
+
}>;
|
|
48
|
+
trace: string | null;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
completedAt: string | null;
|
|
52
|
+
/** On `getRequest` once done. */
|
|
53
|
+
result?: unknown;
|
|
54
|
+
}
|
|
55
|
+
export interface CreatePrivacyRequestBody {
|
|
56
|
+
subjectId: string;
|
|
57
|
+
type: PrivacyCanonicalType | 'export' | 'erasure' | 'erase';
|
|
58
|
+
caseId: string;
|
|
59
|
+
/** ISO 8601 or epoch ms: nothing is erased before it. */
|
|
60
|
+
executeAfter?: string | number;
|
|
61
|
+
reason?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface PrivacyOrchestrator {
|
|
64
|
+
object: 'privacy_orchestrator';
|
|
65
|
+
configured: boolean;
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
provider: string | null;
|
|
68
|
+
name: string | null;
|
|
69
|
+
case_url: string | null;
|
|
70
|
+
cancel_url: string | null;
|
|
71
|
+
auth_header: string;
|
|
72
|
+
auth_scheme: string;
|
|
73
|
+
api_key_set: boolean;
|
|
74
|
+
signing_secret_set: boolean;
|
|
75
|
+
use_partner_link: boolean;
|
|
76
|
+
open_closure_cases: boolean;
|
|
77
|
+
completion_webhook: Record<string, unknown> | null;
|
|
78
|
+
last_case_at: number | null;
|
|
79
|
+
last_error: string | null;
|
|
80
|
+
last_error_at: number | null;
|
|
81
|
+
presets: Array<Record<string, unknown>>;
|
|
82
|
+
/** Only on the write that minted it. */
|
|
83
|
+
signing_secret?: string;
|
|
84
|
+
/** Only on the write that created the completion endpoint. */
|
|
85
|
+
completion_webhook_secret?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface PrivacyOrchestratorInput {
|
|
88
|
+
/** A preset id (`cookiemunch`, `custom`) or your own lower-case id. */
|
|
89
|
+
provider?: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
enabled?: boolean;
|
|
92
|
+
case_url?: string | null;
|
|
93
|
+
/** Must contain `{id}`. */
|
|
94
|
+
cancel_url?: string | null;
|
|
95
|
+
auth_header?: string;
|
|
96
|
+
auth_scheme?: 'bearer' | 'raw';
|
|
97
|
+
api_key?: string | null;
|
|
98
|
+
/** Call through the partner link the orchestrator granted Atlas (partner id = provider). */
|
|
99
|
+
use_partner_link?: boolean;
|
|
100
|
+
open_closure_cases?: boolean;
|
|
101
|
+
sign_requests?: boolean;
|
|
102
|
+
completion_webhook_url?: string | null;
|
|
103
|
+
}
|
|
104
|
+
export declare function privacyResource(request: RequestFn): {
|
|
105
|
+
/** What this executor speaks (public). */
|
|
106
|
+
discover(): Promise<Record<string, unknown>>;
|
|
107
|
+
/** A ready-made orchestrator connection profile, e.g. `cookiemunch` (public). */
|
|
108
|
+
preset(id: string): Promise<Record<string, unknown>>;
|
|
109
|
+
/** Find a person: `atlas.sub` alone when present, then `atlas.ext`, then emails. */
|
|
110
|
+
lookup(body: {
|
|
111
|
+
emails?: string[];
|
|
112
|
+
atlas?: PrivacySubject;
|
|
113
|
+
}): Promise<PrivacyLookupResult>;
|
|
114
|
+
/** Open a request (or get the existing one for the same case). */
|
|
115
|
+
createRequest(body: CreatePrivacyRequestBody, idempotencyKey?: string): Promise<PrivacyRequest>;
|
|
116
|
+
getRequest(id: string): Promise<PrivacyRequest>;
|
|
117
|
+
/** Cancel before it runs: nothing is erased, the account stays. */
|
|
118
|
+
cancelRequest(id: string, idempotencyKey?: string): Promise<PrivacyRequest>;
|
|
119
|
+
orchestrator: {
|
|
120
|
+
get(): Promise<PrivacyOrchestrator>;
|
|
121
|
+
/** Connect or update; new secrets come back once. */
|
|
122
|
+
set(body: PrivacyOrchestratorInput): Promise<PrivacyOrchestrator>;
|
|
123
|
+
delete(): Promise<PrivacyOrchestrator & {
|
|
124
|
+
deleted: boolean;
|
|
125
|
+
}>;
|
|
126
|
+
};
|
|
127
|
+
};
|