@nangohq/types 0.54.0 → 0.55.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.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<'invalid_content_type'> | ApiError<'not_found'> | ApiError<'conflict'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_headers', 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'>;
14
+ export type ResDefaultErrors = ApiError<'invalid_content_type'> | ApiError<'not_found'> | ApiError<'conflict'> | ApiError<'forbidden'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_headers', 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/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export type * from './scripts/syncs/api.js';
27
27
  export type * from './slackNotifications/db.js';
28
28
  export type * from './notification/active-logs/db.js';
29
29
  export type * from './connection/api/get.js';
30
+ export type * from './sync/api.js';
30
31
  export type * from './integration/api.js';
31
32
  export type * from './integration/db.js';
32
33
  export type * from './providers/provider.js';
@@ -59,6 +59,7 @@ export interface BaseProvider {
59
59
  authorization_url_skip_encode?: string[];
60
60
  access_token_url?: string;
61
61
  authorization_params?: Record<string, string>;
62
+ authorization_code_param_in_callback?: string;
62
63
  scope_separator?: string;
63
64
  default_scopes?: string[];
64
65
  token_url?: string | TokenUrlObject;
@@ -1,4 +1,3 @@
1
- import type { BasicApiCredentials, ApiKeyCredentials, AppCredentials, TbaCredentials, TableauCredentials, JwtCredentials, TwoStepCredentials, SignatureCredentials } from '../auth/api.js';
2
1
  import type { DBConnectionDecrypted } from '../connection/db.js';
3
2
  import type { HTTP_METHOD } from '../nangoYaml/index.js';
4
3
  import type { Provider } from '../providers/provider.js';
@@ -15,13 +14,12 @@ export interface ProxyFile {
15
14
  }
16
15
  export interface BaseProxyConfiguration {
17
16
  providerConfigKey: string;
18
- connectionId: string;
19
17
  endpoint: string;
20
18
  retries?: number;
21
19
  data?: unknown;
22
20
  files?: ProxyFile[];
23
21
  headers?: Record<string, string>;
24
- params?: string | Record<string, string | number>;
22
+ params?: string | Record<string, string | number | string[] | number[]>;
25
23
  baseUrlOverride?: string;
26
24
  responseType?: ResponseType | undefined;
27
25
  retryHeader?: RetryHeaderConfig;
@@ -32,19 +30,16 @@ export interface UserProvidedProxyConfiguration extends BaseProxyConfiguration {
32
30
  method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'get' | 'post' | 'patch' | 'put' | 'delete';
33
31
  paginate?: Partial<CursorPagination> | Partial<LinkPagination> | Partial<OffsetPagination>;
34
32
  }
33
+ export type ConnectionForProxy = Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'credentials' | 'metadata'>;
35
34
  export interface ApplicationConstructedProxyConfiguration extends BaseProxyConfiguration {
36
- decompress?: boolean;
35
+ decompress: boolean;
37
36
  method: HTTP_METHOD;
38
37
  providerName: string;
39
- token: string | BasicApiCredentials | ApiKeyCredentials | AppCredentials | TbaCredentials | TableauCredentials | JwtCredentials | TwoStepCredentials | SignatureCredentials;
40
38
  provider: Provider;
41
- connection: Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'credentials' | 'metadata'>;
42
39
  }
43
40
  export type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
44
41
  export interface InternalProxyConfiguration {
45
42
  providerName: string;
46
- connection: Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'credentials' | 'metadata'>;
47
- existingActivityLogId?: string | null | undefined;
48
43
  }
49
44
  export interface RetryHeaderConfig {
50
45
  at?: string;
@@ -30,6 +30,7 @@ export type GetPublicRecords = Endpoint<{
30
30
  Error: ApiError<'unknown_connection'>;
31
31
  Querystring: {
32
32
  model: string;
33
+ variant?: string | undefined;
33
34
  delta?: string | undefined;
34
35
  modified_after?: string | undefined;
35
36
  limit?: number | undefined;
@@ -0,0 +1,35 @@
1
+ import type { ApiError, Endpoint } from '../api.js';
2
+ export type PostSyncVariant = Endpoint<{
3
+ Method: 'POST';
4
+ Path: '/sync/:name/variant/:variant';
5
+ Body: {
6
+ provider_config_key: string;
7
+ connection_id: string;
8
+ };
9
+ Params: {
10
+ name: string;
11
+ variant: string;
12
+ };
13
+ Error: ApiError<'invalid_variant' | 'unknown_connection' | 'unknown_provider_config' | 'unknown_sync' | 'sync_variant_already_exists' | 'failed_sync_variant_creation'>;
14
+ Success: {
15
+ id: string;
16
+ name: string;
17
+ variant: string;
18
+ };
19
+ }>;
20
+ export type DeleteSyncVariant = Endpoint<{
21
+ Method: 'DELETE';
22
+ Path: '/sync/:name/variant/:variant';
23
+ Body: {
24
+ provider_config_key: string;
25
+ connection_id: string;
26
+ };
27
+ Params: {
28
+ name: string;
29
+ variant: string;
30
+ };
31
+ Error: ApiError<'invalid_variant' | 'unknown_connection' | 'failed_sync_variant_deletion'>;
32
+ Success: {
33
+ success: boolean;
34
+ };
35
+ }>;
@@ -12,6 +12,7 @@ export interface NangoSyncWebhookBodyBase extends NangoWebhookBase {
12
12
  connectionId: string;
13
13
  providerConfigKey: string;
14
14
  syncName: string;
15
+ syncVariant: string;
15
16
  model: string;
16
17
  syncType: 'INCREMENTAL' | 'INITIAL' | 'WEBHOOK';
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.54.0",
3
+ "version": "0.55.0",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",