@nangohq/types 0.46.0 → 0.46.1
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/api.d.ts +1 -1
- package/dist/connect/api.d.ts +7 -3
- package/dist/connect/session.d.ts +6 -1
- package/dist/integration/api.d.ts +8 -1
- package/dist/proxy/api.d.ts +2 -0
- package/dist/utils.d.ts +5 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ValidationError {
|
|
|
11
11
|
message: string;
|
|
12
12
|
path: (string | number)[];
|
|
13
13
|
}
|
|
14
|
-
export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'> | ApiError<'resource_capped'> | ApiError<'missing_auth_header'> | ApiError<'malformed_auth_header'> | ApiError<'unknown_account'> | ApiError<'unknown_connect_session_token'> | ApiError<'invalid_cli_version'> | ApiError<'invalid_permissions'>;
|
|
14
|
+
export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'> | ApiError<'resource_capped'> | ApiError<'missing_auth_header'> | ApiError<'malformed_auth_header'> | ApiError<'unknown_account'> | ApiError<'unknown_connect_session_token'> | ApiError<'invalid_cli_version'> | ApiError<'invalid_permissions'> | ApiError<'invalid_connect_session_token_format'>;
|
|
15
15
|
export type EndpointMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
16
16
|
/**
|
|
17
17
|
* API Request/Response type
|
package/dist/connect/api.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ import type { Endpoint } from '../api.js';
|
|
|
2
2
|
export interface ConnectSessionPayload {
|
|
3
3
|
allowed_integrations?: string[] | undefined;
|
|
4
4
|
integrations_config_defaults?: Record<string, {
|
|
5
|
-
|
|
5
|
+
user_scopes?: string | undefined;
|
|
6
|
+
connection_config: {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
oauth_scopes_override?: string | undefined;
|
|
9
|
+
};
|
|
6
10
|
}> | undefined;
|
|
7
11
|
end_user: {
|
|
8
12
|
id: string;
|
|
@@ -21,7 +25,7 @@ export type PostConnectSessions = Endpoint<{
|
|
|
21
25
|
Success: {
|
|
22
26
|
data: {
|
|
23
27
|
token: string;
|
|
24
|
-
expires_at:
|
|
28
|
+
expires_at: string;
|
|
25
29
|
};
|
|
26
30
|
};
|
|
27
31
|
}>;
|
|
@@ -41,5 +45,5 @@ export type PostInternalConnectSessions = Endpoint<{
|
|
|
41
45
|
Method: 'POST';
|
|
42
46
|
Path: '/api/v1/connect/sessions';
|
|
43
47
|
Success: PostConnectSessions['Success'];
|
|
44
|
-
Body: Pick<ConnectSessionPayload, 'allowed_integrations'>;
|
|
48
|
+
Body: Pick<ConnectSessionPayload, 'allowed_integrations' | 'end_user' | 'organization'>;
|
|
45
49
|
}>;
|
|
@@ -5,7 +5,12 @@ export interface ConnectSession {
|
|
|
5
5
|
readonly environmentId: number;
|
|
6
6
|
readonly allowedIntegrations?: string[] | null;
|
|
7
7
|
readonly integrationsConfigDefaults?: Record<string, {
|
|
8
|
-
|
|
8
|
+
/** Only used by Slack */
|
|
9
|
+
user_scopes?: string | undefined;
|
|
10
|
+
connectionConfig: {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
oauth_scopes_override?: string | undefined;
|
|
13
|
+
};
|
|
9
14
|
}> | null;
|
|
10
15
|
readonly createdAt: Date;
|
|
11
16
|
readonly updatedAt: Date | null;
|
|
@@ -65,6 +65,14 @@ export type DeletePublicIntegration = Endpoint<{
|
|
|
65
65
|
success: true;
|
|
66
66
|
};
|
|
67
67
|
}>;
|
|
68
|
+
export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
|
|
69
|
+
export type GetIntegrations = Endpoint<{
|
|
70
|
+
Method: 'GET';
|
|
71
|
+
Path: '/api/v1/integrations';
|
|
72
|
+
Success: {
|
|
73
|
+
data: ApiIntegration[];
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
68
76
|
export type PostIntegration = Endpoint<{
|
|
69
77
|
Method: 'POST';
|
|
70
78
|
Path: '/api/v1/integrations';
|
|
@@ -78,7 +86,6 @@ export type PostIntegration = Endpoint<{
|
|
|
78
86
|
data: ApiIntegration;
|
|
79
87
|
};
|
|
80
88
|
}>;
|
|
81
|
-
export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
|
|
82
89
|
export type GetIntegration = Endpoint<{
|
|
83
90
|
Method: 'GET';
|
|
84
91
|
Path: '/api/v1/integrations/:providerConfigKey';
|
package/dist/proxy/api.d.ts
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -13,4 +13,9 @@ export type PickFromUnion<T, U extends T> = ValidateSelection<T, U>;
|
|
|
13
13
|
export type NullablePartial<TBase, TNullableKey extends keyof TBase = {
|
|
14
14
|
[K in keyof TBase]: null extends TBase[K] ? K : never;
|
|
15
15
|
}[keyof TBase]> = Partial<Pick<TBase, TNullableKey>> & Pick<TBase, Exclude<keyof TBase, TNullableKey>>;
|
|
16
|
+
export type Jsonable = string | number | boolean | null | undefined | readonly Jsonable[] | {
|
|
17
|
+
readonly [key: string]: Jsonable;
|
|
18
|
+
} | {
|
|
19
|
+
toJSON(): Jsonable;
|
|
20
|
+
};
|
|
16
21
|
export {};
|