bruce-models 6.9.7 → 6.9.9
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/dist/bruce-models.es5.js +41 -16
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +41 -16
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/ann-document/ann-document.js +17 -5
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/plugin/plugin.js +11 -4
- package/dist/lib/plugin/plugin.js.map +1 -1
- package/dist/lib/style/style.js +12 -6
- package/dist/lib/style/style.js.map +1 -1
- package/dist/types/ann-document/ann-document.d.ts +5 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/plugin/plugin.d.ts +1 -0
- package/dist/types/style/style.d.ts +3 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -2163,14 +2163,14 @@
|
|
|
2163
2163
|
*/
|
|
2164
2164
|
function GetList(params) {
|
|
2165
2165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2166
|
-
let { api, docType: type, req: reqParams, entityId, expandSettings } = params;
|
|
2166
|
+
let { api, docType: type, req: reqParams, entityId, expandSettings, pageIndex, pageSize } = params;
|
|
2167
2167
|
if (!api) {
|
|
2168
2168
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
2169
2169
|
}
|
|
2170
2170
|
if (!type) {
|
|
2171
2171
|
type = "";
|
|
2172
2172
|
}
|
|
2173
|
-
const cache = api.GetCacheItem(GetListCacheKey(type, entityId, expandSettings), reqParams);
|
|
2173
|
+
const cache = api.GetCacheItem(GetListCacheKey(type, entityId, expandSettings, pageIndex, pageSize), reqParams);
|
|
2174
2174
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
2175
2175
|
return cache.data;
|
|
2176
2176
|
}
|
|
@@ -2186,6 +2186,10 @@
|
|
|
2186
2186
|
if (expandSettings) {
|
|
2187
2187
|
urlParams.append("expandSettings", "true");
|
|
2188
2188
|
}
|
|
2189
|
+
if (pageIndex !== undefined || pageSize !== undefined) {
|
|
2190
|
+
urlParams.append("PageIndex", String(pageIndex || 0));
|
|
2191
|
+
urlParams.append("PageSize", String(pageSize || 0));
|
|
2192
|
+
}
|
|
2189
2193
|
const url = "documentViews" + `?${urlParams.toString()}`;
|
|
2190
2194
|
const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
|
|
2191
2195
|
res({
|
|
@@ -2197,7 +2201,7 @@
|
|
|
2197
2201
|
}
|
|
2198
2202
|
}));
|
|
2199
2203
|
api.SetCacheItem({
|
|
2200
|
-
key: GetListCacheKey(type, entityId, expandSettings),
|
|
2204
|
+
key: GetListCacheKey(type, entityId, expandSettings, pageIndex, pageSize),
|
|
2201
2205
|
value: req,
|
|
2202
2206
|
req: reqParams
|
|
2203
2207
|
});
|
|
@@ -2229,16 +2233,24 @@
|
|
|
2229
2233
|
* @param type
|
|
2230
2234
|
* @param entityId
|
|
2231
2235
|
* @param expandSettings
|
|
2236
|
+
* @param pageIndex
|
|
2237
|
+
* @param pageSize
|
|
2232
2238
|
* @returns
|
|
2233
2239
|
*/
|
|
2234
|
-
function GetListCacheKey(type, entityId, expandSettings) {
|
|
2240
|
+
function GetListCacheKey(type, entityId, expandSettings, pageIndex, pageSize) {
|
|
2235
2241
|
if (!expandSettings) {
|
|
2236
2242
|
expandSettings = false;
|
|
2237
2243
|
}
|
|
2238
2244
|
if (!entityId) {
|
|
2239
2245
|
entityId = "";
|
|
2240
2246
|
}
|
|
2241
|
-
|
|
2247
|
+
if (!pageIndex) {
|
|
2248
|
+
pageIndex = 0;
|
|
2249
|
+
}
|
|
2250
|
+
if (!pageSize) {
|
|
2251
|
+
pageSize = 0;
|
|
2252
|
+
}
|
|
2253
|
+
return exports.Api.ECacheKey.AnnDocument + type + entityId + expandSettings + pageIndex + "_" + pageSize;
|
|
2242
2254
|
}
|
|
2243
2255
|
AnnDocument.GetListCacheKey = GetListCacheKey;
|
|
2244
2256
|
})(exports.AnnDocument || (exports.AnnDocument = {}));
|
|
@@ -8429,17 +8441,23 @@
|
|
|
8429
8441
|
*/
|
|
8430
8442
|
function GetList(params) {
|
|
8431
8443
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8432
|
-
let { api, req: reqParams } = params;
|
|
8444
|
+
let { api, req: reqParams, pageIndex, pageSize } = params;
|
|
8433
8445
|
if (!api) {
|
|
8434
8446
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
8435
8447
|
}
|
|
8436
|
-
const cache = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
8448
|
+
const cache = api.GetCacheItem(GetListCacheKey(pageIndex, pageSize), reqParams);
|
|
8437
8449
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
8438
8450
|
return cache.data;
|
|
8439
8451
|
}
|
|
8440
8452
|
const res = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
8441
8453
|
try {
|
|
8442
|
-
const
|
|
8454
|
+
const urlParams = new URLSearchParams();
|
|
8455
|
+
if (pageIndex !== undefined || pageSize !== undefined) {
|
|
8456
|
+
urlParams.append("PageIndex", String(pageIndex || 0));
|
|
8457
|
+
urlParams.append("PageSize", String(pageSize || 0));
|
|
8458
|
+
}
|
|
8459
|
+
const url = "ui.entityDisplaySettings" + `?${urlParams.toString()}`;
|
|
8460
|
+
const data = yield api.GET(url, exports.Api.PrepReqParams(reqParams));
|
|
8443
8461
|
res({
|
|
8444
8462
|
styles: data.Items
|
|
8445
8463
|
});
|
|
@@ -8449,7 +8467,7 @@
|
|
|
8449
8467
|
}
|
|
8450
8468
|
}));
|
|
8451
8469
|
api.SetCacheItem({
|
|
8452
|
-
key: GetListCacheKey(),
|
|
8470
|
+
key: GetListCacheKey(pageIndex, pageSize),
|
|
8453
8471
|
value: res,
|
|
8454
8472
|
req: reqParams
|
|
8455
8473
|
});
|
|
@@ -8563,8 +8581,8 @@
|
|
|
8563
8581
|
* }
|
|
8564
8582
|
* @returns
|
|
8565
8583
|
*/
|
|
8566
|
-
function GetListCacheKey() {
|
|
8567
|
-
return exports.Api.ECacheKey.Style;
|
|
8584
|
+
function GetListCacheKey(pageSize, pageIndex) {
|
|
8585
|
+
return exports.Api.ECacheKey.Style + (pageIndex || 0) + "_" + (pageSize || 0);
|
|
8568
8586
|
}
|
|
8569
8587
|
Style.GetListCacheKey = GetListCacheKey;
|
|
8570
8588
|
})(exports.Style || (exports.Style = {}));
|
|
@@ -15731,7 +15749,7 @@
|
|
|
15731
15749
|
* @returns
|
|
15732
15750
|
*/
|
|
15733
15751
|
function GetLoadUrl(params) {
|
|
15734
|
-
let { api, pluginId, cacheKey } = params;
|
|
15752
|
+
let { api, pluginId, cacheKey, viaCdn } = params;
|
|
15735
15753
|
if (!api) {
|
|
15736
15754
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
15737
15755
|
}
|
|
@@ -15744,7 +15762,7 @@
|
|
|
15744
15762
|
urlParams: {
|
|
15745
15763
|
"version": String(cacheKey)
|
|
15746
15764
|
},
|
|
15747
|
-
cdn:
|
|
15765
|
+
cdn: viaCdn
|
|
15748
15766
|
})
|
|
15749
15767
|
};
|
|
15750
15768
|
}
|
|
@@ -15855,7 +15873,8 @@
|
|
|
15855
15873
|
const { indexFileUrl } = GetLoadUrl({
|
|
15856
15874
|
api,
|
|
15857
15875
|
pluginId,
|
|
15858
|
-
cacheKey: plugin.Version
|
|
15876
|
+
cacheKey: plugin.Version,
|
|
15877
|
+
viaCdn: !plugin.IsLoginRequired
|
|
15859
15878
|
});
|
|
15860
15879
|
req = exports.Api.PrepReqParams(req);
|
|
15861
15880
|
const cacheData = api.GetCacheItem(GetIndexFileCacheKey(pluginId, indexFileUrl), req);
|
|
@@ -15864,7 +15883,13 @@
|
|
|
15864
15883
|
fileContentProm = cacheData.data;
|
|
15865
15884
|
}
|
|
15866
15885
|
else {
|
|
15867
|
-
|
|
15886
|
+
const headers = {};
|
|
15887
|
+
if (plugin.IsLoginRequired) {
|
|
15888
|
+
headers[api.GetSessionHeader()] = api.GetSessionId();
|
|
15889
|
+
}
|
|
15890
|
+
fileContentProm = fetch(indexFileUrl, {
|
|
15891
|
+
headers: headers
|
|
15892
|
+
}).then((res) => res.text());
|
|
15868
15893
|
api.SetCacheItem({
|
|
15869
15894
|
key: GetIndexFileCacheKey(pluginId, indexFileUrl),
|
|
15870
15895
|
value: fileContentProm,
|
|
@@ -16665,7 +16690,7 @@
|
|
|
16665
16690
|
}
|
|
16666
16691
|
|
|
16667
16692
|
// This is updated with the package.json version on build.
|
|
16668
|
-
const VERSION = "6.9.
|
|
16693
|
+
const VERSION = "6.9.9";
|
|
16669
16694
|
|
|
16670
16695
|
exports.VERSION = VERSION;
|
|
16671
16696
|
exports.AbstractApi = AbstractApi;
|