@nangohq/types 0.40.6 → 0.40.7
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/auth/api.d.ts +8 -0
- package/dist/auth/http.api.d.ts +19 -0
- package/dist/connection/db.d.ts +2 -2
- package/dist/deploy/api.d.ts +3 -0
- package/dist/deploy/incomingFlow.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/integration/template.d.ts +1 -0
- package/dist/nangoYaml/index.d.ts +9 -8
- package/package.json +3 -1
package/dist/auth/api.d.ts
CHANGED
|
@@ -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,13 @@ 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: string;
|
|
101
|
+
secret: string;
|
|
102
|
+
oauth_client_id: string;
|
|
103
|
+
oauth_client_secret: string;
|
|
104
|
+
}
|
|
97
105
|
export type UnauthCredentials = Record<string, never>;
|
|
98
106
|
export type RefreshTokenResponse = AuthorizationTokenResponse;
|
|
99
107
|
export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'type' | 'raw'> {
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
9
|
+
QueryParams: {
|
|
10
|
+
connectionId: string;
|
|
11
|
+
connectionConfig: ConnectionConfig;
|
|
12
|
+
};
|
|
13
|
+
Params: {
|
|
14
|
+
providerConfigKey: string;
|
|
15
|
+
};
|
|
16
|
+
Path: '/auth/tba';
|
|
17
|
+
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'invalid_auth_mode'> | ApiError<'missing_token_url'> | ApiError<'no_data_returned_from_token_request'> | ApiError<'missing_connection_config_param'>;
|
|
18
|
+
Success: never;
|
|
19
|
+
}>;
|
package/dist/connection/db.d.ts
CHANGED
|
@@ -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;
|
package/dist/deploy/api.d.ts
CHANGED
|
@@ -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';
|
|
@@ -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 |
|
|
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.
|
|
3
|
+
"version": "0.40.7",
|
|
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",
|