@nangohq/types 0.40.6 → 0.40.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.
@@ -9,6 +9,7 @@ export interface AuthModes {
9
9
  Custom: 'CUSTOM';
10
10
  App: 'APP';
11
11
  None: 'NONE';
12
+ TBA: 'TBA';
12
13
  }
13
14
  export type AuthModeType = AuthModes[keyof AuthModes];
14
15
  export interface AuthOperation {
@@ -94,6 +95,15 @@ export interface CredentialsRefresh<T = unknown> {
94
95
  connectionId: string;
95
96
  promise: Promise<T>;
96
97
  }
98
+ export interface TbaCredentials {
99
+ type: AuthModes['TBA'];
100
+ token_id: string;
101
+ token_secret: string;
102
+ config_override: {
103
+ client_id?: string;
104
+ client_secret?: string;
105
+ };
106
+ }
97
107
  export type UnauthCredentials = Record<string, never>;
98
108
  export type RefreshTokenResponse = AuthorizationTokenResponse;
99
109
  export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'type' | 'raw'> {
@@ -0,0 +1,24 @@
1
+ import type { ApiError, Endpoint } from '../api';
2
+ import type { ConnectionConfig } from '../connection/db';
3
+ export type TbaAuthorization = Endpoint<{
4
+ Method: 'POST';
5
+ Body: {
6
+ token_id: string;
7
+ token_secret: string;
8
+ oauth_client_id_override?: string;
9
+ oauth_client_secret_override?: string;
10
+ };
11
+ QueryParams: {
12
+ connectionId: string;
13
+ connectionConfig: ConnectionConfig;
14
+ };
15
+ Params: {
16
+ providerConfigKey: string;
17
+ };
18
+ Path: '/auth/tba';
19
+ Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
20
+ Success: {
21
+ providerConfigKey: string;
22
+ connectionId: string;
23
+ };
24
+ }>;
@@ -1,5 +1,5 @@
1
1
  import type { TimestampsAndDeleted } from '../db.js';
2
- import type { AuthCredentials, ApiKeyCredentials, BasicApiCredentials, AppCredentials, AppStoreCredentials, UnauthCredentials, CustomCredentials, AuthModeType, AuthOperationType } from '../auth/api.js';
2
+ import type { AuthCredentials, ApiKeyCredentials, BasicApiCredentials, AppCredentials, AppStoreCredentials, UnauthCredentials, CustomCredentials, TbaCredentials, AuthModeType, AuthOperationType } from '../auth/api.js';
3
3
  import type { Environment } from '../environment/db.js';
4
4
  import type { Account } from '../account/db.js';
5
5
  export type Metadata = Record<string, unknown>;
@@ -20,7 +20,7 @@ export interface StoredConnection extends BaseConnection {
20
20
  credentials: Record<string, any>;
21
21
  }
22
22
  export interface Connection extends BaseConnection {
23
- credentials: AuthCredentials | ApiKeyCredentials | BasicApiCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials;
23
+ credentials: AuthCredentials | ApiKeyCredentials | BasicApiCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials;
24
24
  }
25
25
  export type RecentlyCreatedConnection = Pick<StoredConnection, 'id' | 'connection_id' | 'provider_config_key'> & {
26
26
  auth_mode: AuthModeType;
@@ -1,3 +1,4 @@
1
+ import type { JSONSchema7 } from 'json-schema';
1
2
  import type { Endpoint } from '../api.js';
2
3
  import type { IncomingFlowConfig, PostConnectionScriptByProvider } from './incomingFlow.js';
3
4
  export type PostDeployConfirmation = Endpoint<{
@@ -9,6 +10,7 @@ export type PostDeployConfirmation = Endpoint<{
9
10
  reconcile: boolean;
10
11
  debug: boolean;
11
12
  singleDeployMode?: boolean;
13
+ jsonSchema?: JSONSchema7 | undefined;
12
14
  };
13
15
  Success: SyncAndActionDifferences;
14
16
  }>;
@@ -22,6 +24,7 @@ export type PostDeploy = Endpoint<{
22
24
  reconcile: boolean;
23
25
  debug: boolean;
24
26
  singleDeployMode?: boolean;
27
+ jsonSchema?: JSONSchema7 | undefined;
25
28
  };
26
29
  Success: any[];
27
30
  }>;
@@ -1,4 +1,4 @@
1
- import type { NangoSyncEndpoint, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml';
1
+ import type { NangoModel, NangoSyncEndpoint, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml';
2
2
  export interface IncomingScriptFiles {
3
3
  js: string;
4
4
  ts: string;
@@ -29,7 +29,7 @@ interface InternalIncomingPreBuiltFlowConfig {
29
29
  auto_start?: boolean;
30
30
  attributes?: object | undefined;
31
31
  metadata?: NangoConfigMetadata | undefined;
32
- model_schema: string;
32
+ model_schema: string | NangoModel[];
33
33
  input?: string | LegacySyncModelSchema | undefined;
34
34
  endpoints?: NangoSyncEndpoint[] | undefined;
35
35
  }
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export type * from './integration/db.js';
21
21
  export type * from './integration/template.js';
22
22
  export type * from './auth/api.js';
23
23
  export type * from './auth/db.js';
24
+ export type * from './auth/http.api.js';
24
25
  export type * from './deploy/api.js';
25
26
  export type * from './deploy/incomingFlow.js';
26
27
  export type * from './nangoYaml/index.js';
@@ -31,6 +31,7 @@ export interface Template {
31
31
  };
32
32
  };
33
33
  authorization_url?: string;
34
+ access_token_url?: string;
34
35
  authorization_params?: Record<string, string>;
35
36
  scope_separator?: string;
36
37
  default_scopes?: string[];
@@ -91,6 +91,8 @@ export interface MessageRow {
91
91
  error: {
92
92
  name: string;
93
93
  message: string;
94
+ type?: string | null;
95
+ payload?: any;
94
96
  } | null;
95
97
  request: {
96
98
  url: string;
@@ -1,5 +1,6 @@
1
1
  export type HTTP_VERB = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
2
2
  export type SyncTypeLiteral = 'incremental' | 'full';
3
+ export type ScriptFileType = 'actions' | 'syncs' | 'post-connection-scripts';
3
4
  export type ScriptTypeLiteral = 'action' | 'sync';
4
5
  export interface NangoYamlV1 {
5
6
  integrations: Record<string, Record<string, NangoYamlV1Integration>>;
@@ -90,17 +91,17 @@ export type LayoutMode = 'root' | 'nested';
90
91
  export interface NangoModel {
91
92
  name: string;
92
93
  fields: NangoModelField[];
93
- isAnon?: boolean;
94
+ isAnon?: boolean | undefined;
94
95
  }
95
96
  export interface NangoModelField {
96
97
  name: string;
97
- value: string | number | boolean | null | undefined | NangoModelField[];
98
- dynamic?: boolean;
99
- tsType?: boolean;
100
- model?: boolean;
101
- array?: boolean;
102
- union?: boolean;
103
- optional?: boolean;
98
+ value: string | number | boolean | null | NangoModelField[];
99
+ dynamic?: boolean | undefined;
100
+ tsType?: boolean | undefined;
101
+ model?: boolean | undefined;
102
+ array?: boolean | undefined;
103
+ union?: boolean | undefined;
104
+ optional?: boolean | undefined;
104
105
  }
105
106
  export type NangoSyncEndpoint = {
106
107
  [key in HTTP_VERB]?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.40.6",
3
+ "version": "0.40.8",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -12,7 +12,9 @@
12
12
  "directory": "packages/utils"
13
13
  },
14
14
  "devDependencies": {
15
+ "@types/json-schema": "7.0.15",
15
16
  "axios": "^1.3.4",
17
+ "json-schema": "0.4.0",
16
18
  "type-fest": "4.14.0"
17
19
  },
18
20
  "license": "SEE LICENSE IN LICENSE FILE IN GIT REPOSITORY",