bruce-models 7.1.115 → 7.1.116

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 CHANGED
@@ -2,6 +2,50 @@
2
2
 
3
3
  This is a library which defines data-models for the Nextspace API and provides functions for communicating with the endpoints.
4
4
 
5
+ ### Workflow Item priority and parent
6
+
7
+ `WorkflowItem.IItem` and `WorkflowItem.ICreateItem` represent `Priority` as an optional
8
+ `number | null` (signed int32) and `"Parent.Item.ID"` as an optional `number | null`
9
+ (the API's int64 parent reference). Use parent IDs that JavaScript can represent
10
+ as safe integers. Priority accepts zero and negative values; the API defines no
11
+ fixed priority scale.
12
+
13
+ `Create` and `Update` accept both fields. On update, omit a field to preserve it or
14
+ send `null` to clear it. The API checks that the parent exists and prevents circular
15
+ parent chains. The focused helpers update existing items through
16
+ `POST workflow/item/{id}` and invalidate Workflow Item caches after success.
17
+
18
+ ```ts
19
+ import { WorkflowItem } from "bruce-models";
20
+
21
+ // Update one attribute while preserving other item fields.
22
+ await WorkflowItem.UpdatePriority({ api, workflowItemId: 9, priority: 3 });
23
+ await WorkflowItem.UpdateParent({ api, workflowItemId: 9, parentItemId: 5 });
24
+
25
+ // Clear priority or detach from the parent.
26
+ await WorkflowItem.UpdatePriority({ api, workflowItemId: 9, priority: null });
27
+ await WorkflowItem.UpdateParent({ api, workflowItemId: 9, parentItemId: null });
28
+
29
+ // Change both attributes in one request.
30
+ await WorkflowItem.Update({
31
+ api,
32
+ workflowItem: { ID: 9, Priority: 0, "Parent.Item.ID": 5 }
33
+ });
34
+
35
+ // List direct children, filtered and sorted by priority.
36
+ const { items } = await WorkflowItem.GetList({
37
+ api,
38
+ parentItemId: 5,
39
+ priority: [-2, 0, 3],
40
+ orderBy: WorkflowItem.EOrderBy.PRIORITY,
41
+ sortOrder: "DESC"
42
+ });
43
+ ```
44
+
45
+ `GetList` uses `GET workflow/itemsquery` with `Priority` and `ParentItemID` query
46
+ parameters. Both filters accept a single value or an array. Use
47
+ `WorkflowItem.EOrderBy.PARENT_ITEM_ID` to sort by parent instead.
48
+
5
49
  <br>
6
50
 
7
51
  ### Local build
@@ -28,4 +72,4 @@ This is a library which defines data-models for the Nextspace API and provides f
28
72
 
29
73
  - Bitbucket will run a build and test step.
30
74
 
31
- - Manually click `NPM Release` in Bitbucket Pipelines.
75
+ - Manually click `NPM Release` in Bitbucket Pipelines.
@@ -24465,6 +24465,26 @@ var UrlUtils;
24465
24465
 
24466
24466
  var WorkflowItem;
24467
24467
  (function (WorkflowItem) {
24468
+ /** Sort fields supported by workflow/itemsquery. */
24469
+ let EOrderBy;
24470
+ (function (EOrderBy) {
24471
+ EOrderBy["ID"] = "ID";
24472
+ EOrderBy["ENTITY_ID"] = "EntityID";
24473
+ EOrderBy["CREATED"] = "Created";
24474
+ EOrderBy["UPDATED"] = "Updated";
24475
+ EOrderBy["DUE_DATE"] = "DueDate";
24476
+ EOrderBy["CREATED_BY_USER_ID"] = "CreatedByUserID";
24477
+ EOrderBy["ITEM_TYPE_ID"] = "ItemTypeID";
24478
+ EOrderBy["ITEM_STATUS_ID"] = "ItemStatusID";
24479
+ EOrderBy["QUEUE_ID"] = "QueueID";
24480
+ EOrderBy["WORKFLOW_SCHEDULE_ID"] = "WorkflowScheduleID";
24481
+ EOrderBy["PRIORITY"] = "Priority";
24482
+ EOrderBy["PARENT_ITEM_ID"] = "ParentItemID";
24483
+ EOrderBy["DESCRIPTION"] = "Description";
24484
+ EOrderBy["UI_SLIDE_ID"] = "UISlideID";
24485
+ EOrderBy["THUMBNAIL_CLIENT_FILE_ID"] = "ThumbnailClientFileID";
24486
+ EOrderBy["RANDOM"] = "RANDOM";
24487
+ })(EOrderBy = WorkflowItem.EOrderBy || (WorkflowItem.EOrderBy = {}));
24468
24488
  function Get(params) {
24469
24489
  return __awaiter(this, void 0, void 0, function* () {
24470
24490
  let { api, workflowItemId, req } = params;
@@ -24555,6 +24575,7 @@ var WorkflowItem;
24555
24575
  });
24556
24576
  }
24557
24577
  WorkflowItem.GetStatistics = GetStatistics;
24578
+ /** Creates an item, including its optional Priority and Parent.Item.ID. */
24558
24579
  function Create(params) {
24559
24580
  var _a, _b, _c, _d, _e;
24560
24581
  return __awaiter(this, void 0, void 0, function* () {
@@ -24581,6 +24602,10 @@ var WorkflowItem;
24581
24602
  });
24582
24603
  }
24583
24604
  WorkflowItem.Create = Create;
24605
+ /**
24606
+ * Saves item changes. Omitted fields are preserved; null clears Priority or Parent.Item.ID.
24607
+ * The API validates that the parent exists and that its parent chain is not circular.
24608
+ */
24584
24609
  function Update(params) {
24585
24610
  return __awaiter(this, void 0, void 0, function* () {
24586
24611
  let { api, workflowItem, req } = params;
@@ -24600,6 +24625,45 @@ var WorkflowItem;
24600
24625
  });
24601
24626
  }
24602
24627
  WorkflowItem.Update = Update;
24628
+ /** Updates only the priority of an existing item. Pass null to clear it. */
24629
+ function UpdatePriority(params) {
24630
+ return __awaiter(this, void 0, void 0, function* () {
24631
+ const { api, workflowItemId, priority, req } = params;
24632
+ if (isInvalidId(workflowItemId) || !Number.isSafeInteger(Number(workflowItemId))) {
24633
+ throw ("Workflow Item ID is required.");
24634
+ }
24635
+ if (priority !== null && (!Number.isInteger(priority) || priority < -2147483648 || priority > 2147483647)) {
24636
+ throw ("Workflow Item priority must be a signed 32-bit integer or null.");
24637
+ }
24638
+ return Update({
24639
+ api,
24640
+ workflowItem: { ID: Number(workflowItemId), Priority: priority },
24641
+ req
24642
+ });
24643
+ });
24644
+ }
24645
+ WorkflowItem.UpdatePriority = UpdatePriority;
24646
+ /**
24647
+ * Updates only the parent of an existing item. Pass null to detach it.
24648
+ * The API validates parent existence and rejects circular parent chains.
24649
+ */
24650
+ function UpdateParent(params) {
24651
+ return __awaiter(this, void 0, void 0, function* () {
24652
+ const { api, workflowItemId, parentItemId, req } = params;
24653
+ if (isInvalidId(workflowItemId) || !Number.isSafeInteger(Number(workflowItemId))) {
24654
+ throw ("Workflow Item ID is required.");
24655
+ }
24656
+ if (parentItemId !== null && (!Number.isSafeInteger(parentItemId) || parentItemId <= 0)) {
24657
+ throw ("Parent Workflow Item ID must be a positive safe integer or null.");
24658
+ }
24659
+ return Update({
24660
+ api,
24661
+ workflowItem: { ID: Number(workflowItemId), "Parent.Item.ID": parentItemId },
24662
+ req
24663
+ });
24664
+ });
24665
+ }
24666
+ WorkflowItem.UpdateParent = UpdateParent;
24603
24667
  function Delete(params) {
24604
24668
  return __awaiter(this, void 0, void 0, function* () {
24605
24669
  let { api, workflowItemId, req } = params;
@@ -25235,7 +25299,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
25235
25299
  }
25236
25300
 
25237
25301
  // This is updated with the package.json version on build.
25238
- const VERSION = "7.1.115";
25302
+ const VERSION = "7.1.116";
25239
25303
 
25240
25304
  export { VERSION, Account, AccountAudit, AccountConcept, AccountFeatures, AccountInvite, AccountLimits, AccountTemplate, AccountType, AnnDocument, AbstractApi, Api, ApiGetters, BruceApi, GlobalApi, GuardianApi, Assembly, Calculator, ChangeSet, ClientFile, ClientFileValueMap, Bounds, BruceEvent, BruceVariable, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, RequestLane, GeoJson, Geometry, LRUCache, UTC, CustomForm, DashboardView, DataFeed, DataLab, DataLabGroup, DataSource, DataTransform, Comment, Entity, EntityAttachment, EntityAttachmentType, EntityAttribute, EntityComment, EntityCoords, EntityHistoricData, EntityLink, EntityLod, EntityLodCategory, EntityRelation, EntityRelationType, EntitySource, EntityTableView, EntityTag, EntityType, EntityTypeRelation, EntityTypeSource, EntityTypeTrigger, Ontology, OntologyDocument, ENVIRONMENT, ExportBrz, ExportCsv, ExportNsx, ExportUsd, Hexbin, ImportAssembly, ImportCad, ImportCsv, ImportGeoJson, ImportJson, ImportKml, ImportLcc, ImportTif, ImportedFile, Uploader, Markup, UIMarkup, NAVIGATOR_CHAT_EVENT_ENTITY_HIGHLIGHT_APPLIED, NAVIGATOR_CHAT_EVENT_SCENE_CONTEXT_PREFETCHED, NavigatorChatClient, NavigatorMcpWebSocketClient, Plugin, PluginAiTool, ProgramKey, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewBookmarkGroup, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewLegacyTile, ProjectViewTile, ZoomControl, Scenario, HostingLocation, MessageBroker, PendingAction, RecordChangeFeed, Style, Tileset, Tracking, Permission, Session, User, UserGroup, UserMfaMethod, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, WorkflowItem, WorkflowSchedule, WorkflowType, WorkflowItemType };
25241
25305
  //# sourceMappingURL=bruce-models.es5.js.map