@uipath/maestro-builder-sdk 6.6.1 → 6.7.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.
@@ -891,71 +891,118 @@ export function dynamicExtract(inputs) {
891
891
  return builtinActionSpec({ kind: 'dynamicExtract', inputs });
892
892
  }
893
893
  /**
894
- * Read ONE entity record from Data Fabric (`core.datafabric.read`). The record
894
+ * Query entity records from Data Fabric (`core.datafabric.read`). The result
895
895
  * publishes to the step's `output`; downstream references re-fetch fresh data
896
896
  * at activation time (the engine re-runs the query rather than caching).
897
897
  *
898
898
  * @remarks
899
- * **Prefer the connector for Data Fabric work during the transition.**
900
- * `core.datafabric.*` has exactly two verbs — this one and
901
- * {@link dataFabricUpdate} — and neither declares an output schema. Create,
902
- * delete, get-by-id, a multi-record query with a row limit, file record fields
903
- * and entity events are NOT in this family: they are operations on the SAME
904
- * product reached through its Integration Service connector,
899
+ * This node is **read-one AND query-many**, on its 1.4 definition: `resultMode:
900
+ * 'multiple'` publishes the matching records under `output.results`, and the
901
+ * platform renames the node "Query entity records" to say so. The SDK still
902
+ * pins 1.0 — read-one — as the no-`{ version }` default, so passing
903
+ * `resultMode` is what selects 1.4; see {@link DataFabricReadInputs.resultMode}.
904
+ *
905
+ * The native family covers all four CRUD verbs: this one,
906
+ * {@link dataFabricCreate}, {@link dataFabricUpdate} and
907
+ * {@link dataFabricDelete}. What it does NOT cover is get-by-id, a query row
908
+ * limit, file record fields, and entity events — those are operations on the
909
+ * SAME product reached through its Integration Service connector,
905
910
  * `uipath-uipath-dataservice` (the tenant displays it as **UiPath Data
906
- * Fabric**), which covers every verb including the two here.
907
- *
908
- * Taking this node for the one verb that has a native form leaves the rest of
909
- * the same entity on the connector — two connection bindings and two payload
910
- * shapes in one flow. So route entity work through the connector unless the
911
- * scenario names these nodes; native forms for the remaining verbs are the
912
- * direction of travel, and this guidance changes when they land. `check` does
913
- * not reject a native node — this is a routing default, not a rule:
911
+ * Fabric**). So a flow that needs one of those still straddles two surfaces,
912
+ * and the connector remains the one surface that covers everything:
914
913
  *
915
914
  * ```ts
916
- * .step('create', connector('uipath-uipath-dataservice', 'create-entity-record',
917
- * { entityName: 'Contracts', contractTitle: 'Q3 renewal' }, { connection: 'df' }))
915
+ * .step('byId', connector('uipath-uipath-dataservice', 'get-entity-record-by-id',
916
+ * { entityName: 'Contracts', recordId: input('id') }, { connection: 'df' }))
918
917
  * ```
919
918
  *
920
- * That operation's body fields come from the entity, so the library cannot
921
- * carry them: run `npx flow-sdk registry prepare uipath-uipath-dataservice
922
- * create-entity-record -f entityName=<Entity>` first (`uip maestro registry
923
- * prepare …` is the same command when you are driving through the UiPath CLI). The routing table is in
924
- * the `data-fabric.md` reference and the parent-field loop in
925
- * `connector-params.md` — cited by name rather than linked, because this
919
+ * A connector operation's body fields come from the entity, so the library
920
+ * cannot carry them: run `npx flow-sdk registry prepare uipath-uipath-dataservice
921
+ * get-entity-record-by-id -f entityName=<Entity>` first (`uip maestro registry
922
+ * prepare …` is the same command when you are driving through the UiPath CLI).
923
+ * The routing table is in the `data-fabric.md` reference and the parent-field
924
+ * loop in `connector-params.md` — cited by name rather than linked, because this
926
925
  * comment renders both into the flat corpus, where those files sit alongside
927
926
  * it, and onto the site, where each symbol is its own page and a relative
928
927
  * `./data-fabric` resolves to nothing.
929
928
  *
930
- * @param inputs - The entity, optional filter rows, and folder scope.
929
+ * @param inputs - The entity, optional filter rows, result mode, and folder scope.
931
930
  * @returns An action spec to pass to `.step(name, …)`.
932
931
  */
933
932
  export function dataFabricRead(inputs) {
934
933
  return builtinActionSpec({ kind: 'dataFabricRead', inputs });
935
934
  }
935
+ /**
936
+ * Create an entity record in Data Fabric (`core.datafabric.create`). The new
937
+ * record publishes to the step's `output`, so a following
938
+ * {@link dataFabricUpdate} or {@link dataFabricDelete} can read its id.
939
+ *
940
+ * @remarks
941
+ * `values` must name at least one column — the node's schema rejects an empty
942
+ * field list rather than inserting a blank row, and `check` says so before the
943
+ * platform does. Field names are the ENTITY's, so copy them from the scenario
944
+ * or the tenant; nothing offline can tell a real column from a typo.
945
+ *
946
+ * See {@link dataFabricRead} for what the native family still does not cover
947
+ * and which connector operation covers it.
948
+ *
949
+ * @param inputs - The entity, the columns the record starts with, and folder scope.
950
+ * @returns An action spec to pass to `.step(name, …)`.
951
+ */
952
+ export function dataFabricCreate(inputs) {
953
+ return builtinActionSpec({ kind: 'dataFabricCreate', inputs });
954
+ }
936
955
  /**
937
956
  * Update an entity record in Data Fabric (`core.datafabric.update`). Target the
938
957
  * record by id or through an earlier {@link dataFabricRead} step; downstream
939
958
  * reads of this step observe the record AFTER the write.
940
959
  *
941
960
  * @remarks
942
- * The second and last verb of the native family — see {@link dataFabricRead}
943
- * for what the family does NOT cover, which connector operation covers it
944
- * instead, and why entity work routes through the connector during the
945
- * transition. For an update whose flow also creates, gets or deletes on the
946
- * same entity, use `connector(…, 'update-entity-record', …)` so the flow keeps
947
- * one surface.
961
+ * `set` must write at least one column: an empty `set` is a no-op the platform
962
+ * reports as success, so `check` rejects it.
963
+ *
964
+ * See {@link dataFabricRead} for what the native family still does not cover
965
+ * and which connector operation covers it.
948
966
  *
949
967
  * @param inputs - The entity, the record selector, and the columns to write.
950
968
  * @returns An action spec to pass to `.step(name, …)`.
951
969
  */
952
970
  export function dataFabricUpdate(inputs) {
953
- const byId = inputs.record?.byId !== undefined;
954
- const fromRead = typeof inputs.record?.fromRead === 'string';
971
+ assertOneRecordRef(inputs.record, 'dataFabricUpdate');
972
+ return builtinActionSpec({ kind: 'dataFabricUpdate', inputs });
973
+ }
974
+ /**
975
+ * Delete an entity record from Data Fabric (`core.datafabric.delete`). Target
976
+ * the record by id or through an earlier {@link dataFabricRead} step, exactly
977
+ * as {@link dataFabricUpdate} does.
978
+ *
979
+ * @remarks
980
+ * A delete **publishes nothing** — its definition declares no output — so
981
+ * `$vars.<step>.output` is undefined at run time and `check` rejects a read of
982
+ * it. Take what you need off the read step that found the record, before the
983
+ * delete.
984
+ *
985
+ * See {@link dataFabricRead} for what the native family still does not cover
986
+ * and which connector operation covers it.
987
+ *
988
+ * @param inputs - The entity, the record selector, and folder scope.
989
+ * @returns An action spec to pass to `.step(name, …)`.
990
+ */
991
+ export function dataFabricDelete(inputs) {
992
+ assertOneRecordRef(inputs.record, 'dataFabricDelete');
993
+ return builtinActionSpec({ kind: 'dataFabricDelete', inputs });
994
+ }
995
+ /**
996
+ * `record` names exactly ONE of `{ byId }` / `{ fromRead }`. Both forms are
997
+ * optional properties on the same object type, so TypeScript alone cannot
998
+ * refuse `{}` — and an empty selector compiles into a write with no target.
999
+ */
1000
+ function assertOneRecordRef(record, factory) {
1001
+ const byId = record?.byId !== undefined;
1002
+ const fromRead = typeof record?.fromRead === 'string';
955
1003
  if (byId === fromRead) {
956
- throw new Error("dataFabricUpdate() targets exactly ONE of record: { byId } or record: { fromRead: '<step>' }.");
1004
+ throw new Error(`${factory}() targets exactly ONE of record: { byId } or record: { fromRead: '<step>' }.`);
957
1005
  }
958
- return builtinActionSpec({ kind: 'dataFabricUpdate', inputs });
959
1006
  }
960
1007
  /**
961
1008
  * Declare an Orchestrator QUEUE ITEM step.