bruce-models 7.1.115 → 7.1.117

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.
@@ -17443,6 +17443,7 @@ var EntityTypeTrigger;
17443
17443
  (function (EType) {
17444
17444
  EType["DataLabQuery"] = "DataLabQuery";
17445
17445
  EType["WorkflowTicket"] = "WorkflowTicket";
17446
+ EType["CreateEntity"] = "CreateEntity";
17446
17447
  })(EType = EntityTypeTrigger.EType || (EntityTypeTrigger.EType = {}));
17447
17448
  /**
17448
17449
  * Builds the Settings payload for a WorkflowTicket trigger.
@@ -24465,6 +24466,26 @@ var UrlUtils;
24465
24466
 
24466
24467
  var WorkflowItem;
24467
24468
  (function (WorkflowItem) {
24469
+ /** Sort fields supported by workflow/itemsquery. */
24470
+ let EOrderBy;
24471
+ (function (EOrderBy) {
24472
+ EOrderBy["ID"] = "ID";
24473
+ EOrderBy["ENTITY_ID"] = "EntityID";
24474
+ EOrderBy["CREATED"] = "Created";
24475
+ EOrderBy["UPDATED"] = "Updated";
24476
+ EOrderBy["DUE_DATE"] = "DueDate";
24477
+ EOrderBy["CREATED_BY_USER_ID"] = "CreatedByUserID";
24478
+ EOrderBy["ITEM_TYPE_ID"] = "ItemTypeID";
24479
+ EOrderBy["ITEM_STATUS_ID"] = "ItemStatusID";
24480
+ EOrderBy["QUEUE_ID"] = "QueueID";
24481
+ EOrderBy["WORKFLOW_SCHEDULE_ID"] = "WorkflowScheduleID";
24482
+ EOrderBy["PRIORITY"] = "Priority";
24483
+ EOrderBy["PARENT_ITEM_ID"] = "ParentItemID";
24484
+ EOrderBy["DESCRIPTION"] = "Description";
24485
+ EOrderBy["UI_SLIDE_ID"] = "UISlideID";
24486
+ EOrderBy["THUMBNAIL_CLIENT_FILE_ID"] = "ThumbnailClientFileID";
24487
+ EOrderBy["RANDOM"] = "RANDOM";
24488
+ })(EOrderBy = WorkflowItem.EOrderBy || (WorkflowItem.EOrderBy = {}));
24468
24489
  function Get(params) {
24469
24490
  return __awaiter(this, void 0, void 0, function* () {
24470
24491
  let { api, workflowItemId, req } = params;
@@ -24555,6 +24576,7 @@ var WorkflowItem;
24555
24576
  });
24556
24577
  }
24557
24578
  WorkflowItem.GetStatistics = GetStatistics;
24579
+ /** Creates an item, including its optional Priority and Parent.Item.ID. */
24558
24580
  function Create(params) {
24559
24581
  var _a, _b, _c, _d, _e;
24560
24582
  return __awaiter(this, void 0, void 0, function* () {
@@ -24581,6 +24603,10 @@ var WorkflowItem;
24581
24603
  });
24582
24604
  }
24583
24605
  WorkflowItem.Create = Create;
24606
+ /**
24607
+ * Saves item changes. Omitted fields are preserved; null clears Priority or Parent.Item.ID.
24608
+ * The API validates that the parent exists and that its parent chain is not circular.
24609
+ */
24584
24610
  function Update(params) {
24585
24611
  return __awaiter(this, void 0, void 0, function* () {
24586
24612
  let { api, workflowItem, req } = params;
@@ -24600,6 +24626,45 @@ var WorkflowItem;
24600
24626
  });
24601
24627
  }
24602
24628
  WorkflowItem.Update = Update;
24629
+ /** Updates only the priority of an existing item. Pass null to clear it. */
24630
+ function UpdatePriority(params) {
24631
+ return __awaiter(this, void 0, void 0, function* () {
24632
+ const { api, workflowItemId, priority, req } = params;
24633
+ if (isInvalidId(workflowItemId) || !Number.isSafeInteger(Number(workflowItemId))) {
24634
+ throw ("Workflow Item ID is required.");
24635
+ }
24636
+ if (priority !== null && (!Number.isInteger(priority) || priority < -2147483648 || priority > 2147483647)) {
24637
+ throw ("Workflow Item priority must be a signed 32-bit integer or null.");
24638
+ }
24639
+ return Update({
24640
+ api,
24641
+ workflowItem: { ID: Number(workflowItemId), Priority: priority },
24642
+ req
24643
+ });
24644
+ });
24645
+ }
24646
+ WorkflowItem.UpdatePriority = UpdatePriority;
24647
+ /**
24648
+ * Updates only the parent of an existing item. Pass null to detach it.
24649
+ * The API validates parent existence and rejects circular parent chains.
24650
+ */
24651
+ function UpdateParent(params) {
24652
+ return __awaiter(this, void 0, void 0, function* () {
24653
+ const { api, workflowItemId, parentItemId, req } = params;
24654
+ if (isInvalidId(workflowItemId) || !Number.isSafeInteger(Number(workflowItemId))) {
24655
+ throw ("Workflow Item ID is required.");
24656
+ }
24657
+ if (parentItemId !== null && (!Number.isSafeInteger(parentItemId) || parentItemId <= 0)) {
24658
+ throw ("Parent Workflow Item ID must be a positive safe integer or null.");
24659
+ }
24660
+ return Update({
24661
+ api,
24662
+ workflowItem: { ID: Number(workflowItemId), "Parent.Item.ID": parentItemId },
24663
+ req
24664
+ });
24665
+ });
24666
+ }
24667
+ WorkflowItem.UpdateParent = UpdateParent;
24603
24668
  function Delete(params) {
24604
24669
  return __awaiter(this, void 0, void 0, function* () {
24605
24670
  let { api, workflowItemId, req } = params;
@@ -25235,7 +25300,7 @@ function getFirstWrappedArray(data, wrapperKeys) {
25235
25300
  }
25236
25301
 
25237
25302
  // This is updated with the package.json version on build.
25238
- const VERSION = "7.1.115";
25303
+ const VERSION = "7.1.117";
25239
25304
 
25240
25305
  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
25306
  //# sourceMappingURL=bruce-models.es5.js.map