@doist/comms-sdk 0.4.2 → 0.4.4

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.
@@ -96,19 +96,30 @@ async function createDefaultDispatcher() {
96
96
  // undici into their bundle. `isNodeEnvironment()` above already gated this
97
97
  // branch, so undici is safe to load when we get here.
98
98
  const { EnvHttpProxyAgent, interceptors } = await Promise.resolve().then(() => __importStar(require('undici')));
99
- // `allowH2: true` opts into HTTP/2 via ALPN; undici falls back to h1.1
100
- // when the server doesn't negotiate h2. Without this flag undici
101
- // defaults to h1.1 even when the server supports h2.
102
- //
103
- // `interceptors.decompress()` decodes gzip/deflate/br/zstd bodies. On
104
- // Node 24+, attaching any custom dispatcher to global `fetch` strips
105
- // `content-encoding` without actually decompressing the body.
106
- // See https://github.com/Doist/todoist-cli/issues/318.
107
- //
108
- // Both emit ExperimentalWarning on first use; suppressed during init.
99
+ // `EnvHttpProxyAgent` (with `allowH2`) and `interceptors.decompress()` both
100
+ // emit an ExperimentalWarning on first use, so build the whole dispatcher
101
+ // inside the suppression block.
109
102
  return suppressExperimentalWarningsSync(() => {
103
+ // `allowH2: true` opts into HTTP/2 via ALPN; undici falls back to h1.1
104
+ // when the server doesn't negotiate h2. Without this flag undici
105
+ // defaults to h1.1 even when the server supports h2.
106
+ const agent = new EnvHttpProxyAgent({ allowH2: true });
107
+ // Some runtimes report `process.versions.node` (so `isNodeEnvironment()`
108
+ // passes) but ship only a partial undici: `interceptors.decompress` is
109
+ // absent and dispatchers have no `.compose`. Bun is the common case.
110
+ // There the proxy agent alone is enough — Bun's `fetch` decompresses
111
+ // gzip/deflate/br/zstd natively — so skip the interceptor instead of
112
+ // crashing on the missing API. Optional chaining also guards a runtime
113
+ // that omits the `interceptors` export entirely.
114
+ if (typeof interceptors?.decompress !== 'function') {
115
+ return agent;
116
+ }
117
+ // `interceptors.decompress()` decodes gzip/deflate/br/zstd bodies. On
118
+ // Node 24+, attaching any custom dispatcher to global `fetch` strips
119
+ // `content-encoding` without actually decompressing the body.
120
+ // See https://github.com/Doist/todoist-cli/issues/318.
110
121
  const decompress = interceptors.decompress();
111
- return new EnvHttpProxyAgent({ allowH2: true }).compose(decompress);
122
+ return agent.compose(decompress);
112
123
  });
113
124
  }
114
125
  // `suppressExperimentalWarningsSync` is exported for direct unit testing —
@@ -136,8 +136,8 @@ function createChannelSchema(linkBaseUrl) {
136
136
  }));
137
137
  }
138
138
  exports.ChannelSchema = createChannelSchema();
139
- // Thread entity from API. `pinned` (boolean) and `pinnedTs` (epoch ms or
140
- // null) are both surfaced — `pinned` is kept for Zapier/webhook clients.
139
+ // Thread entity from API. `pinned` (boolean) and `pinnedDate` are both
140
+ // surfaced — `pinned` is kept for Zapier/webhook clients.
141
141
  exports.ThreadObjectSchema = zod_1.z.object({
142
142
  id: zod_1.z.string(),
143
143
  title: zod_1.z.string(),
@@ -158,10 +158,10 @@ exports.ThreadObjectSchema = zod_1.z.object({
158
158
  lastUpdated: zod_1.z.date(),
159
159
  mutedUntil: zod_1.z.date().nullable().optional(),
160
160
  participants: zod_1.z.array(zod_1.z.number()).nullable().optional(),
161
- // Backend wire shape only includes `pinned_ts` (epoch ms or null);
162
- // derive `pinned` from `pinnedTs != null` if you need a bool.
161
+ // Backend wire shape only includes `pinned_ts` (epoch seconds or null);
162
+ // response normalization exposes that timestamp as `pinnedDate`.
163
163
  pinned: zod_1.z.boolean().optional(),
164
- pinnedTs: zod_1.z.number().int().nullable().optional(),
164
+ pinnedDate: zod_1.z.date().nullable().optional(),
165
165
  posted: zod_1.z.date(),
166
166
  reactions: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable().optional(),
167
167
  recipients: zod_1.z.array(zod_1.z.number()).nullable().optional(),
@@ -370,10 +370,10 @@ function createInboxThreadObjectSchema(linkBaseUrl) {
370
370
  lastUpdated: zod_1.z.date(),
371
371
  mutedUntil: zod_1.z.date().nullable().optional(),
372
372
  participants: zod_1.z.array(zod_1.z.number()).nullable().optional(),
373
- // Backend wire shape only includes `pinned_ts` (epoch ms or null);
374
- // derive `pinned` from `pinnedTs != null` if you need a bool.
373
+ // Backend wire shape only includes `pinned_ts` (epoch seconds or null);
374
+ // response normalization exposes that timestamp as `pinnedDate`.
375
375
  pinned: zod_1.z.boolean().optional(),
376
- pinnedTs: zod_1.z.number().int().nullable().optional(),
376
+ pinnedDate: zod_1.z.date().nullable().optional(),
377
377
  posted: zod_1.z.date(),
378
378
  reactions: zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.number())).nullable().optional(),
379
379
  recipients: zod_1.z.array(zod_1.z.number()).nullable().optional(),
@@ -10,9 +10,10 @@ exports.transformTimestamps = transformTimestamps;
10
10
  function timestampToDate(timestamp) {
11
11
  return new Date(timestamp * 1000);
12
12
  }
13
+ const timestampFieldTargetOverrides = new Map([['pinnedTs', 'pinnedDate']]);
13
14
  /**
14
- * Recursively transforms all timestamp fields (ending in 'Ts') in an object to Date objects.
15
- * Also renames the fields by removing the 'Ts' suffix.
15
+ * Recursively transforms timestamp fields (ending in 'Ts') in an object to Date objects.
16
+ * Also renames converted fields by removing the 'Ts' suffix.
16
17
  * @param obj - The object to transform
17
18
  * @returns The transformed object with Date fields
18
19
  */
@@ -26,22 +27,30 @@ function transformTimestamps(obj) {
26
27
  if (typeof obj === 'object') {
27
28
  const result = {};
28
29
  for (const [key, value] of Object.entries(obj)) {
29
- // Check if the key ends with 'Ts' and the value is a number
30
- if (key.endsWith('Ts') && typeof value === 'number') {
31
- // Remove 'Ts' suffix and convert to Date
32
- const newKey = key.slice(0, -2);
33
- // If the base key already exists in the original object, use *Date suffix
34
- // to avoid overwriting it (e.g. pinned + pinnedTs → pinned + pinnedDate)
35
- const targetKey = newKey in obj ? `${newKey}Date` : newKey;
36
- result[targetKey] = timestampToDate(value);
30
+ // Check if the key ends with 'Ts'
31
+ if (key.endsWith('Ts')) {
32
+ const overriddenTargetKey = timestampFieldTargetOverrides.get(key);
33
+ if (typeof value === 'number') {
34
+ // Remove 'Ts' suffix and convert to Date
35
+ const newKey = key.slice(0, -2);
36
+ // If the base key already exists in the original object, use *Date suffix
37
+ // to avoid overwriting it (e.g. posted + postedTs → posted + postedDate)
38
+ const targetKey = overriddenTargetKey ??
39
+ (newKey in obj ? `${newKey}Date` : newKey);
40
+ result[targetKey] = timestampToDate(value);
41
+ continue;
42
+ }
43
+ if (overriddenTargetKey) {
44
+ result[overriddenTargetKey] = value;
45
+ continue;
46
+ }
37
47
  }
38
- else if (typeof value === 'object' && value !== null) {
48
+ if (typeof value === 'object' && value !== null) {
39
49
  // Recursively transform nested objects
40
50
  result[key] = transformTimestamps(value);
51
+ continue;
41
52
  }
42
- else {
43
- result[key] = value;
44
- }
53
+ result[key] = value;
45
54
  }
46
55
  return result;
47
56
  }
@@ -57,19 +57,30 @@ async function createDefaultDispatcher() {
57
57
  // undici into their bundle. `isNodeEnvironment()` above already gated this
58
58
  // branch, so undici is safe to load when we get here.
59
59
  const { EnvHttpProxyAgent, interceptors } = await import('undici');
60
- // `allowH2: true` opts into HTTP/2 via ALPN; undici falls back to h1.1
61
- // when the server doesn't negotiate h2. Without this flag undici
62
- // defaults to h1.1 even when the server supports h2.
63
- //
64
- // `interceptors.decompress()` decodes gzip/deflate/br/zstd bodies. On
65
- // Node 24+, attaching any custom dispatcher to global `fetch` strips
66
- // `content-encoding` without actually decompressing the body.
67
- // See https://github.com/Doist/todoist-cli/issues/318.
68
- //
69
- // Both emit ExperimentalWarning on first use; suppressed during init.
60
+ // `EnvHttpProxyAgent` (with `allowH2`) and `interceptors.decompress()` both
61
+ // emit an ExperimentalWarning on first use, so build the whole dispatcher
62
+ // inside the suppression block.
70
63
  return suppressExperimentalWarningsSync(() => {
64
+ // `allowH2: true` opts into HTTP/2 via ALPN; undici falls back to h1.1
65
+ // when the server doesn't negotiate h2. Without this flag undici
66
+ // defaults to h1.1 even when the server supports h2.
67
+ const agent = new EnvHttpProxyAgent({ allowH2: true });
68
+ // Some runtimes report `process.versions.node` (so `isNodeEnvironment()`
69
+ // passes) but ship only a partial undici: `interceptors.decompress` is
70
+ // absent and dispatchers have no `.compose`. Bun is the common case.
71
+ // There the proxy agent alone is enough — Bun's `fetch` decompresses
72
+ // gzip/deflate/br/zstd natively — so skip the interceptor instead of
73
+ // crashing on the missing API. Optional chaining also guards a runtime
74
+ // that omits the `interceptors` export entirely.
75
+ if (typeof interceptors?.decompress !== 'function') {
76
+ return agent;
77
+ }
78
+ // `interceptors.decompress()` decodes gzip/deflate/br/zstd bodies. On
79
+ // Node 24+, attaching any custom dispatcher to global `fetch` strips
80
+ // `content-encoding` without actually decompressing the body.
81
+ // See https://github.com/Doist/todoist-cli/issues/318.
71
82
  const decompress = interceptors.decompress();
72
- return new EnvHttpProxyAgent({ allowH2: true }).compose(decompress);
83
+ return agent.compose(decompress);
73
84
  });
74
85
  }
75
86
  // `suppressExperimentalWarningsSync` is exported for direct unit testing —
@@ -126,8 +126,8 @@ export function createChannelSchema(linkBaseUrl) {
126
126
  }));
127
127
  }
128
128
  export const ChannelSchema = createChannelSchema();
129
- // Thread entity from API. `pinned` (boolean) and `pinnedTs` (epoch ms or
130
- // null) are both surfaced — `pinned` is kept for Zapier/webhook clients.
129
+ // Thread entity from API. `pinned` (boolean) and `pinnedDate` are both
130
+ // surfaced — `pinned` is kept for Zapier/webhook clients.
131
131
  export const ThreadObjectSchema = z.object({
132
132
  id: z.string(),
133
133
  title: z.string(),
@@ -148,10 +148,10 @@ export const ThreadObjectSchema = z.object({
148
148
  lastUpdated: z.date(),
149
149
  mutedUntil: z.date().nullable().optional(),
150
150
  participants: z.array(z.number()).nullable().optional(),
151
- // Backend wire shape only includes `pinned_ts` (epoch ms or null);
152
- // derive `pinned` from `pinnedTs != null` if you need a bool.
151
+ // Backend wire shape only includes `pinned_ts` (epoch seconds or null);
152
+ // response normalization exposes that timestamp as `pinnedDate`.
153
153
  pinned: z.boolean().optional(),
154
- pinnedTs: z.number().int().nullable().optional(),
154
+ pinnedDate: z.date().nullable().optional(),
155
155
  posted: z.date(),
156
156
  reactions: z.record(z.string(), z.unknown()).nullable().optional(),
157
157
  recipients: z.array(z.number()).nullable().optional(),
@@ -360,10 +360,10 @@ export function createInboxThreadObjectSchema(linkBaseUrl) {
360
360
  lastUpdated: z.date(),
361
361
  mutedUntil: z.date().nullable().optional(),
362
362
  participants: z.array(z.number()).nullable().optional(),
363
- // Backend wire shape only includes `pinned_ts` (epoch ms or null);
364
- // derive `pinned` from `pinnedTs != null` if you need a bool.
363
+ // Backend wire shape only includes `pinned_ts` (epoch seconds or null);
364
+ // response normalization exposes that timestamp as `pinnedDate`.
365
365
  pinned: z.boolean().optional(),
366
- pinnedTs: z.number().int().nullable().optional(),
366
+ pinnedDate: z.date().nullable().optional(),
367
367
  posted: z.date(),
368
368
  reactions: z.record(z.string(), z.array(z.number())).nullable().optional(),
369
369
  recipients: z.array(z.number()).nullable().optional(),
@@ -6,9 +6,10 @@
6
6
  export function timestampToDate(timestamp) {
7
7
  return new Date(timestamp * 1000);
8
8
  }
9
+ const timestampFieldTargetOverrides = new Map([['pinnedTs', 'pinnedDate']]);
9
10
  /**
10
- * Recursively transforms all timestamp fields (ending in 'Ts') in an object to Date objects.
11
- * Also renames the fields by removing the 'Ts' suffix.
11
+ * Recursively transforms timestamp fields (ending in 'Ts') in an object to Date objects.
12
+ * Also renames converted fields by removing the 'Ts' suffix.
12
13
  * @param obj - The object to transform
13
14
  * @returns The transformed object with Date fields
14
15
  */
@@ -22,22 +23,30 @@ export function transformTimestamps(obj) {
22
23
  if (typeof obj === 'object') {
23
24
  const result = {};
24
25
  for (const [key, value] of Object.entries(obj)) {
25
- // Check if the key ends with 'Ts' and the value is a number
26
- if (key.endsWith('Ts') && typeof value === 'number') {
27
- // Remove 'Ts' suffix and convert to Date
28
- const newKey = key.slice(0, -2);
29
- // If the base key already exists in the original object, use *Date suffix
30
- // to avoid overwriting it (e.g. pinned + pinnedTs → pinned + pinnedDate)
31
- const targetKey = newKey in obj ? `${newKey}Date` : newKey;
32
- result[targetKey] = timestampToDate(value);
26
+ // Check if the key ends with 'Ts'
27
+ if (key.endsWith('Ts')) {
28
+ const overriddenTargetKey = timestampFieldTargetOverrides.get(key);
29
+ if (typeof value === 'number') {
30
+ // Remove 'Ts' suffix and convert to Date
31
+ const newKey = key.slice(0, -2);
32
+ // If the base key already exists in the original object, use *Date suffix
33
+ // to avoid overwriting it (e.g. posted + postedTs → posted + postedDate)
34
+ const targetKey = overriddenTargetKey ??
35
+ (newKey in obj ? `${newKey}Date` : newKey);
36
+ result[targetKey] = timestampToDate(value);
37
+ continue;
38
+ }
39
+ if (overriddenTargetKey) {
40
+ result[overriddenTargetKey] = value;
41
+ continue;
42
+ }
33
43
  }
34
- else if (typeof value === 'object' && value !== null) {
44
+ if (typeof value === 'object' && value !== null) {
35
45
  // Recursively transform nested objects
36
46
  result[key] = transformTimestamps(value);
47
+ continue;
37
48
  }
38
- else {
39
- result[key] = value;
40
- }
49
+ result[key] = value;
41
50
  }
42
51
  return result;
43
52
  }
@@ -39,7 +39,7 @@ export declare const InboxThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
39
39
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
40
40
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
41
41
  pinned: z.ZodOptional<z.ZodBoolean>;
42
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
42
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
43
43
  posted: z.ZodDate;
44
44
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNumber>>>>;
45
45
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -227,7 +227,7 @@ export declare const InboxThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
227
227
  mutedUntil?: Date | null | undefined;
228
228
  participants?: number[] | null | undefined;
229
229
  pinned?: boolean | undefined;
230
- pinnedTs?: number | null | undefined;
230
+ pinnedDate?: Date | null | undefined;
231
231
  reactions?: Record<string, number[]> | null | undefined;
232
232
  recipients?: number[] | null | undefined;
233
233
  snippetMaskAvatarUrl?: string | null | undefined;
@@ -325,7 +325,7 @@ export declare const InboxThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
325
325
  mutedUntil?: Date | null | undefined;
326
326
  participants?: number[] | null | undefined;
327
327
  pinned?: boolean | undefined;
328
- pinnedTs?: number | null | undefined;
328
+ pinnedDate?: Date | null | undefined;
329
329
  reactions?: Record<string, number[]> | null | undefined;
330
330
  recipients?: number[] | null | undefined;
331
331
  snippetMaskAvatarUrl?: string | null | undefined;
@@ -40,7 +40,7 @@ export declare const ThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
40
40
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
41
41
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
42
42
  pinned: z.ZodOptional<z.ZodBoolean>;
43
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
43
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
44
44
  posted: z.ZodDate;
45
45
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
46
46
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -139,7 +139,7 @@ export declare const ThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
139
139
  mutedUntil?: Date | null | undefined;
140
140
  participants?: number[] | null | undefined;
141
141
  pinned?: boolean | undefined;
142
- pinnedTs?: number | null | undefined;
142
+ pinnedDate?: Date | null | undefined;
143
143
  reactions?: Record<string, unknown> | null | undefined;
144
144
  recipients?: number[] | null | undefined;
145
145
  responders?: number[] | null | undefined;
@@ -234,7 +234,7 @@ export declare const ThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
234
234
  mutedUntil?: Date | null | undefined;
235
235
  participants?: number[] | null | undefined;
236
236
  pinned?: boolean | undefined;
237
- pinnedTs?: number | null | undefined;
237
+ pinnedDate?: Date | null | undefined;
238
238
  reactions?: Record<string, unknown> | null | undefined;
239
239
  recipients?: number[] | null | undefined;
240
240
  responders?: number[] | null | undefined;
@@ -277,7 +277,7 @@ export declare const ThreadObjectSchema: z.ZodObject<{
277
277
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
278
278
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
279
279
  pinned: z.ZodOptional<z.ZodBoolean>;
280
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
280
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
281
281
  posted: z.ZodDate;
282
282
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
283
283
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -371,7 +371,7 @@ export declare function createThreadSchema(linkBaseUrl?: string): z.ZodPipe<z.Zo
371
371
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
372
372
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
373
373
  pinned: z.ZodOptional<z.ZodBoolean>;
374
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
374
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
375
375
  posted: z.ZodDate;
376
376
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
377
377
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -470,7 +470,7 @@ export declare function createThreadSchema(linkBaseUrl?: string): z.ZodPipe<z.Zo
470
470
  mutedUntil?: Date | null | undefined;
471
471
  participants?: number[] | null | undefined;
472
472
  pinned?: boolean | undefined;
473
- pinnedTs?: number | null | undefined;
473
+ pinnedDate?: Date | null | undefined;
474
474
  reactions?: Record<string, unknown> | null | undefined;
475
475
  recipients?: number[] | null | undefined;
476
476
  responders?: number[] | null | undefined;
@@ -565,7 +565,7 @@ export declare function createThreadSchema(linkBaseUrl?: string): z.ZodPipe<z.Zo
565
565
  mutedUntil?: Date | null | undefined;
566
566
  participants?: number[] | null | undefined;
567
567
  pinned?: boolean | undefined;
568
- pinnedTs?: number | null | undefined;
568
+ pinnedDate?: Date | null | undefined;
569
569
  reactions?: Record<string, unknown> | null | undefined;
570
570
  recipients?: number[] | null | undefined;
571
571
  responders?: number[] | null | undefined;
@@ -656,7 +656,7 @@ export declare const ThreadSchema: z.ZodPipe<z.ZodObject<{
656
656
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
657
657
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
658
658
  pinned: z.ZodOptional<z.ZodBoolean>;
659
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
659
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
660
660
  posted: z.ZodDate;
661
661
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
662
662
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -755,7 +755,7 @@ export declare const ThreadSchema: z.ZodPipe<z.ZodObject<{
755
755
  mutedUntil?: Date | null | undefined;
756
756
  participants?: number[] | null | undefined;
757
757
  pinned?: boolean | undefined;
758
- pinnedTs?: number | null | undefined;
758
+ pinnedDate?: Date | null | undefined;
759
759
  reactions?: Record<string, unknown> | null | undefined;
760
760
  recipients?: number[] | null | undefined;
761
761
  responders?: number[] | null | undefined;
@@ -850,7 +850,7 @@ export declare const ThreadSchema: z.ZodPipe<z.ZodObject<{
850
850
  mutedUntil?: Date | null | undefined;
851
851
  participants?: number[] | null | undefined;
852
852
  pinned?: boolean | undefined;
853
- pinnedTs?: number | null | undefined;
853
+ pinnedDate?: Date | null | undefined;
854
854
  reactions?: Record<string, unknown> | null | undefined;
855
855
  recipients?: number[] | null | undefined;
856
856
  responders?: number[] | null | undefined;
@@ -1883,7 +1883,7 @@ export declare function createInboxThreadObjectSchema(linkBaseUrl?: string): z.Z
1883
1883
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1884
1884
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
1885
1885
  pinned: z.ZodOptional<z.ZodBoolean>;
1886
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1886
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1887
1887
  posted: z.ZodDate;
1888
1888
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNumber>>>>;
1889
1889
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -2064,7 +2064,7 @@ export declare function createInboxThreadSchema(linkBaseUrl?: string): z.ZodPipe
2064
2064
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2065
2065
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
2066
2066
  pinned: z.ZodOptional<z.ZodBoolean>;
2067
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2067
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2068
2068
  posted: z.ZodDate;
2069
2069
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNumber>>>>;
2070
2070
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -2252,7 +2252,7 @@ export declare function createInboxThreadSchema(linkBaseUrl?: string): z.ZodPipe
2252
2252
  mutedUntil?: Date | null | undefined;
2253
2253
  participants?: number[] | null | undefined;
2254
2254
  pinned?: boolean | undefined;
2255
- pinnedTs?: number | null | undefined;
2255
+ pinnedDate?: Date | null | undefined;
2256
2256
  reactions?: Record<string, number[]> | null | undefined;
2257
2257
  recipients?: number[] | null | undefined;
2258
2258
  snippetMaskAvatarUrl?: string | null | undefined;
@@ -2350,7 +2350,7 @@ export declare function createInboxThreadSchema(linkBaseUrl?: string): z.ZodPipe
2350
2350
  mutedUntil?: Date | null | undefined;
2351
2351
  participants?: number[] | null | undefined;
2352
2352
  pinned?: boolean | undefined;
2353
- pinnedTs?: number | null | undefined;
2353
+ pinnedDate?: Date | null | undefined;
2354
2354
  reactions?: Record<string, number[]> | null | undefined;
2355
2355
  recipients?: number[] | null | undefined;
2356
2356
  snippetMaskAvatarUrl?: string | null | undefined;
@@ -2442,7 +2442,7 @@ export declare const InboxThreadSchema: z.ZodPipe<z.ZodObject<{
2442
2442
  mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2443
2443
  participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
2444
2444
  pinned: z.ZodOptional<z.ZodBoolean>;
2445
- pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2445
+ pinnedDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2446
2446
  posted: z.ZodDate;
2447
2447
  reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNumber>>>>;
2448
2448
  recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
@@ -2630,7 +2630,7 @@ export declare const InboxThreadSchema: z.ZodPipe<z.ZodObject<{
2630
2630
  mutedUntil?: Date | null | undefined;
2631
2631
  participants?: number[] | null | undefined;
2632
2632
  pinned?: boolean | undefined;
2633
- pinnedTs?: number | null | undefined;
2633
+ pinnedDate?: Date | null | undefined;
2634
2634
  reactions?: Record<string, number[]> | null | undefined;
2635
2635
  recipients?: number[] | null | undefined;
2636
2636
  snippetMaskAvatarUrl?: string | null | undefined;
@@ -2728,7 +2728,7 @@ export declare const InboxThreadSchema: z.ZodPipe<z.ZodObject<{
2728
2728
  mutedUntil?: Date | null | undefined;
2729
2729
  participants?: number[] | null | undefined;
2730
2730
  pinned?: boolean | undefined;
2731
- pinnedTs?: number | null | undefined;
2731
+ pinnedDate?: Date | null | undefined;
2732
2732
  reactions?: Record<string, number[]> | null | undefined;
2733
2733
  recipients?: number[] | null | undefined;
2734
2734
  snippetMaskAvatarUrl?: string | null | undefined;
@@ -5,8 +5,8 @@
5
5
  */
6
6
  export declare function timestampToDate(timestamp: number): Date;
7
7
  /**
8
- * Recursively transforms all timestamp fields (ending in 'Ts') in an object to Date objects.
9
- * Also renames the fields by removing the 'Ts' suffix.
8
+ * Recursively transforms timestamp fields (ending in 'Ts') in an object to Date objects.
9
+ * Also renames converted fields by removing the 'Ts' suffix.
10
10
  * @param obj - The object to transform
11
11
  * @returns The transformed object with Date fields
12
12
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/comms-sdk",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "A TypeScript wrapper for the Comms REST API.",
5
5
  "author": "Doist developers",
6
6
  "homepage": "https://doist.github.io/comms-sdk-typescript/",