@nangohq/types 0.69.27 → 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.
@@ -1,25 +1,5 @@
1
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>;
2
+ import type { Checkpoint } from './types.js';
23
3
  /**
24
4
  * Checkpoints are identified by a flexible key format that allows
25
5
  * attaching checkpoints to various entities:
@@ -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>;
@@ -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,5 +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';
85
86
  export type * from './checkpoint/db.js';
86
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> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.69.27",
3
+ "version": "0.69.28",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",