@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.
- package/dist/client/actions.d.ts +86 -0
- package/dist/client/actions.js +40 -0
- package/dist/client/actions.js.map +1 -0
- package/dist/client/actor-tokens.d.ts +28 -0
- package/dist/client/actor-tokens.js +15 -0
- package/dist/client/actor-tokens.js.map +1 -0
- package/dist/client/api-keys.d.ts +77 -0
- package/dist/client/api-keys.js +31 -0
- package/dist/client/api-keys.js.map +1 -0
- package/dist/client/attack-protection.d.ts +41 -0
- package/dist/client/attack-protection.js +14 -0
- package/dist/client/attack-protection.js.map +1 -0
- package/dist/client/audit-logs.d.ts +20 -0
- package/dist/client/audit-logs.js +11 -0
- package/dist/client/audit-logs.js.map +1 -0
- package/dist/client/billing-plans.d.ts +81 -0
- package/dist/client/billing-plans.js +27 -0
- package/dist/client/billing-plans.js.map +1 -0
- package/dist/client/bot-signals.d.ts +88 -0
- package/dist/client/bot-signals.js +24 -0
- package/dist/client/bot-signals.js.map +1 -0
- package/dist/client/branding.d.ts +140 -0
- package/dist/client/branding.js +19 -0
- package/dist/client/branding.js.map +1 -0
- package/dist/client/data-subject-requests.d.ts +40 -0
- package/dist/client/data-subject-requests.js +32 -0
- package/dist/client/data-subject-requests.js.map +1 -0
- package/dist/client/domains.d.ts +45 -0
- package/dist/client/domains.js +21 -0
- package/dist/client/domains.js.map +1 -0
- package/dist/client/email-templates.d.ts +51 -0
- package/dist/client/email-templates.js +24 -0
- package/dist/client/email-templates.js.map +1 -0
- package/dist/client/error.d.ts +31 -0
- package/dist/client/error.js +28 -0
- package/dist/client/error.js.map +1 -0
- package/dist/client/fga.d.ts +191 -0
- package/dist/client/fga.js +91 -0
- package/dist/client/fga.js.map +1 -0
- package/dist/client/import-export.d.ts +88 -0
- package/dist/client/import-export.js +28 -0
- package/dist/client/import-export.js.map +1 -0
- package/dist/client/index.d.ts +796 -0
- package/dist/client/index.js +174 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/instance-security.d.ts +79 -0
- package/dist/client/instance-security.js +44 -0
- package/dist/client/instance-security.js.map +1 -0
- package/dist/client/instance.d.ts +34 -0
- package/dist/client/instance.js +14 -0
- package/dist/client/instance.js.map +1 -0
- package/dist/client/invitations.d.ts +21 -0
- package/dist/client/invitations.js +18 -0
- package/dist/client/invitations.js.map +1 -0
- package/dist/client/jwt-templates.d.ts +26 -0
- package/dist/client/jwt-templates.js +26 -0
- package/dist/client/jwt-templates.js.map +1 -0
- package/dist/client/localizations.d.ts +43 -0
- package/dist/client/localizations.js +24 -0
- package/dist/client/localizations.js.map +1 -0
- package/dist/client/log-streams.d.ts +66 -0
- package/dist/client/log-streams.js +28 -0
- package/dist/client/log-streams.js.map +1 -0
- package/dist/client/lti-platforms.d.ts +49 -0
- package/dist/client/lti-platforms.js +24 -0
- package/dist/client/lti-platforms.js.map +1 -0
- package/dist/client/managed-waf.d.ts +100 -0
- package/dist/client/managed-waf.js +33 -0
- package/dist/client/managed-waf.js.map +1 -0
- package/dist/client/messaging.d.ts +56 -0
- package/dist/client/messaging.js +30 -0
- package/dist/client/messaging.js.map +1 -0
- package/dist/client/network-acls.d.ts +50 -0
- package/dist/client/network-acls.js +29 -0
- package/dist/client/network-acls.js.map +1 -0
- package/dist/client/oauth-clients.d.ts +75 -0
- package/dist/client/oauth-clients.js +45 -0
- package/dist/client/oauth-clients.js.map +1 -0
- package/dist/client/oauth-providers.d.ts +109 -0
- package/dist/client/oauth-providers.js +48 -0
- package/dist/client/oauth-providers.js.map +1 -0
- package/dist/client/organizations.d.ts +211 -0
- package/dist/client/organizations.js +136 -0
- package/dist/client/organizations.js.map +1 -0
- package/dist/client/paginate.d.ts +16 -0
- package/dist/client/paginate.js +35 -0
- package/dist/client/paginate.js.map +1 -0
- package/dist/client/radius-clients.d.ts +52 -0
- package/dist/client/radius-clients.js +24 -0
- package/dist/client/radius-clients.js.map +1 -0
- package/dist/client/rate-limit.d.ts +37 -0
- package/dist/client/rate-limit.js +20 -0
- package/dist/client/rate-limit.js.map +1 -0
- package/dist/client/request.d.ts +52 -0
- package/dist/client/request.js +102 -0
- package/dist/client/request.js.map +1 -0
- package/dist/client/resource-servers.d.ts +44 -0
- package/dist/client/resource-servers.js +24 -0
- package/dist/client/resource-servers.js.map +1 -0
- package/dist/client/restrictions.d.ts +39 -0
- package/dist/client/restrictions.js +29 -0
- package/dist/client/restrictions.js.map +1 -0
- package/dist/client/risk-based-mfa.d.ts +51 -0
- package/dist/client/risk-based-mfa.js +20 -0
- package/dist/client/risk-based-mfa.js.map +1 -0
- package/dist/client/roles.d.ts +84 -0
- package/dist/client/roles.js +57 -0
- package/dist/client/roles.js.map +1 -0
- package/dist/client/scim-provisioning.d.ts +94 -0
- package/dist/client/scim-provisioning.js +49 -0
- package/dist/client/scim-provisioning.js.map +1 -0
- package/dist/client/scim-tokens.d.ts +34 -0
- package/dist/client/scim-tokens.js +18 -0
- package/dist/client/scim-tokens.js.map +1 -0
- package/dist/client/sessions.d.ts +58 -0
- package/dist/client/sessions.js +26 -0
- package/dist/client/sessions.js.map +1 -0
- package/dist/client/sign-in-tokens.d.ts +18 -0
- package/dist/client/sign-in-tokens.js +11 -0
- package/dist/client/sign-in-tokens.js.map +1 -0
- package/dist/client/sms-templates.d.ts +46 -0
- package/dist/client/sms-templates.js +30 -0
- package/dist/client/sms-templates.js.map +1 -0
- package/dist/client/sso-connections.d.ts +76 -0
- package/dist/client/sso-connections.js +28 -0
- package/dist/client/sso-connections.js.map +1 -0
- package/dist/client/sso-onboarding.d.ts +76 -0
- package/dist/client/sso-onboarding.js +42 -0
- package/dist/client/sso-onboarding.js.map +1 -0
- package/dist/client/tokens.d.ts +37 -0
- package/dist/client/tokens.js +11 -0
- package/dist/client/tokens.js.map +1 -0
- package/dist/client/types.d.ts +41 -0
- package/dist/client/types.js +10 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/users.d.ts +204 -0
- package/dist/client/users.js +135 -0
- package/dist/client/users.js.map +1 -0
- package/dist/client/waitlist.d.ts +31 -0
- package/dist/client/waitlist.js +16 -0
- package/dist/client/waitlist.js.map +1 -0
- package/dist/client/webhooks.d.ts +50 -0
- package/dist/client/webhooks.js +24 -0
- package/dist/client/webhooks.js.map +1 -0
- package/dist/handshake.d.ts +76 -0
- package/dist/handshake.js +96 -0
- package/dist/handshake.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/jwks-cache.d.ts +62 -0
- package/dist/jwks-cache.js +114 -0
- package/dist/jwks-cache.js.map +1 -0
- package/dist/verify.d.ts +162 -0
- package/dist/verify.js +226 -0
- package/dist/verify.js.map +1 -0
- package/package.json +26 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { RequestFn } from './request';
|
|
2
|
+
/**
|
|
3
|
+
* The hosted-page / email appearance bag (`authConfig.branding`). Every field is
|
|
4
|
+
* optional and authored by a customer; the render paths only ever read the
|
|
5
|
+
* SANITIZED resolution of it, never these raw values. The flat colour/logo
|
|
6
|
+
* fields feed both email and the hosted page; the deeper fields (`layout`,
|
|
7
|
+
* `interaction`, `card`, …) shape the hosted page only.
|
|
8
|
+
*/
|
|
9
|
+
export interface Branding {
|
|
10
|
+
applicationName?: string;
|
|
11
|
+
logoUrl?: string;
|
|
12
|
+
colorPrimary?: string;
|
|
13
|
+
colorBackground?: string;
|
|
14
|
+
colorText?: string;
|
|
15
|
+
/** Shown in the email footer; falls back to the application name. */
|
|
16
|
+
supportEmail?: string;
|
|
17
|
+
colorAccent?: string;
|
|
18
|
+
colorCard?: string;
|
|
19
|
+
colorBorder?: string;
|
|
20
|
+
/** A CSS length like `12px` or `0.75rem`. */
|
|
21
|
+
borderRadius?: string;
|
|
22
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
23
|
+
/** A curated stack name or `custom`. */
|
|
24
|
+
fontFamily?: string;
|
|
25
|
+
/** When `fontFamily === 'custom'`, an https URL to a @font-face stylesheet. */
|
|
26
|
+
fontUrl?: string;
|
|
27
|
+
layout?: 'centered' | 'split' | 'wall';
|
|
28
|
+
background?: HostedBackground;
|
|
29
|
+
/** Provider display order + which social providers to hide. */
|
|
30
|
+
providers?: {
|
|
31
|
+
order?: string[];
|
|
32
|
+
hidden?: string[];
|
|
33
|
+
};
|
|
34
|
+
copy?: {
|
|
35
|
+
headline?: string;
|
|
36
|
+
subheadline?: string;
|
|
37
|
+
footer?: string;
|
|
38
|
+
};
|
|
39
|
+
socialButtons?: {
|
|
40
|
+
variant?: 'block' | 'compact' | 'icon';
|
|
41
|
+
size?: 'sm' | 'md' | 'lg';
|
|
42
|
+
layout?: 'list' | 'grid' | 'carousel';
|
|
43
|
+
labels?: Record<string, string>;
|
|
44
|
+
search?: 'auto' | 'always' | 'never';
|
|
45
|
+
/** Per-provider colour overrides, keyed by provider id. */
|
|
46
|
+
styles?: Record<string, {
|
|
47
|
+
bg?: string;
|
|
48
|
+
fg?: string;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
/** How a verification code is entered — segmented `boxes` (default) or `single`. */
|
|
52
|
+
codeInput?: 'boxes' | 'single';
|
|
53
|
+
card?: {
|
|
54
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
55
|
+
align?: 'left' | 'center';
|
|
56
|
+
logoSize?: 'sm' | 'md' | 'lg';
|
|
57
|
+
};
|
|
58
|
+
typography?: {
|
|
59
|
+
headingSize?: 'sm' | 'md' | 'lg' | 'xl';
|
|
60
|
+
headingWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
61
|
+
};
|
|
62
|
+
buttonShape?: 'default' | 'rounded' | 'pill' | 'square';
|
|
63
|
+
cardBorder?: 'default' | 'none' | 'bold';
|
|
64
|
+
inputSize?: 'sm' | 'md' | 'lg';
|
|
65
|
+
interaction?: {
|
|
66
|
+
buttonStyle?: 'solid' | 'outline' | 'soft' | 'ghost';
|
|
67
|
+
buttonEffect?: 'none' | 'scale' | 'lift' | 'glow' | 'ripple';
|
|
68
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg';
|
|
69
|
+
density?: 'comfortable' | 'compact' | 'spacious';
|
|
70
|
+
inputStyle?: 'outline' | 'filled' | 'underline';
|
|
71
|
+
animations?: boolean;
|
|
72
|
+
motionSpeed?: 'slow' | 'normal' | 'fast';
|
|
73
|
+
motionEasing?: 'ease' | 'linear' | 'smooth' | 'spring';
|
|
74
|
+
loading?: 'spinner' | 'skeleton' | 'dots' | 'bar';
|
|
75
|
+
};
|
|
76
|
+
backgroundPattern?: 'none' | 'dots' | 'grid' | 'stripes';
|
|
77
|
+
cardStyle?: 'default' | 'glass';
|
|
78
|
+
textScale?: 'sm' | 'md' | 'lg';
|
|
79
|
+
socialPlacement?: 'top' | 'bottom';
|
|
80
|
+
/** A permutation of `['logo','heading','social','form']`. */
|
|
81
|
+
sectionOrder?: string[];
|
|
82
|
+
legal?: {
|
|
83
|
+
termsUrl?: string;
|
|
84
|
+
privacyUrl?: string;
|
|
85
|
+
required?: boolean;
|
|
86
|
+
};
|
|
87
|
+
signUpFields?: Array<{
|
|
88
|
+
key?: string;
|
|
89
|
+
label?: string;
|
|
90
|
+
type?: 'text' | 'email' | 'tel' | 'url' | 'number' | 'date' | 'textarea' | 'checkbox' | 'select' | 'radio' | 'multiselect';
|
|
91
|
+
required?: boolean;
|
|
92
|
+
placeholder?: string;
|
|
93
|
+
options?: string[];
|
|
94
|
+
}>;
|
|
95
|
+
/** Raw CSS, injected after sanitization. */
|
|
96
|
+
customCss?: string;
|
|
97
|
+
/** Sanitized HTML slot above the card. */
|
|
98
|
+
customHtmlHeader?: string;
|
|
99
|
+
/** Sanitized HTML slot below the card. */
|
|
100
|
+
customHtmlFooter?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface HostedBackground {
|
|
103
|
+
type: 'solid' | 'gradient' | 'image' | 'wall';
|
|
104
|
+
color?: string;
|
|
105
|
+
from?: string;
|
|
106
|
+
to?: string;
|
|
107
|
+
angle?: number;
|
|
108
|
+
imageUrl?: string;
|
|
109
|
+
}
|
|
110
|
+
/** What the renderers actually use — everything already escaped or dropped. */
|
|
111
|
+
export interface ResolvedBranding {
|
|
112
|
+
applicationName: string;
|
|
113
|
+
escapedName: string;
|
|
114
|
+
logoUrl: string | null;
|
|
115
|
+
colorPrimary: string;
|
|
116
|
+
colorBackground: string;
|
|
117
|
+
colorText: string;
|
|
118
|
+
supportEmail: string | null;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A read/update echoes the stored branding plus `resolved` — the sanitized shape
|
|
122
|
+
* the page will actually render, so a value silently dropped shows up here
|
|
123
|
+
* rather than being discovered on a live page.
|
|
124
|
+
*/
|
|
125
|
+
export interface BrandingResponse extends Branding {
|
|
126
|
+
object: 'branding';
|
|
127
|
+
resolved: ResolvedBranding;
|
|
128
|
+
}
|
|
129
|
+
/** A draft rendered through the real hosted-page renderer, returned as HTML. */
|
|
130
|
+
export interface HostedPagePreview {
|
|
131
|
+
object: 'hosted_page_preview';
|
|
132
|
+
html: string;
|
|
133
|
+
}
|
|
134
|
+
export declare function brandingResource(request: RequestFn): {
|
|
135
|
+
get(): Promise<BrandingResponse>;
|
|
136
|
+
/** A PARTIAL merge — one field changes, the rest is preserved. */
|
|
137
|
+
update(body: Partial<Branding>): Promise<BrandingResponse>;
|
|
138
|
+
/** Render a draft through the live sign-in renderer without saving it. */
|
|
139
|
+
preview(body: Partial<Branding>): Promise<HostedPagePreview>;
|
|
140
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.brandingResource = brandingResource;
|
|
4
|
+
function brandingResource(request) {
|
|
5
|
+
return {
|
|
6
|
+
get() {
|
|
7
|
+
return request({ method: 'GET', path: '/v1/branding' });
|
|
8
|
+
},
|
|
9
|
+
/** A PARTIAL merge — one field changes, the rest is preserved. */
|
|
10
|
+
update(body) {
|
|
11
|
+
return request({ method: 'PATCH', path: '/v1/branding', body });
|
|
12
|
+
},
|
|
13
|
+
/** Render a draft through the live sign-in renderer without saving it. */
|
|
14
|
+
preview(body) {
|
|
15
|
+
return request({ method: 'POST', path: '/v1/branding/preview', body });
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=branding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branding.js","sourceRoot":"","sources":["../../src/client/branding.ts"],"names":[],"mappings":";;AAyIA,4CAcC;AAdD,SAAgB,gBAAgB,CAAC,OAAkB;IACjD,OAAO;QACL,GAAG;YACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,kEAAkE;QAClE,MAAM,CAAC,IAAuB;YAC5B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,0EAA0E;QAC1E,OAAO,CAAC,IAAuB;YAC7B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAC;QACzE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type RequestFn } from './request';
|
|
2
|
+
import type { CursorPage, CursorParams } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* §13.4 GDPR/DSAR admin surface — the Data Protection Officer's console over
|
|
5
|
+
* data-subject requests. A user files export/erasure requests from the FAPI;
|
|
6
|
+
* this lets an operator SEE every request and ACTION it out of band: fulfil it
|
|
7
|
+
* now, ahead of its grace window, or reject it with a recorded reason. A
|
|
8
|
+
* fulfilled or rejected request is terminal — a second action is a 409.
|
|
9
|
+
*/
|
|
10
|
+
export interface DataSubjectRequest {
|
|
11
|
+
object: 'data_subject_request';
|
|
12
|
+
id: string;
|
|
13
|
+
type: string;
|
|
14
|
+
status: string;
|
|
15
|
+
user_id: string;
|
|
16
|
+
requested_by_type: string | null;
|
|
17
|
+
requested_by_id: string | null;
|
|
18
|
+
reason: string | null;
|
|
19
|
+
scheduled_for: number | null;
|
|
20
|
+
requested_at: number;
|
|
21
|
+
updated_at: number;
|
|
22
|
+
completed_at: number | null;
|
|
23
|
+
/** The export package — present on `get` and on a fulfilled export. */
|
|
24
|
+
result?: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface ListDataSubjectRequestsParams extends CursorParams {
|
|
27
|
+
type?: string;
|
|
28
|
+
status?: string;
|
|
29
|
+
user_id?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function dataSubjectRequestsResource(request: RequestFn): {
|
|
32
|
+
list(params?: ListDataSubjectRequestsParams): Promise<CursorPage<DataSubjectRequest>>;
|
|
33
|
+
get(id: string): Promise<DataSubjectRequest>;
|
|
34
|
+
/** Fulfil a request now — build the export package, or run the erasure — ahead of schedule. */
|
|
35
|
+
fulfill(id: string, idempotencyKey?: string): Promise<DataSubjectRequest>;
|
|
36
|
+
/** Reject a request with a recorded reason. Terminal — it cannot be re-actioned. */
|
|
37
|
+
reject(id: string, body?: {
|
|
38
|
+
reason?: string;
|
|
39
|
+
}, idempotencyKey?: string): Promise<DataSubjectRequest>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataSubjectRequestsResource = dataSubjectRequestsResource;
|
|
4
|
+
const request_1 = require("./request");
|
|
5
|
+
function dataSubjectRequestsResource(request) {
|
|
6
|
+
return {
|
|
7
|
+
list(params = {}) {
|
|
8
|
+
return request({ method: 'GET', path: '/v1/data_subject_requests', query: { ...params } });
|
|
9
|
+
},
|
|
10
|
+
get(id) {
|
|
11
|
+
return request({ method: 'GET', path: `/v1/data_subject_requests/${(0, request_1.enc)(id)}` });
|
|
12
|
+
},
|
|
13
|
+
/** Fulfil a request now — build the export package, or run the erasure — ahead of schedule. */
|
|
14
|
+
fulfill(id, idempotencyKey) {
|
|
15
|
+
return request({
|
|
16
|
+
method: 'POST',
|
|
17
|
+
path: `/v1/data_subject_requests/${(0, request_1.enc)(id)}/fulfill`,
|
|
18
|
+
idempotencyKey,
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
/** Reject a request with a recorded reason. Terminal — it cannot be re-actioned. */
|
|
22
|
+
reject(id, body = {}, idempotencyKey) {
|
|
23
|
+
return request({
|
|
24
|
+
method: 'POST',
|
|
25
|
+
path: `/v1/data_subject_requests/${(0, request_1.enc)(id)}/reject`,
|
|
26
|
+
body,
|
|
27
|
+
idempotencyKey,
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=data-subject-requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-subject-requests.js","sourceRoot":"","sources":["../../src/client/data-subject-requests.ts"],"names":[],"mappings":";;AAiCA,kEAgCC;AAjED,uCAAgD;AAiChD,SAAgB,2BAA2B,CAAC,OAAkB;IAC5D,OAAO;QACL,IAAI,CACF,SAAwC,EAAE;YAE1C,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAClF,CAAC;QACD,+FAA+F;QAC/F,OAAO,CAAC,EAAU,EAAE,cAAuB;YACzC,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,6BAA6B,IAAA,aAAG,EAAC,EAAE,CAAC,UAAU;gBACpD,cAAc;aACf,CAAC,CAAC;QACL,CAAC;QACD,oFAAoF;QACpF,MAAM,CACJ,EAAU,EACV,OAA4B,EAAE,EAC9B,cAAuB;YAEvB,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,6BAA6B,IAAA,aAAG,EAAC,EAAE,CAAC,SAAS;gBACnD,IAAI;gBACJ,cAAc;aACf,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type RequestFn } from './request';
|
|
2
|
+
export interface CustomDomain {
|
|
3
|
+
object: 'custom_domain';
|
|
4
|
+
id: string;
|
|
5
|
+
role: 'fapi' | 'accounts';
|
|
6
|
+
host: string;
|
|
7
|
+
status: string;
|
|
8
|
+
action: string;
|
|
9
|
+
live: boolean;
|
|
10
|
+
cname_target: string;
|
|
11
|
+
last_checked_at: number | null;
|
|
12
|
+
last_observed_target: string | null;
|
|
13
|
+
failure_reason: string | null;
|
|
14
|
+
certificate_expires_at: number | null;
|
|
15
|
+
cookie_domain: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface ListDomainsResponse {
|
|
18
|
+
object: 'list';
|
|
19
|
+
data: CustomDomain[];
|
|
20
|
+
cname_target: string;
|
|
21
|
+
instructions: Record<string, unknown>;
|
|
22
|
+
cookie_checks: Array<{
|
|
23
|
+
origin: string;
|
|
24
|
+
first_party: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
required: boolean;
|
|
27
|
+
environment: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
export declare function domainsResource(request: RequestFn): {
|
|
30
|
+
list(): Promise<ListDomainsResponse>;
|
|
31
|
+
create(body: {
|
|
32
|
+
host: string;
|
|
33
|
+
role?: "fapi" | "accounts";
|
|
34
|
+
}, idempotencyKey?: string): Promise<CustomDomain & {
|
|
35
|
+
instructions: Record<string, unknown>;
|
|
36
|
+
}>;
|
|
37
|
+
verify(id: string): Promise<CustomDomain & {
|
|
38
|
+
verified: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
delete(id: string): Promise<{
|
|
41
|
+
object: "custom_domain";
|
|
42
|
+
id: string;
|
|
43
|
+
deleted: true;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.domainsResource = domainsResource;
|
|
4
|
+
const request_1 = require("./request");
|
|
5
|
+
function domainsResource(request) {
|
|
6
|
+
return {
|
|
7
|
+
list() {
|
|
8
|
+
return request({ method: 'GET', path: '/v1/domains' });
|
|
9
|
+
},
|
|
10
|
+
create(body, idempotencyKey) {
|
|
11
|
+
return request({ method: 'POST', path: '/v1/domains', body, idempotencyKey });
|
|
12
|
+
},
|
|
13
|
+
verify(id) {
|
|
14
|
+
return request({ method: 'POST', path: `/v1/domains/${(0, request_1.enc)(id)}/verify` });
|
|
15
|
+
},
|
|
16
|
+
delete(id) {
|
|
17
|
+
return request({ method: 'DELETE', path: `/v1/domains/${(0, request_1.enc)(id)}` });
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../src/client/domains.ts"],"names":[],"mappings":";;AA4BA,0CAkBC;AA9CD,uCAAgD;AA4BhD,SAAgB,eAAe,CAAC,OAAkB;IAChD,OAAO;QACL,IAAI;YACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,CACJ,IAAkD,EAClD,cAAuB;YAEvB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,IAAA,aAAG,EAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACvE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type RequestFn } from './request';
|
|
2
|
+
import type { ListPage } from './types';
|
|
3
|
+
/** The transactional email a template drives. */
|
|
4
|
+
export type EmailTemplateName = 'verification_code' | 'magic_link' | 'password_reset' | 'password_changed' | 'account_exists_notice' | 'organization_invitation' | 'new_device_sign_in' | 'session_revoked_token_reuse' | 'account_locked' | 'team_member_added' | 'team_role_changed';
|
|
5
|
+
/** The customizable body of a template: a subject line and a text body. */
|
|
6
|
+
export interface EmailTemplateBody {
|
|
7
|
+
subject?: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A list row: the built-in `default` and the stored `override` are both returned
|
|
12
|
+
* so a caller can show a diff rather than guess what changed.
|
|
13
|
+
*/
|
|
14
|
+
export interface EmailTemplate {
|
|
15
|
+
object: 'email_template';
|
|
16
|
+
name: EmailTemplateName;
|
|
17
|
+
default: {
|
|
18
|
+
subject: string;
|
|
19
|
+
text: string;
|
|
20
|
+
};
|
|
21
|
+
override: EmailTemplateBody | null;
|
|
22
|
+
customised: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** The lean shape an update/delete acknowledges with (no `default`). */
|
|
25
|
+
export interface EmailTemplateResult {
|
|
26
|
+
object: 'email_template';
|
|
27
|
+
name: EmailTemplateName;
|
|
28
|
+
override: EmailTemplateBody | null;
|
|
29
|
+
customised: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A rendered template with SAMPLE variables (never a real code). `valid` is false
|
|
33
|
+
* with a `problem` when the draft would be dropped by the renderer.
|
|
34
|
+
*/
|
|
35
|
+
export interface EmailTemplatePreview {
|
|
36
|
+
object: 'email_preview';
|
|
37
|
+
template: EmailTemplateName;
|
|
38
|
+
valid: boolean;
|
|
39
|
+
problem: string | null;
|
|
40
|
+
html: string | null;
|
|
41
|
+
variables: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
export declare function emailTemplatesResource(request: RequestFn): {
|
|
44
|
+
list(): Promise<ListPage<EmailTemplate>>;
|
|
45
|
+
/** Render an unsaved draft (if a body is given) or the stored template. */
|
|
46
|
+
preview(name: string, body?: EmailTemplateBody): Promise<EmailTemplatePreview>;
|
|
47
|
+
/** Save an override. Keyed by template name, not an id. */
|
|
48
|
+
update(name: string, body: EmailTemplateBody): Promise<EmailTemplateResult>;
|
|
49
|
+
/** Revert to the built-in. */
|
|
50
|
+
delete(name: string): Promise<EmailTemplateResult>;
|
|
51
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emailTemplatesResource = emailTemplatesResource;
|
|
4
|
+
const request_1 = require("./request");
|
|
5
|
+
function emailTemplatesResource(request) {
|
|
6
|
+
return {
|
|
7
|
+
list() {
|
|
8
|
+
return request({ method: 'GET', path: '/v1/email_templates' });
|
|
9
|
+
},
|
|
10
|
+
/** Render an unsaved draft (if a body is given) or the stored template. */
|
|
11
|
+
preview(name, body = {}) {
|
|
12
|
+
return request({ method: 'POST', path: `/v1/email_templates/${(0, request_1.enc)(name)}/preview`, body });
|
|
13
|
+
},
|
|
14
|
+
/** Save an override. Keyed by template name, not an id. */
|
|
15
|
+
update(name, body) {
|
|
16
|
+
return request({ method: 'PUT', path: `/v1/email_templates/${(0, request_1.enc)(name)}`, body });
|
|
17
|
+
},
|
|
18
|
+
/** Revert to the built-in. */
|
|
19
|
+
delete(name) {
|
|
20
|
+
return request({ method: 'DELETE', path: `/v1/email_templates/${(0, request_1.enc)(name)}` });
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=email-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-templates.js","sourceRoot":"","sources":["../../src/client/email-templates.ts"],"names":[],"mappings":";;AAwDA,wDAkBC;AA1ED,uCAAgD;AAwDhD,SAAgB,sBAAsB,CAAC,OAAkB;IACvD,OAAO;QACL,IAAI;YACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,2EAA2E;QAC3E,OAAO,CAAC,IAAY,EAAE,OAA0B,EAAE;YAChD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,IAAA,aAAG,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,2DAA2D;QAC3D,MAAM,CAAC,IAAY,EAAE,IAAuB;YAC1C,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,IAAA,aAAG,EAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,8BAA8B;QAC9B,MAAM,CAAC,IAAY;YACjB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,uBAAuB,IAAA,aAAG,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACjF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single error type every management-client call throws on a non-2xx.
|
|
3
|
+
*
|
|
4
|
+
* Atlas answers a failed BAPI call with the §9.1 envelope:
|
|
5
|
+
*
|
|
6
|
+
* { errors: [{ code, message, param?, meta? }] }
|
|
7
|
+
*
|
|
8
|
+
* `code` is the stable, machine-readable part of that contract — integrators
|
|
9
|
+
* branch on it (`LAST_ADMIN`, `NOT_FOUND`, `SCOPE_MISSING`, …) — so it is
|
|
10
|
+
* surfaced first-class here rather than buried in a parsed body. The raw
|
|
11
|
+
* `errors` array and the HTTP `status` are both kept so a caller can inspect
|
|
12
|
+
* `param`/`meta` (e.g. a rate limit's `retry_after`) when they need to.
|
|
13
|
+
*/
|
|
14
|
+
export interface AtlasErrorItem {
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
param?: string;
|
|
18
|
+
meta?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export declare class AtlasApiError extends Error {
|
|
21
|
+
readonly name = "AtlasApiError";
|
|
22
|
+
/** HTTP status of the failed response. */
|
|
23
|
+
readonly status: number;
|
|
24
|
+
/** The full §9.1 error envelope, in order. */
|
|
25
|
+
readonly errors: AtlasErrorItem[];
|
|
26
|
+
constructor(status: number, errors: AtlasErrorItem[], message?: string);
|
|
27
|
+
/** The first error's stable code, the field callers branch on most. */
|
|
28
|
+
get code(): string | undefined;
|
|
29
|
+
/** True when any error in the envelope carries the given stable code. */
|
|
30
|
+
hasCode(code: string): boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AtlasApiError = void 0;
|
|
4
|
+
class AtlasApiError extends Error {
|
|
5
|
+
name = 'AtlasApiError';
|
|
6
|
+
/** HTTP status of the failed response. */
|
|
7
|
+
status;
|
|
8
|
+
/** The full §9.1 error envelope, in order. */
|
|
9
|
+
errors;
|
|
10
|
+
constructor(status, errors, message) {
|
|
11
|
+
super(message ?? errors[0]?.message ?? `Atlas API request failed with status ${status}`);
|
|
12
|
+
this.status = status;
|
|
13
|
+
this.errors = errors;
|
|
14
|
+
// Restore the prototype chain when compiled down to ES5-era targets so
|
|
15
|
+
// `instanceof AtlasApiError` holds for callers branching on the type.
|
|
16
|
+
Object.setPrototypeOf(this, AtlasApiError.prototype);
|
|
17
|
+
}
|
|
18
|
+
/** The first error's stable code, the field callers branch on most. */
|
|
19
|
+
get code() {
|
|
20
|
+
return this.errors[0]?.code;
|
|
21
|
+
}
|
|
22
|
+
/** True when any error in the envelope carries the given stable code. */
|
|
23
|
+
hasCode(code) {
|
|
24
|
+
return this.errors.some((e) => e.code === code);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.AtlasApiError = AtlasApiError;
|
|
28
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/client/error.ts"],"names":[],"mappings":";;;AAoBA,MAAa,aAAc,SAAQ,KAAK;IACpB,IAAI,GAAG,eAAe,CAAC;IACzC,0CAA0C;IACjC,MAAM,CAAS;IACxB,8CAA8C;IACrC,MAAM,CAAmB;IAElC,YAAY,MAAc,EAAE,MAAwB,EAAE,OAAgB;QACpE,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,wCAAwC,MAAM,EAAE,CAAC,CAAC;QACzF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,uEAAuE;QACvE,sEAAsE;QACtE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;IAED,uEAAuE;IACvE,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IAC9B,CAAC;IAED,yEAAyE;IACzE,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAClD,CAAC;CACF;AAzBD,sCAyBC"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { type RequestFn } from './request';
|
|
2
|
+
import type { ListPage } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Fine-grained relationship-based authorization (Zanzibar / OpenFGA), in-house.
|
|
5
|
+
* A tenant owns STORES; each store holds immutable, versioned authorization
|
|
6
|
+
* MODELS and the relationship TUPLES the engine resolves. Every store is scoped
|
|
7
|
+
* to the calling instance — a store from another instance reads as a 404.
|
|
8
|
+
*/
|
|
9
|
+
export interface FgaStore {
|
|
10
|
+
object: 'fga.store';
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
created_at: number;
|
|
14
|
+
updated_at: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FgaAuthorizationModel {
|
|
17
|
+
object: 'fga.authorization_model';
|
|
18
|
+
id: string;
|
|
19
|
+
store_id: string;
|
|
20
|
+
schema_version: string;
|
|
21
|
+
/** The OpenFGA model. Present on get/create; omitted from list rows. */
|
|
22
|
+
model?: Record<string, unknown>;
|
|
23
|
+
created_at: number;
|
|
24
|
+
}
|
|
25
|
+
export interface FgaTuple {
|
|
26
|
+
object: 'fga.tuple';
|
|
27
|
+
/** `type:id` or `type:id#relation` for a userset. */
|
|
28
|
+
user: string;
|
|
29
|
+
relation: string;
|
|
30
|
+
/** The object of the tuple as `type:id`. */
|
|
31
|
+
target: string;
|
|
32
|
+
created_at: number;
|
|
33
|
+
}
|
|
34
|
+
/** A tuple key. `object` is the target as `type:id`; `target` is accepted too. */
|
|
35
|
+
export interface FgaTupleKey {
|
|
36
|
+
user: string;
|
|
37
|
+
relation: string;
|
|
38
|
+
object: string;
|
|
39
|
+
}
|
|
40
|
+
/** An OpenFGA authorization model to persist. Validated before storage. */
|
|
41
|
+
export interface FgaAuthorizationModelInput {
|
|
42
|
+
type_definitions: unknown[];
|
|
43
|
+
/** Defaults to `1.1` when omitted. */
|
|
44
|
+
schema_version?: string;
|
|
45
|
+
conditions?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
/** Both `{ tuple_keys: [...] }` (OpenFGA shape) and a bare array are accepted. */
|
|
48
|
+
export type FgaTupleKeys = FgaTupleKey[] | {
|
|
49
|
+
tuple_keys: FgaTupleKey[];
|
|
50
|
+
};
|
|
51
|
+
export interface FgaCheckBody {
|
|
52
|
+
user: string;
|
|
53
|
+
relation: string;
|
|
54
|
+
object: string;
|
|
55
|
+
/** Defaults to the store's latest model. */
|
|
56
|
+
authorization_model_id?: string;
|
|
57
|
+
contextual_tuples?: FgaTupleKeys;
|
|
58
|
+
}
|
|
59
|
+
export interface FgaListObjectsBody {
|
|
60
|
+
user: string;
|
|
61
|
+
relation: string;
|
|
62
|
+
type: string;
|
|
63
|
+
authorization_model_id?: string;
|
|
64
|
+
contextual_tuples?: FgaTupleKeys;
|
|
65
|
+
}
|
|
66
|
+
/** One item in a batch check; `correlation_id` is echoed back to match results. */
|
|
67
|
+
export interface FgaBatchCheckItem {
|
|
68
|
+
user: string;
|
|
69
|
+
relation: string;
|
|
70
|
+
object: string;
|
|
71
|
+
correlation_id?: string;
|
|
72
|
+
contextual_tuples?: FgaTupleKeys;
|
|
73
|
+
}
|
|
74
|
+
export interface FgaBatchCheckResult {
|
|
75
|
+
object: 'fga.batch_check';
|
|
76
|
+
authorization_model_id: string;
|
|
77
|
+
result: Array<{
|
|
78
|
+
correlation_id: string;
|
|
79
|
+
allowed: boolean;
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
export declare function fgaResource(request: RequestFn): {
|
|
83
|
+
stores: {
|
|
84
|
+
list(): Promise<ListPage<FgaStore>>;
|
|
85
|
+
create(body: {
|
|
86
|
+
name: string;
|
|
87
|
+
}, idempotencyKey?: string): Promise<FgaStore>;
|
|
88
|
+
get(id: string): Promise<FgaStore>;
|
|
89
|
+
delete(id: string): Promise<{
|
|
90
|
+
object: "fga.store";
|
|
91
|
+
id: string;
|
|
92
|
+
deleted: true;
|
|
93
|
+
}>;
|
|
94
|
+
};
|
|
95
|
+
models: {
|
|
96
|
+
list(storeId: string): Promise<ListPage<FgaAuthorizationModel>>;
|
|
97
|
+
create(storeId: string, body: FgaAuthorizationModelInput, idempotencyKey?: string): Promise<FgaAuthorizationModel>;
|
|
98
|
+
get(storeId: string, modelId: string): Promise<FgaAuthorizationModel>;
|
|
99
|
+
};
|
|
100
|
+
/** Write and/or delete tuples in one atomic call. */
|
|
101
|
+
write(storeId: string, body: {
|
|
102
|
+
writes?: FgaTupleKeys;
|
|
103
|
+
deletes?: FgaTupleKeys;
|
|
104
|
+
}, idempotencyKey?: string): Promise<{
|
|
105
|
+
object: "fga.write_result";
|
|
106
|
+
writes: number;
|
|
107
|
+
deletes: number;
|
|
108
|
+
}>;
|
|
109
|
+
/** Query stored tuples by any of user / relation / object. */
|
|
110
|
+
read(storeId: string, body: {
|
|
111
|
+
user?: string;
|
|
112
|
+
relation?: string;
|
|
113
|
+
object?: string;
|
|
114
|
+
}): Promise<ListPage<FgaTuple>>;
|
|
115
|
+
/** Resolve a single access question against the model. */
|
|
116
|
+
check(storeId: string, body: FgaCheckBody): Promise<{
|
|
117
|
+
object: "fga.check";
|
|
118
|
+
allowed: boolean;
|
|
119
|
+
authorization_model_id: string;
|
|
120
|
+
}>;
|
|
121
|
+
/** Resolve MANY access questions in one round trip (list-authorization UIs). */
|
|
122
|
+
batchCheck(storeId: string, body: {
|
|
123
|
+
checks: FgaBatchCheckItem[];
|
|
124
|
+
authorization_model_id?: string;
|
|
125
|
+
}): Promise<FgaBatchCheckResult>;
|
|
126
|
+
/** List the objects of a type a user has a relation to. */
|
|
127
|
+
listObjects(storeId: string, body: FgaListObjectsBody): Promise<{
|
|
128
|
+
object: "fga.list_objects";
|
|
129
|
+
objects: string[];
|
|
130
|
+
authorization_model_id: string;
|
|
131
|
+
}>;
|
|
132
|
+
/** Expand the full userset tree for an object#relation. */
|
|
133
|
+
expand(storeId: string, body: {
|
|
134
|
+
object: string;
|
|
135
|
+
relation: string;
|
|
136
|
+
authorization_model_id?: string;
|
|
137
|
+
}): Promise<{
|
|
138
|
+
object: "fga.expand";
|
|
139
|
+
tree: unknown;
|
|
140
|
+
authorization_model_id: string;
|
|
141
|
+
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Bind a default store so an app that uses one store (the common case) can
|
|
144
|
+
* call `fga.store(id).check({ user, relation, object })` instead of threading
|
|
145
|
+
* the store id through every call — the ergonomic OpenFGA/Auth0-FGA SDKs
|
|
146
|
+
* offer. Returns the same operations with `storeId` pre-applied.
|
|
147
|
+
*/
|
|
148
|
+
store(storeId: string): {
|
|
149
|
+
write: (body: {
|
|
150
|
+
writes?: FgaTupleKeys;
|
|
151
|
+
deletes?: FgaTupleKeys;
|
|
152
|
+
}, idempotencyKey?: string) => Promise<{
|
|
153
|
+
object: "fga.write_result";
|
|
154
|
+
writes: number;
|
|
155
|
+
deletes: number;
|
|
156
|
+
}>;
|
|
157
|
+
read: (body: {
|
|
158
|
+
user?: string;
|
|
159
|
+
relation?: string;
|
|
160
|
+
object?: string;
|
|
161
|
+
}) => Promise<ListPage<FgaTuple>>;
|
|
162
|
+
check: (body: FgaCheckBody) => Promise<{
|
|
163
|
+
object: "fga.check";
|
|
164
|
+
allowed: boolean;
|
|
165
|
+
authorization_model_id: string;
|
|
166
|
+
}>;
|
|
167
|
+
batchCheck: (body: {
|
|
168
|
+
checks: FgaBatchCheckItem[];
|
|
169
|
+
authorization_model_id?: string;
|
|
170
|
+
}) => Promise<FgaBatchCheckResult>;
|
|
171
|
+
listObjects: (body: FgaListObjectsBody) => Promise<{
|
|
172
|
+
object: "fga.list_objects";
|
|
173
|
+
objects: string[];
|
|
174
|
+
authorization_model_id: string;
|
|
175
|
+
}>;
|
|
176
|
+
expand: (body: {
|
|
177
|
+
object: string;
|
|
178
|
+
relation: string;
|
|
179
|
+
authorization_model_id?: string;
|
|
180
|
+
}) => Promise<{
|
|
181
|
+
object: "fga.expand";
|
|
182
|
+
tree: unknown;
|
|
183
|
+
authorization_model_id: string;
|
|
184
|
+
}>;
|
|
185
|
+
models: {
|
|
186
|
+
list: () => Promise<ListPage<FgaAuthorizationModel>>;
|
|
187
|
+
create: (body: FgaAuthorizationModelInput, idempotencyKey?: string) => Promise<FgaAuthorizationModel>;
|
|
188
|
+
get: (modelId: string) => Promise<FgaAuthorizationModel>;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|