@colijnit/mainapi 260.1.6 → 260.1.8
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/file-type.enum.d.ts +2 -1
- package/build/enum/file-type.enum.js +1 -0
- package/build/enum/forms-method-name.enum.d.ts +3 -0
- package/build/enum/forms-method-name.enum.js +7 -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 +3 -1
- package/build/enum/public-service-method.js +2 -0
- package/build/main-api-connection.d.ts +3 -0
- package/build/main-api.d.ts +3 -0
- package/build/main-api.js +9 -0
- package/build/main-api.unit.test.js +36 -3
- package/build/main-auth.d.ts +3 -0
- package/build/main-auth.js +42 -1
- package/build/main-public.d.ts +3 -0
- package/build/main-public.js +18 -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 = {}));
|
|
@@ -17,5 +17,7 @@ export declare enum PublicServiceMethod {
|
|
|
17
17
|
GetSequenceValue = "getSequenceValue",
|
|
18
18
|
PostalCodeRetrieval = "postalCodeRetrieval",
|
|
19
19
|
Commit = "commit",
|
|
20
|
-
GetScreenConfig = "getScreenconfig"
|
|
20
|
+
GetScreenConfig = "getScreenconfig",
|
|
21
|
+
GetGoogleTranslateV3 = "getGoogleTranslateV3",
|
|
22
|
+
IsGoogleTranslateEnabled = "isGoogleTranslateEnabled"
|
|
21
23
|
}
|
|
@@ -22,4 +22,6 @@ var PublicServiceMethod;
|
|
|
22
22
|
PublicServiceMethod["PostalCodeRetrieval"] = "postalCodeRetrieval";
|
|
23
23
|
PublicServiceMethod["Commit"] = "commit";
|
|
24
24
|
PublicServiceMethod["GetScreenConfig"] = "getScreenconfig";
|
|
25
|
+
PublicServiceMethod["GetGoogleTranslateV3"] = "getGoogleTranslateV3";
|
|
26
|
+
PublicServiceMethod["IsGoogleTranslateEnabled"] = "isGoogleTranslateEnabled";
|
|
25
27
|
})(PublicServiceMethod = exports.PublicServiceMethod || (exports.PublicServiceMethod = {}));
|
|
@@ -92,4 +92,7 @@ export declare abstract class MainApiConnection {
|
|
|
92
92
|
abstract getAllFormResponsesForTableAndKey(table: TableName, key: string): Promise<DataServiceResponseData>;
|
|
93
93
|
abstract lockFormResponse(id: number): Promise<DataServiceResponseData>;
|
|
94
94
|
abstract unlockFormResponse(id: number): Promise<DataServiceResponseData>;
|
|
95
|
+
abstract getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
96
|
+
abstract isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
97
|
+
abstract upsertTransactionLineFormResponse(transUUID: string, transactionLineUUID: string, formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
95
98
|
}
|
package/build/main-api.d.ts
CHANGED
|
@@ -106,6 +106,9 @@ export declare class MainApi {
|
|
|
106
106
|
unlockFormResponse(id: number): Promise<DataServiceResponseData>;
|
|
107
107
|
insertFormResponse(formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
108
108
|
updateFormResponse(formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
109
|
+
getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
110
|
+
isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
111
|
+
upsertTransactionLineFormResponse(transUUID: string, transactionLineUUID: string, formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
109
112
|
static createConnector(isPublicSession: boolean, sessionExists: boolean): MainApiConnection;
|
|
110
113
|
private _handleConnectionReset;
|
|
111
114
|
}
|
package/build/main-api.js
CHANGED
|
@@ -287,6 +287,15 @@ class MainApi {
|
|
|
287
287
|
updateFormResponse(formResponse) {
|
|
288
288
|
return this.mainApi.updateFormResponse(formResponse);
|
|
289
289
|
}
|
|
290
|
+
getGoogleTranslation(sourceLanguageCode, targetLanguageCode, toTranslateList) {
|
|
291
|
+
return this.mainApi.getGoogleTranslation(sourceLanguageCode, targetLanguageCode, toTranslateList);
|
|
292
|
+
}
|
|
293
|
+
isGoogleTranslateEnabled() {
|
|
294
|
+
return this.mainApi.isGoogleTranslateEnabled();
|
|
295
|
+
}
|
|
296
|
+
upsertTransactionLineFormResponse(transUUID, transactionLineUUID, formResponse) {
|
|
297
|
+
return this.mainApi.upsertTransactionLineFormResponse(transUUID, transactionLineUUID, formResponse);
|
|
298
|
+
}
|
|
290
299
|
static createConnector(isPublicSession, sessionExists) {
|
|
291
300
|
if (!isPublicSession || sessionExists) {
|
|
292
301
|
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
|
};
|
|
@@ -28,12 +29,18 @@ const localOptions = {
|
|
|
28
29
|
password: "vankeulen1234567890!",
|
|
29
30
|
};
|
|
30
31
|
const remoteOptions = {
|
|
31
|
-
url: "
|
|
32
|
+
url: "https://develop.colijn-it.nl/",
|
|
32
33
|
schema: "815",
|
|
33
|
-
version: "
|
|
34
|
+
version: "260",
|
|
34
35
|
useLoginEncryption: true,
|
|
35
36
|
username: "patrick",
|
|
36
|
-
password: "
|
|
37
|
+
password: "vankeulen1234567890!"
|
|
38
|
+
};
|
|
39
|
+
const publicOptions = {
|
|
40
|
+
url: "https://develop.colijn-it.nl/",
|
|
41
|
+
schema: "815",
|
|
42
|
+
version: "260",
|
|
43
|
+
useLoginEncryption: false,
|
|
37
44
|
};
|
|
38
45
|
describe("Connector", () => {
|
|
39
46
|
let connector;
|
|
@@ -152,4 +159,30 @@ describe("Connector", () => {
|
|
|
152
159
|
const result = yield connector.unlockFormResponse(295);
|
|
153
160
|
expect(result).toBeDefined();
|
|
154
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
|
+
}));
|
|
175
|
+
it('getGoogleTranslation', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
176
|
+
yield connector.connect();
|
|
177
|
+
const sourceLang = 'NL';
|
|
178
|
+
const targetLang = 'EN';
|
|
179
|
+
const list = ['stofgroep'];
|
|
180
|
+
const result = yield connector.getGoogleTranslation(sourceLang, targetLang, list);
|
|
181
|
+
expect(result).toBeDefined();
|
|
182
|
+
}));
|
|
183
|
+
it('isGoogleTranslateEnabled', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
184
|
+
yield connector.connect();
|
|
185
|
+
const result = yield connector.isGoogleTranslateEnabled();
|
|
186
|
+
expect(result).toBeDefined();
|
|
187
|
+
}));
|
|
155
188
|
});
|
package/build/main-auth.d.ts
CHANGED
|
@@ -82,10 +82,13 @@ 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>;
|
|
88
89
|
updateFormResponse(formResponse: FormResponse): Promise<DataServiceResponseData>;
|
|
90
|
+
getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
91
|
+
isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
89
92
|
selectMultiple(moduleName: ModuleName, objectName: string, operationName?: string, parameterValues?: any, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
90
93
|
private _call;
|
|
91
94
|
private _callGetSingleImage;
|
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,
|
|
@@ -813,6 +828,32 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
|
|
|
813
828
|
};
|
|
814
829
|
return this._call(data_service_method_enum_1.DataServiceMethod.UpdateObject, data);
|
|
815
830
|
}
|
|
831
|
+
getGoogleTranslation(sourceLanguageCode, targetLanguageCode, toTranslateList) {
|
|
832
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
833
|
+
const params = {
|
|
834
|
+
sourceLanguageCode: sourceLanguageCode,
|
|
835
|
+
targetLanguageCode: targetLanguageCode,
|
|
836
|
+
toTranslateList: toTranslateList
|
|
837
|
+
};
|
|
838
|
+
const data = {
|
|
839
|
+
methodName: public_service_method_1.PublicServiceMethod.GetGoogleTranslateV3,
|
|
840
|
+
moduleName: backend_service_name_enum_1.BackendServiceName.PublicService,
|
|
841
|
+
refCursorAsArray: true,
|
|
842
|
+
parameterValues: params
|
|
843
|
+
};
|
|
844
|
+
return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data);
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
isGoogleTranslateEnabled() {
|
|
848
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
849
|
+
const data = {
|
|
850
|
+
methodName: public_service_method_1.PublicServiceMethod.IsGoogleTranslateEnabled,
|
|
851
|
+
moduleName: backend_service_name_enum_1.BackendServiceName.PublicService,
|
|
852
|
+
refCursorAsArray: true
|
|
853
|
+
};
|
|
854
|
+
return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data);
|
|
855
|
+
});
|
|
856
|
+
}
|
|
816
857
|
selectMultiple(moduleName, objectName, operationName, parameterValues, showLoader) {
|
|
817
858
|
if (showLoader === undefined) {
|
|
818
859
|
showLoader = false;
|
package/build/main-public.d.ts
CHANGED
|
@@ -82,6 +82,9 @@ 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>;
|
|
86
|
+
getGoogleTranslation(sourceLanguageCode: string, targetLanguageCode: string, toTranslateList: string[]): Promise<DataServiceResponseData>;
|
|
87
|
+
isGoogleTranslateEnabled(): Promise<DataServiceResponseData>;
|
|
85
88
|
selectMultiple(moduleName: ModuleName, objectName: string, operationName?: string, parameterValues?: any, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
86
89
|
getSingleImage(nodeId: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean, tableName?: TableName): Promise<DataServiceResponseData>;
|
|
87
90
|
getImage(key: number | string, publication?: number, includeMimetype?: boolean, thumb?: boolean): Promise<DataServiceResponseData>;
|
package/build/main-public.js
CHANGED
|
@@ -336,6 +336,24 @@ 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
|
+
}
|
|
343
|
+
getGoogleTranslation(sourceLanguageCode, targetLanguageCode, toTranslateList) {
|
|
344
|
+
const params = {
|
|
345
|
+
sourceLanguageCode: sourceLanguageCode,
|
|
346
|
+
targetLanguageCode: targetLanguageCode,
|
|
347
|
+
toTranslateList: toTranslateList
|
|
348
|
+
};
|
|
349
|
+
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
350
|
+
return this._call(public_service_method_1.PublicServiceMethod.GetGoogleTranslateV3, data);
|
|
351
|
+
}
|
|
352
|
+
isGoogleTranslateEnabled() {
|
|
353
|
+
const params = {};
|
|
354
|
+
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
355
|
+
return this._call(public_service_method_1.PublicServiceMethod.IsGoogleTranslateEnabled, data);
|
|
356
|
+
}
|
|
339
357
|
selectMultiple(moduleName, objectName, operationName, parameterValues, showLoader) {
|
|
340
358
|
console.warn('getOrderLineSetCategories not implemented');
|
|
341
359
|
return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
|