bruce-models 7.1.108 → 7.1.110

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.
@@ -45,6 +45,7 @@
45
45
  ECacheKey["Entity"] = "entity";
46
46
  ECacheKey["EntityType"] = "entitytype";
47
47
  ECacheKey["EntityTypeRelation"] = "entitytyperelation";
48
+ ECacheKey["EntityTypeSource"] = "entitytypesource";
48
49
  ECacheKey["Ontology"] = "ontology";
49
50
  ECacheKey["EntityTypeTrigger"] = "entitytypetrigger";
50
51
  ECacheKey["DataFeed"] = "datafeed";
@@ -17001,6 +17002,111 @@
17001
17002
  }
17002
17003
  })(exports.EntityTypeRelation || (exports.EntityTypeRelation = {}));
17003
17004
 
17005
+ (function (EntityTypeSource) {
17006
+ let EKind;
17007
+ (function (EKind) {
17008
+ // Deprecated. Behaves as Entity.
17009
+ EKind["Unset"] = "UNSET";
17010
+ // Creates or updates Entities matching the key in the Data Mapping.
17011
+ EKind["Entity"] = "ENTITY";
17012
+ // Overlays attributes onto Entities that already exist.
17013
+ EKind["Attribute"] = "ATTRIBUTE";
17014
+ // On demand only. The Entity's Outline carries a URL to fetch its rows.
17015
+ EKind["Reference"] = "REFERENCE";
17016
+ })(EKind = EntityTypeSource.EKind || (EntityTypeSource.EKind = {}));
17017
+ /**
17018
+ * Gets a single Entity Type Source record, including its Data Mapping.
17019
+ */
17020
+ function Get(params) {
17021
+ return __awaiter(this, void 0, void 0, function* () {
17022
+ let { api, entityTypeId, entityTypeSourceId, req } = params;
17023
+ if (!entityTypeId) {
17024
+ throw ("Entity Type ID is required.");
17025
+ }
17026
+ if (!entityTypeSourceId) {
17027
+ throw ("Entity Type Source ID is required.");
17028
+ }
17029
+ if (!api) {
17030
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17031
+ }
17032
+ const key = GetCacheKey(entityTypeId, entityTypeSourceId);
17033
+ const cache = api.GetCacheItem(key, req);
17034
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
17035
+ return cache.data;
17036
+ }
17037
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
17038
+ try {
17039
+ const data = yield api.GET(`entityType/${entityTypeId}/source/${entityTypeSourceId}`, exports.Api.PrepReqParams(req));
17040
+ res({
17041
+ source: data
17042
+ });
17043
+ }
17044
+ catch (e) {
17045
+ rej(e);
17046
+ }
17047
+ }));
17048
+ api.SetCacheItem({
17049
+ key,
17050
+ value: prom,
17051
+ req
17052
+ });
17053
+ return prom;
17054
+ });
17055
+ }
17056
+ EntityTypeSource.Get = Get;
17057
+ /**
17058
+ * Gets the Entity Type Source records feeding the specified Entity Type.
17059
+ */
17060
+ function GetList(params) {
17061
+ return __awaiter(this, void 0, void 0, function* () {
17062
+ let { api, entityTypeId, req } = params;
17063
+ if (!entityTypeId) {
17064
+ throw ("Entity Type ID is required.");
17065
+ }
17066
+ if (!api) {
17067
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
17068
+ }
17069
+ const key = GetListCacheKey(entityTypeId);
17070
+ const cache = api.GetCacheItem(key, req);
17071
+ if (cache === null || cache === void 0 ? void 0 : cache.found) {
17072
+ return cache.data;
17073
+ }
17074
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
17075
+ try {
17076
+ const data = yield api.GET(`entityType/${entityTypeId}/sources`, exports.Api.PrepReqParams(req));
17077
+ res({
17078
+ sources: Array.isArray(data === null || data === void 0 ? void 0 : data.Items) ? data.Items : []
17079
+ });
17080
+ }
17081
+ catch (e) {
17082
+ rej(e);
17083
+ }
17084
+ }));
17085
+ api.SetCacheItem({
17086
+ key,
17087
+ value: prom,
17088
+ req
17089
+ });
17090
+ return prom;
17091
+ });
17092
+ }
17093
+ EntityTypeSource.GetList = GetList;
17094
+ /**
17095
+ * Returns cache identifier for an Entity Type Source record.
17096
+ */
17097
+ function GetCacheKey(entityTypeId, entityTypeSourceId) {
17098
+ return exports.Api.ECacheKey.EntityTypeSource + exports.Api.ECacheKey.Id + entityTypeId + exports.Api.ECacheKey.Id + entityTypeSourceId;
17099
+ }
17100
+ EntityTypeSource.GetCacheKey = GetCacheKey;
17101
+ /**
17102
+ * Returns cache identifier for the list of Entity Type Source records for an Entity Type.
17103
+ */
17104
+ function GetListCacheKey(entityTypeId) {
17105
+ return exports.Api.ECacheKey.EntityTypeSource + exports.Api.ECacheKey.Id + entityTypeId;
17106
+ }
17107
+ EntityTypeSource.GetListCacheKey = GetListCacheKey;
17108
+ })(exports.EntityTypeSource || (exports.EntityTypeSource = {}));
17109
+
17004
17110
  (function (EntityTypeTrigger) {
17005
17111
  let EType;
17006
17112
  (function (EType) {
@@ -18366,6 +18472,17 @@
18366
18472
  EAnchorDivSide["BottomRight"] = "BottomRight";
18367
18473
  EAnchorDivSide["TopRight"] = "TopRight";
18368
18474
  })(EAnchorDivSide = Div.EAnchorDivSide || (Div.EAnchorDivSide = {}));
18475
+ /**
18476
+ * Whether a div's height is authored or taken from what is in it.
18477
+ */
18478
+ let ECellSizing;
18479
+ (function (ECellSizing) {
18480
+ // The stored height is the height. Content that does not fit is clipped.
18481
+ ECellSizing["Fixed"] = "FIXED";
18482
+ // The content decides the height, with the stored height as a floor.
18483
+ // The stored height is kept up to date from what was actually laid out.
18484
+ ECellSizing["Auto"] = "AUTO";
18485
+ })(ECellSizing = Div.ECellSizing || (Div.ECellSizing = {}));
18369
18486
  // Describes expected content of a row cell.
18370
18487
  let EItemType;
18371
18488
  (function (EItemType) {
@@ -24008,14 +24125,15 @@
24008
24125
  if (!api) {
24009
24126
  api = exports.ENVIRONMENT.Api().GetBruceApi();
24010
24127
  }
24011
- const key = GetListCacheKey();
24128
+ const url = BuildListUrl(params);
24129
+ const key = GetListCacheKey(params);
24012
24130
  const cache = api.GetCacheItem(key, req);
24013
24131
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
24014
24132
  return cache.data;
24015
24133
  }
24016
24134
  const request = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
24017
24135
  try {
24018
- const data = yield api.GET("workflow/schedules", exports.Api.PrepReqParams(req));
24136
+ const data = yield api.GET(url, exports.Api.PrepReqParams(req));
24019
24137
  res({ workflowSchedules: ParseListResponse(data) });
24020
24138
  }
24021
24139
  catch (e) {
@@ -24039,7 +24157,7 @@
24039
24157
  const id = workflowSchedule.ID && workflowSchedule.ID > 0 ? workflowSchedule.ID : 0;
24040
24158
  const data = yield api.POST(`workflow/schedule/${id}`, workflowSchedule, exports.Api.PrepReqParams(req));
24041
24159
  const parsed = ParseResponse(data);
24042
- api.Cache.Remove(GetListCacheKey());
24160
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowSchedule);
24043
24161
  if (id > 0) {
24044
24162
  api.Cache.Remove(GetCacheKey(id));
24045
24163
  }
@@ -24061,12 +24179,20 @@
24061
24179
  api = exports.ENVIRONMENT.Api().GetBruceApi();
24062
24180
  }
24063
24181
  yield api.DELETE(`workflow/schedule/${workflowScheduleId}`, exports.Api.PrepReqParams(req));
24064
- api.Cache.Remove(GetCacheKey(workflowScheduleId));
24065
- api.Cache.Remove(GetListCacheKey());
24182
+ api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowSchedule);
24066
24183
  api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.WorkflowItem);
24067
24184
  });
24068
24185
  }
24069
24186
  WorkflowSchedule.Delete = Delete;
24187
+ function BuildListUrl(params) {
24188
+ var _a, _b, _c, _d;
24189
+ const q = new URLSearchParams();
24190
+ appendParam$1(q, "Entity.InternalID", (_b = (_a = params === null || params === void 0 ? void 0 : params.entityInternalId) !== null && _a !== void 0 ? _a : params === null || params === void 0 ? void 0 : params["Entity.InternalID"]) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.EntityInternalID);
24191
+ appendParam$1(q, "Entity.ID", (_d = (_c = params === null || params === void 0 ? void 0 : params.entityId) !== null && _c !== void 0 ? _c : params === null || params === void 0 ? void 0 : params["Entity.ID"]) !== null && _d !== void 0 ? _d : params === null || params === void 0 ? void 0 : params.EntityID);
24192
+ const qs = q.toString();
24193
+ return qs ? `workflow/schedules?${qs}` : "workflow/schedules";
24194
+ }
24195
+ WorkflowSchedule.BuildListUrl = BuildListUrl;
24070
24196
  function ParseResponse(response) {
24071
24197
  var _a, _b, _c, _d;
24072
24198
  const parsed = parseObject$6(response);
@@ -24095,11 +24221,26 @@
24095
24221
  return `${exports.Api.ECacheKey.WorkflowSchedule}${exports.Api.ECacheKey.Id}${id}`;
24096
24222
  }
24097
24223
  WorkflowSchedule.GetCacheKey = GetCacheKey;
24098
- function GetListCacheKey() {
24099
- return exports.Api.ECacheKey.WorkflowSchedule;
24224
+ function GetListCacheKey(params) {
24225
+ const url = BuildListUrl(params);
24226
+ return url === "workflow/schedules"
24227
+ ? exports.Api.ECacheKey.WorkflowSchedule
24228
+ : `${exports.Api.ECacheKey.WorkflowSchedule}${exports.Api.ECacheKey.ListId}${url}`;
24100
24229
  }
24101
24230
  WorkflowSchedule.GetListCacheKey = GetListCacheKey;
24102
24231
  })(exports.WorkflowSchedule || (exports.WorkflowSchedule = {}));
24232
+ function appendParam$1(q, key, value) {
24233
+ if (value == null || value === "") {
24234
+ return;
24235
+ }
24236
+ if (Array.isArray(value)) {
24237
+ if (value.length) {
24238
+ q.append(key, value.join(","));
24239
+ }
24240
+ return;
24241
+ }
24242
+ q.append(key, String(value));
24243
+ }
24103
24244
  function parseObject$6(data) {
24104
24245
  if (data == null || data == undefined) {
24105
24246
  return null;
@@ -24424,7 +24565,7 @@
24424
24565
  }
24425
24566
 
24426
24567
  // This is updated with the package.json version on build.
24427
- const VERSION = "7.1.108";
24568
+ const VERSION = "7.1.110";
24428
24569
 
24429
24570
  exports.VERSION = VERSION;
24430
24571
  exports.AbstractApi = AbstractApi;