@nangohq/types 0.71.2 → 0.71.4
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/account/api.d.ts +100 -19
- package/dist/action/api.d.ts +21 -5
- package/dist/admin/http.api.d.ts +8 -2
- package/dist/api-keys/auth.d.ts +38 -0
- package/dist/api-keys/scopes.d.ts +3 -1
- package/dist/api.d.ts +7 -0
- package/dist/api.endpoints.d.ts +7 -6
- package/dist/audit-trail/api.d.ts +41 -0
- package/dist/audit-trail/event.d.ts +56 -0
- package/dist/auth/api.d.ts +2 -10
- package/dist/auth/http.api.d.ts +50 -26
- package/dist/authz/types.d.ts +1 -1
- package/dist/billing/http.api.d.ts +6 -2
- package/dist/cli/api.d.ts +6 -2
- package/dist/clientMetadata/http.api.d.ts +6 -2
- package/dist/connect/api.d.ts +36 -7
- package/dist/connectUISettings/api.d.ts +11 -3
- package/dist/connection/api/get.d.ts +39 -12
- package/dist/connection/api/metadata.d.ts +8 -4
- package/dist/db.d.ts +5 -0
- package/dist/deploy/api.d.ts +14 -4
- package/dist/environment/api/index.d.ts +34 -11
- package/dist/environment/api/otlp.d.ts +6 -2
- package/dist/environment/api/webhook.d.ts +4 -2
- package/dist/environment/variable/api.d.ts +4 -2
- package/dist/flow/http.api.d.ts +17 -7
- package/dist/function/config.d.ts +65 -0
- package/dist/function/db.d.ts +39 -0
- package/dist/functions/api.d.ts +141 -17
- package/dist/gettingStarted/api.d.ts +11 -3
- package/dist/index.d.ts +7 -3
- package/dist/integration/api.d.ts +52 -15
- package/dist/invitations/api.d.ts +15 -6
- package/dist/logs/api.d.ts +26 -6
- package/dist/mcp/api.d.ts +21 -5
- package/dist/meta/api.d.ts +7 -2
- package/dist/mfa/api.d.ts +35 -6
- package/dist/plain/api.d.ts +6 -2
- package/dist/plans/http.api.d.ts +33 -9
- package/dist/providers/api.d.ts +21 -5
- package/dist/providers/provider.d.ts +4 -7
- package/dist/proxy/http.api.d.ts +6 -2
- package/dist/pubsub/events.d.ts +3 -1
- package/dist/record/api.d.ts +21 -5
- package/dist/scripts/http.api.d.ts +6 -2
- package/dist/stripe/http.api.d.ts +16 -5
- package/dist/sync/api.d.ts +22 -8
- package/dist/team/api.d.ts +18 -6
- package/dist/user/api.d.ts +11 -4
- package/dist/user/db.d.ts +2 -0
- package/dist/webhooks/http.api.d.ts +6 -2
- package/package.json +1 -1
- package/dist/functions/capabilities.d.ts +0 -7
package/dist/account/api.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
2
3
|
import type { ApiUser } from '../user/api.js';
|
|
3
|
-
export type PostSignup =
|
|
4
|
+
export type PostSignup = ApiEndpoint<{
|
|
5
|
+
Audit: AuditPolicy<'app_auth', 'signup', 'account'>;
|
|
4
6
|
Method: 'POST';
|
|
5
7
|
Path: '/api/v1/account/signup';
|
|
6
8
|
Body: {
|
|
@@ -18,19 +20,26 @@ export type PostSignup = Endpoint<{
|
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
}>;
|
|
21
|
-
export type
|
|
23
|
+
export type ConfirmEmail = ApiEndpoint<{
|
|
24
|
+
Audit: {
|
|
25
|
+
kind: 'no-audit';
|
|
26
|
+
reason: 'non-auditable';
|
|
27
|
+
};
|
|
22
28
|
Method: 'POST';
|
|
23
29
|
Path: '/api/v1/account/verify/code';
|
|
24
30
|
Body: {
|
|
25
31
|
token: string;
|
|
26
32
|
};
|
|
27
|
-
Error: ApiError<'
|
|
33
|
+
Error: ApiError<'error_validating_user'> | ApiError<'invalid_token'> | ApiError<'token_expired'>;
|
|
28
34
|
Success: {
|
|
29
35
|
user: ApiUser;
|
|
30
|
-
showHearAboutUs?: boolean;
|
|
31
36
|
};
|
|
32
37
|
}>;
|
|
33
|
-
export type ResendVerificationEmailByUuid =
|
|
38
|
+
export type ResendVerificationEmailByUuid = ApiEndpoint<{
|
|
39
|
+
Audit: {
|
|
40
|
+
kind: 'no-audit';
|
|
41
|
+
reason: 'non-auditable';
|
|
42
|
+
};
|
|
34
43
|
Method: 'POST';
|
|
35
44
|
Path: '/api/v1/account/resend-verification-email/by-uuid';
|
|
36
45
|
Body: {
|
|
@@ -41,7 +50,11 @@ export type ResendVerificationEmailByUuid = Endpoint<{
|
|
|
41
50
|
success: boolean;
|
|
42
51
|
};
|
|
43
52
|
}>;
|
|
44
|
-
export type ResendVerificationEmailByEmail =
|
|
53
|
+
export type ResendVerificationEmailByEmail = ApiEndpoint<{
|
|
54
|
+
Audit: {
|
|
55
|
+
kind: 'no-audit';
|
|
56
|
+
reason: 'non-auditable';
|
|
57
|
+
};
|
|
45
58
|
Method: 'POST';
|
|
46
59
|
Path: '/api/v1/account/resend-verification-email/by-email';
|
|
47
60
|
Body: {
|
|
@@ -52,7 +65,11 @@ export type ResendVerificationEmailByEmail = Endpoint<{
|
|
|
52
65
|
success: boolean;
|
|
53
66
|
};
|
|
54
67
|
}>;
|
|
55
|
-
export type GetEmailByUuid =
|
|
68
|
+
export type GetEmailByUuid = ApiEndpoint<{
|
|
69
|
+
Audit: {
|
|
70
|
+
kind: 'no-audit';
|
|
71
|
+
reason: 'non-auditable';
|
|
72
|
+
};
|
|
56
73
|
Method: 'GET';
|
|
57
74
|
Path: '/api/v1/account/email/:uuid';
|
|
58
75
|
Params: {
|
|
@@ -64,7 +81,11 @@ export type GetEmailByUuid = Endpoint<{
|
|
|
64
81
|
verified: boolean;
|
|
65
82
|
};
|
|
66
83
|
}>;
|
|
67
|
-
export type GetEmailByExpiredToken =
|
|
84
|
+
export type GetEmailByExpiredToken = ApiEndpoint<{
|
|
85
|
+
Audit: {
|
|
86
|
+
kind: 'no-audit';
|
|
87
|
+
reason: 'non-auditable';
|
|
88
|
+
};
|
|
68
89
|
Method: 'GET';
|
|
69
90
|
Path: '/api/v1/account/email/expired-token/:token';
|
|
70
91
|
Params: {
|
|
@@ -77,24 +98,36 @@ export type GetEmailByExpiredToken = Endpoint<{
|
|
|
77
98
|
uuid: string;
|
|
78
99
|
};
|
|
79
100
|
}>;
|
|
80
|
-
export type PostSignin =
|
|
101
|
+
export type PostSignin = ApiEndpoint<{
|
|
102
|
+
Audit: AuditPolicy<'app_auth', 'login', 'account'>;
|
|
81
103
|
Method: 'POST';
|
|
82
104
|
Path: '/api/v1/account/signin';
|
|
83
105
|
Body: {
|
|
84
106
|
email: string;
|
|
85
107
|
password: string;
|
|
108
|
+
returnTo?: string;
|
|
86
109
|
};
|
|
87
110
|
Error: ApiError<'email_not_verified'> | ApiError<'user_suspended'> | ApiError<'unauthorized'>;
|
|
88
111
|
Success: {
|
|
89
112
|
user: ApiUser;
|
|
113
|
+
url: string;
|
|
114
|
+
} | {
|
|
115
|
+
data: {
|
|
116
|
+
mfaRequired: true;
|
|
117
|
+
};
|
|
90
118
|
};
|
|
91
119
|
}>;
|
|
92
|
-
export type PostLogout =
|
|
120
|
+
export type PostLogout = ApiEndpoint<{
|
|
121
|
+
Audit: AuditPolicy<'app_auth', 'logout', 'account'>;
|
|
93
122
|
Method: 'POST';
|
|
94
123
|
Path: '/api/v1/account/logout';
|
|
95
124
|
Success: never;
|
|
96
125
|
}>;
|
|
97
|
-
export type PostForgotPassword =
|
|
126
|
+
export type PostForgotPassword = ApiEndpoint<{
|
|
127
|
+
Audit: {
|
|
128
|
+
kind: 'no-audit';
|
|
129
|
+
reason: 'non-auditable';
|
|
130
|
+
};
|
|
98
131
|
Method: 'POST';
|
|
99
132
|
Path: '/api/v1/account/forgot-password';
|
|
100
133
|
Body: {
|
|
@@ -104,7 +137,8 @@ export type PostForgotPassword = Endpoint<{
|
|
|
104
137
|
success: true;
|
|
105
138
|
};
|
|
106
139
|
}>;
|
|
107
|
-
export type PutResetPassword =
|
|
140
|
+
export type PutResetPassword = ApiEndpoint<{
|
|
141
|
+
Audit: AuditPolicy<'app_auth', 'password_reset', 'account'>;
|
|
108
142
|
Method: 'PUT';
|
|
109
143
|
Path: '/api/v1/account/reset-password';
|
|
110
144
|
Body: {
|
|
@@ -116,7 +150,11 @@ export type PutResetPassword = Endpoint<{
|
|
|
116
150
|
success: true;
|
|
117
151
|
};
|
|
118
152
|
}>;
|
|
119
|
-
export type PostManagedSignup =
|
|
153
|
+
export type PostManagedSignup = ApiEndpoint<{
|
|
154
|
+
Audit: {
|
|
155
|
+
kind: 'no-audit';
|
|
156
|
+
reason: 'initiates SSO redirect, no auth state change';
|
|
157
|
+
};
|
|
120
158
|
Method: 'POST';
|
|
121
159
|
Path: '/api/v1/account/managed/signup';
|
|
122
160
|
Body: {
|
|
@@ -129,7 +167,11 @@ export type PostManagedSignup = Endpoint<{
|
|
|
129
167
|
};
|
|
130
168
|
};
|
|
131
169
|
}>;
|
|
132
|
-
export type GetManagedEmailVerification =
|
|
170
|
+
export type GetManagedEmailVerification = ApiEndpoint<{
|
|
171
|
+
Audit: {
|
|
172
|
+
kind: 'no-audit';
|
|
173
|
+
reason: 'read-only, no auth state change';
|
|
174
|
+
};
|
|
133
175
|
Method: 'GET';
|
|
134
176
|
Path: '/api/v1/account/managed/verification';
|
|
135
177
|
Error: ApiError<'not_found'>;
|
|
@@ -139,7 +181,8 @@ export type GetManagedEmailVerification = Endpoint<{
|
|
|
139
181
|
};
|
|
140
182
|
};
|
|
141
183
|
}>;
|
|
142
|
-
export type PostManagedEmailVerification =
|
|
184
|
+
export type PostManagedEmailVerification = ApiEndpoint<{
|
|
185
|
+
Audit: AuditPolicy<'app_auth', 'login' | 'signup', 'account'>;
|
|
143
186
|
Method: 'POST';
|
|
144
187
|
Path: '/api/v1/account/managed/verification';
|
|
145
188
|
Body: {
|
|
@@ -152,7 +195,8 @@ export type PostManagedEmailVerification = Endpoint<{
|
|
|
152
195
|
};
|
|
153
196
|
};
|
|
154
197
|
}>;
|
|
155
|
-
export type GetManagedCallback =
|
|
198
|
+
export type GetManagedCallback = ApiEndpoint<{
|
|
199
|
+
Audit: AuditPolicy<'app_auth', 'login' | 'signup', 'account'>;
|
|
156
200
|
Method: 'GET';
|
|
157
201
|
Path: '/api/v1/login/callback';
|
|
158
202
|
Querystring: {
|
|
@@ -166,7 +210,11 @@ export type GetManagedCallback = Endpoint<{
|
|
|
166
210
|
};
|
|
167
211
|
};
|
|
168
212
|
}>;
|
|
169
|
-
export type GetOnboardingHearAboutUs =
|
|
213
|
+
export type GetOnboardingHearAboutUs = ApiEndpoint<{
|
|
214
|
+
Audit: {
|
|
215
|
+
kind: 'no-audit';
|
|
216
|
+
reason: 'non-auditable';
|
|
217
|
+
};
|
|
170
218
|
Method: 'GET';
|
|
171
219
|
Path: '/api/v1/account/onboarding/hear-about-us';
|
|
172
220
|
Error: ApiError<'unauthorized'>;
|
|
@@ -176,7 +224,40 @@ export type GetOnboardingHearAboutUs = Endpoint<{
|
|
|
176
224
|
};
|
|
177
225
|
};
|
|
178
226
|
}>;
|
|
179
|
-
export type
|
|
227
|
+
export type GetOnboardingAccountDiscovery = ApiEndpoint<{
|
|
228
|
+
Audit: {
|
|
229
|
+
kind: 'no-audit';
|
|
230
|
+
reason: 'non-auditable';
|
|
231
|
+
};
|
|
232
|
+
Method: 'GET';
|
|
233
|
+
Path: '/api/v1/account/onboarding/account-discovery';
|
|
234
|
+
Error: ApiError<'forbidden'>;
|
|
235
|
+
Success: {
|
|
236
|
+
data: {
|
|
237
|
+
suggestedAccountName: string | null;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
}>;
|
|
241
|
+
export type PostOnboardingRequestInvite = ApiEndpoint<{
|
|
242
|
+
Audit: {
|
|
243
|
+
kind: 'no-audit';
|
|
244
|
+
reason: 'non-auditable';
|
|
245
|
+
};
|
|
246
|
+
Method: 'POST';
|
|
247
|
+
Path: '/api/v1/account/onboarding/request-invite';
|
|
248
|
+
Body: never;
|
|
249
|
+
Error: ApiError<'not_found'> | ApiError<'email_delivery_failed'>;
|
|
250
|
+
Success: {
|
|
251
|
+
data: {
|
|
252
|
+
success: true;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
}>;
|
|
256
|
+
export type PostOnboardingHearAboutUs = ApiEndpoint<{
|
|
257
|
+
Audit: {
|
|
258
|
+
kind: 'no-audit';
|
|
259
|
+
reason: 'non-auditable';
|
|
260
|
+
};
|
|
180
261
|
Method: 'POST';
|
|
181
262
|
Path: '/api/v1/account/onboarding/hear-about-us';
|
|
182
263
|
Body: {
|
package/dist/action/api.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint } from '../api.js';
|
|
2
2
|
export interface AsyncActionResponse {
|
|
3
3
|
id: string;
|
|
4
4
|
statusUrl: string;
|
|
5
5
|
}
|
|
6
|
-
export type GetAsyncActionResult =
|
|
6
|
+
export type GetAsyncActionResult = ApiEndpoint<{
|
|
7
|
+
Audit: {
|
|
8
|
+
kind: 'no-audit';
|
|
9
|
+
reason: 'non-auditable';
|
|
10
|
+
};
|
|
7
11
|
Method: 'GET';
|
|
8
12
|
Path: `/action/:id`;
|
|
9
13
|
Params: {
|
|
@@ -11,7 +15,11 @@ export type GetAsyncActionResult = Endpoint<{
|
|
|
11
15
|
};
|
|
12
16
|
Success: Record<string, any>;
|
|
13
17
|
}>;
|
|
14
|
-
export type PostPublicTriggerAction =
|
|
18
|
+
export type PostPublicTriggerAction = ApiEndpoint<{
|
|
19
|
+
Audit: {
|
|
20
|
+
kind: 'no-audit';
|
|
21
|
+
reason: 'non-auditable';
|
|
22
|
+
};
|
|
15
23
|
Method: 'POST';
|
|
16
24
|
Path: '/action/trigger';
|
|
17
25
|
Body: {
|
|
@@ -26,7 +34,11 @@ export type PostPublicTriggerAction = Endpoint<{
|
|
|
26
34
|
};
|
|
27
35
|
Success: any;
|
|
28
36
|
}>;
|
|
29
|
-
export type PostInternalTriggerFunction =
|
|
37
|
+
export type PostInternalTriggerFunction = ApiEndpoint<{
|
|
38
|
+
Audit: {
|
|
39
|
+
kind: 'no-audit';
|
|
40
|
+
reason: 'non-auditable';
|
|
41
|
+
};
|
|
30
42
|
Method: 'POST';
|
|
31
43
|
Path: '/api/v1/trigger/function';
|
|
32
44
|
Body: {
|
|
@@ -42,7 +54,11 @@ export type PostInternalTriggerFunction = Endpoint<{
|
|
|
42
54
|
Success: any;
|
|
43
55
|
}>;
|
|
44
56
|
/** @deprecated Use POST /action/trigger to trigger actions and GET /records to fetch sync records instead. */
|
|
45
|
-
export type GetPublicV1 =
|
|
57
|
+
export type GetPublicV1 = ApiEndpoint<{
|
|
58
|
+
Audit: {
|
|
59
|
+
kind: 'no-audit';
|
|
60
|
+
reason: 'non-auditable';
|
|
61
|
+
};
|
|
46
62
|
Method: 'GET';
|
|
47
63
|
Path: `/v1/:path`;
|
|
48
64
|
Params: any;
|
package/dist/admin/http.api.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type PostImpersonate =
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../index.js';
|
|
2
|
+
export type PostImpersonate = ApiEndpoint<{
|
|
3
|
+
Audit: {
|
|
4
|
+
kind: 'no-audit';
|
|
5
|
+
reason: 'TODO: audit coverage pending';
|
|
6
|
+
};
|
|
3
7
|
Method: 'POST';
|
|
4
8
|
Path: `/api/v1/admin/impersonate`;
|
|
5
9
|
Querystring: {
|
|
@@ -8,7 +12,9 @@ export type PostImpersonate = Endpoint<{
|
|
|
8
12
|
Body: {
|
|
9
13
|
accountUUID: string;
|
|
10
14
|
loginReason: string;
|
|
15
|
+
code?: string | undefined;
|
|
11
16
|
};
|
|
17
|
+
Error: ApiError<'invalid_mfa_code'> | ApiError<'mfa_not_enabled'>;
|
|
12
18
|
Success: {
|
|
13
19
|
success: true;
|
|
14
20
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DBAPISecret, DBEnvironment } from '../environment/db.js';
|
|
2
|
+
import type { DBPlan } from '../plans/db.js';
|
|
3
|
+
import type { DBTeam } from '../team/db.js';
|
|
4
|
+
export type ApiKeyAuthSource = 'customer_key' | 'sandbox_token' | 'api_secret' | 'env_var' | 'connect_session';
|
|
5
|
+
export interface ApiKeyPrincipal {
|
|
6
|
+
type: 'api_key';
|
|
7
|
+
source: ApiKeyAuthSource;
|
|
8
|
+
accountId: number;
|
|
9
|
+
scopes: string[];
|
|
10
|
+
environmentIds: number[];
|
|
11
|
+
keyId?: number;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
}
|
|
14
|
+
export type ApiKeyAuthorizationTarget = {
|
|
15
|
+
type: 'account';
|
|
16
|
+
accountId: number;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'environment';
|
|
19
|
+
accountId: number;
|
|
20
|
+
environmentId: number;
|
|
21
|
+
};
|
|
22
|
+
export interface ApiKeyAuthDetails {
|
|
23
|
+
source: Exclude<ApiKeyAuthSource, 'connect_session'>;
|
|
24
|
+
scopes?: string[];
|
|
25
|
+
apiKeyId?: number;
|
|
26
|
+
apiKeyDisplayName?: string;
|
|
27
|
+
purpose?: 'dryrun' | 'deploy';
|
|
28
|
+
dryrunId?: string;
|
|
29
|
+
deploymentId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ApiKeyContext {
|
|
32
|
+
account: DBTeam;
|
|
33
|
+
environment?: DBEnvironment;
|
|
34
|
+
secret?: DBAPISecret;
|
|
35
|
+
plan: DBPlan | null;
|
|
36
|
+
principal: ApiKeyPrincipal;
|
|
37
|
+
auth: ApiKeyAuthDetails;
|
|
38
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare const API_KEY_SCOPES: readonly ["environment:*", "environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:list_functions", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:create", "environment:integrations:update", "environment:integrations:delete", "environment:integrations:*", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connections:*", "environment:connect_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:syncs:*", "environment:functions:list", "environment:functions:read", "environment:functions:delete", "environment:functions:compile", "environment:functions:dryrun", "environment:functions:*", "environment:deploy", "environment:records:read", "environment:records:write", "environment:records:*", "environment:logs:read", "environment:actions:execute", "environment:actions:*", "environment:proxy", "environment:variables:read", "environment:mcp"];
|
|
2
2
|
export type ApiKeyScope = (typeof API_KEY_SCOPES)[number];
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const ACCOUNT_API_KEY_SCOPES: readonly ["account:*", "account:billing:read", "account:team:invite_member"];
|
|
4
|
+
export type AccountApiKeyScope = (typeof ACCOUNT_API_KEY_SCOPES)[number];
|
|
5
|
+
export type CustomerKeyScope = ApiKeyScope | AccountApiKeyScope;
|
package/dist/api.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EndpointAudit } from './audit-trail/event.js';
|
|
1
2
|
import type { RunnerOutputError } from './runner/index.js';
|
|
2
3
|
export interface ApiError<TCode extends string, TErrors = Error[] | ValidationError[] | undefined, TPayload = unknown> {
|
|
3
4
|
error: {
|
|
@@ -65,6 +66,12 @@ export interface Endpoint<T extends EndpointDefinition> {
|
|
|
65
66
|
*/
|
|
66
67
|
Reply: ResDefaultErrors | (T['Error'] extends ApiError<any> ? T['Error'] | T['Success'] : T['Success']);
|
|
67
68
|
}
|
|
69
|
+
export interface ApiEndpointDefinition extends EndpointDefinition {
|
|
70
|
+
Audit: EndpointAudit;
|
|
71
|
+
}
|
|
72
|
+
export type ApiEndpoint<T extends ApiEndpointDefinition> = Endpoint<T> & {
|
|
73
|
+
Audit: T['Audit'];
|
|
74
|
+
};
|
|
68
75
|
export interface ErrorPayload {
|
|
69
76
|
type: string;
|
|
70
77
|
description: string;
|
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, GetManagedEmailVerification, PostForgotPassword, PostLogout, PostManagedEmailVerification, PostManagedSignup, PostSignin, PostSignup, PutResetPassword } from './account/api.js';
|
|
1
|
+
import type { ConfirmEmail, GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, GetManagedEmailVerification, GetOnboardingAccountDiscovery, PostForgotPassword, PostLogout, PostManagedEmailVerification, PostManagedSignup, PostOnboardingRequestInvite, PostSignin, PostSignup, PutResetPassword } from './account/api.js';
|
|
2
2
|
import type { GetAsyncActionResult, GetPublicV1, PostInternalTriggerFunction, PostPublicTriggerAction } from './action/api.js';
|
|
3
3
|
import type { PostImpersonate } from './admin/http.api.js';
|
|
4
4
|
import type { EndpointMethod } from './api.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { GetAuditTrail } from './audit-trail/api.js';
|
|
6
|
+
import type { PostPublicApiKeyAuthorization, PostPublicAwsSigV4Authorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
|
|
6
7
|
import type { PostCliTelemetry } from './cli/api.js';
|
|
7
8
|
import type { GetPublicClientMetadata } from './clientMetadata/http.api.js';
|
|
8
9
|
import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api.js';
|
|
@@ -14,13 +15,13 @@ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, GetEnvironment, Get
|
|
|
14
15
|
import type { PatchWebhook } from './environment/api/webhook.js';
|
|
15
16
|
import type { PostEnvironmentVariables } from './environment/variable/api.js';
|
|
16
17
|
import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api.js';
|
|
17
|
-
import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunctionDeployment, GetFunctionDryrun, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult } from './functions/api.js';
|
|
18
|
+
import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunctionDeployment, GetFunctionDryrun, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentBundle, PostFunctionDeploymentBundlePreview, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult } from './functions/api.js';
|
|
18
19
|
import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
|
|
19
20
|
import type { DeleteIntegration, DeletePublicIntegration, GetFunctionCode, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
|
|
20
21
|
import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
|
|
21
22
|
import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api.js';
|
|
22
23
|
import type { GetMeta } from './meta/api.js';
|
|
23
|
-
import type { DeleteMFA, GetMFAStatus, PostMFAActivation, PostMFAEnrollment, PostMFARecoveryCodes } from './mfa/api.js';
|
|
24
|
+
import type { DeleteMFA, GetMFAStatus, PostMFAActivation, PostMFAEnrollment, PostMFALoginVerification, PostMFARecoveryCodes } from './mfa/api.js';
|
|
24
25
|
import type { GetPlainHmac } from './plain/api.js';
|
|
25
26
|
import type { GetBillingUsage, GetBillingUsageTopDimensionValues, PostPlanChange, PostPlanExtendTrial, PutBillingInvoicingDetails } from './plans/http.api.js';
|
|
26
27
|
import type { GetProvider, GetProviders, GetPublicProvider, GetPublicProviders } from './providers/api.js';
|
|
@@ -32,8 +33,8 @@ import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, Pos
|
|
|
32
33
|
import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
|
|
33
34
|
import type { GetUser, PatchUser, PutUserPassword } from './user/api.js';
|
|
34
35
|
import type { PostPublicWebhook } from './webhooks/http.api.js';
|
|
35
|
-
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization |
|
|
36
|
-
export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetBillingUsage | GetBillingUsageTopDimensionValues | GetUser | PatchUser | PutUserPassword | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | GetIntegrationFunction | GetIntegrationFunctions | GetFunctionCode | DeleteIntegrationFunction | GetIntegrationTemplates | GetProviderTemplates | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | PatchConnection | PostConnectionMetadata | GetConnectionRecordModels | GetConnectionRecords | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | ListApiKeys | CreateApiKey | DeleteApiKey | PatchApiKey | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction | GetMFAStatus | PostMFAEnrollment | PostMFAActivation | PostMFARecoveryCodes | DeleteMFA | GetPlainHmac;
|
|
36
|
+
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | DeleteConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicClientMetadata | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PostCliTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicAwsSigV4Authorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | GetFunctionDeployment | PostFunctionDeploymentResult | PostFunctionDeploymentBundle | PostFunctionDeploymentBundlePreview | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | AllPublicProxy;
|
|
37
|
+
export type PrivateApiEndpoints = GetAuditTrail | ConfirmEmail | PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetBillingUsage | GetBillingUsageTopDimensionValues | GetUser | PatchUser | PutUserPassword | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | GetIntegrationFunction | GetIntegrationFunctions | GetFunctionCode | DeleteIntegrationFunction | GetIntegrationTemplates | GetProviderTemplates | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | PatchConnection | PostConnectionMetadata | GetConnectionRecordModels | GetConnectionRecords | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | GetOnboardingAccountDiscovery | PostOnboardingRequestInvite | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | ListApiKeys | CreateApiKey | DeleteApiKey | PatchApiKey | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction | GetMFAStatus | PostMFAEnrollment | PostMFAActivation | PostMFARecoveryCodes | PostMFALoginVerification | DeleteMFA | GetPlainHmac;
|
|
37
38
|
export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
|
|
38
39
|
/**
|
|
39
40
|
* Automatically narrow endpoints type with Method + Path
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ApiEndpoint } from '../api.js';
|
|
2
|
+
import type { AuditAction, AuditActor, AuditContext, AuditOutcome, AuditResource, AuditTarget, AuditTrailVersion } from './event.js';
|
|
3
|
+
export interface ApiAuditTrailEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
version: AuditTrailVersion;
|
|
6
|
+
occurredAt: string;
|
|
7
|
+
accountId: number;
|
|
8
|
+
environment: {
|
|
9
|
+
id: number;
|
|
10
|
+
display: string;
|
|
11
|
+
} | null;
|
|
12
|
+
actor: AuditActor;
|
|
13
|
+
via?: AuditActor[];
|
|
14
|
+
targets: AuditTarget[];
|
|
15
|
+
context: AuditContext;
|
|
16
|
+
outcome: AuditOutcome;
|
|
17
|
+
resource: AuditResource;
|
|
18
|
+
action: AuditAction;
|
|
19
|
+
metadata?: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export type GetAuditTrail = ApiEndpoint<{
|
|
22
|
+
Audit: {
|
|
23
|
+
kind: 'no-audit';
|
|
24
|
+
reason: 'non-auditable';
|
|
25
|
+
};
|
|
26
|
+
Method: 'GET';
|
|
27
|
+
Path: '/api/v1/audit-trail';
|
|
28
|
+
Querystring: {
|
|
29
|
+
cursor?: string;
|
|
30
|
+
from?: string;
|
|
31
|
+
to?: string;
|
|
32
|
+
resources?: string;
|
|
33
|
+
actions?: string;
|
|
34
|
+
};
|
|
35
|
+
Success: {
|
|
36
|
+
data: ApiAuditTrailEvent[];
|
|
37
|
+
pagination: {
|
|
38
|
+
nextCursor: string | null;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type AuditTrailVersion = '2026-07-16';
|
|
2
|
+
export type AuditActorType = 'user' | 'api_key' | 'system' | 'anonymous';
|
|
3
|
+
export type AuditOutcome = 'success' | 'failure' | 'denied';
|
|
4
|
+
export type AuditInterface = 'api' | 'mcp';
|
|
5
|
+
interface AuditEventTable {
|
|
6
|
+
connection: 'created' | 'updated' | 'metadata_updated' | 'refreshed' | 'deleted';
|
|
7
|
+
sync: 'enabled' | 'disabled' | 'paused' | 'started' | 'triggered' | 'cancelled' | 'frequency_changed' | 'variant_created' | 'variant_deleted';
|
|
8
|
+
function: 'deployed' | 'upgraded' | 'deleted';
|
|
9
|
+
integration: 'created' | 'updated' | 'deleted';
|
|
10
|
+
api_key: 'created' | 'updated' | 'deleted';
|
|
11
|
+
member: 'invited' | 'invite_accepted' | 'invite_declined' | 'invite_revoked' | 'role_changed' | 'removed';
|
|
12
|
+
team: 'updated';
|
|
13
|
+
user: 'updated';
|
|
14
|
+
environment: 'created' | 'updated' | 'variables_changed' | 'webhook_urls_changed' | 'deleted';
|
|
15
|
+
app_auth: 'login' | 'logout' | 'signup' | 'password_changed' | 'password_reset';
|
|
16
|
+
mfa: 'enrolled' | 'enabled' | 'disabled' | 'verified' | 'recovery_regenerated';
|
|
17
|
+
billing: 'plan_changed' | 'trial_extended' | 'details_changed' | 'payment_method_added' | 'payment_method_removed';
|
|
18
|
+
}
|
|
19
|
+
export type AuditResource = keyof AuditEventTable;
|
|
20
|
+
export type AuditActionOf<R extends AuditResource> = AuditEventTable[R];
|
|
21
|
+
export type AuditAction = AuditActionOf<AuditResource>;
|
|
22
|
+
export type AuditEventKey = {
|
|
23
|
+
[R in AuditResource]: `${R}.${AuditEventTable[R]}`;
|
|
24
|
+
}[AuditResource];
|
|
25
|
+
export type AuditScope = 'account' | 'environment';
|
|
26
|
+
export type AuditTargetType = 'connection' | 'sync' | 'function' | 'integration' | 'api_key' | 'member' | 'team' | 'user' | 'environment';
|
|
27
|
+
export interface AuditActor {
|
|
28
|
+
type: AuditActorType;
|
|
29
|
+
id: string;
|
|
30
|
+
display?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AuditTarget {
|
|
33
|
+
type: AuditTargetType;
|
|
34
|
+
id: string;
|
|
35
|
+
display?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AuditContext {
|
|
38
|
+
interface?: AuditInterface;
|
|
39
|
+
ip?: string;
|
|
40
|
+
userAgent?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface AuditPolicy<R extends AuditResource = AuditResource, A extends AuditActionOf<R> = AuditActionOf<R>, S extends AuditScope = AuditScope> {
|
|
43
|
+
kind: 'audit';
|
|
44
|
+
resource: R;
|
|
45
|
+
action: A;
|
|
46
|
+
scope: S;
|
|
47
|
+
}
|
|
48
|
+
export interface NoAudit<Reason extends string = 'non-auditable'> {
|
|
49
|
+
kind: 'no-audit';
|
|
50
|
+
reason: Reason;
|
|
51
|
+
}
|
|
52
|
+
export type EndpointAudit = AuditPolicy | NoAudit<string>;
|
|
53
|
+
export type SerializedAuditEvent = {
|
|
54
|
+
event: string;
|
|
55
|
+
};
|
|
56
|
+
export {};
|
package/dist/auth/api.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export interface AuthModes {
|
|
|
6
6
|
OAuth2CC: 'OAUTH2_CC';
|
|
7
7
|
Basic: 'BASIC';
|
|
8
8
|
ApiKey: 'API_KEY';
|
|
9
|
-
AppStore: 'APP_STORE';
|
|
10
9
|
Custom: 'CUSTOM';
|
|
11
10
|
App: 'APP';
|
|
12
11
|
None: 'NONE';
|
|
@@ -66,13 +65,6 @@ export interface AppCredentials {
|
|
|
66
65
|
raw: Record<string, any>;
|
|
67
66
|
jwtToken?: string;
|
|
68
67
|
}
|
|
69
|
-
export interface AppStoreCredentials {
|
|
70
|
-
type?: AuthModes['AppStore'];
|
|
71
|
-
access_token: string;
|
|
72
|
-
expires_at?: Date | undefined;
|
|
73
|
-
raw: Record<string, any>;
|
|
74
|
-
private_key: string;
|
|
75
|
-
}
|
|
76
68
|
export interface OAuth2Credentials extends CredentialsCommon {
|
|
77
69
|
type: AuthModes['OAuth2'];
|
|
78
70
|
access_token: string;
|
|
@@ -170,6 +162,6 @@ export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'typ
|
|
|
170
162
|
expires_in?: number;
|
|
171
163
|
}
|
|
172
164
|
export type TestableCredentials = ApiKeyCredentials | BasicApiCredentials | TbaCredentials | JwtCredentials | SignatureCredentials;
|
|
173
|
-
export type RefreshableCredentials = OAuth2Credentials | AppCredentials |
|
|
174
|
-
export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials |
|
|
165
|
+
export type RefreshableCredentials = OAuth2Credentials | AppCredentials | OAuth2ClientCredentials | JwtCredentials | TwoStepCredentials | BillCredentials | SignatureCredentials | AwsSigV4Credentials;
|
|
166
|
+
export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | JwtCredentials | BillCredentials | TwoStepCredentials | CombinedOauth2AppCredentials | SignatureCredentials | InstallPluginCredentials | AwsSigV4Credentials;
|
|
175
167
|
export type ApiPublicAllAuthCredentials = ReplaceInObjectDeep<AllAuthCredentials, Date, string>;
|