zitejs 0.9.54 → 0.9.56

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.
@@ -251,6 +251,40 @@ export declare class Zite {
251
251
  formulaExpression?: string | undefined;
252
252
  resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
253
253
  };
254
+ } | {
255
+ name: string;
256
+ type: "rollup";
257
+ template: {
258
+ linkedRecordFieldId: string;
259
+ rollupFieldId: string;
260
+ aggregationFormula: string;
261
+ formulaExpression?: string | undefined;
262
+ formatting?: {
263
+ numberDisplayType?: "number" | "currency" | "duration" | "percent" | undefined;
264
+ currencyCode?: string | undefined;
265
+ decimalPlaces?: number | undefined;
266
+ numberFormat?: "local" | "comma_period" | "period_comma" | "space_comma" | "space_period" | "no_separator" | undefined;
267
+ displayTimeZone?: boolean | undefined;
268
+ dateFormat?: "local" | "long" | "us" | "european" | "iso" | undefined;
269
+ timeFormat?: "12h" | "24h" | undefined;
270
+ timezone?: string | undefined;
271
+ trueDisplay?: string | undefined;
272
+ falseDisplay?: string | undefined;
273
+ } | undefined;
274
+ filterEnabled?: boolean | undefined;
275
+ sortEnabled?: boolean | undefined;
276
+ resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
277
+ };
278
+ } | {
279
+ name: string;
280
+ type: "updated_by";
281
+ template: globalThis.Record<string, never>;
282
+ } | {
283
+ name: string;
284
+ type: "user";
285
+ template: {
286
+ allowMultiple: boolean;
287
+ };
254
288
  } | {
255
289
  name: string;
256
290
  type: "source";
@@ -430,6 +464,40 @@ export declare class Zite {
430
464
  formulaExpression?: string | undefined;
431
465
  resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
432
466
  };
467
+ } | {
468
+ name: string;
469
+ type: "rollup";
470
+ template: {
471
+ linkedRecordFieldId: string;
472
+ rollupFieldId: string;
473
+ aggregationFormula: string;
474
+ formulaExpression?: string | undefined;
475
+ formatting?: {
476
+ numberDisplayType?: "number" | "currency" | "duration" | "percent" | undefined;
477
+ currencyCode?: string | undefined;
478
+ decimalPlaces?: number | undefined;
479
+ numberFormat?: "local" | "comma_period" | "period_comma" | "space_comma" | "space_period" | "no_separator" | undefined;
480
+ displayTimeZone?: boolean | undefined;
481
+ dateFormat?: "local" | "long" | "us" | "european" | "iso" | undefined;
482
+ timeFormat?: "12h" | "24h" | undefined;
483
+ timezone?: string | undefined;
484
+ trueDisplay?: string | undefined;
485
+ falseDisplay?: string | undefined;
486
+ } | undefined;
487
+ filterEnabled?: boolean | undefined;
488
+ sortEnabled?: boolean | undefined;
489
+ resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
490
+ };
491
+ } | {
492
+ name: string;
493
+ type: "updated_by";
494
+ template: globalThis.Record<string, never>;
495
+ } | {
496
+ name: string;
497
+ type: "user";
498
+ template: {
499
+ allowMultiple: boolean;
500
+ };
433
501
  } | {
434
502
  name: string;
435
503
  type: "source";
@@ -619,6 +687,40 @@ export declare class Zite {
619
687
  formulaExpression?: string | undefined;
620
688
  resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
621
689
  };
690
+ } | {
691
+ name: string;
692
+ type: "rollup";
693
+ template: {
694
+ linkedRecordFieldId: string;
695
+ rollupFieldId: string;
696
+ aggregationFormula: string;
697
+ formulaExpression?: string | undefined;
698
+ formatting?: {
699
+ numberDisplayType?: "number" | "currency" | "duration" | "percent" | undefined;
700
+ currencyCode?: string | undefined;
701
+ decimalPlaces?: number | undefined;
702
+ numberFormat?: "local" | "comma_period" | "period_comma" | "space_comma" | "space_period" | "no_separator" | undefined;
703
+ displayTimeZone?: boolean | undefined;
704
+ dateFormat?: "local" | "long" | "us" | "european" | "iso" | undefined;
705
+ timeFormat?: "12h" | "24h" | undefined;
706
+ timezone?: string | undefined;
707
+ trueDisplay?: string | undefined;
708
+ falseDisplay?: string | undefined;
709
+ } | undefined;
710
+ filterEnabled?: boolean | undefined;
711
+ sortEnabled?: boolean | undefined;
712
+ resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
713
+ };
714
+ } | {
715
+ name: string;
716
+ type: "updated_by";
717
+ template: globalThis.Record<string, never>;
718
+ } | {
719
+ name: string;
720
+ type: "user";
721
+ template: {
722
+ allowMultiple: boolean;
723
+ };
622
724
  } | {
623
725
  name: string;
624
726
  type: "source";
@@ -811,6 +913,40 @@ export declare class Zite {
811
913
  formulaExpression?: string | undefined;
812
914
  resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
813
915
  };
916
+ } | {
917
+ name: string;
918
+ type: "rollup";
919
+ template: {
920
+ linkedRecordFieldId: string;
921
+ rollupFieldId: string;
922
+ aggregationFormula: string;
923
+ formulaExpression?: string | undefined;
924
+ formatting?: {
925
+ numberDisplayType?: "number" | "currency" | "duration" | "percent" | undefined;
926
+ currencyCode?: string | undefined;
927
+ decimalPlaces?: number | undefined;
928
+ numberFormat?: "local" | "comma_period" | "period_comma" | "space_comma" | "space_period" | "no_separator" | undefined;
929
+ displayTimeZone?: boolean | undefined;
930
+ dateFormat?: "local" | "long" | "us" | "european" | "iso" | undefined;
931
+ timeFormat?: "12h" | "24h" | undefined;
932
+ timezone?: string | undefined;
933
+ trueDisplay?: string | undefined;
934
+ falseDisplay?: string | undefined;
935
+ } | undefined;
936
+ filterEnabled?: boolean | undefined;
937
+ sortEnabled?: boolean | undefined;
938
+ resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
939
+ };
940
+ } | {
941
+ name: string;
942
+ type: "updated_by";
943
+ template: globalThis.Record<string, never>;
944
+ } | {
945
+ name: string;
946
+ type: "user";
947
+ template: {
948
+ allowMultiple: boolean;
949
+ };
814
950
  } | {
815
951
  name: string;
816
952
  type: "source";
@@ -1011,6 +1147,40 @@ export declare class Zite {
1011
1147
  formulaExpression?: string | undefined;
1012
1148
  resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
1013
1149
  };
1150
+ } | {
1151
+ name: string;
1152
+ type: "rollup";
1153
+ template: {
1154
+ linkedRecordFieldId: string;
1155
+ rollupFieldId: string;
1156
+ aggregationFormula: string;
1157
+ formulaExpression?: string | undefined;
1158
+ formatting?: {
1159
+ numberDisplayType?: "number" | "currency" | "duration" | "percent" | undefined;
1160
+ currencyCode?: string | undefined;
1161
+ decimalPlaces?: number | undefined;
1162
+ numberFormat?: "local" | "comma_period" | "period_comma" | "space_comma" | "space_period" | "no_separator" | undefined;
1163
+ displayTimeZone?: boolean | undefined;
1164
+ dateFormat?: "local" | "long" | "us" | "european" | "iso" | undefined;
1165
+ timeFormat?: "12h" | "24h" | undefined;
1166
+ timezone?: string | undefined;
1167
+ trueDisplay?: string | undefined;
1168
+ falseDisplay?: string | undefined;
1169
+ } | undefined;
1170
+ filterEnabled?: boolean | undefined;
1171
+ sortEnabled?: boolean | undefined;
1172
+ resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
1173
+ };
1174
+ } | {
1175
+ name: string;
1176
+ type: "updated_by";
1177
+ template: globalThis.Record<string, never>;
1178
+ } | {
1179
+ name: string;
1180
+ type: "user";
1181
+ template: {
1182
+ allowMultiple: boolean;
1183
+ };
1014
1184
  } | {
1015
1185
  name: string;
1016
1186
  type: "source";
@@ -1212,6 +1382,40 @@ export declare class Zite {
1212
1382
  formulaExpression?: string | undefined;
1213
1383
  resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
1214
1384
  };
1385
+ } | {
1386
+ name: string;
1387
+ type: "rollup";
1388
+ template: {
1389
+ linkedRecordFieldId: string;
1390
+ rollupFieldId: string;
1391
+ aggregationFormula: string;
1392
+ formulaExpression?: string | undefined;
1393
+ formatting?: {
1394
+ numberDisplayType?: "number" | "currency" | "duration" | "percent" | undefined;
1395
+ currencyCode?: string | undefined;
1396
+ decimalPlaces?: number | undefined;
1397
+ numberFormat?: "local" | "comma_period" | "period_comma" | "space_comma" | "space_period" | "no_separator" | undefined;
1398
+ displayTimeZone?: boolean | undefined;
1399
+ dateFormat?: "local" | "long" | "us" | "european" | "iso" | undefined;
1400
+ timeFormat?: "12h" | "24h" | undefined;
1401
+ timezone?: string | undefined;
1402
+ trueDisplay?: string | undefined;
1403
+ falseDisplay?: string | undefined;
1404
+ } | undefined;
1405
+ filterEnabled?: boolean | undefined;
1406
+ sortEnabled?: boolean | undefined;
1407
+ resultType?: "number" | "boolean" | "date" | "array" | "text" | undefined;
1408
+ };
1409
+ } | {
1410
+ name: string;
1411
+ type: "updated_by";
1412
+ template: globalThis.Record<string, never>;
1413
+ } | {
1414
+ name: string;
1415
+ type: "user";
1416
+ template: {
1417
+ allowMultiple: boolean;
1418
+ };
1215
1419
  } | {
1216
1420
  name: string;
1217
1421
  type: "source";
@@ -0,0 +1,2 @@
1
+ export type SdkCall = (integrationId: string, className: string, methodName: string, params?: unknown) => Promise<unknown>;
2
+ export declare function getSdkCall(): SdkCall;
@@ -0,0 +1,7 @@
1
+ export function getSdkCall() {
2
+ const fn = globalThis.__wrapSdkCall;
3
+ if (!fn) {
4
+ throw new Error('Zite SDK runtime not initialized. Endpoints must run inside the Zite worker.');
5
+ }
6
+ return fn;
7
+ }
@@ -1,9 +1,12 @@
1
+ export interface RenderHtmlParams {
2
+ html: string;
3
+ filename?: string;
4
+ }
5
+ export interface RenderHtmlResult {
6
+ url: string;
7
+ filename: string;
8
+ }
1
9
  export declare class ZitePdf {
2
- generate(options: {
3
- html: string;
4
- [key: string]: unknown;
5
- }): Promise<{
6
- url: string;
7
- [key: string]: unknown;
8
- }>;
10
+ static renderHtml(params: RenderHtmlParams): Promise<RenderHtmlResult>;
9
11
  }
12
+ export declare const Pdf: typeof ZitePdf;
@@ -1,5 +1,8 @@
1
+ import { getSdkCall } from '../internal/sdkCall.js';
2
+ const PDF_LIB_INTEGRATION_ID = '__pdf__';
1
3
  export class ZitePdf {
2
- generate(options) {
3
- throw new Error('ZitePdf is only available in the Zite runtime.');
4
+ static renderHtml(params) {
5
+ return getSdkCall()(PDF_LIB_INTEGRATION_ID, 'ZitePdf', 'renderHtml', params);
4
6
  }
5
7
  }
8
+ export const Pdf = ZitePdf;
@@ -1,10 +1,4 @@
1
- function getSdkCall() {
2
- const fn = globalThis.__wrapSdkCall;
3
- if (!fn) {
4
- throw new Error("Zite SDK runtime not initialized. Endpoints must run inside the Zite worker.");
5
- }
6
- return fn;
7
- }
1
+ import { getSdkCall } from "../internal/sdkCall.js";
8
2
  const DB_INTEGRATION_ID = "databases";
9
3
  function getBaseId() {
10
4
  try {
@@ -1,16 +1,106 @@
1
- export declare class ZiteSchedule {
2
- static create(config: {
3
- name: string;
4
- cron: string;
5
- endpoint: string;
6
- input?: Record<string, unknown>;
1
+ type DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
2
+ type ActiveWindow = {
3
+ hoursRange?: {
4
+ from: string;
5
+ to: string;
6
+ };
7
+ daysOfWeek?: DayOfWeek[];
8
+ };
9
+ export type ZiteSchedule = {
10
+ scheduleType: 'recurring';
11
+ schedule: {
12
+ frequency: 'minutely';
13
+ interval: number;
14
+ activeWindow?: ActiveWindow;
15
+ } | {
16
+ frequency: 'hourly';
17
+ interval: number;
18
+ minute?: number;
19
+ activeWindow?: ActiveWindow;
20
+ } | {
21
+ frequency: 'daily';
22
+ interval: number;
23
+ times: string[];
24
+ } | {
25
+ frequency: 'weekly';
26
+ interval: number;
27
+ daysOfWeek: DayOfWeek[];
28
+ times: string[];
29
+ } | {
30
+ frequency: 'monthly';
31
+ interval: 1;
32
+ monthlyDay: {
33
+ type: 'dayOfMonth';
34
+ day: number | 'last';
35
+ } | {
36
+ type: 'weekdayOccurrence';
37
+ weekday: DayOfWeek;
38
+ occurrence: 1 | 2 | 3 | 4 | 'last';
39
+ };
40
+ times: string[];
41
+ };
42
+ endPolicy?: {
43
+ type: 'never';
44
+ } | {
45
+ type: 'onDate';
46
+ endAt: string;
47
+ } | {
48
+ type: 'afterOccurrences';
49
+ occurrences: number;
50
+ };
51
+ overlapPolicy?: 'skip' | 'allow';
52
+ timezone: string;
53
+ paused?: boolean;
54
+ } | {
55
+ scheduleType: 'oneTime';
56
+ fireAt: string;
57
+ timezone: string;
58
+ paused?: boolean;
59
+ };
60
+ export type Schedule = ZiteSchedule;
61
+ export type RuntimeScheduleInfo = {
62
+ id: string;
63
+ cronJobId: string;
64
+ endpointId: string;
65
+ schedule: ZiteSchedule | null;
66
+ inputs?: Record<string, unknown>;
67
+ paused: boolean;
68
+ nextActionTimes: string[];
69
+ recentActions: {
70
+ scheduledAt: string;
71
+ takenAt: string;
72
+ workflowId: string;
73
+ firstExecutionRunId: string;
74
+ }[];
75
+ };
76
+ export declare class ZiteSchedules {
77
+ static add(args: {
78
+ endpointId: string;
79
+ schedule: ZiteSchedule;
80
+ inputs?: Record<string, unknown>;
7
81
  }): Promise<{
8
82
  id: string;
83
+ cronJobId: string;
9
84
  }>;
10
- static delete(id: string): Promise<void>;
11
- static list(): Promise<Array<{
85
+ static list(args?: {
86
+ endpointId?: string;
87
+ }): Promise<{
88
+ schedules: RuntimeScheduleInfo[];
89
+ }>;
90
+ static remove(args: {
12
91
  id: string;
13
- name: string;
14
- cron: string;
15
- }>>;
92
+ }): Promise<{
93
+ id: string;
94
+ deleted: true;
95
+ }>;
96
+ static update(args: {
97
+ id: string;
98
+ schedule?: ZiteSchedule;
99
+ inputs?: Record<string, unknown>;
100
+ }): Promise<{
101
+ id: string;
102
+ updated: true;
103
+ }>;
16
104
  }
105
+ export declare const Schedules: typeof ZiteSchedules;
106
+ export {};
@@ -1,11 +1,17 @@
1
- export class ZiteSchedule {
2
- static create(config) {
3
- throw new Error('ZiteSchedule is only available in the Zite runtime.');
1
+ import { getSdkCall } from '../internal/sdkCall.js';
2
+ const SCHEDULES_SDK_INTEGRATION_ID = '__schedules__';
3
+ export class ZiteSchedules {
4
+ static add(args) {
5
+ return getSdkCall()(SCHEDULES_SDK_INTEGRATION_ID, 'ZiteSchedules', 'add', args);
4
6
  }
5
- static delete(id) {
6
- throw new Error('ZiteSchedule is only available in the Zite runtime.');
7
+ static list(args) {
8
+ return getSdkCall()(SCHEDULES_SDK_INTEGRATION_ID, 'ZiteSchedules', 'list', args ?? {});
7
9
  }
8
- static list() {
9
- throw new Error('ZiteSchedule is only available in the Zite runtime.');
10
+ static remove(args) {
11
+ return getSdkCall()(SCHEDULES_SDK_INTEGRATION_ID, 'ZiteSchedules', 'remove', args);
12
+ }
13
+ static update(args) {
14
+ return getSdkCall()(SCHEDULES_SDK_INTEGRATION_ID, 'ZiteSchedules', 'update', args);
10
15
  }
11
16
  }
17
+ export const Schedules = ZiteSchedules;
@@ -7,7 +7,7 @@ export declare const timeFormatEnum: readonly ["12h", "24h"];
7
7
  export type TimeFormat = (typeof timeFormatEnum)[number];
8
8
  export declare const durationFormatEnum: readonly ["h:mm", "h:mm:ss", "h:mm:ss.s", "h:mm:ss.ss", "h:mm:ss.sss"];
9
9
  export type DurationFormat = (typeof durationFormatEnum)[number];
10
- export declare const fieldTypeEnum: readonly ["currency", "single_line_text", "long_text", "rich_text", "number", "single_select", "multiple_select", "date", "datetime", "checkbox", "attachments", "email", "url", "phone_number", "rating", "duration", "percent", "linked_record", "lookup", "source", "formula", "autonumber", "created_at", "updated_at"];
10
+ export declare const fieldTypeEnum: readonly ["currency", "single_line_text", "long_text", "rich_text", "number", "single_select", "multiple_select", "date", "datetime", "checkbox", "attachments", "email", "url", "phone_number", "rating", "duration", "percent", "linked_record", "lookup", "source", "formula", "autonumber", "created_at", "updated_at", "rollup", "updated_by", "user"];
11
11
  export type FieldType = (typeof fieldTypeEnum)[number];
12
12
  export declare const fieldTypeSchema: z.ZodEnum<{
13
13
  number: "number";
@@ -34,6 +34,9 @@ export declare const fieldTypeSchema: z.ZodEnum<{
34
34
  autonumber: "autonumber";
35
35
  created_at: "created_at";
36
36
  updated_at: "updated_at";
37
+ rollup: "rollup";
38
+ updated_by: "updated_by";
39
+ user: "user";
37
40
  }>;
38
41
  export declare const selectOptionSchema: z.ZodObject<{
39
42
  value: z.ZodString;
@@ -189,6 +192,58 @@ export declare const lookupTemplateSchema: z.ZodObject<{
189
192
  text: "text";
190
193
  }>>;
191
194
  }, z.core.$strip>;
195
+ export declare const rollupTemplateSchema: z.ZodObject<{
196
+ linkedRecordFieldId: z.ZodString;
197
+ rollupFieldId: z.ZodString;
198
+ aggregationFormula: z.ZodString;
199
+ formulaExpression: z.ZodOptional<z.ZodString>;
200
+ formatting: z.ZodOptional<z.ZodObject<{
201
+ numberDisplayType: z.ZodOptional<z.ZodEnum<{
202
+ number: "number";
203
+ currency: "currency";
204
+ duration: "duration";
205
+ percent: "percent";
206
+ }>>;
207
+ currencyCode: z.ZodOptional<z.ZodString>;
208
+ decimalPlaces: z.ZodOptional<z.ZodNumber>;
209
+ numberFormat: z.ZodOptional<z.ZodEnum<{
210
+ local: "local";
211
+ comma_period: "comma_period";
212
+ period_comma: "period_comma";
213
+ space_comma: "space_comma";
214
+ space_period: "space_period";
215
+ no_separator: "no_separator";
216
+ }>>;
217
+ displayTimeZone: z.ZodOptional<z.ZodBoolean>;
218
+ dateFormat: z.ZodOptional<z.ZodEnum<{
219
+ local: "local";
220
+ long: "long";
221
+ us: "us";
222
+ european: "european";
223
+ iso: "iso";
224
+ }>>;
225
+ timeFormat: z.ZodOptional<z.ZodEnum<{
226
+ "12h": "12h";
227
+ "24h": "24h";
228
+ }>>;
229
+ timezone: z.ZodOptional<z.ZodString>;
230
+ trueDisplay: z.ZodOptional<z.ZodString>;
231
+ falseDisplay: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$strip>>;
233
+ filterEnabled: z.ZodOptional<z.ZodBoolean>;
234
+ sortEnabled: z.ZodOptional<z.ZodBoolean>;
235
+ resultType: z.ZodOptional<z.ZodEnum<{
236
+ number: "number";
237
+ boolean: "boolean";
238
+ date: "date";
239
+ array: "array";
240
+ text: "text";
241
+ }>>;
242
+ }, z.core.$strip>;
243
+ export declare const updatedByTemplateSchema: z.ZodObject<{}, z.core.$strip>;
244
+ export declare const userTemplateSchema: z.ZodObject<{
245
+ allowMultiple: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
246
+ }, z.core.$strip>;
192
247
  export declare const sourceTemplateSchema: z.ZodObject<{}, z.core.$strip>;
193
248
  export declare const formulaTemplateSchema: z.ZodObject<{
194
249
  expression: z.ZodString;
@@ -448,6 +503,67 @@ export declare const publicFieldDefinitionSchema: z.ZodDiscriminatedUnion<[z.Zod
448
503
  text: "text";
449
504
  }>>;
450
505
  }, z.core.$strip>;
506
+ }, z.core.$strip>, z.ZodObject<{
507
+ name: z.ZodString;
508
+ type: z.ZodLiteral<"rollup">;
509
+ template: z.ZodObject<{
510
+ linkedRecordFieldId: z.ZodString;
511
+ rollupFieldId: z.ZodString;
512
+ aggregationFormula: z.ZodString;
513
+ formulaExpression: z.ZodOptional<z.ZodString>;
514
+ formatting: z.ZodOptional<z.ZodObject<{
515
+ numberDisplayType: z.ZodOptional<z.ZodEnum<{
516
+ number: "number";
517
+ currency: "currency";
518
+ duration: "duration";
519
+ percent: "percent";
520
+ }>>;
521
+ currencyCode: z.ZodOptional<z.ZodString>;
522
+ decimalPlaces: z.ZodOptional<z.ZodNumber>;
523
+ numberFormat: z.ZodOptional<z.ZodEnum<{
524
+ local: "local";
525
+ comma_period: "comma_period";
526
+ period_comma: "period_comma";
527
+ space_comma: "space_comma";
528
+ space_period: "space_period";
529
+ no_separator: "no_separator";
530
+ }>>;
531
+ displayTimeZone: z.ZodOptional<z.ZodBoolean>;
532
+ dateFormat: z.ZodOptional<z.ZodEnum<{
533
+ local: "local";
534
+ long: "long";
535
+ us: "us";
536
+ european: "european";
537
+ iso: "iso";
538
+ }>>;
539
+ timeFormat: z.ZodOptional<z.ZodEnum<{
540
+ "12h": "12h";
541
+ "24h": "24h";
542
+ }>>;
543
+ timezone: z.ZodOptional<z.ZodString>;
544
+ trueDisplay: z.ZodOptional<z.ZodString>;
545
+ falseDisplay: z.ZodOptional<z.ZodString>;
546
+ }, z.core.$strip>>;
547
+ filterEnabled: z.ZodOptional<z.ZodBoolean>;
548
+ sortEnabled: z.ZodOptional<z.ZodBoolean>;
549
+ resultType: z.ZodOptional<z.ZodEnum<{
550
+ number: "number";
551
+ boolean: "boolean";
552
+ date: "date";
553
+ array: "array";
554
+ text: "text";
555
+ }>>;
556
+ }, z.core.$strip>;
557
+ }, z.core.$strip>, z.ZodObject<{
558
+ name: z.ZodString;
559
+ type: z.ZodLiteral<"updated_by">;
560
+ template: z.ZodObject<{}, z.core.$strip>;
561
+ }, z.core.$strip>, z.ZodObject<{
562
+ name: z.ZodString;
563
+ type: z.ZodLiteral<"user">;
564
+ template: z.ZodObject<{
565
+ allowMultiple: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
566
+ }, z.core.$strip>;
451
567
  }, z.core.$strip>, z.ZodObject<{
452
568
  name: z.ZodString;
453
569
  type: z.ZodLiteral<"source">;
@@ -544,6 +660,9 @@ export type FieldTemplateMap = {
544
660
  percent: z.infer<typeof percentTemplateSchema>;
545
661
  linked_record: z.infer<typeof linkedRecordTemplateSchema>;
546
662
  lookup: z.infer<typeof lookupTemplateSchema>;
663
+ rollup: z.infer<typeof rollupTemplateSchema>;
664
+ updated_by: z.infer<typeof updatedByTemplateSchema>;
665
+ user: z.infer<typeof userTemplateSchema>;
547
666
  source: z.infer<typeof sourceTemplateSchema>;
548
667
  formula: z.infer<typeof formulaTemplateSchema>;
549
668
  autonumber: z.infer<typeof autonumberTemplateSchema>;
@@ -41,6 +41,9 @@ export const fieldTypeEnum = [
41
41
  "autonumber",
42
42
  "created_at",
43
43
  "updated_at",
44
+ "rollup",
45
+ "updated_by",
46
+ "user",
44
47
  ];
45
48
  export const fieldTypeSchema = z.enum(fieldTypeEnum);
46
49
  export const selectOptionSchema = z.object({
@@ -149,6 +152,40 @@ export const lookupTemplateSchema = z.object({
149
152
  .enum(["text", "number", "date", "boolean", "array"])
150
153
  .optional(),
151
154
  });
155
+ export const rollupTemplateSchema = z.object({
156
+ linkedRecordFieldId: z.string().min(1),
157
+ rollupFieldId: z.string().min(1),
158
+ aggregationFormula: z.string().min(1),
159
+ formulaExpression: z.string().optional(),
160
+ formatting: z
161
+ .object({
162
+ numberDisplayType: z
163
+ .enum(["number", "currency", "percent", "duration"])
164
+ .optional(),
165
+ currencyCode: z.string().optional(),
166
+ decimalPlaces: z.number().min(0).max(10).optional(),
167
+ numberFormat: z.enum(numberFormatEnum).optional(),
168
+ displayTimeZone: z.boolean().optional(),
169
+ dateFormat: z.enum(dateFormatEnum).optional(),
170
+ timeFormat: z.enum(timeFormatEnum).optional(),
171
+ timezone: z.string().optional(),
172
+ trueDisplay: z.string().optional(),
173
+ falseDisplay: z.string().optional(),
174
+ })
175
+ .optional(),
176
+ filterEnabled: z.boolean().optional(),
177
+ sortEnabled: z.boolean().optional(),
178
+ resultType: z
179
+ .enum(["text", "number", "date", "boolean", "array"])
180
+ .optional(),
181
+ });
182
+ export const updatedByTemplateSchema = z.object({});
183
+ export const userTemplateSchema = z.object({
184
+ allowMultiple: z
185
+ .boolean()
186
+ .nullish()
187
+ .transform((v) => v ?? false),
188
+ });
152
189
  export const sourceTemplateSchema = z.object({});
153
190
  const formulaFormattingSchema = z
154
191
  .object({
@@ -284,6 +321,18 @@ export const publicFieldDefinitionSchema = z.discriminatedUnion("type", [
284
321
  type: z.literal("lookup"),
285
322
  template: lookupTemplateSchema,
286
323
  }),
324
+ basePublicFieldSchema.extend({
325
+ type: z.literal("rollup"),
326
+ template: rollupTemplateSchema,
327
+ }),
328
+ basePublicFieldSchema.extend({
329
+ type: z.literal("updated_by"),
330
+ template: updatedByTemplateSchema,
331
+ }),
332
+ basePublicFieldSchema.extend({
333
+ type: z.literal("user"),
334
+ template: userTemplateSchema,
335
+ }),
287
336
  basePublicFieldSchema.extend({
288
337
  type: z.literal("source"),
289
338
  template: sourceTemplateSchema,