@colijnit/mainapi 260.1.7 → 260.1.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/build/enum/forms-method-name.enum.d.ts +3 -0
- package/build/enum/forms-method-name.enum.js +7 -0
- package/build/enum/general-method.enum.d.ts +2 -1
- package/build/enum/general-method.enum.js +1 -0
- package/build/enum/module-name.enum.d.ts +2 -1
- package/build/enum/module-name.enum.js +1 -0
- package/build/enum/public-service-method.d.ts +2 -1
- package/build/enum/public-service-method.js +1 -0
- package/build/main-api-connection.d.ts +2 -0
- package/build/main-api.d.ts +2 -0
- package/build/main-api.js +8 -0
- package/build/main-api.unit.test.js +22 -0
- package/build/main-auth.d.ts +2 -0
- package/build/main-auth.js +32 -1
- package/build/main-public.d.ts +2 -0
- package/build/main-public.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormsMethodName = void 0;
|
|
4
|
+
var FormsMethodName;
|
|
5
|
+
(function (FormsMethodName) {
|
|
6
|
+
FormsMethodName["UpsertTransactionLineFormResponse"] = "upsertTransactionLineFormResponse";
|
|
7
|
+
})(FormsMethodName = exports.FormsMethodName || (exports.FormsMethodName = {}));
|
|
@@ -33,5 +33,6 @@ export declare enum GeneralMethod {
|
|
|
33
33
|
MergeTexts = "mergeTexts",
|
|
34
34
|
SelectTextsByTableKey = "selectTextsByTableKey",
|
|
35
35
|
GetResultOfValidationCurrentDatabaseObjectsChecksum = "getResultOfValidationCurrentDatabaseObjectsChecksum",
|
|
36
|
-
PostalCodeRetrieval = "postalCodeRetrieval"
|
|
36
|
+
PostalCodeRetrieval = "postalCodeRetrieval",
|
|
37
|
+
CreateQrCode = "createQRCode"
|
|
37
38
|
}
|
|
@@ -38,4 +38,5 @@ var GeneralMethod;
|
|
|
38
38
|
GeneralMethod["SelectTextsByTableKey"] = "selectTextsByTableKey";
|
|
39
39
|
GeneralMethod["GetResultOfValidationCurrentDatabaseObjectsChecksum"] = "getResultOfValidationCurrentDatabaseObjectsChecksum";
|
|
40
40
|
GeneralMethod["PostalCodeRetrieval"] = "postalCodeRetrieval";
|
|
41
|
+
GeneralMethod["CreateQrCode"] = "createQRCode";
|
|
41
42
|
})(GeneralMethod = exports.GeneralMethod || (exports.GeneralMethod = {}));
|
|
@@ -19,5 +19,6 @@ export declare enum PublicServiceMethod {
|
|
|
19
19
|
Commit = "commit",
|
|
20
20
|
GetScreenConfig = "getScreenconfig",
|
|
21
21
|
GetGoogleTranslateV3 = "getGoogleTranslateV3",
|
|
22
|
-
IsGoogleTranslateEnabled = "isGoogleTranslateEnabled"
|
|
22
|
+
IsGoogleTranslateEnabled = "isGoogleTranslateEnabled",
|
|
23
|
+
CreateQRCode = "createQRCode"
|
|
23
24
|
}
|
|
@@ -24,4 +24,5 @@ var PublicServiceMethod;
|
|
|
24
24
|
PublicServiceMethod["GetScreenConfig"] = "getScreenconfig";
|
|
25
25
|
PublicServiceMethod["GetGoogleTranslateV3"] = "getGoogleTranslateV3";
|
|
26
26
|
PublicServiceMethod["IsGoogleTranslateEnabled"] = "isGoogleTranslateEnabled";
|
|
27
|
+
PublicServiceMethod["CreateQRCode"] = "createQRCode";
|
|
27
28
|
})(PublicServiceMethod = exports.PublicServiceMethod || (exports.PublicServiceMethod = {}));
|
|
@@ -94,4 +94,6 @@ export declare abstract class MainApiConnection {
|
|
|
94
94
|
abstract unlockFormResponse(id: number): Promise<DataServiceResponseData>;
|
|
95
95
|
abstract getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
96
96
|
abstract isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
97
|
+
abstract upsertTransactionLineFormResponse(transUUID: string, transactionLineUUID: string, formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
98
|
+
abstract createQRCode(width: number, height: number, value: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
97
99
|
}
|
package/build/main-api.d.ts
CHANGED
|
@@ -108,6 +108,8 @@ export declare class MainApi {
|
|
|
108
108
|
updateFormResponse(formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
109
109
|
getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
110
110
|
isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
111
|
+
upsertTransactionLineFormResponse(transUUID: string, transactionLineUUID: string, formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
112
|
+
createQRCode(width: number, height: number, value: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
111
113
|
static createConnector(isPublicSession: boolean, sessionExists: boolean): MainApiConnection;
|
|
112
114
|
private _handleConnectionReset;
|
|
113
115
|
}
|
package/build/main-api.js
CHANGED
|
@@ -293,6 +293,14 @@ class MainApi {
|
|
|
293
293
|
isGoogleTranslateEnabled() {
|
|
294
294
|
return this.mainApi.isGoogleTranslateEnabled();
|
|
295
295
|
}
|
|
296
|
+
upsertTransactionLineFormResponse(transUUID, transactionLineUUID, formResponse) {
|
|
297
|
+
return this.mainApi.upsertTransactionLineFormResponse(transUUID, transactionLineUUID, formResponse);
|
|
298
|
+
}
|
|
299
|
+
createQRCode(width, height, value, showLoader) {
|
|
300
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
return this.mainApi.createQRCode(width, height, value, showLoader);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
296
304
|
static createConnector(isPublicSession, sessionExists) {
|
|
297
305
|
if (!isPublicSession || sessionExists) {
|
|
298
306
|
return new main_auth_1.MainAuth();
|
|
@@ -16,6 +16,7 @@ const preset_bo_1 = require("./model/preset.bo");
|
|
|
16
16
|
const report_type_enum_1 = require("./enum/report-type.enum");
|
|
17
17
|
const internal_param_enum_1 = require("./enum/internal-param.enum");
|
|
18
18
|
const table_name_enum_1 = require("./enum/table-name.enum");
|
|
19
|
+
const form_response_bo_1 = require("./model/form-response.bo");
|
|
19
20
|
const options = {
|
|
20
21
|
url: 'http'
|
|
21
22
|
};
|
|
@@ -158,6 +159,19 @@ describe("Connector", () => {
|
|
|
158
159
|
const result = yield connector.unlockFormResponse(295);
|
|
159
160
|
expect(result).toBeDefined();
|
|
160
161
|
}));
|
|
162
|
+
it('upsertTransactionLineFormResponse', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
163
|
+
yield connector.connect();
|
|
164
|
+
let lineUUID = "";
|
|
165
|
+
let transUUID = "";
|
|
166
|
+
let formResponse = new form_response_bo_1.FormResponse();
|
|
167
|
+
const result = yield connector.upsertTransactionLineFormResponse(transUUID, lineUUID, formResponse);
|
|
168
|
+
expect(result).toBeDefined();
|
|
169
|
+
}));
|
|
170
|
+
it('getFormResponseById', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
171
|
+
yield connector.connect();
|
|
172
|
+
const result = yield connector.getFormResponse(295);
|
|
173
|
+
expect(result).toBeDefined();
|
|
174
|
+
}));
|
|
161
175
|
it('getGoogleTranslation', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
162
176
|
yield connector.connect();
|
|
163
177
|
const sourceLang = 'NL';
|
|
@@ -171,4 +185,12 @@ describe("Connector", () => {
|
|
|
171
185
|
const result = yield connector.isGoogleTranslateEnabled();
|
|
172
186
|
expect(result).toBeDefined();
|
|
173
187
|
}));
|
|
188
|
+
it('createQrCode', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
189
|
+
yield connector.connect();
|
|
190
|
+
const height = 480;
|
|
191
|
+
const width = 480;
|
|
192
|
+
const value = "https://google.com";
|
|
193
|
+
const result = yield connector.createQRCode(width, height, value);
|
|
194
|
+
expect(result).toBeDefined();
|
|
195
|
+
}));
|
|
174
196
|
});
|
package/build/main-auth.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export declare class MainAuth extends MainApiConnection {
|
|
|
82
82
|
getFormById(formId: number): Promise<DataServiceResponseData>;
|
|
83
83
|
getFormResponse(formResponseId: number): Promise<DataServiceResponseData>;
|
|
84
84
|
getAllFormResponsesForTableAndKey(table: TableName, key: string): Promise<DataServiceResponseData>;
|
|
85
|
+
upsertTransactionLineFormResponse(transUUID: string, transactionLineUUID: string, formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
85
86
|
lockFormResponse(id: number): Promise<DataServiceResponseData>;
|
|
86
87
|
unlockFormResponse(id: number): Promise<DataServiceResponseData>;
|
|
87
88
|
insertFormResponse(formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
@@ -89,6 +90,7 @@ export declare class MainAuth extends MainApiConnection {
|
|
|
89
90
|
getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
90
91
|
isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
91
92
|
selectMultiple(moduleName: ModuleName, objectName: string, operationName?: string, parameterValues?: any, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
93
|
+
createQRCode(width: number, height: number, value: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
92
94
|
private _call;
|
|
93
95
|
private _callGetSingleImage;
|
|
94
96
|
private _handleDocumentBody;
|
package/build/main-auth.js
CHANGED
|
@@ -44,6 +44,7 @@ const article_method_enum_1 = require("./enum/article-method.enum");
|
|
|
44
44
|
const file_utils_1 = require("./utils/file-utils");
|
|
45
45
|
const image_content_bo_1 = require("./model/image-content.bo");
|
|
46
46
|
const forms_object_name_enum_1 = require("./enum/forms-object-name.enum");
|
|
47
|
+
const forms_method_name_enum_1 = require("./enum/forms-method-name.enum");
|
|
47
48
|
class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
48
49
|
constructor() {
|
|
49
50
|
super(...arguments);
|
|
@@ -762,7 +763,7 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
|
762
763
|
refCursorAsArray: true,
|
|
763
764
|
objectId: formResponseId
|
|
764
765
|
};
|
|
765
|
-
return this._call(data_service_method_enum_1.DataServiceMethod.
|
|
766
|
+
return this._call(data_service_method_enum_1.DataServiceMethod.SelectSingleObject, data);
|
|
766
767
|
}
|
|
767
768
|
getAllFormResponsesForTableAndKey(table, key) {
|
|
768
769
|
const params = {
|
|
@@ -777,6 +778,20 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
|
777
778
|
};
|
|
778
779
|
return this._call(data_service_method_enum_1.DataServiceMethod.SelectMultipleObjects, data);
|
|
779
780
|
}
|
|
781
|
+
upsertTransactionLineFormResponse(transUUID, transactionLineUUID, formResponse) {
|
|
782
|
+
const params = {
|
|
783
|
+
lineUuid: transactionLineUUID,
|
|
784
|
+
transactionUuid: transUUID,
|
|
785
|
+
formResponseDTO: formResponse
|
|
786
|
+
};
|
|
787
|
+
const data = {
|
|
788
|
+
moduleName: module_name_enum_1.ModuleName.Transaction,
|
|
789
|
+
methodName: forms_method_name_enum_1.FormsMethodName.UpsertTransactionLineFormResponse,
|
|
790
|
+
parameterValues: params,
|
|
791
|
+
refCursorAsArray: true
|
|
792
|
+
};
|
|
793
|
+
return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data, backend_service_name_enum_1.BackendServiceName.DataService);
|
|
794
|
+
}
|
|
780
795
|
lockFormResponse(id) {
|
|
781
796
|
const data = {
|
|
782
797
|
moduleName: module_name_enum_1.ModuleName.Forms,
|
|
@@ -855,6 +870,22 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
|
855
870
|
}
|
|
856
871
|
return this._call(data_service_method_enum_1.DataServiceMethod.SelectMultipleObjects, data, backend_service_name_enum_1.BackendServiceName.DataService, showLoader);
|
|
857
872
|
}
|
|
873
|
+
createQRCode(width, height, value, showLoader) {
|
|
874
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
875
|
+
const params = {
|
|
876
|
+
width: width,
|
|
877
|
+
height: height,
|
|
878
|
+
value: value
|
|
879
|
+
};
|
|
880
|
+
const data = {
|
|
881
|
+
moduleName: module_name_enum_1.ModuleName.General,
|
|
882
|
+
methodName: general_method_enum_1.GeneralMethod.CreateQrCode,
|
|
883
|
+
parameterValues: params,
|
|
884
|
+
refCursorAsArray: true,
|
|
885
|
+
};
|
|
886
|
+
return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data, backend_service_name_enum_1.BackendServiceName.DataService, showLoader);
|
|
887
|
+
});
|
|
888
|
+
}
|
|
858
889
|
_call(method, data, service = backend_service_name_enum_1.BackendServiceName.DataService, showLoader = false) {
|
|
859
890
|
return __awaiter(this, void 0, void 0, function* () {
|
|
860
891
|
return this.connector.call(method, data, showLoader, service);
|
package/build/main-public.d.ts
CHANGED
|
@@ -82,12 +82,14 @@ export declare class MainPublic extends MainApiConnection {
|
|
|
82
82
|
unlockFormResponse(id: number): Promise<DataServiceResponseData>;
|
|
83
83
|
insertFormResponse(formResponse: FormResponse, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
84
84
|
updateFormResponse(formResponse: FormResponse, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
85
|
+
upsertTransactionLineFormResponse(transUUID: string, transactionLineUUID: string, formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
85
86
|
getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
86
87
|
isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
87
88
|
selectMultiple(moduleName: ModuleName, objectName: string, operationName?: string, parameterValues?: any, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
88
89
|
getSingleImage(nodeId: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean, tableName?: TableName): Promise<DataServiceResponseData>;
|
|
89
90
|
getImage(key: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean): Promise<DataServiceResponseData>;
|
|
90
91
|
getImageForCoDocument(document: CoDocument, thumb?: boolean): Promise<DataServiceResponseData>;
|
|
92
|
+
createQRCode(width: number, height: number, value: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
91
93
|
private createServiceRequestData;
|
|
92
94
|
private _call;
|
|
93
95
|
private _callAjaxService;
|
package/build/main-public.js
CHANGED
|
@@ -336,6 +336,10 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
|
|
|
336
336
|
console.warn('updateFormResponse not implemented');
|
|
337
337
|
return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
|
|
338
338
|
}
|
|
339
|
+
upsertTransactionLineFormResponse(transUUID, transactionLineUUID, formResponse) {
|
|
340
|
+
console.warn('upsertTransactionLineFormResponse not implemented');
|
|
341
|
+
return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
|
|
342
|
+
}
|
|
339
343
|
getGoogleTranslation(sourceLanguageCode, targetLanguageCode, toTranslateList) {
|
|
340
344
|
const params = {
|
|
341
345
|
sourceLanguageCode: sourceLanguageCode,
|
|
@@ -390,6 +394,12 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
|
|
|
390
394
|
return this._handleCoDocumentRequest(type, fileType, hasPublicAccess, document.documentId, document.mimeTypeInternal, thumb, document.filePath);
|
|
391
395
|
}
|
|
392
396
|
}
|
|
397
|
+
createQRCode(width, height, value, showLoader) {
|
|
398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
399
|
+
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { width: width, height: height, value: value, showLoader: showLoader });
|
|
400
|
+
return this._call(public_service_method_1.PublicServiceMethod.CreateQRCode, data);
|
|
401
|
+
});
|
|
402
|
+
}
|
|
393
403
|
createServiceRequestData() {
|
|
394
404
|
const data = { languageCode: this.languageCode };
|
|
395
405
|
return data;
|