@nangohq/types 0.41.0 → 0.42.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.
- package/dist/account/api.d.ts +23 -0
- package/dist/api.d.ts +4 -0
- package/dist/api.endpoints.d.ts +4 -1
- package/dist/connection/db.d.ts +4 -4
- package/dist/db.d.ts +2 -2
- package/dist/deploy/api.d.ts +1 -0
- package/dist/deploy/incomingFlow.d.ts +7 -0
- package/dist/environment/db.d.ts +3 -3
- package/dist/flow/http.api.d.ts +11 -0
- package/dist/index.d.ts +5 -1
- package/dist/integration/template.d.ts +1 -1
- package/dist/invitations/api.d.ts +31 -0
- package/dist/invitations/db.d.ts +11 -0
- package/dist/nangoYaml/index.d.ts +5 -0
- package/dist/team/api.d.ts +51 -0
- package/dist/team/db.d.ts +7 -0
- package/dist/user/api.d.ts +17 -0
- package/package.json +1 -1
- package/dist/account/db.d.ts +0 -10
package/dist/account/api.d.ts
CHANGED
|
@@ -98,3 +98,26 @@ export type Signin = Endpoint<{
|
|
|
98
98
|
user: WebUser;
|
|
99
99
|
};
|
|
100
100
|
}>;
|
|
101
|
+
export type PostForgotPassword = Endpoint<{
|
|
102
|
+
Method: 'PUT';
|
|
103
|
+
Path: '/api/v1/account/forgot-password';
|
|
104
|
+
Body: {
|
|
105
|
+
email: string;
|
|
106
|
+
};
|
|
107
|
+
Error: ApiError<'user_not_found'>;
|
|
108
|
+
Success: {
|
|
109
|
+
success: true;
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
112
|
+
export type PutResetPassword = Endpoint<{
|
|
113
|
+
Method: 'PUT';
|
|
114
|
+
Path: '/api/v1/account/reset-password';
|
|
115
|
+
Body: {
|
|
116
|
+
token: string;
|
|
117
|
+
password: string;
|
|
118
|
+
};
|
|
119
|
+
Error: ApiError<'user_not_found'> | ApiError<'invalid_token'>;
|
|
120
|
+
Success: {
|
|
121
|
+
success: true;
|
|
122
|
+
};
|
|
123
|
+
}>;
|
package/dist/api.d.ts
CHANGED
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ import type { GetOperation, SearchFilters, SearchMessages, SearchOperations } fr
|
|
|
3
3
|
import type { GetOnboardingStatus } from './onboarding/api';
|
|
4
4
|
import type { SetMetadata, UpdateMetadata } from './connection/api/metadata';
|
|
5
5
|
import type { PostDeploy, PostDeployConfirmation } from './deploy/api';
|
|
6
|
-
|
|
6
|
+
import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
|
|
7
|
+
import type { PostForgotPassword, PutResetPassword, Signin, Signup } from './account/api';
|
|
8
|
+
import type { DeleteInvite, PostInvite } from './invitations/api';
|
|
9
|
+
export type APIEndpoints = Signup | Signin | GetTeam | PutTeam | PostInvite | DeleteInvite | DeleteTeamUser | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation;
|
|
7
10
|
/**
|
|
8
11
|
* Automatically narrow endpoints type with Method + Path
|
|
9
12
|
*/
|
package/dist/connection/db.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TimestampsAndDeleted } from '../db.js';
|
|
2
2
|
import type { ApiKeyCredentials, BasicApiCredentials, AuthModeType, AuthOperationType, AllAuthCredentials } from '../auth/api.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { DBEnvironment } from '../environment/db.js';
|
|
4
|
+
import type { DBTeam } from '../team/db.js';
|
|
5
5
|
export type Metadata = Record<string, unknown>;
|
|
6
6
|
export type ConnectionConfig = Record<string, any>;
|
|
7
7
|
export interface BaseConnection extends TimestampsAndDeleted {
|
|
@@ -26,8 +26,8 @@ export type RecentlyCreatedConnection = Pick<StoredConnection, 'id' | 'connectio
|
|
|
26
26
|
auth_mode: AuthModeType;
|
|
27
27
|
error?: string;
|
|
28
28
|
operation: AuthOperationType;
|
|
29
|
-
environment:
|
|
30
|
-
account:
|
|
29
|
+
environment: DBEnvironment;
|
|
30
|
+
account: DBTeam;
|
|
31
31
|
};
|
|
32
32
|
export interface ApiConnection {
|
|
33
33
|
id?: number;
|
package/dist/db.d.ts
CHANGED
package/dist/deploy/api.d.ts
CHANGED
|
@@ -52,4 +52,11 @@ export interface IncomingFlowConfig extends InternalIncomingPreBuiltFlowConfig {
|
|
|
52
52
|
sync_type?: SyncTypeLiteral | undefined;
|
|
53
53
|
webhookSubscriptions?: string[] | undefined;
|
|
54
54
|
}
|
|
55
|
+
export interface IncomingFlowConfigUpgrade extends IncomingFlowConfig {
|
|
56
|
+
id: string;
|
|
57
|
+
upgrade_version: string;
|
|
58
|
+
last_deployed: string;
|
|
59
|
+
is_public: true;
|
|
60
|
+
pre_built: true;
|
|
61
|
+
}
|
|
55
62
|
export {};
|
package/dist/environment/db.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Timestamps } from '../db';
|
|
2
|
-
export interface
|
|
2
|
+
export interface DBEnvironmentVariable extends Timestamps {
|
|
3
3
|
id?: number;
|
|
4
4
|
name: string;
|
|
5
5
|
value: string;
|
|
@@ -7,7 +7,7 @@ export interface EnvironmentVariable extends Timestamps {
|
|
|
7
7
|
value_iv?: string | null;
|
|
8
8
|
value_tag?: string | null;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface DBEnvironment extends Timestamps {
|
|
11
11
|
id: number;
|
|
12
12
|
uuid: string;
|
|
13
13
|
name: string;
|
|
@@ -28,7 +28,7 @@ export interface Environment extends Timestamps {
|
|
|
28
28
|
hmac_digest?: string | null;
|
|
29
29
|
secret_key_rotatable?: boolean;
|
|
30
30
|
public_key_rotatable?: boolean;
|
|
31
|
-
pending_secret_key
|
|
31
|
+
pending_secret_key: string | null;
|
|
32
32
|
pending_secret_key_iv?: string | null;
|
|
33
33
|
pending_secret_key_tag?: string | null;
|
|
34
34
|
pending_public_key?: string | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ApiError, Endpoint } from '../api';
|
|
2
|
+
import type { IncomingFlowConfigUpgrade } from '../deploy/incomingFlow';
|
|
3
|
+
export type UpgradePreBuiltFlow = Endpoint<{
|
|
4
|
+
Method: 'PUT';
|
|
5
|
+
Path: '/api/v1/flow/upgrade/pre-built';
|
|
6
|
+
Body: IncomingFlowConfigUpgrade;
|
|
7
|
+
Error: ApiError<'upgrade_failed'>;
|
|
8
|
+
Success: {
|
|
9
|
+
success: true;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,13 @@ export type * from './record/api.js';
|
|
|
7
7
|
export type * from './logs/api.js';
|
|
8
8
|
export type * from './logs/messages.js';
|
|
9
9
|
export type * from './account/api.js';
|
|
10
|
-
export type * from './account/db.js';
|
|
11
10
|
export type * from './user/api.js';
|
|
12
11
|
export type * from './connection/api/metadata.js';
|
|
13
12
|
export type * from './connection/db.js';
|
|
13
|
+
export type * from './invitations/api.js';
|
|
14
|
+
export type * from './invitations/db.js';
|
|
15
|
+
export type * from './team/api.js';
|
|
16
|
+
export type * from './team/db.js';
|
|
14
17
|
export type * from './proxy/api.js';
|
|
15
18
|
export type * from './environment/db.js';
|
|
16
19
|
export type * from './scripts/post-connection/db.js';
|
|
@@ -28,4 +31,5 @@ export type * from './nangoYaml/index.js';
|
|
|
28
31
|
export type * from './environment/db.js';
|
|
29
32
|
export type * from './environment/api/webhook.js';
|
|
30
33
|
export type * from './webhooks/api.js';
|
|
34
|
+
export type * from './flow/http.api.js';
|
|
31
35
|
export type * from './utils.js';
|
|
@@ -60,7 +60,7 @@ export interface TemplateOAuth2 extends Template {
|
|
|
60
60
|
authorization_method?: OAuthAuthorizationMethodType;
|
|
61
61
|
body_format?: OAuthBodyFormatType;
|
|
62
62
|
refresh_url?: string;
|
|
63
|
-
token_request_auth_method?: 'basic';
|
|
63
|
+
token_request_auth_method?: 'basic' | 'custom';
|
|
64
64
|
}
|
|
65
65
|
export interface TemplateOAuth1 extends Template {
|
|
66
66
|
auth_mode: 'OAUTH1';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Endpoint } from '../api';
|
|
2
|
+
export type PostInvite = Endpoint<{
|
|
3
|
+
Method: 'POST';
|
|
4
|
+
Path: '/api/v1/invite';
|
|
5
|
+
Querystring: {
|
|
6
|
+
env: string;
|
|
7
|
+
};
|
|
8
|
+
Body: {
|
|
9
|
+
emails: string[];
|
|
10
|
+
};
|
|
11
|
+
Success: {
|
|
12
|
+
data: {
|
|
13
|
+
invited: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export type DeleteInvite = Endpoint<{
|
|
18
|
+
Method: 'DELETE';
|
|
19
|
+
Path: '/api/v1/invite';
|
|
20
|
+
Querystring: {
|
|
21
|
+
env: string;
|
|
22
|
+
};
|
|
23
|
+
Body: {
|
|
24
|
+
email: string;
|
|
25
|
+
};
|
|
26
|
+
Success: {
|
|
27
|
+
data: {
|
|
28
|
+
success: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
@@ -13,6 +13,7 @@ export interface NangoYamlV1Integration {
|
|
|
13
13
|
runs?: string;
|
|
14
14
|
track_deletes?: boolean;
|
|
15
15
|
auto_start?: boolean;
|
|
16
|
+
version?: string;
|
|
16
17
|
}
|
|
17
18
|
export interface NangoYamlV2 {
|
|
18
19
|
integrations: Record<string, NangoYamlV2Integration>;
|
|
@@ -35,6 +36,7 @@ export interface NangoYamlV2IntegrationSync {
|
|
|
35
36
|
scopes?: string | string[];
|
|
36
37
|
input?: string;
|
|
37
38
|
'webhook-subscriptions'?: string | string[];
|
|
39
|
+
version?: string;
|
|
38
40
|
}
|
|
39
41
|
export interface NangoYamlV2IntegrationAction {
|
|
40
42
|
endpoint: string;
|
|
@@ -42,6 +44,7 @@ export interface NangoYamlV2IntegrationAction {
|
|
|
42
44
|
description?: string;
|
|
43
45
|
scopes?: string | string[];
|
|
44
46
|
input?: string;
|
|
47
|
+
version?: string;
|
|
45
48
|
}
|
|
46
49
|
export interface NangoYamlModel {
|
|
47
50
|
[key: string]: NangoYamlModelFields;
|
|
@@ -76,6 +79,7 @@ export interface ParsedNangoSync {
|
|
|
76
79
|
output: string[] | null;
|
|
77
80
|
usedModels: string[];
|
|
78
81
|
webhookSubscriptions: string[];
|
|
82
|
+
version: string;
|
|
79
83
|
}
|
|
80
84
|
export interface ParsedNangoAction {
|
|
81
85
|
name: string;
|
|
@@ -86,6 +90,7 @@ export interface ParsedNangoAction {
|
|
|
86
90
|
endpoint: NangoSyncEndpoint | null;
|
|
87
91
|
scopes: string[];
|
|
88
92
|
usedModels: string[];
|
|
93
|
+
version: string;
|
|
89
94
|
}
|
|
90
95
|
export type LayoutMode = 'root' | 'nested';
|
|
91
96
|
export interface NangoModel {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Merge } from 'type-fest';
|
|
2
|
+
import type { ApiError, ApiTimestamps, Endpoint } from '../api';
|
|
3
|
+
import type { DBInvitation } from '../invitations/db';
|
|
4
|
+
import type { WebUser } from '../user/api';
|
|
5
|
+
import type { DBTeam } from './db';
|
|
6
|
+
export type GetTeam = Endpoint<{
|
|
7
|
+
Method: 'GET';
|
|
8
|
+
Path: '/api/v1/team';
|
|
9
|
+
Querystring: {
|
|
10
|
+
env: string;
|
|
11
|
+
};
|
|
12
|
+
Success: {
|
|
13
|
+
data: {
|
|
14
|
+
account: ApiTeam;
|
|
15
|
+
users: WebUser[];
|
|
16
|
+
invitedUsers: ApiInvitation[];
|
|
17
|
+
isAdminTeam: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
export type ApiInvitation = Merge<Omit<DBInvitation, 'token'>, ApiTimestamps>;
|
|
22
|
+
export type ApiTeam = Merge<DBTeam, ApiTimestamps>;
|
|
23
|
+
export type PutTeam = Endpoint<{
|
|
24
|
+
Method: 'PUT';
|
|
25
|
+
Path: '/api/v1/team';
|
|
26
|
+
Querystring: {
|
|
27
|
+
env: string;
|
|
28
|
+
};
|
|
29
|
+
Body: {
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
Success: {
|
|
33
|
+
data: DBTeam;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
export type DeleteTeamUser = Endpoint<{
|
|
37
|
+
Method: 'DELETE';
|
|
38
|
+
Path: '/api/v1/team/users/:id';
|
|
39
|
+
Querystring: {
|
|
40
|
+
env: string;
|
|
41
|
+
};
|
|
42
|
+
Params: {
|
|
43
|
+
id: number;
|
|
44
|
+
};
|
|
45
|
+
Error: ApiError<'user_not_found'>;
|
|
46
|
+
Success: {
|
|
47
|
+
data: {
|
|
48
|
+
success: true;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}>;
|
package/dist/user/api.d.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
|
+
import type { Timestamps } from '../db';
|
|
1
2
|
export interface WebUser {
|
|
2
3
|
id: number;
|
|
3
4
|
accountId: number;
|
|
4
5
|
email: string;
|
|
5
6
|
name: string;
|
|
6
7
|
}
|
|
8
|
+
export interface DBUser extends Timestamps {
|
|
9
|
+
id: number;
|
|
10
|
+
email: string;
|
|
11
|
+
name: string;
|
|
12
|
+
hashed_password: string;
|
|
13
|
+
salt: string;
|
|
14
|
+
account_id: number;
|
|
15
|
+
reset_password_token: string | undefined;
|
|
16
|
+
suspended: boolean;
|
|
17
|
+
suspended_at: Date;
|
|
18
|
+
currentUser?: boolean;
|
|
19
|
+
email_verified: boolean;
|
|
20
|
+
email_verification_token: string | null;
|
|
21
|
+
email_verification_token_expires_at: Date | null;
|
|
22
|
+
uuid: string;
|
|
23
|
+
}
|
package/package.json
CHANGED