@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/users.d.ts
CHANGED
|
@@ -170,7 +170,353 @@ export declare function usersResource(request: RequestFn): {
|
|
|
170
170
|
deleted: true;
|
|
171
171
|
tokens_revoked: number;
|
|
172
172
|
}>;
|
|
173
|
+
/**
|
|
174
|
+
* `POST /v1/users/by_emails` — resolve up to 1000 addresses to user ids in
|
|
175
|
+
* one call. Verified, live users only by default; an address ABSENT from
|
|
176
|
+
* `data` has no such user. For rights requests pass `include_unverified`.
|
|
177
|
+
*/
|
|
178
|
+
byEmails(body: UsersByEmailsBody): Promise<ListPage<UserEmailMatch>>;
|
|
179
|
+
/**
|
|
180
|
+
* `GET /v1/users/:id/resolved` — the flat identity: real primary email,
|
|
181
|
+
* whether it is verified, name, image and linked provider identities.
|
|
182
|
+
*/
|
|
183
|
+
resolved(id: string): Promise<ResolvedUser>;
|
|
184
|
+
/** `GET /v1/users/:id/state` — portable state: progression, tier, flair, entitlements, directives, roles. */
|
|
185
|
+
state(id: string): Promise<UserState>;
|
|
186
|
+
/**
|
|
187
|
+
* `GET /v1/users/:id/sign_in_history` — successful sign-ins, newest first,
|
|
188
|
+
* cursor-paginated (`limit` 1–100, default 50). Works with `paginate()`:
|
|
189
|
+
* `paginate((p) => atlas.users.signInHistory('user_1', p))`.
|
|
190
|
+
*/
|
|
191
|
+
signInHistory(id: string, params?: CursorParams): Promise<CursorPage<SignInEvent>>;
|
|
192
|
+
/**
|
|
193
|
+
* `GET /v1/users/:id/organization_memberships` — the organizations a user
|
|
194
|
+
* belongs to with role, resolved plan and join time. Cursor-paginated
|
|
195
|
+
* (`limit` default 20, max 100).
|
|
196
|
+
*/
|
|
197
|
+
listOrganizationMemberships(id: string, params?: CursorParams): Promise<CursorPage<UserOrganizationMembership>>;
|
|
198
|
+
/**
|
|
199
|
+
* `POST /v1/users/:id/password` — set (reset) a user's password. Password
|
|
200
|
+
* history and policy apply unless `skip_password_checks` is set.
|
|
201
|
+
*/
|
|
202
|
+
setPassword(id: string, body: SetUserPasswordBody): Promise<User>;
|
|
203
|
+
/** `DELETE /v1/users/:id/profile_image` — clear the profile image. */
|
|
204
|
+
deleteProfileImage(id: string): Promise<User>;
|
|
205
|
+
/** `DELETE /v1/users/:id/passkeys/:passkeyId` — remove one of the user's passkeys. */
|
|
206
|
+
deletePasskey(id: string, passkeyId: string): Promise<{
|
|
207
|
+
object: "passkey";
|
|
208
|
+
id: string;
|
|
209
|
+
deleted: true;
|
|
210
|
+
}>;
|
|
211
|
+
/**
|
|
212
|
+
* `POST /v1/users/:id/identities/import` — link a KNOWN provider identity
|
|
213
|
+
* (migration) without an OAuth flow. A `(provider, provider_user_id)` held
|
|
214
|
+
* by another user is a 409. Idempotent on the same user.
|
|
215
|
+
*/
|
|
216
|
+
importIdentity(id: string, body: ImportIdentityBody): Promise<Identity>;
|
|
217
|
+
/**
|
|
218
|
+
* `DELETE /v1/users/:id/identities/by-provider/:provider` — hard-remove a
|
|
219
|
+
* provider identity (undo a mis-import). Unlike `unlinkIdentity`, no new
|
|
220
|
+
* user is created. The account's only sign-in identity is refused.
|
|
221
|
+
*/
|
|
222
|
+
removeIdentityByProvider(id: string, provider: string): Promise<{
|
|
223
|
+
object: string;
|
|
224
|
+
id: string;
|
|
225
|
+
provider: string;
|
|
226
|
+
removed: boolean;
|
|
227
|
+
}>;
|
|
228
|
+
/**
|
|
229
|
+
* `POST /v1/users/:id/erasure_acks` — your app confirms it purged its copy
|
|
230
|
+
* of the user during a scheduled deletion, optionally contributing a JSON
|
|
231
|
+
* `payload` to the erasure export. Upserts on (user, source).
|
|
232
|
+
*/
|
|
233
|
+
acknowledgeErasure(id: string, body: UserErasureAckBody, idempotencyKey?: string): Promise<UserErasureAck>;
|
|
234
|
+
/**
|
|
235
|
+
* `GET /v1/users/:id/erasure_export` — Atlas's own data about the user plus
|
|
236
|
+
* every app's contributed payload, in one package.
|
|
237
|
+
*/
|
|
238
|
+
erasureExport(id: string): Promise<UserErasureExport>;
|
|
239
|
+
/** Graceful deletion with a cancellation window (`DELETE /v1/users/:id` stays the immediate path). */
|
|
240
|
+
deletion: {
|
|
241
|
+
/** `POST /v1/users/:id/deletion` — schedule; `grace_seconds` defaults to the instance erasure grace. */
|
|
242
|
+
schedule(id: string, body?: {
|
|
243
|
+
grace_seconds?: number;
|
|
244
|
+
}, idempotencyKey?: string): Promise<User>;
|
|
245
|
+
/** `POST /v1/users/:id/deletion/cancel` — 409 unless a deletion is still scheduled. */
|
|
246
|
+
cancel(id: string, idempotencyKey?: string): Promise<User>;
|
|
247
|
+
/** `POST /v1/users/:id/deletion/finalize` — purge once the window has lapsed; 409 if none is due. */
|
|
248
|
+
finalize(id: string, idempotencyKey?: string): Promise<{
|
|
249
|
+
object: "user";
|
|
250
|
+
id: string;
|
|
251
|
+
deleted: true;
|
|
252
|
+
}>;
|
|
253
|
+
};
|
|
254
|
+
/** Cross-property directives: suspension, read-only, forced logout. */
|
|
255
|
+
directives: {
|
|
256
|
+
/** `POST /v1/users/:id/directives` — revokes live sessions where applicable. */
|
|
257
|
+
impose(id: string, body: ImposeUserDirectiveBody, idempotencyKey?: string): Promise<UserDirective>;
|
|
258
|
+
/** `DELETE /v1/users/:id/directives` — lift the user's directive. */
|
|
259
|
+
lift(id: string): Promise<{
|
|
260
|
+
object: "directive";
|
|
261
|
+
user_id: string;
|
|
262
|
+
lifted: true;
|
|
263
|
+
}>;
|
|
264
|
+
};
|
|
265
|
+
/** Versioned consent records (ToS, privacy, marketing…). Append-only. */
|
|
266
|
+
consents: {
|
|
267
|
+
list(id: string): Promise<{
|
|
268
|
+
object: string;
|
|
269
|
+
data: UserConsent[];
|
|
270
|
+
}>;
|
|
271
|
+
/** Record acceptance (default) or `status: 'withdrawn'`. Repeating the current standing returns the existing record. */
|
|
272
|
+
record(id: string, body: RecordUserConsentBody, idempotencyKey?: string): Promise<UserConsent>;
|
|
273
|
+
};
|
|
274
|
+
/** Push number-matching approval of an arbitrary action ("approve this transfer"). */
|
|
275
|
+
approvalRequests: {
|
|
276
|
+
/**
|
|
277
|
+
* `POST /v1/users/:id/approval_requests` — push the prompt to the user's
|
|
278
|
+
* devices. Display the returned `match_number` yourself; 409 when the user
|
|
279
|
+
* has no push device.
|
|
280
|
+
*/
|
|
281
|
+
create(id: string, body: CreateUserApprovalRequestBody): Promise<UserApprovalRequestCreated>;
|
|
282
|
+
/** `GET /v1/users/:id/approval_requests/:approvalId` — poll its status. */
|
|
283
|
+
get(id: string, approvalId: string): Promise<UserApprovalRequest>;
|
|
284
|
+
};
|
|
285
|
+
/** Security-notification preferences of one end user. */
|
|
286
|
+
notificationPreferences: {
|
|
287
|
+
get(id: string): Promise<UserNotificationPreferences>;
|
|
288
|
+
/** `{ preferences: { category: enabled } }`. Security-critical categories cannot be disabled. */
|
|
289
|
+
update(id: string, body: UpdateUserNotificationPreferencesBody): Promise<UserNotificationPreferences>;
|
|
290
|
+
};
|
|
291
|
+
/** Phone numbers on a user (the SMS counterpart of email addresses). */
|
|
292
|
+
phoneNumbers: {
|
|
293
|
+
/** Starts unverified. */
|
|
294
|
+
add(id: string, body: {
|
|
295
|
+
phone_number: string;
|
|
296
|
+
}): Promise<UserPhoneNumber>;
|
|
297
|
+
/** Mark verified. 409 if the number is already verified on another user. */
|
|
298
|
+
verify(id: string, phoneId: string): Promise<UserPhoneNumber>;
|
|
299
|
+
delete(id: string, phoneId: string): Promise<{
|
|
300
|
+
object: "phone_number";
|
|
301
|
+
id: string;
|
|
302
|
+
deleted: true;
|
|
303
|
+
}>;
|
|
304
|
+
};
|
|
305
|
+
/** XP / level progression. */
|
|
306
|
+
progression: {
|
|
307
|
+
/**
|
|
308
|
+
* `POST /v1/users/:id/progression/events` — append an event, idempotent on
|
|
309
|
+
* `idempotency_key` (per calling key). A negative `amount` needs the `*` scope.
|
|
310
|
+
*/
|
|
311
|
+
addEvent(id: string, body: UserProgressionEventBody): Promise<UserProgressionEvent>;
|
|
312
|
+
};
|
|
173
313
|
};
|
|
314
|
+
export interface UsersByEmailsBody {
|
|
315
|
+
/** Up to 1000 addresses, case-insensitive, deduplicated. */
|
|
316
|
+
email_addresses: string[];
|
|
317
|
+
/** Also match addresses never verified (for rights requests). Default false. */
|
|
318
|
+
include_unverified?: boolean;
|
|
319
|
+
/** Also match soft-deleted users. Default false. */
|
|
320
|
+
include_deleted?: boolean;
|
|
321
|
+
}
|
|
322
|
+
export interface UserEmailMatch {
|
|
323
|
+
email_address: string;
|
|
324
|
+
user_id: string;
|
|
325
|
+
verified: boolean;
|
|
326
|
+
/** Present (true) only for a soft-deleted user matched via `include_deleted`. */
|
|
327
|
+
deleted?: boolean;
|
|
328
|
+
}
|
|
329
|
+
export interface ResolvedUser {
|
|
330
|
+
object: string;
|
|
331
|
+
user_id: string;
|
|
332
|
+
/** The real primary email, never a placeholder; null when the user has none. */
|
|
333
|
+
email: string | null;
|
|
334
|
+
email_verified: boolean;
|
|
335
|
+
name: string | null;
|
|
336
|
+
image_url: string | null;
|
|
337
|
+
identities: Array<{
|
|
338
|
+
provider: string;
|
|
339
|
+
provider_user_id: string;
|
|
340
|
+
email: string | null;
|
|
341
|
+
}>;
|
|
342
|
+
}
|
|
343
|
+
export interface UserState {
|
|
344
|
+
object: 'user_state';
|
|
345
|
+
attributes: {
|
|
346
|
+
/** Keyed by track name. */
|
|
347
|
+
progression: Record<string, {
|
|
348
|
+
xp: number;
|
|
349
|
+
level: number;
|
|
350
|
+
}>;
|
|
351
|
+
/** From `public_metadata.tier`, when set. */
|
|
352
|
+
tier?: unknown;
|
|
353
|
+
/** From `public_metadata.flair`, when set. */
|
|
354
|
+
flair?: unknown;
|
|
355
|
+
};
|
|
356
|
+
entitlements: unknown[];
|
|
357
|
+
directives: unknown[];
|
|
358
|
+
roles: unknown[];
|
|
359
|
+
}
|
|
360
|
+
export interface SignInEvent {
|
|
361
|
+
object: 'sign_in_event';
|
|
362
|
+
id: string;
|
|
363
|
+
/** password, email_code, oauth, passkey, … */
|
|
364
|
+
method: string;
|
|
365
|
+
/** The social provider, for an oauth sign-in. */
|
|
366
|
+
provider: string | null;
|
|
367
|
+
provider_email: string | null;
|
|
368
|
+
ip: string | null;
|
|
369
|
+
/** The actor id when the sign-in was an impersonation. */
|
|
370
|
+
impersonated_by: string | null;
|
|
371
|
+
created_at: number;
|
|
372
|
+
}
|
|
373
|
+
export interface UserOrganizationMembership {
|
|
374
|
+
object: 'organization_membership';
|
|
375
|
+
organization_id: string;
|
|
376
|
+
organization_slug: string;
|
|
377
|
+
role: string;
|
|
378
|
+
plan: string | null;
|
|
379
|
+
joined_at: number;
|
|
380
|
+
}
|
|
381
|
+
export interface SetUserPasswordBody {
|
|
382
|
+
password: string;
|
|
383
|
+
skip_password_checks?: boolean;
|
|
384
|
+
/** Revoke the user's other sessions. */
|
|
385
|
+
sign_out_of_other_sessions?: boolean;
|
|
386
|
+
}
|
|
387
|
+
export interface ImportIdentityBody {
|
|
388
|
+
provider: string;
|
|
389
|
+
provider_user_id: string;
|
|
390
|
+
email_address?: string;
|
|
391
|
+
verified?: boolean;
|
|
392
|
+
}
|
|
393
|
+
export interface UserErasureAckBody {
|
|
394
|
+
/** The acknowledging app/system (its app id or a label). */
|
|
395
|
+
source: string;
|
|
396
|
+
/** Alias of `source`. */
|
|
397
|
+
app_id?: string;
|
|
398
|
+
/** Your data for the erasure export; omit to only confirm the purge. */
|
|
399
|
+
payload?: Record<string, unknown>;
|
|
400
|
+
}
|
|
401
|
+
export interface UserErasureAck {
|
|
402
|
+
object: 'user_erasure_ack';
|
|
403
|
+
id: string;
|
|
404
|
+
user_id: string;
|
|
405
|
+
source: string;
|
|
406
|
+
created_at: number;
|
|
407
|
+
}
|
|
408
|
+
export interface UserErasureExport {
|
|
409
|
+
object: 'erasure_export';
|
|
410
|
+
format_version: 1;
|
|
411
|
+
generated_at: number;
|
|
412
|
+
user_id: string;
|
|
413
|
+
/** Atlas's own data about the user (no secrets). */
|
|
414
|
+
atlas: Record<string, unknown>;
|
|
415
|
+
app_contributions: Array<{
|
|
416
|
+
source: string;
|
|
417
|
+
contributed_at: number;
|
|
418
|
+
payload: unknown;
|
|
419
|
+
}>;
|
|
420
|
+
}
|
|
421
|
+
export interface ImposeUserDirectiveBody {
|
|
422
|
+
/** ISO 8601 timestamp the suspension lasts until. */
|
|
423
|
+
suspended_until?: string;
|
|
424
|
+
read_only?: boolean;
|
|
425
|
+
forced_logout?: boolean;
|
|
426
|
+
reason?: string;
|
|
427
|
+
}
|
|
428
|
+
export interface UserDirective {
|
|
429
|
+
object: 'directive';
|
|
430
|
+
user_id: string;
|
|
431
|
+
suspended_until?: string;
|
|
432
|
+
read_only?: true;
|
|
433
|
+
forced_logout?: true;
|
|
434
|
+
reason?: string;
|
|
435
|
+
/** Live sessions revoked by imposing the directive. */
|
|
436
|
+
sessions_revoked: number;
|
|
437
|
+
}
|
|
438
|
+
export interface RecordUserConsentBody {
|
|
439
|
+
/** e.g. `tos`, `privacy`, `marketing`. */
|
|
440
|
+
policy: string;
|
|
441
|
+
/** The policy version accepted. */
|
|
442
|
+
version: string;
|
|
443
|
+
/** `accepted` (default) or `withdrawn`. */
|
|
444
|
+
status?: 'accepted' | 'withdrawn';
|
|
445
|
+
source?: string;
|
|
446
|
+
metadata?: Record<string, unknown>;
|
|
447
|
+
}
|
|
448
|
+
export interface UserConsent {
|
|
449
|
+
object: 'consent';
|
|
450
|
+
id: string;
|
|
451
|
+
policy: string;
|
|
452
|
+
version: string;
|
|
453
|
+
status: 'accepted' | 'withdrawn' | (string & {});
|
|
454
|
+
source: string | null;
|
|
455
|
+
metadata?: unknown;
|
|
456
|
+
created_at: number;
|
|
457
|
+
}
|
|
458
|
+
export interface CreateUserApprovalRequestBody {
|
|
459
|
+
/** What is being approved, shown on the device. */
|
|
460
|
+
description: string;
|
|
461
|
+
/** Extra key/value details shown under the description. Strings only. */
|
|
462
|
+
context?: Record<string, string>;
|
|
463
|
+
}
|
|
464
|
+
export interface UserApprovalRequestCreated {
|
|
465
|
+
object: 'approval_request';
|
|
466
|
+
id: string;
|
|
467
|
+
status: 'pending';
|
|
468
|
+
/** Show this to the user; they confirm the matching number on their device. */
|
|
469
|
+
match_number: string;
|
|
470
|
+
expires_at: number;
|
|
471
|
+
}
|
|
472
|
+
export interface UserApprovalRequest {
|
|
473
|
+
object: 'approval_request';
|
|
474
|
+
id: string;
|
|
475
|
+
status: 'pending' | 'approved' | 'denied' | 'expired';
|
|
476
|
+
description: string;
|
|
477
|
+
context?: Record<string, string>;
|
|
478
|
+
approved_by_device_id: string | null;
|
|
479
|
+
created_at: number;
|
|
480
|
+
expires_at: number;
|
|
481
|
+
resolved_at: number | null;
|
|
482
|
+
}
|
|
483
|
+
export interface UserNotificationPreference {
|
|
484
|
+
category: string;
|
|
485
|
+
label: string;
|
|
486
|
+
enabled: boolean;
|
|
487
|
+
/** False for security-critical categories, which are always enabled. */
|
|
488
|
+
optional: boolean;
|
|
489
|
+
}
|
|
490
|
+
export interface UserNotificationPreferences {
|
|
491
|
+
object: 'notification_preferences';
|
|
492
|
+
preferences: UserNotificationPreference[];
|
|
493
|
+
}
|
|
494
|
+
export interface UpdateUserNotificationPreferencesBody {
|
|
495
|
+
/** Category key → enabled. */
|
|
496
|
+
preferences: Record<string, boolean>;
|
|
497
|
+
}
|
|
498
|
+
export interface UserPhoneNumber {
|
|
499
|
+
object: 'phone_number';
|
|
500
|
+
id: string;
|
|
501
|
+
phone_number: string;
|
|
502
|
+
verified: boolean;
|
|
503
|
+
created_at: number;
|
|
504
|
+
}
|
|
505
|
+
export interface UserProgressionEventBody {
|
|
506
|
+
track?: string;
|
|
507
|
+
amount: number;
|
|
508
|
+
reason: string;
|
|
509
|
+
/** Required; a retry with the same key is a no-op. */
|
|
510
|
+
idempotency_key: string;
|
|
511
|
+
}
|
|
512
|
+
export interface UserProgressionEvent {
|
|
513
|
+
object: 'progression_event';
|
|
514
|
+
track: string;
|
|
515
|
+
xp: number;
|
|
516
|
+
level: number;
|
|
517
|
+
level_changed: boolean;
|
|
518
|
+
delta: number;
|
|
519
|
+
}
|
|
174
520
|
/** One sign-in identity on a user: the base Atlas anchor, or a linked provider. */
|
|
175
521
|
export interface Identity {
|
|
176
522
|
object: 'identity';
|
package/dist/client/users.js
CHANGED
|
@@ -130,6 +130,234 @@ function usersResource(request) {
|
|
|
130
130
|
revokeGrant(grantId) {
|
|
131
131
|
return request({ method: 'DELETE', path: `/v1/grants/${(0, request_1.enc)(grantId)}` });
|
|
132
132
|
},
|
|
133
|
+
/**
|
|
134
|
+
* `POST /v1/users/by_emails` — resolve up to 1000 addresses to user ids in
|
|
135
|
+
* one call. Verified, live users only by default; an address ABSENT from
|
|
136
|
+
* `data` has no such user. For rights requests pass `include_unverified`.
|
|
137
|
+
*/
|
|
138
|
+
byEmails(body) {
|
|
139
|
+
return request({ method: 'POST', path: '/v1/users/by_emails', body });
|
|
140
|
+
},
|
|
141
|
+
/**
|
|
142
|
+
* `GET /v1/users/:id/resolved` — the flat identity: real primary email,
|
|
143
|
+
* whether it is verified, name, image and linked provider identities.
|
|
144
|
+
*/
|
|
145
|
+
resolved(id) {
|
|
146
|
+
return request({ method: 'GET', path: `/v1/users/${(0, request_1.enc)(id)}/resolved` });
|
|
147
|
+
},
|
|
148
|
+
/** `GET /v1/users/:id/state` — portable state: progression, tier, flair, entitlements, directives, roles. */
|
|
149
|
+
state(id) {
|
|
150
|
+
return request({ method: 'GET', path: `/v1/users/${(0, request_1.enc)(id)}/state` });
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* `GET /v1/users/:id/sign_in_history` — successful sign-ins, newest first,
|
|
154
|
+
* cursor-paginated (`limit` 1–100, default 50). Works with `paginate()`:
|
|
155
|
+
* `paginate((p) => atlas.users.signInHistory('user_1', p))`.
|
|
156
|
+
*/
|
|
157
|
+
signInHistory(id, params = {}) {
|
|
158
|
+
return request({
|
|
159
|
+
method: 'GET',
|
|
160
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/sign_in_history`,
|
|
161
|
+
query: { ...params },
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* `GET /v1/users/:id/organization_memberships` — the organizations a user
|
|
166
|
+
* belongs to with role, resolved plan and join time. Cursor-paginated
|
|
167
|
+
* (`limit` default 20, max 100).
|
|
168
|
+
*/
|
|
169
|
+
listOrganizationMemberships(id, params = {}) {
|
|
170
|
+
return request({
|
|
171
|
+
method: 'GET',
|
|
172
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/organization_memberships`,
|
|
173
|
+
query: { ...params },
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
/**
|
|
177
|
+
* `POST /v1/users/:id/password` — set (reset) a user's password. Password
|
|
178
|
+
* history and policy apply unless `skip_password_checks` is set.
|
|
179
|
+
*/
|
|
180
|
+
setPassword(id, body) {
|
|
181
|
+
return request({ method: 'POST', path: `/v1/users/${(0, request_1.enc)(id)}/password`, body });
|
|
182
|
+
},
|
|
183
|
+
/** `DELETE /v1/users/:id/profile_image` — clear the profile image. */
|
|
184
|
+
deleteProfileImage(id) {
|
|
185
|
+
return request({ method: 'DELETE', path: `/v1/users/${(0, request_1.enc)(id)}/profile_image` });
|
|
186
|
+
},
|
|
187
|
+
/** `DELETE /v1/users/:id/passkeys/:passkeyId` — remove one of the user's passkeys. */
|
|
188
|
+
deletePasskey(id, passkeyId) {
|
|
189
|
+
return request({
|
|
190
|
+
method: 'DELETE',
|
|
191
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/passkeys/${(0, request_1.enc)(passkeyId)}`,
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
|
+
/**
|
|
195
|
+
* `POST /v1/users/:id/identities/import` — link a KNOWN provider identity
|
|
196
|
+
* (migration) without an OAuth flow. A `(provider, provider_user_id)` held
|
|
197
|
+
* by another user is a 409. Idempotent on the same user.
|
|
198
|
+
*/
|
|
199
|
+
importIdentity(id, body) {
|
|
200
|
+
return request({ method: 'POST', path: `/v1/users/${(0, request_1.enc)(id)}/identities/import`, body });
|
|
201
|
+
},
|
|
202
|
+
/**
|
|
203
|
+
* `DELETE /v1/users/:id/identities/by-provider/:provider` — hard-remove a
|
|
204
|
+
* provider identity (undo a mis-import). Unlike `unlinkIdentity`, no new
|
|
205
|
+
* user is created. The account's only sign-in identity is refused.
|
|
206
|
+
*/
|
|
207
|
+
removeIdentityByProvider(id, provider) {
|
|
208
|
+
return request({
|
|
209
|
+
method: 'DELETE',
|
|
210
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/identities/by-provider/${(0, request_1.enc)(provider)}`,
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
/**
|
|
214
|
+
* `POST /v1/users/:id/erasure_acks` — your app confirms it purged its copy
|
|
215
|
+
* of the user during a scheduled deletion, optionally contributing a JSON
|
|
216
|
+
* `payload` to the erasure export. Upserts on (user, source).
|
|
217
|
+
*/
|
|
218
|
+
acknowledgeErasure(id, body, idempotencyKey) {
|
|
219
|
+
return request({
|
|
220
|
+
method: 'POST',
|
|
221
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/erasure_acks`,
|
|
222
|
+
body,
|
|
223
|
+
idempotencyKey,
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
/**
|
|
227
|
+
* `GET /v1/users/:id/erasure_export` — Atlas's own data about the user plus
|
|
228
|
+
* every app's contributed payload, in one package.
|
|
229
|
+
*/
|
|
230
|
+
erasureExport(id) {
|
|
231
|
+
return request({ method: 'GET', path: `/v1/users/${(0, request_1.enc)(id)}/erasure_export` });
|
|
232
|
+
},
|
|
233
|
+
/** Graceful deletion with a cancellation window (`DELETE /v1/users/:id` stays the immediate path). */
|
|
234
|
+
deletion: {
|
|
235
|
+
/** `POST /v1/users/:id/deletion` — schedule; `grace_seconds` defaults to the instance erasure grace. */
|
|
236
|
+
schedule(id, body = {}, idempotencyKey) {
|
|
237
|
+
return request({
|
|
238
|
+
method: 'POST',
|
|
239
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/deletion`,
|
|
240
|
+
body,
|
|
241
|
+
idempotencyKey,
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
/** `POST /v1/users/:id/deletion/cancel` — 409 unless a deletion is still scheduled. */
|
|
245
|
+
cancel(id, idempotencyKey) {
|
|
246
|
+
return request({
|
|
247
|
+
method: 'POST',
|
|
248
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/deletion/cancel`,
|
|
249
|
+
idempotencyKey,
|
|
250
|
+
});
|
|
251
|
+
},
|
|
252
|
+
/** `POST /v1/users/:id/deletion/finalize` — purge once the window has lapsed; 409 if none is due. */
|
|
253
|
+
finalize(id, idempotencyKey) {
|
|
254
|
+
return request({
|
|
255
|
+
method: 'POST',
|
|
256
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/deletion/finalize`,
|
|
257
|
+
idempotencyKey,
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
/** Cross-property directives: suspension, read-only, forced logout. */
|
|
262
|
+
directives: {
|
|
263
|
+
/** `POST /v1/users/:id/directives` — revokes live sessions where applicable. */
|
|
264
|
+
impose(id, body, idempotencyKey) {
|
|
265
|
+
return request({
|
|
266
|
+
method: 'POST',
|
|
267
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/directives`,
|
|
268
|
+
body,
|
|
269
|
+
idempotencyKey,
|
|
270
|
+
});
|
|
271
|
+
},
|
|
272
|
+
/** `DELETE /v1/users/:id/directives` — lift the user's directive. */
|
|
273
|
+
lift(id) {
|
|
274
|
+
return request({ method: 'DELETE', path: `/v1/users/${(0, request_1.enc)(id)}/directives` });
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
/** Versioned consent records (ToS, privacy, marketing…). Append-only. */
|
|
278
|
+
consents: {
|
|
279
|
+
list(id) {
|
|
280
|
+
return request({ method: 'GET', path: `/v1/users/${(0, request_1.enc)(id)}/consents` });
|
|
281
|
+
},
|
|
282
|
+
/** Record acceptance (default) or `status: 'withdrawn'`. Repeating the current standing returns the existing record. */
|
|
283
|
+
record(id, body, idempotencyKey) {
|
|
284
|
+
return request({
|
|
285
|
+
method: 'POST',
|
|
286
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/consents`,
|
|
287
|
+
body,
|
|
288
|
+
idempotencyKey,
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
/** Push number-matching approval of an arbitrary action ("approve this transfer"). */
|
|
293
|
+
approvalRequests: {
|
|
294
|
+
/**
|
|
295
|
+
* `POST /v1/users/:id/approval_requests` — push the prompt to the user's
|
|
296
|
+
* devices. Display the returned `match_number` yourself; 409 when the user
|
|
297
|
+
* has no push device.
|
|
298
|
+
*/
|
|
299
|
+
create(id, body) {
|
|
300
|
+
return request({ method: 'POST', path: `/v1/users/${(0, request_1.enc)(id)}/approval_requests`, body });
|
|
301
|
+
},
|
|
302
|
+
/** `GET /v1/users/:id/approval_requests/:approvalId` — poll its status. */
|
|
303
|
+
get(id, approvalId) {
|
|
304
|
+
return request({
|
|
305
|
+
method: 'GET',
|
|
306
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/approval_requests/${(0, request_1.enc)(approvalId)}`,
|
|
307
|
+
});
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
/** Security-notification preferences of one end user. */
|
|
311
|
+
notificationPreferences: {
|
|
312
|
+
get(id) {
|
|
313
|
+
return request({
|
|
314
|
+
method: 'GET',
|
|
315
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/notification_preferences`,
|
|
316
|
+
});
|
|
317
|
+
},
|
|
318
|
+
/** `{ preferences: { category: enabled } }`. Security-critical categories cannot be disabled. */
|
|
319
|
+
update(id, body) {
|
|
320
|
+
return request({
|
|
321
|
+
method: 'PATCH',
|
|
322
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/notification_preferences`,
|
|
323
|
+
body,
|
|
324
|
+
});
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
/** Phone numbers on a user (the SMS counterpart of email addresses). */
|
|
328
|
+
phoneNumbers: {
|
|
329
|
+
/** Starts unverified. */
|
|
330
|
+
add(id, body) {
|
|
331
|
+
return request({ method: 'POST', path: `/v1/users/${(0, request_1.enc)(id)}/phone_numbers`, body });
|
|
332
|
+
},
|
|
333
|
+
/** Mark verified. 409 if the number is already verified on another user. */
|
|
334
|
+
verify(id, phoneId) {
|
|
335
|
+
return request({
|
|
336
|
+
method: 'POST',
|
|
337
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/phone_numbers/${(0, request_1.enc)(phoneId)}/verify`,
|
|
338
|
+
});
|
|
339
|
+
},
|
|
340
|
+
delete(id, phoneId) {
|
|
341
|
+
return request({
|
|
342
|
+
method: 'DELETE',
|
|
343
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/phone_numbers/${(0, request_1.enc)(phoneId)}`,
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
/** XP / level progression. */
|
|
348
|
+
progression: {
|
|
349
|
+
/**
|
|
350
|
+
* `POST /v1/users/:id/progression/events` — append an event, idempotent on
|
|
351
|
+
* `idempotency_key` (per calling key). A negative `amount` needs the `*` scope.
|
|
352
|
+
*/
|
|
353
|
+
addEvent(id, body) {
|
|
354
|
+
return request({
|
|
355
|
+
method: 'POST',
|
|
356
|
+
path: `/v1/users/${(0, request_1.enc)(id)}/progression/events`,
|
|
357
|
+
body,
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
},
|
|
133
361
|
};
|
|
134
362
|
}
|
|
135
363
|
//# sourceMappingURL=users.js.map
|
package/dist/client/users.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/client/users.ts"],"names":[],"mappings":";;AAmEA,
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/client/users.ts"],"names":[],"mappings":";;AAmEA,sCAkaC;AAreD,uCAAgD;AAmEhD,SAAgB,aAAa,CAAC,OAAkB;IAC9C,OAAO;QACL,0CAA0C;QAC1C,IAAI,CAAC,SAA0B,EAAE;YAC/B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,CAAC,IAAoB,EAAE,cAAuB;YAClD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,MAAM,CAAC,EAAU,EAAE,IAAoB;YACrC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,wEAAwE;QACxE,eAAe,CAAC,EAAU,EAAE,IAA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or: string | null;
|
|
23
23
|
}
|
|
24
|
+
export interface BulkWaitlistResult {
|
|
25
|
+
object: 'list';
|
|
26
|
+
data: WaitlistEntry[];
|
|
27
|
+
errors: Array<{
|
|
28
|
+
index: number;
|
|
29
|
+
email_address: string;
|
|
30
|
+
code: string;
|
|
31
|
+
message: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
24
34
|
export declare function waitlistResource(request: RequestFn): {
|
|
35
|
+
/** Add an address to the waitlist. Idempotent on the address. */
|
|
36
|
+
create(body: {
|
|
37
|
+
email_address: string;
|
|
38
|
+
}, idempotencyKey?: string): Promise<WaitlistEntry>;
|
|
39
|
+
/** Add up to 100 addresses; per-entry errors are returned, not thrown. */
|
|
40
|
+
bulkCreate(emailAddresses: string[], idempotencyKey?: string): Promise<BulkWaitlistResult>;
|
|
41
|
+
delete(id: string): Promise<{
|
|
42
|
+
object: "waitlist_entry";
|
|
43
|
+
id: string;
|
|
44
|
+
deleted: true;
|
|
45
|
+
}>;
|
|
25
46
|
list(params?: ListWaitlistParams): Promise<ListWaitlistResponse>;
|
|
26
47
|
/** Approve or deny a waitlist entry. */
|
|
27
48
|
decide(id: string, body: {
|
package/dist/client/waitlist.js
CHANGED
|
@@ -4,6 +4,22 @@ exports.waitlistResource = waitlistResource;
|
|
|
4
4
|
const request_1 = require("./request");
|
|
5
5
|
function waitlistResource(request) {
|
|
6
6
|
return {
|
|
7
|
+
/** Add an address to the waitlist. Idempotent on the address. */
|
|
8
|
+
create(body, idempotencyKey) {
|
|
9
|
+
return request({ method: 'POST', path: '/v1/waitlist_entries', body, idempotencyKey });
|
|
10
|
+
},
|
|
11
|
+
/** Add up to 100 addresses; per-entry errors are returned, not thrown. */
|
|
12
|
+
bulkCreate(emailAddresses, idempotencyKey) {
|
|
13
|
+
return request({
|
|
14
|
+
method: 'POST',
|
|
15
|
+
path: '/v1/waitlist_entries/bulk',
|
|
16
|
+
body: { email_addresses: emailAddresses },
|
|
17
|
+
idempotencyKey,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
delete(id) {
|
|
21
|
+
return request({ method: 'DELETE', path: `/v1/waitlist_entries/${(0, request_1.enc)(id)}` });
|
|
22
|
+
},
|
|
7
23
|
list(params = {}) {
|
|
8
24
|
return request({ method: 'GET', path: '/v1/waitlist_entries', query: { ...params } });
|
|
9
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitlist.js","sourceRoot":"","sources":["../../src/client/waitlist.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"waitlist.js","sourceRoot":"","sources":["../../src/client/waitlist.ts"],"names":[],"mappings":";;AAiCA,4CA6BC;AA9DD,uCAAgD;AAiChD,SAAgB,gBAAgB,CAAC,OAAkB;IACjD,OAAO;QACL,iEAAiE;QACjE,MAAM,CAAC,IAA+B,EAAE,cAAuB;YAC7D,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACzF,CAAC;QACD,0EAA0E;QAC1E,UAAU,CAAC,cAAwB,EAAE,cAAuB;YAC1D,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,2BAA2B;gBACjC,IAAI,EAAE,EAAE,eAAe,EAAE,cAAc,EAAE;gBACzC,cAAc;aACf,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,wBAAwB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,IAAI,CAAC,SAA6B,EAAE;YAClC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QACxF,CAAC;QACD,wCAAwC;QACxC,MAAM,CACJ,EAAU,EACV,IAAsD;YAEtD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,IAAA,aAAG,EAAC,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3F,CAAC;KACF,CAAC;AACJ,CAAC"}
|