@nangohq/types 0.40.5 → 0.40.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.d.ts CHANGED
@@ -11,7 +11,7 @@ export interface ValidationError {
11
11
  message: string;
12
12
  path: (string | number)[];
13
13
  }
14
- export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'missing_auth_header'> | ApiError<'generic_error_support', undefined, string>;
14
+ export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'missing_auth_header'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'>;
15
15
  export type EndpointMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
16
16
  /**
17
17
  * API Request/Response type
@@ -2,7 +2,8 @@ import type { EndpointMethod } from './api';
2
2
  import type { GetOperation, SearchFilters, SearchMessages, SearchOperations } from './logs/api';
3
3
  import type { GetOnboardingStatus } from './onboarding/api';
4
4
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata';
5
- export type APIEndpoints = SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | SetMetadata | UpdateMetadata;
5
+ import type { PostDeploy, PostDeployConfirmation } from './deploy/api';
6
+ export type APIEndpoints = SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation;
6
7
  /**
7
8
  * Automatically narrow endpoints type with Method + Path
8
9
  */
@@ -0,0 +1,47 @@
1
+ import type { Endpoint } from '../api.js';
2
+ import type { IncomingFlowConfig, PostConnectionScriptByProvider } from './incomingFlow.js';
3
+ export type PostDeployConfirmation = Endpoint<{
4
+ Method: 'POST';
5
+ Path: '/sync/deploy/confirmation';
6
+ Body: {
7
+ flowConfigs: IncomingFlowConfig[];
8
+ postConnectionScriptsByProvider: PostConnectionScriptByProvider[];
9
+ reconcile: boolean;
10
+ debug: boolean;
11
+ singleDeployMode?: boolean;
12
+ };
13
+ Success: SyncAndActionDifferences;
14
+ }>;
15
+ export type PostDeploy = Endpoint<{
16
+ Method: 'POST';
17
+ Path: '/sync/deploy';
18
+ Body: {
19
+ flowConfigs: IncomingFlowConfig[];
20
+ postConnectionScriptsByProvider: PostConnectionScriptByProvider[];
21
+ nangoYamlBody: string;
22
+ reconcile: boolean;
23
+ debug: boolean;
24
+ singleDeployMode?: boolean;
25
+ };
26
+ Success: any[];
27
+ }>;
28
+ export interface SlimSync {
29
+ id?: number;
30
+ name: string;
31
+ auto_start: boolean;
32
+ sync_id?: string | null;
33
+ providerConfigKey: string;
34
+ connections?: number;
35
+ enabled?: boolean;
36
+ }
37
+ export interface SlimAction {
38
+ id?: number;
39
+ providerConfigKey: string;
40
+ name: string;
41
+ }
42
+ export interface SyncAndActionDifferences {
43
+ newSyncs: SlimSync[];
44
+ deletedSyncs: SlimSync[];
45
+ newActions: SlimAction[];
46
+ deletedActions: SlimAction[];
47
+ }
@@ -0,0 +1,55 @@
1
+ import type { NangoSyncEndpoint, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml';
2
+ export interface IncomingScriptFiles {
3
+ js: string;
4
+ ts: string;
5
+ }
6
+ export interface IncomingPostConnectionScript {
7
+ name: string;
8
+ fileBody: IncomingScriptFiles;
9
+ }
10
+ export interface PostConnectionScriptByProvider {
11
+ providerConfigKey: string;
12
+ scripts: IncomingPostConnectionScript[];
13
+ }
14
+ export interface NangoConfigMetadata {
15
+ scopes?: string[] | undefined;
16
+ description?: string | undefined;
17
+ }
18
+ export interface LegacySyncModelSchema {
19
+ name: string;
20
+ fields: {
21
+ name: string;
22
+ type: string;
23
+ }[];
24
+ }
25
+ interface InternalIncomingPreBuiltFlowConfig {
26
+ type: ScriptTypeLiteral;
27
+ models: string[];
28
+ runs: string;
29
+ auto_start?: boolean;
30
+ attributes?: object | undefined;
31
+ metadata?: NangoConfigMetadata | undefined;
32
+ model_schema: string;
33
+ input?: string | LegacySyncModelSchema | undefined;
34
+ endpoints?: NangoSyncEndpoint[] | undefined;
35
+ }
36
+ export interface IncomingPreBuiltFlowConfig extends InternalIncomingPreBuiltFlowConfig {
37
+ provider: string;
38
+ is_public: boolean;
39
+ public_route?: string;
40
+ name: string;
41
+ syncName?: string;
42
+ nango_config_id?: number;
43
+ providerConfigKey?: string;
44
+ fileBody?: IncomingScriptFiles;
45
+ }
46
+ export interface IncomingFlowConfig extends InternalIncomingPreBuiltFlowConfig {
47
+ syncName: string;
48
+ providerConfigKey: string;
49
+ fileBody: IncomingScriptFiles;
50
+ version?: string | undefined;
51
+ track_deletes?: boolean;
52
+ sync_type?: SyncTypeLiteral | undefined;
53
+ webhookSubscriptions?: string[] | undefined;
54
+ }
55
+ export {};
package/dist/index.d.ts CHANGED
@@ -13,7 +13,6 @@ export type * from './connection/api/metadata.js';
13
13
  export type * from './connection/db.js';
14
14
  export type * from './proxy/api.js';
15
15
  export type * from './environment/db.js';
16
- export type * from './scripts/post-connection/api.js';
17
16
  export type * from './scripts/post-connection/db.js';
18
17
  export type * from './scripts/syncs/api.js';
19
18
  export type * from './notification/active-logs/db.js';
@@ -22,8 +21,10 @@ export type * from './integration/db.js';
22
21
  export type * from './integration/template.js';
23
22
  export type * from './auth/api.js';
24
23
  export type * from './auth/db.js';
24
+ export type * from './deploy/api.js';
25
+ export type * from './deploy/incomingFlow.js';
25
26
  export type * from './nangoYaml/index.js';
26
- export type * from './utils.js';
27
27
  export type * from './environment/db.js';
28
28
  export type * from './environment/api/webhook.js';
29
29
  export type * from './webhooks/api.js';
30
+ export type * from './utils.js';
@@ -1,11 +1,12 @@
1
1
  export type HTTP_VERB = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
2
2
  export type SyncTypeLiteral = 'incremental' | 'full';
3
+ export type ScriptTypeLiteral = 'action' | 'sync';
3
4
  export interface NangoYamlV1 {
4
5
  integrations: Record<string, Record<string, NangoYamlV1Integration>>;
5
6
  models: NangoYamlModel;
6
7
  }
7
8
  export interface NangoYamlV1Integration {
8
- type?: 'action' | 'sync';
9
+ type?: ScriptTypeLiteral;
9
10
  returns?: string | string[];
10
11
  description?: string;
11
12
  runs?: string;
@@ -102,5 +103,5 @@ export interface NangoModelField {
102
103
  optional?: boolean;
103
104
  }
104
105
  export type NangoSyncEndpoint = {
105
- [key in HTTP_VERB]?: string;
106
+ [key in HTTP_VERB]?: string | undefined;
106
107
  };
@@ -4,9 +4,8 @@ export interface ActiveLog extends Timestamps {
4
4
  type: string;
5
5
  action: string;
6
6
  connection_id: number;
7
- activity_log_id: number;
8
7
  log_id: string;
9
8
  active: boolean;
10
9
  sync_id: string | null;
11
10
  }
12
- export type ActiveLogIds = Pick<ActiveLog, 'activity_log_id' | 'log_id'>;
11
+ export type ActiveLogIds = Pick<ActiveLog, 'log_id'>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.40.5",
3
+ "version": "0.40.6",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -1,11 +0,0 @@
1
- export interface IncomingPostConnectionScript {
2
- name: string;
3
- fileBody: {
4
- js: string;
5
- ts: string;
6
- };
7
- }
8
- export interface PostConnectionScriptByProvider {
9
- providerConfigKey: string;
10
- scripts: IncomingPostConnectionScript[];
11
- }