@elementumai/edk 0.13.3 → 0.13.4
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-sdk/src/engine/coverage-gaps.d.ts +3 -0
- package/dist-sdk/src/engine/coverage-gaps.js +5 -0
- package/dist-sdk/src/engine/pull/context.d.ts +1 -1
- package/dist-sdk/src/engine/pull/context.js +1 -1
- package/dist-sdk/src/engine/pull/stream-root.d.ts +5 -1
- package/dist-sdk/src/engine/pull/stream-root.js +3 -0
- package/dist-sdk/src/engine/tf/index.d.ts +1 -0
- package/dist-sdk/src/engine/tf/index.js +1 -0
- package/dist-sdk/src/engine/tf/jsonencode.d.ts +19 -0
- package/dist-sdk/src/engine/tf/jsonencode.js +49 -0
- package/dist-sdk/src/entities/app/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/approval-trigger-refs.d.ts +20 -0
- package/dist-sdk/src/entities/automation/approval-trigger-refs.js +83 -0
- package/dist-sdk/src/entities/automation/build.js +1 -1
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +7 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/automation/from-tf.js +104 -14
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/lookup-owner.d.ts +23 -0
- package/dist-sdk/src/entities/automation/lookup-owner.js +27 -0
- package/dist-sdk/src/entities/automation/module.js +182 -24
- package/dist-sdk/src/entities/automation/to-tf.js +163 -5
- package/dist-sdk/src/entities/automation/triggers.d.ts +47 -1
- package/dist-sdk/src/entities/automation/unsafe-script-output.d.ts +10 -5
- package/dist-sdk/src/entities/automation/unsafe-script-output.js +10 -5
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +31 -11
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +38 -2
- package/dist-sdk/src/entities/element/index.d.ts +1 -1
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +6 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +15 -3
- package/dist-sdk/src/entities/shared/filters/index.js +19 -1
- package/dist-sdk/src/entities/shared/filters/print.js +5 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +13 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +74 -1
- package/dist-sdk/src/entities/shared/filters/types.d.ts +8 -1
- package/dist-sdk/src/entities/widget/to-tf.js +2 -1
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +4 -2
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +1 -1
- package/dist-sdk/src/graph/types.d.ts +23 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type { ApprovalChainRef, AppOrElementRef, DatamineRef, FieldRef } from "../../catalog/index.js";
|
|
12
12
|
import type { UnsafePlatformId } from "../../core/platform-id.js";
|
|
13
13
|
import type { RecordShape } from "../field/record-shape.js";
|
|
14
|
+
import type { CalculationTypedValue } from "../shared/ref.js";
|
|
14
15
|
import { type InferTriggerType, type WithOnDemandTriggeredBy, type TriggerInputFieldDef, type TriggerInputSchema } from "../../core/triggers/on-demand.js";
|
|
15
16
|
import type { OnDemandParamTypeAlias } from "../shared/types/field-types.js";
|
|
16
17
|
import type { Filter } from "./filter.js";
|
|
@@ -153,8 +154,53 @@ export interface approvalProcessStatusUpdatedTriggerOptions<A extends AppOrEleme
|
|
|
153
154
|
*/
|
|
154
155
|
readonly filter?: Filter | null;
|
|
155
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* The user the platform records as having moved the approval process to the
|
|
159
|
+
* trigger's status (the web app's "Final Approval By"): the approver when a
|
|
160
|
+
* person decided, or the user who cancelled. When an approval process expires
|
|
161
|
+
* on its deadline nobody decided, so it doesn't name a decider. The bare
|
|
162
|
+
* `ctx.trigger.approver` reads the id.
|
|
163
|
+
*/
|
|
164
|
+
export interface ApprovalProcessStatusUpdatedApprover {
|
|
165
|
+
readonly id: CalculationTypedValue<string, "user">;
|
|
166
|
+
readonly email: string;
|
|
167
|
+
readonly name: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* What an approval process status trigger gives its steps (#2990): the
|
|
171
|
+
* record, plus who moved the approval process to the status, when, and the
|
|
172
|
+
* status and reason.
|
|
173
|
+
*
|
|
174
|
+
* An approval process with a deadline can expire with nobody acting. It then
|
|
175
|
+
* reports `"APPROVED"` or `"DENIED"` (by its expiration outcome), the same
|
|
176
|
+
* statuses a person's decision gives, but nobody decided, so `approver` is not
|
|
177
|
+
* a person who approved. Only `reason` tells the two apart: on expiry it is
|
|
178
|
+
* "Approval expired due to SLA breach". An expiry that cancels reports the
|
|
179
|
+
* same `"CANCELLED"` as a person cancelling.
|
|
180
|
+
*/
|
|
181
|
+
export interface ApprovalProcessStatusUpdatedTriggerOutput<A extends AppOrElementRef = AppOrElementRef> {
|
|
182
|
+
readonly record: RecordShape<A>;
|
|
183
|
+
/** Who the platform records as moving the approval process to this status (the web app's "Final Approval By"); see the expiry note above. */
|
|
184
|
+
readonly approver: ApprovalProcessStatusUpdatedApprover;
|
|
185
|
+
/** When the approval process reached this status (date and time; the web app's "Final Approval At"). */
|
|
186
|
+
readonly approvalUpdatedAt: CalculationTypedValue<string, "datetime">;
|
|
187
|
+
/**
|
|
188
|
+
* The approval process's status, such as `"APPROVED"`. On a
|
|
189
|
+
* `"STEP_APPROVED"` trigger it is that step's own status (`"APPROVED"`),
|
|
190
|
+
* never `"STEP_APPROVED"`, and `approver` and `reason` are that step's
|
|
191
|
+
* decider and comment.
|
|
192
|
+
*/
|
|
193
|
+
readonly status: approvalProcessStatusUpdatedStatus;
|
|
194
|
+
/**
|
|
195
|
+
* The approval process's reason: the comment given with a person's
|
|
196
|
+
* decision, the platform's message when it is cancelled, "Approval expired
|
|
197
|
+
* due to SLA breach" on expiry, or the reason an automation passed when it
|
|
198
|
+
* set the status.
|
|
199
|
+
*/
|
|
200
|
+
readonly reason: string;
|
|
201
|
+
}
|
|
156
202
|
/** Fires when an approval chain on a record changes to the configured status. */
|
|
157
|
-
export declare function approvalProcessStatusUpdated<A extends AppOrElementRef>(opts: approvalProcessStatusUpdatedTriggerOptions<A>): TriggerChain<
|
|
203
|
+
export declare function approvalProcessStatusUpdated<A extends AppOrElementRef>(opts: approvalProcessStatusUpdatedTriggerOptions<A>): TriggerChain<ApprovalProcessStatusUpdatedTriggerOutput<A>>;
|
|
158
204
|
export interface AttachmentTriggerOptions<A extends AppOrElementRef = AppOrElementRef> {
|
|
159
205
|
readonly app: A;
|
|
160
206
|
/**
|
|
@@ -5,11 +5,16 @@ import { type Ref } from "../shared/ref.js";
|
|
|
5
5
|
* an output, so the reference round-trips unchanged (#1725).
|
|
6
6
|
*
|
|
7
7
|
* The platform resolves only declared outputs, so at runtime this reads
|
|
8
|
-
* nothing
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* nothing, and its publish check rejects the reference ("has a value
|
|
9
|
+
* reference that is no longer valid"): an automation that still uses it
|
|
10
|
+
* plans clean after pull, but any apply that republishes it fails until the
|
|
11
|
+
* script declares the output (#3050). Prefer adding the output to the
|
|
12
|
+
* script's `outputs` and reading `ctx.actions.<script>.result.<output>`.
|
|
13
|
+
* Build rejects a plain undeclared `result.<output>` in a filter, rejects
|
|
14
|
+
* this marker on an undeclared output in a task input, and accepts it in
|
|
15
|
+
* filters, workflow outputs and field assignments, so pulled automations
|
|
16
|
+
* round-trip. On an output the script does declare, it builds the same
|
|
17
|
+
* reference as the plain read.
|
|
13
18
|
*
|
|
14
19
|
* @example
|
|
15
20
|
* ```ts
|
|
@@ -13,11 +13,16 @@ const UNSAFE_SCRIPT_OUTPUT_MARKER = "__edkUnsafeScriptOutput::";
|
|
|
13
13
|
* an output, so the reference round-trips unchanged (#1725).
|
|
14
14
|
*
|
|
15
15
|
* The platform resolves only declared outputs, so at runtime this reads
|
|
16
|
-
* nothing
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* nothing, and its publish check rejects the reference ("has a value
|
|
17
|
+
* reference that is no longer valid"): an automation that still uses it
|
|
18
|
+
* plans clean after pull, but any apply that republishes it fails until the
|
|
19
|
+
* script declares the output (#3050). Prefer adding the output to the
|
|
20
|
+
* script's `outputs` and reading `ctx.actions.<script>.result.<output>`.
|
|
21
|
+
* Build rejects a plain undeclared `result.<output>` in a filter, rejects
|
|
22
|
+
* this marker on an undeclared output in a task input, and accepts it in
|
|
23
|
+
* filters, workflow outputs and field assignments, so pulled automations
|
|
24
|
+
* round-trip. On an output the script does declare, it builds the same
|
|
25
|
+
* reference as the plain read.
|
|
21
26
|
*
|
|
22
27
|
* @example
|
|
23
28
|
* ```ts
|
|
@@ -2,15 +2,30 @@ import type { AgentRef, AppOrElementRef, AutomationRef, FieldRef, WidgetRef } fr
|
|
|
2
2
|
import type { UnsafePlatformId } from "../../core/platform-id.js";
|
|
3
3
|
import type { AppViewFieldRef } from "../app/build.js";
|
|
4
4
|
import type { Filter } from "../shared/filters/types.js";
|
|
5
|
-
|
|
5
|
+
interface DynamicLayoutValueMap {
|
|
6
6
|
readonly string: string;
|
|
7
|
-
} | {
|
|
8
7
|
readonly number: number;
|
|
9
|
-
} | {
|
|
10
8
|
readonly boolean: boolean;
|
|
11
|
-
} | {
|
|
12
9
|
readonly strings: readonly string[];
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The person viewing the record, as the layout editor's **Current User**.
|
|
12
|
+
* Compare a user field with it using `equals` or `notEquals`.
|
|
13
|
+
*/
|
|
14
|
+
readonly currentUser: true;
|
|
15
|
+
/**
|
|
16
|
+
* The groups of the person viewing the record, as the layout editor's
|
|
17
|
+
* **Current User's Groups**. Compare a group field with it: `equals` and
|
|
18
|
+
* `in` are true when the field's group is one of the viewer's groups,
|
|
19
|
+
* `notEquals` and `notIn` when it is not.
|
|
20
|
+
*/
|
|
21
|
+
readonly currentUserGroups: true;
|
|
22
|
+
}
|
|
23
|
+
/** A fixed comparison value or default: exactly one of `string`, `number`, `boolean`, `strings`. */
|
|
24
|
+
export type DynamicLayoutTypedValue = ExactlyOneVariant<Pick<DynamicLayoutValueMap, "string" | "number" | "boolean" | "strings">>;
|
|
25
|
+
/** The person viewing the record (the editor's **Current User**); exactly `{ currentUser: true }`. */
|
|
26
|
+
export type DynamicLayoutCurrentUserValue = ExactlyOneVariant<Pick<DynamicLayoutValueMap, "currentUser">>;
|
|
27
|
+
/** The viewer's groups (the editor's **Current User's Groups**); exactly `{ currentUserGroups: true }`. */
|
|
28
|
+
export type DynamicLayoutCurrentUserGroupsValue = ExactlyOneVariant<Pick<DynamicLayoutValueMap, "currentUserGroups">>;
|
|
14
29
|
export type DynamicLayoutCssLength = {
|
|
15
30
|
readonly px: number;
|
|
16
31
|
} | {
|
|
@@ -165,6 +180,7 @@ export interface DynamicLayoutComponentVariantMap {
|
|
|
165
180
|
readonly variant?: "default" | "outline" | "ghost" | "destructive";
|
|
166
181
|
readonly icon?: string;
|
|
167
182
|
readonly confirmMessage?: string;
|
|
183
|
+
readonly fieldName?: string;
|
|
168
184
|
/** App or element that owns the automation, as the layout editor records it. */
|
|
169
185
|
readonly automationApp?: AppOrElementRef;
|
|
170
186
|
readonly color?: string;
|
|
@@ -235,21 +251,25 @@ type ExactlyOneVariant<Map extends object> = {
|
|
|
235
251
|
};
|
|
236
252
|
}[keyof Map];
|
|
237
253
|
export type DynamicLayoutComponent<ComponentKey extends string = string, ConditionKey extends string = string, SaveGroupKey extends string = string> = DynamicLayoutComponentCommon<ComponentKey, ConditionKey, SaveGroupKey> & ExactlyOneVariant<DynamicLayoutComponentVariantMap>;
|
|
238
|
-
export type DynamicLayoutComparison = {
|
|
254
|
+
export type DynamicLayoutComparison<Value = DynamicLayoutTypedValue> = {
|
|
239
255
|
readonly field: AppViewFieldRef;
|
|
240
|
-
readonly value:
|
|
256
|
+
readonly value: Value;
|
|
241
257
|
};
|
|
258
|
+
/** `equals` / `notEquals`: a typed value, the viewer, or the viewer's groups. */
|
|
259
|
+
export type DynamicLayoutEqualityComparison = DynamicLayoutComparison<ExactlyOneVariant<Pick<DynamicLayoutValueMap, "string" | "number" | "boolean" | "strings" | "currentUser" | "currentUserGroups">>>;
|
|
260
|
+
/** `in` / `notIn`: a list of strings, or the viewer's groups (the provider accepts nothing else). */
|
|
261
|
+
export type DynamicLayoutMembershipComparison = DynamicLayoutComparison<ExactlyOneVariant<Pick<DynamicLayoutValueMap, "strings" | "currentUserGroups">>>;
|
|
242
262
|
interface DynamicLayoutConditionVariantMap<ConditionKey extends string> {
|
|
243
|
-
readonly equals:
|
|
244
|
-
readonly notEquals:
|
|
263
|
+
readonly equals: DynamicLayoutEqualityComparison;
|
|
264
|
+
readonly notEquals: DynamicLayoutEqualityComparison;
|
|
245
265
|
readonly greaterThan: DynamicLayoutComparison;
|
|
246
266
|
readonly greaterThanOrEqual: DynamicLayoutComparison;
|
|
247
267
|
readonly lessThan: DynamicLayoutComparison;
|
|
248
268
|
readonly lessThanOrEqual: DynamicLayoutComparison;
|
|
249
269
|
readonly contains: DynamicLayoutComparison;
|
|
250
270
|
readonly notContains: DynamicLayoutComparison;
|
|
251
|
-
readonly in:
|
|
252
|
-
readonly notIn:
|
|
271
|
+
readonly in: DynamicLayoutMembershipComparison;
|
|
272
|
+
readonly notIn: DynamicLayoutMembershipComparison;
|
|
253
273
|
readonly empty: {
|
|
254
274
|
readonly field: AppViewFieldRef;
|
|
255
275
|
};
|
|
@@ -3,6 +3,7 @@ import { resolveForeignRef } from "../shared/foreign-ref.js";
|
|
|
3
3
|
import { expr, isCanonicalTsLabel, isTfExpr, isUuid, scopedResourceLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
|
|
4
4
|
import { filterToTf } from "../access-policy/to-tf.js";
|
|
5
5
|
import { AUTOMATION_RESOURCE_TYPE, WORKFLOW_PUBLISH_RESOURCE_TYPE, automationResourceLabel } from "../automation/types.js";
|
|
6
|
+
import { automationLookupOwnerId } from "../automation/lookup-owner.js";
|
|
6
7
|
import { isUnsafePlatformId } from "../../core/platform-id.js";
|
|
7
8
|
import { droppedEntryGap, fieldRefToTfValue, UNRESOLVED_FIELD_REF } from "../field/to-tf.js";
|
|
8
9
|
import { targetFilterFieldResolver } from "../relationship/to-tf.js";
|
|
@@ -658,8 +659,10 @@ function conditionMap(conditions, where, opts) {
|
|
|
658
659
|
const field = resolveField(rec["field"], `${where}.conditions.${conditionId}.${key}`, opts);
|
|
659
660
|
if (field !== undefined)
|
|
660
661
|
comparison["field_id"] = field;
|
|
661
|
-
if (rec["value"] !== undefined)
|
|
662
|
+
if (rec["value"] !== undefined) {
|
|
663
|
+
checkViewerValue(key, rec["value"], rec["field"], `${where}.conditions.${conditionId}.${key}`, opts);
|
|
662
664
|
comparison["value"] = typedValue(rec["value"], rec["field"], opts);
|
|
665
|
+
}
|
|
663
666
|
attrs[snakeKey(key)] = comparison;
|
|
664
667
|
}
|
|
665
668
|
else if (key === "stage") {
|
|
@@ -746,6 +749,39 @@ function resolveField(value, where, opts) {
|
|
|
746
749
|
opts.diagnostics.push(`${where}: field "${refName}" has no Terraform mapping; dropped`);
|
|
747
750
|
return resolved;
|
|
748
751
|
}
|
|
752
|
+
/**
|
|
753
|
+
* The layout editor offers Current User only on a user field with equals /
|
|
754
|
+
* not equals, and Current User's Groups only on a group field with equals /
|
|
755
|
+
* not equals / in / not in (edk#3038). The provider rejects any other
|
|
756
|
+
* operator; a field of another type still applies but never matches as
|
|
757
|
+
* intended, so build says so.
|
|
758
|
+
*/
|
|
759
|
+
const VIEWER_VALUE_RULES = {
|
|
760
|
+
currentUser: { operators: new Set(["equals", "notEquals"]), fieldTypes: new Set(["USER", "USER_ID"]), label: "a user field" },
|
|
761
|
+
currentUserGroups: { operators: new Set(["equals", "notEquals", "in", "notIn"]), fieldTypes: new Set(["GROUP", "GROUP_ID"]), label: "a group field" },
|
|
762
|
+
};
|
|
763
|
+
function checkViewerValue(operator, value, fieldValue, where, opts) {
|
|
764
|
+
const rec = object(value);
|
|
765
|
+
for (const [marker, rule] of Object.entries(VIEWER_VALUE_RULES)) {
|
|
766
|
+
// An undefined key is absent, as everywhere else in this file.
|
|
767
|
+
if (rec[marker] === undefined)
|
|
768
|
+
continue;
|
|
769
|
+
if (rec[marker] !== true) {
|
|
770
|
+
throw new EntityTfError(`${where}: ${marker} must be true`);
|
|
771
|
+
}
|
|
772
|
+
const others = Object.keys(rec).filter((key) => key !== marker && rec[key] !== undefined);
|
|
773
|
+
if (others.length > 0) {
|
|
774
|
+
throw new EntityTfError(`${where}: ${marker} is the whole value; remove ${others.join(", ")}`);
|
|
775
|
+
}
|
|
776
|
+
if (!rule.operators.has(operator)) {
|
|
777
|
+
throw new EntityTfError(`${where}: ${marker} can't be used with ${operator}; use ${[...rule.operators].join(", ")}`);
|
|
778
|
+
}
|
|
779
|
+
const fieldType = fieldValue?.fieldType;
|
|
780
|
+
if (fieldType !== undefined && !rule.fieldTypes.has(fieldType)) {
|
|
781
|
+
opts.diagnostics.push(`${where}: ${marker} compares ${rule.label}, but this field is ${fieldType}; the condition will not match the viewer as intended`);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
749
785
|
function typedValue(value, fieldValue, opts) {
|
|
750
786
|
const rec = object(value);
|
|
751
787
|
const token = fieldValue;
|
|
@@ -801,7 +837,7 @@ function resolveAutomation(token, where, opts) {
|
|
|
801
837
|
const platformName = platformAutomationName(token, opts);
|
|
802
838
|
if (platformName !== undefined) {
|
|
803
839
|
const label = `${opts.ownerTfLabel}_${tsLabelToTfLabel(refName)}`;
|
|
804
|
-
opts.orgRefs.rawLookup(AUTOMATION_RESOURCE_TYPE, label, platformName, { app_id: opts.
|
|
840
|
+
opts.orgRefs.rawLookup(AUTOMATION_RESOURCE_TYPE, label, platformName, { app_id: automationLookupOwnerId(scopeOf(opts), opts.ownerTfLabel, opts.orgRefs) });
|
|
805
841
|
return expr.dataAttr(AUTOMATION_RESOURCE_TYPE, label, ["id"]);
|
|
806
842
|
}
|
|
807
843
|
return expr.resourceAttr(AUTOMATION_RESOURCE_TYPE, automationResourceLabel(opts.ownerTfLabel, refName, scopeOf(opts), scopeOf(opts) === "element" ? opts.ownerHandle : undefined), ["id"]);
|
|
@@ -11,7 +11,7 @@ export { type AppRecordCreateForm, type AppRecordCreateFormSection } from "../ap
|
|
|
11
11
|
export { listViewDensity, managedViewSortAggregation, managedViewSortDirection, type ListViewDensity, type ManagedViewSort, type ManagedViewSortAggregation, type ManagedViewSortDirection, type ManagedViewSortField, type ManagedViewSortOrder, } from "../view/build.js";
|
|
12
12
|
export { type AppRelationship, type AppRelationshipColumn } from "../relationship/build.js";
|
|
13
13
|
export { runAutomationParameterValue, type RunAutomationParameterValue } from "../widget/build.js";
|
|
14
|
-
export { type DynamicLayoutBlockCommon, type DynamicLayoutComponent, type DynamicLayoutCondition, type DynamicLayoutCssLength, type DynamicLayoutDependency, type DynamicLayoutFieldComponent, type DynamicLayoutFieldValidation, type DynamicLayoutSaveGroup, type DynamicLayoutStyle, type DynamicLayoutTypedValue, type DynamicLayoutValidationRule, type ElementDynamicLayout, dynamicLayout, } from "../dynamic-layout/build.js";
|
|
14
|
+
export { type DynamicLayoutBlockCommon, type DynamicLayoutComponent, type DynamicLayoutCondition, type DynamicLayoutCssLength, type DynamicLayoutDependency, type DynamicLayoutFieldComponent, type DynamicLayoutFieldValidation, type DynamicLayoutSaveGroup, type DynamicLayoutStyle, type DynamicLayoutTypedValue, type DynamicLayoutCurrentUserValue, type DynamicLayoutCurrentUserGroupsValue, type DynamicLayoutEqualityComparison, type DynamicLayoutMembershipComparison, type DynamicLayoutValidationRule, type ElementDynamicLayout, dynamicLayout, } from "../dynamic-layout/build.js";
|
|
15
15
|
export { dashboardChartWidget, dashboardRecordsWidget, dashboardWidgetSize, type DashboardChartWidget, type DashboardRecordsWidget, type DashboardWidget, type DashboardWidgetSize, } from "../dashboard/build.js";
|
|
16
16
|
export { attachmentField, booleanField, calculatedField, dateField, dateTimeField, decimalField, dropdownDisplay, dropdownField, dropdownOption, dropdownValue, groupField, jsonField, multiSelectField, numberField, relationField, richTextField, textField, userField, type AttachmentFieldOptions, type BaseFieldOptions, type CalculatedFieldOptions, type InferredCalculatedField, type NumericFieldFormat, type DropdownConfig, type DropdownDisplay, type DropdownFieldOptions, type DropdownOption, type DropdownParentValueRef, type DynamicDropdownConfig, type DynamicDropdownParent, type DynamicDropdownParentMapping, type MultiSelectFieldOptions, type NumericFieldOptions, type RelationFieldOptions, type QrFieldFormat, type TextFieldOptions, } from "../field/build.js";
|
|
17
17
|
export { calc, dateDifUnit, dateTimeTruncPrecision, field, orderByDirection, predicateOp, weekdayMode, type ConcatExprType, type DateDifUnit, type DateTimeTruncPrecision, type Expr, type ExprType, type FieldRefExprType, type OrderByDirection, type Predicate, type PredicateOp, type StringAggOptions, type StringAggOrderBy, type WeekdayMode, } from "../field/calc.js";
|
|
@@ -130,6 +130,12 @@ export interface AutomationRefAst {
|
|
|
130
130
|
readonly kind: "automation";
|
|
131
131
|
readonly appHandle: string;
|
|
132
132
|
readonly automationKey: string;
|
|
133
|
+
/**
|
|
134
|
+
* Display name of an automation pull leaves platform-managed, so it is not
|
|
135
|
+
* in source: printed as `automationRef({ refName, name, parent })`, which
|
|
136
|
+
* build looks up by that name (#3047).
|
|
137
|
+
*/
|
|
138
|
+
readonly unmanagedName?: string;
|
|
133
139
|
}
|
|
134
140
|
/** Reference to an app's document model via the app's `documentModels` bag. */
|
|
135
141
|
export interface DocumentModelRefAst {
|
|
@@ -4,8 +4,8 @@ import type { UnsafePlatformId } from "../../../core/platform-id.js";
|
|
|
4
4
|
import { type AppField, type FieldScope } from "../../../core/types/app.js";
|
|
5
5
|
import { type Ref } from "../ref.js";
|
|
6
6
|
import type { WorkflowFieldType } from "../types/field-types.js";
|
|
7
|
-
import type { AndFilter, BetweenFilter, ConsecutiveRangeFilter, ContainsFilter, CurrentRangeFilter, DateTimeUnit, EqualsFilter, FalseFilter, Filter, FilterReference, FilterValue, GreaterThanEqualsFilter, GreaterThanFilter, InFilter, IsNullFilter, LessThanEqualsFilter, LessThanFilter, LikeFilter, LikeMode, OrFilter, OverlapsFilter, TrueFilter, ValueType } from "./types.js";
|
|
8
|
-
export type { AndFilter, BetweenFilter, ConsecutiveRangeFilter, ContainsFilter, CurrentRangeFilter, DateTimeUnit, EqualsFilter, FalseFilter, FieldFilterOptions, Filter, FilterReference, FilterValue, GreaterThanEqualsFilter, GreaterThanFilter, InFilter, IsNullFilter, LessThanEqualsFilter, LessThanFilter, LikeFilter, LikeMode, OrFilter, OverlapsFilter, TrueFilter, ValueType, } from "./types.js";
|
|
7
|
+
import type { AndFilter, BetweenFilter, ConsecutiveRangeFilter, ContainsFilter, CurrentRangeFilter, DateTimeUnit, EqualsFilter, FalseFilter, Filter, FilterReference, FilterValue, GreaterThanEqualsFilter, GreaterThanFilter, InFilter, IsNullFilter, LessThanEqualsFilter, LessThanFilter, LikeFilter, LikeMode, OrFilter, OverlapsFilter, ReferenceValueType, TrueFilter, ValueType } from "./types.js";
|
|
8
|
+
export type { AndFilter, BetweenFilter, ConsecutiveRangeFilter, ContainsFilter, CurrentRangeFilter, DateTimeUnit, EqualsFilter, FalseFilter, FieldFilterOptions, Filter, FilterReference, FilterValue, GreaterThanEqualsFilter, GreaterThanFilter, InFilter, IsNullFilter, LessThanEqualsFilter, LessThanFilter, LikeFilter, LikeMode, OrFilter, OverlapsFilter, ReferenceValueType, TrueFilter, ValueType, } from "./types.js";
|
|
9
9
|
export type FilterField = AppOrElementRef | FieldRef | UserFieldRef | UserGroupFieldRef | TableColumnRef | TableRef | AppField<FieldScope> | UnsafePlatformId | string;
|
|
10
10
|
/**
|
|
11
11
|
* A filter field named by a field token or `unsafePlatformId()`, never by a bare
|
|
@@ -29,7 +29,7 @@ declare const FILTER_REFERENCE_BRAND: unique symbol;
|
|
|
29
29
|
export interface FilterReferenceInput {
|
|
30
30
|
readonly [FILTER_REFERENCE_BRAND]: true;
|
|
31
31
|
readonly ref: Ref<unknown> | string;
|
|
32
|
-
readonly valueType:
|
|
32
|
+
readonly valueType: ReferenceValueType;
|
|
33
33
|
/** The caller named this type. Build must not replace it with field metadata. */
|
|
34
34
|
readonly explicit: true;
|
|
35
35
|
readonly multiple?: boolean;
|
|
@@ -52,6 +52,18 @@ export declare function text(ref: Ref<unknown> | string, options?: {
|
|
|
52
52
|
export declare function uuid(ref: Ref<unknown> | string, options?: {
|
|
53
53
|
readonly multiple?: boolean;
|
|
54
54
|
}): FilterReferenceInput;
|
|
55
|
+
/**
|
|
56
|
+
* The groups of the user a reference holds (the automation builder's
|
|
57
|
+
* "<user>'s groups", such as "Triggered By's groups"), for a record search on
|
|
58
|
+
* a Group field:
|
|
59
|
+
* `filter.isIn(self.fields.assignmentGroup, [filter.groupsOf(ctx.trigger.triggeredBy.id)])`
|
|
60
|
+
* matches a record whose group is one of that user's groups (`isNotIn`: is
|
|
61
|
+
* not). The platform accepts it only as the sole value of `isIn` / `isNotIn`
|
|
62
|
+
* on a Group field, and build refuses anything else. The reference must hold
|
|
63
|
+
* one user's id, such as `ctx.trigger.triggeredBy.id` or a user-id output, not
|
|
64
|
+
* an email or name (edk#3039).
|
|
65
|
+
*/
|
|
66
|
+
export declare function groupsOf(ref: Ref<unknown> | string): FilterReferenceInput;
|
|
55
67
|
export declare function isFilterReferenceInput(value: unknown): value is FilterReferenceInput;
|
|
56
68
|
/**
|
|
57
69
|
* A picklist, status, or stage option selected by its LABEL. Build resolves
|
|
@@ -72,6 +72,20 @@ export function text(ref, options) {
|
|
|
72
72
|
export function uuid(ref, options) {
|
|
73
73
|
return referenceInput(ref, "UUID", options);
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* The groups of the user a reference holds (the automation builder's
|
|
77
|
+
* "<user>'s groups", such as "Triggered By's groups"), for a record search on
|
|
78
|
+
* a Group field:
|
|
79
|
+
* `filter.isIn(self.fields.assignmentGroup, [filter.groupsOf(ctx.trigger.triggeredBy.id)])`
|
|
80
|
+
* matches a record whose group is one of that user's groups (`isNotIn`: is
|
|
81
|
+
* not). The platform accepts it only as the sole value of `isIn` / `isNotIn`
|
|
82
|
+
* on a Group field, and build refuses anything else. The reference must hold
|
|
83
|
+
* one user's id, such as `ctx.trigger.triggeredBy.id` or a user-id output, not
|
|
84
|
+
* an email or name (edk#3039).
|
|
85
|
+
*/
|
|
86
|
+
export function groupsOf(ref) {
|
|
87
|
+
return referenceInput(ref, "USER_GROUPS");
|
|
88
|
+
}
|
|
75
89
|
export function isFilterReferenceInput(value) {
|
|
76
90
|
return typeof value === "object" && value !== null && FILTER_REFERENCE_BRAND in value;
|
|
77
91
|
}
|
|
@@ -188,8 +202,12 @@ function leftType(left, fallback, explicit) {
|
|
|
188
202
|
return leftType(sourceField(left), fallback, explicit);
|
|
189
203
|
if (explicit !== undefined)
|
|
190
204
|
return explicit;
|
|
191
|
-
if (isFilterReferenceInput(left))
|
|
205
|
+
if (isFilterReferenceInput(left)) {
|
|
206
|
+
if (left.valueType === "USER_GROUPS") {
|
|
207
|
+
throw new EdkValidationError("filter.groupsOf(...) can't be the compared side: use it as the only value of filter.isIn / filter.isNotIn on a Group field");
|
|
208
|
+
}
|
|
192
209
|
return left.valueType;
|
|
210
|
+
}
|
|
193
211
|
if (isRef(left) || typeof left === "string" || isUnsafePlatformId(left))
|
|
194
212
|
return fallback;
|
|
195
213
|
return fieldTypeToValueType(isAppField(left) ? left.type : "fieldType" in left ? left.fieldType : undefined);
|
|
@@ -164,6 +164,11 @@ function printFilterValue(value, codec, call, quote) {
|
|
|
164
164
|
case "UUID":
|
|
165
165
|
helper = "uuid";
|
|
166
166
|
break;
|
|
167
|
+
case "USER_GROUPS":
|
|
168
|
+
if (value.multiple === true)
|
|
169
|
+
throw new EntityTfError("a user-groups filter value holds one user, never a list");
|
|
170
|
+
helper = "groupsOf";
|
|
171
|
+
break;
|
|
167
172
|
case undefined:
|
|
168
173
|
return `${codec.reference(value.value)}${options}`;
|
|
169
174
|
default: throw new Error(`unsupported filter reference type "${realType}"`);
|
|
@@ -117,6 +117,19 @@ export interface FilterToTfCodec {
|
|
|
117
117
|
* that authored type is kept as written.
|
|
118
118
|
*/
|
|
119
119
|
readonly referenceRealType?: (reference: unknown, role: "left" | "value", authored: string | undefined) => string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* `filter.groupsOf(...)` is accepted only where the owner sets this: the
|
|
122
|
+
* platform expands USER_GROUPS in record search filters alone (edk#3039).
|
|
123
|
+
*/
|
|
124
|
+
readonly allowGroupsOf?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* The declared type of what a reference holds (`USER_ID`, `TEXT`, …), or
|
|
127
|
+
* undefined when the owner can't tell. `filter.groupsOf` needs a user id.
|
|
128
|
+
*/
|
|
129
|
+
readonly referenceDeclaredType?: (reference: unknown) => {
|
|
130
|
+
readonly type: string;
|
|
131
|
+
readonly multiple?: boolean;
|
|
132
|
+
} | undefined;
|
|
120
133
|
}
|
|
121
134
|
/** Which schema a filter's `field_id` addresses: app/element fields, or the fixed platform user / user-group directory. */
|
|
122
135
|
export type FilterFieldScope = "app" | "user" | "userGroup";
|
|
@@ -64,6 +64,78 @@ function fieldOptions(filter, codec, type) {
|
|
|
64
64
|
: {}),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
+
function isGroupsOfValue(value) {
|
|
68
|
+
if (typeof value !== "object" || value === null)
|
|
69
|
+
return false;
|
|
70
|
+
const raw = value;
|
|
71
|
+
const realType = raw.realType ?? raw.real_type;
|
|
72
|
+
return typeof realType === "string" && realType.toUpperCase() === "USER_GROUPS";
|
|
73
|
+
}
|
|
74
|
+
/** Why a reference of this declared type isn't one user's id, in product words. */
|
|
75
|
+
function groupsOfTypeProblem(declared) {
|
|
76
|
+
if (declared === "USER")
|
|
77
|
+
return "is a whole user (use its .id)";
|
|
78
|
+
if (declared === "OBJECT")
|
|
79
|
+
return "is a whole item, not one user's id";
|
|
80
|
+
if (declared === "ASPECT_RECORD_ID" || declared === "RECORD_ID")
|
|
81
|
+
return "is a record's id, not a user's id";
|
|
82
|
+
if (declared === "GROUP" || declared === "GROUP_ID")
|
|
83
|
+
return "is a group, not a user's id";
|
|
84
|
+
if (declared === "RECORD_HANDLE")
|
|
85
|
+
return "is the record's ID, not a user's id";
|
|
86
|
+
if (declared === "DROPDOWN" || declared === "PICKLIST" || declared === "SYSTEM_FIELD" || declared.endsWith("_PART"))
|
|
87
|
+
return "is not a user's id";
|
|
88
|
+
return `holds a ${declared.toLowerCase().replace(/_/g, " ")} value, not a user's id`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The platform expands `filter.groupsOf(...)` (realType USER_GROUPS) only as
|
|
92
|
+
* the sole value of an IN filter on a Group field, from one user's id (jarvis
|
|
93
|
+
* UserGroupsFilterResolver); anything else fails when the automation runs.
|
|
94
|
+
* edk#3039.
|
|
95
|
+
*/
|
|
96
|
+
function checkGroupsOfPlacement(filter, type, field, codec) {
|
|
97
|
+
const values = Array.isArray(filter.values) ? filter.values : [];
|
|
98
|
+
const others = [filter.leftValue, filter.value, filter.min, filter.max];
|
|
99
|
+
if (!others.some(isGroupsOfValue) && !values.some(isGroupsOfValue))
|
|
100
|
+
return;
|
|
101
|
+
const fail = (why) => {
|
|
102
|
+
throw new EntityTfError(`filter.groupsOf(...) ${why}: use it as the only value of filter.isIn / filter.isNotIn on a Group field in a record search`);
|
|
103
|
+
};
|
|
104
|
+
// A problem with the reference itself: its own advice, not the placement's.
|
|
105
|
+
const failReference = (why) => {
|
|
106
|
+
throw new EntityTfError(`filter.groupsOf(...) ${why}; it takes one user's id, such as ctx.trigger.triggeredBy.id or a user field's .id`);
|
|
107
|
+
};
|
|
108
|
+
if (codec.allowGroupsOf !== true)
|
|
109
|
+
fail("works only in a record search filter");
|
|
110
|
+
if (isGroupsOfValue(filter.leftValue))
|
|
111
|
+
fail("can't be the compared side");
|
|
112
|
+
// The platform reads the compared field's id (operator.getField()); a
|
|
113
|
+
// fieldValue(...) left side leaves it empty.
|
|
114
|
+
if (filter.field === undefined)
|
|
115
|
+
fail("needs a field as the compared side, not a fieldValue(...) or a reference");
|
|
116
|
+
if (type !== "in")
|
|
117
|
+
fail(`can't be used with ${type}`);
|
|
118
|
+
if (values.length !== 1)
|
|
119
|
+
fail("must be the only value in its list");
|
|
120
|
+
const fieldType = typeof field === "object" && field !== null ? field.fieldType : undefined;
|
|
121
|
+
if (typeof fieldType === "string" && fieldType !== "GROUP" && fieldType !== "GROUP_ID")
|
|
122
|
+
fail(`compares a ${fieldType} field`);
|
|
123
|
+
const groupsOfValue = values[0];
|
|
124
|
+
if (groupsOfValue.multiple === true)
|
|
125
|
+
failReference("holds a list");
|
|
126
|
+
const reference = groupsOfValue.value;
|
|
127
|
+
const declaredType = codec.referenceDeclaredType?.(reference);
|
|
128
|
+
const declared = declaredType?.type.toUpperCase();
|
|
129
|
+
if (declaredType?.multiple === true)
|
|
130
|
+
failReference("holds a list");
|
|
131
|
+
if (declared !== undefined && declared !== "USER_ID")
|
|
132
|
+
failReference(groupsOfTypeProblem(declared));
|
|
133
|
+
const name = typeof reference === "object" && reference !== null ? reference.name : undefined;
|
|
134
|
+
// Without a declared type, a reference named for an email or a name
|
|
135
|
+
// ("triggeredBy.email", "User's Email", "managerEmail") never holds an id.
|
|
136
|
+
if (declared === undefined && typeof name === "string" && /(?:email|name)$/i.test(name))
|
|
137
|
+
failReference(`holds ${JSON.stringify(name)}, not a user's id`);
|
|
138
|
+
}
|
|
67
139
|
/** The only authored/wire-filter -> Terraform-HCL filter serializer. */
|
|
68
140
|
export function filterToTf(value, codec) {
|
|
69
141
|
const filter = wireFilter(value);
|
|
@@ -76,6 +148,7 @@ export function filterToTf(value, codec) {
|
|
|
76
148
|
return { type, children: filter.children.map((child) => filterToTf(child, codec)) };
|
|
77
149
|
}
|
|
78
150
|
const field = filter.field ?? codec.fieldFromLeftValue?.(filter.leftValue);
|
|
151
|
+
checkGroupsOfPlacement(filter, type, field, codec);
|
|
79
152
|
const left = withLeft(filter, codec, type);
|
|
80
153
|
if (left.field_id === undefined && left.left_value === undefined) {
|
|
81
154
|
throw new EntityTfError(`${type} filter has no left side`);
|
|
@@ -491,7 +564,7 @@ function decodedReferenceRealType(codec, reference, stored) {
|
|
|
491
564
|
const fallback = (present ? stored.toUpperCase() : "TEXT");
|
|
492
565
|
if (present)
|
|
493
566
|
return fallback;
|
|
494
|
-
return codec.referenceType?.(reference,
|
|
567
|
+
return codec.referenceType?.(reference, "TEXT") ?? fallback;
|
|
495
568
|
}
|
|
496
569
|
/** The only Terraform-HCL filter -> strongly typed deserializer AST. */
|
|
497
570
|
export function filterFromTf(value, codec, fieldScope = "app") {
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* Discriminated on `type` with values matching platform filter type names.
|
|
5
5
|
*/
|
|
6
6
|
export type ValueType = "BOOLEAN" | "CURRENT_USER" | "DATE" | "DATETIME" | "FIELD" | "NULL" | "NUMBER" | "RECORD_FIELD" | "REFERENCE" | "TEXT" | "UUID";
|
|
7
|
+
/**
|
|
8
|
+
* The type a REFERENCE value compares as. Besides every comparison type it
|
|
9
|
+
* can be USER_GROUPS: the groups of the user the reference holds, which only
|
|
10
|
+
* `filter.groupsOf(...)` writes (edk#3039). It is not a comparison type an
|
|
11
|
+
* operator accepts.
|
|
12
|
+
*/
|
|
13
|
+
export type ReferenceValueType = ValueType | "USER_GROUPS";
|
|
7
14
|
export type FilterReference = {
|
|
8
15
|
type: "TRIGGER";
|
|
9
16
|
name: string;
|
|
@@ -95,7 +102,7 @@ export type FilterValue<FieldValue = string, ReferenceValue = FilterReference> =
|
|
|
95
102
|
*/
|
|
96
103
|
| {
|
|
97
104
|
type: "REFERENCE";
|
|
98
|
-
realType?:
|
|
105
|
+
realType?: ReferenceValueType;
|
|
99
106
|
explicit?: true;
|
|
100
107
|
value: ReferenceValue;
|
|
101
108
|
label?: string;
|
|
@@ -3,6 +3,7 @@ import { workspaceAspectKey } from "../../engine/build/context.js";
|
|
|
3
3
|
import { foreignFieldDataLabel, resolveForeignRef } from "../shared/foreign-ref.js";
|
|
4
4
|
import { expr, isCanonicalTsLabel, sanitizeName, scopedResourceLabel, tfLabelToTsLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
|
|
5
5
|
import { AUTOMATION_RESOURCE_TYPE, automationResourceLabel } from "../automation/types.js";
|
|
6
|
+
import { automationLookupOwnerId } from "../automation/lookup-owner.js";
|
|
6
7
|
import { fieldMetadataFromEntries } from "../field/metadata.js";
|
|
7
8
|
import { authoredFieldKeysFromPayload, droppedEntryGap, fieldLookupName, fieldRefToTfValue, unauthoredSiblingFieldRef, UNRESOLVED_FIELD_REF, } from "../field/to-tf.js";
|
|
8
9
|
import { runAutomationParameterValue } from "./build.js";
|
|
@@ -391,7 +392,7 @@ function resolveAutomation(value, widgetKey, where, opts) {
|
|
|
391
392
|
return undefined;
|
|
392
393
|
}
|
|
393
394
|
const label = `${opts.ownerTfLabel}_${tsLabelToTfLabel(refName)}`;
|
|
394
|
-
opts.orgRefs.rawLookup(AUTOMATION_RESOURCE_TYPE, label, displayName, { app_id: opts.
|
|
395
|
+
opts.orgRefs.rawLookup(AUTOMATION_RESOURCE_TYPE, label, displayName, { app_id: automationLookupOwnerId(opts.scope, opts.ownerTfLabel, opts.orgRefs) });
|
|
395
396
|
return expr.dataAttr(AUTOMATION_RESOURCE_TYPE, label, ["id"]);
|
|
396
397
|
}
|
|
397
398
|
return expr.resourceAttr(AUTOMATION_RESOURCE_TYPE, automationResourceLabel(opts.ownerTfLabel, refName, opts.scope, opts.scope === "element" ? opts.ownerHandle : undefined), ["id"]);
|
|
@@ -167,7 +167,7 @@ export type ListControlsOption = {
|
|
|
167
167
|
/**
|
|
168
168
|
* Customer-facing name: Record list
|
|
169
169
|
* Customer-facing description: A compact stacked list of records with titles and status pills. Use it for queues and pickers.
|
|
170
|
-
* Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. Optional density: "compact" | "standard" | "comfortable" (List View names); omit to keep today’s spacing. Live lists show a matching record count in the collection footer. Set showExport: true to show Export in the top-right of the collection; omit or false keeps Export hidden. Optional fields is an ordered string[] of real aspect field ids shown as labeled attribute chips beside each title (user/group avatars, picklist color, locale dates, number/currency). Omit fields to keep today’s fixed system pills; when fields is set, do not also expect those pills. Never invent field UUIDs; resolve ids from Owning App fields when the admin asks in plain language (for example "show Team and Priority on each row"). To share a ListControls filter, bind this list’s filterJson and quickFilterValue to the exact same paths as the control: use /query/filter and /query/statusGroup for one shared pair, or /query/filter/{blockKey} and /query/statusGroup/{blockKey} for an independent same-aspect pair. Each block-keyed pair can define its own quickFilters chips. For a view with more than one App, use /query/filter/<aspectId> and /query/statusGroup/<aspectId> for every block serving that App. Exception: independent ListControls/list pairs on the same App, including in a multi-App view, use /query/filter/{blockKey} and /query/statusGroup/{blockKey}. Shared and aspect-scoped paths remain first-class. Use filterPreset only for a no-chip seed or an independent list filter. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
|
|
170
|
+
* Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. Optional density: "compact" | "standard" | "comfortable" (List View names); omit to keep today’s spacing. Live lists show a matching record count in the collection footer. Set showExport: true to show Export in the top-right of the collection; omit or false keeps Export hidden. Optional fields is an ordered string[] of real aspect field ids shown as labeled attribute chips beside each title (user/group avatars, picklist color, locale dates, number/currency). Omit fields to keep today’s fixed system pills; when fields is set, do not also expect those pills. Set booleanDisplay to "badge" (default) or "icon" to choose how read-only checkbox/boolean fields render among configured attributes; the field name stays visible. Never invent field UUIDs; resolve ids from Owning App fields when the admin asks in plain language (for example "show Team and Priority on each row"). To share a ListControls filter, bind this list’s filterJson and quickFilterValue to the exact same paths as the control: use /query/filter and /query/statusGroup for one shared pair, or /query/filter/{blockKey} and /query/statusGroup/{blockKey} for an independent same-aspect pair. Each block-keyed pair can define its own quickFilters chips. For a view with more than one App, use /query/filter/<aspectId> and /query/statusGroup/<aspectId> for every block serving that App. Exception: independent ListControls/list pairs on the same App, including in a multi-App view, use /query/filter/{blockKey} and /query/statusGroup/{blockKey}. Shared and aspect-scoped paths remain first-class. Use filterPreset only for a no-chip seed or an independent list filter. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
|
|
171
171
|
*/
|
|
172
172
|
export type ListCollectionBlockElement = {
|
|
173
173
|
readonly type: "ListCollectionBlock";
|
|
@@ -226,6 +226,7 @@ export type ListCollectionBlockSelfFetchingProps = {
|
|
|
226
226
|
readonly loadingMessage?: (string) | (PropExpression);
|
|
227
227
|
readonly errorMessage?: (string) | (PropExpression);
|
|
228
228
|
readonly emptyMessage?: (string) | (PropExpression);
|
|
229
|
+
readonly booleanDisplay?: ("badge" | "icon") | (PropExpression);
|
|
229
230
|
readonly aspectId?: (string) | (PropExpression);
|
|
230
231
|
readonly searchValue?: (string) | (PropExpression);
|
|
231
232
|
readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
|
|
@@ -420,7 +421,7 @@ export type CardBlockProps = {
|
|
|
420
421
|
/**
|
|
421
422
|
* Customer-facing name: Data table
|
|
422
423
|
* Customer-facing description: A spreadsheet-style table with typed columns for structured rows.
|
|
423
|
-
* Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId with record columns for live records; self-fetching falls back to the runtime default aspect. Optional density: "compact" | "standard" | "comfortable" (List View names); omit to keep today’s spacing. Self-fetching columns are registered system keys (handle, title, status, priority, assignee, assignmentGroup, createdBy, createdTime, updatedAt, stage) and/or real aspect field ids - never invent field UUIDs - as strings, or { key, width?, minWidth?, maxWidth? } for admin default widths (key is the same system key or field id). Prefer semantic system keys when they exist. Optional columnHeaders maps the same column string to a display label; omit to use i18n/system headers or the field name from aspect metadata. Object columns with header/type/align select the presentational branch. Live tables show a matching record count in the collection footer; CMV users may resize columns (browser-local, not written back to Spec). Set showExport: true to show Export in the top-right of the collection; omit or false keeps Export hidden. Presentational rows may set href (absolute https:// opens a new tab, "/path" navigates inside Elementum) so the primary title cell renders as a link; same rules as ActionCardBlock. Per-cell links use a cell-hint object with href. To share a ListControls filter, bind this table’s filterJson and quickFilterValue to the exact same paths as the control: use /query/filter and /query/statusGroup for one shared pair, or /query/filter/{blockKey} and /query/statusGroup/{blockKey} for an independent same-aspect pair. Each block-keyed pair can define its own quickFilters chips. For a view with more than one App, use /query/filter/<aspectId> and /query/statusGroup/<aspectId> for every block serving that App. Shared and aspect-scoped paths remain first-class. Use filterPreset only for a no-chip seed or an independent table filter. Looks like a spreadsheet-style grid; wrap in CardBlock with padding "none". Prefer ListCollectionBlock for compact record queues.
|
|
424
|
+
* Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId with record columns for live records; self-fetching falls back to the runtime default aspect. Optional density: "compact" | "standard" | "comfortable" (List View names); omit to keep today’s spacing. Self-fetching columns are registered system keys (handle, title, status, priority, assignee, assignmentGroup, createdBy, createdTime, updatedAt, stage) and/or real aspect field ids - never invent field UUIDs - as strings, or { key, width?, minWidth?, maxWidth? } for admin default widths (key is the same system key or field id). Prefer semantic system keys when they exist. Optional columnHeaders maps the same column string to a display label; omit to use i18n/system headers or the field name from aspect metadata. Set booleanDisplay to "badge" (default) or "icon" to choose how read-only checkbox/boolean aspect fields render in live records. Object columns with header/type/align select the presentational branch. Live tables show a matching record count in the collection footer; CMV users may resize columns (browser-local, not written back to Spec). Set showExport: true to show Export in the top-right of the collection; omit or false keeps Export hidden. Presentational rows may set href (absolute https:// opens a new tab, "/path" navigates inside Elementum) so the primary title cell renders as a link; same rules as ActionCardBlock. Per-cell links use a cell-hint object with href. To share a ListControls filter, bind this table’s filterJson and quickFilterValue to the exact same paths as the control: use /query/filter and /query/statusGroup for one shared pair, or /query/filter/{blockKey} and /query/statusGroup/{blockKey} for an independent same-aspect pair. Each block-keyed pair can define its own quickFilters chips. For a view with more than one App, use /query/filter/<aspectId> and /query/statusGroup/<aspectId> for every block serving that App. Shared and aspect-scoped paths remain first-class. Use filterPreset only for a no-chip seed or an independent table filter. Looks like a spreadsheet-style grid; wrap in CardBlock with padding "none". Prefer ListCollectionBlock for compact record queues.
|
|
424
425
|
*/
|
|
425
426
|
export type DataTableBlockElement = {
|
|
426
427
|
readonly type: "DataTableBlock";
|
|
@@ -484,6 +485,7 @@ export type DataTableBlockSelfFetchingProps = {
|
|
|
484
485
|
readonly loadingMessage?: (string) | (PropExpression);
|
|
485
486
|
readonly errorMessage?: (string) | (PropExpression);
|
|
486
487
|
readonly emptyMessage?: (string) | (PropExpression);
|
|
488
|
+
readonly booleanDisplay?: ("badge" | "icon") | (PropExpression);
|
|
487
489
|
readonly aspectId?: (string) | (PropExpression);
|
|
488
490
|
readonly columns?: (ReadonlyArray<DataTableSelfFetchingColumn>) | (PropExpression);
|
|
489
491
|
readonly columnHeaders?: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by `npm run generate:ragnarok` — do not edit. Refresh with `npm run refresh:ragnarok`.
|
|
2
|
-
// Source: urn:elementum:elementum-blocks:spec:v1 version 1.
|
|
3
|
-
// Schema sha256:
|
|
2
|
+
// Source: urn:elementum:elementum-blocks:spec:v1 version 1.46.0
|
|
3
|
+
// Schema sha256: d8dfa173c9efe7aa2eedf7a5f44abeb9eb9d6a3c34e920216c39971f3e6f5a63
|
|
4
4
|
// Generator revision: 2
|
|
5
5
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Public graph barrel: KIND_MODULES + derived views for pull/build/canvas.
|
|
3
3
|
*/
|
|
4
4
|
import { type CatalogRenderArgs, type CatalogRenderResult, type EntityKindModule, type KindId, type ParentEdge, type PortableEmptiedList, type PortableLeaveOut, type PortablePrincipals, type StateAlignment, type StateScopedPlatformEntry, type TaskOutputReference, matchType } from "./types.js";
|
|
5
|
-
export type { AdoptionAddressAlias, AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StateAlignment, StateReferenceResolver, StateScopedPlatformEntry, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, TaskOutputReference, ToTfResult, UnmanagedLookup, } from "./types.js";
|
|
5
|
+
export type { AdoptionAddressAlias, AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StateAlignment, StateReferenceResolver, StateScopedPlatformEntry, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, TaskOutputReference, ToTfResult, UnmanagedLookup, SkippedOwnFileReport, } from "./types.js";
|
|
6
6
|
export type { ReferenceLookupStrategy } from "./types.js";
|
|
7
7
|
export { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE, defaultMatchResourceType, implementedResourceTypes, isResourceAdoptable, isTfLive, knownResourceTypes, matchType, singleResourceType, } from "./types.js";
|
|
8
8
|
export { KIND_MODULES } from "./modules.js";
|