@nangohq/types 0.53.2 → 0.54.0

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,4 +1,4 @@
1
- import type { Merge } from 'type-fest';
1
+ import type { Merge, SetNonNullable } from 'type-fest';
2
2
  /**
3
3
  * Level of the log and operation
4
4
  */
@@ -111,6 +111,11 @@ export interface MessageRow {
111
111
  headers: Record<string, string>;
112
112
  } | null;
113
113
  meta: MessageMeta | null;
114
+ retry?: {
115
+ attempt: number;
116
+ max: number;
117
+ waited: number;
118
+ } | undefined;
114
119
  createdAt: string;
115
120
  updatedAt: string;
116
121
  startedAt: string | null;
@@ -123,11 +128,9 @@ export interface MessageRow {
123
128
  export type OperationRowInsert = Omit<Merge<Partial<MessageRow>, {
124
129
  operation: OperationList;
125
130
  }>, 'message'>;
126
- export type OperationRow = Merge<Required<OperationRowInsert>, {
127
- message: string;
128
- accountId: number;
129
- accountName: string;
130
- }>;
131
+ export type OperationRow = SetNonNullable<Omit<MessageRow, 'operation'>, 'id' | 'message' | 'source' | 'createdAt' | 'accountId' | 'accountName' | 'type' | 'level' | 'expiresAt' | 'state'> & {
132
+ operation: OperationList;
133
+ };
131
134
  /**
132
135
  * What is required to insert a Message
133
136
  */
@@ -1,17 +1,29 @@
1
- import type { EndpointMethod } from '../api.js';
2
- import type { BasicApiCredentials, ApiKeyCredentials, AppCredentials } from '../auth/api.js';
1
+ import type { BasicApiCredentials, ApiKeyCredentials, AppCredentials, TbaCredentials, TableauCredentials, JwtCredentials, TwoStepCredentials, SignatureCredentials } from '../auth/api.js';
3
2
  import type { DBConnectionDecrypted } from '../connection/db.js';
3
+ import type { HTTP_METHOD } from '../nangoYaml/index.js';
4
4
  import type { Provider } from '../providers/provider.js';
5
+ export interface ProxyFile {
6
+ fieldname: string;
7
+ originalname: string;
8
+ encoding: string;
9
+ mimetype: string;
10
+ size: number;
11
+ destination: string;
12
+ filename: string;
13
+ path: string;
14
+ buffer: Buffer;
15
+ }
5
16
  export interface BaseProxyConfiguration {
6
17
  providerConfigKey: string;
7
18
  connectionId: string;
8
19
  endpoint: string;
9
20
  retries?: number;
10
21
  data?: unknown;
22
+ files?: ProxyFile[];
11
23
  headers?: Record<string, string>;
12
24
  params?: string | Record<string, string | number>;
13
25
  baseUrlOverride?: string;
14
- responseType?: ResponseType;
26
+ responseType?: ResponseType | undefined;
15
27
  retryHeader?: RetryHeaderConfig;
16
28
  retryOn?: number[] | null;
17
29
  }
@@ -22,16 +34,16 @@ export interface UserProvidedProxyConfiguration extends BaseProxyConfiguration {
22
34
  }
23
35
  export interface ApplicationConstructedProxyConfiguration extends BaseProxyConfiguration {
24
36
  decompress?: boolean;
25
- method: EndpointMethod;
37
+ method: HTTP_METHOD;
26
38
  providerName: string;
27
- token: string | BasicApiCredentials | ApiKeyCredentials | AppCredentials;
39
+ token: string | BasicApiCredentials | ApiKeyCredentials | AppCredentials | TbaCredentials | TableauCredentials | JwtCredentials | TwoStepCredentials | SignatureCredentials;
28
40
  provider: Provider;
29
- connection: DBConnectionDecrypted;
41
+ connection: Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'credentials' | 'metadata'>;
30
42
  }
31
43
  export type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
32
44
  export interface InternalProxyConfiguration {
33
45
  providerName: string;
34
- connection: DBConnectionDecrypted;
46
+ connection: Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'credentials' | 'metadata'>;
35
47
  existingActivityLogId?: string | null | undefined;
36
48
  }
37
49
  export interface RetryHeaderConfig {
@@ -1,20 +1,7 @@
1
1
  import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios';
2
2
  import type { RunnerFlags } from '.';
3
- import type { Metadata } from '../connection/db';
4
3
  import type { DBTeam } from '../team/db';
5
4
  import type { DBSyncConfig } from '../syncConfigs/db';
6
- export interface RunArgs {
7
- sync: string;
8
- connectionId: string;
9
- lastSyncDate?: string;
10
- useServerLastSyncDate?: boolean;
11
- input?: object;
12
- metadata?: Metadata;
13
- autoConfirm: boolean;
14
- debug: boolean;
15
- optionalEnvironment?: string;
16
- optionalProviderConfigKey?: string;
17
- }
18
5
  export interface NangoProps {
19
6
  scriptType: 'sync' | 'action' | 'webhook' | 'on-event';
20
7
  host?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.53.2",
3
+ "version": "0.54.0",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",