@nangohq/types 0.40.1 → 0.40.2

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/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export type * from './account/db.js';
11
11
  export type * from './user/api.js';
12
12
  export type * from './connection/api/metadata.js';
13
13
  export type * from './connection/db.js';
14
+ export type * from './proxy/api.js';
14
15
  export type * from './environment/db.js';
15
16
  export type * from './scripts/post-connection/api.js';
16
17
  export type * from './scripts/post-connection/db.js';
@@ -21,6 +22,8 @@ export type * from './integration/db.js';
21
22
  export type * from './integration/template.js';
22
23
  export type * from './auth/api.js';
23
24
  export type * from './auth/db.js';
25
+ export type * from './nangoYaml/index.js';
26
+ export type * from './utils.js';
24
27
  export type * from './environment/db.js';
25
28
  export type * from './environment/api/webhook.js';
26
29
  export type * from './webhooks/api.js';
@@ -120,3 +120,4 @@ export type OperationRow = Pick<MessageRow, OperationRequired> & Omit<MessageRow
120
120
  export type MessageRowInsert = Pick<MessageRow, 'type' | 'message'> & Partial<Omit<MessageRow, 'type' | 'message'>> & {
121
121
  id?: string | undefined;
122
122
  };
123
+ export type LogsBuffer = Pick<MessageRow, 'level' | 'message' | 'createdAt'> & Partial<Pick<MessageRow, 'error' | 'meta'>>;
@@ -0,0 +1,106 @@
1
+ export type HTTP_VERB = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
2
+ export type SyncTypeLiteral = 'incremental' | 'full';
3
+ export interface NangoYamlV1 {
4
+ integrations: Record<string, Record<string, NangoYamlV1Integration>>;
5
+ models: NangoYamlModel;
6
+ }
7
+ export interface NangoYamlV1Integration {
8
+ type?: 'action' | 'sync';
9
+ returns?: string | string[];
10
+ description?: string;
11
+ runs?: string;
12
+ track_deletes?: boolean;
13
+ auto_start?: boolean;
14
+ }
15
+ export interface NangoYamlV2 {
16
+ integrations: Record<string, NangoYamlV2Integration>;
17
+ models: NangoYamlModel;
18
+ }
19
+ export interface NangoYamlV2Integration {
20
+ provider?: string;
21
+ syncs?: Record<string, NangoYamlV2IntegrationSync>;
22
+ actions?: Record<string, NangoYamlV2IntegrationAction>;
23
+ 'post-connection-scripts'?: string[];
24
+ }
25
+ export interface NangoYamlV2IntegrationSync {
26
+ endpoint: string | string[];
27
+ output: string | string[];
28
+ description?: string;
29
+ sync_type?: SyncTypeLiteral;
30
+ track_deletes?: boolean;
31
+ auto_start?: boolean;
32
+ runs: string;
33
+ scopes?: string | string[];
34
+ input?: string;
35
+ 'webhook-subscriptions'?: string | string[];
36
+ }
37
+ export interface NangoYamlV2IntegrationAction {
38
+ endpoint: string;
39
+ output?: string | string[];
40
+ description?: string;
41
+ scopes?: string | string[];
42
+ input?: string;
43
+ }
44
+ export interface NangoYamlModel {
45
+ [key: string]: NangoYamlModelFields;
46
+ }
47
+ export interface NangoYamlModelFields {
48
+ [key: string]: NangoYamlModelField;
49
+ }
50
+ export type NangoYamlModelField = boolean | number | string | null | string[] | NangoYamlModelFields;
51
+ export type NangoYaml = NangoYamlV1 | NangoYamlV2;
52
+ export interface NangoYamlParsed {
53
+ yamlVersion: 'v1' | 'v2';
54
+ integrations: NangoYamlParsedIntegration[];
55
+ models: Map<string, NangoModel>;
56
+ }
57
+ export interface NangoYamlParsedIntegration {
58
+ providerConfigKey: string;
59
+ syncs: ParsedNangoSync[];
60
+ actions: ParsedNangoAction[];
61
+ postConnectionScripts: string[];
62
+ }
63
+ export interface ParsedNangoSync {
64
+ name: string;
65
+ type: 'sync';
66
+ endpoints: NangoSyncEndpoint[];
67
+ description: string;
68
+ sync_type: SyncTypeLiteral;
69
+ track_deletes: boolean;
70
+ auto_start: boolean;
71
+ runs: string;
72
+ scopes: string[];
73
+ input: string | null;
74
+ output: string[] | null;
75
+ usedModels: string[];
76
+ webhookSubscriptions: string[];
77
+ }
78
+ export interface ParsedNangoAction {
79
+ name: string;
80
+ type: 'action';
81
+ description: string;
82
+ input: string | null;
83
+ output: string[] | null;
84
+ endpoint: NangoSyncEndpoint | null;
85
+ scopes: string[];
86
+ usedModels: string[];
87
+ }
88
+ export type LayoutMode = 'root' | 'nested';
89
+ export interface NangoModel {
90
+ name: string;
91
+ fields: NangoModelField[];
92
+ isAnon?: boolean;
93
+ }
94
+ export interface NangoModelField {
95
+ name: string;
96
+ value: string | number | boolean | null | undefined | NangoModelField[];
97
+ dynamic?: boolean;
98
+ tsType?: boolean;
99
+ model?: boolean;
100
+ array?: boolean;
101
+ union?: boolean;
102
+ optional?: boolean;
103
+ }
104
+ export type NangoSyncEndpoint = {
105
+ [key in HTTP_VERB]?: string;
106
+ };
@@ -0,0 +1,9 @@
1
+ export type MaybePromise<T> = Promise<T> | T;
2
+ export type LogMethod = (...args: any[]) => any;
3
+ export interface Logger {
4
+ error: LogMethod;
5
+ warn: LogMethod;
6
+ info: LogMethod;
7
+ debug: LogMethod;
8
+ child: (...message: any[]) => Logger;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.40.1",
3
+ "version": "0.40.2",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",