@nangohq/types 0.56.4 → 0.57.1

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.
@@ -10,7 +10,7 @@ import type { GetUser, PatchUser } from './user/api';
10
10
  import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy, PatchIntegration, PostIntegration } from './integration/api';
11
11
  import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization, PostPublicJwtAuthorization, PostPublicBillAuthorization, PostPublicSignatureAuthorization, PostPublicTwoStepAuthorization, PostPublicApiKeyAuthorization, PostPublicBasicAuthorization, PostPublicAppStoreAuthorization } from './auth/http.api';
12
12
  import type { GetPublicProvider, GetPublicProviders } from './providers/api';
13
- import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect } from './connect/api';
13
+ import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api';
14
14
  import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh } from './connection/api/get';
15
15
  import type { GetMeta } from './meta/api';
16
16
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
@@ -20,7 +20,7 @@ import type { PatchWebhook } from './environment/api/webhook';
20
20
  import type { PostEnvironmentVariables } from './environment/variable/api';
21
21
  import type { GetPublicRecords } from './record/api';
22
22
  import type { GetPublicScriptsConfig } from './scripts/http.api';
23
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig;
23
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry;
24
24
  export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PatchOnboarding | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | PatchWebhook | PostEnvironmentVariables;
25
25
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
26
26
  /**
@@ -158,4 +158,6 @@ export type RefreshTokenResponse = AuthorizationTokenResponse;
158
158
  export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'type' | 'raw'> {
159
159
  expires_in?: number;
160
160
  }
161
+ export type TestableCredentials = ApiKeyCredentials | BasicApiCredentials | TbaCredentials | JwtCredentials | SignatureCredentials;
162
+ export type RefreshableCredentials = OAuth2Credentials | AppCredentials | AppStoreCredentials | OAuth2ClientCredentials | TableauCredentials | JwtCredentials | TwoStepCredentials | BillCredentials | SignatureCredentials;
161
163
  export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials | TwoStepCredentials | SignatureCredentials;
@@ -67,3 +67,16 @@ export type PostInternalConnectSessions = Endpoint<{
67
67
  Success: PostConnectSessions['Success'];
68
68
  Body: Pick<ConnectSessionInput, 'allowed_integrations' | 'end_user' | 'organization'>;
69
69
  }>;
70
+ export type PostPublicConnectTelemetry = Endpoint<{
71
+ Method: 'POST';
72
+ Path: '/connect/telemetry';
73
+ Body: {
74
+ token: string;
75
+ event: 'open' | 'view:list' | 'view:integration' | 'view:unknown_error' | 'view:credentials_error' | 'view:success' | 'click:integration' | 'click:doc' | 'click:doc_section' | 'click:connect' | 'click:close' | 'click:finish' | 'click:outside' | 'popup:blocked_by_browser' | 'popup:closed_early';
76
+ timestamp: Date;
77
+ dimensions?: {
78
+ integration?: string | undefined;
79
+ } | undefined;
80
+ };
81
+ Success: never;
82
+ }>;
@@ -4,6 +4,7 @@ export interface ConnectSession {
4
4
  readonly accountId: number;
5
5
  readonly environmentId: number;
6
6
  readonly connectionId: number | null;
7
+ readonly operationId: string | null;
7
8
  readonly allowedIntegrations: string[] | null;
8
9
  readonly integrationsConfigDefaults: Record<string, {
9
10
  /** Only used by Slack */
@@ -102,7 +102,7 @@ export type PostInsights = Endpoint<{
102
102
  env: string;
103
103
  };
104
104
  Body: {
105
- type: PickFromUnion<ConcatOperationListWithGroup, 'action' | 'sync:run' | 'proxy' | 'webhook:incoming'>;
105
+ type: PickFromUnion<ConcatOperationListWithGroup, 'action' | 'sync:run' | 'proxy' | 'webhook:incoming' | 'auth:create_connection'>;
106
106
  };
107
107
  Success: {
108
108
  data: {
@@ -115,5 +115,8 @@ export interface InsightsHistogramEntry {
115
115
  total: number;
116
116
  success: number;
117
117
  failure: number;
118
+ cancelled: number;
119
+ expired: number;
120
+ running: number;
118
121
  }
119
122
  export {};
@@ -87,6 +87,7 @@ export interface MessageRow {
87
87
  level: LogLevel;
88
88
  type: MessageType;
89
89
  message: string;
90
+ context?: 'script' | 'proxy' | 'webhook' | undefined;
90
91
  parentId: string;
91
92
  error?: MessageError | undefined;
92
93
  request?: MessageHTTPRequest | undefined;
@@ -95,6 +96,7 @@ export interface MessageRow {
95
96
  retry?: MessageHTTPRetry | undefined;
96
97
  createdAt: string;
97
98
  endedAt?: string | undefined;
99
+ durationMs?: number | undefined;
98
100
  }
99
101
  export interface OperationRow {
100
102
  id: string;
@@ -122,6 +124,8 @@ export interface OperationRow {
122
124
  integrationName?: string | undefined;
123
125
  connectionId?: number | undefined;
124
126
  connectionName?: string | undefined;
127
+ endUserId?: string | undefined;
128
+ endUserName?: string | undefined;
125
129
  syncConfigId?: number | undefined;
126
130
  syncConfigName?: string | undefined;
127
131
  jobId?: string | undefined;
@@ -135,6 +139,7 @@ export interface OperationRow {
135
139
  startedAt: string | null;
136
140
  endedAt: string | null;
137
141
  expiresAt: string | null;
142
+ durationMs?: number | undefined;
138
143
  }
139
144
  /**
140
145
  * What is required to insert an Operation
@@ -143,7 +148,7 @@ export type OperationRowInsert = Merge<Partial<OperationRow>, Pick<OperationRow,
143
148
  /**
144
149
  * What is required to insert a Message
145
150
  */
146
- export type MessageRowInsert = Pick<MessageRow, 'type' | 'message' | 'createdAt'> & Partial<Omit<MessageRow, 'type' | 'message'>> & {
151
+ export type MessageRowInsert = Pick<MessageRow, 'type' | 'message' | 'createdAt' | 'level'> & Partial<Omit<MessageRow, 'type' | 'message'>> & {
147
152
  id?: never;
148
153
  };
149
154
  export type MessageOrOperationRow = MessageRow | OperationRow;
@@ -50,7 +50,7 @@ export interface BaseProvider {
50
50
  paginate?: LinkPagination | CursorPagination | OffsetPagination;
51
51
  verification?: {
52
52
  method: EndpointMethod;
53
- endpoint: string;
53
+ endpoints: string[];
54
54
  base_url_override?: string;
55
55
  headers?: Record<string, string>;
56
56
  };
@@ -74,6 +74,7 @@ export interface BaseProvider {
74
74
  webhook_routing_script?: string;
75
75
  webhook_user_defined_secret?: boolean;
76
76
  post_connection_script?: string;
77
+ credentials_verification_script?: string;
77
78
  categories?: string[];
78
79
  connection_configuration?: string[];
79
80
  connection_config?: Record<string, SimplifiedJSONSchema>;
@@ -140,3 +141,5 @@ export interface ProviderSignature extends BaseProvider {
140
141
  };
141
142
  }
142
143
  export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt | ProviderTwoStep | ProviderSignature;
144
+ export type RefreshableProvider = ProviderOAuth2;
145
+ export type TestableProvider = ProviderJwt | ProviderSignature;
@@ -6,23 +6,26 @@ export interface NangoProps {
6
6
  scriptType: 'sync' | 'action' | 'webhook' | 'on-event';
7
7
  host?: string;
8
8
  secretKey: string;
9
- team?: Pick<DBTeam, 'id' | 'name'>;
9
+ team: Pick<DBTeam, 'id' | 'name'>;
10
10
  connectionId: string;
11
11
  environmentId: number;
12
- environmentName?: string;
12
+ environmentName: string;
13
13
  activityLogId?: string | undefined;
14
14
  providerConfigKey: string;
15
15
  provider: string;
16
16
  lastSyncDate?: Date;
17
17
  syncId?: string | undefined;
18
18
  syncVariant?: string | undefined;
19
- nangoConnectionId?: number;
19
+ nangoConnectionId: number;
20
20
  syncJobId?: number | undefined;
21
21
  track_deletes?: boolean;
22
22
  attributes?: object | undefined;
23
23
  abortSignal?: AbortSignal;
24
24
  syncConfig: DBSyncConfig;
25
25
  runnerFlags: RunnerFlags;
26
+ /**
27
+ * @deprecated not used
28
+ */
26
29
  debug: boolean;
27
30
  startedAt: Date;
28
31
  endUser: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.56.4",
3
+ "version": "0.57.1",
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.7.9",
15
+ "axios": "^1.8.2",
16
16
  "json-schema": "0.4.0",
17
17
  "type-fest": "4.32.0"
18
18
  },