@nangohq/types 0.57.1 → 0.57.3
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/connect/api.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ export interface ConnectSessionInput {
|
|
|
3
3
|
allowed_integrations?: string[] | undefined;
|
|
4
4
|
integrations_config_defaults?: Record<string, {
|
|
5
5
|
user_scopes?: string | undefined;
|
|
6
|
-
|
|
6
|
+
authorization_params?: Record<string, string> | undefined;
|
|
7
|
+
connection_config?: {
|
|
7
8
|
[key: string]: unknown;
|
|
8
9
|
oauth_scopes_override?: string | undefined;
|
|
9
|
-
};
|
|
10
|
+
} | undefined;
|
|
10
11
|
}> | undefined;
|
|
11
12
|
end_user: {
|
|
12
13
|
id: string;
|
|
@@ -65,7 +66,7 @@ export type PostInternalConnectSessions = Endpoint<{
|
|
|
65
66
|
Method: 'POST';
|
|
66
67
|
Path: '/api/v1/connect/sessions';
|
|
67
68
|
Success: PostConnectSessions['Success'];
|
|
68
|
-
Body: Pick<ConnectSessionInput, 'allowed_integrations' | 'end_user' | 'organization'>;
|
|
69
|
+
Body: Pick<ConnectSessionInput, 'allowed_integrations' | 'end_user' | 'organization' | 'integrations_config_defaults'>;
|
|
69
70
|
}>;
|
|
70
71
|
export type PostPublicConnectTelemetry = Endpoint<{
|
|
71
72
|
Method: 'POST';
|
|
@@ -6,14 +6,16 @@ export interface ConnectSession {
|
|
|
6
6
|
readonly connectionId: number | null;
|
|
7
7
|
readonly operationId: string | null;
|
|
8
8
|
readonly allowedIntegrations: string[] | null;
|
|
9
|
-
readonly integrationsConfigDefaults: Record<string,
|
|
10
|
-
/** Only used by Slack */
|
|
11
|
-
user_scopes?: string | undefined;
|
|
12
|
-
connectionConfig: {
|
|
13
|
-
[key: string]: unknown;
|
|
14
|
-
oauth_scopes_override?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
}> | null;
|
|
9
|
+
readonly integrationsConfigDefaults: Record<string, ConnectSessionIntegrationConfigDefaults> | null;
|
|
17
10
|
readonly createdAt: Date;
|
|
18
11
|
readonly updatedAt: Date | null;
|
|
19
12
|
}
|
|
13
|
+
export interface ConnectSessionIntegrationConfigDefaults {
|
|
14
|
+
/** Only used by Slack */
|
|
15
|
+
user_scopes?: string | undefined;
|
|
16
|
+
authorization_params?: Record<string, string> | undefined;
|
|
17
|
+
connectionConfig?: {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
oauth_scopes_override?: string | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
}
|
package/dist/connection/db.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import type { TimestampsAndDeletedCorrect } from '../db.js';
|
|
|
2
2
|
import type { AuthModeType, AuthOperationType, AllAuthCredentials } from '../auth/api.js';
|
|
3
3
|
import type { DBEnvironment } from '../environment/db.js';
|
|
4
4
|
import type { DBTeam } from '../team/db.js';
|
|
5
|
-
import type { Merge } from 'type-fest';
|
|
5
|
+
import type { Merge, Simplify } from 'type-fest';
|
|
6
6
|
import type { EndUser } from '../endUser/index.js';
|
|
7
|
+
import type { ReplaceInObject } from '../utils.js';
|
|
7
8
|
export type Metadata = Record<string, unknown>;
|
|
8
9
|
export type ConnectionConfig = Record<string, any>;
|
|
9
10
|
export interface DBConnection extends TimestampsAndDeletedCorrect {
|
|
@@ -24,7 +25,13 @@ export interface DBConnection extends TimestampsAndDeletedCorrect {
|
|
|
24
25
|
credentials_iv: string | null;
|
|
25
26
|
credentials_tag: string | null;
|
|
26
27
|
last_fetched_at: Date | null;
|
|
28
|
+
credentials_expires_at: Date | null;
|
|
29
|
+
last_refresh_failure: Date | null;
|
|
30
|
+
last_refresh_success: Date | null;
|
|
31
|
+
refresh_attempts: number | null;
|
|
32
|
+
refresh_exhausted: boolean;
|
|
27
33
|
}
|
|
34
|
+
export type DBConnectionAsJSONRow = Simplify<ReplaceInObject<DBConnection, Date, string>>;
|
|
28
35
|
export type DBConnectionDecrypted = Merge<DBConnection, {
|
|
29
36
|
credentials: AllAuthCredentials;
|
|
30
37
|
}>;
|
|
@@ -105,6 +105,7 @@ export interface ProviderOAuth1 extends BaseProvider {
|
|
|
105
105
|
signature_method: 'HMAC-SHA1' | 'RSA-SHA1' | 'PLAINTEXT';
|
|
106
106
|
}
|
|
107
107
|
export interface ProviderJwt extends BaseProvider {
|
|
108
|
+
auth_mode: 'JWT';
|
|
108
109
|
token: {
|
|
109
110
|
expires_in_ms: number;
|
|
110
111
|
headers: {
|
|
@@ -116,6 +117,7 @@ export interface ProviderJwt extends BaseProvider {
|
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
|
|
120
|
+
auth_mode: 'TWO_STEP';
|
|
119
121
|
token_headers?: Record<string, string>;
|
|
120
122
|
token_response: {
|
|
121
123
|
token: string;
|
|
@@ -133,6 +135,7 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
|
|
|
133
135
|
body_format?: 'xml' | 'json' | 'form';
|
|
134
136
|
}
|
|
135
137
|
export interface ProviderSignature extends BaseProvider {
|
|
138
|
+
auth_mode: 'SIGNATURE';
|
|
136
139
|
signature: {
|
|
137
140
|
protocol: 'WSSE';
|
|
138
141
|
};
|
|
@@ -140,6 +143,9 @@ export interface ProviderSignature extends BaseProvider {
|
|
|
140
143
|
expires_in_ms: number;
|
|
141
144
|
};
|
|
142
145
|
}
|
|
143
|
-
export
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
export interface ProviderApiKey extends BaseProvider {
|
|
147
|
+
auth_mode: 'API_KEY';
|
|
148
|
+
}
|
|
149
|
+
export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt | ProviderTwoStep | ProviderSignature | ProviderApiKey;
|
|
150
|
+
export type RefreshableProvider = ProviderTwoStep | ProviderJwt | ProviderSignature | ProviderOAuth2;
|
|
151
|
+
export type TestableProvider = ProviderApiKey;
|
package/dist/utils.d.ts
CHANGED
|
@@ -18,4 +18,7 @@ export type Jsonable = string | number | boolean | null | undefined | readonly J
|
|
|
18
18
|
} | {
|
|
19
19
|
toJSON(): Jsonable;
|
|
20
20
|
};
|
|
21
|
+
export type ReplaceInObject<T, From, To> = {
|
|
22
|
+
[K in keyof T]: T[K] extends infer U ? (U extends From ? Exclude<U, From> | To : U) : never;
|
|
23
|
+
};
|
|
21
24
|
export {};
|