@nangohq/types 0.45.0 → 0.45.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.
@@ -9,6 +9,7 @@ export type ConnectionQueryString = {
9
9
  } | {
10
10
  connect_session_token: string;
11
11
  });
12
+ type AuthErrors = ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'> | ApiError<'integration_not_allowed'>;
12
13
  export type PostPublicTbaAuthorization = Endpoint<{
13
14
  Method: 'POST';
14
15
  Body: {
@@ -22,7 +23,7 @@ export type PostPublicTbaAuthorization = Endpoint<{
22
23
  providerConfigKey: string;
23
24
  };
24
25
  Path: '/auth/tba/:providerConfigKey';
25
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
26
+ Error: AuthErrors;
26
27
  Success: {
27
28
  providerConfigKey: string;
28
29
  connectionId: string;
@@ -40,7 +41,7 @@ export type PostPublicTableauAuthorization = Endpoint<{
40
41
  providerConfigKey: string;
41
42
  };
42
43
  Path: '/auth/tableau/:providerConfigKey';
43
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
44
+ Error: AuthErrors;
44
45
  Success: {
45
46
  providerConfigKey: string;
46
47
  connectionId: string;
@@ -61,7 +62,7 @@ export type PostPublicJwtAuthorization = Endpoint<{
61
62
  providerConfigKey: string;
62
63
  };
63
64
  Path: '/auth/jwt/:providerConfigKey';
64
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
65
+ Error: AuthErrors;
65
66
  Success: {
66
67
  providerConfigKey: string;
67
68
  connectionId: string;
@@ -74,7 +75,7 @@ export type PostPublicUnauthenticatedAuthorization = Endpoint<{
74
75
  providerConfigKey: string;
75
76
  };
76
77
  Path: '/auth/unauthenticated/:providerConfigKey';
77
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
78
+ Error: AuthErrors;
78
79
  Success: {
79
80
  providerConfigKey: string;
80
81
  connectionId: string;
@@ -93,7 +94,7 @@ export type PostPublicBillAuthorization = Endpoint<{
93
94
  providerConfigKey: string;
94
95
  };
95
96
  Path: '/auth/bill/:providerConfigKey';
96
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
97
+ Error: AuthErrors;
97
98
  Success: {
98
99
  providerConfigKey: string;
99
100
  connectionId: string;
@@ -107,7 +108,7 @@ export type PostPublicTwoStepAuthorization = Endpoint<{
107
108
  providerConfigKey: string;
108
109
  };
109
110
  Path: '/auth/two-step/:providerConfigKey';
110
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
111
+ Error: AuthErrors;
111
112
  Success: {
112
113
  providerConfigKey: string;
113
114
  connectionId: string;
@@ -124,9 +125,10 @@ export type PostPublicSignatureAuthorization = Endpoint<{
124
125
  providerConfigKey: string;
125
126
  };
126
127
  Path: '/auth/signature-based/:providerConfigKey';
127
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
128
+ Error: AuthErrors;
128
129
  Success: {
129
130
  providerConfigKey: string;
130
131
  connectionId: string;
131
132
  };
132
133
  }>;
134
+ export {};
@@ -64,7 +64,7 @@ export type PostIntegration = Endpoint<{
64
64
  data: ApiIntegration;
65
65
  };
66
66
  }>;
67
- export type ApiIntegration = Merge<IntegrationConfig, ApiTimestamps>;
67
+ export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
68
68
  export type GetIntegration = Endpoint<{
69
69
  Method: 'GET';
70
70
  Path: '/api/v1/integrations/:providerConfigKey';
@@ -1,14 +1,15 @@
1
1
  import type { TimestampsAndDeleted } from '../db.js';
2
2
  export interface IntegrationConfig extends TimestampsAndDeleted {
3
- id?: number;
3
+ id?: number | undefined;
4
4
  unique_key: string;
5
5
  provider: string;
6
6
  oauth_client_id: string;
7
7
  oauth_client_secret: string;
8
- oauth_scopes?: string;
8
+ oauth_scopes?: string | undefined;
9
9
  environment_id: number;
10
10
  oauth_client_secret_iv?: string | null;
11
11
  oauth_client_secret_tag?: string | null;
12
- app_link?: string | null;
13
- custom?: Record<string, string>;
12
+ app_link?: string | null | undefined;
13
+ custom?: Record<string, string> | undefined;
14
+ missing_fields: string[];
14
15
  }
@@ -37,6 +37,10 @@ export interface OperationAction {
37
37
  type: 'action';
38
38
  action: 'run';
39
39
  }
40
+ export interface OperationOnEvents {
41
+ type: 'events';
42
+ action: 'post_connection_creation' | 'pre_connection_deletion';
43
+ }
40
44
  export interface OperationAuth {
41
45
  type: 'auth';
42
46
  action: 'create_connection' | 'refresh_token' | 'post_connection' | 'connection_test';
@@ -53,7 +57,7 @@ export interface OperationDeploy {
53
57
  type: 'deploy';
54
58
  action: 'prebuilt' | 'custom';
55
59
  }
56
- export type OperationList = OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationDeploy | OperationAuth | OperationAdmin;
60
+ export type OperationList = OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationOnEvents | OperationDeploy | OperationAuth | OperationAdmin;
57
61
  /**
58
62
  * Full schema
59
63
  */
@@ -55,13 +55,13 @@ export interface BaseProvider {
55
55
  };
56
56
  };
57
57
  authorization_url?: string;
58
- authorization_url_encode?: boolean;
58
+ authorization_url_skip_encode?: string[];
59
59
  access_token_url?: string;
60
60
  authorization_params?: Record<string, string>;
61
61
  scope_separator?: string;
62
62
  default_scopes?: string[];
63
63
  token_url?: string | TokenUrlObject;
64
- token_url_encode?: boolean;
64
+ token_url_skip_encode?: string[];
65
65
  token_params?: Record<string, string>;
66
66
  authorization_url_replacements?: Record<string, string>;
67
67
  redirect_uri_metadata?: string[];
@@ -39,6 +39,13 @@ export interface NangoAuthWebhookBodyBase extends NangoWebhookBase {
39
39
  provider: string;
40
40
  environment: string;
41
41
  operation: AuthOperationType;
42
+ /**
43
+ * Only presents if the connection happened with a session token
44
+ */
45
+ endUser?: {
46
+ endUserId: string;
47
+ organizationId?: string | undefined;
48
+ } | undefined;
42
49
  }
43
50
  export interface NangoAuthWebhookBodySuccess extends NangoAuthWebhookBodyBase {
44
51
  success: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.45.0",
3
+ "version": "0.45.1",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",