@nangohq/types 0.69.25 → 0.69.27

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,38 @@
1
+ import type { Timestamps } from '../db.js';
2
+ /**
3
+ * Allowed types for checkpoint values.
4
+ * Only flat key-value structures are supported (no nested objects or arrays).
5
+ * Date values are automatically converted to ISO strings when stored.
6
+ */
7
+ export type CheckpointValue = string | number | boolean | Date;
8
+ /**
9
+ * A checkpoint is a flat key-value object that can be used to store
10
+ * progress or state during function execution.
11
+ * Date values are automatically converted to ISO strings when stored.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const checkpoint: Checkpoint = {
16
+ * lastProcessedPage: 5,
17
+ * lastCursor: "abc123",
18
+ * lastRunAt: new Date(), // stored as ISO string
19
+ * };
20
+ * ```
21
+ */
22
+ export type Checkpoint = Record<string, CheckpointValue>;
23
+ /**
24
+ * Checkpoints are identified by a flexible key format that allows
25
+ * attaching checkpoints to various entities:
26
+ *
27
+ * @example Key formats:
28
+ * - `connection:123:config:456` - checkpoint for a specific sync/action per connection
29
+ */
30
+ export interface DBCheckpoint extends Timestamps {
31
+ id: number;
32
+ environment_id: number;
33
+ connection_id: number;
34
+ key: string;
35
+ checkpoint: Checkpoint;
36
+ version: number;
37
+ deleted_at: Date | null;
38
+ }
@@ -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>;
package/dist/index.d.ts CHANGED
@@ -82,4 +82,5 @@ 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/db.js';
85
86
  export type * from './mcp/api.js';
@@ -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.25",
3
+ "version": "0.69.27",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",