@nangohq/types 0.70.7 → 0.70.8

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.
@@ -95,12 +95,11 @@ export type PostLogout = Endpoint<{
95
95
  Success: never;
96
96
  }>;
97
97
  export type PostForgotPassword = Endpoint<{
98
- Method: 'PUT';
98
+ Method: 'POST';
99
99
  Path: '/api/v1/account/forgot-password';
100
100
  Body: {
101
101
  email: string;
102
102
  };
103
- Error: ApiError<'user_not_found'>;
104
103
  Success: {
105
104
  success: true;
106
105
  };
@@ -18,10 +18,11 @@ import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetInt
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 { GetPlainHmac } from './plain/api.js';
21
22
  import type { GetBillingUsage, GetBillingUsageTopDimensionValues, PostPlanChange, PostPlanExtendTrial, PutBillingInvoicingDetails } from './plans/http.api.js';
22
23
  import type { GetProvider, GetProviders, GetPublicProvider, GetPublicProviders } from './providers/api.js';
23
24
  import type { AllPublicProxy } from './proxy/http.api.js';
24
- import type { GetPublicRecords, PatchPublicPruneRecords } from './record/api.js';
25
+ import type { GetConnectionRecordModels, GetConnectionRecords, GetPublicRecords, PatchPublicPruneRecords } from './record/api.js';
25
26
  import type { GetPublicScriptsConfig } from './scripts/http.api.js';
26
27
  import type { GetSharedCredentialsProvider, GetSharedCredentialsProviders, PatchSharedCredentialsProvider, PostSharedCredentialsProvider } from './sharedCredentials/api.js';
27
28
  import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync/api.js';
@@ -29,7 +30,7 @@ import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api
29
30
  import type { GetUser, PatchUser, PutUserPassword } from './user/api.js';
30
31
  import type { PostPublicWebhook } from './webhooks/http.api.js';
31
32
  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
+ 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 | 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 | GetPlainHmac;
33
34
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
34
35
  /**
35
36
  * Automatically narrow endpoints type with Method + Path
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export type * from './admin/http.api.js';
13
13
  export type * from './account/api.js';
14
14
  export type * from './user/api.js';
15
15
  export type * from './user/db.js';
16
+ export type * from './plain/api.js';
16
17
  export type * from './connection/api/metadata.js';
17
18
  export type * from './connection/db.js';
18
19
  export type * from './connectUISettings/dto.js';
@@ -4,8 +4,13 @@ import type { JSONSchema7 } from 'json-schema';
4
4
  export type HTTP_METHOD = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
5
5
  /** @deprecated **/
6
6
  export type SyncTypeLiteral = 'incremental' | 'full';
7
- export type ScriptFileType = 'actions' | 'syncs' | 'on-events' | 'post-connection-scripts';
7
+ export type ScriptFileType = 'actions' | 'syncs' | 'on-events' | 'functions' | 'webhooks' | 'post-connection-scripts';
8
8
  export type ScriptTypeLiteral = 'action' | 'sync' | 'on-event';
9
+ /**
10
+ * The `function` primitive is authored via `createFunction()` / `createWebhook()`. It is tracked
11
+ * separately from {@link ScriptTypeLiteral} (sync/action/on-event) while it is introduced additively.
12
+ */
13
+ export type FunctionScriptTypeLiteral = 'function';
9
14
  export interface NangoYamlV1 {
10
15
  integrations: Record<string, Record<string, NangoYamlV1Integration>>;
11
16
  models: NangoYamlModel;
@@ -76,6 +81,7 @@ export interface NangoYamlParsedIntegration {
76
81
  providerConfigKey: string;
77
82
  syncs: ParsedNangoSync[];
78
83
  actions: ParsedNangoAction[];
84
+ functions: ParsedNangoFunction[];
79
85
  onEventScripts: Record<OnEventType, string[]>;
80
86
  /**
81
87
  * @deprecated
@@ -101,6 +107,47 @@ export interface ParsedNangoSync {
101
107
  json_schema?: JSONSchema7 | undefined;
102
108
  features?: Feature[] | undefined;
103
109
  }
110
+ /** Serializable view of a function trigger (the executable hooks live in the deployed file body). */
111
+ export interface ParsedFunctionTrigger {
112
+ type: 'http' | 'schedule' | 'event';
113
+ /** http trigger: maps to the URL path segment. */
114
+ name?: string;
115
+ /** http trigger: 'integration' (default) or 'connection' for tokenized per-connection URLs. */
116
+ scope?: 'integration' | 'connection';
117
+ /** schedule trigger. */
118
+ schedule?: string;
119
+ /** event trigger. */
120
+ event?: string;
121
+ /** Whether ingress coalescing is configured (the window/key config). */
122
+ debounce?: {
123
+ key?: {
124
+ body: string;
125
+ } | {
126
+ header: string;
127
+ };
128
+ windowMs: number;
129
+ maxWindowMs?: number;
130
+ maxEntities?: number;
131
+ payloadMode?: 'latest' | 'all';
132
+ };
133
+ /** Whether the trigger ships an `ingressChallenge` hook (executed at ingress). */
134
+ hasIngressChallenge?: boolean;
135
+ /** Whether the trigger ships an `ingressValidation` hook (executed at ingress). */
136
+ hasIngressValidation?: boolean;
137
+ }
138
+ export interface ParsedNangoFunction {
139
+ name: string;
140
+ type: 'function';
141
+ description: string;
142
+ triggers: ParsedFunctionTrigger[];
143
+ input: string | null;
144
+ output: string[] | null;
145
+ scopes: string[];
146
+ usedModels: string[];
147
+ version: string;
148
+ json_schema?: JSONSchema7 | undefined;
149
+ features?: Feature[] | undefined;
150
+ }
104
151
  export interface ParsedNangoAction {
105
152
  name: string;
106
153
  type: 'action';
@@ -143,7 +190,7 @@ export interface FlowsYaml {
143
190
  models: NangoYamlModel;
144
191
  }>;
145
192
  }
146
- export type FlowZeroJson = NangoYamlParsedIntegration & {
193
+ export type FlowZeroJson = Omit<NangoYamlParsedIntegration, 'functions'> & {
147
194
  jsonSchema?: JSONSchema7;
148
195
  sdkVersion: string;
149
196
  };
@@ -26,6 +26,7 @@ export type RunnerDataTransferTelemetry = WithTags<{
26
26
  callsite: 'proxy' | 'uncontrolled_fetch' | 'persist_records' | 'persist_logs';
27
27
  bytesSent: number;
28
28
  bytesReceived: number;
29
+ count: number;
29
30
  }>;
30
31
  export type RunnerTelemetry = RunnerDataTransferTelemetry;
31
32
  export type PostRunnerTelemetry = Endpoint<{
@@ -0,0 +1,11 @@
1
+ import type { ApiError, Endpoint } from '../api.js';
2
+ export type GetPlainHmac = Endpoint<{
3
+ Method: 'GET';
4
+ Path: `/api/v1/plain`;
5
+ Success: {
6
+ data: {
7
+ hash: string;
8
+ };
9
+ };
10
+ Error: ApiError<'unauthorized'>;
11
+ }>;
@@ -95,6 +95,17 @@ export type UsageWebhookForwardEvent = UsageEventBase<'usage.webhook_forward', {
95
95
  success: boolean;
96
96
  };
97
97
  }>;
98
+ export type DataTransferCallsite = 'credential_test_hook' | 'credential_verification_hook' | 'connection_hook' | 'webhook_forward' | 'proxy' | 'uncontrolled_fetch' | 'persist_logs' | 'persist_records';
99
+ export type UsageDataTransferEvent = UsageEventBase<'usage.data_transfer', {
100
+ value: number;
101
+ properties: {
102
+ package: 'server' | 'runner' | 'shared';
103
+ callsite: DataTransferCallsite;
104
+ ingressedBytes: number;
105
+ egressedBytes: number;
106
+ syncId?: string;
107
+ };
108
+ }>;
98
109
  type EnforceUsageEventBase<T extends UsageEventBase<any, any>> = T;
99
- export type UsageEvent = EnforceUsageEventBase<UsageMarEvent | UsageRecordsEvent | UsageActionsEvent | UsageConnectionsEvent | UsageFunctionExecutionsEvent | UsageProxyEvent | UsageWebhookForwardEvent>;
110
+ export type UsageEvent = EnforceUsageEventBase<UsageMarEvent | UsageRecordsEvent | UsageActionsEvent | UsageConnectionsEvent | UsageFunctionExecutionsEvent | UsageProxyEvent | UsageWebhookForwardEvent | UsageDataTransferEvent>;
100
111
  export {};
@@ -63,3 +63,48 @@ export type PatchPublicPruneRecords = Endpoint<{
63
63
  has_more: boolean;
64
64
  };
65
65
  }>;
66
+ export interface ConnectionRecordModel {
67
+ model: string;
68
+ variant: string | null;
69
+ count: number;
70
+ size_bytes: number;
71
+ updated_at: string;
72
+ }
73
+ export type GetConnectionRecordModels = Endpoint<{
74
+ Method: 'GET';
75
+ Path: '/api/v1/connections/:connectionId/records/models';
76
+ Params: {
77
+ connectionId: string;
78
+ };
79
+ Querystring: {
80
+ env: string;
81
+ provider_config_key: string;
82
+ };
83
+ Success: {
84
+ data: ConnectionRecordModel[];
85
+ };
86
+ }>;
87
+ export type GetConnectionRecords = Endpoint<{
88
+ Method: 'GET';
89
+ Path: '/api/v1/connections/:connectionId/records';
90
+ Params: {
91
+ connectionId: string;
92
+ };
93
+ Querystring: {
94
+ env: string;
95
+ provider_config_key: string;
96
+ model: string;
97
+ variant?: string | undefined;
98
+ limit?: number | undefined;
99
+ cursor?: string | undefined;
100
+ metadata_only?: boolean | undefined;
101
+ /** When set, return at most one full record for this external id (for lazy payload fetch). metadata_only is ignored */
102
+ record_id?: string | undefined;
103
+ };
104
+ Success: {
105
+ data: {
106
+ next_cursor: string | null;
107
+ records: NangoRecord[];
108
+ };
109
+ };
110
+ }>;
package/dist/web/env.d.ts CHANGED
@@ -8,6 +8,7 @@ export interface WindowEnv {
8
8
  publicPosthogHost: string;
9
9
  publicLogoDevKey: string;
10
10
  publicStripeKey: string;
11
+ publicPlainAppId: string;
11
12
  isCloud: boolean;
12
13
  isHosted: boolean;
13
14
  isEnterprise: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.70.7",
3
+ "version": "0.70.8",
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.16.1",
15
+ "axios": "1.18.0",
16
16
  "json-schema": "0.4.0",
17
17
  "type-fest": "4.41.0"
18
18
  },