@atlasauth/backend 0.1.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 (157) hide show
  1. package/dist/client/actions.d.ts +86 -0
  2. package/dist/client/actions.js +40 -0
  3. package/dist/client/actions.js.map +1 -0
  4. package/dist/client/actor-tokens.d.ts +28 -0
  5. package/dist/client/actor-tokens.js +15 -0
  6. package/dist/client/actor-tokens.js.map +1 -0
  7. package/dist/client/api-keys.d.ts +77 -0
  8. package/dist/client/api-keys.js +31 -0
  9. package/dist/client/api-keys.js.map +1 -0
  10. package/dist/client/attack-protection.d.ts +41 -0
  11. package/dist/client/attack-protection.js +14 -0
  12. package/dist/client/attack-protection.js.map +1 -0
  13. package/dist/client/audit-logs.d.ts +20 -0
  14. package/dist/client/audit-logs.js +11 -0
  15. package/dist/client/audit-logs.js.map +1 -0
  16. package/dist/client/billing-plans.d.ts +81 -0
  17. package/dist/client/billing-plans.js +27 -0
  18. package/dist/client/billing-plans.js.map +1 -0
  19. package/dist/client/bot-signals.d.ts +88 -0
  20. package/dist/client/bot-signals.js +24 -0
  21. package/dist/client/bot-signals.js.map +1 -0
  22. package/dist/client/branding.d.ts +140 -0
  23. package/dist/client/branding.js +19 -0
  24. package/dist/client/branding.js.map +1 -0
  25. package/dist/client/data-subject-requests.d.ts +40 -0
  26. package/dist/client/data-subject-requests.js +32 -0
  27. package/dist/client/data-subject-requests.js.map +1 -0
  28. package/dist/client/domains.d.ts +45 -0
  29. package/dist/client/domains.js +21 -0
  30. package/dist/client/domains.js.map +1 -0
  31. package/dist/client/email-templates.d.ts +51 -0
  32. package/dist/client/email-templates.js +24 -0
  33. package/dist/client/email-templates.js.map +1 -0
  34. package/dist/client/error.d.ts +31 -0
  35. package/dist/client/error.js +28 -0
  36. package/dist/client/error.js.map +1 -0
  37. package/dist/client/fga.d.ts +191 -0
  38. package/dist/client/fga.js +91 -0
  39. package/dist/client/fga.js.map +1 -0
  40. package/dist/client/import-export.d.ts +88 -0
  41. package/dist/client/import-export.js +28 -0
  42. package/dist/client/import-export.js.map +1 -0
  43. package/dist/client/index.d.ts +796 -0
  44. package/dist/client/index.js +174 -0
  45. package/dist/client/index.js.map +1 -0
  46. package/dist/client/instance-security.d.ts +79 -0
  47. package/dist/client/instance-security.js +44 -0
  48. package/dist/client/instance-security.js.map +1 -0
  49. package/dist/client/instance.d.ts +34 -0
  50. package/dist/client/instance.js +14 -0
  51. package/dist/client/instance.js.map +1 -0
  52. package/dist/client/invitations.d.ts +21 -0
  53. package/dist/client/invitations.js +18 -0
  54. package/dist/client/invitations.js.map +1 -0
  55. package/dist/client/jwt-templates.d.ts +26 -0
  56. package/dist/client/jwt-templates.js +26 -0
  57. package/dist/client/jwt-templates.js.map +1 -0
  58. package/dist/client/localizations.d.ts +43 -0
  59. package/dist/client/localizations.js +24 -0
  60. package/dist/client/localizations.js.map +1 -0
  61. package/dist/client/log-streams.d.ts +66 -0
  62. package/dist/client/log-streams.js +28 -0
  63. package/dist/client/log-streams.js.map +1 -0
  64. package/dist/client/lti-platforms.d.ts +49 -0
  65. package/dist/client/lti-platforms.js +24 -0
  66. package/dist/client/lti-platforms.js.map +1 -0
  67. package/dist/client/managed-waf.d.ts +100 -0
  68. package/dist/client/managed-waf.js +33 -0
  69. package/dist/client/managed-waf.js.map +1 -0
  70. package/dist/client/messaging.d.ts +56 -0
  71. package/dist/client/messaging.js +30 -0
  72. package/dist/client/messaging.js.map +1 -0
  73. package/dist/client/network-acls.d.ts +50 -0
  74. package/dist/client/network-acls.js +29 -0
  75. package/dist/client/network-acls.js.map +1 -0
  76. package/dist/client/oauth-clients.d.ts +75 -0
  77. package/dist/client/oauth-clients.js +45 -0
  78. package/dist/client/oauth-clients.js.map +1 -0
  79. package/dist/client/oauth-providers.d.ts +109 -0
  80. package/dist/client/oauth-providers.js +48 -0
  81. package/dist/client/oauth-providers.js.map +1 -0
  82. package/dist/client/organizations.d.ts +211 -0
  83. package/dist/client/organizations.js +136 -0
  84. package/dist/client/organizations.js.map +1 -0
  85. package/dist/client/paginate.d.ts +16 -0
  86. package/dist/client/paginate.js +35 -0
  87. package/dist/client/paginate.js.map +1 -0
  88. package/dist/client/radius-clients.d.ts +52 -0
  89. package/dist/client/radius-clients.js +24 -0
  90. package/dist/client/radius-clients.js.map +1 -0
  91. package/dist/client/rate-limit.d.ts +37 -0
  92. package/dist/client/rate-limit.js +20 -0
  93. package/dist/client/rate-limit.js.map +1 -0
  94. package/dist/client/request.d.ts +52 -0
  95. package/dist/client/request.js +102 -0
  96. package/dist/client/request.js.map +1 -0
  97. package/dist/client/resource-servers.d.ts +44 -0
  98. package/dist/client/resource-servers.js +24 -0
  99. package/dist/client/resource-servers.js.map +1 -0
  100. package/dist/client/restrictions.d.ts +39 -0
  101. package/dist/client/restrictions.js +29 -0
  102. package/dist/client/restrictions.js.map +1 -0
  103. package/dist/client/risk-based-mfa.d.ts +51 -0
  104. package/dist/client/risk-based-mfa.js +20 -0
  105. package/dist/client/risk-based-mfa.js.map +1 -0
  106. package/dist/client/roles.d.ts +84 -0
  107. package/dist/client/roles.js +57 -0
  108. package/dist/client/roles.js.map +1 -0
  109. package/dist/client/scim-provisioning.d.ts +94 -0
  110. package/dist/client/scim-provisioning.js +49 -0
  111. package/dist/client/scim-provisioning.js.map +1 -0
  112. package/dist/client/scim-tokens.d.ts +34 -0
  113. package/dist/client/scim-tokens.js +18 -0
  114. package/dist/client/scim-tokens.js.map +1 -0
  115. package/dist/client/sessions.d.ts +58 -0
  116. package/dist/client/sessions.js +26 -0
  117. package/dist/client/sessions.js.map +1 -0
  118. package/dist/client/sign-in-tokens.d.ts +18 -0
  119. package/dist/client/sign-in-tokens.js +11 -0
  120. package/dist/client/sign-in-tokens.js.map +1 -0
  121. package/dist/client/sms-templates.d.ts +46 -0
  122. package/dist/client/sms-templates.js +30 -0
  123. package/dist/client/sms-templates.js.map +1 -0
  124. package/dist/client/sso-connections.d.ts +76 -0
  125. package/dist/client/sso-connections.js +28 -0
  126. package/dist/client/sso-connections.js.map +1 -0
  127. package/dist/client/sso-onboarding.d.ts +76 -0
  128. package/dist/client/sso-onboarding.js +42 -0
  129. package/dist/client/sso-onboarding.js.map +1 -0
  130. package/dist/client/tokens.d.ts +37 -0
  131. package/dist/client/tokens.js +11 -0
  132. package/dist/client/tokens.js.map +1 -0
  133. package/dist/client/types.d.ts +41 -0
  134. package/dist/client/types.js +10 -0
  135. package/dist/client/types.js.map +1 -0
  136. package/dist/client/users.d.ts +204 -0
  137. package/dist/client/users.js +135 -0
  138. package/dist/client/users.js.map +1 -0
  139. package/dist/client/waitlist.d.ts +31 -0
  140. package/dist/client/waitlist.js +16 -0
  141. package/dist/client/waitlist.js.map +1 -0
  142. package/dist/client/webhooks.d.ts +50 -0
  143. package/dist/client/webhooks.js +24 -0
  144. package/dist/client/webhooks.js.map +1 -0
  145. package/dist/handshake.d.ts +76 -0
  146. package/dist/handshake.js +96 -0
  147. package/dist/handshake.js.map +1 -0
  148. package/dist/index.d.ts +6 -0
  149. package/dist/index.js +26 -0
  150. package/dist/index.js.map +1 -0
  151. package/dist/jwks-cache.d.ts +62 -0
  152. package/dist/jwks-cache.js +114 -0
  153. package/dist/jwks-cache.js.map +1 -0
  154. package/dist/verify.d.ts +162 -0
  155. package/dist/verify.js +226 -0
  156. package/dist/verify.js.map +1 -0
  157. package/package.json +26 -0
@@ -0,0 +1,49 @@
1
+ import { type RequestFn } from './request';
2
+ import type { ListPage } from './types';
3
+ /**
4
+ * An LTI 1.3 platform (LMS) registration for a core launch. Every field is a
5
+ * PUBLIC trust anchor — a launch is verified against the platform's own
6
+ * published JWKS, not a shared secret — so a registration is fully readable and
7
+ * editable with no reveal-once.
8
+ */
9
+ export interface LtiPlatform {
10
+ object: 'lti_platform';
11
+ id: string;
12
+ organization_id: string | null;
13
+ issuer: string;
14
+ client_id: string;
15
+ auth_login_url: string;
16
+ jwks_uri: string;
17
+ deployment_ids: string[];
18
+ created_at: number;
19
+ updated_at: number;
20
+ }
21
+ export interface CreateLtiPlatformBody {
22
+ issuer: string;
23
+ client_id: string;
24
+ /** An absolute https URL. */
25
+ auth_login_url: string;
26
+ /** An absolute https URL. */
27
+ jwks_uri: string;
28
+ /** At least one deployment id is required. */
29
+ deployment_ids: string[];
30
+ organization_id?: string;
31
+ }
32
+ export interface UpdateLtiPlatformBody {
33
+ auth_login_url?: string;
34
+ jwks_uri?: string;
35
+ deployment_ids?: string[];
36
+ /** Pass `null` to unbind the platform from an organization. */
37
+ organization_id?: string | null;
38
+ }
39
+ export declare function ltiPlatformsResource(request: RequestFn): {
40
+ list(): Promise<ListPage<LtiPlatform>>;
41
+ get(id: string): Promise<LtiPlatform>;
42
+ create(body: CreateLtiPlatformBody, idempotencyKey?: string): Promise<LtiPlatform>;
43
+ update(id: string, body: UpdateLtiPlatformBody): Promise<LtiPlatform>;
44
+ delete(id: string): Promise<{
45
+ object: "lti_platform";
46
+ id: string;
47
+ deleted: true;
48
+ }>;
49
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ltiPlatformsResource = ltiPlatformsResource;
4
+ const request_1 = require("./request");
5
+ function ltiPlatformsResource(request) {
6
+ return {
7
+ list() {
8
+ return request({ method: 'GET', path: '/v1/lti_platforms' });
9
+ },
10
+ get(id) {
11
+ return request({ method: 'GET', path: `/v1/lti_platforms/${(0, request_1.enc)(id)}` });
12
+ },
13
+ create(body, idempotencyKey) {
14
+ return request({ method: 'POST', path: '/v1/lti_platforms', body, idempotencyKey });
15
+ },
16
+ update(id, body) {
17
+ return request({ method: 'PATCH', path: `/v1/lti_platforms/${(0, request_1.enc)(id)}`, body });
18
+ },
19
+ delete(id) {
20
+ return request({ method: 'DELETE', path: `/v1/lti_platforms/${(0, request_1.enc)(id)}` });
21
+ },
22
+ };
23
+ }
24
+ //# sourceMappingURL=lti-platforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lti-platforms.js","sourceRoot":"","sources":["../../src/client/lti-platforms.ts"],"names":[],"mappings":";;AA0CA,oDAkBC;AA5DD,uCAAgD;AA0ChD,SAAgB,oBAAoB,CAAC,OAAkB;IACrD,OAAO;QACL,IAAI;YACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,CAAC,IAA2B,EAAE,cAAuB;YACzD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,CAAC,EAAU,EAAE,IAA2B;YAC5C,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAClF,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { type RequestFn } from './request';
2
+ /** Credential config, with secrets reduced to `has_*` markers. */
3
+ export interface ManagedWafCredential {
4
+ /** 'keys' (BYO IAM key/secret) | 'role' (cross-account STS AssumeRole). */
5
+ mode: string;
6
+ /** `keys` mode: the IAM access key id (an identifier, not a secret). */
7
+ access_key_id: string | null;
8
+ /** Whether a secret access key EXISTS — never the secret itself. */
9
+ has_secret_access_key: boolean;
10
+ /** `role` mode: the ARN of the cross-account role Atlas assumes. */
11
+ role_arn: string | null;
12
+ /** Whether an AssumeRole ExternalId EXISTS — never the value itself. */
13
+ has_external_id: boolean;
14
+ }
15
+ /**
16
+ * §5 Managed AWS WAF config + provisioning state. Secrets are write-only and
17
+ * NEVER returned; GET exposes only `has_*` markers. When the instance has no
18
+ * config the response collapses to `{ configured: false, enabled: false,
19
+ * status: 'disabled' }` and the config fields are absent.
20
+ */
21
+ export interface ManagedWaf {
22
+ object: 'managed_waf';
23
+ configured: boolean;
24
+ enabled: boolean;
25
+ /** 'disabled' | 'active' | 'error' */
26
+ status: string;
27
+ scope?: string;
28
+ region?: string;
29
+ web_acl_name?: string;
30
+ edge_resource_arn?: string | null;
31
+ cloudfront_distribution_id?: string | null;
32
+ token_domains?: string[];
33
+ gated_paths?: string[];
34
+ immunity_seconds?: number;
35
+ credential?: ManagedWafCredential;
36
+ web_acl_id?: string | null;
37
+ web_acl_arn?: string | null;
38
+ last_error?: string | null;
39
+ last_provisioned_at?: number | null;
40
+ updated_at?: number;
41
+ }
42
+ /** Just the provisioning state — what `GET /v1/managed_waf/status` returns. */
43
+ export interface ManagedWafStatus {
44
+ object: 'managed_waf_status';
45
+ enabled: boolean;
46
+ status: string;
47
+ web_acl_id: string | null;
48
+ web_acl_arn: string | null;
49
+ last_error: string | null;
50
+ last_provisioned_at: number | null;
51
+ }
52
+ /**
53
+ * The outcome of a provision/deprovision: the full config plus the FAIL-SAFE
54
+ * result. An AWS failure rides `ok: false` + `error` in the body rather than
55
+ * throwing, so it never looks like an Atlas outage.
56
+ */
57
+ export type ManagedWafOutcome = ManagedWaf & {
58
+ ok: boolean;
59
+ error: string | null;
60
+ };
61
+ export interface UpdateManagedWafBody {
62
+ enabled?: boolean;
63
+ /** 'REGIONAL' | 'CLOUDFRONT' */
64
+ scope?: string;
65
+ region?: string;
66
+ web_acl_name?: string;
67
+ edge_resource_arn?: string | null;
68
+ cloudfront_distribution_id?: string | null;
69
+ token_domains?: string[];
70
+ gated_paths?: string[];
71
+ /** 60..86400 seconds. */
72
+ immunity_seconds?: number;
73
+ credential?: {
74
+ /** 'keys' | 'role' */
75
+ mode?: string;
76
+ access_key_id?: string | null;
77
+ /** Write-only: accepted, encrypted at rest, never returned. */
78
+ secret_access_key?: string | null;
79
+ role_arn?: string | null;
80
+ /** Write-only: accepted, encrypted at rest, never returned. */
81
+ external_id?: string | null;
82
+ };
83
+ }
84
+ /**
85
+ * The self-service control plane for Atlas's managed AWS WAF captcha gate —
86
+ * config + write-only credentials, and the provision/deprovision actions that
87
+ * reconcile the WebACL.
88
+ */
89
+ export declare function managedWafResource(request: RequestFn): {
90
+ /** Read config + provisioning state, with secrets reduced to `has_*` markers. */
91
+ get(): Promise<ManagedWaf>;
92
+ /** Read just the provisioning state. */
93
+ status(): Promise<ManagedWafStatus>;
94
+ /** Set config and write-only credentials; omitted fields are left unchanged. */
95
+ update(body: UpdateManagedWafBody): Promise<ManagedWaf>;
96
+ /** Apply now — idempotent create/update + associate the WebACL. */
97
+ provision(): Promise<ManagedWafOutcome>;
98
+ /** Disassociate and delete the WebACL. */
99
+ deprovision(): Promise<ManagedWafOutcome>;
100
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.managedWafResource = managedWafResource;
4
+ /**
5
+ * The self-service control plane for Atlas's managed AWS WAF captcha gate —
6
+ * config + write-only credentials, and the provision/deprovision actions that
7
+ * reconcile the WebACL.
8
+ */
9
+ function managedWafResource(request) {
10
+ return {
11
+ /** Read config + provisioning state, with secrets reduced to `has_*` markers. */
12
+ get() {
13
+ return request({ method: 'GET', path: '/v1/managed_waf' });
14
+ },
15
+ /** Read just the provisioning state. */
16
+ status() {
17
+ return request({ method: 'GET', path: '/v1/managed_waf/status' });
18
+ },
19
+ /** Set config and write-only credentials; omitted fields are left unchanged. */
20
+ update(body) {
21
+ return request({ method: 'PUT', path: '/v1/managed_waf', body });
22
+ },
23
+ /** Apply now — idempotent create/update + associate the WebACL. */
24
+ provision() {
25
+ return request({ method: 'POST', path: '/v1/managed_waf/provision' });
26
+ },
27
+ /** Disassociate and delete the WebACL. */
28
+ deprovision() {
29
+ return request({ method: 'POST', path: '/v1/managed_waf/deprovision' });
30
+ },
31
+ };
32
+ }
33
+ //# sourceMappingURL=managed-waf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-waf.js","sourceRoot":"","sources":["../../src/client/managed-waf.ts"],"names":[],"mappings":";;AA8FA,gDAuBC;AA5BD;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,OAAkB;IACnD,OAAO;QACL,iFAAiF;QACjF,GAAG;YACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,wCAAwC;QACxC,MAAM;YACJ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,gFAAgF;QAChF,MAAM,CAAC,IAA0B;YAC/B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,mEAAmE;QACnE,SAAS;YACP,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,0CAA0C;QAC1C,WAAW;YACT,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC,CAAC;QAC1E,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { type RequestFn } from './request';
2
+ /**
3
+ * §BYOK messaging provider config — wire the tenant's own email/SMS provider
4
+ * (Resend/SES/SMTP/Brevo/Mailgun, Twilio) over the secret-key BAPI.
5
+ *
6
+ * A provider SECRET is WRITE-ONLY: it goes in through `config` and is never
7
+ * read back — a response reports only WHICH secret keys are set (`secrets_set`).
8
+ * Omit a secret on an edit to keep the stored one (so a from-address change need
9
+ * not re-enter the API key).
10
+ */
11
+ export interface MessagingProvider {
12
+ object: 'messaging_provider';
13
+ channel: 'email' | 'sms';
14
+ transport: string;
15
+ from_address: string | null;
16
+ status: string;
17
+ /** Non-secret config only — secret values are stripped before serialising. */
18
+ config: Record<string, unknown>;
19
+ /** Which secret keys are set for this transport, never their values. */
20
+ secrets_set: Record<string, boolean>;
21
+ updated_at: number;
22
+ }
23
+ export interface MessagingProviders {
24
+ object: 'messaging_providers';
25
+ email: MessagingProvider | null;
26
+ sms: MessagingProvider | null;
27
+ }
28
+ export interface MessagingProviderInput {
29
+ /** The transport, e.g. `resend`, `ses`, `smtp` (email) or `twilio` (sms). */
30
+ transport: string;
31
+ from_address?: string;
32
+ /** Transport config; carries the write-only secret keys on write. */
33
+ config?: Record<string, unknown>;
34
+ }
35
+ export interface MessagingTestResult {
36
+ object: 'messaging_test';
37
+ channel: string;
38
+ sent_to: string;
39
+ ok: true;
40
+ }
41
+ export interface DeletedMessagingProvider {
42
+ object: 'messaging_provider';
43
+ channel: string;
44
+ deleted: true;
45
+ }
46
+ export declare function messagingResource(request: RequestFn): {
47
+ /** The instance's configured email and SMS providers, secrets omitted. */
48
+ get(): Promise<MessagingProviders>;
49
+ setEmail(body: MessagingProviderInput): Promise<MessagingProvider>;
50
+ setSms(body: MessagingProviderInput): Promise<MessagingProvider>;
51
+ deleteChannel(channel: "email" | "sms"): Promise<DeletedMessagingProvider>;
52
+ /** Send a fixed, clearly-marked test message through the channel's provider. */
53
+ test(channel: "email" | "sms", body: {
54
+ to: string;
55
+ }): Promise<MessagingTestResult>;
56
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.messagingResource = messagingResource;
4
+ const request_1 = require("./request");
5
+ function messagingResource(request) {
6
+ return {
7
+ /** The instance's configured email and SMS providers, secrets omitted. */
8
+ get() {
9
+ return request({ method: 'GET', path: '/v1/messaging_providers' });
10
+ },
11
+ setEmail(body) {
12
+ return request({ method: 'PUT', path: '/v1/messaging_providers/email', body });
13
+ },
14
+ setSms(body) {
15
+ return request({ method: 'PUT', path: '/v1/messaging_providers/sms', body });
16
+ },
17
+ deleteChannel(channel) {
18
+ return request({ method: 'DELETE', path: `/v1/messaging_providers/${(0, request_1.enc)(channel)}` });
19
+ },
20
+ /** Send a fixed, clearly-marked test message through the channel's provider. */
21
+ test(channel, body) {
22
+ return request({
23
+ method: 'POST',
24
+ path: `/v1/messaging_providers/${(0, request_1.enc)(channel)}/test`,
25
+ body,
26
+ });
27
+ },
28
+ };
29
+ }
30
+ //# sourceMappingURL=messaging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/client/messaging.ts"],"names":[],"mappings":";;AAmDA,8CAwBC;AA3ED,uCAAgD;AAmDhD,SAAgB,iBAAiB,CAAC,OAAkB;IAClD,OAAO;QACL,0EAA0E;QAC1E,GAAG;YACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC,CAAC;QACrE,CAAC;QACD,QAAQ,CAAC,IAA4B;YACnC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,CAAC,CAAC;QACjF,CAAC;QACD,MAAM,CAAC,IAA4B;YACjC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,aAAa,CAAC,OAAwB;YACpC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,2BAA2B,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QACxF,CAAC;QACD,gFAAgF;QAChF,IAAI,CAAC,OAAwB,EAAE,IAAoB;YACjD,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,2BAA2B,IAAA,aAAG,EAAC,OAAO,CAAC,OAAO;gBACpD,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { type RequestFn } from './request';
2
+ import type { ListPage } from './types';
3
+ export type NetworkAclAction = 'allow' | 'deny';
4
+ /**
5
+ * §11.2 a per-instance IP allow/deny rule — a richer control than the single
6
+ * ip_allowlist, layered on top of it. Rules are evaluated in priority order
7
+ * (lower first), first match wins.
8
+ */
9
+ export interface NetworkAcl {
10
+ object: 'network_acl';
11
+ id: string;
12
+ action: NetworkAclAction;
13
+ /** A single IP or CIDR range; refused at write time if malformed. */
14
+ cidr: string;
15
+ description: string | null;
16
+ priority: number;
17
+ enabled: boolean;
18
+ created_at: number;
19
+ updated_at: number;
20
+ }
21
+ export interface CreateNetworkAclBody {
22
+ action: NetworkAclAction;
23
+ cidr: string;
24
+ description?: string | null;
25
+ priority?: number;
26
+ enabled?: boolean;
27
+ }
28
+ export interface UpdateNetworkAclBody {
29
+ action?: NetworkAclAction;
30
+ cidr?: string;
31
+ description?: string | null;
32
+ priority?: number;
33
+ enabled?: boolean;
34
+ }
35
+ /**
36
+ * CRUD over the instance's Network ACL rules. Enforcement lives in the request
37
+ * choke point; this surface just manages the rules, and every write is audited.
38
+ */
39
+ export declare function networkAclsResource(request: RequestFn): {
40
+ /** All rules for the instance, in priority order. */
41
+ list(): Promise<ListPage<NetworkAcl>>;
42
+ get(id: string): Promise<NetworkAcl>;
43
+ create(body: CreateNetworkAclBody, idempotencyKey?: string): Promise<NetworkAcl>;
44
+ update(id: string, body: UpdateNetworkAclBody): Promise<NetworkAcl>;
45
+ delete(id: string): Promise<{
46
+ object: "network_acl";
47
+ id: string;
48
+ deleted: true;
49
+ }>;
50
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.networkAclsResource = networkAclsResource;
4
+ const request_1 = require("./request");
5
+ /**
6
+ * CRUD over the instance's Network ACL rules. Enforcement lives in the request
7
+ * choke point; this surface just manages the rules, and every write is audited.
8
+ */
9
+ function networkAclsResource(request) {
10
+ return {
11
+ /** All rules for the instance, in priority order. */
12
+ list() {
13
+ return request({ method: 'GET', path: '/v1/network_acls' });
14
+ },
15
+ get(id) {
16
+ return request({ method: 'GET', path: `/v1/network_acls/${(0, request_1.enc)(id)}` });
17
+ },
18
+ create(body, idempotencyKey) {
19
+ return request({ method: 'POST', path: '/v1/network_acls', body, idempotencyKey });
20
+ },
21
+ update(id, body) {
22
+ return request({ method: 'PATCH', path: `/v1/network_acls/${(0, request_1.enc)(id)}`, body });
23
+ },
24
+ delete(id) {
25
+ return request({ method: 'DELETE', path: `/v1/network_acls/${(0, request_1.enc)(id)}` });
26
+ },
27
+ };
28
+ }
29
+ //# sourceMappingURL=network-acls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-acls.js","sourceRoot":"","sources":["../../src/client/network-acls.ts"],"names":[],"mappings":";;AA2CA,kDAmBC;AA9DD,uCAAgD;AAuChD;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,OAAkB;IACpD,OAAO;QACL,qDAAqD;QACrD,IAAI;YACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAC9D,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,oBAAoB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACzE,CAAC;QACD,MAAM,CAAC,IAA0B,EAAE,cAAuB;YACxD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,CAAC,EAAU,EAAE,IAA0B;YAC3C,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,oBAAoB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACjF,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5E,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { type RequestFn } from './request';
2
+ import type { ListPage } from './types';
3
+ export interface OAuthClient {
4
+ object: 'oauth_client';
5
+ id: string;
6
+ client_id: string;
7
+ name: string;
8
+ logo_url: string | null;
9
+ redirect_uris: string[];
10
+ allowed_scopes: string[];
11
+ grant_types: string[];
12
+ token_endpoint_auth_method: 'client_secret_basic' | 'client_secret_post' | 'none';
13
+ secret_prefix: string | null;
14
+ is_public: boolean;
15
+ first_party: boolean;
16
+ created_at: number;
17
+ updated_at: number;
18
+ }
19
+ /** Create/rotate reveal the secret exactly once, alongside the client. */
20
+ export interface OAuthClientWithSecret extends OAuthClient {
21
+ client_secret?: string;
22
+ note: string;
23
+ }
24
+ export interface ClientGrant {
25
+ object: 'client_grant';
26
+ id: string;
27
+ /** The internal OAuthClient.id (not the public client_id). */
28
+ client_id: string;
29
+ resource_server_id: string;
30
+ scopes: string[];
31
+ created_at: number;
32
+ updated_at: number;
33
+ }
34
+ export interface CreateOAuthClientBody {
35
+ name: string;
36
+ redirect_uris: string[];
37
+ allowed_scopes?: string[];
38
+ grant_types?: string[];
39
+ token_endpoint_auth_method?: 'client_secret_basic' | 'client_secret_post' | 'none';
40
+ logo_url?: string;
41
+ first_party?: boolean;
42
+ }
43
+ export interface UpdateOAuthClientBody {
44
+ name?: string;
45
+ redirect_uris?: string[];
46
+ allowed_scopes?: string[];
47
+ token_endpoint_auth_method?: 'client_secret_basic' | 'client_secret_post' | 'none';
48
+ logo_url?: string | null;
49
+ first_party?: boolean;
50
+ }
51
+ export declare function oauthClientsResource(request: RequestFn): {
52
+ list(): Promise<ListPage<OAuthClient>>;
53
+ get(id: string): Promise<OAuthClient>;
54
+ create(body: CreateOAuthClientBody, idempotencyKey?: string): Promise<OAuthClientWithSecret>;
55
+ update(id: string, body: UpdateOAuthClientBody): Promise<OAuthClient>;
56
+ rotateSecret(id: string): Promise<OAuthClientWithSecret>;
57
+ delete(id: string): Promise<{
58
+ object: "oauth_client";
59
+ id: string;
60
+ deleted: true;
61
+ note: string;
62
+ }>;
63
+ grants: {
64
+ list(clientId: string): Promise<ListPage<ClientGrant>>;
65
+ create(clientId: string, body: {
66
+ resource_server_id: string;
67
+ scopes?: string[];
68
+ }): Promise<ClientGrant>;
69
+ delete(clientId: string, grantId: string): Promise<{
70
+ object: "client_grant";
71
+ id: string;
72
+ deleted: true;
73
+ }>;
74
+ };
75
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauthClientsResource = oauthClientsResource;
4
+ const request_1 = require("./request");
5
+ function oauthClientsResource(request) {
6
+ return {
7
+ list() {
8
+ return request({ method: 'GET', path: '/v1/oauth_clients' });
9
+ },
10
+ get(id) {
11
+ return request({ method: 'GET', path: `/v1/oauth_clients/${(0, request_1.enc)(id)}` });
12
+ },
13
+ create(body, idempotencyKey) {
14
+ return request({ method: 'POST', path: '/v1/oauth_clients', body, idempotencyKey });
15
+ },
16
+ update(id, body) {
17
+ return request({ method: 'PATCH', path: `/v1/oauth_clients/${(0, request_1.enc)(id)}`, body });
18
+ },
19
+ rotateSecret(id) {
20
+ return request({ method: 'POST', path: `/v1/oauth_clients/${(0, request_1.enc)(id)}/rotate_secret` });
21
+ },
22
+ delete(id) {
23
+ return request({ method: 'DELETE', path: `/v1/oauth_clients/${(0, request_1.enc)(id)}` });
24
+ },
25
+ grants: {
26
+ list(clientId) {
27
+ return request({ method: 'GET', path: `/v1/oauth_clients/${(0, request_1.enc)(clientId)}/grants` });
28
+ },
29
+ create(clientId, body) {
30
+ return request({
31
+ method: 'POST',
32
+ path: `/v1/oauth_clients/${(0, request_1.enc)(clientId)}/grants`,
33
+ body,
34
+ });
35
+ },
36
+ delete(clientId, grantId) {
37
+ return request({
38
+ method: 'DELETE',
39
+ path: `/v1/oauth_clients/${(0, request_1.enc)(clientId)}/grants/${(0, request_1.enc)(grantId)}`,
40
+ });
41
+ },
42
+ },
43
+ };
44
+ }
45
+ //# sourceMappingURL=oauth-clients.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-clients.js","sourceRoot":"","sources":["../../src/client/oauth-clients.ts"],"names":[],"mappings":";;AAwDA,oDA8CC;AAtGD,uCAAgD;AAwDhD,SAAgB,oBAAoB,CAAC,OAAkB;IACrD,OAAO;QACL,IAAI;YACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,CAAC,IAA2B,EAAE,cAAuB;YACzD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,CAAC,EAAU,EAAE,IAA2B;YAC5C,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAClF,CAAC;QACD,YAAY,CAAC,EAAU;YACrB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACzF,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,EAAE;YACN,IAAI,CAAC,QAAgB;gBACnB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;YACvF,CAAC;YACD,MAAM,CACJ,QAAgB,EAChB,IAAuD;gBAEvD,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,QAAQ,CAAC,SAAS;oBACjD,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;YACD,MAAM,CACJ,QAAgB,EAChB,OAAe;gBAEf,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,QAAQ;oBAChB,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,QAAQ,CAAC,WAAW,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE;iBAClE,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { type RequestFn } from './request';
2
+ import type { ListPage } from './types';
3
+ /** One credential input a provider needs (client_id, team_id, private key…). */
4
+ export interface OAuthProviderCredentialField {
5
+ key: string;
6
+ label: string;
7
+ /** Stored encrypted and never returned. */
8
+ secret?: boolean;
9
+ multiline?: boolean;
10
+ optional?: boolean;
11
+ help?: string;
12
+ }
13
+ /** A provider-specific option beyond credentials (Google `hd`, tenant, prompt…). */
14
+ export interface OAuthProviderSetting {
15
+ key: string;
16
+ label: string;
17
+ type: 'string' | 'boolean' | 'select';
18
+ options?: string[];
19
+ help?: string;
20
+ }
21
+ /**
22
+ * A single social sign-in provider row: the whole catalog entry plus whatever is
23
+ * configured for this instance, and NEVER the secret — only `has_secret`. The
24
+ * `redirect_uri` is derived from the instance's own FAPI host (the exact string
25
+ * to register at the provider console), never accepted from the caller.
26
+ */
27
+ export interface OAuthProvider {
28
+ object: 'oauth_provider';
29
+ provider: string;
30
+ display_name: string;
31
+ category: string;
32
+ tier: string;
33
+ setup_docs_url: string | null;
34
+ default_scopes: string[];
35
+ credential_fields: OAuthProviderCredentialField[];
36
+ settings: OAuthProviderSetting[];
37
+ native: boolean;
38
+ redirect_uri: string;
39
+ configured: boolean;
40
+ client_id: string | null;
41
+ has_secret: boolean;
42
+ enabled: boolean;
43
+ /** §6.5 which screens this provider serves. Both default true. */
44
+ allow_sign_in: boolean;
45
+ allow_sign_up: boolean;
46
+ scopes: string[];
47
+ updated_at: number | null;
48
+ }
49
+ /**
50
+ * Credentials for the redirect code-exchange flow. `client_id`/`client_secret`
51
+ * cover the common two-field case; `values` carries the exact per-field shape for
52
+ * providers that need more (Apple team/key id, etc.), and `settings` the
53
+ * provider-specific options. The secret is write-only.
54
+ */
55
+ export interface UpsertOAuthProviderBody {
56
+ client_id?: string;
57
+ /** Write-only; stored encrypted, never returned. Required for redirect-only providers. */
58
+ client_secret?: string;
59
+ scopes?: string[];
60
+ values?: Record<string, string>;
61
+ settings?: Record<string, string>;
62
+ }
63
+ /** The connectivity test's honest verdict: what it proved, and what it did not. */
64
+ export interface OAuthConnectionTest {
65
+ object: 'oauth_connection_test';
66
+ provider: string;
67
+ ok: boolean;
68
+ reason: string;
69
+ message: string;
70
+ /** The credential facts this check verified. */
71
+ checked: string[];
72
+ /** What a pass deliberately does NOT prove (redirect registration, consent…). */
73
+ not_checked: string[];
74
+ }
75
+ export declare function oauthProvidersResource(request: RequestFn): {
76
+ /** The whole catalog, configured or not — a not-yet-set-up provider is exactly the one a setup agent wants. */
77
+ list(): Promise<ListPage<OAuthProvider>>;
78
+ get(provider: string): Promise<OAuthProvider>;
79
+ /** Set (or replace) this instance's own credentials for a provider. */
80
+ upsert(provider: string, body: UpsertOAuthProviderBody, idempotencyKey?: string): Promise<{
81
+ object: "oauth_provider";
82
+ provider: string;
83
+ configured: true;
84
+ }>;
85
+ delete(provider: string): Promise<{
86
+ object: "oauth_provider";
87
+ provider: string;
88
+ deleted: true;
89
+ note: string;
90
+ }>;
91
+ /** Turn a configured provider on or off. Refused if it has no usable credentials. */
92
+ setEnabled(provider: string, enabled: boolean): Promise<{
93
+ object: "oauth_provider";
94
+ provider: string;
95
+ enabled: boolean;
96
+ }>;
97
+ /** §6.5 which screens this provider serves. At least one must be true. */
98
+ setScope(provider: string, body: {
99
+ allow_sign_in: boolean;
100
+ allow_sign_up: boolean;
101
+ }): Promise<{
102
+ object: "oauth_provider";
103
+ provider: string;
104
+ allow_sign_in: boolean;
105
+ allow_sign_up: boolean;
106
+ }>;
107
+ /** Verify the stored credentials against the provider's token endpoint, without enabling it. */
108
+ test(provider: string): Promise<OAuthConnectionTest>;
109
+ };