@colijnit/mainapi 1.0.6 → 1.0.7

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.
@@ -2,5 +2,6 @@ export declare enum ModuleName {
2
2
  General = "General",
3
3
  Report = "Report",
4
4
  ReportingDocuments = "ReportingDocuments",
5
- Tags = "Tags"
5
+ Tags = "Tags",
6
+ SimpleBaseData = "SimpleBaseData"
6
7
  }
@@ -7,4 +7,5 @@ var ModuleName;
7
7
  ModuleName["Report"] = "Report";
8
8
  ModuleName["ReportingDocuments"] = "ReportingDocuments";
9
9
  ModuleName["Tags"] = "Tags";
10
+ ModuleName["SimpleBaseData"] = "SimpleBaseData";
10
11
  })(ModuleName = exports.ModuleName || (exports.ModuleName = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum SimpleBaseDataObjectName {
2
+ Currency = "Currency",
3
+ PaymentCondition = "PaymentCondition"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimpleBaseDataObjectName = void 0;
4
+ var SimpleBaseDataObjectName;
5
+ (function (SimpleBaseDataObjectName) {
6
+ SimpleBaseDataObjectName["Currency"] = "Currency";
7
+ SimpleBaseDataObjectName["PaymentCondition"] = "PaymentCondition";
8
+ })(SimpleBaseDataObjectName = exports.SimpleBaseDataObjectName || (exports.SimpleBaseDataObjectName = {}));
@@ -0,0 +1,3 @@
1
+ export declare enum SimpleBaseDataOperationName {
2
+ Default = "default"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimpleBaseDataOperationName = void 0;
4
+ var SimpleBaseDataOperationName;
5
+ (function (SimpleBaseDataOperationName) {
6
+ SimpleBaseDataOperationName["Default"] = "default";
7
+ })(SimpleBaseDataOperationName = exports.SimpleBaseDataOperationName || (exports.SimpleBaseDataOperationName = {}));
@@ -14,6 +14,8 @@ export declare abstract class MainApiConnection {
14
14
  abstract listAllPrinters(): Promise<DataServiceResponseData>;
15
15
  abstract getSendMethods(): Promise<DataServiceResponseData>;
16
16
  abstract getDocumentContent(id: number, thumbnail: boolean): Promise<DataServiceResponseData>;
17
+ abstract getCurrencies(active: boolean): Promise<DataServiceResponseData>;
18
+ abstract getPaymentConditions(name: string): Promise<DataServiceResponseData>;
17
19
  abstract getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
18
20
  abstract getInternalParameterValue(param: InternalParam): Promise<DataServiceResponseData>;
19
21
  abstract getPackageStickerPrintLayouts(): Promise<DataServiceResponseData>;
@@ -25,6 +25,8 @@ export declare class MainApi {
25
25
  listAllPrinters(): Promise<DataServiceResponseData>;
26
26
  getSendMethods(): Promise<DataServiceResponseData>;
27
27
  getDocumentContent(id: number, thumbnail?: boolean): Promise<DataServiceResponseData>;
28
+ getCurrencies(active?: boolean): Promise<DataServiceResponseData>;
29
+ getPaymentConditions(name?: string): Promise<DataServiceResponseData>;
28
30
  getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
29
31
  getInternalParameterValue(param: InternalParam): Promise<DataServiceResponseData>;
30
32
  getPackageStickerPrintLayouts(): Promise<DataServiceResponseData>;
package/build/main-api.js CHANGED
@@ -56,6 +56,12 @@ class MainApi {
56
56
  getDocumentContent(id, thumbnail = true) {
57
57
  return this.mainApi.getDocumentContent(id, thumbnail);
58
58
  }
59
+ getCurrencies(active = true) {
60
+ return this.mainApi.getCurrencies(active);
61
+ }
62
+ getPaymentConditions(name) {
63
+ return this.mainApi.getPaymentConditions(name);
64
+ }
59
65
  getJoinedTags(table, key) {
60
66
  return this.mainApi.getJoinedTags(table, key);
61
67
  }
@@ -34,7 +34,7 @@ const remoteOptions = {
34
34
  describe("Connector", () => {
35
35
  let connector;
36
36
  beforeEach(() => {
37
- connector = new main_api_1.MainApi(remoteOptions);
37
+ connector = new main_api_1.MainApi(localOptions);
38
38
  jest.setTimeout(1300000);
39
39
  });
40
40
  it('getSequenceValue', () => __awaiter(void 0, void 0, void 0, function* () {
@@ -55,6 +55,19 @@ describe("Connector", () => {
55
55
  const result = yield connector.getJoinedTags(table, key);
56
56
  expect(result).toBeDefined();
57
57
  }));
58
+ it('getCurrencies', () => __awaiter(void 0, void 0, void 0, function* () {
59
+ const result = yield connector.getCurrencies(false);
60
+ expect(result).toBeDefined();
61
+ }));
62
+ it('getAllPaymentConditions', () => __awaiter(void 0, void 0, void 0, function* () {
63
+ const result = yield connector.getPaymentConditions();
64
+ expect(result).toBeDefined();
65
+ }));
66
+ it('get0000PaymentConditions', () => __awaiter(void 0, void 0, void 0, function* () {
67
+ const name = '0000';
68
+ const result = yield connector.getPaymentConditions(name);
69
+ expect(result.resultObjects).toHaveLength(1);
70
+ }));
58
71
  it('getPackageStickerPrintLayouts', () => __awaiter(void 0, void 0, void 0, function* () {
59
72
  const result = yield connector.getPackageStickerPrintLayouts();
60
73
  expect(result).toBeDefined();
@@ -8,6 +8,8 @@ export declare class MainAuth extends MainApiConnection {
8
8
  listAllPrinters(): Promise<DataServiceResponseData>;
9
9
  getSendMethods(): Promise<DataServiceResponseData>;
10
10
  getDocumentContent(id: number, thumbnail?: boolean): Promise<DataServiceResponseData>;
11
+ getCurrencies(active?: boolean): Promise<DataServiceResponseData>;
12
+ getPaymentConditions(name?: string): Promise<DataServiceResponseData>;
11
13
  getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
12
14
  getInternalParameterValue(param: InternalParam): Promise<DataServiceResponseData>;
13
15
  getPackageStickerPrintLayouts(): Promise<DataServiceResponseData>;
@@ -20,6 +20,8 @@ const business_object_serializer_1 = require("@colijnit/ioneconnector/build/fact
20
20
  const reporting_documents_method_enum_1 = require("./enum/reporting-documents-method.enum");
21
21
  const report_method_enum_1 = require("./enum/report-method.enum");
22
22
  const tag_method_enum_1 = require("./enum/tag-method.enum");
23
+ const simple_base_data_object_name_enum_1 = require("./enum/simple-base-data-object-name.enum");
24
+ const simple_base_data_operation_name_enum_1 = require("./enum/simple-base-data-operation-name.enum");
23
25
  class MainAuth extends main_api_connection_1.MainApiConnection {
24
26
  constructor() {
25
27
  super(...arguments);
@@ -78,6 +80,24 @@ class MainAuth extends main_api_connection_1.MainApiConnection {
78
80
  };
79
81
  return this._call(data_service_method_enum_1.DataServiceMethod.ExecuteMethod, data);
80
82
  }
83
+ getCurrencies(active = true) {
84
+ if (active) {
85
+ const params = {
86
+ active: true
87
+ };
88
+ return this.selectMultiple(module_name_enum_1.ModuleName.SimpleBaseData, simple_base_data_object_name_enum_1.SimpleBaseDataObjectName.Currency, simple_base_data_operation_name_enum_1.SimpleBaseDataOperationName.Default, params);
89
+ }
90
+ else {
91
+ return this.selectMultiple(module_name_enum_1.ModuleName.SimpleBaseData, simple_base_data_object_name_enum_1.SimpleBaseDataObjectName.Currency);
92
+ }
93
+ }
94
+ getPaymentConditions(name) {
95
+ const params = {};
96
+ if (name) {
97
+ params.condition = name;
98
+ }
99
+ return this.selectMultiple(module_name_enum_1.ModuleName.SimpleBaseData, simple_base_data_object_name_enum_1.SimpleBaseDataObjectName.PaymentCondition, "", params);
100
+ }
81
101
  getJoinedTags(table, key) {
82
102
  const inputParams = {
83
103
  table: table,
@@ -10,6 +10,8 @@ export declare class MainPublic extends MainApiConnection {
10
10
  getDocumentContent(id: number, thumbnail: boolean): Promise<DataServiceResponseData>;
11
11
  getInternalParameterValue(param: InternalParam): Promise<DataServiceResponseData>;
12
12
  getPackageStickerPrintLayouts(): Promise<DataServiceResponseData>;
13
+ getCurrencies(active?: boolean): Promise<DataServiceResponseData>;
14
+ getPaymentConditions(name?: string): Promise<DataServiceResponseData>;
13
15
  getJoinedTags(table: string, key: string): Promise<DataServiceResponseData>;
14
16
  private createServiceRequestData;
15
17
  private _call;
@@ -49,6 +49,14 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
49
49
  console.warn('getInternalParameterValue not implemented');
50
50
  return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
51
51
  }
52
+ getCurrencies(active = true) {
53
+ console.warn('getCurrencies not implemented');
54
+ return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
55
+ }
56
+ getPaymentConditions(name) {
57
+ console.warn('getPaymentConditions not implemented');
58
+ return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
59
+ }
52
60
  getJoinedTags(table, key) {
53
61
  console.warn('getJoinedTags not implemented');
54
62
  return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
@@ -0,0 +1,13 @@
1
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
2
+ export declare class Currency extends BusinessObject {
3
+ id: number;
4
+ code: string;
5
+ unit: string;
6
+ exchangeRate: number;
7
+ startDate: Date;
8
+ endDate: Date;
9
+ numberOfDecimals: number;
10
+ symbol: number;
11
+ typeOfRate: string;
12
+ isoCode: string;
13
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Currency = void 0;
13
+ const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
14
+ const date_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/date-field.decorator");
15
+ const business_object_data_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/business-object-data.decorator");
16
+ const data_mapping_enum_1 = require("../enum/data-mapping.enum");
17
+ let Currency = class Currency extends business_object_1.BusinessObject {
18
+ };
19
+ __decorate([
20
+ date_field_decorator_1.DateField(),
21
+ __metadata("design:type", Date)
22
+ ], Currency.prototype, "startDate", void 0);
23
+ __decorate([
24
+ date_field_decorator_1.DateField(),
25
+ __metadata("design:type", Date)
26
+ ], Currency.prototype, "endDate", void 0);
27
+ Currency = __decorate([
28
+ business_object_data_decorator_1.BusinessObjectData({
29
+ name: "Currency",
30
+ mapping: data_mapping_enum_1.DataMapping.Simplebasedata
31
+ })
32
+ ], Currency);
33
+ exports.Currency = Currency;
@@ -0,0 +1,6 @@
1
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
2
+ export declare class PaymentConditionLedgerAccount extends BusinessObject {
3
+ adminId: any;
4
+ ledgerId: number;
5
+ costCenterId: number;
6
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentConditionLedgerAccount = void 0;
4
+ const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
5
+ class PaymentConditionLedgerAccount extends business_object_1.BusinessObject {
6
+ }
7
+ exports.PaymentConditionLedgerAccount = PaymentConditionLedgerAccount;
@@ -0,0 +1,11 @@
1
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
2
+ import { PaymentConditionLedgerAccount } from './payment-condition-ledger-account.bo';
3
+ export declare class PaymentCondition extends BusinessObject {
4
+ condition: string;
5
+ description: string;
6
+ daysLater: number;
7
+ type: string;
8
+ maturities: number;
9
+ percentage: number;
10
+ ledgers: PaymentConditionLedgerAccount[];
11
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PaymentCondition = void 0;
13
+ const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
14
+ const complex_array_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator");
15
+ const payment_condition_ledger_account_bo_1 = require("./payment-condition-ledger-account.bo");
16
+ const business_object_data_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/business-object-data.decorator");
17
+ const data_mapping_enum_1 = require("../enum/data-mapping.enum");
18
+ let PaymentCondition = class PaymentCondition extends business_object_1.BusinessObject {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.ledgers = [];
22
+ }
23
+ };
24
+ __decorate([
25
+ complex_array_decorator_1.ComplexArray(payment_condition_ledger_account_bo_1.PaymentConditionLedgerAccount),
26
+ __metadata("design:type", Array)
27
+ ], PaymentCondition.prototype, "ledgers", void 0);
28
+ PaymentCondition = __decorate([
29
+ business_object_data_decorator_1.BusinessObjectData({
30
+ name: "PaymentCondition",
31
+ mapping: data_mapping_enum_1.DataMapping.Simplebasedata
32
+ })
33
+ ], PaymentCondition);
34
+ exports.PaymentCondition = PaymentCondition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/mainapi",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "scripts": {
5
5
  "build": "grunt clean && tsc",
6
6
  "browserify": "browserify build/connector.js --s colijn -o dist/out-tsc/bundle.js",
@@ -36,6 +36,7 @@
36
36
  "grunt-contrib-uglify-es": "git+https://github.com/gruntjs/grunt-contrib-uglify.git#harmony",
37
37
  "gulp": "^3.9.1",
38
38
  "jest": "^24.8.0",
39
+ "request": "2.34.0",
39
40
  "ts-jest": "^24.0.2",
40
41
  "typescript": "4.3.5"
41
42
  },