@nangohq/types 0.71.1 → 0.71.3
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 +73 -19
- package/dist/action/api.d.ts +21 -5
- package/dist/admin/http.api.d.ts +8 -2
- package/dist/api.d.ts +7 -0
- package/dist/api.endpoints.d.ts +6 -5
- package/dist/audit-trail/api.d.ts +39 -0
- package/dist/audit-trail/event.d.ts +54 -0
- package/dist/auth/api.d.ts +4 -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/billing/types.d.ts +7 -16
- 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 +43 -16
- 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/db.d.ts +40 -0
- package/dist/functions/api.d.ts +73 -17
- package/dist/functions/config.d.ts +58 -0
- package/dist/gettingStarted/api.d.ts +11 -3
- package/dist/index.d.ts +4 -0
- package/dist/integration/api.d.ts +51 -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 -3
- 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 +5 -7
- package/dist/proxy/api.d.ts +4 -1
- 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/utils.d.ts +3 -0
- package/dist/webhooks/http.api.d.ts +6 -2
- package/package.json +1 -1
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,29 @@ 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
|
+
email: string;
|
|
36
|
+
userId: number;
|
|
37
|
+
accountId: number;
|
|
30
38
|
showHearAboutUs?: boolean;
|
|
31
39
|
};
|
|
32
40
|
}>;
|
|
33
|
-
export type ResendVerificationEmailByUuid =
|
|
41
|
+
export type ResendVerificationEmailByUuid = ApiEndpoint<{
|
|
42
|
+
Audit: {
|
|
43
|
+
kind: 'no-audit';
|
|
44
|
+
reason: 'non-auditable';
|
|
45
|
+
};
|
|
34
46
|
Method: 'POST';
|
|
35
47
|
Path: '/api/v1/account/resend-verification-email/by-uuid';
|
|
36
48
|
Body: {
|
|
@@ -41,7 +53,11 @@ export type ResendVerificationEmailByUuid = Endpoint<{
|
|
|
41
53
|
success: boolean;
|
|
42
54
|
};
|
|
43
55
|
}>;
|
|
44
|
-
export type ResendVerificationEmailByEmail =
|
|
56
|
+
export type ResendVerificationEmailByEmail = ApiEndpoint<{
|
|
57
|
+
Audit: {
|
|
58
|
+
kind: 'no-audit';
|
|
59
|
+
reason: 'non-auditable';
|
|
60
|
+
};
|
|
45
61
|
Method: 'POST';
|
|
46
62
|
Path: '/api/v1/account/resend-verification-email/by-email';
|
|
47
63
|
Body: {
|
|
@@ -52,7 +68,11 @@ export type ResendVerificationEmailByEmail = Endpoint<{
|
|
|
52
68
|
success: boolean;
|
|
53
69
|
};
|
|
54
70
|
}>;
|
|
55
|
-
export type GetEmailByUuid =
|
|
71
|
+
export type GetEmailByUuid = ApiEndpoint<{
|
|
72
|
+
Audit: {
|
|
73
|
+
kind: 'no-audit';
|
|
74
|
+
reason: 'non-auditable';
|
|
75
|
+
};
|
|
56
76
|
Method: 'GET';
|
|
57
77
|
Path: '/api/v1/account/email/:uuid';
|
|
58
78
|
Params: {
|
|
@@ -64,7 +84,11 @@ export type GetEmailByUuid = Endpoint<{
|
|
|
64
84
|
verified: boolean;
|
|
65
85
|
};
|
|
66
86
|
}>;
|
|
67
|
-
export type GetEmailByExpiredToken =
|
|
87
|
+
export type GetEmailByExpiredToken = ApiEndpoint<{
|
|
88
|
+
Audit: {
|
|
89
|
+
kind: 'no-audit';
|
|
90
|
+
reason: 'non-auditable';
|
|
91
|
+
};
|
|
68
92
|
Method: 'GET';
|
|
69
93
|
Path: '/api/v1/account/email/expired-token/:token';
|
|
70
94
|
Params: {
|
|
@@ -77,24 +101,35 @@ export type GetEmailByExpiredToken = Endpoint<{
|
|
|
77
101
|
uuid: string;
|
|
78
102
|
};
|
|
79
103
|
}>;
|
|
80
|
-
export type PostSignin =
|
|
104
|
+
export type PostSignin = ApiEndpoint<{
|
|
105
|
+
Audit: AuditPolicy<'app_auth', 'login', 'account'>;
|
|
81
106
|
Method: 'POST';
|
|
82
107
|
Path: '/api/v1/account/signin';
|
|
83
108
|
Body: {
|
|
84
109
|
email: string;
|
|
85
110
|
password: string;
|
|
111
|
+
returnTo?: string;
|
|
86
112
|
};
|
|
87
113
|
Error: ApiError<'email_not_verified'> | ApiError<'user_suspended'> | ApiError<'unauthorized'>;
|
|
88
114
|
Success: {
|
|
89
115
|
user: ApiUser;
|
|
116
|
+
} | {
|
|
117
|
+
data: {
|
|
118
|
+
mfaRequired: true;
|
|
119
|
+
};
|
|
90
120
|
};
|
|
91
121
|
}>;
|
|
92
|
-
export type PostLogout =
|
|
122
|
+
export type PostLogout = ApiEndpoint<{
|
|
123
|
+
Audit: AuditPolicy<'app_auth', 'logout', 'account'>;
|
|
93
124
|
Method: 'POST';
|
|
94
125
|
Path: '/api/v1/account/logout';
|
|
95
126
|
Success: never;
|
|
96
127
|
}>;
|
|
97
|
-
export type PostForgotPassword =
|
|
128
|
+
export type PostForgotPassword = ApiEndpoint<{
|
|
129
|
+
Audit: {
|
|
130
|
+
kind: 'no-audit';
|
|
131
|
+
reason: 'non-auditable';
|
|
132
|
+
};
|
|
98
133
|
Method: 'POST';
|
|
99
134
|
Path: '/api/v1/account/forgot-password';
|
|
100
135
|
Body: {
|
|
@@ -104,7 +139,8 @@ export type PostForgotPassword = Endpoint<{
|
|
|
104
139
|
success: true;
|
|
105
140
|
};
|
|
106
141
|
}>;
|
|
107
|
-
export type PutResetPassword =
|
|
142
|
+
export type PutResetPassword = ApiEndpoint<{
|
|
143
|
+
Audit: AuditPolicy<'app_auth', 'password_reset', 'account'>;
|
|
108
144
|
Method: 'PUT';
|
|
109
145
|
Path: '/api/v1/account/reset-password';
|
|
110
146
|
Body: {
|
|
@@ -116,7 +152,11 @@ export type PutResetPassword = Endpoint<{
|
|
|
116
152
|
success: true;
|
|
117
153
|
};
|
|
118
154
|
}>;
|
|
119
|
-
export type PostManagedSignup =
|
|
155
|
+
export type PostManagedSignup = ApiEndpoint<{
|
|
156
|
+
Audit: {
|
|
157
|
+
kind: 'no-audit';
|
|
158
|
+
reason: 'initiates SSO redirect, no auth state change';
|
|
159
|
+
};
|
|
120
160
|
Method: 'POST';
|
|
121
161
|
Path: '/api/v1/account/managed/signup';
|
|
122
162
|
Body: {
|
|
@@ -129,7 +169,11 @@ export type PostManagedSignup = Endpoint<{
|
|
|
129
169
|
};
|
|
130
170
|
};
|
|
131
171
|
}>;
|
|
132
|
-
export type GetManagedEmailVerification =
|
|
172
|
+
export type GetManagedEmailVerification = ApiEndpoint<{
|
|
173
|
+
Audit: {
|
|
174
|
+
kind: 'no-audit';
|
|
175
|
+
reason: 'read-only, no auth state change';
|
|
176
|
+
};
|
|
133
177
|
Method: 'GET';
|
|
134
178
|
Path: '/api/v1/account/managed/verification';
|
|
135
179
|
Error: ApiError<'not_found'>;
|
|
@@ -139,7 +183,8 @@ export type GetManagedEmailVerification = Endpoint<{
|
|
|
139
183
|
};
|
|
140
184
|
};
|
|
141
185
|
}>;
|
|
142
|
-
export type PostManagedEmailVerification =
|
|
186
|
+
export type PostManagedEmailVerification = ApiEndpoint<{
|
|
187
|
+
Audit: AuditPolicy<'app_auth', 'login' | 'signup', 'account'>;
|
|
143
188
|
Method: 'POST';
|
|
144
189
|
Path: '/api/v1/account/managed/verification';
|
|
145
190
|
Body: {
|
|
@@ -152,7 +197,8 @@ export type PostManagedEmailVerification = Endpoint<{
|
|
|
152
197
|
};
|
|
153
198
|
};
|
|
154
199
|
}>;
|
|
155
|
-
export type GetManagedCallback =
|
|
200
|
+
export type GetManagedCallback = ApiEndpoint<{
|
|
201
|
+
Audit: AuditPolicy<'app_auth', 'login' | 'signup', 'account'>;
|
|
156
202
|
Method: 'GET';
|
|
157
203
|
Path: '/api/v1/login/callback';
|
|
158
204
|
Querystring: {
|
|
@@ -166,7 +212,11 @@ export type GetManagedCallback = Endpoint<{
|
|
|
166
212
|
};
|
|
167
213
|
};
|
|
168
214
|
}>;
|
|
169
|
-
export type GetOnboardingHearAboutUs =
|
|
215
|
+
export type GetOnboardingHearAboutUs = ApiEndpoint<{
|
|
216
|
+
Audit: {
|
|
217
|
+
kind: 'no-audit';
|
|
218
|
+
reason: 'non-auditable';
|
|
219
|
+
};
|
|
170
220
|
Method: 'GET';
|
|
171
221
|
Path: '/api/v1/account/onboarding/hear-about-us';
|
|
172
222
|
Error: ApiError<'unauthorized'>;
|
|
@@ -176,7 +226,11 @@ export type GetOnboardingHearAboutUs = Endpoint<{
|
|
|
176
226
|
};
|
|
177
227
|
};
|
|
178
228
|
}>;
|
|
179
|
-
export type PostOnboardingHearAboutUs =
|
|
229
|
+
export type PostOnboardingHearAboutUs = ApiEndpoint<{
|
|
230
|
+
Audit: {
|
|
231
|
+
kind: 'no-audit';
|
|
232
|
+
reason: 'non-auditable';
|
|
233
|
+
};
|
|
180
234
|
Method: 'POST';
|
|
181
235
|
Path: '/api/v1/account/onboarding/hear-about-us';
|
|
182
236
|
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
|
};
|
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, PostForgotPassword, PostLogout, PostManagedEmailVerification, PostManagedSignup, 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';
|
|
@@ -20,7 +21,7 @@ import type { DeleteIntegration, DeletePublicIntegration, GetFunctionCode, GetIn
|
|
|
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 | 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 | 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,39 @@
|
|
|
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
|
+
};
|
|
33
|
+
Success: {
|
|
34
|
+
data: ApiAuditTrailEvent[];
|
|
35
|
+
pagination: {
|
|
36
|
+
nextCursor: string | null;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type AuditTrailVersion = '2026-07-16';
|
|
2
|
+
export type AuditActorType = 'user' | 'api_key' | 'system' | 'anonymous';
|
|
3
|
+
export type AuditOutcome = 'success' | 'failure' | 'denied';
|
|
4
|
+
interface AuditEventTable {
|
|
5
|
+
connection: 'created' | 'updated' | 'metadata_updated' | 'refreshed' | 'deleted';
|
|
6
|
+
sync: 'enabled' | 'disabled' | 'paused' | 'started' | 'triggered' | 'cancelled' | 'frequency_changed' | 'variant_created' | 'variant_deleted';
|
|
7
|
+
function: 'deployed' | 'upgraded' | 'deleted';
|
|
8
|
+
integration: 'created' | 'updated' | 'deleted';
|
|
9
|
+
api_key: 'created' | 'updated' | 'deleted';
|
|
10
|
+
member: 'invited' | 'invite_accepted' | 'invite_declined' | 'invite_revoked' | 'role_changed' | 'removed';
|
|
11
|
+
team: 'updated';
|
|
12
|
+
user: 'updated';
|
|
13
|
+
environment: 'created' | 'updated' | 'variables_changed' | 'webhook_urls_changed' | 'deleted';
|
|
14
|
+
app_auth: 'login' | 'logout' | 'signup' | 'password_changed' | 'password_reset';
|
|
15
|
+
mfa: 'enrolled' | 'enabled' | 'disabled' | 'verified' | 'recovery_regenerated';
|
|
16
|
+
billing: 'plan_changed' | 'trial_extended' | 'details_changed' | 'payment_method_added' | 'payment_method_removed';
|
|
17
|
+
}
|
|
18
|
+
export type AuditResource = keyof AuditEventTable;
|
|
19
|
+
export type AuditActionOf<R extends AuditResource> = AuditEventTable[R];
|
|
20
|
+
export type AuditAction = AuditActionOf<AuditResource>;
|
|
21
|
+
export type AuditEventKey = {
|
|
22
|
+
[R in AuditResource]: `${R}.${AuditEventTable[R]}`;
|
|
23
|
+
}[AuditResource];
|
|
24
|
+
export type AuditScope = 'account' | 'environment';
|
|
25
|
+
export type AuditTargetType = 'connection' | 'sync' | 'function' | 'integration' | 'api_key' | 'member' | 'team' | 'user' | 'environment';
|
|
26
|
+
export interface AuditActor {
|
|
27
|
+
type: AuditActorType;
|
|
28
|
+
id: string;
|
|
29
|
+
display?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface AuditTarget {
|
|
32
|
+
type: AuditTargetType;
|
|
33
|
+
id: string;
|
|
34
|
+
display?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AuditContext {
|
|
37
|
+
ip?: string;
|
|
38
|
+
userAgent?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AuditPolicy<R extends AuditResource = AuditResource, A extends AuditActionOf<R> = AuditActionOf<R>, S extends AuditScope = AuditScope> {
|
|
41
|
+
kind: 'audit';
|
|
42
|
+
resource: R;
|
|
43
|
+
action: A;
|
|
44
|
+
scope: S;
|
|
45
|
+
}
|
|
46
|
+
export interface NoAudit<Reason extends string = 'non-auditable'> {
|
|
47
|
+
kind: 'no-audit';
|
|
48
|
+
reason: Reason;
|
|
49
|
+
}
|
|
50
|
+
export type EndpointAudit = AuditPolicy | NoAudit<string>;
|
|
51
|
+
export type SerializedAuditEvent = {
|
|
52
|
+
event: string;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
package/dist/auth/api.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { DBConnection } from '../connection/db.js';
|
|
2
|
+
import type { ReplaceInObjectDeep } from '../utils.js';
|
|
2
3
|
export interface AuthModes {
|
|
3
4
|
OAuth1: 'OAUTH1';
|
|
4
5
|
OAuth2: 'OAUTH2';
|
|
5
6
|
OAuth2CC: 'OAUTH2_CC';
|
|
6
7
|
Basic: 'BASIC';
|
|
7
8
|
ApiKey: 'API_KEY';
|
|
8
|
-
AppStore: 'APP_STORE';
|
|
9
9
|
Custom: 'CUSTOM';
|
|
10
10
|
App: 'APP';
|
|
11
11
|
None: 'NONE';
|
|
@@ -65,13 +65,6 @@ export interface AppCredentials {
|
|
|
65
65
|
raw: Record<string, any>;
|
|
66
66
|
jwtToken?: string;
|
|
67
67
|
}
|
|
68
|
-
export interface AppStoreCredentials {
|
|
69
|
-
type?: AuthModes['AppStore'];
|
|
70
|
-
access_token: string;
|
|
71
|
-
expires_at?: Date | undefined;
|
|
72
|
-
raw: Record<string, any>;
|
|
73
|
-
private_key: string;
|
|
74
|
-
}
|
|
75
68
|
export interface OAuth2Credentials extends CredentialsCommon {
|
|
76
69
|
type: AuthModes['OAuth2'];
|
|
77
70
|
access_token: string;
|
|
@@ -169,5 +162,6 @@ export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'typ
|
|
|
169
162
|
expires_in?: number;
|
|
170
163
|
}
|
|
171
164
|
export type TestableCredentials = ApiKeyCredentials | BasicApiCredentials | TbaCredentials | JwtCredentials | SignatureCredentials;
|
|
172
|
-
export type RefreshableCredentials = OAuth2Credentials | AppCredentials |
|
|
173
|
-
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;
|
|
167
|
+
export type ApiPublicAllAuthCredentials = ReplaceInObjectDeep<AllAuthCredentials, Date, string>;
|
package/dist/auth/http.api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
2
|
export type ConnectionQueryString = {
|
|
3
3
|
connection_id?: string | undefined;
|
|
4
4
|
params?: Record<string, any> | undefined;
|
|
@@ -34,7 +34,11 @@ export interface WebSocketConnectionResponseSuccess {
|
|
|
34
34
|
private_key?: string | undefined;
|
|
35
35
|
}
|
|
36
36
|
type AuthErrors = ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'> | ApiError<'integration_not_allowed'> | ApiError<'invalid_connection'> | ApiError<'connection_test_failed'> | ApiError<'connection_validation_failed'>;
|
|
37
|
-
export type PostPublicApiKeyAuthorization =
|
|
37
|
+
export type PostPublicApiKeyAuthorization = ApiEndpoint<{
|
|
38
|
+
Audit: {
|
|
39
|
+
kind: 'no-audit';
|
|
40
|
+
reason: 'TODO: audit coverage pending';
|
|
41
|
+
};
|
|
38
42
|
Method: 'POST';
|
|
39
43
|
Body: {
|
|
40
44
|
apiKey: string;
|
|
@@ -47,23 +51,11 @@ export type PostPublicApiKeyAuthorization = Endpoint<{
|
|
|
47
51
|
Error: AuthErrors;
|
|
48
52
|
Success: ConnectionResponseSuccess;
|
|
49
53
|
}>;
|
|
50
|
-
export type
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
privateKey: string;
|
|
55
|
-
issuerId: string;
|
|
56
|
-
scope?: string | undefined;
|
|
54
|
+
export type PostPublicBasicAuthorization = ApiEndpoint<{
|
|
55
|
+
Audit: {
|
|
56
|
+
kind: 'no-audit';
|
|
57
|
+
reason: 'TODO: audit coverage pending';
|
|
57
58
|
};
|
|
58
|
-
Querystring: ConnectionQueryString;
|
|
59
|
-
Params: {
|
|
60
|
-
providerConfigKey: string;
|
|
61
|
-
};
|
|
62
|
-
Path: '/app-store-auth/:providerConfigKey';
|
|
63
|
-
Error: AuthErrors;
|
|
64
|
-
Success: ConnectionResponseSuccess;
|
|
65
|
-
}>;
|
|
66
|
-
export type PostPublicBasicAuthorization = Endpoint<{
|
|
67
59
|
Method: 'POST';
|
|
68
60
|
Body: {
|
|
69
61
|
username: string;
|
|
@@ -77,7 +69,11 @@ export type PostPublicBasicAuthorization = Endpoint<{
|
|
|
77
69
|
Error: AuthErrors;
|
|
78
70
|
Success: ConnectionResponseSuccess;
|
|
79
71
|
}>;
|
|
80
|
-
export type PostPublicTbaAuthorization =
|
|
72
|
+
export type PostPublicTbaAuthorization = ApiEndpoint<{
|
|
73
|
+
Audit: {
|
|
74
|
+
kind: 'no-audit';
|
|
75
|
+
reason: 'TODO: audit coverage pending';
|
|
76
|
+
};
|
|
81
77
|
Method: 'POST';
|
|
82
78
|
Body: {
|
|
83
79
|
token_id: string;
|
|
@@ -94,7 +90,11 @@ export type PostPublicTbaAuthorization = Endpoint<{
|
|
|
94
90
|
Error: AuthErrors;
|
|
95
91
|
Success: ConnectionResponseSuccess;
|
|
96
92
|
}>;
|
|
97
|
-
export type PostPublicJwtAuthorization =
|
|
93
|
+
export type PostPublicJwtAuthorization = ApiEndpoint<{
|
|
94
|
+
Audit: {
|
|
95
|
+
kind: 'no-audit';
|
|
96
|
+
reason: 'TODO: audit coverage pending';
|
|
97
|
+
};
|
|
98
98
|
Method: 'POST';
|
|
99
99
|
Body: Record<string, any>;
|
|
100
100
|
Querystring: ConnectionQueryString;
|
|
@@ -105,7 +105,11 @@ export type PostPublicJwtAuthorization = Endpoint<{
|
|
|
105
105
|
Error: AuthErrors;
|
|
106
106
|
Success: ConnectionResponseSuccess;
|
|
107
107
|
}>;
|
|
108
|
-
export type PostPublicUnauthenticatedAuthorization =
|
|
108
|
+
export type PostPublicUnauthenticatedAuthorization = ApiEndpoint<{
|
|
109
|
+
Audit: {
|
|
110
|
+
kind: 'no-audit';
|
|
111
|
+
reason: 'TODO: audit coverage pending';
|
|
112
|
+
};
|
|
109
113
|
Method: 'POST';
|
|
110
114
|
Querystring: ConnectionQueryString;
|
|
111
115
|
Params: {
|
|
@@ -115,7 +119,11 @@ export type PostPublicUnauthenticatedAuthorization = Endpoint<{
|
|
|
115
119
|
Error: AuthErrors;
|
|
116
120
|
Success: ConnectionResponseSuccess;
|
|
117
121
|
}>;
|
|
118
|
-
export type PostPublicBillAuthorization =
|
|
122
|
+
export type PostPublicBillAuthorization = ApiEndpoint<{
|
|
123
|
+
Audit: {
|
|
124
|
+
kind: 'no-audit';
|
|
125
|
+
reason: 'TODO: audit coverage pending';
|
|
126
|
+
};
|
|
119
127
|
Method: 'POST';
|
|
120
128
|
Body: {
|
|
121
129
|
username: string;
|
|
@@ -131,7 +139,11 @@ export type PostPublicBillAuthorization = Endpoint<{
|
|
|
131
139
|
Error: AuthErrors;
|
|
132
140
|
Success: ConnectionResponseSuccess;
|
|
133
141
|
}>;
|
|
134
|
-
export type PostPublicTwoStepAuthorization =
|
|
142
|
+
export type PostPublicTwoStepAuthorization = ApiEndpoint<{
|
|
143
|
+
Audit: {
|
|
144
|
+
kind: 'no-audit';
|
|
145
|
+
reason: 'TODO: audit coverage pending';
|
|
146
|
+
};
|
|
135
147
|
Method: 'POST';
|
|
136
148
|
Body: Record<string, any>;
|
|
137
149
|
Querystring: ConnectionQueryString;
|
|
@@ -142,7 +154,11 @@ export type PostPublicTwoStepAuthorization = Endpoint<{
|
|
|
142
154
|
Error: AuthErrors;
|
|
143
155
|
Success: ConnectionResponseSuccess;
|
|
144
156
|
}>;
|
|
145
|
-
export type PostPublicSignatureAuthorization =
|
|
157
|
+
export type PostPublicSignatureAuthorization = ApiEndpoint<{
|
|
158
|
+
Audit: {
|
|
159
|
+
kind: 'no-audit';
|
|
160
|
+
reason: 'TODO: audit coverage pending';
|
|
161
|
+
};
|
|
146
162
|
Method: 'POST';
|
|
147
163
|
Body: {
|
|
148
164
|
username: string;
|
|
@@ -157,7 +173,11 @@ export type PostPublicSignatureAuthorization = Endpoint<{
|
|
|
157
173
|
Success: ConnectionResponseSuccess;
|
|
158
174
|
}>;
|
|
159
175
|
type AwsSigV4AuthErrors = AuthErrors | ApiError<'invalid_aws_sigv4_config'> | ApiError<'missing_aws_sigv4_service'> | ApiError<'missing_aws_sigv4_sts_endpoint'> | ApiError<'missing_aws_sigv4_builtin_credentials'> | ApiError<'missing_aws_sigv4_region'> | ApiError<'aws_sigv4_sts_request_failed'>;
|
|
160
|
-
export type PostPublicAwsSigV4Authorization =
|
|
176
|
+
export type PostPublicAwsSigV4Authorization = ApiEndpoint<{
|
|
177
|
+
Audit: {
|
|
178
|
+
kind: 'no-audit';
|
|
179
|
+
reason: 'TODO: audit coverage pending';
|
|
180
|
+
};
|
|
161
181
|
Method: 'POST';
|
|
162
182
|
Body: {
|
|
163
183
|
role_arn: string;
|
|
@@ -171,7 +191,11 @@ export type PostPublicAwsSigV4Authorization = Endpoint<{
|
|
|
171
191
|
Error: AwsSigV4AuthErrors;
|
|
172
192
|
Success: ConnectionResponseSuccess;
|
|
173
193
|
}>;
|
|
174
|
-
export type PostPublicOauthOutboundAuthorization =
|
|
194
|
+
export type PostPublicOauthOutboundAuthorization = ApiEndpoint<{
|
|
195
|
+
Audit: {
|
|
196
|
+
kind: 'no-audit';
|
|
197
|
+
reason: 'TODO: audit coverage pending';
|
|
198
|
+
};
|
|
175
199
|
Method: 'POST';
|
|
176
200
|
Body: {
|
|
177
201
|
username: string;
|
package/dist/authz/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Role } from '../user/db.js';
|
|
2
2
|
export type Action = 'create' | 'read' | 'update' | 'delete' | '*';
|
|
3
|
-
export type Resource = 'team' | 'team_member' | 'invite' | 'connect_ui_settings' | 'billing' | 'plan' | 'environment' | 'environment_production_flag' | 'environment_key' | 'environment_variable' | 'webhook' | 'integration' | 'connection' | 'flow' | 'sync_command' | 'secret_key' | 'connection_credential' | 'log' | '*';
|
|
3
|
+
export type Resource = 'team' | 'team_member' | 'invite' | 'connect_ui_settings' | 'billing' | 'plan' | 'environment' | 'environment_production_flag' | 'environment_key' | 'environment_variable' | 'webhook' | 'integration' | 'connection' | 'flow' | 'sync_command' | 'secret_key' | 'connection_credential' | 'log' | 'audit_trail' | '*';
|
|
4
4
|
export type Scope = 'production' | 'non-production' | 'global';
|
|
5
5
|
export interface Permission {
|
|
6
6
|
action: Action;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type PostOrbWebhooks =
|
|
1
|
+
import type { ApiEndpoint } from '../api.js';
|
|
2
|
+
export type PostOrbWebhooks = ApiEndpoint<{
|
|
3
|
+
Audit: {
|
|
4
|
+
kind: 'no-audit';
|
|
5
|
+
reason: 'non-auditable';
|
|
6
|
+
};
|
|
3
7
|
Method: 'POST';
|
|
4
8
|
Path: '/api/v1/orb/webhooks';
|
|
5
9
|
Body: any;
|