@nangohq/types 0.48.1 → 0.48.2

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<'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'>;
14
+ export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'conflict'> | 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
@@ -15,8 +15,9 @@ import type { DeletePublicConnection, GetConnection, GetConnections, GetConnecti
15
15
  import type { GetMeta } from './meta/api';
16
16
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
17
17
  import type { PostPublicWebhook } from './webhooks/http.api';
18
+ import type { PostEnvironment } from './environment/api';
18
19
  export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook;
19
- export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | 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;
20
+ export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | 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;
20
21
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
21
22
  /**
22
23
  * Automatically narrow endpoints type with Method + Path
@@ -46,6 +46,10 @@ export interface CredentialsCommon<T = Record<string, any>> {
46
46
  type: AuthModeType;
47
47
  raw: T;
48
48
  }
49
+ export interface OAuth1Token {
50
+ oAuthToken: string;
51
+ oAuthTokenSecret: string;
52
+ }
49
53
  export interface BasicApiCredentials {
50
54
  type: AuthModes['Basic'];
51
55
  username: string;
@@ -27,10 +27,10 @@ export interface DBEndUser {
27
27
  export type DBInsertEndUser = Omit<DBEndUser, 'id' | 'created_at' | 'updated_at'>;
28
28
  export interface ApiEndUser {
29
29
  id: string;
30
- displayName: string | null;
30
+ display_name: string | null;
31
31
  email: string | null;
32
32
  organization: {
33
33
  id: string;
34
- displayName: string | null;
34
+ display_name: string | null;
35
35
  } | null;
36
36
  }
@@ -0,0 +1,12 @@
1
+ import type { Endpoint } from '../../api';
2
+ import type { DBEnvironment } from '../db';
3
+ export type PostEnvironment = Endpoint<{
4
+ Method: 'POST';
5
+ Path: '/api/v1/environments';
6
+ Body: {
7
+ name: string;
8
+ };
9
+ Success: {
10
+ data: Pick<DBEnvironment, 'id' | 'name'>;
11
+ };
12
+ }>;
@@ -0,0 +1,4 @@
1
+ export interface EnvironmentVariable {
2
+ name: string;
3
+ value: string;
4
+ }
package/dist/index.d.ts CHANGED
@@ -21,7 +21,6 @@ export type * from './team/api.js';
21
21
  export type * from './team/db.js';
22
22
  export type * from './providers/api.js';
23
23
  export type * from './proxy/api.js';
24
- export type * from './environment/db.js';
25
24
  export type * from './scripts/on-events/db.js';
26
25
  export type * from './scripts/on-events/api.js';
27
26
  export type * from './scripts/syncs/api.js';
@@ -42,10 +41,13 @@ export type * from './connect/api.js';
42
41
  export type * from './connect/session.js';
43
42
  export type * from './endUser/index.js';
44
43
  export type * from './runner/index.js';
44
+ export type * from './runner/sdk.js';
45
45
  export type * from './nangoYaml/index.js';
46
46
  export type * from './environment/db.js';
47
+ export type * from './environment/api/index.js';
47
48
  export type * from './environment/api/webhook.js';
48
49
  export type * from './environment/api/otlp.js';
50
+ export type * from './environment/variable/index.js';
49
51
  export type * from './webhooks/api.js';
50
52
  export type * from './webhooks/http.api.js';
51
53
  export type * from './flow/http.api.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export type EntityType = 'connect_session' | 'connection' | 'environment';
3
2
  export interface PrivateKey {
4
3
  readonly id: number;
@@ -102,7 +102,7 @@ export type PostInsights = Endpoint<{
102
102
  env: string;
103
103
  };
104
104
  Body: {
105
- type: PickFromUnion<ConcatOperationListWithGroup, 'action' | 'sync' | 'proxy' | 'webhook:incoming'>;
105
+ type: PickFromUnion<ConcatOperationListWithGroup, 'action' | 'sync:run' | 'proxy' | 'webhook:incoming'>;
106
106
  };
107
107
  Success: {
108
108
  data: {
@@ -122,9 +122,7 @@ export interface NangoModelField {
122
122
  union?: boolean | undefined;
123
123
  optional?: boolean | undefined;
124
124
  }
125
- export type NangoSyncEndpointOld = {
126
- [key in HTTP_METHOD]?: string | undefined;
127
- };
125
+ export type NangoSyncEndpointOld = Partial<Record<HTTP_METHOD, string | undefined>>;
128
126
  export interface NangoSyncEndpointV2 {
129
127
  method: HTTP_METHOD;
130
128
  path: string;
@@ -122,7 +122,7 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
122
122
  };
123
123
  token_expires_in_ms?: number;
124
124
  proxy_header_authorization?: string;
125
- body_format?: 'xml' | 'json';
125
+ body_format?: 'xml' | 'json' | 'form';
126
126
  }
127
127
  export interface ProviderSignature extends BaseProvider {
128
128
  signature: {
@@ -47,22 +47,25 @@ export declare enum PaginationType {
47
47
  LINK = "link",
48
48
  OFFSET = "offset"
49
49
  }
50
- export interface Pagination {
51
- type: string;
50
+ export interface PaginationBase {
52
51
  limit?: number;
53
52
  response_path?: string;
54
53
  limit_name_in_request: string;
55
54
  }
56
- export interface CursorPagination extends Pagination {
55
+ export type Pagination = CursorPagination | LinkPagination | OffsetPagination;
56
+ export interface CursorPagination extends PaginationBase {
57
+ type: 'cursor';
57
58
  cursor_path_in_response: string;
58
59
  cursor_name_in_request: string;
59
60
  }
60
- export interface LinkPagination extends Pagination {
61
+ export interface LinkPagination extends PaginationBase {
62
+ type: 'link';
61
63
  link_rel_in_response_header?: string;
62
64
  link_path_in_response_body?: string;
63
65
  }
64
66
  export type OffsetCalculationMethod = 'per-page' | 'by-response-size';
65
- export interface OffsetPagination extends Pagination {
67
+ export interface OffsetPagination extends PaginationBase {
68
+ type: 'offset';
66
69
  offset_name_in_request: string;
67
70
  offset_start_value?: number;
68
71
  offset_calculation_method?: OffsetCalculationMethod;
@@ -0,0 +1,58 @@
1
+ import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios';
2
+ import type { RunnerFlags } from '.';
3
+ import type { Metadata } from '../connection/db';
4
+ import type { DBTeam } from '../team/db';
5
+ import type { DBSyncConfig } from '../syncConfigs/db';
6
+ export interface RunArgs {
7
+ sync: string;
8
+ connectionId: string;
9
+ lastSyncDate?: string;
10
+ useServerLastSyncDate?: boolean;
11
+ input?: object;
12
+ metadata?: Metadata;
13
+ autoConfirm: boolean;
14
+ debug: boolean;
15
+ optionalEnvironment?: string;
16
+ optionalProviderConfigKey?: string;
17
+ }
18
+ export interface DryRunServiceInterface {
19
+ run: (options: RunArgs, debug?: boolean) => Promise<string | void>;
20
+ }
21
+ export interface NangoProps {
22
+ scriptType: 'sync' | 'action' | 'webhook' | 'on-event';
23
+ host?: string;
24
+ secretKey: string;
25
+ team?: Pick<DBTeam, 'id' | 'name'>;
26
+ connectionId: string;
27
+ environmentId: number;
28
+ environmentName?: string;
29
+ activityLogId?: string | undefined;
30
+ providerConfigKey: string;
31
+ provider: string;
32
+ lastSyncDate?: Date;
33
+ syncId?: string | undefined;
34
+ nangoConnectionId?: number;
35
+ syncJobId?: number | undefined;
36
+ track_deletes?: boolean;
37
+ attributes?: object | undefined;
38
+ abortSignal?: AbortSignal;
39
+ syncConfig: DBSyncConfig;
40
+ runnerFlags: RunnerFlags;
41
+ debug: boolean;
42
+ startedAt: Date;
43
+ endUser: {
44
+ id: number;
45
+ endUserId: string | null;
46
+ orgId: string | null;
47
+ } | null;
48
+ axios?: {
49
+ request?: AxiosInterceptorManager<AxiosRequestConfig>;
50
+ response?: {
51
+ onFulfilled: (value: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>;
52
+ onRejected: (value: unknown) => AxiosError | Promise<AxiosError>;
53
+ };
54
+ };
55
+ }
56
+ export interface UserLogParameters {
57
+ level?: 'info' | 'debug' | 'error' | 'warn' | 'http' | 'verbose' | 'silly';
58
+ }
package/dist/web/env.d.ts CHANGED
@@ -6,7 +6,8 @@ export interface WindowEnv {
6
6
  publicPosthogKey: string;
7
7
  publicPosthogHost: string;
8
8
  publicLogoDevKey: string;
9
- publicKoalaKey: string;
9
+ publicKoalaApiUrl: string;
10
+ publicKoalaCdnUrl: string;
10
11
  isCloud: boolean;
11
12
  features: {
12
13
  logs: boolean;
@@ -14,5 +15,6 @@ export interface WindowEnv {
14
15
  auth: boolean;
15
16
  managedAuth: boolean;
16
17
  gettingStarted: boolean;
18
+ slack: boolean;
17
19
  };
18
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.48.1",
3
+ "version": "0.48.2",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -13,9 +13,9 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/json-schema": "7.0.15",
16
- "axios": "^1.7.4",
16
+ "axios": "^1.7.9",
17
17
  "json-schema": "0.4.0",
18
- "type-fest": "4.26.1"
18
+ "type-fest": "4.32.0"
19
19
  },
20
20
  "license": "SEE LICENSE IN LICENSE FILE IN GIT REPOSITORY",
21
21
  "files": [