@erxes/core-contract 0.1.0-v2.3 → 0.1.0-v2.5
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/automations.d.ts +5 -7
- package/dist/automations.js +6 -4
- package/dist/client.d.ts +600 -10
- package/dist/client.js +16 -1
- package/dist/contract/routes.json.js +16 -0
- package/dist/emails.d.ts +105 -0
- package/dist/emails.js +25 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +1 -0
- package/dist/index.d.ts +291 -9
- package/dist/index.js +4 -2
- package/dist/plugins.d.ts +82 -1
- package/dist/plugins.js +14 -3
- package/dist/roles.d.ts +136 -0
- package/dist/roles.js +22 -1
- package/package.json +2 -1
package/dist/automations.d.ts
CHANGED
|
@@ -1773,13 +1773,11 @@ export declare const automationsContract: {
|
|
|
1773
1773
|
}>, Record<never, never>>;
|
|
1774
1774
|
test: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1775
1775
|
id: z.ZodString;
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
id: z.ZodString;
|
|
1782
|
-
}, z.core.$strip>>;
|
|
1776
|
+
subjectType: z.ZodOptional<z.ZodEnum<{
|
|
1777
|
+
company: "company";
|
|
1778
|
+
customer: "customer";
|
|
1779
|
+
}>>;
|
|
1780
|
+
subjectId: z.ZodOptional<z.ZodString>;
|
|
1783
1781
|
payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1784
1782
|
assumeEventHappens: z.ZodDefault<z.ZodBoolean>;
|
|
1785
1783
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/automations.js
CHANGED
|
@@ -145,14 +145,16 @@ const automationsContract = {
|
|
|
145
145
|
summary: "Dry run of the working copy: what each step would do for a record (nothing is changed)"
|
|
146
146
|
}).input(z.object({
|
|
147
147
|
id: Id,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}).optional(),
|
|
148
|
+
/** The record to run for: send both, or neither for a run without one. */
|
|
149
|
+
subjectType: z.enum(CONTENT_TYPES).optional(),
|
|
150
|
+
subjectId: Id.optional(),
|
|
152
151
|
/** Event fields for the trigger (type, payload); defaults to the trigger's event. */
|
|
153
152
|
payload: z.record(z.string(), z.unknown()).optional(),
|
|
154
153
|
/** Pretend waits for events end with the event happening. */
|
|
155
154
|
assumeEventHappens: z.boolean().default(false)
|
|
155
|
+
}).refine((input) => input.subjectType === void 0 === (input.subjectId === void 0), {
|
|
156
|
+
message: "Send subjectType and subjectId together",
|
|
157
|
+
path: ["subjectId"]
|
|
156
158
|
})).output(z.object({
|
|
157
159
|
triggerMatches: z.boolean(),
|
|
158
160
|
goalMetAtStart: z.boolean(),
|