@elementumai/edk 0.10.4 → 0.12.0
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/README.md +49 -13
- package/dist-sdk/src/catalog/token.js +2 -1
- package/dist-sdk/src/core/triggers/on-demand.d.ts +2 -0
- package/dist-sdk/src/core/triggers/on-demand.js +3 -0
- package/dist-sdk/src/core/wire/ref-serializer.js +26 -1
- package/dist-sdk/src/engine/build/context.d.ts +4 -0
- package/dist-sdk/src/engine/coverage-gaps.d.ts +7 -0
- package/dist-sdk/src/engine/coverage-gaps.js +12 -0
- package/dist-sdk/src/engine/ei/json-stream-reader.d.ts +43 -0
- package/dist-sdk/src/engine/ei/json-stream-reader.js +234 -0
- package/dist-sdk/src/engine/ei/run.d.ts +42 -1
- package/dist-sdk/src/engine/ei/run.js +201 -32
- package/dist-sdk/src/engine/ei/saved-plan.d.ts +16 -0
- package/dist-sdk/src/engine/ei/saved-plan.js +19 -0
- package/dist-sdk/src/engine/ei/state.d.ts +1 -1
- package/dist-sdk/src/engine/ei/state.js +17 -4
- package/dist-sdk/src/engine/progress.d.ts +3 -1
- package/dist-sdk/src/engine/progress.js +7 -3
- package/dist-sdk/src/engine/pull/authored-address.d.ts +15 -1
- package/dist-sdk/src/engine/pull/authored-address.js +180 -29
- package/dist-sdk/src/engine/pull/context.d.ts +37 -2
- package/dist-sdk/src/engine/pull/context.js +7 -4
- package/dist-sdk/src/engine/pull/ref-only.d.ts +18 -0
- package/dist-sdk/src/engine/pull/ref-only.js +52 -0
- package/dist-sdk/src/engine/tf/index.d.ts +2 -2
- package/dist-sdk/src/engine/tf/index.js +2 -2
- package/dist-sdk/src/engine/tf/labels.d.ts +22 -0
- package/dist-sdk/src/engine/tf/labels.js +50 -0
- package/dist-sdk/src/engine/tf/model.d.ts +2 -0
- package/dist-sdk/src/engine/tf/model.js +26 -0
- package/dist-sdk/src/engine/validation.d.ts +2 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +18 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +58 -24
- package/dist-sdk/src/entities/access-policy/member-list.d.ts +32 -0
- package/dist-sdk/src/entities/access-policy/member-list.js +57 -0
- package/dist-sdk/src/entities/access-policy/module.js +10 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +4 -3
- package/dist-sdk/src/entities/access-policy/to-tf.js +21 -12
- package/dist-sdk/src/entities/agent/build.js +7 -5
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +2 -0
- package/dist-sdk/src/entities/agent/from-tf.js +13 -3
- package/dist-sdk/src/entities/agent/to-tf.js +11 -5
- package/dist-sdk/src/entities/agent/tools.d.ts +8 -0
- package/dist-sdk/src/entities/agent/tools.js +6 -2
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +29 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +56 -3
- package/dist-sdk/src/entities/agent-tool/types.d.ts +12 -8
- package/dist-sdk/src/entities/agent-tool/types.js +13 -9
- package/dist-sdk/src/entities/app/build.d.ts +12 -1
- package/dist-sdk/src/entities/app/build.js +80 -4
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +5 -7
- package/dist-sdk/src/entities/app/from-tf.js +17 -12
- package/dist-sdk/src/entities/app/stage-keys.d.ts +18 -3
- package/dist-sdk/src/entities/app/stage-keys.js +40 -6
- package/dist-sdk/src/entities/app/to-tf.js +7 -4
- package/dist-sdk/src/entities/automation/build.d.ts +52 -31
- package/dist-sdk/src/entities/automation/build.js +59 -20
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +7 -4
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +39 -14
- package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -2
- package/dist-sdk/src/entities/automation/from-tf.js +721 -93
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/module.d.ts +22 -2
- package/dist-sdk/src/entities/automation/module.js +244 -57
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +22 -2
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +54 -3
- package/dist-sdk/src/entities/automation/run-target.d.ts +61 -0
- package/dist-sdk/src/entities/automation/run-target.js +104 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +11 -1
- package/dist-sdk/src/entities/automation/script-code.js +106 -4
- package/dist-sdk/src/entities/automation/script-lint.d.ts +13 -0
- package/dist-sdk/src/entities/automation/script-lint.js +418 -0
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +17 -1
- package/dist-sdk/src/entities/automation/task-output-labels.js +58 -1
- package/dist-sdk/src/entities/automation/tasks.d.ts +67 -22
- package/dist-sdk/src/entities/automation/tasks.js +18 -4
- package/dist-sdk/src/entities/automation/to-tf.d.ts +1 -3
- package/dist-sdk/src/entities/automation/to-tf.js +354 -64
- package/dist-sdk/src/entities/automation/triggers.d.ts +63 -11
- package/dist-sdk/src/entities/automation/triggers.js +45 -5
- package/dist-sdk/src/entities/automation/types.d.ts +21 -0
- package/dist-sdk/src/entities/automation/types.js +26 -0
- package/dist-sdk/src/entities/chart/build.d.ts +9 -1
- package/dist-sdk/src/entities/chart/from-tf.d.ts +2 -2
- package/dist-sdk/src/entities/chart/from-tf.js +25 -1
- package/dist-sdk/src/entities/chart/index.d.ts +1 -1
- package/dist-sdk/src/entities/chart/printer.js +5 -2
- package/dist-sdk/src/entities/chart/to-tf.js +19 -1
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +11 -1
- package/dist-sdk/src/entities/dashboard/from-tf.js +57 -7
- package/dist-sdk/src/entities/dashboard/to-tf.js +13 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +8 -2
- package/dist-sdk/src/entities/dynamic-layout/condition-keys.d.ts +48 -0
- package/dist-sdk/src/entities/dynamic-layout/condition-keys.js +261 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +3 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +66 -20
- package/dist-sdk/src/entities/dynamic-layout/module.js +2 -1
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +4 -2
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +341 -32
- package/dist-sdk/src/entities/element/build.d.ts +10 -0
- package/dist-sdk/src/entities/element/build.js +1 -0
- package/dist-sdk/src/entities/element/from-tf.js +14 -9
- package/dist-sdk/src/entities/element/to-tf.js +7 -4
- package/dist-sdk/src/entities/field/from-tf.d.ts +24 -0
- package/dist-sdk/src/entities/field/from-tf.js +79 -1
- package/dist-sdk/src/entities/field/module.js +14 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +38 -3
- package/dist-sdk/src/entities/field/to-tf.js +108 -34
- package/dist-sdk/src/entities/file-reader/module.js +3 -3
- package/dist-sdk/src/entities/file-reader/to-tf.js +3 -3
- package/dist-sdk/src/entities/file-reader/types.d.ts +4 -16
- package/dist-sdk/src/entities/file-reader/types.js +7 -0
- package/dist-sdk/src/entities/org/group.d.ts +1 -0
- package/dist-sdk/src/entities/org/group.js +2 -1
- package/dist-sdk/src/entities/org/role.js +5 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +8 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +10 -2
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/record-create-form/to-tf.js +14 -2
- package/dist-sdk/src/entities/relationship/from-tf.d.ts +8 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +88 -10
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +3 -2
- package/dist-sdk/src/entities/relationship/to-tf.js +79 -8
- package/dist-sdk/src/entities/role/from-tf.js +24 -7
- package/dist-sdk/src/entities/role/to-tf.js +25 -7
- package/dist-sdk/src/entities/service-account/from-tf.js +2 -1
- package/dist-sdk/src/entities/service-account/module.js +20 -0
- package/dist-sdk/src/entities/service-account/role-fidelity.d.ts +5 -5
- package/dist-sdk/src/entities/service-account/role-fidelity.js +21 -13
- package/dist-sdk/src/entities/service-account/to-tf.js +12 -4
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +2 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +1 -1
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +12 -7
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +6 -3
- package/dist-sdk/src/entities/shared/types/field-types.js +3 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +5 -2
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +8 -1
- package/dist-sdk/src/entities/skill/from-tf.js +10 -3
- package/dist-sdk/src/entities/skill/module.js +18 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +8 -1
- package/dist-sdk/src/entities/skill/to-tf.js +23 -14
- package/dist-sdk/src/entities/skill/tools.d.ts +8 -0
- package/dist-sdk/src/entities/skill/tools.js +6 -2
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +8 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -2
- package/dist-sdk/src/entities/task/to-tf.js +1 -0
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +8 -2
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +20 -10
- package/dist-sdk/src/entities/view/from-tf.d.ts +68 -4
- package/dist-sdk/src/entities/view/from-tf.js +394 -22
- package/dist-sdk/src/entities/view/module.js +20 -0
- package/dist-sdk/src/entities/view/portable.d.ts +11 -0
- package/dist-sdk/src/entities/view/portable.js +47 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +4 -1
- package/dist-sdk/src/entities/view/to-tf.js +25 -7
- package/dist-sdk/src/entities/view/types.js +1 -1
- package/dist-sdk/src/entities/widget/build.d.ts +4 -3
- package/dist-sdk/src/entities/widget/from-tf.d.ts +3 -0
- package/dist-sdk/src/entities/widget/from-tf.js +100 -3
- package/dist-sdk/src/entities/widget/to-tf.d.ts +16 -1
- package/dist-sdk/src/entities/widget/to-tf.js +77 -14
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +30 -9
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/field-resource-types.d.ts +2 -0
- package/dist-sdk/src/graph/field-resource-types.js +11 -0
- package/dist-sdk/src/graph/index.d.ts +41 -3
- package/dist-sdk/src/graph/index.js +24 -2
- package/dist-sdk/src/graph/types.d.ts +195 -5
- package/package.json +1 -1
|
@@ -116,8 +116,11 @@ type ValidatedUpdateFieldAssignments<Fields extends readonly FieldAssignment[]>
|
|
|
116
116
|
};
|
|
117
117
|
export interface UpdateFieldOptions<A extends AppOrElementOrTaskRef = AppOrElementOrTaskRef, Fields extends readonly FieldAssignment[] = readonly FieldAssignment[]> {
|
|
118
118
|
readonly app: A;
|
|
119
|
-
/**
|
|
120
|
-
|
|
119
|
+
/**
|
|
120
|
+
* The record to update (e.g. `ctx.trigger.record` or `.record.recordId`),
|
|
121
|
+
* or every record a search found (`ctx.actions.<search>.records`).
|
|
122
|
+
*/
|
|
123
|
+
readonly record: RecordReference<A> | Ref<readonly RecordShape<A>[]>;
|
|
121
124
|
readonly fields: Fields & ValidatedUpdateFieldAssignments<NoInfer<Fields>>;
|
|
122
125
|
}
|
|
123
126
|
/** Update fields on an existing record. `value: ""` or `value: null` clears a nullable field (including Dropdown). */
|
|
@@ -168,11 +171,23 @@ export interface RelateRecordsOptions {
|
|
|
168
171
|
readonly target: ValueOrRef<unknown>;
|
|
169
172
|
}
|
|
170
173
|
export declare function relateRecords(opts: RelateRecordsOptions): ActionDef<Record<string, never>>;
|
|
171
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* A file to attach to the email. Set exactly one key: `attachment` is an
|
|
176
|
+
* attachment field, `file` is a file from the trigger or an earlier task, and
|
|
177
|
+
* `record` attaches every file on a record.
|
|
178
|
+
*/
|
|
172
179
|
export type EmailAttachment = {
|
|
180
|
+
readonly attachment: ValueOrRef<unknown>;
|
|
181
|
+
readonly file?: never;
|
|
182
|
+
readonly record?: never;
|
|
183
|
+
} | {
|
|
173
184
|
readonly file: ValueOrRef<unknown>;
|
|
185
|
+
readonly attachment?: never;
|
|
186
|
+
readonly record?: never;
|
|
174
187
|
} | {
|
|
175
|
-
readonly
|
|
188
|
+
readonly record: ValueOrRef<unknown>;
|
|
189
|
+
readonly attachment?: never;
|
|
190
|
+
readonly file?: never;
|
|
176
191
|
};
|
|
177
192
|
export interface SendEmailOptions {
|
|
178
193
|
readonly subject: ValueOrRef<unknown>;
|
|
@@ -185,12 +200,19 @@ export interface SendEmailOptions {
|
|
|
185
200
|
readonly toGroups?: readonly ValueOrRef<unknown>[];
|
|
186
201
|
/** Literal email addresses. */
|
|
187
202
|
readonly toAddresses?: readonly ValueOrRef<unknown>[];
|
|
203
|
+
/** Files to attach. Omit to leave the live attachments as they are; `[]` removes them. */
|
|
188
204
|
readonly attachments?: readonly EmailAttachment[];
|
|
205
|
+
/**
|
|
206
|
+
* The platform id of a DNS-verified sending domain. Omit to keep the live
|
|
207
|
+
* task's domain, including one chosen in the web app; omitting it does not
|
|
208
|
+
* reset the task to the default domain.
|
|
209
|
+
*/
|
|
210
|
+
readonly emailSendDomainId?: string;
|
|
189
211
|
}
|
|
190
212
|
export declare function sendEmail(opts: SendEmailOptions): ActionDef<Record<string, never>>;
|
|
191
213
|
export interface PostCommentOptions {
|
|
192
214
|
readonly contents: ValueOrRef<unknown>;
|
|
193
|
-
/**
|
|
215
|
+
/** Channel (Select Channel): omit or `["public"]` for the Public Channel; `["consumer"]` for the Customer Channel (needs customer chat on the app's record comments). */
|
|
194
216
|
readonly tags?: readonly string[];
|
|
195
217
|
/** The record to comment on (required). */
|
|
196
218
|
readonly record: ValueOrRef<unknown>;
|
|
@@ -316,12 +338,13 @@ type ExecuteScriptFieldValue<T extends ScriptOutputType> = T extends {
|
|
|
316
338
|
readonly [K in keyof P]: ExecuteScriptFieldValue<P[K]>;
|
|
317
339
|
} : T extends {
|
|
318
340
|
readonly type: "object";
|
|
319
|
-
} ? Record<string, unknown> : T extends "integer" | "number" | "decimal" ? number : T extends "boolean" ? boolean : string;
|
|
341
|
+
} | "object" ? Record<string, unknown> : T extends "integer" | "number" | "decimal" ? number : T extends "boolean" ? boolean : string;
|
|
320
342
|
/** The properties of an authored `outputs` option, in either accepted form. */
|
|
321
343
|
type ScriptOutputPropertiesOf<O> = O extends {
|
|
322
344
|
readonly properties: ScriptOutputProperties;
|
|
323
345
|
} ? O["properties"] : O extends ScriptOutputProperties ? O : undefined;
|
|
324
|
-
|
|
346
|
+
/** Result shape for an executeScript whose `outputs` option is `O`. */
|
|
347
|
+
export type ExecuteScriptOutput<O extends ScriptOutputs | undefined> = {
|
|
325
348
|
readonly result: ScriptOutputPropertiesOf<O> extends ScriptOutputProperties ? {
|
|
326
349
|
readonly [K in keyof ScriptOutputPropertiesOf<O>]: ExecuteScriptFieldValue<Extract<ScriptOutputPropertiesOf<O>[K], ScriptOutputType>>;
|
|
327
350
|
} : Record<string, unknown>;
|
|
@@ -354,9 +377,12 @@ export interface ExecuteScriptListInputToken {
|
|
|
354
377
|
* can read - which fields, and under what alias. The value is a whole record
|
|
355
378
|
* or a list of records (a prior task's `.records`, read per item).
|
|
356
379
|
*
|
|
357
|
-
* Inside this wrapper
|
|
358
|
-
*
|
|
359
|
-
*
|
|
380
|
+
* Inside this wrapper a record trigger's `ctx.trigger.record` deploys the
|
|
381
|
+
* whole record. The `.record` of `recordSearch`, `createRecord` and
|
|
382
|
+
* `updateField` is the whole record in any script input, wrapped or not.
|
|
383
|
+
* `.record.recordId` is the ID for `recordSearch` and `createRecord`. An
|
|
384
|
+
* Update Field `.record.recordId` does not build. Elsewhere they are the
|
|
385
|
+
* record ID a `record:` slot takes.
|
|
360
386
|
* An on-demand record parameter and `findRelatedRecords`' `.record` expose
|
|
361
387
|
* only the record ID, so they stay the ID here too.
|
|
362
388
|
*/
|
|
@@ -495,7 +521,24 @@ export interface ApiRequestMultipartPart {
|
|
|
495
521
|
export interface ApiRequestMultipartBody {
|
|
496
522
|
readonly parts: readonly ApiRequestMultipartPart[];
|
|
497
523
|
}
|
|
498
|
-
|
|
524
|
+
/** elementum_api_task's `response_type` values; the provider default is JSON. */
|
|
525
|
+
export type ApiResponseType = "JSON" | "FILE" | "CUSTOM";
|
|
526
|
+
/**
|
|
527
|
+
* apiRequest outputs for a `responseType`. JSON (also when omitted) has no
|
|
528
|
+
* `.file`, since build rejects it (edk#2058); FILE, CUSTOM or a non-literal
|
|
529
|
+
* type keep every accessor.
|
|
530
|
+
*/
|
|
531
|
+
export type ApiRequestOutputs<R extends ApiResponseType = ApiResponseType> = [R] extends ["JSON"] ? {
|
|
532
|
+
response: unknown;
|
|
533
|
+
statusCode?: unknown;
|
|
534
|
+
textResponse?: unknown;
|
|
535
|
+
} : {
|
|
536
|
+
response: unknown;
|
|
537
|
+
file?: unknown;
|
|
538
|
+
statusCode?: unknown;
|
|
539
|
+
textResponse?: unknown;
|
|
540
|
+
};
|
|
541
|
+
export interface ApiRequestOptions<R extends ApiResponseType = ApiResponseType> {
|
|
499
542
|
readonly url: ValueOrRef<unknown>;
|
|
500
543
|
readonly method: string;
|
|
501
544
|
readonly headers?: readonly ApiRequestHeader[];
|
|
@@ -513,15 +556,10 @@ export interface ApiRequestOptions {
|
|
|
513
556
|
readonly customBody?: ApiRequestCustomBody;
|
|
514
557
|
/** elementum_api_task's `multipart_body` block (file uploads). Mutually exclusive with `jsonBody`/`formBody`/`customBody`. */
|
|
515
558
|
readonly multipartBody?: ApiRequestMultipartBody;
|
|
516
|
-
readonly responseType?:
|
|
559
|
+
readonly responseType?: R;
|
|
517
560
|
readonly continueOnError?: boolean;
|
|
518
561
|
}
|
|
519
|
-
export declare function apiRequest(opts: ApiRequestOptions): ActionDef<
|
|
520
|
-
response: unknown;
|
|
521
|
-
file?: unknown;
|
|
522
|
-
statusCode?: unknown;
|
|
523
|
-
textResponse?: unknown;
|
|
524
|
-
}>;
|
|
562
|
+
export declare function apiRequest<R extends ApiResponseType = "JSON">(opts: ApiRequestOptions<R>): ActionDef<ApiRequestOutputs<R>>;
|
|
525
563
|
export interface AiSearchTableOptions {
|
|
526
564
|
readonly table: SearchTableRef | UnsafePlatformId;
|
|
527
565
|
readonly query: ValueOrRef<unknown>;
|
|
@@ -902,7 +940,8 @@ export interface RunAutomationStaticOptions<A extends AutomationCatalogRef = Aut
|
|
|
902
940
|
* The UI's "Dynamic Reference" mode: the automation to run is a value
|
|
903
941
|
* resolved at runtime, such as a trigger parameter or an earlier step's
|
|
904
942
|
* output holding an automation ID. The platform always waits for a dynamic
|
|
905
|
-
* target, so `synchronous` must be `true`.
|
|
943
|
+
* target, so `synchronous` must be `true`. Its outputs don't come back today
|
|
944
|
+
* (see `outputs`).
|
|
906
945
|
*/
|
|
907
946
|
export interface RunAutomationDynamicReferenceOptions<Outputs extends readonly string[] | undefined = undefined> {
|
|
908
947
|
readonly automation: Ref<string>;
|
|
@@ -910,9 +949,15 @@ export interface RunAutomationDynamicReferenceOptions<Outputs extends readonly s
|
|
|
910
949
|
/** Input mappings by the target's on-demand trigger parameter **name**. */
|
|
911
950
|
readonly inputs?: readonly RunAutomationInput[];
|
|
912
951
|
/**
|
|
913
|
-
* Output names to
|
|
914
|
-
*
|
|
915
|
-
*
|
|
952
|
+
* Output names to expose on the step result. The target is unknown at build
|
|
953
|
+
* time, so each name is `unknown`. Omitting `outputs` exposes nothing.
|
|
954
|
+
*
|
|
955
|
+
* The platform doesn't return a Dynamic Reference target's outputs today:
|
|
956
|
+
* every name listed here reads as null at run time, though the same target
|
|
957
|
+
* called with Select Automation returns them (edk#1869). To get a result
|
|
958
|
+
* back, have the target report it instead: give a separate on-demand
|
|
959
|
+
* automation trigger inputs for the result, and end the target with a
|
|
960
|
+
* Select Automation `runAutomation` to it that maps them.
|
|
916
961
|
*/
|
|
917
962
|
readonly outputs?: Outputs;
|
|
918
963
|
}
|
|
@@ -131,8 +131,18 @@ export function relateRecords(opts) {
|
|
|
131
131
|
function refList(values) {
|
|
132
132
|
return values === undefined ? undefined : values.map((v) => typeof v === "object" && v !== null && "__kind" in v && v.__kind === "user" ? v : serializeValueOrRef(v));
|
|
133
133
|
}
|
|
134
|
+
const EMAIL_ATTACHMENT_KEYS = ["attachment", "file", "record"];
|
|
134
135
|
function serializeEmailAttachment(a) {
|
|
135
|
-
|
|
136
|
+
const unknownKeys = Object.keys(a).filter((key) => !EMAIL_ATTACHMENT_KEYS.includes(key));
|
|
137
|
+
if (unknownKeys.length > 0) {
|
|
138
|
+
throw new Error(`sendEmail attachment has unsupported key ${unknownKeys.map((k) => `"${k}"`).join(", ")}; set exactly one of attachment, file, or record.`);
|
|
139
|
+
}
|
|
140
|
+
const present = EMAIL_ATTACHMENT_KEYS.filter((key) => a[key] !== undefined);
|
|
141
|
+
if (present.length !== 1) {
|
|
142
|
+
throw new Error("sendEmail attachment must set exactly one of attachment, file, or record.");
|
|
143
|
+
}
|
|
144
|
+
const key = present[0];
|
|
145
|
+
return { [key]: serializeValueOrRef(a[key]) };
|
|
136
146
|
}
|
|
137
147
|
export function sendEmail(opts) {
|
|
138
148
|
if (!opts.toUsers?.length && !opts.toGroups?.length && !opts.toAddresses?.length) {
|
|
@@ -151,6 +161,7 @@ export function sendEmail(opts) {
|
|
|
151
161
|
...(opts.attachments !== undefined
|
|
152
162
|
? { emailAttachments: opts.attachments.map(serializeEmailAttachment) }
|
|
153
163
|
: {}),
|
|
164
|
+
...(opts.emailSendDomainId !== undefined ? { emailSendDomainId: opts.emailSendDomainId } : {}),
|
|
154
165
|
},
|
|
155
166
|
};
|
|
156
167
|
}
|
|
@@ -310,9 +321,12 @@ const EXECUTE_SCRIPT_LIST_INPUT_MARKER = "__edkExecuteScriptListInput";
|
|
|
310
321
|
* can read - which fields, and under what alias. The value is a whole record
|
|
311
322
|
* or a list of records (a prior task's `.records`, read per item).
|
|
312
323
|
*
|
|
313
|
-
* Inside this wrapper
|
|
314
|
-
*
|
|
315
|
-
*
|
|
324
|
+
* Inside this wrapper a record trigger's `ctx.trigger.record` deploys the
|
|
325
|
+
* whole record. The `.record` of `recordSearch`, `createRecord` and
|
|
326
|
+
* `updateField` is the whole record in any script input, wrapped or not.
|
|
327
|
+
* `.record.recordId` is the ID for `recordSearch` and `createRecord`. An
|
|
328
|
+
* Update Field `.record.recordId` does not build. Elsewhere they are the
|
|
329
|
+
* record ID a `record:` slot takes.
|
|
316
330
|
* An on-demand record parameter and `findRelatedRecords`' `.record` expose
|
|
317
331
|
* only the record ID, so they stay the ID here too.
|
|
318
332
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DeployableEntity } from "../../engine/entity.js";
|
|
2
2
|
import { type ValidationFailure } from "../../engine/validation.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
4
4
|
import { type ForeignRootIdentity, type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
|
|
5
5
|
import type { BuildFieldMetadata } from "../../graph/types.js";
|
|
6
6
|
import type { AppServiceAccount } from "../service-account/build.js";
|
|
@@ -88,8 +88,6 @@ export interface AutomationToTfResult {
|
|
|
88
88
|
readonly blocks: readonly TfBlock[];
|
|
89
89
|
readonly address: string;
|
|
90
90
|
}
|
|
91
|
-
/** Run-automation targets reference publish for ACTIVE automations, automation for draft/inactive. */
|
|
92
|
-
export declare function automationRunTargetResourceAttr(appTfLabel: string, automationRefName: string, activeAutomationRefNames: ReadonlySet<string> | undefined, scope?: ChildResourceScope, handle?: string): TfExpr;
|
|
93
91
|
/**
|
|
94
92
|
* edk#1499: script-input field mappings read fields off a whole record. A
|
|
95
93
|
* value that exposes only a record ID (an onDemand record parameter, or
|