d5-api-initializer 1.0.0 → 1.0.2
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
|
@@ -25,8 +25,18 @@ var __publicField = (obj, key, value) => {
|
|
|
25
25
|
// src/lib-index.ts
|
|
26
26
|
var lib_index_exports = {};
|
|
27
27
|
__export(lib_index_exports, {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
ApiCore: () => ApiCore,
|
|
29
|
+
ApiHttpRequest: () => ApiHttpRequest,
|
|
30
|
+
ApiHttpResponse: () => ApiHttpResponse,
|
|
31
|
+
ApiInvoker: () => ApiInvoker,
|
|
32
|
+
ApiJoinInvoker: () => ApiJoinInvoker,
|
|
33
|
+
ApiObjectCollectionIterator: () => ApiObjectCollectionIterator,
|
|
34
|
+
ApiRequest: () => ApiRequest,
|
|
35
|
+
ApiResponse: () => ApiResponse,
|
|
36
|
+
EngineInitializer: () => EngineInitializer,
|
|
37
|
+
LanguageCode: () => LanguageCode,
|
|
38
|
+
UserMessages: () => UserMessages_default,
|
|
39
|
+
default: () => lib_index_default
|
|
30
40
|
});
|
|
31
41
|
module.exports = __toCommonJS(lib_index_exports);
|
|
32
42
|
|
|
@@ -297,6 +307,14 @@ var ApiInvoker = class {
|
|
|
297
307
|
}
|
|
298
308
|
};
|
|
299
309
|
|
|
310
|
+
// src/api-interfaces.ts
|
|
311
|
+
var LanguageCode = /* @__PURE__ */ ((LanguageCode2) => {
|
|
312
|
+
LanguageCode2["ua"] = "ua";
|
|
313
|
+
LanguageCode2["ru"] = "ru";
|
|
314
|
+
LanguageCode2["en"] = "eng";
|
|
315
|
+
return LanguageCode2;
|
|
316
|
+
})(LanguageCode || {});
|
|
317
|
+
|
|
300
318
|
// src/classes/UserMessages.ts
|
|
301
319
|
function formatMessage(text, args = []) {
|
|
302
320
|
let str = text;
|
|
@@ -784,17 +802,12 @@ var EngineInitializer = class {
|
|
|
784
802
|
this.engine.putJSWapiOper(operationName, (jsWapiRequest, jsWapiResponse) => {
|
|
785
803
|
const request = new ApiRequest(jsWapiRequest, this.engine.getName());
|
|
786
804
|
const apiCore = new ApiCore({ http: this.engine, request });
|
|
787
|
-
return this._operations[operationName](
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
objectName: this.engine.getName(),
|
|
794
|
-
externalObject: this.engine.getExternalName(),
|
|
795
|
-
externalFieldsMap: this.engine.getExternalObjectFields()
|
|
796
|
-
}
|
|
797
|
-
);
|
|
805
|
+
return this._operations[operationName](apiCore, request, new ApiResponse(jsWapiResponse, this.engine.getName()), {
|
|
806
|
+
parameters: this.engine.getExternalSystemParameters(),
|
|
807
|
+
objectName: this.engine.getName(),
|
|
808
|
+
externalObject: this.engine.getExternalName(),
|
|
809
|
+
externalFieldsMap: this.engine.getExternalObjectFields()
|
|
810
|
+
});
|
|
798
811
|
});
|
|
799
812
|
}
|
|
800
813
|
/**
|
|
@@ -811,17 +824,39 @@ var EngineInitializer = class {
|
|
|
811
824
|
initTranslation(translations) {
|
|
812
825
|
UserMessages_default.appendDictionary(translations);
|
|
813
826
|
}
|
|
814
|
-
call({
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
827
|
+
call({
|
|
828
|
+
apiCore,
|
|
829
|
+
apiRequest,
|
|
830
|
+
apiResponse,
|
|
831
|
+
operation,
|
|
832
|
+
meta
|
|
833
|
+
}) {
|
|
834
|
+
return this._operations[operation](apiCore, apiRequest, apiResponse, meta);
|
|
821
835
|
}
|
|
822
836
|
};
|
|
837
|
+
|
|
838
|
+
// src/classes/ApiJoinInvoker.ts
|
|
839
|
+
var ApiJoinInvoker = class {
|
|
840
|
+
constructor(jsWapiJoinInvoker) {
|
|
841
|
+
__publicField(this, "_jsWapiJoinInvoker");
|
|
842
|
+
this._jsWapiJoinInvoker = jsWapiJoinInvoker;
|
|
843
|
+
}
|
|
844
|
+
//TODO: implement methods.
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
// src/lib-index.ts
|
|
848
|
+
var lib_index_default = ApiObjectInitializer;
|
|
823
849
|
// Annotate the CommonJS export names for ESM import in node:
|
|
824
850
|
0 && (module.exports = {
|
|
825
|
-
|
|
826
|
-
|
|
851
|
+
ApiCore,
|
|
852
|
+
ApiHttpRequest,
|
|
853
|
+
ApiHttpResponse,
|
|
854
|
+
ApiInvoker,
|
|
855
|
+
ApiJoinInvoker,
|
|
856
|
+
ApiObjectCollectionIterator,
|
|
857
|
+
ApiRequest,
|
|
858
|
+
ApiResponse,
|
|
859
|
+
EngineInitializer,
|
|
860
|
+
LanguageCode,
|
|
861
|
+
UserMessages
|
|
827
862
|
});
|
|
@@ -93,6 +93,12 @@ declare namespace jsWapi {
|
|
|
93
93
|
putJSWapiOper(operation: string, callback: (jsWapiRequest: JSWapiRequest, jsWapiResponse: JSWapiResponse) => void): void;
|
|
94
94
|
}
|
|
95
95
|
function setJSWapiEngine(init: (object: JSWapiEngine) => void): void;
|
|
96
|
+
interface JSWapiApplication {
|
|
97
|
+
getName(): string;
|
|
98
|
+
newJSWapiHttp(url: string): JSWapiHttp;
|
|
99
|
+
putJSWapiOper(operation: string, callback: (request: JSWapiRequest, response: JSWapiResponse) => void): void;
|
|
100
|
+
}
|
|
101
|
+
function setJSWapiObject(init: (object: JSWapiApplication) => void): void;
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
declare class ApiHttpResponse {
|
|
@@ -418,4 +424,18 @@ declare class EngineInitializer<MetaParams = Record<string, any>> {
|
|
|
418
424
|
}): void;
|
|
419
425
|
}
|
|
420
426
|
|
|
421
|
-
|
|
427
|
+
declare class ApiJoinInvoker {
|
|
428
|
+
readonly _jsWapiJoinInvoker: any;
|
|
429
|
+
constructor(jsWapiJoinInvoker: any);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
declare class UserMessages {
|
|
433
|
+
private _messages;
|
|
434
|
+
private _lang;
|
|
435
|
+
appendDictionary(newDictionary: Record<LanguageCode, Record<string, string>>): void;
|
|
436
|
+
format(msgKey: string, params?: string[]): string;
|
|
437
|
+
set lang(value: LanguageCode);
|
|
438
|
+
}
|
|
439
|
+
declare const _default: UserMessages;
|
|
440
|
+
|
|
441
|
+
export { ApiCore, ApiHttpRequest, ApiHttpResponse, ApiInvoker, ApiJoinInvoker, ApiObjectCollectionIterator, ApiRequest, ApiResponse, EngineInitializer, IApiOperations, IFilter, IFilterValue, IFiltersCollection, IHttpCallback, IMappedCollection, LanguageCode, _default as UserMessages, ApiObjectInitializer as default };
|
|
@@ -272,6 +272,14 @@ var ApiInvoker = class {
|
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
+
// src/api-interfaces.ts
|
|
276
|
+
var LanguageCode = /* @__PURE__ */ ((LanguageCode2) => {
|
|
277
|
+
LanguageCode2["ua"] = "ua";
|
|
278
|
+
LanguageCode2["ru"] = "ru";
|
|
279
|
+
LanguageCode2["en"] = "eng";
|
|
280
|
+
return LanguageCode2;
|
|
281
|
+
})(LanguageCode || {});
|
|
282
|
+
|
|
275
283
|
// src/classes/UserMessages.ts
|
|
276
284
|
function formatMessage(text, args = []) {
|
|
277
285
|
let str = text;
|
|
@@ -759,17 +767,12 @@ var EngineInitializer = class {
|
|
|
759
767
|
this.engine.putJSWapiOper(operationName, (jsWapiRequest, jsWapiResponse) => {
|
|
760
768
|
const request = new ApiRequest(jsWapiRequest, this.engine.getName());
|
|
761
769
|
const apiCore = new ApiCore({ http: this.engine, request });
|
|
762
|
-
return this._operations[operationName](
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
objectName: this.engine.getName(),
|
|
769
|
-
externalObject: this.engine.getExternalName(),
|
|
770
|
-
externalFieldsMap: this.engine.getExternalObjectFields()
|
|
771
|
-
}
|
|
772
|
-
);
|
|
770
|
+
return this._operations[operationName](apiCore, request, new ApiResponse(jsWapiResponse, this.engine.getName()), {
|
|
771
|
+
parameters: this.engine.getExternalSystemParameters(),
|
|
772
|
+
objectName: this.engine.getName(),
|
|
773
|
+
externalObject: this.engine.getExternalName(),
|
|
774
|
+
externalFieldsMap: this.engine.getExternalObjectFields()
|
|
775
|
+
});
|
|
773
776
|
});
|
|
774
777
|
}
|
|
775
778
|
/**
|
|
@@ -786,16 +789,39 @@ var EngineInitializer = class {
|
|
|
786
789
|
initTranslation(translations) {
|
|
787
790
|
UserMessages_default.appendDictionary(translations);
|
|
788
791
|
}
|
|
789
|
-
call({
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
792
|
+
call({
|
|
793
|
+
apiCore,
|
|
794
|
+
apiRequest,
|
|
795
|
+
apiResponse,
|
|
796
|
+
operation,
|
|
797
|
+
meta
|
|
798
|
+
}) {
|
|
799
|
+
return this._operations[operation](apiCore, apiRequest, apiResponse, meta);
|
|
796
800
|
}
|
|
797
801
|
};
|
|
802
|
+
|
|
803
|
+
// src/classes/ApiJoinInvoker.ts
|
|
804
|
+
var ApiJoinInvoker = class {
|
|
805
|
+
constructor(jsWapiJoinInvoker) {
|
|
806
|
+
__publicField(this, "_jsWapiJoinInvoker");
|
|
807
|
+
this._jsWapiJoinInvoker = jsWapiJoinInvoker;
|
|
808
|
+
}
|
|
809
|
+
//TODO: implement methods.
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
// src/lib-index.ts
|
|
813
|
+
var lib_index_default = ApiObjectInitializer;
|
|
798
814
|
export {
|
|
799
|
-
|
|
800
|
-
|
|
815
|
+
ApiCore,
|
|
816
|
+
ApiHttpRequest,
|
|
817
|
+
ApiHttpResponse,
|
|
818
|
+
ApiInvoker,
|
|
819
|
+
ApiJoinInvoker,
|
|
820
|
+
ApiObjectCollectionIterator,
|
|
821
|
+
ApiRequest,
|
|
822
|
+
ApiResponse,
|
|
823
|
+
EngineInitializer,
|
|
824
|
+
LanguageCode,
|
|
825
|
+
UserMessages_default as UserMessages,
|
|
826
|
+
lib_index_default as default
|
|
801
827
|
};
|
|
@@ -272,6 +272,14 @@ var ApiInvoker = class {
|
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
+
// src/api-interfaces.ts
|
|
276
|
+
var LanguageCode = /* @__PURE__ */ ((LanguageCode2) => {
|
|
277
|
+
LanguageCode2["ua"] = "ua";
|
|
278
|
+
LanguageCode2["ru"] = "ru";
|
|
279
|
+
LanguageCode2["en"] = "eng";
|
|
280
|
+
return LanguageCode2;
|
|
281
|
+
})(LanguageCode || {});
|
|
282
|
+
|
|
275
283
|
// src/classes/UserMessages.ts
|
|
276
284
|
function formatMessage(text, args = []) {
|
|
277
285
|
let str = text;
|
|
@@ -759,17 +767,12 @@ var EngineInitializer = class {
|
|
|
759
767
|
this.engine.putJSWapiOper(operationName, (jsWapiRequest, jsWapiResponse) => {
|
|
760
768
|
const request = new ApiRequest(jsWapiRequest, this.engine.getName());
|
|
761
769
|
const apiCore = new ApiCore({ http: this.engine, request });
|
|
762
|
-
return this._operations[operationName](
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
objectName: this.engine.getName(),
|
|
769
|
-
externalObject: this.engine.getExternalName(),
|
|
770
|
-
externalFieldsMap: this.engine.getExternalObjectFields()
|
|
771
|
-
}
|
|
772
|
-
);
|
|
770
|
+
return this._operations[operationName](apiCore, request, new ApiResponse(jsWapiResponse, this.engine.getName()), {
|
|
771
|
+
parameters: this.engine.getExternalSystemParameters(),
|
|
772
|
+
objectName: this.engine.getName(),
|
|
773
|
+
externalObject: this.engine.getExternalName(),
|
|
774
|
+
externalFieldsMap: this.engine.getExternalObjectFields()
|
|
775
|
+
});
|
|
773
776
|
});
|
|
774
777
|
}
|
|
775
778
|
/**
|
|
@@ -786,16 +789,39 @@ var EngineInitializer = class {
|
|
|
786
789
|
initTranslation(translations) {
|
|
787
790
|
UserMessages_default.appendDictionary(translations);
|
|
788
791
|
}
|
|
789
|
-
call({
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
792
|
+
call({
|
|
793
|
+
apiCore,
|
|
794
|
+
apiRequest,
|
|
795
|
+
apiResponse,
|
|
796
|
+
operation,
|
|
797
|
+
meta
|
|
798
|
+
}) {
|
|
799
|
+
return this._operations[operation](apiCore, apiRequest, apiResponse, meta);
|
|
796
800
|
}
|
|
797
801
|
};
|
|
802
|
+
|
|
803
|
+
// src/classes/ApiJoinInvoker.ts
|
|
804
|
+
var ApiJoinInvoker = class {
|
|
805
|
+
constructor(jsWapiJoinInvoker) {
|
|
806
|
+
__publicField(this, "_jsWapiJoinInvoker");
|
|
807
|
+
this._jsWapiJoinInvoker = jsWapiJoinInvoker;
|
|
808
|
+
}
|
|
809
|
+
//TODO: implement methods.
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
// src/lib-index.ts
|
|
813
|
+
var lib_index_default = ApiObjectInitializer;
|
|
798
814
|
export {
|
|
799
|
-
|
|
800
|
-
|
|
815
|
+
ApiCore,
|
|
816
|
+
ApiHttpRequest,
|
|
817
|
+
ApiHttpResponse,
|
|
818
|
+
ApiInvoker,
|
|
819
|
+
ApiJoinInvoker,
|
|
820
|
+
ApiObjectCollectionIterator,
|
|
821
|
+
ApiRequest,
|
|
822
|
+
ApiResponse,
|
|
823
|
+
EngineInitializer,
|
|
824
|
+
LanguageCode,
|
|
825
|
+
UserMessages_default as UserMessages,
|
|
826
|
+
lib_index_default as default
|
|
801
827
|
};
|