d5-api-initializer 1.5.5 → 1.7.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "d5-api-initializer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {},
|
|
6
6
|
"main": "publish/cjs/d5-api-initializer",
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
"prerelease": "npm version prerelease --preid=alpha"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@babel/core": "7.
|
|
34
|
+
"@babel/core": "7.27.4",
|
|
35
|
+
"@babel/preset-env": "7.27.2",
|
|
36
|
+
"@babel/preset-typescript": "7.27.1",
|
|
35
37
|
"@types/node": "20.11.16",
|
|
36
38
|
"archiver": "6.0.1",
|
|
37
39
|
"copy-webpack-plugin": "^11.0.0",
|
|
@@ -40,8 +42,8 @@
|
|
|
40
42
|
"dotenv": "16.4.7",
|
|
41
43
|
"eslint": "7.19.0",
|
|
42
44
|
"rimraf": "5.0.5",
|
|
43
|
-
"
|
|
44
|
-
"tsup": "
|
|
45
|
-
"typescript": "5.
|
|
45
|
+
"babel-loader": "10.0.0",
|
|
46
|
+
"tsup": "8.5.0",
|
|
47
|
+
"typescript": "5.8.3"
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -17,10 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var __publicField = (obj, key, value) =>
|
|
21
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
-
return value;
|
|
23
|
-
};
|
|
20
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
24
21
|
|
|
25
22
|
// src/lib-index.ts
|
|
26
23
|
var lib_index_exports = {};
|
|
@@ -440,6 +437,10 @@ var ApiInvoker = class {
|
|
|
440
437
|
this._jsWapiInvoker = this._jsWapiInvoker.putNestedColumns(nestedColumns);
|
|
441
438
|
return this;
|
|
442
439
|
}
|
|
440
|
+
addFilters(filters) {
|
|
441
|
+
this._jsWapiInvoker = this._jsWapiInvoker.putFilters(filters);
|
|
442
|
+
return this;
|
|
443
|
+
}
|
|
443
444
|
addSorts(sorts) {
|
|
444
445
|
this._jsWapiInvoker = this._jsWapiInvoker.addSorts(sorts);
|
|
445
446
|
return this;
|
|
@@ -480,8 +481,7 @@ var UserMessages = class {
|
|
|
480
481
|
__publicField(this, "_lang", "ua" /* ua */);
|
|
481
482
|
}
|
|
482
483
|
appendDictionary(newDictionary) {
|
|
483
|
-
if (Array.isArray(newDictionary) || !newDictionary || typeof newDictionary !== "object")
|
|
484
|
-
return;
|
|
484
|
+
if (Array.isArray(newDictionary) || !newDictionary || typeof newDictionary !== "object") return;
|
|
485
485
|
for (const key in newDictionary) {
|
|
486
486
|
if (!this._messages.hasOwnProperty(key)) {
|
|
487
487
|
this._messages[key] = {};
|
|
@@ -996,16 +996,14 @@ var ApiInitializer = class {
|
|
|
996
996
|
throw new Error(msg);
|
|
997
997
|
};
|
|
998
998
|
if (typeof settings === "string") {
|
|
999
|
-
if (!operations)
|
|
1000
|
-
throwError('The second argument "operations" is required');
|
|
999
|
+
if (!operations) throwError('The second argument "operations" is required');
|
|
1001
1000
|
this._operations = operations;
|
|
1002
1001
|
this.internalCreate(settings);
|
|
1003
1002
|
options?.translations && this.initTranslation(options.translations);
|
|
1004
1003
|
return;
|
|
1005
1004
|
}
|
|
1006
1005
|
const { objectName, operations: opers, translations } = settings;
|
|
1007
|
-
if (!opers)
|
|
1008
|
-
throwError('Property "operations" in the settings is required');
|
|
1006
|
+
if (!opers) throwError('Property "operations" in the settings is required');
|
|
1009
1007
|
this._operations = opers;
|
|
1010
1008
|
this.internalCreate(objectName);
|
|
1011
1009
|
translations && this.initTranslation(translations);
|
|
@@ -1063,8 +1061,7 @@ var EngineInitializer = class {
|
|
|
1063
1061
|
const throwError = (msg) => {
|
|
1064
1062
|
throw new Error(msg);
|
|
1065
1063
|
};
|
|
1066
|
-
if (!operations)
|
|
1067
|
-
throwError('Property "operations" in the settings is required');
|
|
1064
|
+
if (!operations) throwError('Property "operations" in the settings is required');
|
|
1068
1065
|
this._operations = operations;
|
|
1069
1066
|
this.internalCreate();
|
|
1070
1067
|
translations && this.initTranslation(translations);
|
|
@@ -1122,8 +1119,7 @@ var ApplicationInitializer = class {
|
|
|
1122
1119
|
const throwError = (msg) => {
|
|
1123
1120
|
throw new Error(msg);
|
|
1124
1121
|
};
|
|
1125
|
-
if (!operations)
|
|
1126
|
-
throwError('Property "operations" in the settings is required');
|
|
1122
|
+
if (!operations) throwError('Property "operations" in the settings is required');
|
|
1127
1123
|
this._operations = operations;
|
|
1128
1124
|
this.internalCreate();
|
|
1129
1125
|
}
|
|
@@ -33,6 +33,7 @@ declare namespace jsWapi {
|
|
|
33
33
|
putAggregatedColumns(columns: any): JSWapiInvoker;
|
|
34
34
|
setNestedColumns(columns: any): JSWapiInvoker;
|
|
35
35
|
putNestedColumns(columns: any): JSWapiInvoker;
|
|
36
|
+
putFilters(filters: IFiltersCollection): JSWapiInvoker;
|
|
36
37
|
setHierarchy(parentColumn: string, requestKind?: number): JSWapiInvoker;
|
|
37
38
|
setSrcRequest(srcRequest: any): JSWapiInvoker;
|
|
38
39
|
setFirstRows(number: number): JSWapiInvoker;
|
|
@@ -410,6 +411,7 @@ declare class ApiInvoker implements IInvoker$1<ApiInvoker> {
|
|
|
410
411
|
addColumns(columns: string[]): ApiInvoker;
|
|
411
412
|
addAggregatedColumns(aggregatedColumns: IMappedCollection): ApiInvoker;
|
|
412
413
|
addNestedColumns(nestedColumns: IMappedCollection): ApiInvoker;
|
|
414
|
+
addFilters(filters: IFiltersCollection): ApiInvoker;
|
|
413
415
|
addSorts(sorts: string[]): ApiInvoker;
|
|
414
416
|
addFile(fileID: string, fileStream: any): ApiInvoker;
|
|
415
417
|
addRequestRow(data: Record<string, any>): ApiInvoker;
|
|
@@ -753,4 +755,4 @@ declare class UserMessages {
|
|
|
753
755
|
}
|
|
754
756
|
declare const _default: UserMessages;
|
|
755
757
|
|
|
756
|
-
export { ApiCore, ApiHttpRequest, ApiHttpResponse, ApiInvoker, ApiJoinInvoker, ApiObjectCollectionIterator, ApiRequest, ApiResponse, ApplicationInitializer, EngineInitializer, IApiOperations, IFilter, IFilterValue, IFiltersCollection, IHttpCallback, IMappedCollection, LanguageCode, MultipartFormData, _default as UserMessages, ApiObjectInitializer as default, fileLink, fileRequestId };
|
|
758
|
+
export { ApiCore, ApiHttpRequest, ApiHttpResponse, ApiInvoker, ApiJoinInvoker, ApiObjectCollectionIterator, ApiRequest, ApiResponse, ApplicationInitializer, EngineInitializer, type IApiOperations, type IFilter, type IFilterValue, type IFiltersCollection, type IHttpCallback, type IMappedCollection, LanguageCode, MultipartFormData, _default as UserMessages, ApiObjectInitializer as default, fileLink, fileRequestId };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
|
|
8
5
|
// src/classes/ApiHttpResponse.ts
|
|
9
6
|
var ApiHttpResponse = class {
|
|
@@ -401,6 +398,10 @@ var ApiInvoker = class {
|
|
|
401
398
|
this._jsWapiInvoker = this._jsWapiInvoker.putNestedColumns(nestedColumns);
|
|
402
399
|
return this;
|
|
403
400
|
}
|
|
401
|
+
addFilters(filters) {
|
|
402
|
+
this._jsWapiInvoker = this._jsWapiInvoker.putFilters(filters);
|
|
403
|
+
return this;
|
|
404
|
+
}
|
|
404
405
|
addSorts(sorts) {
|
|
405
406
|
this._jsWapiInvoker = this._jsWapiInvoker.addSorts(sorts);
|
|
406
407
|
return this;
|
|
@@ -441,8 +442,7 @@ var UserMessages = class {
|
|
|
441
442
|
__publicField(this, "_lang", "ua" /* ua */);
|
|
442
443
|
}
|
|
443
444
|
appendDictionary(newDictionary) {
|
|
444
|
-
if (Array.isArray(newDictionary) || !newDictionary || typeof newDictionary !== "object")
|
|
445
|
-
return;
|
|
445
|
+
if (Array.isArray(newDictionary) || !newDictionary || typeof newDictionary !== "object") return;
|
|
446
446
|
for (const key in newDictionary) {
|
|
447
447
|
if (!this._messages.hasOwnProperty(key)) {
|
|
448
448
|
this._messages[key] = {};
|
|
@@ -957,16 +957,14 @@ var ApiInitializer = class {
|
|
|
957
957
|
throw new Error(msg);
|
|
958
958
|
};
|
|
959
959
|
if (typeof settings === "string") {
|
|
960
|
-
if (!operations)
|
|
961
|
-
throwError('The second argument "operations" is required');
|
|
960
|
+
if (!operations) throwError('The second argument "operations" is required');
|
|
962
961
|
this._operations = operations;
|
|
963
962
|
this.internalCreate(settings);
|
|
964
963
|
options?.translations && this.initTranslation(options.translations);
|
|
965
964
|
return;
|
|
966
965
|
}
|
|
967
966
|
const { objectName, operations: opers, translations } = settings;
|
|
968
|
-
if (!opers)
|
|
969
|
-
throwError('Property "operations" in the settings is required');
|
|
967
|
+
if (!opers) throwError('Property "operations" in the settings is required');
|
|
970
968
|
this._operations = opers;
|
|
971
969
|
this.internalCreate(objectName);
|
|
972
970
|
translations && this.initTranslation(translations);
|
|
@@ -1024,8 +1022,7 @@ var EngineInitializer = class {
|
|
|
1024
1022
|
const throwError = (msg) => {
|
|
1025
1023
|
throw new Error(msg);
|
|
1026
1024
|
};
|
|
1027
|
-
if (!operations)
|
|
1028
|
-
throwError('Property "operations" in the settings is required');
|
|
1025
|
+
if (!operations) throwError('Property "operations" in the settings is required');
|
|
1029
1026
|
this._operations = operations;
|
|
1030
1027
|
this.internalCreate();
|
|
1031
1028
|
translations && this.initTranslation(translations);
|
|
@@ -1083,8 +1080,7 @@ var ApplicationInitializer = class {
|
|
|
1083
1080
|
const throwError = (msg) => {
|
|
1084
1081
|
throw new Error(msg);
|
|
1085
1082
|
};
|
|
1086
|
-
if (!operations)
|
|
1087
|
-
throwError('Property "operations" in the settings is required');
|
|
1083
|
+
if (!operations) throwError('Property "operations" in the settings is required');
|
|
1088
1084
|
this._operations = operations;
|
|
1089
1085
|
this.internalCreate();
|
|
1090
1086
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
|
|
8
5
|
// src/classes/ApiHttpResponse.ts
|
|
9
6
|
var ApiHttpResponse = class {
|
|
@@ -401,6 +398,10 @@ var ApiInvoker = class {
|
|
|
401
398
|
this._jsWapiInvoker = this._jsWapiInvoker.putNestedColumns(nestedColumns);
|
|
402
399
|
return this;
|
|
403
400
|
}
|
|
401
|
+
addFilters(filters) {
|
|
402
|
+
this._jsWapiInvoker = this._jsWapiInvoker.putFilters(filters);
|
|
403
|
+
return this;
|
|
404
|
+
}
|
|
404
405
|
addSorts(sorts) {
|
|
405
406
|
this._jsWapiInvoker = this._jsWapiInvoker.addSorts(sorts);
|
|
406
407
|
return this;
|
|
@@ -441,8 +442,7 @@ var UserMessages = class {
|
|
|
441
442
|
__publicField(this, "_lang", "ua" /* ua */);
|
|
442
443
|
}
|
|
443
444
|
appendDictionary(newDictionary) {
|
|
444
|
-
if (Array.isArray(newDictionary) || !newDictionary || typeof newDictionary !== "object")
|
|
445
|
-
return;
|
|
445
|
+
if (Array.isArray(newDictionary) || !newDictionary || typeof newDictionary !== "object") return;
|
|
446
446
|
for (const key in newDictionary) {
|
|
447
447
|
if (!this._messages.hasOwnProperty(key)) {
|
|
448
448
|
this._messages[key] = {};
|
|
@@ -957,16 +957,14 @@ var ApiInitializer = class {
|
|
|
957
957
|
throw new Error(msg);
|
|
958
958
|
};
|
|
959
959
|
if (typeof settings === "string") {
|
|
960
|
-
if (!operations)
|
|
961
|
-
throwError('The second argument "operations" is required');
|
|
960
|
+
if (!operations) throwError('The second argument "operations" is required');
|
|
962
961
|
this._operations = operations;
|
|
963
962
|
this.internalCreate(settings);
|
|
964
963
|
options?.translations && this.initTranslation(options.translations);
|
|
965
964
|
return;
|
|
966
965
|
}
|
|
967
966
|
const { objectName, operations: opers, translations } = settings;
|
|
968
|
-
if (!opers)
|
|
969
|
-
throwError('Property "operations" in the settings is required');
|
|
967
|
+
if (!opers) throwError('Property "operations" in the settings is required');
|
|
970
968
|
this._operations = opers;
|
|
971
969
|
this.internalCreate(objectName);
|
|
972
970
|
translations && this.initTranslation(translations);
|
|
@@ -1024,8 +1022,7 @@ var EngineInitializer = class {
|
|
|
1024
1022
|
const throwError = (msg) => {
|
|
1025
1023
|
throw new Error(msg);
|
|
1026
1024
|
};
|
|
1027
|
-
if (!operations)
|
|
1028
|
-
throwError('Property "operations" in the settings is required');
|
|
1025
|
+
if (!operations) throwError('Property "operations" in the settings is required');
|
|
1029
1026
|
this._operations = operations;
|
|
1030
1027
|
this.internalCreate();
|
|
1031
1028
|
translations && this.initTranslation(translations);
|
|
@@ -1083,8 +1080,7 @@ var ApplicationInitializer = class {
|
|
|
1083
1080
|
const throwError = (msg) => {
|
|
1084
1081
|
throw new Error(msg);
|
|
1085
1082
|
};
|
|
1086
|
-
if (!operations)
|
|
1087
|
-
throwError('Property "operations" in the settings is required');
|
|
1083
|
+
if (!operations) throwError('Property "operations" in the settings is required');
|
|
1088
1084
|
this._operations = operations;
|
|
1089
1085
|
this.internalCreate();
|
|
1090
1086
|
}
|