@erxes/core-contract 0.1.0-v2.0 → 0.1.0-v2.1
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.
- package/dist/activities.d.ts +21 -14
- package/dist/activities.js +6 -10
- package/dist/audit.d.ts +13 -17
- package/dist/audit.js +9 -9
- package/dist/auth.d.ts +33 -35
- package/dist/auth.js +8 -7
- package/dist/automationDefinition.d.ts +4 -3
- package/dist/automationDefinition.js +9 -31
- package/dist/automationRuns.d.ts +6 -5
- package/dist/automationRuns.js +8 -22
- package/dist/automations.d.ts +35 -36
- package/dist/automations.js +15 -23
- package/dist/common.d.ts +29 -4
- package/dist/common.js +30 -10
- package/dist/companies.d.ts +34 -34
- package/dist/companies.js +6 -5
- package/dist/contract/routes.json.js +1794 -0
- package/dist/customerAuth.d.ts +222 -0
- package/dist/customerAuth.js +180 -0
- package/dist/customers.d.ts +51 -54
- package/dist/customers.js +7 -12
- package/dist/db/src/enums.d.ts +8 -0
- package/dist/db/src/enums.js +336 -0
- package/dist/db/src/schema/auditStreams.js +6 -14
- package/dist/db/src/schema/authTokens.js +4 -6
- package/dist/db/src/schema/automations.js +12 -28
- package/dist/db/src/schema/common.d.ts +2 -6
- package/dist/db/src/schema/common.js +1 -24
- package/dist/db/src/schema/companies.js +6 -5
- package/dist/db/src/schema/customerAuth.js +101 -0
- package/dist/db/src/schema/customers.js +6 -6
- package/dist/db/src/schema/events.js +12 -60
- package/dist/db/src/schema/fieldValues.js +2 -2
- package/dist/db/src/schema/fields.js +10 -28
- package/dist/db/src/schema/index.js +21 -20
- package/dist/db/src/schema/leadStages.js +5 -10
- package/dist/db/src/schema/leads.js +5 -10
- package/dist/db/src/schema/oauth.js +3 -3
- package/dist/db/src/schema/payments.js +12 -22
- package/dist/db/src/schema/platform.js +11 -26
- package/dist/db/src/schema/plugins.js +4 -4
- package/dist/db/src/schema/products.js +7 -8
- package/dist/db/src/schema/rateLimits.js +7 -0
- package/dist/db/src/schema/saas.js +3 -9
- package/dist/db/src/schema/tags.js +6 -5
- package/dist/db/src/schema/transfer.js +12 -32
- package/dist/db/src/schema/trash.js +6 -7
- package/dist/db/src/schema/users.js +6 -10
- package/dist/db/src/schema/views.js +5 -13
- package/dist/db/src/schema/webhooks.js +7 -14
- package/dist/db/src/table.js +16 -2
- package/dist/events.d.ts +19 -23
- package/dist/events.js +16 -18
- package/dist/fields.d.ts +22 -50
- package/dist/fields.js +6 -28
- package/dist/files.d.ts +10 -5
- package/dist/files.js +4 -3
- package/dist/index.d.ts +557 -321
- package/dist/index.js +17 -16
- package/dist/leads.d.ts +5 -3
- package/dist/leads.js +8 -7
- package/dist/notifications.d.ts +4 -48
- package/dist/notifications.js +7 -73
- package/dist/organizations.d.ts +3 -3
- package/dist/payments.d.ts +28 -58
- package/dist/payments.js +10 -34
- package/dist/platform.d.ts +1 -0
- package/dist/platform.js +2 -5
- package/dist/plugins.d.ts +10 -4
- package/dist/plugins.js +19 -9
- package/dist/products.d.ts +31 -36
- package/dist/products.js +8 -7
- package/dist/roles.d.ts +0 -3
- package/dist/roles.js +5 -5
- package/dist/routes.d.ts +8 -0
- package/dist/routes.js +13 -0
- package/dist/saas.d.ts +0 -6
- package/dist/saas.js +5 -27
- package/dist/tags.d.ts +4 -4
- package/dist/tags.js +3 -3
- package/dist/transfer.d.ts +62 -24
- package/dist/transfer.js +15 -36
- package/dist/trash.d.ts +23 -4
- package/dist/trash.js +5 -5
- package/dist/users.d.ts +27 -41
- package/dist/users.js +13 -26
- package/dist/values.d.ts +159 -0
- package/dist/values.js +144 -0
- package/dist/views.d.ts +8 -8
- package/dist/views.js +8 -21
- package/dist/webhooks.d.ts +26 -20
- package/dist/webhooks.js +18 -11
- package/package.json +4 -1
- package/dist/db/src/schema/jobs.js +0 -44
package/dist/activities.d.ts
CHANGED
|
@@ -27,14 +27,15 @@ export declare const Activity: z.ZodObject<{
|
|
|
27
27
|
summary: z.ZodNullable<z.ZodString>;
|
|
28
28
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
29
29
|
link: z.ZodNullable<z.ZodString>;
|
|
30
|
-
editedAt: z.ZodNullable<z.ZodISODateTime
|
|
31
|
-
occurredAt: z.ZodISODateTime
|
|
30
|
+
editedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
31
|
+
occurredAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
32
32
|
entity: z.ZodNullable<z.ZodObject<{
|
|
33
33
|
type: z.ZodString;
|
|
34
34
|
id: z.ZodString;
|
|
35
35
|
}, z.core.$strip>>;
|
|
36
36
|
actor: z.ZodObject<{
|
|
37
37
|
type: z.ZodEnum<{
|
|
38
|
+
customer: "customer";
|
|
38
39
|
plugin: "plugin";
|
|
39
40
|
system: "system";
|
|
40
41
|
user: "user";
|
|
@@ -132,14 +133,15 @@ export declare const activitiesContract: {
|
|
|
132
133
|
summary: z.ZodNullable<z.ZodString>;
|
|
133
134
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
134
135
|
link: z.ZodNullable<z.ZodString>;
|
|
135
|
-
editedAt: z.ZodNullable<z.ZodISODateTime
|
|
136
|
-
occurredAt: z.ZodISODateTime
|
|
136
|
+
editedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
137
|
+
occurredAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
137
138
|
entity: z.ZodNullable<z.ZodObject<{
|
|
138
139
|
type: z.ZodString;
|
|
139
140
|
id: z.ZodString;
|
|
140
141
|
}, z.core.$strip>>;
|
|
141
142
|
actor: z.ZodObject<{
|
|
142
143
|
type: z.ZodEnum<{
|
|
144
|
+
customer: "customer";
|
|
143
145
|
plugin: "plugin";
|
|
144
146
|
system: "system";
|
|
145
147
|
user: "user";
|
|
@@ -181,14 +183,15 @@ export declare const activitiesContract: {
|
|
|
181
183
|
summary: z.ZodNullable<z.ZodString>;
|
|
182
184
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
183
185
|
link: z.ZodNullable<z.ZodString>;
|
|
184
|
-
editedAt: z.ZodNullable<z.ZodISODateTime
|
|
185
|
-
occurredAt: z.ZodISODateTime
|
|
186
|
+
editedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
187
|
+
occurredAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
186
188
|
entity: z.ZodNullable<z.ZodObject<{
|
|
187
189
|
type: z.ZodString;
|
|
188
190
|
id: z.ZodString;
|
|
189
191
|
}, z.core.$strip>>;
|
|
190
192
|
actor: z.ZodObject<{
|
|
191
193
|
type: z.ZodEnum<{
|
|
194
|
+
customer: "customer";
|
|
192
195
|
plugin: "plugin";
|
|
193
196
|
system: "system";
|
|
194
197
|
user: "user";
|
|
@@ -215,14 +218,15 @@ export declare const activitiesContract: {
|
|
|
215
218
|
summary: z.ZodNullable<z.ZodString>;
|
|
216
219
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
217
220
|
link: z.ZodNullable<z.ZodString>;
|
|
218
|
-
editedAt: z.ZodNullable<z.ZodISODateTime
|
|
219
|
-
occurredAt: z.ZodISODateTime
|
|
221
|
+
editedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
222
|
+
occurredAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
220
223
|
entity: z.ZodNullable<z.ZodObject<{
|
|
221
224
|
type: z.ZodString;
|
|
222
225
|
id: z.ZodString;
|
|
223
226
|
}, z.core.$strip>>;
|
|
224
227
|
actor: z.ZodObject<{
|
|
225
228
|
type: z.ZodEnum<{
|
|
229
|
+
customer: "customer";
|
|
226
230
|
plugin: "plugin";
|
|
227
231
|
system: "system";
|
|
228
232
|
user: "user";
|
|
@@ -267,14 +271,15 @@ export declare const activitiesContract: {
|
|
|
267
271
|
summary: z.ZodNullable<z.ZodString>;
|
|
268
272
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
269
273
|
link: z.ZodNullable<z.ZodString>;
|
|
270
|
-
editedAt: z.ZodNullable<z.ZodISODateTime
|
|
271
|
-
occurredAt: z.ZodISODateTime
|
|
274
|
+
editedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
275
|
+
occurredAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
272
276
|
entity: z.ZodNullable<z.ZodObject<{
|
|
273
277
|
type: z.ZodString;
|
|
274
278
|
id: z.ZodString;
|
|
275
279
|
}, z.core.$strip>>;
|
|
276
280
|
actor: z.ZodObject<{
|
|
277
281
|
type: z.ZodEnum<{
|
|
282
|
+
customer: "customer";
|
|
278
283
|
plugin: "plugin";
|
|
279
284
|
system: "system";
|
|
280
285
|
user: "user";
|
|
@@ -324,14 +329,15 @@ export declare const activitiesContract: {
|
|
|
324
329
|
summary: z.ZodNullable<z.ZodString>;
|
|
325
330
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
326
331
|
link: z.ZodNullable<z.ZodString>;
|
|
327
|
-
editedAt: z.ZodNullable<z.ZodISODateTime
|
|
328
|
-
occurredAt: z.ZodISODateTime
|
|
332
|
+
editedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
333
|
+
occurredAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
329
334
|
entity: z.ZodNullable<z.ZodObject<{
|
|
330
335
|
type: z.ZodString;
|
|
331
336
|
id: z.ZodString;
|
|
332
337
|
}, z.core.$strip>>;
|
|
333
338
|
actor: z.ZodObject<{
|
|
334
339
|
type: z.ZodEnum<{
|
|
340
|
+
customer: "customer";
|
|
335
341
|
plugin: "plugin";
|
|
336
342
|
system: "system";
|
|
337
343
|
user: "user";
|
|
@@ -362,14 +368,15 @@ export declare const activitiesContract: {
|
|
|
362
368
|
summary: z.ZodNullable<z.ZodString>;
|
|
363
369
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
364
370
|
link: z.ZodNullable<z.ZodString>;
|
|
365
|
-
editedAt: z.ZodNullable<z.ZodISODateTime
|
|
366
|
-
occurredAt: z.ZodISODateTime
|
|
371
|
+
editedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
372
|
+
occurredAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
367
373
|
entity: z.ZodNullable<z.ZodObject<{
|
|
368
374
|
type: z.ZodString;
|
|
369
375
|
id: z.ZodString;
|
|
370
376
|
}, z.core.$strip>>;
|
|
371
377
|
actor: z.ZodObject<{
|
|
372
378
|
type: z.ZodEnum<{
|
|
379
|
+
customer: "customer";
|
|
373
380
|
plugin: "plugin";
|
|
374
381
|
system: "system";
|
|
375
382
|
user: "user";
|
package/dist/activities.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ACTIVITY_TARGETS, TIMELINE_KINDS } from "./db/src/enums.js";
|
|
1
2
|
import { activities } from "./db/src/schema/platform.js";
|
|
2
3
|
import "./db/src/schema/index.js";
|
|
3
|
-
import { CursorQuery, Id, cursorPageOf, isoDate } from "./common.js";
|
|
4
|
+
import { CursorQuery, Id, QueryFlag, cursorPageOf, isoDate } from "./common.js";
|
|
4
5
|
import { ActorRef, AppLink, DedupeKey, EntityRef, EventType } from "./platform.js";
|
|
5
6
|
import { oc } from "@orpc/contract";
|
|
6
7
|
import { createSelectSchema, createUpdateSchema } from "drizzle-zod";
|
|
7
8
|
import { z } from "zod";
|
|
8
9
|
// src/activities.ts
|
|
9
|
-
const ActivityTarget = z.enum(
|
|
10
|
+
const ActivityTarget = z.enum(ACTIVITY_TARGETS);
|
|
10
11
|
/**
|
|
11
12
|
* What a timeline is about: a customer or company, or a plugin's own record
|
|
12
13
|
* type declared in its manifest (`hr.employee`, `ecom.order`).
|
|
@@ -70,12 +71,7 @@ const NoteInput = z.object({
|
|
|
70
71
|
fileIds: z.array(Id).max(20).default([])
|
|
71
72
|
});
|
|
72
73
|
/** Which entries a timeline shows. */
|
|
73
|
-
const TimelineKind = z.enum(
|
|
74
|
-
"all",
|
|
75
|
-
"notes",
|
|
76
|
-
"changes",
|
|
77
|
-
"plugins"
|
|
78
|
-
]);
|
|
74
|
+
const TimelineKind = z.enum(TIMELINE_KINDS);
|
|
79
75
|
const ActivityInput = createUpdateSchema(activities, {
|
|
80
76
|
targetType: () => TimelineTarget,
|
|
81
77
|
targetId: () => Id,
|
|
@@ -125,9 +121,9 @@ const activitiesContract = {
|
|
|
125
121
|
to: z.iso.datetime().optional(),
|
|
126
122
|
kind: TimelineKind.default("all"),
|
|
127
123
|
/** Pinned notes only. */
|
|
128
|
-
pinned:
|
|
124
|
+
pinned: QueryFlag.optional(),
|
|
129
125
|
/** A company's timeline with its customers' entries too. */
|
|
130
|
-
includeRelated:
|
|
126
|
+
includeRelated: QueryFlag.optional()
|
|
131
127
|
})).output(cursorPageOf(Activity)),
|
|
132
128
|
addNote: oc.route({
|
|
133
129
|
method: "POST",
|
package/dist/audit.d.ts
CHANGED
|
@@ -10,9 +10,10 @@ export declare const AuditEntry: z.ZodObject<{
|
|
|
10
10
|
ip: z.ZodNullable<z.ZodString>;
|
|
11
11
|
userAgent: z.ZodNullable<z.ZodString>;
|
|
12
12
|
source: z.ZodString;
|
|
13
|
-
createdAt: z.ZodISODateTime
|
|
13
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
14
14
|
actor: z.ZodObject<{
|
|
15
15
|
type: z.ZodEnum<{
|
|
16
|
+
customer: "customer";
|
|
16
17
|
plugin: "plugin";
|
|
17
18
|
system: "system";
|
|
18
19
|
user: "user";
|
|
@@ -26,12 +27,6 @@ export declare const AuditEntry: z.ZodObject<{
|
|
|
26
27
|
in: {};
|
|
27
28
|
}>;
|
|
28
29
|
export type AuditEntry = z.infer<typeof AuditEntry>;
|
|
29
|
-
/** Who changed what in core (owners and admins). */
|
|
30
|
-
export declare const AuditStreamFormat: z.ZodEnum<{
|
|
31
|
-
datadog: "datadog";
|
|
32
|
-
erxes: "erxes";
|
|
33
|
-
splunk: "splunk";
|
|
34
|
-
}>;
|
|
35
30
|
export declare const AuditStream: z.ZodObject<{
|
|
36
31
|
id: z.ZodString;
|
|
37
32
|
name: z.ZodString;
|
|
@@ -47,10 +42,10 @@ export declare const AuditStream: z.ZodObject<{
|
|
|
47
42
|
paused: "paused";
|
|
48
43
|
}>;
|
|
49
44
|
cursorSeq: z.ZodInt;
|
|
50
|
-
lastDeliveredAt: z.ZodNullable<z.ZodISODateTime
|
|
45
|
+
lastDeliveredAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
51
46
|
lastError: z.ZodNullable<z.ZodString>;
|
|
52
47
|
consecutiveFailures: z.ZodInt;
|
|
53
|
-
createdAt: z.ZodISODateTime
|
|
48
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
54
49
|
pending: z.ZodInt;
|
|
55
50
|
}, {
|
|
56
51
|
out: {};
|
|
@@ -90,9 +85,10 @@ export declare const auditContract: {
|
|
|
90
85
|
ip: z.ZodNullable<z.ZodString>;
|
|
91
86
|
userAgent: z.ZodNullable<z.ZodString>;
|
|
92
87
|
source: z.ZodString;
|
|
93
|
-
createdAt: z.ZodISODateTime
|
|
88
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
94
89
|
actor: z.ZodObject<{
|
|
95
90
|
type: z.ZodEnum<{
|
|
91
|
+
customer: "customer";
|
|
96
92
|
plugin: "plugin";
|
|
97
93
|
system: "system";
|
|
98
94
|
user: "user";
|
|
@@ -149,7 +145,7 @@ export declare const auditContract: {
|
|
|
149
145
|
hash: z.ZodString;
|
|
150
146
|
keyId: z.ZodString;
|
|
151
147
|
signature: z.ZodString;
|
|
152
|
-
createdAt: z.ZodISODateTime
|
|
148
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
153
149
|
}, z.core.$strip>>;
|
|
154
150
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
155
151
|
settings: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
|
@@ -178,10 +174,10 @@ export declare const auditContract: {
|
|
|
178
174
|
paused: "paused";
|
|
179
175
|
}>;
|
|
180
176
|
cursorSeq: z.ZodInt;
|
|
181
|
-
lastDeliveredAt: z.ZodNullable<z.ZodISODateTime
|
|
177
|
+
lastDeliveredAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
182
178
|
lastError: z.ZodNullable<z.ZodString>;
|
|
183
179
|
consecutiveFailures: z.ZodInt;
|
|
184
|
-
createdAt: z.ZodISODateTime
|
|
180
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
185
181
|
pending: z.ZodInt;
|
|
186
182
|
}, {
|
|
187
183
|
out: {};
|
|
@@ -223,10 +219,10 @@ export declare const auditContract: {
|
|
|
223
219
|
paused: "paused";
|
|
224
220
|
}>;
|
|
225
221
|
cursorSeq: z.ZodInt;
|
|
226
|
-
lastDeliveredAt: z.ZodNullable<z.ZodISODateTime
|
|
222
|
+
lastDeliveredAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
227
223
|
lastError: z.ZodNullable<z.ZodString>;
|
|
228
224
|
consecutiveFailures: z.ZodInt;
|
|
229
|
-
createdAt: z.ZodISODateTime
|
|
225
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
230
226
|
pending: z.ZodInt;
|
|
231
227
|
}, {
|
|
232
228
|
out: {};
|
|
@@ -269,10 +265,10 @@ export declare const auditContract: {
|
|
|
269
265
|
paused: "paused";
|
|
270
266
|
}>;
|
|
271
267
|
cursorSeq: z.ZodInt;
|
|
272
|
-
lastDeliveredAt: z.ZodNullable<z.ZodISODateTime
|
|
268
|
+
lastDeliveredAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
273
269
|
lastError: z.ZodNullable<z.ZodString>;
|
|
274
270
|
consecutiveFailures: z.ZodInt;
|
|
275
|
-
createdAt: z.ZodISODateTime
|
|
271
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
276
272
|
pending: z.ZodInt;
|
|
277
273
|
}, {
|
|
278
274
|
out: {};
|
package/dist/audit.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { AUDIT_STREAM_STARTS } from "./db/src/enums.js";
|
|
1
2
|
import { auditLogs } from "./db/src/schema/platform.js";
|
|
2
|
-
import {
|
|
3
|
+
import { auditStreams } from "./db/src/schema/auditStreams.js";
|
|
3
4
|
import "./db/src/schema/index.js";
|
|
4
|
-
import {
|
|
5
|
+
import { AuditStreamFormat } from "./values.js";
|
|
6
|
+
import { CursorQuery, Id, cursorPageOf, isoDate, listOf } from "./common.js";
|
|
5
7
|
import { ActorRef } from "./platform.js";
|
|
6
8
|
import { oc } from "@orpc/contract";
|
|
7
9
|
import { createSelectSchema, createUpdateSchema } from "drizzle-zod";
|
|
@@ -28,8 +30,6 @@ const AuditEntry = createSelectSchema(auditLogs, {
|
|
|
28
30
|
source: true,
|
|
29
31
|
createdAt: true
|
|
30
32
|
}).extend({ actor: ActorRef });
|
|
31
|
-
/** Who changed what in core (owners and admins). */
|
|
32
|
-
const AuditStreamFormat = z.enum(AUDIT_STREAM_FORMATS);
|
|
33
33
|
const StreamUrl = z.string().trim().check(z.url()).max(2e3).refine((value) => /^https?:\/\//.test(value), "an http(s) address");
|
|
34
34
|
/** A header the log service needs (`DD-API-KEY`, `Authorization: Splunk …`); its value is write-only. */
|
|
35
35
|
const AuthHeader = z.object({
|
|
@@ -138,8 +138,8 @@ totalCapped: z.boolean() })),
|
|
|
138
138
|
hash: z.string(),
|
|
139
139
|
keyId: z.string(),
|
|
140
140
|
signature: z.string(),
|
|
141
|
-
createdAt:
|
|
142
|
-
})) })),
|
|
141
|
+
createdAt: isoDate()
|
|
142
|
+
})).max(1e3) })),
|
|
143
143
|
settings: oc.route({
|
|
144
144
|
method: "GET",
|
|
145
145
|
path: "/settings/audit",
|
|
@@ -160,7 +160,7 @@ totalCapped: z.boolean() })),
|
|
|
160
160
|
method: "GET",
|
|
161
161
|
path: "/audit/streams",
|
|
162
162
|
summary: "Where the audit log is streamed (owners)"
|
|
163
|
-
}).output(
|
|
163
|
+
}).output(listOf(AuditStream)),
|
|
164
164
|
createStream: oc.route({
|
|
165
165
|
method: "POST",
|
|
166
166
|
path: "/audit/streams",
|
|
@@ -173,7 +173,7 @@ totalCapped: z.boolean() })),
|
|
|
173
173
|
format: AuditStreamFormat.default("erxes"),
|
|
174
174
|
authHeader: AuthHeader.optional(),
|
|
175
175
|
/** `now`: entries from here on; `beginning`: everything still kept, then new ones. */
|
|
176
|
-
from: z.enum(
|
|
176
|
+
from: z.enum(AUDIT_STREAM_STARTS).default("now")
|
|
177
177
|
})).output(z.object({
|
|
178
178
|
stream: AuditStream,
|
|
179
179
|
secret: z.string()
|
|
@@ -201,4 +201,4 @@ totalCapped: z.boolean() })),
|
|
|
201
201
|
ms: z.number().nullable()
|
|
202
202
|
}))
|
|
203
203
|
};
|
|
204
|
-
export { AuditEntry, AuditStream,
|
|
204
|
+
export { AuditEntry, AuditStream, auditContract };
|
package/dist/auth.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ export declare const Session: z.ZodObject<{
|
|
|
22
22
|
disabled: "disabled";
|
|
23
23
|
invited: "invited";
|
|
24
24
|
}>;
|
|
25
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
26
|
-
createdAt: z.ZodISODateTime
|
|
27
|
-
updatedAt: z.ZodISODateTime
|
|
25
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
26
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
27
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
28
28
|
twoFactorEnabled: z.ZodBoolean;
|
|
29
29
|
}, {
|
|
30
30
|
out: {};
|
|
@@ -36,7 +36,7 @@ export declare const Session: z.ZodObject<{
|
|
|
36
36
|
name: z.ZodString;
|
|
37
37
|
country: z.ZodNullable<z.ZodString>;
|
|
38
38
|
currency: z.ZodString;
|
|
39
|
-
createdAt: z.ZodISODateTime
|
|
39
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
40
40
|
}, {
|
|
41
41
|
out: {};
|
|
42
42
|
in: {};
|
|
@@ -44,8 +44,6 @@ export declare const Session: z.ZodObject<{
|
|
|
44
44
|
permissions: z.ZodArray<z.ZodString>;
|
|
45
45
|
}, z.core.$strip>;
|
|
46
46
|
export type Session = z.infer<typeof Session>;
|
|
47
|
-
/** At least 8 characters with a lower-case letter, an upper-case letter and a digit (as old erxes). */
|
|
48
|
-
export declare const NewPassword: z.ZodString;
|
|
49
47
|
export declare const authContract: {
|
|
50
48
|
setupStatus: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
|
51
49
|
required: z.ZodBoolean;
|
|
@@ -85,9 +83,9 @@ export declare const authContract: {
|
|
|
85
83
|
disabled: "disabled";
|
|
86
84
|
invited: "invited";
|
|
87
85
|
}>;
|
|
88
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
89
|
-
createdAt: z.ZodISODateTime
|
|
90
|
-
updatedAt: z.ZodISODateTime
|
|
86
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
87
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
88
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
91
89
|
twoFactorEnabled: z.ZodBoolean;
|
|
92
90
|
}, {
|
|
93
91
|
out: {};
|
|
@@ -99,7 +97,7 @@ export declare const authContract: {
|
|
|
99
97
|
name: z.ZodString;
|
|
100
98
|
country: z.ZodNullable<z.ZodString>;
|
|
101
99
|
currency: z.ZodString;
|
|
102
|
-
createdAt: z.ZodISODateTime
|
|
100
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
103
101
|
}, {
|
|
104
102
|
out: {};
|
|
105
103
|
in: {};
|
|
@@ -133,9 +131,9 @@ export declare const authContract: {
|
|
|
133
131
|
disabled: "disabled";
|
|
134
132
|
invited: "invited";
|
|
135
133
|
}>;
|
|
136
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
137
|
-
createdAt: z.ZodISODateTime
|
|
138
|
-
updatedAt: z.ZodISODateTime
|
|
134
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
135
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
136
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
139
137
|
twoFactorEnabled: z.ZodBoolean;
|
|
140
138
|
}, {
|
|
141
139
|
out: {};
|
|
@@ -147,7 +145,7 @@ export declare const authContract: {
|
|
|
147
145
|
name: z.ZodString;
|
|
148
146
|
country: z.ZodNullable<z.ZodString>;
|
|
149
147
|
currency: z.ZodString;
|
|
150
|
-
createdAt: z.ZodISODateTime
|
|
148
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
151
149
|
}, {
|
|
152
150
|
out: {};
|
|
153
151
|
in: {};
|
|
@@ -189,9 +187,9 @@ export declare const authContract: {
|
|
|
189
187
|
disabled: "disabled";
|
|
190
188
|
invited: "invited";
|
|
191
189
|
}>;
|
|
192
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
193
|
-
createdAt: z.ZodISODateTime
|
|
194
|
-
updatedAt: z.ZodISODateTime
|
|
190
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
191
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
192
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
195
193
|
twoFactorEnabled: z.ZodBoolean;
|
|
196
194
|
}, {
|
|
197
195
|
out: {};
|
|
@@ -203,7 +201,7 @@ export declare const authContract: {
|
|
|
203
201
|
name: z.ZodString;
|
|
204
202
|
country: z.ZodNullable<z.ZodString>;
|
|
205
203
|
currency: z.ZodString;
|
|
206
|
-
createdAt: z.ZodISODateTime
|
|
204
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
207
205
|
}, {
|
|
208
206
|
out: {};
|
|
209
207
|
in: {};
|
|
@@ -245,9 +243,9 @@ export declare const authContract: {
|
|
|
245
243
|
disabled: "disabled";
|
|
246
244
|
invited: "invited";
|
|
247
245
|
}>;
|
|
248
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
249
|
-
createdAt: z.ZodISODateTime
|
|
250
|
-
updatedAt: z.ZodISODateTime
|
|
246
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
247
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
248
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
251
249
|
twoFactorEnabled: z.ZodBoolean;
|
|
252
250
|
}, {
|
|
253
251
|
out: {};
|
|
@@ -259,7 +257,7 @@ export declare const authContract: {
|
|
|
259
257
|
name: z.ZodString;
|
|
260
258
|
country: z.ZodNullable<z.ZodString>;
|
|
261
259
|
currency: z.ZodString;
|
|
262
|
-
createdAt: z.ZodISODateTime
|
|
260
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
263
261
|
}, {
|
|
264
262
|
out: {};
|
|
265
263
|
in: {};
|
|
@@ -293,9 +291,9 @@ export declare const authContract: {
|
|
|
293
291
|
disabled: "disabled";
|
|
294
292
|
invited: "invited";
|
|
295
293
|
}>;
|
|
296
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
297
|
-
createdAt: z.ZodISODateTime
|
|
298
|
-
updatedAt: z.ZodISODateTime
|
|
294
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
295
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
296
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
299
297
|
twoFactorEnabled: z.ZodBoolean;
|
|
300
298
|
}, {
|
|
301
299
|
out: {};
|
|
@@ -307,7 +305,7 @@ export declare const authContract: {
|
|
|
307
305
|
name: z.ZodString;
|
|
308
306
|
country: z.ZodNullable<z.ZodString>;
|
|
309
307
|
currency: z.ZodString;
|
|
310
|
-
createdAt: z.ZodISODateTime
|
|
308
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
311
309
|
}, {
|
|
312
310
|
out: {};
|
|
313
311
|
in: {};
|
|
@@ -362,9 +360,9 @@ export declare const authContract: {
|
|
|
362
360
|
disabled: "disabled";
|
|
363
361
|
invited: "invited";
|
|
364
362
|
}>;
|
|
365
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
366
|
-
createdAt: z.ZodISODateTime
|
|
367
|
-
updatedAt: z.ZodISODateTime
|
|
363
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
364
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
365
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
368
366
|
twoFactorEnabled: z.ZodBoolean;
|
|
369
367
|
}, {
|
|
370
368
|
out: {};
|
|
@@ -376,7 +374,7 @@ export declare const authContract: {
|
|
|
376
374
|
name: z.ZodString;
|
|
377
375
|
country: z.ZodNullable<z.ZodString>;
|
|
378
376
|
currency: z.ZodString;
|
|
379
|
-
createdAt: z.ZodISODateTime
|
|
377
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
380
378
|
}, {
|
|
381
379
|
out: {};
|
|
382
380
|
in: {};
|
|
@@ -412,9 +410,9 @@ export declare const authContract: {
|
|
|
412
410
|
disabled: "disabled";
|
|
413
411
|
invited: "invited";
|
|
414
412
|
}>;
|
|
415
|
-
onboardedAt: z.ZodNullable<z.ZodISODateTime
|
|
416
|
-
createdAt: z.ZodISODateTime
|
|
417
|
-
updatedAt: z.ZodISODateTime
|
|
413
|
+
onboardedAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
|
|
414
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
415
|
+
updatedAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
418
416
|
twoFactorEnabled: z.ZodBoolean;
|
|
419
417
|
}, {
|
|
420
418
|
out: {};
|
|
@@ -426,7 +424,7 @@ export declare const authContract: {
|
|
|
426
424
|
name: z.ZodString;
|
|
427
425
|
country: z.ZodNullable<z.ZodString>;
|
|
428
426
|
currency: z.ZodString;
|
|
429
|
-
createdAt: z.ZodISODateTime
|
|
427
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
430
428
|
}, {
|
|
431
429
|
out: {};
|
|
432
430
|
in: {};
|
|
@@ -445,7 +443,7 @@ export declare const authContract: {
|
|
|
445
443
|
success: z.ZodBoolean;
|
|
446
444
|
ip: z.ZodNullable<z.ZodString>;
|
|
447
445
|
userAgent: z.ZodNullable<z.ZodString>;
|
|
448
|
-
createdAt: z.ZodISODateTime
|
|
446
|
+
createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
|
|
449
447
|
}, z.core.$strip>>;
|
|
450
448
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
451
449
|
};
|
package/dist/auth.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { LANGUAGES } from "./db/src/enums.js";
|
|
2
|
+
import { isoDate } from "./common.js";
|
|
3
|
+
import { NewPassword } from "./values.js";
|
|
1
4
|
import { Organization, OrganizationRegion } from "./organizations.js";
|
|
2
5
|
import { User } from "./users.js";
|
|
3
6
|
import { oc } from "@orpc/contract";
|
|
@@ -9,8 +12,6 @@ const Session = z.object({
|
|
|
9
12
|
/** What the member may do (actions); owners have every one. */
|
|
10
13
|
permissions: z.array(z.string())
|
|
11
14
|
});
|
|
12
|
-
/** At least 8 characters with a lower-case letter, an upper-case letter and a digit (as old erxes). */
|
|
13
|
-
const NewPassword = z.string().min(8, "At least 8 characters").max(200).regex(/[a-z]/, "Add a lower-case letter").regex(/[A-Z]/, "Add an upper-case letter").regex(/\d/, "Add a digit");
|
|
14
15
|
const authContract = {
|
|
15
16
|
setupStatus: oc.route({
|
|
16
17
|
method: "GET",
|
|
@@ -134,7 +135,7 @@ const authContract = {
|
|
|
134
135
|
/** Fill a fresh organisation with example contacts, notes and an automation (owners; once, while it has no contacts). */
|
|
135
136
|
exampleData: z.boolean().optional(),
|
|
136
137
|
/** The language of the example data: the member's UI language. */
|
|
137
|
-
language: z.enum(
|
|
138
|
+
language: z.enum(LANGUAGES).optional()
|
|
138
139
|
}).optional()).output(Session),
|
|
139
140
|
changePassword: oc.route({
|
|
140
141
|
method: "POST",
|
|
@@ -147,13 +148,13 @@ const authContract = {
|
|
|
147
148
|
signIns: oc.route({
|
|
148
149
|
method: "GET",
|
|
149
150
|
path: "/auth/sign-ins",
|
|
150
|
-
summary: "My recent sign-ins and failed attempts, newest first"
|
|
151
|
+
summary: "My 15 most recent sign-ins and failed attempts, newest first"
|
|
151
152
|
}).output(z.object({ data: z.array(z.object({
|
|
152
153
|
id: z.string(),
|
|
153
154
|
success: z.boolean(),
|
|
154
155
|
ip: z.string().nullable(),
|
|
155
156
|
userAgent: z.string().nullable(),
|
|
156
|
-
createdAt:
|
|
157
|
-
})) }))
|
|
157
|
+
createdAt: isoDate()
|
|
158
|
+
})).max(15) }))
|
|
158
159
|
};
|
|
159
|
-
export {
|
|
160
|
+
export { Session, authContract };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CONDITION_OPERATORS,
|
|
1
|
+
import { CONDITION_OPERATORS, DELAY_UNITS } from "./db/src/enums.js";
|
|
2
|
+
import { ConditionGroup as ConditionGroup$1 } from "./db/src/schema/common.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
/** Where a condition or template reads from: `event.payload.amount`, `subject.primaryEmail`, `steps.s2.output.id`. */
|
|
4
5
|
export declare const ContextPath: z.ZodString;
|
|
@@ -74,7 +75,7 @@ export type AutomationStep = {
|
|
|
74
75
|
id: string;
|
|
75
76
|
type: 'delay';
|
|
76
77
|
amount?: number;
|
|
77
|
-
unit?:
|
|
78
|
+
unit?: (typeof DELAY_UNITS)[number];
|
|
78
79
|
until?: string;
|
|
79
80
|
label?: string;
|
|
80
81
|
} | {
|
|
@@ -85,7 +86,7 @@ export type AutomationStep = {
|
|
|
85
86
|
conditions?: ConditionGroup;
|
|
86
87
|
/** Give up after this long (the step's output says `matched: false`). */
|
|
87
88
|
amount: number;
|
|
88
|
-
unit:
|
|
89
|
+
unit: (typeof DELAY_UNITS)[number];
|
|
89
90
|
label?: string;
|
|
90
91
|
} | {
|
|
91
92
|
id: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CONDITION_OPERATORS } from "./db/src/
|
|
2
|
-
import "./db/src/schema/index.js";
|
|
1
|
+
import { CONDITION_MATCHES, CONDITION_OPERATORS, CONTENT_TYPES, DELAY_UNITS, REENTRY_RULES, RELATIVE_DATE_UNITS, SCHEDULE_INTERVALS } from "./db/src/enums.js";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
// src/automationDefinition.ts
|
|
5
4
|
/** Where a condition or template reads from: `event.payload.amount`, `subject.primaryEmail`, `steps.s2.output.id`. */
|
|
@@ -8,11 +7,7 @@ const ConditionOperator = z.enum(CONDITION_OPERATORS);
|
|
|
8
7
|
/** The value of a relative-date rule: "within the last 30 days". */
|
|
9
8
|
const RelativeAmount = z.object({
|
|
10
9
|
amount: z.int().min(0).max(3650),
|
|
11
|
-
unit: z.enum(
|
|
12
|
-
"days",
|
|
13
|
-
"weeks",
|
|
14
|
-
"months"
|
|
15
|
-
]).default("days")
|
|
10
|
+
unit: z.enum(RELATIVE_DATE_UNITS).default("days")
|
|
16
11
|
});
|
|
17
12
|
const ConditionRule = z.object({
|
|
18
13
|
path: ContextPath,
|
|
@@ -21,18 +16,14 @@ const ConditionRule = z.object({
|
|
|
21
16
|
});
|
|
22
17
|
/** Rules (or nested groups) that must all, or any, hold. */
|
|
23
18
|
const ConditionGroup = z.lazy(() => z.object({
|
|
24
|
-
match: z.enum(
|
|
19
|
+
match: z.enum(CONDITION_MATCHES),
|
|
25
20
|
rules: z.array(z.union([ConditionRule, ConditionGroup])).max(50)
|
|
26
21
|
}));
|
|
27
22
|
const StepId = z.string().regex(/^[a-z0-9]{1,24}$/i, "letters and digits");
|
|
28
23
|
const Label = z.string().trim().max(100).optional();
|
|
29
24
|
const Duration = {
|
|
30
25
|
amount: z.int().min(1).max(1e4),
|
|
31
|
-
unit: z.enum(
|
|
32
|
-
"minutes",
|
|
33
|
-
"hours",
|
|
34
|
-
"days"
|
|
35
|
-
])
|
|
26
|
+
unit: z.enum(DELAY_UNITS)
|
|
36
27
|
};
|
|
37
28
|
/**
|
|
38
29
|
* Action input: values, or text with `{{subject.firstName}}`-style
|
|
@@ -52,11 +43,7 @@ const AutomationStep = z.lazy(() => z.discriminatedUnion("type", [
|
|
|
52
43
|
id: StepId,
|
|
53
44
|
type: z.literal("delay"),
|
|
54
45
|
amount: z.int().min(1).max(1e4).optional(),
|
|
55
|
-
unit: z.enum(
|
|
56
|
-
"minutes",
|
|
57
|
-
"hours",
|
|
58
|
-
"days"
|
|
59
|
-
]).optional(),
|
|
46
|
+
unit: z.enum(DELAY_UNITS).optional(),
|
|
60
47
|
/** A date to wait until (template allowed), instead of an amount. */
|
|
61
48
|
until: z.string().max(200).optional(),
|
|
62
49
|
label: Label
|
|
@@ -116,7 +103,7 @@ const TimeZone = z.string().max(60).refine((zone) => {
|
|
|
116
103
|
}, "a time zone like Asia/Ulaanbaatar");
|
|
117
104
|
/** Which records a scheduled or manual run goes through: none (one run), or each matching customer/company. */
|
|
118
105
|
const Audience = z.object({
|
|
119
|
-
type: z.enum(
|
|
106
|
+
type: z.enum(CONTENT_TYPES),
|
|
120
107
|
/** Conditions on `subject.*`; empty: every record. */
|
|
121
108
|
conditions: ConditionGroup.optional()
|
|
122
109
|
});
|
|
@@ -128,12 +115,7 @@ const AutomationTrigger = z.discriminatedUnion("kind", [
|
|
|
128
115
|
}),
|
|
129
116
|
z.object({
|
|
130
117
|
kind: z.literal("schedule"),
|
|
131
|
-
every: z.enum(
|
|
132
|
-
"hour",
|
|
133
|
-
"day",
|
|
134
|
-
"week",
|
|
135
|
-
"month"
|
|
136
|
-
]),
|
|
118
|
+
every: z.enum(SCHEDULE_INTERVALS),
|
|
137
119
|
at: TimeOfDay.default("09:00"),
|
|
138
120
|
/** 1 = Monday … 7 = Sunday (week). */
|
|
139
121
|
weekdays: z.array(z.int().min(1).max(7)).max(7).optional(),
|
|
@@ -143,7 +125,7 @@ const AutomationTrigger = z.discriminatedUnion("kind", [
|
|
|
143
125
|
}),
|
|
144
126
|
z.object({
|
|
145
127
|
kind: z.literal("date"),
|
|
146
|
-
subject: z.enum(
|
|
128
|
+
subject: z.enum(CONTENT_TYPES),
|
|
147
129
|
/** `birthDate` or a date custom field's id. */
|
|
148
130
|
field: z.string().min(1).max(64),
|
|
149
131
|
/** Days after (positive) or before (negative) the date. */
|
|
@@ -163,11 +145,7 @@ const AutomationTrigger = z.discriminatedUnion("kind", [
|
|
|
163
145
|
* When the same customer or company may run through again:
|
|
164
146
|
* every time, only once ever, or once a day.
|
|
165
147
|
*/
|
|
166
|
-
const Reentry = z.enum(
|
|
167
|
-
"always",
|
|
168
|
-
"once",
|
|
169
|
-
"daily"
|
|
170
|
-
]);
|
|
148
|
+
const Reentry = z.enum(REENTRY_RULES);
|
|
171
149
|
const AutomationDefinition = z.object({
|
|
172
150
|
trigger: AutomationTrigger,
|
|
173
151
|
steps: z.array(AutomationStep).min(1).max(100),
|