@atlasauth/backend 0.24.0 → 0.26.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 (201) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/dist/client/abac.d.ts +521 -0
  3. package/dist/client/abac.js +146 -0
  4. package/dist/client/abac.js.map +1 -0
  5. package/dist/client/access-policies.d.ts +100 -0
  6. package/dist/client/access-policies.js +29 -0
  7. package/dist/client/access-policies.js.map +1 -0
  8. package/dist/client/action-gallery.d.ts +1 -1
  9. package/dist/client/action-gallery.js.map +1 -1
  10. package/dist/client/actions.d.ts +129 -6
  11. package/dist/client/actions.js +4 -0
  12. package/dist/client/actions.js.map +1 -1
  13. package/dist/client/analytics-reports.d.ts +215 -0
  14. package/dist/client/analytics-reports.js +56 -0
  15. package/dist/client/analytics-reports.js.map +1 -0
  16. package/dist/client/app-catalog.d.ts +74 -0
  17. package/dist/client/app-catalog.js +30 -0
  18. package/dist/client/app-catalog.js.map +1 -0
  19. package/dist/client/attack-protection.d.ts +10 -0
  20. package/dist/client/attack-protection.js +8 -0
  21. package/dist/client/attack-protection.js.map +1 -1
  22. package/dist/client/audit-events.d.ts +71 -0
  23. package/dist/client/audit-events.js +28 -0
  24. package/dist/client/audit-events.js.map +1 -1
  25. package/dist/client/authz-decisions.d.ts +108 -0
  26. package/dist/client/authz-decisions.js +40 -0
  27. package/dist/client/authz-decisions.js.map +1 -0
  28. package/dist/client/connections.d.ts +507 -0
  29. package/dist/client/connections.js +164 -0
  30. package/dist/client/connections.js.map +1 -0
  31. package/dist/client/credentials.d.ts +8 -0
  32. package/dist/client/credentials.js.map +1 -1
  33. package/dist/client/custom-oauth-providers.d.ts +15 -0
  34. package/dist/client/custom-oauth-providers.js.map +1 -1
  35. package/dist/client/delegated-ui-proxy.d.ts +25 -0
  36. package/dist/client/delegated-ui-proxy.js +46 -0
  37. package/dist/client/delegated-ui-proxy.js.map +1 -0
  38. package/dist/client/desktop-mfa.d.ts +104 -0
  39. package/dist/client/desktop-mfa.js +44 -0
  40. package/dist/client/desktop-mfa.js.map +1 -0
  41. package/dist/client/devices.d.ts +44 -0
  42. package/dist/client/devices.js +26 -0
  43. package/dist/client/devices.js.map +1 -0
  44. package/dist/client/email-templates.d.ts +1 -1
  45. package/dist/client/email-templates.js.map +1 -1
  46. package/dist/client/fga.d.ts +125 -4
  47. package/dist/client/fga.js +40 -0
  48. package/dist/client/fga.js.map +1 -1
  49. package/dist/client/flags.d.ts +101 -0
  50. package/dist/client/flags.js +104 -0
  51. package/dist/client/flags.js.map +1 -0
  52. package/dist/client/groups.d.ts +146 -0
  53. package/dist/client/groups.js +67 -0
  54. package/dist/client/groups.js.map +1 -0
  55. package/dist/client/identity-verification.d.ts +62 -0
  56. package/dist/client/identity-verification.js +39 -0
  57. package/dist/client/identity-verification.js.map +1 -0
  58. package/dist/client/iga.d.ts +436 -0
  59. package/dist/client/iga.js +82 -0
  60. package/dist/client/iga.js.map +1 -0
  61. package/dist/client/index.d.ts +1433 -4
  62. package/dist/client/index.js +96 -0
  63. package/dist/client/index.js.map +1 -1
  64. package/dist/client/journeys.d.ts +108 -0
  65. package/dist/client/journeys.js +35 -0
  66. package/dist/client/journeys.js.map +1 -0
  67. package/dist/client/least-privilege.d.ts +95 -0
  68. package/dist/client/least-privilege.js +28 -0
  69. package/dist/client/least-privilege.js.map +1 -0
  70. package/dist/client/log-streams.d.ts +1 -1
  71. package/dist/client/managed-grants.d.ts +52 -0
  72. package/dist/client/managed-grants.js +28 -0
  73. package/dist/client/managed-grants.js.map +1 -0
  74. package/dist/client/marketing.d.ts +67 -0
  75. package/dist/client/marketing.js +26 -0
  76. package/dist/client/marketing.js.map +1 -0
  77. package/dist/client/mcp-gateways.d.ts +126 -0
  78. package/dist/client/mcp-gateways.js +47 -0
  79. package/dist/client/mcp-gateways.js.map +1 -0
  80. package/dist/client/messaging.d.ts +14 -3
  81. package/dist/client/messaging.js.map +1 -1
  82. package/dist/client/mfa-factors.d.ts +120 -0
  83. package/dist/client/mfa-factors.js +73 -0
  84. package/dist/client/mfa-factors.js.map +1 -0
  85. package/dist/client/migrations.d.ts +1 -1
  86. package/dist/client/migrations.js.map +1 -1
  87. package/dist/client/network-acls.d.ts +6 -1
  88. package/dist/client/network-acls.js.map +1 -1
  89. package/dist/client/network-zones.d.ts +56 -0
  90. package/dist/client/network-zones.js +29 -0
  91. package/dist/client/network-zones.js.map +1 -0
  92. package/dist/client/notifications.d.ts +1 -1
  93. package/dist/client/notifications.js.map +1 -1
  94. package/dist/client/oauth-clients.d.ts +187 -3
  95. package/dist/client/oauth-clients.js +64 -0
  96. package/dist/client/oauth-clients.js.map +1 -1
  97. package/dist/client/openfga.d.ts +90 -3
  98. package/dist/client/openfga.js +27 -1
  99. package/dist/client/openfga.js.map +1 -1
  100. package/dist/client/org-role-grants.d.ts +57 -0
  101. package/dist/client/org-role-grants.js +40 -0
  102. package/dist/client/org-role-grants.js.map +1 -0
  103. package/dist/client/organizations.d.ts +52 -0
  104. package/dist/client/organizations.js +44 -0
  105. package/dist/client/organizations.js.map +1 -1
  106. package/dist/client/page-templates.d.ts +78 -0
  107. package/dist/client/page-templates.js +31 -0
  108. package/dist/client/page-templates.js.map +1 -0
  109. package/dist/client/passkey-api.d.ts +73 -0
  110. package/dist/client/passkey-api.js +34 -0
  111. package/dist/client/passkey-api.js.map +1 -0
  112. package/dist/client/policy-bundles.d.ts +105 -0
  113. package/dist/client/policy-bundles.js +38 -0
  114. package/dist/client/policy-bundles.js.map +1 -0
  115. package/dist/client/resources.d.ts +150 -0
  116. package/dist/client/resources.js +73 -0
  117. package/dist/client/resources.js.map +1 -0
  118. package/dist/client/risk-based-mfa.d.ts +147 -0
  119. package/dist/client/risk-based-mfa.js +30 -0
  120. package/dist/client/risk-based-mfa.js.map +1 -1
  121. package/dist/client/roles.d.ts +4 -0
  122. package/dist/client/roles.js.map +1 -1
  123. package/dist/client/service-connectors.d.ts +83 -0
  124. package/dist/client/service-connectors.js +33 -0
  125. package/dist/client/service-connectors.js.map +1 -0
  126. package/dist/client/ssf.d.ts +112 -0
  127. package/dist/client/ssf.js +49 -0
  128. package/dist/client/ssf.js.map +1 -0
  129. package/dist/client/sso-onboarding.d.ts +6 -0
  130. package/dist/client/sso-onboarding.js.map +1 -1
  131. package/dist/client/users.d.ts +302 -0
  132. package/dist/client/users.js +125 -0
  133. package/dist/client/users.js.map +1 -1
  134. package/dist/client/vault.d.ts +85 -0
  135. package/dist/client/vault.js +50 -0
  136. package/dist/client/vault.js.map +1 -0
  137. package/dist/client/vc.d.ts +136 -0
  138. package/dist/client/vc.js +43 -0
  139. package/dist/client/vc.js.map +1 -0
  140. package/dist/client/webhooks.d.ts +31 -2
  141. package/dist/client/webhooks.js.map +1 -1
  142. package/dist/client/workflows.d.ts +131 -0
  143. package/dist/client/workflows.js +36 -0
  144. package/dist/client/workflows.js.map +1 -0
  145. package/dist/index.d.ts +5 -0
  146. package/dist/index.js +11 -2
  147. package/dist/index.js.map +1 -1
  148. package/dist/magic-did.d.ts +5 -0
  149. package/dist/magic-did.js +49 -0
  150. package/dist/magic-did.js.map +1 -0
  151. package/dist/migration-bridge.d.ts +9 -0
  152. package/dist/migration-bridge.js +28 -2
  153. package/dist/migration-bridge.js.map +1 -1
  154. package/dist/migration-presets-g3.d.ts +2 -0
  155. package/dist/migration-presets-g3.js +254 -0
  156. package/dist/migration-presets-g3.js.map +1 -0
  157. package/dist/migration-presets-g4/authentik.d.ts +14 -0
  158. package/dist/migration-presets-g4/authentik.js +37 -0
  159. package/dist/migration-presets-g4/authentik.js.map +1 -0
  160. package/dist/migration-presets-g4/fusionauth.d.ts +2 -0
  161. package/dist/migration-presets-g4/fusionauth.js +52 -0
  162. package/dist/migration-presets-g4/fusionauth.js.map +1 -0
  163. package/dist/migration-presets-g4/hanko.d.ts +12 -0
  164. package/dist/migration-presets-g4/hanko.js +46 -0
  165. package/dist/migration-presets-g4/hanko.js.map +1 -0
  166. package/dist/migration-presets-g4/keycloak.d.ts +16 -0
  167. package/dist/migration-presets-g4/keycloak.js +37 -0
  168. package/dist/migration-presets-g4/keycloak.js.map +1 -0
  169. package/dist/migration-presets-g4/logto.d.ts +12 -0
  170. package/dist/migration-presets-g4/logto.js +35 -0
  171. package/dist/migration-presets-g4/logto.js.map +1 -0
  172. package/dist/migration-presets-g4/ory.d.ts +2 -0
  173. package/dist/migration-presets-g4/ory.js +67 -0
  174. package/dist/migration-presets-g4/ory.js.map +1 -0
  175. package/dist/migration-presets-g4/supertokens.d.ts +13 -0
  176. package/dist/migration-presets-g4/supertokens.js +35 -0
  177. package/dist/migration-presets-g4/supertokens.js.map +1 -0
  178. package/dist/migration-presets-g4/zitadel.d.ts +2 -0
  179. package/dist/migration-presets-g4/zitadel.js +36 -0
  180. package/dist/migration-presets-g4/zitadel.js.map +1 -0
  181. package/dist/migration-presets-g4.d.ts +10 -0
  182. package/dist/migration-presets-g4.js +30 -0
  183. package/dist/migration-presets-g4.js.map +1 -0
  184. package/dist/migration-presets.d.ts +6 -0
  185. package/dist/migration-presets.js +102 -6
  186. package/dist/migration-presets.js.map +1 -1
  187. package/dist/policy-bundle.d.ts +110 -0
  188. package/dist/policy-bundle.js +289 -0
  189. package/dist/policy-bundle.js.map +1 -0
  190. package/dist/request-auth.d.ts +32 -0
  191. package/dist/request-auth.js +72 -0
  192. package/dist/request-auth.js.map +1 -0
  193. package/dist/uma.d.ts +77 -0
  194. package/dist/uma.js +95 -0
  195. package/dist/uma.js.map +1 -0
  196. package/dist/verify.d.ts +2 -0
  197. package/dist/verify.js.map +1 -1
  198. package/dist/workos-session.d.ts +30 -0
  199. package/dist/workos-session.js +123 -0
  200. package/dist/workos-session.js.map +1 -0
  201. package/package.json +2 -2
@@ -0,0 +1,112 @@
1
+ import { type RequestFn } from './request';
2
+ /** Event type URIs (CAEP + RISC) a stream can subscribe to. */
3
+ export type SsfEventType = 'https://schemas.openid.net/secevent/caep/event-type/session-revoked' | 'https://schemas.openid.net/secevent/caep/event-type/credential-change' | 'https://schemas.openid.net/secevent/caep/event-type/assurance-level-change' | 'https://schemas.openid.net/secevent/caep/event-type/token-claims-change' | 'https://schemas.openid.net/secevent/caep/event-type/risk-level-change' | 'https://schemas.openid.net/secevent/risc/event-type/account-disabled' | 'https://schemas.openid.net/secevent/risc/event-type/account-enabled' | 'https://schemas.openid.net/secevent/risc/event-type/account-purged' | 'https://schemas.openid.net/secevent/risc/event-type/credential-compromise';
4
+ export interface SsfStream {
5
+ object: 'ssf_stream';
6
+ id: string;
7
+ description: string | null;
8
+ delivery: {
9
+ method: string;
10
+ endpoint_url?: string | null;
11
+ };
12
+ delivery_method: 'push' | 'poll';
13
+ audience: string;
14
+ events_requested: string[];
15
+ events_supported: string[];
16
+ status: 'enabled' | 'paused' | 'disabled';
17
+ created_at: number;
18
+ updated_at: number;
19
+ pending_events?: number;
20
+ }
21
+ /** Returned once on create for a poll stream. */
22
+ export interface SsfStreamCreated extends SsfStream {
23
+ poll_token?: string;
24
+ poll_endpoint?: string;
25
+ }
26
+ export interface CreateSsfStreamBody {
27
+ delivery_method: 'push' | 'poll';
28
+ /** Push only: the https endpoint that receives each SET. */
29
+ endpoint_url?: string;
30
+ /** Push only: sent as the `Authorization` header (write-only). */
31
+ authorization_header?: string;
32
+ audience?: string;
33
+ description?: string;
34
+ events_requested?: string[];
35
+ }
36
+ export interface UpdateSsfStreamBody {
37
+ endpoint_url?: string;
38
+ authorization_header?: string;
39
+ description?: string;
40
+ events_requested?: string[];
41
+ status?: 'enabled' | 'paused' | 'disabled';
42
+ }
43
+ export interface SsfEventRecord {
44
+ object: 'ssf_event';
45
+ id: string;
46
+ event_type: string;
47
+ user_id: string | null;
48
+ status: 'pending' | 'delivered' | 'failed';
49
+ attempts: number;
50
+ last_error: string | null;
51
+ delivered_at: number | null;
52
+ created_at: number;
53
+ }
54
+ /** `sync_posture` (device-compliance-change only) records the device's compliance in Atlas device posture and nothing else. */
55
+ export type SsfReceiverAction = 'revoke_sessions' | 'refresh_claims' | 'ban' | 'sync_posture' | 'ignore';
56
+ export interface SsfReceiver {
57
+ object: 'ssf_receiver';
58
+ id: string;
59
+ name: string;
60
+ issuer: string;
61
+ jwks_uri: string;
62
+ audience: string | null;
63
+ actions: Record<string, SsfReceiverAction>;
64
+ enabled: boolean;
65
+ last_received_at: number | null;
66
+ created_at: number;
67
+ /** Only on create. */
68
+ receive_endpoint?: string;
69
+ }
70
+ export interface CreateSsfReceiverBody {
71
+ name: string;
72
+ issuer: string;
73
+ jwks_uri: string;
74
+ audience?: string;
75
+ actions?: Record<string, SsfReceiverAction>;
76
+ }
77
+ /** Shared Signals Framework (SSF 1.0) with CAEP and RISC: transmitter streams and inbound receivers. */
78
+ export declare function ssfResource(request: RequestFn): {
79
+ streams: {
80
+ list(): Promise<{
81
+ object: "list";
82
+ data: SsfStream[];
83
+ }>;
84
+ create(body: CreateSsfStreamBody): Promise<SsfStreamCreated>;
85
+ get(id: string): Promise<SsfStream>;
86
+ update(id: string, body: UpdateSsfStreamBody): Promise<SsfStream>;
87
+ delete(id: string): Promise<void>;
88
+ /** Queue a verification event so the receiver can confirm the stream works. */
89
+ verify(id: string, state?: string): Promise<{
90
+ object: "ssf_verification";
91
+ stream_id: string;
92
+ state: string;
93
+ }>;
94
+ events(id: string, query?: {
95
+ limit?: number;
96
+ }): Promise<{
97
+ object: "list";
98
+ data: SsfEventRecord[];
99
+ }>;
100
+ };
101
+ receivers: {
102
+ list(): Promise<{
103
+ object: "list";
104
+ data: SsfReceiver[];
105
+ }>;
106
+ create(body: CreateSsfReceiverBody): Promise<SsfReceiver>;
107
+ update(id: string, body: Partial<Omit<CreateSsfReceiverBody, "issuer">> & {
108
+ enabled?: boolean;
109
+ }): Promise<SsfReceiver>;
110
+ delete(id: string): Promise<void>;
111
+ };
112
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ssfResource = ssfResource;
4
+ /** Shared Signals Framework (SSF 1.0) with CAEP and RISC: transmitter streams and inbound receivers. */
5
+ function ssfResource(request) {
6
+ const stream = (id) => `/v1/ssf/streams/${encodeURIComponent(id)}`;
7
+ const receiver = (id) => `/v1/ssf/receivers/${encodeURIComponent(id)}`;
8
+ return {
9
+ streams: {
10
+ list() {
11
+ return request({ method: 'GET', path: '/v1/ssf/streams' });
12
+ },
13
+ create(body) {
14
+ return request({ method: 'POST', path: '/v1/ssf/streams', body });
15
+ },
16
+ get(id) {
17
+ return request({ method: 'GET', path: stream(id) });
18
+ },
19
+ update(id, body) {
20
+ return request({ method: 'PATCH', path: stream(id), body });
21
+ },
22
+ delete(id) {
23
+ return request({ method: 'DELETE', path: stream(id) });
24
+ },
25
+ /** Queue a verification event so the receiver can confirm the stream works. */
26
+ verify(id, state) {
27
+ return request({ method: 'POST', path: `${stream(id)}/verify`, body: { state } });
28
+ },
29
+ events(id, query = {}) {
30
+ return request({ method: 'GET', path: `${stream(id)}/events`, query });
31
+ },
32
+ },
33
+ receivers: {
34
+ list() {
35
+ return request({ method: 'GET', path: '/v1/ssf/receivers' });
36
+ },
37
+ create(body) {
38
+ return request({ method: 'POST', path: '/v1/ssf/receivers', body });
39
+ },
40
+ update(id, body) {
41
+ return request({ method: 'PATCH', path: receiver(id), body });
42
+ },
43
+ delete(id) {
44
+ return request({ method: 'DELETE', path: receiver(id) });
45
+ },
46
+ },
47
+ };
48
+ }
49
+ //# sourceMappingURL=ssf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssf.js","sourceRoot":"","sources":["../../src/client/ssf.ts"],"names":[],"mappings":";;AA6FA,kCA2CC;AA5CD,wGAAwG;AACxG,SAAgB,WAAW,CAAC,OAAkB;IAC5C,MAAM,MAAM,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,mBAAmB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC3E,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,qBAAqB,kBAAkB,CAAC,EAAE,CAA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EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;YAC/D,CAAC;YACD,MAAM,CAAC,IAA2B;gBAChC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC;YACtE,CAAC;YACD,MAAM,CAAC,EAAU,EAAE,IAA4E;gBAC7F,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YAChE,CAAC;YACD,MAAM,CAAC,EAAU;gBACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC3D,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -5,6 +5,8 @@ import type { ListPage } from './types';
5
5
  * self-service-profiles model. It fixes which protocols an end-customer may
6
6
  * configure and either binds an org or promises to name one at ticket issue.
7
7
  */
8
+ /** An Admin Portal task a ticket may perform for its organization. */
9
+ export type SsoPortalIntent = 'sso' | 'directory_sync' | 'domain_verification' | 'log_stream' | 'audit_log' | 'certificate_renewal' | 'api_keys' | 'webhooks';
8
10
  export interface SsoOnboardingProfile {
9
11
  object: 'sso_onboarding_profile';
10
12
  id: string;
@@ -14,6 +16,8 @@ export interface SsoOnboardingProfile {
14
16
  organization_id: string | null;
15
17
  company_name: string | null;
16
18
  allow_scim: boolean;
19
+ /** The Admin Portal tasks this profile's tickets may perform. */
20
+ intents: SsoPortalIntent[];
17
21
  created_at: number;
18
22
  updated_at: number;
19
23
  }
@@ -49,6 +53,8 @@ export interface CreateSsoOnboardingProfileBody {
49
53
  organization_id?: string | null;
50
54
  company_name?: string | null;
51
55
  allow_scim?: boolean;
56
+ /** Admin Portal tasks to grant; omit for the classic SSO (+ domain) profile. */
57
+ intents?: SsoPortalIntent[];
52
58
  }
53
59
  export interface CreateSsoOnboardingTicketBody {
54
60
  /** Required for an unbound profile; must match (or be omitted) for a bound one. */
@@ -1 +1 @@
1
- {"version":3,"file":"sso-onboarding.js","sourceRoot":"","sources":["../../src/client/sso-onboarding.ts"],"names":[],"mappings":";;AAgEA,sDA6CC;AA7GD,uCAAgD;AAgEhD,SAAgB,qBAAqB,CAAC,OAAkB;IACtD,OAAO;QACL,IAAI;YACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC,CAAC;QACzE,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,+BAA+B,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,MAAM,CACJ,IAAoC,EACpC,cAAuB;YAEvB,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,6BAA6B;gBACnC,IAAI;gBACJ,cAAc;aACf,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,+BAA+B,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,+EAA+E;QAC/E,YAAY,CACV,SAAiB,EACjB,OAAsC,EAAE,EACxC,cAAuB;YAEvB,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,+BAA+B,IAAA,aAAG,EAAC,SAAS,CAAC,UAAU;gBAC7D,IAAI;gBACJ,cAAc;aACf,CAAC,CAAC;QACL,CAAC;QACD,kFAAkF;QAClF,YAAY,CACV,QAAgB;YAEhB,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,8BAA8B,IAAA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,CAAC,SAAS;aAC3D,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type RequestFn } from './request';
2
+ import type { ImportedMfa } from './mfa-factors';
2
3
  import type { CursorPage, CursorParams, DeletedObject, ListPage, Metadata } from './types';
3
4
  /** A user as the BAPI serves it. `private_metadata` is never returned. */
4
5
  export interface User {
@@ -10,6 +11,8 @@ export interface User {
10
11
  image_url: string | null;
11
12
  public_metadata: Metadata;
12
13
  mfa_enabled: boolean;
14
+ /** Factor classes this user must always use; empty = none. */
15
+ required_factors?: string[];
13
16
  banned: boolean;
14
17
  /** A timed ban's expiry (epoch ms); null for a permanent ban or none. */
15
18
  ban_expires_at?: number | null;
@@ -208,6 +211,8 @@ export interface CreateUserBody {
208
211
  first_name?: string;
209
212
  last_name?: string;
210
213
  email_verified?: boolean;
214
+ /** The user must choose a new password at their first sign-in (`update_password` required action). */
215
+ password_change_required?: boolean;
211
216
  public_metadata?: Metadata;
212
217
  private_metadata?: Metadata;
213
218
  unsafe_metadata?: Metadata;
@@ -223,8 +228,12 @@ export interface CreateUserBody {
223
228
  referral?: CreateUserReferralInput;
224
229
  /** The user's own referral code; unique per instance (`409 REFERRAL_CODE_TAKEN`). */
225
230
  referral_code?: string;
231
+ /** An existing authenticator (TOTP or HOTP) and recovery codes to import, so the user keeps their second factor. */
232
+ mfa?: ImportedMfa;
226
233
  }
227
234
  export interface UpdateUserBody {
235
+ /** Force a second factor at every sign-in; `null`/`[]` clears. */
236
+ required_factors?: Array<'totp' | 'sms' | 'passkey' | 'push'> | null;
228
237
  first_name?: string;
229
238
  last_name?: string;
230
239
  /**
@@ -274,6 +283,7 @@ export declare function usersResource(request: RequestFn): {
274
283
  unban(id: string): Promise<User>;
275
284
  lock(id: string, body?: {
276
285
  duration_in_seconds?: number;
286
+ reason?: string;
277
287
  }): Promise<User>;
278
288
  unlock(id: string): Promise<User>;
279
289
  /**
@@ -424,6 +434,17 @@ export declare function usersResource(request: RequestFn): {
424
434
  setPassword(id: string, body: SetUserPasswordBody): Promise<User>;
425
435
  /** `DELETE /v1/users/:id/profile_image` — clear the profile image. */
426
436
  deleteProfileImage(id: string): Promise<User>;
437
+ /** `GET /v1/users/:id/device_keys` — the user's device keys (native biometric sign-in). */
438
+ listDeviceKeys(id: string): Promise<{
439
+ object: "list";
440
+ data: DeviceKey[];
441
+ }>;
442
+ /** `DELETE /v1/users/:id/device_keys/:keyId` — revoke one device key. */
443
+ deleteDeviceKey(id: string, keyId: string): Promise<{
444
+ object: "device_key";
445
+ id: string;
446
+ deleted: true;
447
+ }>;
427
448
  /** `DELETE /v1/users/:id/passkeys/:passkeyId` — remove one of the user's passkeys. */
428
449
  deletePasskey(id: string, passkeyId: string): Promise<{
429
450
  object: "passkey";
@@ -458,6 +479,126 @@ export declare function usersResource(request: RequestFn): {
458
479
  * every app's contributed payload, in one package.
459
480
  */
460
481
  erasureExport(id: string): Promise<UserErasureExport>;
482
+ /**
483
+ * `POST /v1/users/:id/links` — mint an email-verification or password-reset
484
+ * link (and code) for a user WITHOUT sending it, for tools that deliver it
485
+ * themselves. The response is a credential: single-use, `expires_in_seconds`
486
+ * 60 to 86400 (default 3600), audited without the secret.
487
+ */
488
+ createLink(id: string, body: UserLinkBody, idempotencyKey?: string): Promise<UserLink>;
489
+ /**
490
+ * Advanced search: a boolean filter tree (and / or / not) over profile
491
+ * columns, traits and metadata, roles, MFA, last country and dates; plus
492
+ * export and saved views.
493
+ */
494
+ search: {
495
+ /** `POST /v1/users/search` */
496
+ query(body: UserSearchBody): Promise<CursorPage<User> & {
497
+ total_count?: number;
498
+ }>;
499
+ /** `POST /v1/users/search/export` — the matching users (up to 10,000) as CSV or NDJSON text. */
500
+ export(body: UserSearchExportBody): Promise<string>;
501
+ views: {
502
+ list(): Promise<{
503
+ object: "list";
504
+ data: UserSearchView[];
505
+ has_more: boolean;
506
+ }>;
507
+ create(body: UserSearchViewBody & {
508
+ name: string;
509
+ }, idempotencyKey?: string): Promise<UserSearchView>;
510
+ update(id: string, body: UserSearchViewBody): Promise<UserSearchView>;
511
+ delete(id: string): Promise<{
512
+ object: "user_search_view";
513
+ id: string;
514
+ deleted: true;
515
+ }>;
516
+ };
517
+ };
518
+ /**
519
+ * Required actions: make a user owe a step at their next sign-in (any
520
+ * method). The sign-in holds until the user finishes it, except a `custom`
521
+ * step, which you close with `clear` once they have completed it in your app.
522
+ */
523
+ requiredActions: {
524
+ /** `POST /v1/users/:id/required_actions` — 201 when newly opened, 200 when it already was. */
525
+ request(id: string, body: RequiredActionBody, idempotencyKey?: string): Promise<RequiredAction>;
526
+ /** `GET /v1/users/:id/required_actions` — what the user owes. */
527
+ list(id: string): Promise<{
528
+ object: "list";
529
+ data: RequiredAction[];
530
+ has_more: boolean;
531
+ }>;
532
+ /** `DELETE /v1/users/:id/required_actions/:requiredActionId` — withdraw it (or close a `custom` step). */
533
+ clear(id: string, requiredActionId: string, idempotencyKey?: string): Promise<{
534
+ object: "required_action";
535
+ id: string;
536
+ deleted: true;
537
+ }>;
538
+ /** `POST /v1/required_actions/bulk` — the same action for an organization's members or a list of user ids (max 5000). */
539
+ bulk(body: RequiredActionBody & ({
540
+ organization_id: string;
541
+ } | {
542
+ user_ids: string[];
543
+ }), idempotencyKey?: string): Promise<RequiredActionBulkResult>;
544
+ };
545
+ /** Notes an operator keeps on a user (never shown to the user). */
546
+ notes: {
547
+ /** `GET /v1/users/:id/notes` — pinned first, then newest. */
548
+ list(id: string): Promise<{
549
+ object: "list";
550
+ data: UserNote[];
551
+ has_more: boolean;
552
+ total_count: number;
553
+ }>;
554
+ /** `POST /v1/users/:id/notes` */
555
+ create(id: string, body: {
556
+ body: string;
557
+ pinned?: boolean;
558
+ }, idempotencyKey?: string): Promise<UserNote>;
559
+ /** `PATCH /v1/users/:id/notes/:noteId` */
560
+ update(id: string, noteId: string, body: {
561
+ body?: string;
562
+ pinned?: boolean;
563
+ }, idempotencyKey?: string): Promise<UserNote>;
564
+ /** `DELETE /v1/users/:id/notes/:noteId` */
565
+ delete(id: string, noteId: string, idempotencyKey?: string): Promise<{
566
+ object: "user_note";
567
+ id: string;
568
+ deleted: true;
569
+ }>;
570
+ };
571
+ /**
572
+ * `GET /v1/users/:id/history` — every recorded profile, metadata and status
573
+ * change, newest first, with values before and after.
574
+ */
575
+ history(id: string, params?: {
576
+ limit?: number;
577
+ starting_after?: string;
578
+ action?: string[];
579
+ }): Promise<UserHistoryPage>;
580
+ /** Family accounts: a minor's parental-consent state, and their guardians. */
581
+ minorStatus(id: string): Promise<MinorStatus>;
582
+ /** Re-assess a user from their date-of-birth trait (for users created before age gating). */
583
+ assessMinor(id: string): Promise<MinorStatus>;
584
+ guardians: {
585
+ /** `POST /v1/users/:id/guardians` — a pending link with a one-time `consent_url`; `send_email` mails it. */
586
+ request(id: string, body: {
587
+ email?: string;
588
+ guardian_user_id?: string;
589
+ relationship?: string;
590
+ send_email?: boolean;
591
+ }, idempotencyKey?: string): Promise<GuardianLink & {
592
+ consent_url: string;
593
+ emailed: boolean;
594
+ }>;
595
+ /** Record consent obtained another way (a signed form, a call). */
596
+ approve(id: string, linkId: string, body?: {
597
+ note?: string;
598
+ }): Promise<GuardianLink>;
599
+ /** Withdraw a guardian link. */
600
+ revoke(id: string, linkId: string): Promise<GuardianLink>;
601
+ };
461
602
  /** Graceful deletion with a cancellation window (`DELETE /v1/users/:id` stays the immediate path). */
462
603
  deletion: {
463
604
  /** `POST /v1/users/:id/deletion` — schedule; `grace_seconds` defaults to the instance erasure grace. */
@@ -755,6 +896,16 @@ export interface UserProgressionEvent {
755
896
  delta: number;
756
897
  }
757
898
  /** One sign-in identity on a user: the base Atlas anchor, or a linked provider. */
899
+ /** A device-bound biometric sign-in key (public metadata only). */
900
+ export interface DeviceKey {
901
+ object: 'device_key';
902
+ id: string;
903
+ label: string | null;
904
+ platform: string | null;
905
+ biometric_bound: boolean;
906
+ last_used_at: number | null;
907
+ created_at: number;
908
+ }
758
909
  export interface Identity {
759
910
  object: 'identity';
760
911
  id: string;
@@ -785,3 +936,154 @@ export interface OAuthAccessToken {
785
936
  scopes: string[];
786
937
  refreshed: boolean;
787
938
  }
939
+ export type UserSearchOp = 'eq' | 'ne' | 'in' | 'nin' | 'contains' | 'starts_with' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'exists';
940
+ /** A condition `{ field, op, value }` or a group `{ and }` / `{ or }` / `{ not }`. */
941
+ export type UserSearchFilter = {
942
+ field: string;
943
+ op: UserSearchOp;
944
+ value?: unknown;
945
+ } | {
946
+ and: UserSearchFilter[];
947
+ } | {
948
+ or: UserSearchFilter[];
949
+ } | {
950
+ not: UserSearchFilter;
951
+ };
952
+ export interface UserSearchBody {
953
+ filter?: UserSearchFilter;
954
+ /** Free text over id, names, username, emails and phones, ANDed with the filter. */
955
+ query?: string;
956
+ order_by?: string;
957
+ limit?: number;
958
+ starting_after?: string;
959
+ offset?: number;
960
+ include_total_count?: boolean;
961
+ include_deleted?: boolean;
962
+ }
963
+ export interface UserSearchExportBody extends Omit<UserSearchBody, 'limit' | 'starting_after' | 'offset' | 'include_total_count'> {
964
+ format?: 'csv' | 'ndjson';
965
+ fields?: string[];
966
+ }
967
+ export interface UserSearchViewBody {
968
+ name?: string;
969
+ filter?: UserSearchFilter;
970
+ order_by?: string | null;
971
+ }
972
+ export interface UserSearchView {
973
+ object: 'user_search_view';
974
+ id: string;
975
+ name: string;
976
+ filter: UserSearchFilter;
977
+ order_by: string | null;
978
+ created_by: string | null;
979
+ created_at: number;
980
+ updated_at: number;
981
+ }
982
+ export type RequiredActionName = 'update_password' | 'verify_email' | 'accept_policy' | 'configure_mfa' | 'update_profile' | 'identity_verification' | 'custom';
983
+ export interface RequiredActionBody {
984
+ action: RequiredActionName;
985
+ /** `custom` only: the https URL the user is sent to. */
986
+ url?: string;
987
+ reason?: string;
988
+ }
989
+ export interface RequiredAction {
990
+ object: 'required_action';
991
+ id: string;
992
+ user_id: string;
993
+ action: RequiredActionName;
994
+ url: string | null;
995
+ reason: string | null;
996
+ created_by: string | null;
997
+ created_at: number;
998
+ }
999
+ export interface RequiredActionBulkResult {
1000
+ object: 'required_action_bulk_result';
1001
+ action: RequiredActionName;
1002
+ matched: number;
1003
+ created: number;
1004
+ already_open: number;
1005
+ skipped: number;
1006
+ }
1007
+ export interface UserLinkBody {
1008
+ type: 'password_reset' | 'email_verification';
1009
+ /** One of the user's addresses; default the primary. */
1010
+ email_address_id?: string;
1011
+ expires_in_seconds?: number;
1012
+ }
1013
+ export interface UserLink {
1014
+ object: 'user_link';
1015
+ type: 'password_reset' | 'email_verification';
1016
+ user_id: string;
1017
+ email_address_id: string;
1018
+ email_address: string;
1019
+ /** Present when the instance delivers this proof as a link. */
1020
+ url?: string;
1021
+ /** Present when the instance delivers this proof as a code. */
1022
+ code?: string;
1023
+ /** Password reset only: the reset attempt the link and code belong to. */
1024
+ attempt_id?: string;
1025
+ expires_at: number;
1026
+ }
1027
+ export interface UserNote {
1028
+ object: 'user_note';
1029
+ id: string;
1030
+ user_id: string;
1031
+ body: string;
1032
+ pinned: boolean;
1033
+ author: {
1034
+ type: 'api_key' | 'dashboard_user';
1035
+ id: string | null;
1036
+ };
1037
+ created_at: number;
1038
+ updated_at: number;
1039
+ }
1040
+ export interface UserHistoryEntry {
1041
+ object: 'user_history_entry';
1042
+ id: string;
1043
+ user_id: string;
1044
+ action: string;
1045
+ actor: {
1046
+ type: 'api_key' | 'dashboard_user' | 'user' | 'system';
1047
+ id: string | null;
1048
+ };
1049
+ /** Each changed field; a password or private_metadata value carries `redacted: true` and no values. */
1050
+ changes: Array<{
1051
+ field: string;
1052
+ before?: unknown;
1053
+ after?: unknown;
1054
+ redacted?: boolean;
1055
+ }>;
1056
+ reason: string | null;
1057
+ expires_at: number | null;
1058
+ created_at: number;
1059
+ }
1060
+ export interface UserHistoryPage {
1061
+ object: 'list';
1062
+ data: UserHistoryEntry[];
1063
+ has_more: boolean;
1064
+ next_cursor: string | null;
1065
+ }
1066
+ export interface GuardianLink {
1067
+ object: 'guardian_link';
1068
+ id: string;
1069
+ child_user_id: string;
1070
+ guardian_user_id: string | null;
1071
+ guardian_email: string | null;
1072
+ relationship: string | null;
1073
+ status: 'pending' | 'active' | 'declined' | 'revoked' | 'expired';
1074
+ expires_at: number | null;
1075
+ consent_method: 'email_link' | 'admin' | null;
1076
+ consented_at: number | null;
1077
+ created_at: number;
1078
+ }
1079
+ export interface MinorStatus {
1080
+ object: 'minor_status';
1081
+ /** not_required for anyone at or above the age of digital consent. */
1082
+ status: 'not_required' | 'consent_required' | 'consented' | 'declined';
1083
+ birthdate?: string;
1084
+ age_at_assessment?: number;
1085
+ consent_age?: number;
1086
+ jurisdiction?: string | null;
1087
+ consented_at?: number | null;
1088
+ guardians: GuardianLink[];
1089
+ }