@nangohq/types 0.69.26 → 0.69.28

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.
@@ -5,7 +5,7 @@ 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
7
  import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
8
- import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
8
+ import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PatchPublicConnection, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
9
9
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata.js';
10
10
  import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api.js';
11
11
  import type { DeleteEnvironment, GetEnvironments, PatchEnvironment, PostEnvironment } from './environment/api/index.js';
@@ -27,7 +27,7 @@ import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, Pos
27
27
  import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api.js';
28
28
  import type { GetUser, PatchUser } from './user/api.js';
29
29
  import type { PostPublicWebhook } from './webhooks/http.api.js';
30
- 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 | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | AllPublicProxy;
30
+ 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 | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | AllPublicProxy;
31
31
  export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider;
32
32
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
33
33
  /**
@@ -0,0 +1,18 @@
1
+ import type { Timestamps } from '../db.js';
2
+ import type { Checkpoint } from './types.js';
3
+ /**
4
+ * Checkpoints are identified by a flexible key format that allows
5
+ * attaching checkpoints to various entities:
6
+ *
7
+ * @example Key formats:
8
+ * - `connection:123:config:456` - checkpoint for a specific sync/action per connection
9
+ */
10
+ export interface DBCheckpoint extends Timestamps {
11
+ id: number;
12
+ environment_id: number;
13
+ connection_id: number;
14
+ key: string;
15
+ checkpoint: Checkpoint;
16
+ version: number;
17
+ deleted_at: Date | null;
18
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Allowed types for checkpoint values.
3
+ * Only flat key-value structures are supported (no nested objects or arrays).
4
+ * Date values are automatically converted to ISO strings when stored.
5
+ */
6
+ export type CheckpointValue = string | number | boolean | Date;
7
+ /**
8
+ * A checkpoint is a flat key-value object that can be used to store
9
+ * progress or state during function execution.
10
+ * Date values are automatically converted to ISO strings when stored.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const checkpoint: Checkpoint = {
15
+ * lastProcessedPage: 5,
16
+ * lastCursor: "abc123",
17
+ * lastRunAt: new Date(), // stored as ISO string
18
+ * };
19
+ * ```
20
+ */
21
+ export type Checkpoint = Record<string, CheckpointValue>;
@@ -16,6 +16,7 @@ export interface ConnectSessionInput {
16
16
  id: string;
17
17
  display_name?: string | undefined;
18
18
  } | undefined;
19
+ tags?: Record<string, string> | undefined;
19
20
  overrides?: Record<string, {
20
21
  docs_connect?: string | undefined;
21
22
  }> | undefined;
@@ -53,6 +54,7 @@ export type PostPublicConnectSessionsReconnect = Endpoint<{
53
54
  end_user?: ConnectSessionInput['end_user'] | undefined;
54
55
  organization?: ConnectSessionInput['organization'];
55
56
  overrides?: ConnectSessionInput['overrides'];
57
+ tags?: ConnectSessionInput['tags'];
56
58
  };
57
59
  Success: {
58
60
  data: {
@@ -1,3 +1,4 @@
1
+ import type { Tags } from '../db.js';
1
2
  import type { InternalEndUser } from '../endUser/index.js';
2
3
  export interface ConnectSession {
3
4
  readonly id: number;
@@ -10,6 +11,7 @@ export interface ConnectSession {
10
11
  readonly integrationsConfigDefaults: Record<string, ConnectSessionIntegrationConfigDefaults> | null;
11
12
  readonly overrides: Record<string, ConnectSessionOverrides> | null;
12
13
  readonly endUser: InternalEndUser | null;
14
+ readonly tags: Tags;
13
15
  readonly createdAt: Date;
14
16
  readonly updatedAt: Date | null;
15
17
  }
@@ -1,6 +1,7 @@
1
1
  import type { ApiError, ApiTimestamps, Endpoint } from '../../api.js';
2
2
  import type { AllAuthCredentials, ApiKeyCredentials, BasicApiCredentials, OAuth1Credentials, OAuth2ClientCredentials, OAuth2Credentials, TbaCredentials } from '../../auth/api.js';
3
3
  import type { EndUserInput } from '../../connect/api.js';
4
+ import type { Tags } from '../../db.js';
4
5
  import type { ApiEndUser } from '../../endUser/index.js';
5
6
  import type { ActiveLog } from '../../notification/active-logs/db.js';
6
7
  import type { ReplaceInObject } from '../../utils.js';
@@ -13,6 +14,7 @@ export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id'
13
14
  log_id: string;
14
15
  }[];
15
16
  endUser: ApiEndUser | null;
17
+ tags: Tags;
16
18
  };
17
19
  export type GetConnections = Endpoint<{
18
20
  Method: 'GET';
@@ -53,6 +55,7 @@ export type ApiPublicConnection = Pick<DBConnection, 'id' | 'connection_id'> & {
53
55
  log_id: string;
54
56
  }[];
55
57
  end_user: ApiEndUser | null;
58
+ tags: Tags;
56
59
  };
57
60
  export type GetPublicConnections = Endpoint<{
58
61
  Method: 'GET';
@@ -62,6 +65,7 @@ export type GetPublicConnections = Endpoint<{
62
65
  endUserId?: string | undefined;
63
66
  integrationId?: string | undefined;
64
67
  endUserOrganizationId?: string | undefined;
68
+ tags?: Tags | undefined;
65
69
  limit?: number | undefined;
66
70
  page?: number | undefined;
67
71
  };
@@ -90,6 +94,7 @@ export type PostPublicConnection = Endpoint<{
90
94
  type: 'NONE';
91
95
  };
92
96
  end_user?: EndUserInput | undefined;
97
+ tags?: Tags | undefined;
93
98
  };
94
99
  Success: ApiPublicConnectionFull;
95
100
  }>;
@@ -126,6 +131,7 @@ export type ApiPublicConnectionFull = Pick<DBConnection, 'id' | 'connection_id'
126
131
  log_id: string;
127
132
  }[];
128
133
  end_user: ApiEndUser | null;
134
+ tags: Tags;
129
135
  credentials: AllAuthCredentials;
130
136
  };
131
137
  export type GetPublicConnection = Endpoint<{
@@ -154,6 +160,7 @@ export type PatchPublicConnection = Endpoint<{
154
160
  };
155
161
  Body: {
156
162
  end_user?: EndUserInput | undefined;
163
+ tags?: Tags | undefined;
157
164
  };
158
165
  Success: {
159
166
  success: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { AllAuthCredentials, AuthModeType, AuthOperationType } from '../auth/api.js';
2
- import type { TimestampsAndDeletedCorrect } from '../db.js';
2
+ import type { Tags, TimestampsAndDeletedCorrect } from '../db.js';
3
3
  import type { InternalEndUser } from '../endUser/index.js';
4
4
  import type { DBEnvironment } from '../environment/db.js';
5
5
  import type { DBTeam } from '../team/db.js';
@@ -16,6 +16,7 @@ export interface DBConnection extends TimestampsAndDeletedCorrect {
16
16
  id: number;
17
17
  config_id: number;
18
18
  end_user_id: number | null;
19
+ tags: Tags;
19
20
  /**
20
21
  * @deprecated
21
22
  */
package/dist/db.d.ts CHANGED
@@ -14,3 +14,4 @@ export interface TimestampsAndDeleted extends Timestamps, Deleted {
14
14
  }
15
15
  export interface TimestampsAndDeletedCorrect extends Timestamps, DeletedCorrect {
16
16
  }
17
+ export type Tags = Record<string, string>;
@@ -3,9 +3,9 @@ import type { ApiPlan } from '../../plans/http.api.js';
3
3
  import type { DBEnvironment, DBExternalWebhook } from '../db.js';
4
4
  import type { ApiEnvironmentVariable } from '../variable/api.js';
5
5
  import type { Merge } from 'type-fest';
6
- export type ApiEnvironment = Omit<Merge<DBEnvironment, {
6
+ export type ApiEnvironment = Merge<DBEnvironment, {
7
7
  callback_url: string;
8
- } & ApiTimestamps>, 'secret_key_iv' | 'secret_key_tag' | 'secret_key_hashed' | 'pending_secret_key_iv' | 'pending_secret_key_tag' | 'pending_public_key'>;
8
+ } & ApiTimestamps>;
9
9
  export type ApiWebhooks = Omit<DBExternalWebhook, 'id' | 'environment_id' | 'created_at' | 'updated_at'>;
10
10
  export type GetEnvironments = Endpoint<{
11
11
  Method: 'GET';
@@ -12,11 +12,14 @@ export interface DBEnvironment extends TimestampsAndDeletedCorrect {
12
12
  uuid: string;
13
13
  name: string;
14
14
  account_id: number;
15
+ /**
16
+ * @deprecated Field secret_key is deprecated.
17
+ * New code should use SecretService to retrieve secrets for environments.
18
+ * This field is populated for backward compatibility only.
19
+ * It may be removed in a future release.
20
+ */
15
21
  secret_key: string;
16
22
  public_key: string;
17
- secret_key_iv?: string | null;
18
- secret_key_tag?: string | null;
19
- secret_key_hashed?: string | null;
20
23
  callback_url: string | null;
21
24
  /**
22
25
  * @deprecated
@@ -34,9 +37,13 @@ export interface DBEnvironment extends TimestampsAndDeletedCorrect {
34
37
  hmac_digest?: string | null;
35
38
  secret_key_rotatable?: boolean;
36
39
  public_key_rotatable?: boolean;
40
+ /**
41
+ * @deprecated Field pending_secret_key is deprecated.
42
+ * New code should use SecretService to rotate secrets for environments.
43
+ * This field is populated for backward compatibility only.
44
+ * It may be removed in a future release.
45
+ */
37
46
  pending_secret_key: string | null;
38
- pending_secret_key_iv?: string | null;
39
- pending_secret_key_tag?: string | null;
40
47
  pending_public_key?: string | null;
41
48
  slack_notifications: boolean;
42
49
  webhook_receive_url: string | null;
package/dist/index.d.ts CHANGED
@@ -82,4 +82,6 @@ export type * from './fleet/api.js';
82
82
  export type * from './fleet/index.js';
83
83
  export type * from './persist/api.js';
84
84
  export type * from './jobs/api.js';
85
+ export type * from './checkpoint/types.js';
86
+ export type * from './checkpoint/db.js';
85
87
  export type * from './mcp/api.js';
@@ -1,4 +1,5 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
+ import type { Checkpoint } from '../checkpoint/types.js';
2
3
  import type { MessageRowInsert } from '../logs/messages.js';
3
4
  import type { MergingStrategy, NangoRecord } from '../record/api.js';
4
5
  interface LogBody {
@@ -34,4 +35,13 @@ export interface GetRecordsSuccess {
34
35
  records: NangoRecord[];
35
36
  nextCursor?: string;
36
37
  }
38
+ export interface GetCheckpointSuccess {
39
+ checkpoint: Checkpoint;
40
+ version: number;
41
+ deletedAt: string | null;
42
+ }
43
+ export interface PutCheckpointSuccess {
44
+ checkpoint: Checkpoint;
45
+ version: number;
46
+ }
37
47
  export {};
package/dist/result.d.ts CHANGED
@@ -3,7 +3,7 @@ export interface Left<T, E extends Error> {
3
3
  isErr(this: Result<T, E>): this is Left<T, E>;
4
4
  isOk(this: Result<T, E>): this is Right<T, E>;
5
5
  unwrap(): T;
6
- map<U>(fn: (value: T) => U): Result<T, E>;
6
+ map<U>(fn: (value: T) => U): Result<U, E>;
7
7
  mapError<U extends Error>(fn: (error: E) => U): Result<T, U>;
8
8
  }
9
9
  export interface Right<T, E extends Error> {
@@ -41,6 +41,7 @@ export interface NangoAuthWebhookBodyBase extends NangoWebhookBase {
41
41
  provider: string;
42
42
  environment: string;
43
43
  operation: AuthOperationType;
44
+ tags?: Record<string, string> | undefined;
44
45
  /**
45
46
  * Only presents if the connection happened with a session token
46
47
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.69.26",
3
+ "version": "0.69.28",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",