@nangohq/types 0.70.4 → 0.70.6
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/api-keys/scopes.d.ts +1 -1
- package/dist/api.endpoints.d.ts +3 -3
- package/dist/environment/db.d.ts +3 -0
- package/dist/functions/api.d.ts +178 -91
- package/dist/functions/domain.d.ts +45 -0
- package/dist/index.d.ts +1 -0
- package/dist/integration/api.d.ts +7 -0
- package/dist/persist/api.d.ts +23 -0
- package/dist/plans/db.d.ts +5 -0
- package/dist/runner/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const API_KEY_SCOPES: readonly ["environment:*", "environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:
|
|
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:compile", "environment:functions:dryrun", "environment:functions:*", "environment:deploy", "environment:records:read", "environment:records:write", "environment:records:*", "environment:actions:execute", "environment:actions:*", "environment:proxy", "environment:variables:read", "environment:mcp"];
|
|
2
2
|
export type ApiKeyScope = (typeof API_KEY_SCOPES)[number];
|
|
3
3
|
export declare const ALL_SCOPES: string[];
|
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, GetEnvironment, Get
|
|
|
12
12
|
import type { PatchWebhook } from './environment/api/webhook.js';
|
|
13
13
|
import type { PostEnvironmentVariables } from './environment/variable/api.js';
|
|
14
14
|
import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api.js';
|
|
15
|
-
import type { GetIntegrationFunctions, GetProviderTemplates, PostRemoteFunctionCompile, PostRemoteFunctionDeploy, PostRemoteFunctionDryrun } from './functions/api.js';
|
|
15
|
+
import type { GetFunctionDryrun, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, PostFunctionCompile, PostFunctionDeployment, PostFunctionDryrun, PostFunctionDryrunResult, PostRemoteFunctionCompile, PostRemoteFunctionDeploy, PostRemoteFunctionDryrun } from './functions/api.js';
|
|
16
16
|
import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
|
|
17
17
|
import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
|
|
18
18
|
import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
|
|
@@ -28,8 +28,8 @@ import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, Pos
|
|
|
28
28
|
import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
|
|
29
29
|
import type { GetUser, PatchUser } from './user/api.js';
|
|
30
30
|
import type { PostPublicWebhook } from './webhooks/http.api.js';
|
|
31
|
-
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostRemoteFunctionCompile | PostRemoteFunctionDryrun | PostRemoteFunctionDeploy | GetPublicFunctionCode | AllPublicProxy;
|
|
32
|
-
export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | GetIntegrationFunctions | GetProviderTemplates | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | 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;
|
|
31
|
+
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | PostRemoteFunctionCompile | PostRemoteFunctionDryrun | PostRemoteFunctionDeploy | GetPublicFunctionCode | AllPublicProxy;
|
|
32
|
+
export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | GetIntegrationFunction | GetIntegrationFunctions | GetIntegrationTemplates | GetProviderTemplates | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | 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;
|
|
33
33
|
export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
|
|
34
34
|
/**
|
|
35
35
|
* Automatically narrow endpoints type with Method + Path
|
package/dist/environment/db.d.ts
CHANGED
|
@@ -85,6 +85,9 @@ export interface DBCustomerKey extends Timestamps {
|
|
|
85
85
|
iv: string;
|
|
86
86
|
tag: string;
|
|
87
87
|
hashed: string;
|
|
88
|
+
sandbox_signing_secret: string | null;
|
|
89
|
+
sandbox_signing_secret_iv: string | null;
|
|
90
|
+
sandbox_signing_secret_tag: string | null;
|
|
88
91
|
last_used_at: Date | null;
|
|
89
92
|
deleted_at: Date | null;
|
|
90
93
|
}
|
package/dist/functions/api.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { ApiError, Endpoint } from '../api.js';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type FunctionType = 'action' | 'sync' | 'on-event';
|
|
6
|
-
export type FunctionErrorCode = 'invalid_request' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'function_disabled' | 'timeout' | 'validation_error';
|
|
2
|
+
import type { DeployedNangoFunction, FunctionType, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
|
|
3
|
+
export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
|
|
4
|
+
export type FunctionErrorCode = 'invalid_request' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'dryrun_not_found' | 'function_disabled' | 'execution_environment_unavailable' | 'timeout' | 'validation_error';
|
|
7
5
|
export interface ProxyCall {
|
|
8
6
|
method: string;
|
|
9
7
|
endpoint: string;
|
|
@@ -16,114 +14,176 @@ export interface ProxyCall {
|
|
|
16
14
|
response: unknown;
|
|
17
15
|
headers: Record<string, unknown>;
|
|
18
16
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
export interface FunctionCompileBody {
|
|
18
|
+
code: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FunctionCompileSuccess {
|
|
21
|
+
bundle_size_bytes: number;
|
|
22
|
+
bundled_js: string;
|
|
23
|
+
compiled_at: string;
|
|
24
|
+
}
|
|
25
|
+
export interface FunctionDryrunBody {
|
|
26
|
+
integration_id: string;
|
|
27
|
+
function_type: RunnableFunctionType;
|
|
28
|
+
code: string;
|
|
29
|
+
connection_id: string;
|
|
30
|
+
input?: unknown;
|
|
31
|
+
metadata?: Record<string, unknown> | undefined;
|
|
32
|
+
checkpoint?: Record<string, unknown> | undefined;
|
|
33
|
+
last_sync_date?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export type FunctionDryrunStatus = 'waiting' | 'running' | 'success' | 'failed';
|
|
36
|
+
export interface FunctionDryrunCreateSuccess {
|
|
37
|
+
id: string;
|
|
38
|
+
status: Extract<FunctionDryrunStatus, 'waiting' | 'running'>;
|
|
39
|
+
created_at: string;
|
|
40
|
+
}
|
|
41
|
+
export interface FunctionDryrunResultSuccess {
|
|
42
|
+
id: string;
|
|
43
|
+
status: FunctionDryrunStatus;
|
|
44
|
+
integration_id: string;
|
|
45
|
+
function_type: RunnableFunctionType;
|
|
46
|
+
created_at: string;
|
|
47
|
+
updated_at: string;
|
|
48
|
+
started_at?: string | undefined;
|
|
49
|
+
completed_at?: string | undefined;
|
|
50
|
+
duration_ms?: number | undefined;
|
|
51
|
+
output?: string | undefined;
|
|
52
|
+
result?: unknown;
|
|
53
|
+
error?: ApiError<FunctionErrorCode>['error'] | undefined;
|
|
54
|
+
}
|
|
55
|
+
export type FunctionDryrunResultBody = {
|
|
56
|
+
status: 'success';
|
|
57
|
+
output: string;
|
|
58
|
+
duration_ms?: number | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
status: 'failed';
|
|
61
|
+
output?: string | undefined;
|
|
62
|
+
duration_ms?: number | undefined;
|
|
63
|
+
error: {
|
|
64
|
+
code?: string | undefined;
|
|
65
|
+
message: string;
|
|
66
|
+
payload?: unknown;
|
|
27
67
|
};
|
|
68
|
+
};
|
|
69
|
+
export interface FunctionDeploymentBody {
|
|
70
|
+
type: 'function';
|
|
71
|
+
integration_id: string;
|
|
72
|
+
function_name: string;
|
|
73
|
+
function_type: RunnableFunctionType;
|
|
74
|
+
code: string;
|
|
75
|
+
version?: string | undefined;
|
|
76
|
+
allow_destructive?: boolean | undefined;
|
|
77
|
+
}
|
|
78
|
+
export interface FunctionDeploySuccess {
|
|
79
|
+
integration_id: string;
|
|
80
|
+
function_name: string;
|
|
81
|
+
function_type: RunnableFunctionType;
|
|
82
|
+
deployed: boolean;
|
|
83
|
+
deployed_functions: {
|
|
84
|
+
name: string;
|
|
85
|
+
version: string;
|
|
86
|
+
}[];
|
|
87
|
+
output: string;
|
|
88
|
+
}
|
|
89
|
+
export type PostFunctionCompile = Endpoint<{
|
|
90
|
+
Method: 'POST';
|
|
91
|
+
Path: '/functions/compile';
|
|
92
|
+
Body: FunctionCompileBody;
|
|
28
93
|
Error: ApiError<FunctionErrorCode>;
|
|
29
|
-
Success:
|
|
30
|
-
integration_id: string;
|
|
31
|
-
function_name: string;
|
|
32
|
-
function_type: FunctionType;
|
|
33
|
-
bundle_size_bytes: number;
|
|
34
|
-
bundled_js: string;
|
|
35
|
-
compiled_at: string;
|
|
36
|
-
};
|
|
94
|
+
Success: FunctionCompileSuccess;
|
|
37
95
|
}>;
|
|
38
|
-
export type
|
|
96
|
+
export type PostFunctionDryrun = Endpoint<{
|
|
39
97
|
Method: 'POST';
|
|
40
|
-
Path: '/
|
|
41
|
-
Body:
|
|
42
|
-
integration_id: string;
|
|
43
|
-
function_name: string;
|
|
44
|
-
function_type: FunctionType;
|
|
45
|
-
code: string;
|
|
46
|
-
connection_id: string;
|
|
47
|
-
input?: unknown;
|
|
48
|
-
metadata?: Record<string, unknown> | undefined;
|
|
49
|
-
checkpoint?: Record<string, unknown> | undefined;
|
|
50
|
-
last_sync_date?: string | undefined;
|
|
51
|
-
};
|
|
98
|
+
Path: '/functions/dryruns';
|
|
99
|
+
Body: FunctionDryrunBody;
|
|
52
100
|
Error: ApiError<FunctionErrorCode>;
|
|
53
|
-
Success:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
101
|
+
Success: FunctionDryrunCreateSuccess;
|
|
102
|
+
}>;
|
|
103
|
+
export type GetFunctionDryrun = Endpoint<{
|
|
104
|
+
Method: 'GET';
|
|
105
|
+
Path: '/functions/dryruns/:id';
|
|
106
|
+
Params: {
|
|
107
|
+
id: string;
|
|
60
108
|
};
|
|
109
|
+
Error: ApiError<FunctionErrorCode>;
|
|
110
|
+
Success: FunctionDryrunResultSuccess;
|
|
61
111
|
}>;
|
|
62
|
-
export type
|
|
112
|
+
export type PostFunctionDryrunResult = Endpoint<{
|
|
63
113
|
Method: 'POST';
|
|
64
|
-
Path: '/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
function_name: string;
|
|
68
|
-
function_type: FunctionType;
|
|
69
|
-
code: string;
|
|
114
|
+
Path: '/functions/dryruns/:id/result';
|
|
115
|
+
Params: {
|
|
116
|
+
id: string;
|
|
70
117
|
};
|
|
118
|
+
Body: FunctionDryrunResultBody;
|
|
71
119
|
Error: ApiError<FunctionErrorCode>;
|
|
72
120
|
Success: {
|
|
73
|
-
|
|
74
|
-
function_name: string;
|
|
75
|
-
function_type: FunctionType;
|
|
76
|
-
deployed: boolean;
|
|
77
|
-
deployed_functions: {
|
|
78
|
-
name: string;
|
|
79
|
-
version: string;
|
|
80
|
-
}[];
|
|
81
|
-
output: string;
|
|
121
|
+
ok: true;
|
|
82
122
|
};
|
|
83
123
|
}>;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
124
|
+
export type PostFunctionDeployment = Endpoint<{
|
|
125
|
+
Method: 'POST';
|
|
126
|
+
Path: '/functions/deployments';
|
|
127
|
+
Body: FunctionDeploymentBody;
|
|
128
|
+
Error: ApiError<FunctionErrorCode>;
|
|
129
|
+
Success: FunctionDeploySuccess;
|
|
130
|
+
}>;
|
|
131
|
+
export interface RemoteFunctionCompileBody {
|
|
132
|
+
integration_id: string;
|
|
133
|
+
function_name: string;
|
|
134
|
+
function_type: RunnableFunctionType;
|
|
135
|
+
code: string;
|
|
88
136
|
}
|
|
89
|
-
export interface
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
json_schema: JSONSchema7 | null;
|
|
94
|
-
/** Cron expression. */
|
|
95
|
-
runs: string | null;
|
|
96
|
-
auto_start: boolean;
|
|
97
|
-
track_deletes: boolean;
|
|
137
|
+
export interface RemoteFunctionCompileSuccess extends FunctionCompileSuccess {
|
|
138
|
+
integration_id: string;
|
|
139
|
+
function_name: string;
|
|
140
|
+
function_type: RunnableFunctionType;
|
|
98
141
|
}
|
|
99
|
-
export interface
|
|
100
|
-
|
|
101
|
-
input?:
|
|
102
|
-
|
|
103
|
-
|
|
142
|
+
export interface RemoteFunctionDryrunBody extends RemoteFunctionCompileBody {
|
|
143
|
+
connection_id: string;
|
|
144
|
+
input?: unknown;
|
|
145
|
+
metadata?: Record<string, unknown> | undefined;
|
|
146
|
+
checkpoint?: Record<string, unknown> | undefined;
|
|
147
|
+
last_sync_date?: string | undefined;
|
|
104
148
|
}
|
|
105
|
-
export interface
|
|
106
|
-
|
|
107
|
-
|
|
149
|
+
export interface RemoteFunctionDryrunSuccess {
|
|
150
|
+
integration_id: string;
|
|
151
|
+
function_name: string;
|
|
152
|
+
function_type: RunnableFunctionType;
|
|
153
|
+
duration_ms: number;
|
|
154
|
+
result?: unknown;
|
|
108
155
|
}
|
|
109
|
-
export
|
|
110
|
-
|
|
111
|
-
id: number;
|
|
112
|
-
enabled: boolean;
|
|
113
|
-
/** ISO-8601 timestamp. */
|
|
114
|
-
last_deployed: string;
|
|
115
|
-
source: FunctionSource;
|
|
156
|
+
export interface RemoteFunctionDeployBody extends RemoteFunctionCompileBody {
|
|
157
|
+
allow_destructive?: boolean | undefined;
|
|
116
158
|
}
|
|
117
|
-
export type
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
159
|
+
export type PostRemoteFunctionCompile = Endpoint<{
|
|
160
|
+
Method: 'POST';
|
|
161
|
+
Path: '/remote-function/compile';
|
|
162
|
+
Body: RemoteFunctionCompileBody;
|
|
163
|
+
Error: ApiError<FunctionErrorCode>;
|
|
164
|
+
Success: RemoteFunctionCompileSuccess;
|
|
165
|
+
}>;
|
|
166
|
+
export type PostRemoteFunctionDryrun = Endpoint<{
|
|
167
|
+
Method: 'POST';
|
|
168
|
+
Path: '/remote-function/dryrun';
|
|
169
|
+
Body: RemoteFunctionDryrunBody;
|
|
170
|
+
Error: ApiError<FunctionErrorCode>;
|
|
171
|
+
Success: RemoteFunctionDryrunSuccess;
|
|
172
|
+
}>;
|
|
173
|
+
export type PostRemoteFunctionDeploy = Endpoint<{
|
|
174
|
+
Method: 'POST';
|
|
175
|
+
Path: '/remote-function/deploy';
|
|
176
|
+
Body: RemoteFunctionDeployBody;
|
|
177
|
+
Error: ApiError<FunctionErrorCode>;
|
|
178
|
+
Success: FunctionDeploySuccess;
|
|
179
|
+
}>;
|
|
121
180
|
export type GetIntegrationFunctions = Endpoint<{
|
|
122
181
|
Method: 'GET';
|
|
123
182
|
Path: '/api/v1/integrations/:providerConfigKey/functions';
|
|
124
183
|
Querystring: {
|
|
125
184
|
env: string;
|
|
126
185
|
type?: FunctionType;
|
|
186
|
+
search?: string;
|
|
127
187
|
page?: number;
|
|
128
188
|
limit?: number;
|
|
129
189
|
};
|
|
@@ -131,7 +191,7 @@ export type GetIntegrationFunctions = Endpoint<{
|
|
|
131
191
|
providerConfigKey: string;
|
|
132
192
|
};
|
|
133
193
|
Success: {
|
|
134
|
-
data:
|
|
194
|
+
data: DeployedNangoFunction[];
|
|
135
195
|
pagination: {
|
|
136
196
|
total: number;
|
|
137
197
|
page: number;
|
|
@@ -139,6 +199,21 @@ export type GetIntegrationFunctions = Endpoint<{
|
|
|
139
199
|
};
|
|
140
200
|
};
|
|
141
201
|
}>;
|
|
202
|
+
export type GetIntegrationFunction = Endpoint<{
|
|
203
|
+
Method: 'GET';
|
|
204
|
+
Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
|
|
205
|
+
Querystring: {
|
|
206
|
+
env: string;
|
|
207
|
+
type?: FunctionType;
|
|
208
|
+
};
|
|
209
|
+
Params: {
|
|
210
|
+
providerConfigKey: string;
|
|
211
|
+
functionName: string;
|
|
212
|
+
};
|
|
213
|
+
Success: {
|
|
214
|
+
data: DeployedNangoFunction;
|
|
215
|
+
};
|
|
216
|
+
}>;
|
|
142
217
|
export type GetProviderTemplates = Endpoint<{
|
|
143
218
|
Method: 'GET';
|
|
144
219
|
Path: '/api/v1/providers/:providerConfigKey/templates';
|
|
@@ -152,4 +227,16 @@ export type GetProviderTemplates = Endpoint<{
|
|
|
152
227
|
data: (NangoSyncFunction | NangoActionFunction)[];
|
|
153
228
|
};
|
|
154
229
|
}>;
|
|
155
|
-
export {
|
|
230
|
+
export type GetIntegrationTemplates = Endpoint<{
|
|
231
|
+
Method: 'GET';
|
|
232
|
+
Path: '/api/v1/integrations/:providerConfigKey/templates';
|
|
233
|
+
Querystring: {
|
|
234
|
+
env: string;
|
|
235
|
+
};
|
|
236
|
+
Params: {
|
|
237
|
+
providerConfigKey: string;
|
|
238
|
+
};
|
|
239
|
+
Success: {
|
|
240
|
+
data: NangoFunctionTemplate[];
|
|
241
|
+
};
|
|
242
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { OnEventType } from '../scripts/on-events/api.js';
|
|
2
|
+
import type { FunctionSource } from '../syncConfigs/db.js';
|
|
3
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
4
|
+
export type FunctionType = 'action' | 'sync' | 'on-event';
|
|
5
|
+
interface NangoFunctionBase {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
scopes?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface NangoSyncFunction extends NangoFunctionBase {
|
|
11
|
+
type: 'sync';
|
|
12
|
+
input?: string;
|
|
13
|
+
returns: string[];
|
|
14
|
+
json_schema: JSONSchema7 | null;
|
|
15
|
+
/** Schedule expression such as `every day`. */
|
|
16
|
+
runs: string | null;
|
|
17
|
+
auto_start: boolean;
|
|
18
|
+
track_deletes: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface NangoActionFunction extends NangoFunctionBase {
|
|
21
|
+
type: 'action';
|
|
22
|
+
input?: string;
|
|
23
|
+
returns: string[];
|
|
24
|
+
json_schema: JSONSchema7 | null;
|
|
25
|
+
}
|
|
26
|
+
export interface NangoOnEventFunction extends NangoFunctionBase {
|
|
27
|
+
type: 'on-event';
|
|
28
|
+
event: OnEventType;
|
|
29
|
+
}
|
|
30
|
+
export type NangoFunction = NangoSyncFunction | NangoActionFunction | NangoOnEventFunction;
|
|
31
|
+
export interface DeployedMeta {
|
|
32
|
+
id: number;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
/** ISO-8601 timestamp. */
|
|
35
|
+
last_deployed: string;
|
|
36
|
+
source: FunctionSource;
|
|
37
|
+
}
|
|
38
|
+
export type DeployedNangoSyncFunction = NangoSyncFunction & DeployedMeta;
|
|
39
|
+
export type DeployedNangoActionFunction = NangoActionFunction & DeployedMeta;
|
|
40
|
+
export type DeployedNangoOnEventFunction = NangoOnEventFunction & DeployedMeta;
|
|
41
|
+
export type DeployedNangoFunction = DeployedNangoSyncFunction | DeployedNangoActionFunction | DeployedNangoOnEventFunction;
|
|
42
|
+
export type NangoFunctionTemplate = (NangoSyncFunction | NangoActionFunction) & {
|
|
43
|
+
deployed?: DeployedMeta;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export type * from './checkpoint/types.js';
|
|
|
88
88
|
export type * from './checkpoint/db.js';
|
|
89
89
|
export type * from './mcp/api.js';
|
|
90
90
|
export type * from './functions/api.js';
|
|
91
|
+
export type * from './functions/domain.js';
|
|
91
92
|
export type * from './lambda/index.js';
|
|
92
93
|
export type * from './authz/types.js';
|
|
93
94
|
export type * from './pubsub/events.js';
|
|
@@ -21,6 +21,13 @@ export interface ApiPublicIntegrationInclude {
|
|
|
21
21
|
app_id: string | null;
|
|
22
22
|
private_key: string | null;
|
|
23
23
|
app_link: string | null;
|
|
24
|
+
} | {
|
|
25
|
+
type: AuthModes['Custom'];
|
|
26
|
+
client_id: string | null;
|
|
27
|
+
client_secret: string | null;
|
|
28
|
+
app_id: string | null;
|
|
29
|
+
app_link: string | null;
|
|
30
|
+
private_key: string | null;
|
|
24
31
|
} | null;
|
|
25
32
|
}
|
|
26
33
|
export type GetPublicListIntegrations = Endpoint<{
|
package/dist/persist/api.d.ts
CHANGED
|
@@ -16,6 +16,29 @@ export type PostLog = Endpoint<{
|
|
|
16
16
|
Error: ApiError<'post_log_failed'>;
|
|
17
17
|
Success: never;
|
|
18
18
|
}>;
|
|
19
|
+
type WithTags<T> = T & {
|
|
20
|
+
integrationId: string;
|
|
21
|
+
connectionId: string;
|
|
22
|
+
syncId?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type RunnerDataTransferTelemetry = WithTags<{
|
|
25
|
+
type: 'data_transfer';
|
|
26
|
+
bytesSent: number;
|
|
27
|
+
bytesReceived: number;
|
|
28
|
+
}>;
|
|
29
|
+
export type RunnerTelemetry = RunnerDataTransferTelemetry;
|
|
30
|
+
export type PostRunnerTelemetry = Endpoint<{
|
|
31
|
+
Method: 'POST';
|
|
32
|
+
Path: '/environment/:environmentId/runner/telemetry';
|
|
33
|
+
Params: {
|
|
34
|
+
environmentId: number;
|
|
35
|
+
};
|
|
36
|
+
Body: {
|
|
37
|
+
events: RunnerTelemetry[];
|
|
38
|
+
};
|
|
39
|
+
Error: ApiError<'post_runner_telemetry_failed'>;
|
|
40
|
+
Success: never;
|
|
41
|
+
}>;
|
|
19
42
|
export interface PostRecordsSuccess {
|
|
20
43
|
nextMerging: MergingStrategy;
|
|
21
44
|
}
|
package/dist/plans/db.d.ts
CHANGED
|
@@ -80,6 +80,11 @@ export interface DBPlan extends Timestamps {
|
|
|
80
80
|
* @default false
|
|
81
81
|
*/
|
|
82
82
|
has_otel: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Enable runner telemetry export to persist
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
export_runner_telemetry: boolean;
|
|
83
88
|
/**
|
|
84
89
|
* Change the applied rate limit for the public API
|
|
85
90
|
* @default "m"
|
package/dist/runner/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nangohq/types",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.6",
|
|
4
4
|
"description": "Types used in Nango applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/utils"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"axios": "1.
|
|
15
|
+
"axios": "1.16.1",
|
|
16
16
|
"json-schema": "0.4.0",
|
|
17
17
|
"type-fest": "4.41.0"
|
|
18
18
|
},
|