@nangohq/types 0.70.5 → 0.70.7

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.
@@ -1,3 +1,3 @@
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:deploy", "environment:dryrun", "environment:records:read", "environment:records:write", "environment:records:*", "environment:actions:execute", "environment:actions:*", "environment:proxy", "environment:variables:read", "environment:mcp"];
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: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[];
@@ -2,7 +2,7 @@ import type { GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, GetMan
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 { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
5
+ import type { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicAwsSigV4Authorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
6
6
  import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api.js';
7
7
  import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
8
8
  import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PatchPublicConnection, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
@@ -12,13 +12,13 @@ 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 { GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, PostRemoteFunctionCompile, PostRemoteFunctionDeploy, PostRemoteFunctionDryrun } from './functions/api.js';
15
+ import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunctionDeployment, GetFunctionDryrun, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult } 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';
19
19
  import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api.js';
20
20
  import type { GetMeta } from './meta/api.js';
21
- import type { PostPlanChange, PostPlanExtendTrial, PutBillingInvoicingDetails } from './plans/http.api.js';
21
+ import type { GetBillingUsage, GetBillingUsageTopDimensionValues, PostPlanChange, PostPlanExtendTrial, PutBillingInvoicingDetails } from './plans/http.api.js';
22
22
  import type { GetProvider, GetProviders, GetPublicProvider, GetPublicProviders } from './providers/api.js';
23
23
  import type { AllPublicProxy } from './proxy/http.api.js';
24
24
  import type { GetPublicRecords, PatchPublicPruneRecords } from './record/api.js';
@@ -26,10 +26,10 @@ import type { GetPublicScriptsConfig } from './scripts/http.api.js';
26
26
  import type { GetSharedCredentialsProvider, GetSharedCredentialsProviders, PatchSharedCredentialsProvider, PostSharedCredentialsProvider } from './sharedCredentials/api.js';
27
27
  import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync/api.js';
28
28
  import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
29
- import type { GetUser, PatchUser } from './user/api.js';
29
+ import type { GetUser, PatchUser, PutUserPassword } 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 | 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;
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 | PostPublicAwsSigV4Authorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | GetFunctionDeployment | PostFunctionDeploymentResult | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | AllPublicProxy;
32
+ 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 | DeleteIntegrationFunction | 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
@@ -17,6 +17,7 @@ export interface AuthModes {
17
17
  MCP_OAUTH2: 'MCP_OAUTH2';
18
18
  MCP_OAUTH2_GENERIC: 'MCP_OAUTH2_GENERIC';
19
19
  InstallPlugin: 'INSTALL_PLUGIN';
20
+ AwsSigV4: 'AWS_SIGV4';
20
21
  }
21
22
  export type AuthModeType = AuthModes[keyof AuthModes];
22
23
  export type AuthOperationType = 'creation' | 'override' | 'refresh' | 'unknown';
@@ -146,6 +147,17 @@ export interface InstallPluginCredentials {
146
147
  type: AuthModes['Basic'];
147
148
  [key: string]: any;
148
149
  }
150
+ export interface AwsSigV4Credentials extends CredentialsCommon {
151
+ type: AuthModes['AwsSigV4'];
152
+ role_arn: string;
153
+ region: string;
154
+ service: string;
155
+ access_key_id: string;
156
+ secret_access_key: string;
157
+ session_token: string;
158
+ expires_at?: Date | undefined;
159
+ external_id?: string | undefined;
160
+ }
149
161
  export interface CombinedOauth2AppCredentials extends CredentialsCommon {
150
162
  type: AuthModes['Custom'];
151
163
  app: AppCredentials;
@@ -157,5 +169,5 @@ export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'typ
157
169
  expires_in?: number;
158
170
  }
159
171
  export type TestableCredentials = ApiKeyCredentials | BasicApiCredentials | TbaCredentials | JwtCredentials | SignatureCredentials;
160
- export type RefreshableCredentials = OAuth2Credentials | AppCredentials | AppStoreCredentials | OAuth2ClientCredentials | JwtCredentials | TwoStepCredentials | BillCredentials | SignatureCredentials;
161
- export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | JwtCredentials | BillCredentials | TwoStepCredentials | CombinedOauth2AppCredentials | SignatureCredentials | InstallPluginCredentials;
172
+ export type RefreshableCredentials = OAuth2Credentials | AppCredentials | AppStoreCredentials | OAuth2ClientCredentials | JwtCredentials | TwoStepCredentials | BillCredentials | SignatureCredentials | AwsSigV4Credentials;
173
+ export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | JwtCredentials | BillCredentials | TwoStepCredentials | CombinedOauth2AppCredentials | SignatureCredentials | InstallPluginCredentials | AwsSigV4Credentials;
@@ -156,6 +156,21 @@ export type PostPublicSignatureAuthorization = Endpoint<{
156
156
  Error: AuthErrors;
157
157
  Success: ConnectionResponseSuccess;
158
158
  }>;
159
+ 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 = Endpoint<{
161
+ Method: 'POST';
162
+ Body: {
163
+ role_arn: string;
164
+ region?: string | undefined;
165
+ };
166
+ Querystring: ConnectionQueryString;
167
+ Params: {
168
+ providerConfigKey: string;
169
+ };
170
+ Path: '/auth/aws-sigv4/:providerConfigKey';
171
+ Error: AwsSigV4AuthErrors;
172
+ Success: ConnectionResponseSuccess;
173
+ }>;
159
174
  export type PostPublicOauthOutboundAuthorization = Endpoint<{
160
175
  Method: 'POST';
161
176
  Body: {
@@ -70,6 +70,18 @@ export interface BillingSubscription {
70
70
  pendingChangeId?: string | undefined;
71
71
  planExternalId: string;
72
72
  }
73
+ export type CounterUsageMetric = Exclude<UsageMetric, 'records' | 'connections'>;
74
+ export type AvgUsageMetric = Extract<UsageMetric, 'records' | 'connections'>;
75
+ export interface BreakdownDimensions {
76
+ proxy: 'environment_id' | 'integration_id' | 'connection_id' | 'success';
77
+ function_executions: 'environment_id' | 'integration_id' | 'connection_id' | 'function_name' | 'function_type' | 'success';
78
+ function_logs: 'environment_id' | 'integration_id' | 'connection_id' | 'function_name' | 'function_type' | 'success';
79
+ function_compute_gbms: 'environment_id' | 'integration_id' | 'connection_id' | 'function_name' | 'function_type' | 'success';
80
+ webhook_forwards: 'environment_id' | 'integration_id' | 'connection_id' | 'success';
81
+ records: 'environment_id' | 'integration_id' | 'connection_id' | 'model';
82
+ connections: 'environment_id' | 'integration_id';
83
+ }
84
+ export type DimensionFor<M extends UsageMetric> = 'none' | BreakdownDimensions[M];
73
85
  export interface GetBillingUsageOpts {
74
86
  timeframe?: {
75
87
  start: Date;
@@ -80,6 +92,44 @@ export interface GetBillingUsageOpts {
80
92
  id: string;
81
93
  group_by?: 'environmentId' | 'environmentName' | 'integrationId' | 'type' | 'functionName' | 'model';
82
94
  };
95
+ /**
96
+ * Per-request override of the dashboard backend source. Honoured only
97
+ * when `FLAG_ALLOW_OVERRIDE_GETUSAGE_SERVICE` is enabled (dev gate); ignored
98
+ * everywhere else, so the default stays Orb. Only used by
99
+ * `UsageTracker.getBillingUsage`; the Orb client itself ignores it.
100
+ */
101
+ source?: 'clickhouse' | 'orb';
102
+ /**
103
+ * Per-metric dimension breakdown spec. Honoured only on the CH path
104
+ * (records / connections via `getDailySumAndBatches`, counters via
105
+ * `getDailyCounter`); the Orb client ignores it. Each metric's
106
+ * `BillingUsageMetric` gains a `breakdown` array of up to `top + 1`
107
+ * series (top-N dimension values + a single 'rest' aggregating the
108
+ * long tail). Top defaults to 10 and is clamped server-side to
109
+ * the CH cap.
110
+ */
111
+ breakdown?: {
112
+ [M in UsageMetric]?: BreakdownDimensions[M] | undefined;
113
+ };
114
+ top?: number;
115
+ /**
116
+ * Subset of metrics to populate in the response. When set, only those
117
+ * metrics are fanned out (CH path) and returned. Omitted → all 7.
118
+ * Ignored on the Orb path.
119
+ */
120
+ metrics?: UsageMetric[];
121
+ /**
122
+ * Per-metric row-level filter: scopes that metric's response to rows
123
+ * where the given dimension equals the given value. Mutually exclusive
124
+ * with `breakdown[<metric>]` on the same metric — controllers reject
125
+ * the combination. CH path only; the Orb client ignores it.
126
+ */
127
+ filter?: {
128
+ [M in UsageMetric]?: {
129
+ dimension: BreakdownDimensions[M];
130
+ value: string;
131
+ } | undefined;
132
+ };
83
133
  }
84
134
  export interface BillingUsageMetric {
85
135
  externalId: string;
@@ -87,6 +137,15 @@ export interface BillingUsageMetric {
87
137
  key: string;
88
138
  value: string;
89
139
  };
140
+ /**
141
+ * The top-N + 'rest' breakdown collapses every dim value outside the top
142
+ * into a single rollup bucket. Marked with `isRest: true` so the dashboard
143
+ * can distinguish it from a real dim value that happens to literally be
144
+ * the string 'rest' (e.g. a `connection_id` or `model` named 'rest').
145
+ * `group.value` is set to the display string 'rest' as a default; the
146
+ * flag is the authoritative signal.
147
+ */
148
+ isRest?: true;
90
149
  total: number;
91
150
  usage: {
92
151
  timeframeStart: Date;
@@ -94,6 +153,19 @@ export interface BillingUsageMetric {
94
153
  quantity: number;
95
154
  }[];
96
155
  view_mode: 'cumulative' | 'periodic';
156
+ /**
157
+ * Populated only when the request included a `breakdown` spec for this
158
+ * metric AND the CH path served the request. Each entry is a per-
159
+ * dimension-value series (carrying its own `group: {key, value}`), with
160
+ * one 'rest' entry aggregating the long tail.
161
+ *
162
+ * Mutually exclusive with the top-level `usage`/`total`: when breakdown
163
+ * is requested the top-level is empty (`usage: []`, `total: 0`) and only
164
+ * `breakdown` carries data — callers asking for a breakdown opt into the
165
+ * per-dim view. When breakdown is NOT requested, the top-level is the
166
+ * no-dim global and this field is absent.
167
+ */
168
+ breakdown?: BillingUsageMetric[];
97
169
  }
98
170
  export type BillingUsageMetrics = Partial<Record<UsageMetric, BillingUsageMetric | undefined>>;
99
171
  export interface ApiBillingUsageMetric extends BillingUsageMetric {
@@ -1,6 +1,7 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
2
  import type { DeployedNangoFunction, FunctionType, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
3
- export type FunctionErrorCode = 'invalid_request' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'function_disabled' | 'timeout' | 'validation_error';
3
+ export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
4
+ export type FunctionErrorCode = 'invalid_request' | 'server_error' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'dryrun_not_found' | 'deployment_not_found' | 'function_disabled' | 'execution_environment_unavailable' | 'timeout' | 'validation_error';
4
5
  export interface ProxyCall {
5
6
  method: string;
6
7
  endpoint: string;
@@ -13,92 +14,205 @@ export interface ProxyCall {
13
14
  response: unknown;
14
15
  headers: Record<string, unknown>;
15
16
  }
16
- export type PostRemoteFunctionCompile = Endpoint<{
17
- Method: 'POST';
18
- Path: '/remote-function/compile';
19
- Body: {
20
- integration_id: string;
21
- function_name: string;
22
- function_type: FunctionType;
23
- code: string;
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 FunctionAsyncJobStatus = 'waiting' | 'running' | 'success' | 'failed';
36
+ export type FunctionDryrunStatus = FunctionAsyncJobStatus;
37
+ export type FunctionDeploymentStatus = FunctionAsyncJobStatus;
38
+ export interface FunctionDryrunCreateSuccess {
39
+ id: string;
40
+ status: Extract<FunctionDryrunStatus, 'waiting' | 'running'>;
41
+ created_at: string;
42
+ }
43
+ export interface FunctionDryrunResultSuccess {
44
+ id: string;
45
+ status: FunctionDryrunStatus;
46
+ integration_id: string;
47
+ function_type: RunnableFunctionType;
48
+ created_at: string;
49
+ updated_at: string;
50
+ started_at?: string | undefined;
51
+ completed_at?: string | undefined;
52
+ duration_ms?: number | undefined;
53
+ output?: string | undefined;
54
+ result?: unknown;
55
+ error?: ApiError<FunctionErrorCode>['error'] | undefined;
56
+ }
57
+ export type FunctionDryrunResultBody = {
58
+ status: 'success';
59
+ output: string;
60
+ duration_ms?: number | undefined;
61
+ } | {
62
+ status: 'failed';
63
+ output?: string | undefined;
64
+ duration_ms?: number | undefined;
65
+ error: {
66
+ code?: string | undefined;
67
+ message: string;
68
+ payload?: unknown;
69
+ };
70
+ };
71
+ export interface FunctionDeploymentBody {
72
+ type: 'function';
73
+ integration_id: string;
74
+ function_name: string;
75
+ function_type: RunnableFunctionType;
76
+ code: string;
77
+ version?: string | undefined;
78
+ allow_destructive?: boolean | undefined;
79
+ }
80
+ export interface FunctionDeploymentCreateSuccess {
81
+ id: string;
82
+ status: Extract<FunctionDeploymentStatus, 'waiting' | 'running'>;
83
+ created_at: string;
84
+ }
85
+ export interface FunctionDeploymentResultSuccess {
86
+ id: string;
87
+ status: FunctionDeploymentStatus;
88
+ integration_id: string;
89
+ function_name: string;
90
+ function_type: RunnableFunctionType;
91
+ created_at: string;
92
+ updated_at: string;
93
+ started_at?: string | undefined;
94
+ completed_at?: string | undefined;
95
+ duration_ms?: number | undefined;
96
+ deployed?: boolean | undefined;
97
+ deployed_functions?: {
98
+ name: string;
99
+ version: string;
100
+ }[] | undefined;
101
+ output?: string | undefined;
102
+ error?: ApiError<FunctionErrorCode>['error'] | undefined;
103
+ }
104
+ export type FunctionDeploymentResultBody = {
105
+ status: 'success';
106
+ output: string;
107
+ duration_ms?: number | undefined;
108
+ } | {
109
+ status: 'failed';
110
+ output?: string | undefined;
111
+ duration_ms?: number | undefined;
112
+ error: {
113
+ code?: string | undefined;
114
+ message: string;
115
+ payload?: unknown;
24
116
  };
117
+ };
118
+ export type PostFunctionCompile = Endpoint<{
119
+ Method: 'POST';
120
+ Path: '/functions/compile';
121
+ Body: FunctionCompileBody;
25
122
  Error: ApiError<FunctionErrorCode>;
26
- Success: {
27
- integration_id: string;
28
- function_name: string;
29
- function_type: FunctionType;
30
- bundle_size_bytes: number;
31
- bundled_js: string;
32
- compiled_at: string;
123
+ Success: FunctionCompileSuccess;
124
+ }>;
125
+ export type PostFunctionDryrun = Endpoint<{
126
+ Method: 'POST';
127
+ Path: '/functions/dryruns';
128
+ Body: FunctionDryrunBody;
129
+ Error: ApiError<FunctionErrorCode>;
130
+ Success: FunctionDryrunCreateSuccess;
131
+ }>;
132
+ export type GetFunctionDryrun = Endpoint<{
133
+ Method: 'GET';
134
+ Path: '/functions/dryruns/:id';
135
+ Params: {
136
+ id: string;
33
137
  };
138
+ Error: ApiError<FunctionErrorCode>;
139
+ Success: FunctionDryrunResultSuccess;
34
140
  }>;
35
- export type PostRemoteFunctionDryrun = Endpoint<{
141
+ export type PostFunctionDryrunResult = Endpoint<{
36
142
  Method: 'POST';
37
- Path: '/remote-function/dryrun';
38
- Body: {
39
- integration_id: string;
40
- function_name: string;
41
- function_type: FunctionType;
42
- code: string;
43
- connection_id: string;
44
- input?: unknown;
45
- metadata?: Record<string, unknown> | undefined;
46
- checkpoint?: Record<string, unknown> | undefined;
47
- last_sync_date?: string | undefined;
143
+ Path: '/functions/dryruns/:id/result';
144
+ Params: {
145
+ id: string;
48
146
  };
147
+ Body: FunctionDryrunResultBody;
49
148
  Error: ApiError<FunctionErrorCode>;
50
149
  Success: {
51
- integration_id: string;
52
- function_name: string;
53
- function_type: FunctionType;
54
- execution_timeout_at: string;
55
- duration_ms: number;
56
- result?: unknown;
150
+ ok: true;
57
151
  };
58
152
  }>;
59
- export type PostRemoteFunctionDeploy = Endpoint<{
153
+ export type PostFunctionDeployment = Endpoint<{
60
154
  Method: 'POST';
61
- Path: '/remote-function/deploy';
62
- Body: {
63
- integration_id: string;
64
- function_name: string;
65
- function_type: FunctionType;
66
- code: string;
155
+ Path: '/functions/deployments';
156
+ Body: FunctionDeploymentBody;
157
+ Error: ApiError<FunctionErrorCode>;
158
+ Success: FunctionDeploymentCreateSuccess;
159
+ }>;
160
+ export type GetFunctionDeployment = Endpoint<{
161
+ Method: 'GET';
162
+ Path: '/functions/deployments/:id';
163
+ Params: {
164
+ id: string;
67
165
  };
68
166
  Error: ApiError<FunctionErrorCode>;
167
+ Success: FunctionDeploymentResultSuccess;
168
+ }>;
169
+ export type PostFunctionDeploymentResult = Endpoint<{
170
+ Method: 'POST';
171
+ Path: '/functions/deployments/:id/result';
172
+ Params: {
173
+ id: string;
174
+ };
175
+ Body: FunctionDeploymentResultBody;
176
+ Error: ApiError<FunctionErrorCode>;
69
177
  Success: {
70
- integration_id: string;
71
- function_name: string;
72
- function_type: FunctionType;
73
- deployed: boolean;
74
- deployed_functions: {
75
- name: string;
76
- version: string;
77
- }[];
78
- output: string;
178
+ ok: true;
79
179
  };
80
180
  }>;
181
+ export interface FunctionListFilters {
182
+ type?: FunctionType;
183
+ search?: string;
184
+ page?: number;
185
+ limit?: number;
186
+ }
187
+ export interface FunctionListSuccess {
188
+ data: DeployedNangoFunction[];
189
+ pagination: {
190
+ total: number;
191
+ page: number;
192
+ limit: number;
193
+ };
194
+ }
195
+ export interface DeployedFunctionSuccess {
196
+ data: DeployedNangoFunction;
197
+ }
198
+ export interface FunctionDeletionSuccess {
199
+ data: {
200
+ success: boolean;
201
+ };
202
+ }
203
+ export interface ProviderTemplatesSuccess {
204
+ data: (NangoSyncFunction | NangoActionFunction)[];
205
+ }
81
206
  export type GetIntegrationFunctions = Endpoint<{
82
207
  Method: 'GET';
83
208
  Path: '/api/v1/integrations/:providerConfigKey/functions';
84
209
  Querystring: {
85
210
  env: string;
86
- type?: FunctionType;
87
- search?: string;
88
- page?: number;
89
- limit?: number;
90
- };
211
+ } & FunctionListFilters;
91
212
  Params: {
92
213
  providerConfigKey: string;
93
214
  };
94
- Success: {
95
- data: DeployedNangoFunction[];
96
- pagination: {
97
- total: number;
98
- page: number;
99
- limit: number;
100
- };
101
- };
215
+ Success: FunctionListSuccess;
102
216
  }>;
103
217
  export type GetIntegrationFunction = Endpoint<{
104
218
  Method: 'GET';
@@ -111,9 +225,22 @@ export type GetIntegrationFunction = Endpoint<{
111
225
  providerConfigKey: string;
112
226
  functionName: string;
113
227
  };
114
- Success: {
115
- data: DeployedNangoFunction;
228
+ Success: DeployedFunctionSuccess;
229
+ }>;
230
+ export type DeleteIntegrationFunction = Endpoint<{
231
+ Method: 'DELETE';
232
+ Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
233
+ /** TODO: support deleting on-event functions */
234
+ Querystring: {
235
+ env: string;
236
+ type: RunnableFunctionType;
237
+ };
238
+ Params: {
239
+ providerConfigKey: string;
240
+ functionName: string;
116
241
  };
242
+ Error: ApiError<'function_managed_by_deploy'>;
243
+ Success: FunctionDeletionSuccess;
117
244
  }>;
118
245
  export type GetProviderTemplates = Endpoint<{
119
246
  Method: 'GET';
@@ -124,9 +251,50 @@ export type GetProviderTemplates = Endpoint<{
124
251
  Params: {
125
252
  providerConfigKey: string;
126
253
  };
127
- Success: {
128
- data: (NangoSyncFunction | NangoActionFunction)[];
254
+ Success: ProviderTemplatesSuccess;
255
+ }>;
256
+ export type GetPublicIntegrationFunctions = Endpoint<{
257
+ Method: 'GET';
258
+ Path: '/integrations/:uniqueKey/functions';
259
+ Querystring: FunctionListFilters;
260
+ Params: {
261
+ uniqueKey: string;
262
+ };
263
+ Success: FunctionListSuccess;
264
+ }>;
265
+ export type GetPublicIntegrationFunction = Endpoint<{
266
+ Method: 'GET';
267
+ Path: '/integrations/:uniqueKey/functions/:name';
268
+ Querystring: {
269
+ type?: FunctionType;
270
+ };
271
+ Params: {
272
+ uniqueKey: string;
273
+ name: string;
274
+ };
275
+ Success: DeployedFunctionSuccess;
276
+ }>;
277
+ export type DeletePublicIntegrationFunction = Endpoint<{
278
+ Method: 'DELETE';
279
+ Path: '/integrations/:uniqueKey/functions/:name';
280
+ /** TODO: support deleting on-event functions */
281
+ Querystring: {
282
+ type: RunnableFunctionType;
283
+ };
284
+ Params: {
285
+ uniqueKey: string;
286
+ name: string;
287
+ };
288
+ Error: ApiError<'function_managed_by_deploy'>;
289
+ Success: FunctionDeletionSuccess;
290
+ }>;
291
+ export type GetPublicProviderTemplates = Endpoint<{
292
+ Method: 'GET';
293
+ Path: '/providers/:provider/templates';
294
+ Params: {
295
+ provider: string;
129
296
  };
297
+ Success: ProviderTemplatesSuccess;
130
298
  }>;
131
299
  export type GetIntegrationTemplates = Endpoint<{
132
300
  Method: 'GET';
@@ -10,6 +10,7 @@ export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' |
10
10
  } & ApiPublicIntegrationInclude;
11
11
  export interface ApiPublicIntegrationInclude {
12
12
  webhook_url?: string | null;
13
+ credentials_label?: Record<string, string> | undefined;
13
14
  credentials?: {
14
15
  type: AuthModes['OAuth2'] | AuthModes['OAuth1'] | AuthModes['TBA'];
15
16
  client_id: string | null;
@@ -49,6 +50,7 @@ export type PostPublicIntegration = Endpoint<{
49
50
  display_name?: string | undefined;
50
51
  credentials?: ApiPublicIntegrationCredentials | undefined;
51
52
  forward_webhooks?: boolean | undefined;
53
+ integration_config?: Record<string, string> | undefined;
52
54
  };
53
55
  Success: {
54
56
  data: ApiPublicIntegration;
@@ -91,6 +93,8 @@ export type PatchPublicIntegration = Endpoint<{
91
93
  display_name?: string | undefined;
92
94
  credentials?: ApiPublicIntegrationCredentials | undefined;
93
95
  forward_webhooks?: boolean | undefined;
96
+ integration_config?: Record<string, string> | undefined;
97
+ custom?: Record<string, string> | undefined;
94
98
  };
95
99
  Success: {
96
100
  data: ApiPublicIntegration;
@@ -208,6 +212,7 @@ export type PostIntegration = Endpoint<{
208
212
  displayName?: string | undefined;
209
213
  forward_webhooks?: boolean | undefined;
210
214
  auth?: IntegrationAuthBody | undefined;
215
+ integrationConfig?: Record<string, string> | undefined;
211
216
  };
212
217
  Success: {
213
218
  data: ApiIntegration;
@@ -248,6 +253,7 @@ export type PatchIntegration = Endpoint<{
248
253
  webhookSecret?: string | undefined;
249
254
  displayName?: string | undefined;
250
255
  forward_webhooks?: boolean | undefined;
256
+ integrationConfig?: Record<string, string> | undefined;
251
257
  } | IntegrationAuthBody;
252
258
  Success: {
253
259
  data: {
@@ -14,6 +14,7 @@ export type GetMeta = Endpoint<{
14
14
  baseUrl: string;
15
15
  debugMode: boolean;
16
16
  gettingStartedClosed: boolean;
17
+ billingUsageSource: 'clickhouse' | 'orb';
17
18
  };
18
19
  };
19
20
  }>;
@@ -16,6 +16,30 @@ 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
+ callsite: 'proxy' | 'uncontrolled_fetch' | 'persist_records' | 'persist_logs';
27
+ bytesSent: number;
28
+ bytesReceived: number;
29
+ }>;
30
+ export type RunnerTelemetry = RunnerDataTransferTelemetry;
31
+ export type PostRunnerTelemetry = Endpoint<{
32
+ Method: 'POST';
33
+ Path: '/environment/:environmentId/runner/telemetry';
34
+ Params: {
35
+ environmentId: number;
36
+ };
37
+ Body: {
38
+ events: RunnerTelemetry[];
39
+ };
40
+ Error: ApiError<'post_runner_telemetry_failed'>;
41
+ Success: never;
42
+ }>;
19
43
  export interface PostRecordsSuccess {
20
44
  nextMerging: MergingStrategy;
21
45
  }
@@ -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"
@@ -121,11 +126,6 @@ export interface DBPlan extends Timestamps {
121
126
  * @default false
122
127
  */
123
128
  can_disable_connect_ui_watermark: boolean;
124
- /**
125
- * Enable or disable remote function compile, dry-run, and deploy endpoints
126
- * @default false
127
- */
128
- remote_functions: boolean;
129
129
  /**
130
130
  * Sync Function Runtime
131
131
  * @default "runner"
@@ -156,6 +156,11 @@ export interface DBPlan extends Timestamps {
156
156
  * @default true
157
157
  */
158
158
  has_records_autopruning: boolean;
159
+ /**
160
+ * Records store key for this account
161
+ * @default 'default'
162
+ */
163
+ records_store: 'default' | 'records2';
159
164
  /**
160
165
  * Limit the number of variants per sync
161
166
  * @default 100
@@ -1,8 +1,8 @@
1
- import type { ApiBillingUsageMetrics, BillingCustomer, BillingInvoicingDetails } from '../billing/types.js';
2
- import type { MetricUsageSummary, UsageMetric } from '../usage/index.js';
3
- import type { ReplaceInObject } from '../utils.js';
4
1
  import type { DBPlan } from './db.js';
5
2
  import type { Endpoint } from '../api.js';
3
+ import type { ApiBillingUsageMetrics, BillingCustomer, BillingInvoicingDetails, BreakdownDimensions } from '../billing/types.js';
4
+ import type { MetricUsageSummary, UsageMetric } from '../usage/index.js';
5
+ import type { ReplaceInObject } from '../utils.js';
6
6
  export type ApiPlan = ReplaceInObject<DBPlan, Date, string>;
7
7
  export type PostPlanExtendTrial = Endpoint<{
8
8
  Method: 'POST';
@@ -61,6 +61,28 @@ export type GetUsage = Endpoint<{
61
61
  data: Record<UsageMetric, MetricUsageSummary>;
62
62
  };
63
63
  }>;
64
+ export type GetBillingUsageTopDimensionValues = Endpoint<{
65
+ Method: 'GET';
66
+ Path: '/api/v1/plans/billing-usage/top-dimension-values';
67
+ Querystring: {
68
+ [M in UsageMetric]: {
69
+ env: string;
70
+ metric: M;
71
+ dimension: BreakdownDimensions[M];
72
+ from: string;
73
+ to: string;
74
+ limit?: string | undefined;
75
+ };
76
+ }[UsageMetric];
77
+ Success: {
78
+ data: {
79
+ values: {
80
+ id: string;
81
+ label: string;
82
+ }[];
83
+ };
84
+ };
85
+ }>;
64
86
  export type GetBillingUsage = Endpoint<{
65
87
  Method: 'GET';
66
88
  Path: '/api/v1/plans/billing-usage';
@@ -68,6 +90,13 @@ export type GetBillingUsage = Endpoint<{
68
90
  env: string;
69
91
  from?: string | undefined;
70
92
  to?: string | undefined;
93
+ source?: 'clickhouse' | 'orb' | undefined;
94
+ metrics?: UsageMetric[] | undefined;
95
+ breakdown?: {
96
+ [M in UsageMetric]?: BreakdownDimensions[M] | undefined;
97
+ } | undefined;
98
+ top?: string | undefined;
99
+ filter?: Partial<Record<UsageMetric, string | undefined>> | undefined;
71
100
  };
72
101
  Success: {
73
102
  data: {
@@ -1,5 +1,5 @@
1
1
  import type { Endpoint } from '../api.js';
2
- import type { Provider } from './provider.js';
2
+ import type { Provider, SimplifiedJSONSchema } from './provider.js';
3
3
  import type { AuthModeType } from '../auth/api.js';
4
4
  export type GetPublicProviders = Endpoint<{
5
5
  Method: 'GET';
@@ -41,6 +41,7 @@ export interface ApiProviderListItem {
41
41
  preConfigured: boolean;
42
42
  preConfiguredScopes: string[];
43
43
  clientRegistration?: 'dynamic' | 'static' | 'metadata';
44
+ integration_config?: Record<string, SimplifiedJSONSchema> | undefined;
44
45
  }
45
46
  export type GetProviders = Endpoint<{
46
47
  Method: 'GET';
@@ -34,6 +34,12 @@ export interface SimplifiedJSONSchema {
34
34
  doc_section?: string;
35
35
  secret?: string;
36
36
  automated: boolean;
37
+ enum?: string[];
38
+ warnings?: Record<string, string>;
39
+ visible_when?: {
40
+ field: string;
41
+ equals: string;
42
+ };
37
43
  }
38
44
  export interface BaseProvider {
39
45
  display_name: string;
@@ -44,6 +50,7 @@ export interface BaseProvider {
44
50
  headers?: Record<string, string>;
45
51
  connection_config?: Record<string, string>;
46
52
  query?: Record<string, string>;
53
+ body?: Record<string, string>;
47
54
  retry?: RetryHeaderConfig;
48
55
  decompress?: boolean;
49
56
  forward_headers_on_redirect?: boolean;
@@ -85,6 +92,7 @@ export interface BaseProvider {
85
92
  connection_configuration?: string[];
86
93
  connection_config?: Record<string, SimplifiedJSONSchema>;
87
94
  credentials?: Record<string, SimplifiedJSONSchema>;
95
+ integration_config?: Record<string, SimplifiedJSONSchema>;
88
96
  assertion_option?: Record<string, SimplifiedJSONSchema>;
89
97
  authorization_url_fragment?: string;
90
98
  body_format?: OAuthBodyFormatType;
@@ -126,6 +134,7 @@ export interface ProviderMcpOAUTH2 extends Omit<BaseProvider, 'body_format'> {
126
134
  auth_mode: 'MCP_OAUTH2';
127
135
  registration_url?: string;
128
136
  client_registration: McpOAuth2ClientRegistration;
137
+ registration_params?: Record<string, string | string[]>;
129
138
  }
130
139
  export interface ProviderMcpOAuth2Generic extends Omit<BaseProvider, 'body_format'> {
131
140
  auth_mode: 'MCP_OAUTH2_GENERIC';
@@ -191,6 +200,7 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
191
200
  token_expiration_strategy?: 'expireAt' | 'expireIn';
192
201
  refresh_token?: string;
193
202
  };
203
+ token_response_headers?: string[];
194
204
  additional_steps?: {
195
205
  body_format?: 'json' | 'form';
196
206
  token_params?: Record<string, string>;
@@ -224,6 +234,9 @@ export interface ProviderSignature extends BaseProvider {
224
234
  expires_in_ms: number;
225
235
  };
226
236
  }
237
+ export interface ProviderAwsSigV4 extends BaseProvider {
238
+ auth_mode: 'AWS_SIGV4';
239
+ }
227
240
  export interface ProviderApiKey extends BaseProvider {
228
241
  auth_mode: 'API_KEY';
229
242
  }
@@ -231,6 +244,6 @@ export interface ProviderInstallPlugin extends BaseProvider {
231
244
  auth_mode: 'INSTALL_PLUGIN';
232
245
  auth_type: 'BASIC';
233
246
  }
234
- export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt | ProviderTwoStep | ProviderSignature | ProviderApiKey | ProviderBill | ProviderGithubApp | ProviderAppleAppStore | ProviderCustom | ProviderMcpOAUTH2 | ProviderMcpOAuth2Generic | ProviderInstallPlugin;
235
- export type RefreshableProvider = ProviderTwoStep | ProviderJwt | ProviderSignature | ProviderOAuth2 | ProviderMcpOAuth2Generic;
247
+ export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt | ProviderTwoStep | ProviderSignature | ProviderAwsSigV4 | ProviderApiKey | ProviderBill | ProviderGithubApp | ProviderAppleAppStore | ProviderCustom | ProviderMcpOAUTH2 | ProviderMcpOAuth2Generic | ProviderInstallPlugin;
248
+ export type RefreshableProvider = ProviderTwoStep | ProviderJwt | ProviderSignature | ProviderOAuth2 | ProviderMcpOAuth2Generic | ProviderAwsSigV4;
236
249
  export type TestableProvider = ProviderApiKey;
@@ -27,6 +27,16 @@ export interface BaseProxyConfiguration {
27
27
  retryHeader?: RetryHeaderConfig;
28
28
  retryOn?: number[] | null;
29
29
  forwardHeadersOnRedirect?: boolean;
30
+ /**
31
+ * If set, called with the resolved outbound URL before the proxy request is sent.
32
+ * Implementations may throw (e.g. shared `ProxyError`) to abort the request.
33
+ */
34
+ validateProxyRequestUrl?: (args: {
35
+ absoluteUrl: string;
36
+ proxyConfig: ApplicationConstructedProxyConfiguration;
37
+ connection: ConnectionForProxy;
38
+ integrationConfig?: IntegrationConfigForProxy;
39
+ }) => void;
30
40
  /**
31
41
  * If set, called with the absolute URL of each HTTP redirect before Axios follows it.
32
42
  * Implementations may throw (e.g. shared `ProxyError`) to abort the redirect.
@@ -39,7 +49,7 @@ export interface UserProvidedProxyConfiguration extends BaseProxyConfiguration {
39
49
  paginate?: Partial<CursorPagination> | Partial<LinkPagination> | Partial<OffsetPagination>;
40
50
  }
41
51
  export type ConnectionForProxy = Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'credentials' | 'metadata'>;
42
- export type IntegrationConfigForProxy = Pick<DBIntegrationDecrypted, 'oauth_client_id' | 'oauth_client_secret'>;
52
+ export type IntegrationConfigForProxy = Pick<DBIntegrationDecrypted, 'oauth_client_id' | 'oauth_client_secret' | 'custom'>;
43
53
  export interface ApplicationConstructedProxyConfiguration extends BaseProxyConfiguration {
44
54
  decompress: boolean;
45
55
  method: HTTP_METHOD;
@@ -21,6 +21,7 @@ export interface RunnerFlags {
21
21
  validateActionOutput: boolean;
22
22
  validateSyncRecords: boolean;
23
23
  validateSyncMetadata: boolean;
24
+ exportRunnerTelemetry: boolean;
24
25
  }
25
26
  export interface RoutingContext {
26
27
  plan: DBPlan | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.70.5",
3
+ "version": "0.70.7",
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.2",
15
+ "axios": "1.16.1",
16
16
  "json-schema": "0.4.0",
17
17
  "type-fest": "4.41.0"
18
18
  },