@nangohq/types 0.66.2 → 0.67.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/api.endpoints.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { PostImpersonate } from './admin/http.api.js';
|
|
|
4
4
|
import type { EndpointMethod } from './api.js';
|
|
5
5
|
import type { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
|
|
6
6
|
import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api.js';
|
|
7
|
-
import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh } from './connection/api/get.js';
|
|
7
|
+
import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
|
|
8
8
|
import type { SetMetadata, UpdateMetadata } from './connection/api/metadata.js';
|
|
9
9
|
import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api.js';
|
|
10
10
|
import type { DeleteEnvironment, PatchEnvironment, PostEnvironment } from './environment/api/index.js';
|
|
@@ -26,7 +26,7 @@ import type { PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync
|
|
|
26
26
|
import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api.js';
|
|
27
27
|
import type { GetUser, PatchUser } from './user/api.js';
|
|
28
28
|
import type { PostPublicWebhook } from './webhooks/http.api.js';
|
|
29
|
-
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization;
|
|
29
|
+
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection;
|
|
30
30
|
export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PatchOnboarding | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted;
|
|
31
31
|
export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
|
|
32
32
|
/**
|
package/dist/auth/api.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DBConnection } from '../connection/db.js';
|
|
1
2
|
export interface AuthModes {
|
|
2
3
|
OAuth1: 'OAUTH1';
|
|
3
4
|
OAuth2: 'OAUTH2';
|
|
@@ -15,13 +16,7 @@ export interface AuthModes {
|
|
|
15
16
|
Signature: 'SIGNATURE';
|
|
16
17
|
}
|
|
17
18
|
export type AuthModeType = AuthModes[keyof AuthModes];
|
|
18
|
-
export
|
|
19
|
-
CREATION: 'creation';
|
|
20
|
-
OVERRIDE: 'override';
|
|
21
|
-
REFRESH: 'refresh';
|
|
22
|
-
UNKNOWN: 'unknown';
|
|
23
|
-
}
|
|
24
|
-
export type AuthOperationType = AuthOperation[keyof AuthOperation];
|
|
19
|
+
export type AuthOperationType = 'creation' | 'override' | 'refresh' | 'unknown';
|
|
25
20
|
export interface OAuthAuthorizationMethod {
|
|
26
21
|
BODY: 'body';
|
|
27
22
|
HEADER: 'header';
|
|
@@ -33,8 +28,8 @@ export interface OAuthBodyFormat {
|
|
|
33
28
|
JSON: 'json';
|
|
34
29
|
}
|
|
35
30
|
export interface ConnectionUpsertResponse {
|
|
36
|
-
|
|
37
|
-
operation:
|
|
31
|
+
connection: DBConnection;
|
|
32
|
+
operation: AuthOperationType;
|
|
38
33
|
}
|
|
39
34
|
export interface OAuth1RequestTokenResult {
|
|
40
35
|
request_token: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ApiError, ApiTimestamps, Endpoint } from '../../api.js';
|
|
2
|
-
import type { AllAuthCredentials } from '../../auth/api.js';
|
|
2
|
+
import type { AllAuthCredentials, ApiKeyCredentials, BasicApiCredentials, OAuth1Credentials, OAuth2ClientCredentials, OAuth2Credentials, TbaCredentials } from '../../auth/api.js';
|
|
3
3
|
import type { ApiEndUser } from '../../endUser/index.js';
|
|
4
4
|
import type { ActiveLog } from '../../notification/active-logs/db.js';
|
|
5
5
|
import type { ReplaceInObject } from '../../utils.js';
|
|
6
|
-
import type { DBConnection, DBConnectionDecrypted } from '../db.js';
|
|
6
|
+
import type { ConnectionConfig, DBConnection, DBConnectionDecrypted } from '../db.js';
|
|
7
7
|
import type { Merge } from 'type-fest';
|
|
8
8
|
export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id' | 'connection_id' | 'provider_config_key' | 'created_at' | 'updated_at'> & {
|
|
9
9
|
provider: string;
|
|
@@ -66,6 +66,24 @@ export type GetPublicConnections = Endpoint<{
|
|
|
66
66
|
connections: ApiPublicConnection[];
|
|
67
67
|
};
|
|
68
68
|
}>;
|
|
69
|
+
export type PostPublicConnection = Endpoint<{
|
|
70
|
+
Method: 'POST';
|
|
71
|
+
Path: '/connections';
|
|
72
|
+
Body: {
|
|
73
|
+
connection_id?: string | undefined;
|
|
74
|
+
provider_config_key: string;
|
|
75
|
+
metadata?: Record<string, unknown> | undefined;
|
|
76
|
+
connection_config?: ConnectionConfig | undefined;
|
|
77
|
+
credentials: OAuth2Credentials | OAuth2ClientCredentials | OAuth1Credentials | ApiKeyCredentials | BasicApiCredentials | TbaCredentials | {
|
|
78
|
+
type: 'APP';
|
|
79
|
+
app_id: string;
|
|
80
|
+
installation_id: string;
|
|
81
|
+
} | {
|
|
82
|
+
type: 'NONE';
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
Success: ApiPublicConnectionFull;
|
|
86
|
+
}>;
|
|
69
87
|
export type ApiConnectionFull = Omit<ReplaceInObject<DBConnectionDecrypted, Date, string>, 'credentials_iv' | 'end_user_id' | 'credentials_tag' | 'deleted' | 'deleted_at'>;
|
|
70
88
|
export type GetConnection = Endpoint<{
|
|
71
89
|
Method: 'GET';
|
package/dist/connection/db.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { Merge, Simplify } from 'type-fest';
|
|
|
8
8
|
export type Metadata = Record<string, unknown>;
|
|
9
9
|
export interface ConnectionConfig {
|
|
10
10
|
[key: string]: any;
|
|
11
|
+
oauth_scopes_override?: string[];
|
|
11
12
|
oauth_scopes?: string;
|
|
12
13
|
authorization_params?: Record<string, string>;
|
|
13
14
|
}
|