bruce-models 7.1.23 → 7.1.25

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.
@@ -17422,23 +17422,35 @@
17422
17422
  /**
17423
17423
  * Valid values for the Change Set Status.
17424
17424
  */
17425
- let BruceChangeStatus;
17426
- (function (BruceChangeStatus) {
17427
- BruceChangeStatus["UNCOMMITTED"] = "Uncommitted";
17428
- BruceChangeStatus["COMMITTED"] = "Committed";
17429
- BruceChangeStatus["CANCELLED"] = "Cancelled";
17430
- })(BruceChangeStatus = ChangeSet.BruceChangeStatus || (ChangeSet.BruceChangeStatus = {}));
17425
+ let EStatus;
17426
+ (function (EStatus) {
17427
+ EStatus["UNCOMMITTED"] = "Uncommitted";
17428
+ EStatus["COMMITTED"] = "Committed";
17429
+ EStatus["CANCELLED"] = "Cancelled";
17430
+ EStatus["ERROR"] = "Error";
17431
+ })(EStatus = ChangeSet.EStatus || (ChangeSet.EStatus = {}));
17432
+ /**
17433
+ * Single-character action values stored on Entity Change and Entity Type Change records.
17434
+ */
17435
+ let EAction;
17436
+ (function (EAction) {
17437
+ EAction["CREATE"] = "C";
17438
+ EAction["UPDATE"] = "U";
17439
+ EAction["DELETE"] = "D";
17440
+ })(EAction = ChangeSet.EAction || (ChangeSet.EAction = {}));
17431
17441
  /**
17432
- * Updates existing or crates new Change Set record.
17442
+ * Updates existing or creates new Change Set record.
17443
+ * To create a new record pass a changeSet without an ID (or with ID set to 0/null).
17433
17444
  */
17434
17445
  function Update(params) {
17446
+ var _a;
17435
17447
  return __awaiter(this, void 0, void 0, function* () {
17436
17448
  let { changeSet: data, api, req: reqParams } = params;
17437
17449
  if (!api) {
17438
17450
  api = exports.ENVIRONMENT.Api().GetBruceApi();
17439
17451
  }
17440
- const url = `change` + (data.ID == null ? "" : "/" + data.ID);
17441
- return api.POST(url, data, exports.Api.PrepReqParams(reqParams));
17452
+ const id = (_a = data.ID) !== null && _a !== void 0 ? _a : 0;
17453
+ return api.POST(`change/${id}`, data, exports.Api.PrepReqParams(reqParams));
17442
17454
  });
17443
17455
  }
17444
17456
  ChangeSet.Update = Update;
@@ -17457,6 +17469,7 @@
17457
17469
  ChangeSet.Delete = Delete;
17458
17470
  /**
17459
17471
  * Gets the Change Set record by its ID.
17472
+ * The response includes PendingAction data when a pending action exists for the change set.
17460
17473
  */
17461
17474
  function Get(params) {
17462
17475
  return __awaiter(this, void 0, void 0, function* () {
@@ -17464,43 +17477,197 @@
17464
17477
  if (!api) {
17465
17478
  api = exports.ENVIRONMENT.Api().GetBruceApi();
17466
17479
  }
17467
- reqParams = exports.Api.PrepReqParams(reqParams);
17468
17480
  return yield api.GET(`change/${id}`, exports.Api.PrepReqParams(reqParams));
17469
17481
  });
17470
17482
  }
17471
17483
  ChangeSet.Get = Get;
17472
17484
  /**
17473
17485
  * Gets the list of all the Change Set records.
17486
+ * TotalCount is returned when PageIndex is 0 (the default).
17474
17487
  */
17475
17488
  function GetList(params) {
17476
17489
  return __awaiter(this, void 0, void 0, function* () {
17477
- let { api, req: reqParams } = params;
17490
+ let { api, req: reqParams, pageSize, pageIndex } = params;
17478
17491
  if (!api) {
17479
17492
  api = exports.ENVIRONMENT.Api().GetBruceApi();
17480
17493
  }
17481
- reqParams = exports.Api.PrepReqParams(reqParams);
17482
- return api.GET("changes", exports.Api.PrepReqParams(reqParams));
17494
+ const urlParams = new URLSearchParams();
17495
+ if (pageSize != null) {
17496
+ urlParams.append("PageSize", String(pageSize));
17497
+ }
17498
+ if (pageIndex != null) {
17499
+ urlParams.append("PageIndex", String(pageIndex));
17500
+ }
17501
+ const query = urlParams.toString();
17502
+ return api.GET(query ? `changes?${query}` : "changes", exports.Api.PrepReqParams(reqParams));
17483
17503
  });
17484
17504
  }
17485
17505
  ChangeSet.GetList = GetList;
17486
17506
  /**
17487
- * Gets the Change Set record by its ID.
17507
+ * Gets the content of the specified Change Set including Entity Type and Entity change records.
17508
+ * Supports pagination, mapping mode, and filtering by entity action and Entity IDs.
17509
+ */
17510
+ function GetContent(params) {
17511
+ return __awaiter(this, void 0, void 0, function* () {
17512
+ let { id, api, req: reqParams, pageSize, pageIndex, select, entityStatus, entityId } = params;
17513
+ if (!api) {
17514
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17515
+ }
17516
+ const urlParams = new URLSearchParams();
17517
+ if (pageSize != null) {
17518
+ urlParams.append("PageSize", String(pageSize));
17519
+ }
17520
+ if (pageIndex != null) {
17521
+ urlParams.append("PageIndex", String(pageIndex));
17522
+ }
17523
+ if (select != null) {
17524
+ urlParams.append("Select", select);
17525
+ }
17526
+ if (entityStatus != null) {
17527
+ const statuses = Array.isArray(entityStatus) ? entityStatus : [entityStatus];
17528
+ for (const s of statuses) {
17529
+ urlParams.append("EntityStatus", s);
17530
+ }
17531
+ }
17532
+ if (entityId != null) {
17533
+ const ids = Array.isArray(entityId) ? entityId : [entityId];
17534
+ for (const eid of ids) {
17535
+ urlParams.append("EntityID", eid);
17536
+ }
17537
+ }
17538
+ const query = urlParams.toString();
17539
+ return api.GET(query ? `change/${id}/content?${query}` : `change/${id}/content`, exports.Api.PrepReqParams(reqParams));
17540
+ });
17541
+ }
17542
+ ChangeSet.GetContent = GetContent;
17543
+ /**
17544
+ * Starts job to commit changes proposed in the change set.
17545
+ * Returns the PA ID to monitor.
17488
17546
  */
17489
- function GetChangeSetContent(params) {
17547
+ function Commit(params) {
17490
17548
  return __awaiter(this, void 0, void 0, function* () {
17491
17549
  let { id, api, req: reqParams } = params;
17492
17550
  if (!api) {
17493
17551
  api = exports.ENVIRONMENT.Api().GetBruceApi();
17494
17552
  }
17495
- reqParams = exports.Api.PrepReqParams(reqParams);
17496
- return api.GET(`change/${id}/content`, exports.Api.PrepReqParams(reqParams));
17553
+ return api.POST(`change/${id}/commit`, null, exports.Api.PrepReqParams(reqParams));
17554
+ });
17555
+ }
17556
+ ChangeSet.Commit = Commit;
17557
+ /**
17558
+ * Gets the details of one Entity Change record by its ID.
17559
+ */
17560
+ function GetEntityChange(params) {
17561
+ return __awaiter(this, void 0, void 0, function* () {
17562
+ let { id, api, req: reqParams } = params;
17563
+ if (!api) {
17564
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17565
+ }
17566
+ return api.GET(`entity/change/${id}`, exports.Api.PrepReqParams(reqParams));
17567
+ });
17568
+ }
17569
+ ChangeSet.GetEntityChange = GetEntityChange;
17570
+ /**
17571
+ * Gets the list of Entity Change records for the specified Change Set.
17572
+ * Supports pagination and filtering by action and Entity ID.
17573
+ */
17574
+ function GetEntityChangeList(params) {
17575
+ return __awaiter(this, void 0, void 0, function* () {
17576
+ let { changeId, api, req: reqParams, pageSize, pageIndex, status, entityId } = params;
17577
+ if (!api) {
17578
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17579
+ }
17580
+ const urlParams = new URLSearchParams();
17581
+ if (pageSize != null) {
17582
+ urlParams.append("PageSize", String(pageSize));
17583
+ }
17584
+ if (pageIndex != null) {
17585
+ urlParams.append("PageIndex", String(pageIndex));
17586
+ }
17587
+ if (status != null) {
17588
+ const statuses = Array.isArray(status) ? status : [status];
17589
+ for (const s of statuses) {
17590
+ urlParams.append("Status", s);
17591
+ }
17592
+ }
17593
+ if (entityId != null) {
17594
+ const ids = Array.isArray(entityId) ? entityId : [entityId];
17595
+ for (const eid of ids) {
17596
+ urlParams.append("EntityID", eid);
17597
+ }
17598
+ }
17599
+ const query = urlParams.toString();
17600
+ return api.GET(query
17601
+ ? `entity/changes/by_change_id/${changeId}?${query}`
17602
+ : `entity/changes/by_change_id/${changeId}`, exports.Api.PrepReqParams(reqParams));
17603
+ });
17604
+ }
17605
+ ChangeSet.GetEntityChangeList = GetEntityChangeList;
17606
+ /**
17607
+ * Gets a mapping of Entity.ID to Action ("C", "U", "D") for all Entity Change records.
17608
+ * Equivalent to GetEntityChangeList with Select=MAPPING.
17609
+ */
17610
+ function GetEntityChangeListMapping(params) {
17611
+ return __awaiter(this, void 0, void 0, function* () {
17612
+ let { changeId, api, req: reqParams, pageSize, pageIndex, status, entityId } = params;
17613
+ if (!api) {
17614
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17615
+ }
17616
+ const urlParams = new URLSearchParams();
17617
+ urlParams.append("Select", "MAPPING");
17618
+ if (pageSize != null) {
17619
+ urlParams.append("PageSize", String(pageSize));
17620
+ }
17621
+ if (pageIndex != null) {
17622
+ urlParams.append("PageIndex", String(pageIndex));
17623
+ }
17624
+ if (status != null) {
17625
+ const statuses = Array.isArray(status) ? status : [status];
17626
+ for (const s of statuses) {
17627
+ urlParams.append("Status", s);
17628
+ }
17629
+ }
17630
+ if (entityId != null) {
17631
+ const ids = Array.isArray(entityId) ? entityId : [entityId];
17632
+ for (const eid of ids) {
17633
+ urlParams.append("EntityID", eid);
17634
+ }
17635
+ }
17636
+ return api.GET(`entity/changes/by_change_id/${changeId}?${urlParams.toString()}`, exports.Api.PrepReqParams(reqParams));
17637
+ });
17638
+ }
17639
+ ChangeSet.GetEntityChangeListMapping = GetEntityChangeListMapping;
17640
+ /**
17641
+ * Updates existing or creates new Entity Change record within the specified Change Set.
17642
+ * To create a new record, omit entityChange.ID or set it to 0.
17643
+ */
17644
+ function UpdateEntityChange(params) {
17645
+ return __awaiter(this, void 0, void 0, function* () {
17646
+ let { changeId, entityChange: data, api, req: reqParams } = params;
17647
+ if (!api) {
17648
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17649
+ }
17650
+ return yield api.POST(`entity/change/by_change_id/${changeId || 0}/${data.ID || 0}`, data, exports.Api.PrepReqParams(reqParams));
17651
+ });
17652
+ }
17653
+ ChangeSet.UpdateEntityChange = UpdateEntityChange;
17654
+ /**
17655
+ * Deletes the specified Entity Change record.
17656
+ */
17657
+ function DeleteEntityChange(params) {
17658
+ return __awaiter(this, void 0, void 0, function* () {
17659
+ let { id, api, req: reqParams } = params;
17660
+ if (!api) {
17661
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17662
+ }
17663
+ yield api.DELETE(`entity/change/${id}`, exports.Api.PrepReqParams(reqParams));
17497
17664
  });
17498
17665
  }
17499
- ChangeSet.GetChangeSetContent = GetChangeSetContent;
17666
+ ChangeSet.DeleteEntityChange = DeleteEntityChange;
17500
17667
  })(exports.ChangeSet || (exports.ChangeSet = {}));
17501
17668
 
17502
17669
  // This is updated with the package.json version on build.
17503
- const VERSION = "7.1.23";
17670
+ const VERSION = "7.1.25";
17504
17671
 
17505
17672
  exports.VERSION = VERSION;
17506
17673
  exports.AbstractApi = AbstractApi;