@nangohq/types 0.39.33 → 0.40.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
@@ -57,3 +57,7 @@ export interface Endpoint<T extends EndpointDefinition> {
57
57
  */
58
58
  Reply: ResDefaultErrors | (T['Error'] extends ApiError<any> ? T['Error'] | T['Success'] : T['Success']);
59
59
  }
60
+ export interface ErrorPayload {
61
+ type: string;
62
+ description: string;
63
+ }
@@ -1,4 +1,3 @@
1
- import type { Template } from '../integration/template.js';
2
1
  import type { BaseConnection } from '../connection/db.js';
3
2
  export interface AuthModes {
4
3
  OAuth1: 'OAUTH1';
@@ -15,6 +14,7 @@ export type AuthModeType = AuthModes[keyof AuthModes];
15
14
  export interface AuthOperation {
16
15
  CREATION: 'creation';
17
16
  OVERRIDE: 'override';
17
+ REFRESH: 'refresh';
18
18
  UNKNOWN: 'unknown';
19
19
  }
20
20
  export type AuthOperationType = AuthOperation[keyof AuthOperation];
@@ -22,6 +22,8 @@ export interface OAuthAuthorizationMethod {
22
22
  BODY: 'body';
23
23
  HEADER: 'header';
24
24
  }
25
+ export type OAuthAuthorizationMethodType = OAuthAuthorizationMethod[keyof OAuthAuthorizationMethod];
26
+ export type OAuthBodyFormatType = OAuthBodyFormat[keyof OAuthBodyFormat];
25
27
  export interface OAuthBodyFormat {
26
28
  FORM: 'form';
27
29
  JSON: 'json';
@@ -30,28 +32,6 @@ export interface ConnectionUpsertResponse {
30
32
  id: number;
31
33
  operation: AuthOperation;
32
34
  }
33
- export interface TemplateOAuth2 extends Template {
34
- auth_mode: AuthModes['OAuth2'] | AuthModes['Custom'];
35
- disable_pkce?: boolean;
36
- token_params?: {
37
- grant_type?: 'authorization_code' | 'client_credentials';
38
- };
39
- refresh_params?: {
40
- grant_type: 'refresh_token';
41
- };
42
- authorization_method?: OAuthAuthorizationMethod;
43
- body_format?: OAuthBodyFormat;
44
- refresh_url?: string;
45
- token_request_auth_method?: 'basic';
46
- }
47
- export interface TemplateOAuth1 extends Template {
48
- auth_mode: AuthModes['OAuth1'];
49
- request_url: string;
50
- request_params?: Record<string, string>;
51
- request_http_method?: 'GET' | 'PUT' | 'POST';
52
- token_http_method?: 'GET' | 'PUT' | 'POST';
53
- signature_method: 'HMAC-SHA1' | 'RSA-SHA1' | 'PLAINTEXT';
54
- }
55
35
  export interface OAuth1RequestTokenResult {
56
36
  request_token: string;
57
37
  request_token_secret: string;
package/dist/index.d.ts CHANGED
@@ -7,13 +7,17 @@ export type * from './record/api.js';
7
7
  export type * from './logs/api.js';
8
8
  export type * from './logs/messages.js';
9
9
  export type * from './account/api.js';
10
+ export type * from './account/db.js';
10
11
  export type * from './user/api.js';
11
12
  export type * from './connection/api/metadata.js';
12
13
  export type * from './connection/db.js';
13
14
  export type * from './environment/db.js';
14
15
  export type * from './scripts/post-connection/api.js';
15
16
  export type * from './scripts/post-connection/db.js';
17
+ export type * from './scripts/syncs/api.js';
16
18
  export type * from './notification/active-logs/db.js';
17
19
  export type * from './connection/api/get.js';
18
20
  export type * from './integration/db.js';
19
21
  export type * from './integration/template.js';
22
+ export type * from './auth/api.js';
23
+ export type * from './auth/db.js';
@@ -1,16 +1,16 @@
1
1
  import type { RetryHeaderConfig, CursorPagination, LinkPagination, OffsetPagination } from '../proxy/api.js';
2
- import type { AuthModeType } from '../auth/api.js';
2
+ import type { AuthModeType, OAuthAuthorizationMethodType, OAuthBodyFormatType } from '../auth/api.js';
3
3
  import type { EndpointMethod } from '../api.js';
4
4
  export interface TokenUrlObject {
5
- OAuth1?: string;
6
- OAuth2?: string;
7
- OAuth2CC?: string;
8
- Basic?: string;
9
- ApiKey?: string;
10
- AppStore?: string;
11
- Custom?: string;
12
- App?: string;
13
- None?: string;
5
+ OAUTH1?: string;
6
+ OAUTH2?: string;
7
+ OAUTH2CC?: string;
8
+ BASIC?: string;
9
+ API_KEY?: string;
10
+ APP_STORE?: string;
11
+ CUSTOM?: string;
12
+ APP?: string;
13
+ NONE?: string;
14
14
  }
15
15
  export interface Template {
16
16
  auth_mode: AuthModeType;
@@ -47,3 +47,25 @@ export interface Template {
47
47
  categories?: string[];
48
48
  connection_configuration?: string[];
49
49
  }
50
+ export interface TemplateOAuth2 extends Template {
51
+ auth_mode: 'OAUTH2' | 'CUSTOM';
52
+ disable_pkce?: boolean;
53
+ token_params?: {
54
+ grant_type?: 'authorization_code' | 'client_credentials';
55
+ };
56
+ refresh_params?: {
57
+ grant_type: 'refresh_token';
58
+ };
59
+ authorization_method?: OAuthAuthorizationMethodType;
60
+ body_format?: OAuthBodyFormatType;
61
+ refresh_url?: string;
62
+ token_request_auth_method?: 'basic';
63
+ }
64
+ export interface TemplateOAuth1 extends Template {
65
+ auth_mode: 'OAUTH1';
66
+ request_url: string;
67
+ request_params?: Record<string, string>;
68
+ request_http_method?: 'GET' | 'PUT' | 'POST';
69
+ token_http_method?: 'GET' | 'PUT' | 'POST';
70
+ signature_method: 'HMAC-SHA1' | 'RSA-SHA1' | 'PLAINTEXT';
71
+ }
@@ -34,9 +34,6 @@ export interface MessageOpProxy {
34
34
  export interface MessageOpAction {
35
35
  type: 'action';
36
36
  }
37
- export interface MessageOpPostConnectionScript {
38
- type: 'post-connection-script';
39
- }
40
37
  export interface MessageOpAuth {
41
38
  type: 'auth';
42
39
  action: 'create_connection' | 'refresh_token' | 'post_connection';
@@ -53,7 +50,7 @@ export interface MessageOpDeploy {
53
50
  type: 'deploy';
54
51
  action: 'prebuilt' | 'custom';
55
52
  }
56
- export type MessageOperation = MessageOpSync | MessageOpProxy | MessageOpAction | MessageOpPostConnectionScript | MessageOpWebhook | MessageOpDeploy | MessageOpAuth | MessageOpAdmin;
53
+ export type MessageOperation = MessageOpSync | MessageOpProxy | MessageOpAction | MessageOpWebhook | MessageOpDeploy | MessageOpAuth | MessageOpAdmin;
57
54
  /**
58
55
  * Full schema
59
56
  */
@@ -107,6 +104,7 @@ export type MessageRow = {
107
104
  updatedAt: string;
108
105
  startedAt: string | null;
109
106
  endedAt: string | null;
107
+ expiresAt: string | null;
110
108
  } & {
111
109
  operation: MessageOperation | null;
112
110
  };
@@ -0,0 +1,6 @@
1
+ export interface SyncResult {
2
+ added: number;
3
+ updated: number;
4
+ deleted: number;
5
+ }
6
+ export type SyncType = 'INCREMENTAL' | 'INITIAL';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.39.33",
3
+ "version": "0.40.0",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",