skedyul 1.7.9 → 1.7.12
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/.build-stamp +1 -1
- package/dist/cli/index.js +17 -6
- package/dist/config/types/batch-operation.d.ts +44 -2
- package/dist/core/client.d.ts +36 -0
- package/dist/dedicated/server.js +16 -6
- package/dist/esm/index.mjs +60 -6
- package/dist/events/types.d.ts +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +61 -6
- package/dist/schemas/agent-schema-v3.d.ts +4 -0
- package/dist/schemas/agent-schema-v3.js +1 -0
- package/dist/schemas/agent-schema-v3.mjs +1 -0
- package/dist/schemas.d.ts +37 -0
- package/dist/server.js +16 -6
- package/dist/serverless/server.mjs +16 -6
- package/dist/triggers/types.d.ts +3 -0
- package/dist/types/batch-operation.d.ts +6 -3
- package/dist/workflows/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1786072268866
|
package/dist/cli/index.js
CHANGED
|
@@ -4781,7 +4781,11 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
4781
4781
|
status: 200,
|
|
4782
4782
|
body: {
|
|
4783
4783
|
success: true,
|
|
4784
|
-
result: {
|
|
4784
|
+
result: {
|
|
4785
|
+
state: {},
|
|
4786
|
+
total: void 0,
|
|
4787
|
+
cascade: operation.cascade
|
|
4788
|
+
},
|
|
4785
4789
|
billing: normalizeBilling(void 0)
|
|
4786
4790
|
}
|
|
4787
4791
|
};
|
|
@@ -4804,20 +4808,26 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
4804
4808
|
status: 200,
|
|
4805
4809
|
body: {
|
|
4806
4810
|
success: true,
|
|
4807
|
-
result:
|
|
4811
|
+
result: {
|
|
4812
|
+
...domain2,
|
|
4813
|
+
// Expose definition cascade to the platform workflow
|
|
4814
|
+
cascade: operation.cascade ?? domain2.cascade
|
|
4815
|
+
},
|
|
4808
4816
|
billing: normalizeBilling(setupResult.billing)
|
|
4809
4817
|
}
|
|
4810
4818
|
};
|
|
4811
4819
|
}
|
|
4820
|
+
const iterateBody = body;
|
|
4812
4821
|
const raw = await runWithConfig(requestConfig, async () => {
|
|
4813
4822
|
return runWithRateLimitExecutionContext(rateLimitContext, async () => {
|
|
4814
4823
|
return runWithLogContext({ invocation }, async () => {
|
|
4815
4824
|
return operation.iterate({
|
|
4816
4825
|
...opContextBase,
|
|
4817
|
-
state:
|
|
4818
|
-
page:
|
|
4819
|
-
cursor:
|
|
4820
|
-
limit:
|
|
4826
|
+
state: iterateBody.state,
|
|
4827
|
+
page: iterateBody.page,
|
|
4828
|
+
cursor: iterateBody.cursor,
|
|
4829
|
+
limit: iterateBody.limit,
|
|
4830
|
+
cascadeEntities: iterateBody.cascadeEntities
|
|
4821
4831
|
});
|
|
4822
4832
|
});
|
|
4823
4833
|
});
|
|
@@ -10103,6 +10113,7 @@ var ThreadEventTypeSchema = import_v44.z.enum([
|
|
|
10103
10113
|
// Message events
|
|
10104
10114
|
"thread.message.received",
|
|
10105
10115
|
"thread.message.sent",
|
|
10116
|
+
"thread.attachment.received",
|
|
10106
10117
|
// Participant events
|
|
10107
10118
|
"thread.participant.joined",
|
|
10108
10119
|
"thread.participant.left",
|
|
@@ -42,17 +42,48 @@ export interface BatchOperationSetupResult {
|
|
|
42
42
|
state?: Record<string, unknown>;
|
|
43
43
|
/** Optional total count for progress display */
|
|
44
44
|
total?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Cascade phases (usually injected from the operation definition by the
|
|
47
|
+
* route handler so the platform workflow can resolve map-gated targets).
|
|
48
|
+
*/
|
|
49
|
+
cascade?: BatchCascadePhase[];
|
|
45
50
|
/** Optional billing (normalized by the route if omitted) */
|
|
46
51
|
billing?: ToolBilling;
|
|
47
52
|
/** Optional success discriminator (default true when domain fields present) */
|
|
48
53
|
success?: true;
|
|
49
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Cascade phase for multi-entity batch imports.
|
|
57
|
+
* Platform upserts configured entities in `order` within each wave.
|
|
58
|
+
*/
|
|
59
|
+
export interface BatchCascadePhase {
|
|
60
|
+
/** App entity handle to upsert */
|
|
61
|
+
entity: string;
|
|
62
|
+
/** Lower runs first within the same wave */
|
|
63
|
+
order: number;
|
|
64
|
+
/** setup = once (typically first iterate); page = every iterate page */
|
|
65
|
+
wave: 'setup' | 'page';
|
|
66
|
+
/**
|
|
67
|
+
* Other cascade entities that must also be CRM-configured for this phase
|
|
68
|
+
* to run (e.g. plan requires package).
|
|
69
|
+
*/
|
|
70
|
+
requires?: string[];
|
|
71
|
+
}
|
|
50
72
|
/**
|
|
51
73
|
* Result from a batch operation iterate function.
|
|
52
74
|
*/
|
|
53
75
|
export interface BatchOperationIterateResult {
|
|
54
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Array of raw items for the primary `entity`.
|
|
78
|
+
* Prefer `itemsByEntity` for cascade imports; when both are set, platform
|
|
79
|
+
* uses `itemsByEntity` and falls back to `items` for the primary entity.
|
|
80
|
+
*/
|
|
55
81
|
items: Record<string, unknown>[];
|
|
82
|
+
/**
|
|
83
|
+
* Multi-entity items keyed by entity handle (cascade imports).
|
|
84
|
+
* Platform upserts each configured entity in cascade order.
|
|
85
|
+
*/
|
|
86
|
+
itemsByEntity?: Record<string, Record<string, unknown>[]>;
|
|
56
87
|
/** Pagination info for fetching more pages */
|
|
57
88
|
pagination: BatchPagination;
|
|
58
89
|
/** Optional state to persist for the next iterate call */
|
|
@@ -89,6 +120,12 @@ export interface BatchOperationContext {
|
|
|
89
120
|
env: Record<string, string>;
|
|
90
121
|
/** Invocation context for log traceability */
|
|
91
122
|
invocation?: InvocationContext;
|
|
123
|
+
/**
|
|
124
|
+
* Entity handles whose CRM maps are configured for this job's cascade.
|
|
125
|
+
* Platform injects this on iterate so apps can skip expensive fetches
|
|
126
|
+
* (e.g. per-member credits) when that entity is not mapped.
|
|
127
|
+
*/
|
|
128
|
+
cascadeEntities?: string[];
|
|
92
129
|
/** Logger instance */
|
|
93
130
|
log: {
|
|
94
131
|
info: (message: string, meta?: Record<string, unknown>) => void;
|
|
@@ -150,10 +187,15 @@ export interface BatchOperationDefinition {
|
|
|
150
187
|
/** Description of what this operation does */
|
|
151
188
|
description?: string;
|
|
152
189
|
/**
|
|
153
|
-
*
|
|
190
|
+
* Primary entity handle (progress + start gate).
|
|
154
191
|
* The platform applies CRM mappings and calls upsertMany.
|
|
155
192
|
*/
|
|
156
193
|
entity: string;
|
|
194
|
+
/**
|
|
195
|
+
* Optional multi-entity cascade. When set, iterate may return
|
|
196
|
+
* `itemsByEntity` and the platform upserts map-configured phases in order.
|
|
197
|
+
*/
|
|
198
|
+
cascade?: BatchCascadePhase[];
|
|
157
199
|
/**
|
|
158
200
|
* Setup function called once at the start of the operation.
|
|
159
201
|
* Use to initialize state, fetch total count, etc.
|
package/dist/core/client.d.ts
CHANGED
|
@@ -192,6 +192,42 @@ export declare const communicationChannel: {
|
|
|
192
192
|
receiveMessage(input: ReceiveMessageInput): Promise<{
|
|
193
193
|
messageId: string;
|
|
194
194
|
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Attach uploaded files to a message created via {@link receiveMessage}.
|
|
197
|
+
*
|
|
198
|
+
* Safe to call before or after the inbox processor creates the ThreadMessage:
|
|
199
|
+
* - Before: attachments are stashed on MessageInbox and linked when the message is created
|
|
200
|
+
* - After: rows are created immediately and `thread.attachment.received` is emitted
|
|
201
|
+
*
|
|
202
|
+
* Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```ts
|
|
206
|
+
* const { messageId } = await communicationChannel.receiveMessage({ ... })
|
|
207
|
+
* const uploaded = await file.upload({ content, name, mimeType })
|
|
208
|
+
* await communicationChannel.attachFilesToMessage({
|
|
209
|
+
* messageId,
|
|
210
|
+
* attachments: [{
|
|
211
|
+
* fileId: uploaded.id,
|
|
212
|
+
* name: uploaded.name,
|
|
213
|
+
* mimeType: 'audio/mpeg',
|
|
214
|
+
* size: content.length,
|
|
215
|
+
* }],
|
|
216
|
+
* })
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
attachFilesToMessage(input: {
|
|
220
|
+
messageId: string;
|
|
221
|
+
attachments: Array<{
|
|
222
|
+
fileId: string;
|
|
223
|
+
name?: string;
|
|
224
|
+
mimeType?: string;
|
|
225
|
+
size?: number;
|
|
226
|
+
}>;
|
|
227
|
+
}): Promise<{
|
|
228
|
+
success: boolean;
|
|
229
|
+
attachmentCount: number;
|
|
230
|
+
}>;
|
|
195
231
|
/**
|
|
196
232
|
* Update a communication channel's properties.
|
|
197
233
|
*
|
package/dist/dedicated/server.js
CHANGED
|
@@ -2111,7 +2111,11 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
2111
2111
|
status: 200,
|
|
2112
2112
|
body: {
|
|
2113
2113
|
success: true,
|
|
2114
|
-
result: {
|
|
2114
|
+
result: {
|
|
2115
|
+
state: {},
|
|
2116
|
+
total: void 0,
|
|
2117
|
+
cascade: operation.cascade
|
|
2118
|
+
},
|
|
2115
2119
|
billing: normalizeBilling(void 0)
|
|
2116
2120
|
}
|
|
2117
2121
|
};
|
|
@@ -2134,20 +2138,26 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
2134
2138
|
status: 200,
|
|
2135
2139
|
body: {
|
|
2136
2140
|
success: true,
|
|
2137
|
-
result:
|
|
2141
|
+
result: {
|
|
2142
|
+
...domain2,
|
|
2143
|
+
// Expose definition cascade to the platform workflow
|
|
2144
|
+
cascade: operation.cascade ?? domain2.cascade
|
|
2145
|
+
},
|
|
2138
2146
|
billing: normalizeBilling(setupResult.billing)
|
|
2139
2147
|
}
|
|
2140
2148
|
};
|
|
2141
2149
|
}
|
|
2150
|
+
const iterateBody = body;
|
|
2142
2151
|
const raw = await runWithConfig(requestConfig, async () => {
|
|
2143
2152
|
return runWithRateLimitExecutionContext(rateLimitContext, async () => {
|
|
2144
2153
|
return runWithLogContext({ invocation }, async () => {
|
|
2145
2154
|
return operation.iterate({
|
|
2146
2155
|
...opContextBase,
|
|
2147
|
-
state:
|
|
2148
|
-
page:
|
|
2149
|
-
cursor:
|
|
2150
|
-
limit:
|
|
2156
|
+
state: iterateBody.state,
|
|
2157
|
+
page: iterateBody.page,
|
|
2158
|
+
cursor: iterateBody.cursor,
|
|
2159
|
+
limit: iterateBody.limit,
|
|
2160
|
+
cascadeEntities: iterateBody.cascadeEntities
|
|
2151
2161
|
});
|
|
2152
2162
|
});
|
|
2153
2163
|
});
|
package/dist/esm/index.mjs
CHANGED
|
@@ -490,6 +490,7 @@ var ThreadEventTypeSchema = z4.enum([
|
|
|
490
490
|
// Message events
|
|
491
491
|
"thread.message.received",
|
|
492
492
|
"thread.message.sent",
|
|
493
|
+
"thread.attachment.received",
|
|
493
494
|
// Participant events
|
|
494
495
|
"thread.participant.joined",
|
|
495
496
|
"thread.participant.left",
|
|
@@ -1923,8 +1924,15 @@ var BatchOperationSetupResultSchema = z8.object({
|
|
|
1923
1924
|
state: z8.record(z8.string(), z8.unknown()).optional(),
|
|
1924
1925
|
total: z8.number().int().nonnegative().optional()
|
|
1925
1926
|
});
|
|
1927
|
+
var BatchCascadePhaseSchema = z8.object({
|
|
1928
|
+
entity: z8.string(),
|
|
1929
|
+
order: z8.number().int(),
|
|
1930
|
+
wave: z8.enum(["setup", "page"]),
|
|
1931
|
+
requires: z8.array(z8.string()).optional()
|
|
1932
|
+
});
|
|
1926
1933
|
var BatchOperationIterateResultSchema = z8.object({
|
|
1927
1934
|
items: z8.array(z8.record(z8.string(), z8.unknown())),
|
|
1935
|
+
itemsByEntity: z8.record(z8.string(), z8.array(z8.record(z8.string(), z8.unknown()))).optional(),
|
|
1928
1936
|
pagination: BatchPaginationSchema,
|
|
1929
1937
|
state: z8.record(z8.string(), z8.unknown()).optional()
|
|
1930
1938
|
});
|
|
@@ -1933,6 +1941,7 @@ var BatchOperationDefinitionSchema = z8.object({
|
|
|
1933
1941
|
label: z8.string(),
|
|
1934
1942
|
description: z8.string().optional(),
|
|
1935
1943
|
entity: z8.string(),
|
|
1944
|
+
cascade: z8.array(BatchCascadePhaseSchema).optional(),
|
|
1936
1945
|
maxConcurrent: z8.number().int().positive().optional(),
|
|
1937
1946
|
pageSize: z8.number().int().positive().optional(),
|
|
1938
1947
|
icon: z8.string().optional()
|
|
@@ -2585,6 +2594,40 @@ var communicationChannel = {
|
|
|
2585
2594
|
});
|
|
2586
2595
|
return data;
|
|
2587
2596
|
},
|
|
2597
|
+
/**
|
|
2598
|
+
* Attach uploaded files to a message created via {@link receiveMessage}.
|
|
2599
|
+
*
|
|
2600
|
+
* Safe to call before or after the inbox processor creates the ThreadMessage:
|
|
2601
|
+
* - Before: attachments are stashed on MessageInbox and linked when the message is created
|
|
2602
|
+
* - After: rows are created immediately and `thread.attachment.received` is emitted
|
|
2603
|
+
*
|
|
2604
|
+
* Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
|
|
2605
|
+
*
|
|
2606
|
+
* @example
|
|
2607
|
+
* ```ts
|
|
2608
|
+
* const { messageId } = await communicationChannel.receiveMessage({ ... })
|
|
2609
|
+
* const uploaded = await file.upload({ content, name, mimeType })
|
|
2610
|
+
* await communicationChannel.attachFilesToMessage({
|
|
2611
|
+
* messageId,
|
|
2612
|
+
* attachments: [{
|
|
2613
|
+
* fileId: uploaded.id,
|
|
2614
|
+
* name: uploaded.name,
|
|
2615
|
+
* mimeType: 'audio/mpeg',
|
|
2616
|
+
* size: content.length,
|
|
2617
|
+
* }],
|
|
2618
|
+
* })
|
|
2619
|
+
* ```
|
|
2620
|
+
*/
|
|
2621
|
+
async attachFilesToMessage(input) {
|
|
2622
|
+
const { data } = await callCore(
|
|
2623
|
+
"communicationChannel.attachFilesToMessage",
|
|
2624
|
+
{
|
|
2625
|
+
messageId: input.messageId,
|
|
2626
|
+
attachments: input.attachments
|
|
2627
|
+
}
|
|
2628
|
+
);
|
|
2629
|
+
return data;
|
|
2630
|
+
},
|
|
2588
2631
|
/**
|
|
2589
2632
|
* Update a communication channel's properties.
|
|
2590
2633
|
*
|
|
@@ -5598,7 +5641,11 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
5598
5641
|
status: 200,
|
|
5599
5642
|
body: {
|
|
5600
5643
|
success: true,
|
|
5601
|
-
result: {
|
|
5644
|
+
result: {
|
|
5645
|
+
state: {},
|
|
5646
|
+
total: void 0,
|
|
5647
|
+
cascade: operation.cascade
|
|
5648
|
+
},
|
|
5602
5649
|
billing: normalizeBilling(void 0)
|
|
5603
5650
|
}
|
|
5604
5651
|
};
|
|
@@ -5621,20 +5668,26 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
5621
5668
|
status: 200,
|
|
5622
5669
|
body: {
|
|
5623
5670
|
success: true,
|
|
5624
|
-
result:
|
|
5671
|
+
result: {
|
|
5672
|
+
...domain2,
|
|
5673
|
+
// Expose definition cascade to the platform workflow
|
|
5674
|
+
cascade: operation.cascade ?? domain2.cascade
|
|
5675
|
+
},
|
|
5625
5676
|
billing: normalizeBilling(setupResult.billing)
|
|
5626
5677
|
}
|
|
5627
5678
|
};
|
|
5628
5679
|
}
|
|
5680
|
+
const iterateBody = body;
|
|
5629
5681
|
const raw = await runWithConfig(requestConfig, async () => {
|
|
5630
5682
|
return runWithRateLimitExecutionContext(rateLimitContext, async () => {
|
|
5631
5683
|
return runWithLogContext({ invocation }, async () => {
|
|
5632
5684
|
return operation.iterate({
|
|
5633
5685
|
...opContextBase,
|
|
5634
|
-
state:
|
|
5635
|
-
page:
|
|
5636
|
-
cursor:
|
|
5637
|
-
limit:
|
|
5686
|
+
state: iterateBody.state,
|
|
5687
|
+
page: iterateBody.page,
|
|
5688
|
+
cursor: iterateBody.cursor,
|
|
5689
|
+
limit: iterateBody.limit,
|
|
5690
|
+
cascadeEntities: iterateBody.cascadeEntities
|
|
5638
5691
|
});
|
|
5639
5692
|
});
|
|
5640
5693
|
});
|
|
@@ -8678,6 +8731,7 @@ export {
|
|
|
8678
8731
|
AssociationSchema,
|
|
8679
8732
|
AuthenticationError,
|
|
8680
8733
|
BaseEventPayloadSchema,
|
|
8734
|
+
BatchCascadePhaseSchema,
|
|
8681
8735
|
BatchOperationDefinitionSchema,
|
|
8682
8736
|
BatchOperationIterateResultSchema,
|
|
8683
8737
|
BatchOperationSetupResultSchema,
|
package/dist/events/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { z } from 'zod/v4';
|
|
|
6
6
|
export declare const ThreadEventTypeSchema: z.ZodEnum<{
|
|
7
7
|
"thread.message.received": "thread.message.received";
|
|
8
8
|
"thread.message.sent": "thread.message.sent";
|
|
9
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
9
10
|
"thread.participant.joined": "thread.participant.joined";
|
|
10
11
|
"thread.participant.left": "thread.participant.left";
|
|
11
12
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -32,6 +33,7 @@ export type CustomEventType = z.infer<typeof CustomEventTypeSchema>;
|
|
|
32
33
|
export declare const EventTypeSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
33
34
|
"thread.message.received": "thread.message.received";
|
|
34
35
|
"thread.message.sent": "thread.message.sent";
|
|
36
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
35
37
|
"thread.participant.joined": "thread.participant.joined";
|
|
36
38
|
"thread.participant.left": "thread.participant.left";
|
|
37
39
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -274,6 +276,7 @@ export declare const ThreadEventSchema: z.ZodObject<{
|
|
|
274
276
|
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
275
277
|
"thread.message.received": "thread.message.received";
|
|
276
278
|
"thread.message.sent": "thread.message.sent";
|
|
279
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
277
280
|
"thread.participant.joined": "thread.participant.joined";
|
|
278
281
|
"thread.participant.left": "thread.participant.left";
|
|
279
282
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -380,6 +383,7 @@ export declare const CreateThreadEventInputSchema: z.ZodObject<{
|
|
|
380
383
|
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
381
384
|
"thread.message.received": "thread.message.received";
|
|
382
385
|
"thread.message.sent": "thread.message.sent";
|
|
386
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
383
387
|
"thread.participant.joined": "thread.participant.joined";
|
|
384
388
|
"thread.participant.left": "thread.participant.left";
|
|
385
389
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -404,6 +408,7 @@ export declare const EventSubscriptionSchema: z.ZodObject<{
|
|
|
404
408
|
subscribes: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
405
409
|
"thread.message.received": "thread.message.received";
|
|
406
410
|
"thread.message.sent": "thread.message.sent";
|
|
411
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
407
412
|
"thread.participant.joined": "thread.participant.joined";
|
|
408
413
|
"thread.participant.left": "thread.participant.left";
|
|
409
414
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -421,6 +426,7 @@ export declare const EventSubscriptionSchema: z.ZodObject<{
|
|
|
421
426
|
cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
422
427
|
"thread.message.received": "thread.message.received";
|
|
423
428
|
"thread.message.sent": "thread.message.sent";
|
|
429
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
424
430
|
"thread.participant.joined": "thread.participant.joined";
|
|
425
431
|
"thread.participant.left": "thread.participant.left";
|
|
426
432
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -444,6 +450,7 @@ export declare const EventWaitSchema: z.ZodObject<{
|
|
|
444
450
|
event: z.ZodUnion<readonly [z.ZodEnum<{
|
|
445
451
|
"thread.message.received": "thread.message.received";
|
|
446
452
|
"thread.message.sent": "thread.message.sent";
|
|
453
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
447
454
|
"thread.participant.joined": "thread.participant.joined";
|
|
448
455
|
"thread.participant.left": "thread.participant.left";
|
|
449
456
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -468,6 +475,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
468
475
|
subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
469
476
|
"thread.message.received": "thread.message.received";
|
|
470
477
|
"thread.message.sent": "thread.message.sent";
|
|
478
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
471
479
|
"thread.participant.joined": "thread.participant.joined";
|
|
472
480
|
"thread.participant.left": "thread.participant.left";
|
|
473
481
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -485,6 +493,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
485
493
|
emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
486
494
|
"thread.message.received": "thread.message.received";
|
|
487
495
|
"thread.message.sent": "thread.message.sent";
|
|
496
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
488
497
|
"thread.participant.joined": "thread.participant.joined";
|
|
489
498
|
"thread.participant.left": "thread.participant.left";
|
|
490
499
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -502,6 +511,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
502
511
|
event: z.ZodUnion<readonly [z.ZodEnum<{
|
|
503
512
|
"thread.message.received": "thread.message.received";
|
|
504
513
|
"thread.message.sent": "thread.message.sent";
|
|
514
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
505
515
|
"thread.participant.joined": "thread.participant.joined";
|
|
506
516
|
"thread.participant.left": "thread.participant.left";
|
|
507
517
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -521,6 +531,7 @@ export declare const EventsConfigSchema: z.ZodObject<{
|
|
|
521
531
|
cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
522
532
|
"thread.message.received": "thread.message.received";
|
|
523
533
|
"thread.message.sent": "thread.message.sent";
|
|
534
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
524
535
|
"thread.participant.joined": "thread.participant.joined";
|
|
525
536
|
"thread.participant.left": "thread.participant.left";
|
|
526
537
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type { CRMContext, SenderContext, ThreadContextItem, ThreadInfo, SandboxC
|
|
|
35
35
|
export { MemoryEntryTypeSchema, MemoryEntrySchema, WorkingMemoryConfigSchema, SemanticMemoryConfigSchema, ExternalMemoryConfigSchema, MemoryConfigSchema, MemoryScopeSchema, MemoryQueryOptionsSchema, ConversationSummarySchema, AgentObservationSchema, ExternalDataCacheSchema, MemoryService, InMemoryStore, createInMemoryService, } from './memory';
|
|
36
36
|
export type { MemoryEntryType, MemoryEntry, WorkingMemoryConfig as MemoryWorkingConfig, SemanticMemoryConfig as MemorySemanticConfig, ExternalMemoryConfig as MemoryExternalConfig, MemoryConfig, MemoryScope, MemoryQueryOptions, ConversationSummary, AgentObservation, ExternalDataCache, MemoryStore, } from './memory';
|
|
37
37
|
export type { CRMFieldType, CRMFieldRequirement, CRMFieldOption, CRMFieldDefinition, CRMFieldSchema, CRMModelSchema, CRMCardinality, CRMOnDelete, CRMRelationshipLink, CRMRelationshipSchema, CRMSchema, CRMSchemaValidationResult, } from './schemas';
|
|
38
|
-
export type { SkedyulConfig, SerializableSkedyulConfig, InstallConfig, ProvisionConfig, BaseDefinition, Scope, FieldOwner, Visibility, ComputeLayer, StructuredFilter, FilterOperator, FilterCondition, FieldOption, EnvVariable, EnvSchema, FieldType, Cardinality, OnDelete, InlineFieldDefinition, FieldVisibility, FieldDefinition, ModelDefinition, RelationshipLink, RelationshipDefinition, CapabilityType, ChannelCapability, ChannelBatchCapability, ChannelFieldPermissions, ChannelField, ChannelDefinition, WorkflowActionInput, WorkflowAction, WorkflowDefinition, AgentDefinition, NavigationItem, NavigationSection, NavigationSidebar, BreadcrumbItem, NavigationBreadcrumb, NavigationConfig, ContextMode, ContextItemModel, ContextItemTool, ContextItem, ContextDefinition, FormStyleProps, ButtonVariant, ButtonSize, ButtonProps, RelationshipExtension, FormHeader, FormActionDefinition, ActionDefinition, ModalFormDefinition, InputComponent, TextareaComponent, SelectComponent, ComboboxComponent, CheckboxComponent, DatePickerComponent, TimePickerComponent, StatusIndicator, FieldSettingComponent, ImageSettingComponent, FileSettingComponent, ListItemTemplate, ListComponent, EmptyFormComponent, AlertComponent, FormComponent, FormLayoutColumn, FormLayoutRow, FormLayoutConfig, FormProps, CardHeader, CardBlock, ListBlock, BlockDefinition, SetupStepDefinition, SetupStepKind, PageType, PageDefinition, HttpMethod, WebhookRequest, WebhookHandlerContext, WebhookHandlerResponse, WebhookHandlerFn, WebhookHandlerDefinition, Webhooks, WebhookHandlerMetadata, ModelDependency, ChannelDependency, WorkflowDependency, ResourceDependency, } from './config';
|
|
38
|
+
export type { SkedyulConfig, SerializableSkedyulConfig, InstallConfig, ProvisionConfig, BaseDefinition, Scope, FieldOwner, Visibility, ComputeLayer, StructuredFilter, FilterOperator, FilterCondition, FieldOption, EnvVariable, EnvSchema, FieldType, Cardinality, OnDelete, InlineFieldDefinition, FieldVisibility, FieldDefinition, ModelDefinition, RelationshipLink, RelationshipDefinition, CapabilityType, ChannelCapability, ChannelBatchCapability, ChannelFieldPermissions, ChannelField, ChannelDefinition, WorkflowActionInput, WorkflowAction, WorkflowDefinition, AgentDefinition, NavigationItem, NavigationSection, NavigationSidebar, BreadcrumbItem, NavigationBreadcrumb, NavigationConfig, ContextMode, ContextItemModel, ContextItemTool, ContextItem, ContextDefinition, FormStyleProps, ButtonVariant, ButtonSize, ButtonProps, RelationshipExtension, FormHeader, FormActionDefinition, ActionDefinition, ModalFormDefinition, InputComponent, TextareaComponent, SelectComponent, ComboboxComponent, CheckboxComponent, DatePickerComponent, TimePickerComponent, StatusIndicator, FieldSettingComponent, ImageSettingComponent, FileSettingComponent, ListItemTemplate, ListComponent, EmptyFormComponent, AlertComponent, FormComponent, FormLayoutColumn, FormLayoutRow, FormLayoutConfig, FormProps, CardHeader, CardBlock, ListBlock, BlockDefinition, SetupStepDefinition, SetupStepKind, BatchCascadePhase, BatchOperationDefinition, BatchOperationContext, BatchOperationIterateResult, BatchOperationSetupResult, PageType, PageDefinition, HttpMethod, WebhookRequest, WebhookHandlerContext, WebhookHandlerResponse, WebhookHandlerFn, WebhookHandlerDefinition, Webhooks, WebhookHandlerMetadata, ModelDependency, ChannelDependency, WorkflowDependency, ResourceDependency, } from './config';
|
|
39
39
|
export { compileAgent, compileWorkflow } from './compiler';
|
|
40
40
|
export type { ValidationError, ValidationWarning, ResolvedPersona, ResolvedTool, EventConfig as CompilerEventConfig, IRMemoryConfig, PolicyConfig, IRRuntimeConfig, AgentIR, WorkflowStepIR, WorkflowIR, CompilationResult, } from './compiler';
|
|
41
41
|
export { TimeStampSchema, DayOfWeekSchema, TimeWindowSlotSchema, WaitUnitSchema, WaitInputRelativeSchema, WaitInputAbsoluteSchema, WaitInputSchema, } from './scheduling/types';
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __export(index_exports, {
|
|
|
42
42
|
AssociationSchema: () => AssociationSchema,
|
|
43
43
|
AuthenticationError: () => AuthenticationError,
|
|
44
44
|
BaseEventPayloadSchema: () => BaseEventPayloadSchema,
|
|
45
|
+
BatchCascadePhaseSchema: () => BatchCascadePhaseSchema,
|
|
45
46
|
BatchOperationDefinitionSchema: () => BatchOperationDefinitionSchema,
|
|
46
47
|
BatchOperationIterateResultSchema: () => BatchOperationIterateResultSchema,
|
|
47
48
|
BatchOperationSetupResultSchema: () => BatchOperationSetupResultSchema,
|
|
@@ -870,6 +871,7 @@ var ThreadEventTypeSchema = import_v44.z.enum([
|
|
|
870
871
|
// Message events
|
|
871
872
|
"thread.message.received",
|
|
872
873
|
"thread.message.sent",
|
|
874
|
+
"thread.attachment.received",
|
|
873
875
|
// Participant events
|
|
874
876
|
"thread.participant.joined",
|
|
875
877
|
"thread.participant.left",
|
|
@@ -2303,8 +2305,15 @@ var BatchOperationSetupResultSchema = import_v48.z.object({
|
|
|
2303
2305
|
state: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional(),
|
|
2304
2306
|
total: import_v48.z.number().int().nonnegative().optional()
|
|
2305
2307
|
});
|
|
2308
|
+
var BatchCascadePhaseSchema = import_v48.z.object({
|
|
2309
|
+
entity: import_v48.z.string(),
|
|
2310
|
+
order: import_v48.z.number().int(),
|
|
2311
|
+
wave: import_v48.z.enum(["setup", "page"]),
|
|
2312
|
+
requires: import_v48.z.array(import_v48.z.string()).optional()
|
|
2313
|
+
});
|
|
2306
2314
|
var BatchOperationIterateResultSchema = import_v48.z.object({
|
|
2307
2315
|
items: import_v48.z.array(import_v48.z.record(import_v48.z.string(), import_v48.z.unknown())),
|
|
2316
|
+
itemsByEntity: import_v48.z.record(import_v48.z.string(), import_v48.z.array(import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()))).optional(),
|
|
2308
2317
|
pagination: BatchPaginationSchema,
|
|
2309
2318
|
state: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional()
|
|
2310
2319
|
});
|
|
@@ -2313,6 +2322,7 @@ var BatchOperationDefinitionSchema = import_v48.z.object({
|
|
|
2313
2322
|
label: import_v48.z.string(),
|
|
2314
2323
|
description: import_v48.z.string().optional(),
|
|
2315
2324
|
entity: import_v48.z.string(),
|
|
2325
|
+
cascade: import_v48.z.array(BatchCascadePhaseSchema).optional(),
|
|
2316
2326
|
maxConcurrent: import_v48.z.number().int().positive().optional(),
|
|
2317
2327
|
pageSize: import_v48.z.number().int().positive().optional(),
|
|
2318
2328
|
icon: import_v48.z.string().optional()
|
|
@@ -2965,6 +2975,40 @@ var communicationChannel = {
|
|
|
2965
2975
|
});
|
|
2966
2976
|
return data;
|
|
2967
2977
|
},
|
|
2978
|
+
/**
|
|
2979
|
+
* Attach uploaded files to a message created via {@link receiveMessage}.
|
|
2980
|
+
*
|
|
2981
|
+
* Safe to call before or after the inbox processor creates the ThreadMessage:
|
|
2982
|
+
* - Before: attachments are stashed on MessageInbox and linked when the message is created
|
|
2983
|
+
* - After: rows are created immediately and `thread.attachment.received` is emitted
|
|
2984
|
+
*
|
|
2985
|
+
* Typical flow for email/MMS: `receiveMessage` → `file.upload` → `attachFilesToMessage`.
|
|
2986
|
+
*
|
|
2987
|
+
* @example
|
|
2988
|
+
* ```ts
|
|
2989
|
+
* const { messageId } = await communicationChannel.receiveMessage({ ... })
|
|
2990
|
+
* const uploaded = await file.upload({ content, name, mimeType })
|
|
2991
|
+
* await communicationChannel.attachFilesToMessage({
|
|
2992
|
+
* messageId,
|
|
2993
|
+
* attachments: [{
|
|
2994
|
+
* fileId: uploaded.id,
|
|
2995
|
+
* name: uploaded.name,
|
|
2996
|
+
* mimeType: 'audio/mpeg',
|
|
2997
|
+
* size: content.length,
|
|
2998
|
+
* }],
|
|
2999
|
+
* })
|
|
3000
|
+
* ```
|
|
3001
|
+
*/
|
|
3002
|
+
async attachFilesToMessage(input) {
|
|
3003
|
+
const { data } = await callCore(
|
|
3004
|
+
"communicationChannel.attachFilesToMessage",
|
|
3005
|
+
{
|
|
3006
|
+
messageId: input.messageId,
|
|
3007
|
+
attachments: input.attachments
|
|
3008
|
+
}
|
|
3009
|
+
);
|
|
3010
|
+
return data;
|
|
3011
|
+
},
|
|
2968
3012
|
/**
|
|
2969
3013
|
* Update a communication channel's properties.
|
|
2970
3014
|
*
|
|
@@ -5978,7 +6022,11 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
5978
6022
|
status: 200,
|
|
5979
6023
|
body: {
|
|
5980
6024
|
success: true,
|
|
5981
|
-
result: {
|
|
6025
|
+
result: {
|
|
6026
|
+
state: {},
|
|
6027
|
+
total: void 0,
|
|
6028
|
+
cascade: operation.cascade
|
|
6029
|
+
},
|
|
5982
6030
|
billing: normalizeBilling(void 0)
|
|
5983
6031
|
}
|
|
5984
6032
|
};
|
|
@@ -6001,20 +6049,26 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
6001
6049
|
status: 200,
|
|
6002
6050
|
body: {
|
|
6003
6051
|
success: true,
|
|
6004
|
-
result:
|
|
6052
|
+
result: {
|
|
6053
|
+
...domain2,
|
|
6054
|
+
// Expose definition cascade to the platform workflow
|
|
6055
|
+
cascade: operation.cascade ?? domain2.cascade
|
|
6056
|
+
},
|
|
6005
6057
|
billing: normalizeBilling(setupResult.billing)
|
|
6006
6058
|
}
|
|
6007
6059
|
};
|
|
6008
6060
|
}
|
|
6061
|
+
const iterateBody = body;
|
|
6009
6062
|
const raw = await runWithConfig(requestConfig, async () => {
|
|
6010
6063
|
return runWithRateLimitExecutionContext(rateLimitContext, async () => {
|
|
6011
6064
|
return runWithLogContext({ invocation }, async () => {
|
|
6012
6065
|
return operation.iterate({
|
|
6013
6066
|
...opContextBase,
|
|
6014
|
-
state:
|
|
6015
|
-
page:
|
|
6016
|
-
cursor:
|
|
6017
|
-
limit:
|
|
6067
|
+
state: iterateBody.state,
|
|
6068
|
+
page: iterateBody.page,
|
|
6069
|
+
cursor: iterateBody.cursor,
|
|
6070
|
+
limit: iterateBody.limit,
|
|
6071
|
+
cascadeEntities: iterateBody.cascadeEntities
|
|
6018
6072
|
});
|
|
6019
6073
|
});
|
|
6020
6074
|
});
|
|
@@ -9059,6 +9113,7 @@ var index_default = { z: import_v414.z };
|
|
|
9059
9113
|
AssociationSchema,
|
|
9060
9114
|
AuthenticationError,
|
|
9061
9115
|
BaseEventPayloadSchema,
|
|
9116
|
+
BatchCascadePhaseSchema,
|
|
9062
9117
|
BatchOperationDefinitionSchema,
|
|
9063
9118
|
BatchOperationIterateResultSchema,
|
|
9064
9119
|
BatchOperationSetupResultSchema,
|
|
@@ -528,6 +528,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
|
|
|
528
528
|
subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
529
529
|
"thread.message.received": "thread.message.received";
|
|
530
530
|
"thread.message.sent": "thread.message.sent";
|
|
531
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
531
532
|
"thread.participant.joined": "thread.participant.joined";
|
|
532
533
|
"thread.participant.left": "thread.participant.left";
|
|
533
534
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -545,6 +546,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
|
|
|
545
546
|
emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
546
547
|
"thread.message.received": "thread.message.received";
|
|
547
548
|
"thread.message.sent": "thread.message.sent";
|
|
549
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
548
550
|
"thread.participant.joined": "thread.participant.joined";
|
|
549
551
|
"thread.participant.left": "thread.participant.left";
|
|
550
552
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -562,6 +564,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
|
|
|
562
564
|
event: z.ZodUnion<readonly [z.ZodEnum<{
|
|
563
565
|
"thread.message.received": "thread.message.received";
|
|
564
566
|
"thread.message.sent": "thread.message.sent";
|
|
567
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
565
568
|
"thread.participant.joined": "thread.participant.joined";
|
|
566
569
|
"thread.participant.left": "thread.participant.left";
|
|
567
570
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -581,6 +584,7 @@ export declare const AgentYAMLV3Schema: z.ZodObject<{
|
|
|
581
584
|
cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
582
585
|
"thread.message.received": "thread.message.received";
|
|
583
586
|
"thread.message.sent": "thread.message.sent";
|
|
587
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
584
588
|
"thread.participant.joined": "thread.participant.joined";
|
|
585
589
|
"thread.participant.left": "thread.participant.left";
|
|
586
590
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
package/dist/schemas.d.ts
CHANGED
|
@@ -3368,8 +3368,18 @@ export declare const BatchOperationSetupResultSchema: z.ZodObject<{
|
|
|
3368
3368
|
state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3369
3369
|
total: z.ZodOptional<z.ZodNumber>;
|
|
3370
3370
|
}, z.core.$strip>;
|
|
3371
|
+
export declare const BatchCascadePhaseSchema: z.ZodObject<{
|
|
3372
|
+
entity: z.ZodString;
|
|
3373
|
+
order: z.ZodNumber;
|
|
3374
|
+
wave: z.ZodEnum<{
|
|
3375
|
+
page: "page";
|
|
3376
|
+
setup: "setup";
|
|
3377
|
+
}>;
|
|
3378
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3379
|
+
}, z.core.$strip>;
|
|
3371
3380
|
export declare const BatchOperationIterateResultSchema: z.ZodObject<{
|
|
3372
3381
|
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3382
|
+
itemsByEntity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
3373
3383
|
pagination: z.ZodObject<{
|
|
3374
3384
|
hasMore: z.ZodBoolean;
|
|
3375
3385
|
page: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3384,6 +3394,15 @@ export declare const BatchOperationDefinitionSchema: z.ZodObject<{
|
|
|
3384
3394
|
label: z.ZodString;
|
|
3385
3395
|
description: z.ZodOptional<z.ZodString>;
|
|
3386
3396
|
entity: z.ZodString;
|
|
3397
|
+
cascade: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3398
|
+
entity: z.ZodString;
|
|
3399
|
+
order: z.ZodNumber;
|
|
3400
|
+
wave: z.ZodEnum<{
|
|
3401
|
+
page: "page";
|
|
3402
|
+
setup: "setup";
|
|
3403
|
+
}>;
|
|
3404
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3405
|
+
}, z.core.$strip>>>;
|
|
3387
3406
|
maxConcurrent: z.ZodOptional<z.ZodNumber>;
|
|
3388
3407
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
3389
3408
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -4197,6 +4216,15 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
|
|
|
4197
4216
|
label: z.ZodString;
|
|
4198
4217
|
description: z.ZodOptional<z.ZodString>;
|
|
4199
4218
|
entity: z.ZodString;
|
|
4219
|
+
cascade: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
4220
|
+
entity: z.ZodString;
|
|
4221
|
+
order: z.ZodNumber;
|
|
4222
|
+
wave: z.ZodEnum<{
|
|
4223
|
+
page: "page";
|
|
4224
|
+
setup: "setup";
|
|
4225
|
+
}>;
|
|
4226
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4227
|
+
}, z.core.$strip>>>;
|
|
4200
4228
|
maxConcurrent: z.ZodOptional<z.ZodNumber>;
|
|
4201
4229
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
4202
4230
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -5021,6 +5049,15 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
|
|
|
5021
5049
|
label: z.ZodString;
|
|
5022
5050
|
description: z.ZodOptional<z.ZodString>;
|
|
5023
5051
|
entity: z.ZodString;
|
|
5052
|
+
cascade: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5053
|
+
entity: z.ZodString;
|
|
5054
|
+
order: z.ZodNumber;
|
|
5055
|
+
wave: z.ZodEnum<{
|
|
5056
|
+
page: "page";
|
|
5057
|
+
setup: "setup";
|
|
5058
|
+
}>;
|
|
5059
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5060
|
+
}, z.core.$strip>>>;
|
|
5024
5061
|
maxConcurrent: z.ZodOptional<z.ZodNumber>;
|
|
5025
5062
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
5026
5063
|
icon: z.ZodOptional<z.ZodString>;
|
package/dist/server.js
CHANGED
|
@@ -2111,7 +2111,11 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
2111
2111
|
status: 200,
|
|
2112
2112
|
body: {
|
|
2113
2113
|
success: true,
|
|
2114
|
-
result: {
|
|
2114
|
+
result: {
|
|
2115
|
+
state: {},
|
|
2116
|
+
total: void 0,
|
|
2117
|
+
cascade: operation.cascade
|
|
2118
|
+
},
|
|
2115
2119
|
billing: normalizeBilling(void 0)
|
|
2116
2120
|
}
|
|
2117
2121
|
};
|
|
@@ -2134,20 +2138,26 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
2134
2138
|
status: 200,
|
|
2135
2139
|
body: {
|
|
2136
2140
|
success: true,
|
|
2137
|
-
result:
|
|
2141
|
+
result: {
|
|
2142
|
+
...domain2,
|
|
2143
|
+
// Expose definition cascade to the platform workflow
|
|
2144
|
+
cascade: operation.cascade ?? domain2.cascade
|
|
2145
|
+
},
|
|
2138
2146
|
billing: normalizeBilling(setupResult.billing)
|
|
2139
2147
|
}
|
|
2140
2148
|
};
|
|
2141
2149
|
}
|
|
2150
|
+
const iterateBody = body;
|
|
2142
2151
|
const raw = await runWithConfig(requestConfig, async () => {
|
|
2143
2152
|
return runWithRateLimitExecutionContext(rateLimitContext, async () => {
|
|
2144
2153
|
return runWithLogContext({ invocation }, async () => {
|
|
2145
2154
|
return operation.iterate({
|
|
2146
2155
|
...opContextBase,
|
|
2147
|
-
state:
|
|
2148
|
-
page:
|
|
2149
|
-
cursor:
|
|
2150
|
-
limit:
|
|
2156
|
+
state: iterateBody.state,
|
|
2157
|
+
page: iterateBody.page,
|
|
2158
|
+
cursor: iterateBody.cursor,
|
|
2159
|
+
limit: iterateBody.limit,
|
|
2160
|
+
cascadeEntities: iterateBody.cascadeEntities
|
|
2151
2161
|
});
|
|
2152
2162
|
});
|
|
2153
2163
|
});
|
|
@@ -2072,7 +2072,11 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
2072
2072
|
status: 200,
|
|
2073
2073
|
body: {
|
|
2074
2074
|
success: true,
|
|
2075
|
-
result: {
|
|
2075
|
+
result: {
|
|
2076
|
+
state: {},
|
|
2077
|
+
total: void 0,
|
|
2078
|
+
cascade: operation.cascade
|
|
2079
|
+
},
|
|
2076
2080
|
billing: normalizeBilling(void 0)
|
|
2077
2081
|
}
|
|
2078
2082
|
};
|
|
@@ -2095,20 +2099,26 @@ async function handleBatchOperationRoute(req, ctx) {
|
|
|
2095
2099
|
status: 200,
|
|
2096
2100
|
body: {
|
|
2097
2101
|
success: true,
|
|
2098
|
-
result:
|
|
2102
|
+
result: {
|
|
2103
|
+
...domain2,
|
|
2104
|
+
// Expose definition cascade to the platform workflow
|
|
2105
|
+
cascade: operation.cascade ?? domain2.cascade
|
|
2106
|
+
},
|
|
2099
2107
|
billing: normalizeBilling(setupResult.billing)
|
|
2100
2108
|
}
|
|
2101
2109
|
};
|
|
2102
2110
|
}
|
|
2111
|
+
const iterateBody = body;
|
|
2103
2112
|
const raw = await runWithConfig(requestConfig, async () => {
|
|
2104
2113
|
return runWithRateLimitExecutionContext(rateLimitContext, async () => {
|
|
2105
2114
|
return runWithLogContext({ invocation }, async () => {
|
|
2106
2115
|
return operation.iterate({
|
|
2107
2116
|
...opContextBase,
|
|
2108
|
-
state:
|
|
2109
|
-
page:
|
|
2110
|
-
cursor:
|
|
2111
|
-
limit:
|
|
2117
|
+
state: iterateBody.state,
|
|
2118
|
+
page: iterateBody.page,
|
|
2119
|
+
cursor: iterateBody.cursor,
|
|
2120
|
+
limit: iterateBody.limit,
|
|
2121
|
+
cascadeEntities: iterateBody.cascadeEntities
|
|
2112
2122
|
});
|
|
2113
2123
|
});
|
|
2114
2124
|
});
|
package/dist/triggers/types.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare const TriggerContextSchema: z.ZodObject<{
|
|
|
62
62
|
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
63
63
|
"thread.message.received": "thread.message.received";
|
|
64
64
|
"thread.message.sent": "thread.message.sent";
|
|
65
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
65
66
|
"thread.participant.joined": "thread.participant.joined";
|
|
66
67
|
"thread.participant.left": "thread.participant.left";
|
|
67
68
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -189,6 +190,7 @@ export declare const ResolvedTriggerSchema: z.ZodObject<{
|
|
|
189
190
|
subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
190
191
|
"thread.message.received": "thread.message.received";
|
|
191
192
|
"thread.message.sent": "thread.message.sent";
|
|
193
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
192
194
|
"thread.participant.joined": "thread.participant.joined";
|
|
193
195
|
"thread.participant.left": "thread.participant.left";
|
|
194
196
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -211,6 +213,7 @@ export declare const ResolvedTriggerSchema: z.ZodObject<{
|
|
|
211
213
|
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
212
214
|
"thread.message.received": "thread.message.received";
|
|
213
215
|
"thread.message.sent": "thread.message.sent";
|
|
216
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
214
217
|
"thread.participant.joined": "thread.participant.joined";
|
|
215
218
|
"thread.participant.left": "thread.participant.left";
|
|
216
219
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These types define the registry and context for batch operations at runtime.
|
|
5
5
|
*/
|
|
6
|
-
import type { BatchOperationSetupFn, BatchOperationIterateFn } from '../config/types/batch-operation';
|
|
7
|
-
export type { BatchOperationContext } from '../config/types/batch-operation';
|
|
6
|
+
import type { BatchCascadePhase, BatchOperationSetupFn, BatchOperationIterateFn } from '../config/types/batch-operation';
|
|
7
|
+
export type { BatchCascadePhase, BatchOperationContext, } from '../config/types/batch-operation';
|
|
8
8
|
/**
|
|
9
9
|
* Entry in the batch operation registry.
|
|
10
10
|
* Contains both metadata and function implementations.
|
|
@@ -16,8 +16,10 @@ export interface BatchOperationRegistryEntry {
|
|
|
16
16
|
label: string;
|
|
17
17
|
/** Description of what this operation does */
|
|
18
18
|
description?: string;
|
|
19
|
-
/**
|
|
19
|
+
/** Primary entity handle that items will be upserted to */
|
|
20
20
|
entity: string;
|
|
21
|
+
/** Optional multi-entity cascade phases */
|
|
22
|
+
cascade?: BatchCascadePhase[];
|
|
21
23
|
/** Setup function called once at the start */
|
|
22
24
|
setup?: BatchOperationSetupFn;
|
|
23
25
|
/** Iterate function called for each page */
|
|
@@ -41,6 +43,7 @@ export interface BatchOperationMetadata {
|
|
|
41
43
|
label: string;
|
|
42
44
|
description?: string;
|
|
43
45
|
entity: string;
|
|
46
|
+
cascade?: BatchCascadePhase[];
|
|
44
47
|
maxConcurrent?: number;
|
|
45
48
|
pageSize?: number;
|
|
46
49
|
icon?: string;
|
|
@@ -71,6 +71,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
|
|
|
71
71
|
subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
72
72
|
"thread.message.received": "thread.message.received";
|
|
73
73
|
"thread.message.sent": "thread.message.sent";
|
|
74
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
74
75
|
"thread.participant.joined": "thread.participant.joined";
|
|
75
76
|
"thread.participant.left": "thread.participant.left";
|
|
76
77
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -88,6 +89,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
|
|
|
88
89
|
emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
89
90
|
"thread.message.received": "thread.message.received";
|
|
90
91
|
"thread.message.sent": "thread.message.sent";
|
|
92
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
91
93
|
"thread.participant.joined": "thread.participant.joined";
|
|
92
94
|
"thread.participant.left": "thread.participant.left";
|
|
93
95
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -105,6 +107,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
|
|
|
105
107
|
event: z.ZodUnion<readonly [z.ZodEnum<{
|
|
106
108
|
"thread.message.received": "thread.message.received";
|
|
107
109
|
"thread.message.sent": "thread.message.sent";
|
|
110
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
108
111
|
"thread.participant.joined": "thread.participant.joined";
|
|
109
112
|
"thread.participant.left": "thread.participant.left";
|
|
110
113
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -124,6 +127,7 @@ export declare const WorkflowYAMLSchema: z.ZodObject<{
|
|
|
124
127
|
cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
125
128
|
"thread.message.received": "thread.message.received";
|
|
126
129
|
"thread.message.sent": "thread.message.sent";
|
|
130
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
127
131
|
"thread.participant.joined": "thread.participant.joined";
|
|
128
132
|
"thread.participant.left": "thread.participant.left";
|
|
129
133
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -185,6 +189,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
|
|
|
185
189
|
subscribes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
186
190
|
"thread.message.received": "thread.message.received";
|
|
187
191
|
"thread.message.sent": "thread.message.sent";
|
|
192
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
188
193
|
"thread.participant.joined": "thread.participant.joined";
|
|
189
194
|
"thread.participant.left": "thread.participant.left";
|
|
190
195
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -202,6 +207,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
|
|
|
202
207
|
emits: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
203
208
|
"thread.message.received": "thread.message.received";
|
|
204
209
|
"thread.message.sent": "thread.message.sent";
|
|
210
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
205
211
|
"thread.participant.joined": "thread.participant.joined";
|
|
206
212
|
"thread.participant.left": "thread.participant.left";
|
|
207
213
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -219,6 +225,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
|
|
|
219
225
|
event: z.ZodUnion<readonly [z.ZodEnum<{
|
|
220
226
|
"thread.message.received": "thread.message.received";
|
|
221
227
|
"thread.message.sent": "thread.message.sent";
|
|
228
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
222
229
|
"thread.participant.joined": "thread.participant.joined";
|
|
223
230
|
"thread.participant.left": "thread.participant.left";
|
|
224
231
|
"thread.participant.mentioned": "thread.participant.mentioned";
|
|
@@ -238,6 +245,7 @@ export declare const WorkflowMetadataSchema: z.ZodObject<{
|
|
|
238
245
|
cancels: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
239
246
|
"thread.message.received": "thread.message.received";
|
|
240
247
|
"thread.message.sent": "thread.message.sent";
|
|
248
|
+
"thread.attachment.received": "thread.attachment.received";
|
|
241
249
|
"thread.participant.joined": "thread.participant.joined";
|
|
242
250
|
"thread.participant.left": "thread.participant.left";
|
|
243
251
|
"thread.participant.mentioned": "thread.participant.mentioned";
|