zudello-integration-sdk 1.0.38 → 1.0.39

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": "zudello-integration-sdk",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "Zudello Integrations SDK",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
package/src/index.js CHANGED
@@ -10,8 +10,10 @@ const ZenotiSDK = require('./sdk/Zenoti')
10
10
  const DearSDK = require('./sdk/Dear')
11
11
  const NexviaSDK = require('./sdk/Nexvia')
12
12
  const FoSDK = require('./sdk/Fo')
13
+ const NavisionSDK = require('./sdk/Navision')
13
14
  const RetailExpressSDK = require('./sdk/RetailExpress')
14
15
  const MYOBAcumaticaSDK = require('./sdk/MYOBAcumatica')
16
+ const MYOBAccountRightSDK = require('./sdk/MYOBAccountRight')
15
17
  const SybizSDK = require('./sdk/Sybiz')
16
18
  const XeroSDK = require('./sdk/Xero')
17
19
  const JobReadySDK = require('./sdk/JobReady')
@@ -19,6 +21,7 @@ const X3SDK = require('./sdk/X3')
19
21
  const SAPB1SDK = require('./sdk/SAPB1')
20
22
  const GPSDK = require('./sdk/GP')
21
23
  const EDISDK = require('./sdk/EDI')
24
+ const SunSystemsSDK = require('./sdk/SunSystems')
22
25
 
23
26
  const Logger = require('./utils/logger')
24
27
  const Metadata = require('./utils/metadata')
@@ -59,6 +62,7 @@ module.exports = {
59
62
  ZenotiSDK,
60
63
  DearSDK,
61
64
  NexviaSDK,
65
+ NavisionSDK,
62
66
  GPSDK,
63
67
  SAPB1SDK,
64
68
  EDISDK,
@@ -66,7 +70,9 @@ module.exports = {
66
70
  FoSDK,
67
71
  RetailExpressSDK,
68
72
  MYOBAcumaticaSDK,
73
+ MYOBAccountRightSDK,
69
74
  SybizSDK,
75
+ SunSystemsSDK,
70
76
  XeroSDK,
71
77
  JobReadySDK,
72
78
  Logger,
@@ -32,6 +32,7 @@ const VendorGroupModule = require("./submodules/intacct/VendorGroup");
32
32
  const WarehouseModule = require("./submodules/intacct/Warehouse");
33
33
  const ApBillModule = require("./submodules/intacct/ApBill");
34
34
  const ApAdjustmentModule = require("./submodules/intacct/ApAdjustment");
35
+ const ArPaymentModule = require("./submodules/intacct/ArPayment");
35
36
  const PoDocumentModule = require("./submodules/intacct/PoDocument");
36
37
  const ArTermModule = require("./submodules/intacct/ArTerm");
37
38
  const ArInvoiceModule = require("./submodules/intacct/ArInvoice");
@@ -96,6 +97,7 @@ class IntacctSDK extends BaseSDK {
96
97
  this.arTerm = new ArTermModule(this);
97
98
  this.arInvoice = new ArInvoiceModule(this);
98
99
  this.arAdjustment = new ArAdjustmentModule(this);
100
+ this.arPayment = new ArPaymentModule(this);
99
101
  this.journal = new JournalModule(this);
100
102
  this.zone = new ZoneModule(this);
101
103
  this.file = new FileModule(this);
@@ -3,7 +3,7 @@
3
3
  const BaseSDK = require('./Base')
4
4
  const UniversalModule = require('./submodules/jobready/Universal')
5
5
 
6
- class JobReady extends BaseSDK {
6
+ class JobReadySDK extends BaseSDK {
7
7
  /**
8
8
  * Constructor.
9
9
  * @param {class} auth Auth class object with authorized api instance.
@@ -28,4 +28,4 @@ class JobReady extends BaseSDK {
28
28
  }
29
29
  }
30
30
 
31
- module.exports = JobReady
31
+ module.exports = JobReadySDK
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/myobAccountRight/Universal')
5
+
6
+ class MYOBAccountRightSDK extends BaseSDK {
7
+ /**
8
+ * Constructor.
9
+ * @param {class} auth Auth class object with authorized api instance.
10
+ * @param {string} connectionUUID The UUID of the Connection we're working on.
11
+ */
12
+ constructor (auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
13
+ super({
14
+ auth,
15
+ connectionUUID,
16
+ organizationUUID,
17
+ apiURL,
18
+ apiVersion,
19
+ appUUIDKey: 'myobAccountRight',
20
+ integrationName: 'MYOBAccountRight',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = MYOBAccountRightSDK
@@ -4,7 +4,7 @@ const BaseSDK = require('./Base')
4
4
  const UniversalModule = require('./submodules/myobAcumatica/Universal')
5
5
  const ODataModule = require('./submodules/myobAcumatica/OData')
6
6
 
7
- class MYOBAcumatica extends BaseSDK {
7
+ class MYOBAcumaticaSDK extends BaseSDK {
8
8
  /**
9
9
  * Constructor.
10
10
  * @param {class} auth Auth class object with authorized api instance.
@@ -30,4 +30,4 @@ class MYOBAcumatica extends BaseSDK {
30
30
  }
31
31
  }
32
32
 
33
- module.exports = MYOBAcumatica
33
+ module.exports = MYOBAcumaticaSDK
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/navision/Universal')
5
+
6
+ class NavisionSDK extends BaseSDK {
7
+ /**
8
+ * Constructor.
9
+ * @param {class} auth Auth class object with authorized api instance.
10
+ * @param {string} connectionUUID The UUID of the Connection we're working on.
11
+ */
12
+ constructor (auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
13
+ super({
14
+ auth,
15
+ connectionUUID,
16
+ organizationUUID,
17
+ apiURL,
18
+ apiVersion,
19
+ appUUIDKey: 'navision',
20
+ integrationName: 'Navision',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = NavisionSDK
@@ -3,7 +3,7 @@
3
3
  const BaseSDK = require('./Base')
4
4
  const UniversalModule = require('./submodules/retailExpress/Universal')
5
5
 
6
- class RetailExpress extends BaseSDK {
6
+ class RetailExpressSDK extends BaseSDK {
7
7
  /**
8
8
  * Constructor.
9
9
  * @param {class} auth Auth class object with authorized api instance.
@@ -28,4 +28,4 @@ class RetailExpress extends BaseSDK {
28
28
  }
29
29
  }
30
30
 
31
- module.exports = RetailExpress
31
+ module.exports = RetailExpressSDK
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/sunsystems/Universal')
5
+
6
+ class SunSystemsSDK extends BaseSDK {
7
+ /**
8
+ * Constructor.
9
+ * @param {class} auth Auth class object with authorized api instance.
10
+ * @param {string} connectionUUID The UUID of the Connection we're working on.
11
+ */
12
+ constructor (auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
13
+ super({
14
+ auth,
15
+ connectionUUID,
16
+ organizationUUID,
17
+ apiURL,
18
+ apiVersion,
19
+ appUUIDKey: 'sunsystems',
20
+ integrationName: 'SunSystems',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = SunSystemsSDK
package/src/sdk/Sybiz.js CHANGED
@@ -3,7 +3,7 @@
3
3
  const BaseSDK = require('./Base')
4
4
  const UniversalModule = require('./submodules/sybiz/Universal')
5
5
 
6
- class Sybiz extends BaseSDK {
6
+ class SybizSDK extends BaseSDK {
7
7
  /**
8
8
  * Constructor.
9
9
  * @param {class} auth Auth class object with authorized api instance.
@@ -28,4 +28,4 @@ class Sybiz extends BaseSDK {
28
28
  }
29
29
  }
30
30
 
31
- module.exports = Sybiz
31
+ module.exports = SybizSDK
package/src/sdk/Xero.js CHANGED
@@ -3,7 +3,7 @@
3
3
  const BaseSDK = require("./Base");
4
4
  const UniversalModule = require("./submodules/xero/Universal");
5
5
 
6
- class Xero extends BaseSDK {
6
+ class XeroSDK extends BaseSDK {
7
7
  /**
8
8
  * Constructor.
9
9
  * @param {class} auth Auth class object with authorized api instance.
@@ -28,4 +28,4 @@ class Xero extends BaseSDK {
28
28
  }
29
29
  }
30
30
 
31
- module.exports = Xero;
31
+ module.exports = XeroSDK;
@@ -0,0 +1,48 @@
1
+ 'use strict'
2
+
3
+ class ArPaymentModule {
4
+ /**
5
+ * Constructor.
6
+ * @param {class} parentModule Object of Intacct class.
7
+ */
8
+ constructor (parentModule) {
9
+ this.module = parentModule
10
+ }
11
+
12
+ /**
13
+ * Creates AR Payment.
14
+ * @returns {object} Create AR Payment Response.
15
+ */
16
+ async create ({ ...fields }) {
17
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/25ccf377-0efc-4403-b3c0-728b7e85ed02`, {
18
+ mappable_parameters: {
19
+ debug: {
20
+ value: false
21
+ },
22
+ ...fields
23
+ }
24
+ }, {
25
+ _debug: true
26
+ })
27
+ }
28
+
29
+ /**
30
+ * Reuse Universal Listing with type AR Payment.
31
+ * @returns {object} List Response.
32
+ */
33
+ async list ({ include = [], exclude = [], filters, orderBy = null, entity = null, showPrivate = false, pageSize = 1000, offset = 0, returnFormat = 'json' }) {
34
+ return await this.module.universal.list({ type: 'ARPYMT', include, exclude, filters, orderBy, entity, showPrivate, pageSize, offset, returnFormat })
35
+ }
36
+
37
+ /**
38
+ * Reuse Universal Auto Pagination Listing with type AR Payment.
39
+ * @returns {object} Auto Pagination responses.
40
+ */
41
+ async * autoPaginationList ({ include = [], exclude = [], filters, orderBy = null, entity = null, showPrivate = false, pageSize = 1000, offset = 0, returnFormat = 'json' }) {
42
+ for await (const response of this.module.universal.autoPaginationList({ type: 'ARPYMT', include, exclude, filters, orderBy, entity, showPrivate, pageSize, offset, returnFormat })) {
43
+ yield response
44
+ }
45
+ }
46
+ }
47
+
48
+ module.exports = ArPaymentModule
@@ -9,6 +9,41 @@ class ItemModule {
9
9
  this.module = parentModule
10
10
  }
11
11
 
12
+ /**
13
+ * Creates Item.
14
+ * @returns {object} Create Item Response.
15
+ */
16
+ async create ({ ...fields }) {
17
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/10bb7e58-6905-499e-bbd8-ed0090989f16`, {
18
+ mappable_parameters: {
19
+ debug: {
20
+ value: false
21
+ },
22
+ ...fields
23
+ }
24
+ }, {
25
+ _debug: true
26
+ })
27
+ }
28
+
29
+ /**
30
+ * Update Item.
31
+ * @returns {object} Update Item Response.
32
+ */
33
+ async update ({ ...fields }) {
34
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/d46feca0-0fb5-4d77-89f7-5600887cce63`, {
35
+ mappable_parameters: {
36
+ debug: {
37
+ value: false
38
+ },
39
+ ...fields
40
+ }
41
+ }, {
42
+ _debug: true
43
+ })
44
+ }
45
+
46
+
12
47
  /**
13
48
  * Reuse Universal Listing with type ITEM.
14
49
  * @returns {object} List Response.
@@ -9,6 +9,40 @@ class VendorModule {
9
9
  this.module = parentModule
10
10
  }
11
11
 
12
+ /**
13
+ * Creates Vendor.
14
+ * @returns {object} Create Vendor Response.
15
+ */
16
+ async create ({ ...fields }) {
17
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/099c3396-e232-43ff-b58f-df74e99d249c`, {
18
+ mappable_parameters: {
19
+ debug: {
20
+ value: false
21
+ },
22
+ ...fields
23
+ }
24
+ }, {
25
+ _debug: true
26
+ })
27
+ }
28
+
29
+ /**
30
+ * Update Vendor.
31
+ * @returns {object} Update Vendor Response.
32
+ */
33
+ async update ({ ...fields }) {
34
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/d17aa178-9609-4ab3-a780-a7f63d32e167`, {
35
+ mappable_parameters: {
36
+ debug: {
37
+ value: false
38
+ },
39
+ ...fields
40
+ }
41
+ }, {
42
+ _debug: true
43
+ })
44
+ }
45
+
12
46
  /**
13
47
  * Reuse Universal Listing with type VENDOR.
14
48
  * @returns {object} List Response.
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+
3
+ class UniversalModule {
4
+ /**
5
+ * Constructor.
6
+ * @param {class} parentModule Object of Xero class.
7
+ */
8
+ constructor(parentModule) {
9
+ this.module = parentModule;
10
+ }
11
+
12
+ /**
13
+ * Universal Request By URL and Method.
14
+ * @param {string} url URL of request.
15
+ * @param {string} method Method of request.
16
+ * @param {object} header Headers to pass to the block
17
+ * @param {object} qs Some available filters inside: offset, limit.
18
+ * @param {object} body Some available data inside.
19
+ * @returns {object} Universal Request Response.
20
+ */
21
+ async request({ url, method, header = {}, qs = {}, body = {} }) {
22
+ const validateIsEmpty = this.module.validator.isEmpty({ url, method });
23
+
24
+ if (!validateIsEmpty.valid) {
25
+ return this.module.responseHandler.error(validateIsEmpty.errors);
26
+ }
27
+
28
+ return await this.module.makeRequest(
29
+ "POST",
30
+ `${this.module.apiURL}/zintegrations/action/9939030a-2670-4b80-a4fb-6ca030d26043`,
31
+ {
32
+ mappable_parameters: {
33
+ url: {
34
+ value: url,
35
+ },
36
+ method: {
37
+ value: method,
38
+ },
39
+ header: {
40
+ value: JSON.stringify(header),
41
+ },
42
+ qs: {
43
+ isMap: true,
44
+ value: JSON.stringify(qs),
45
+ },
46
+ body: {
47
+ isMap: true,
48
+ value: JSON.stringify(body),
49
+ },
50
+ },
51
+ }
52
+ );
53
+ }
54
+
55
+ /**
56
+ * Universal List By URL and Method.
57
+ * @param {string} url URL of listed data.
58
+ * @param {string} method Method of listed data.
59
+ * @param {object} header Headers to pass to the block
60
+ * @param {object} qs Some available filters inside: Page, Limit.
61
+ * @param {object} body Some available data inside.
62
+ * @returns {object} Universal List Response.
63
+ */
64
+ async list({ url, method, header = {}, qs = {}, body = {} }) {
65
+ const validateIsEmpty = this.module.validator.isEmpty({ url, method });
66
+
67
+ if (!validateIsEmpty.valid) {
68
+ return this.module.responseHandler.error(validateIsEmpty.errors);
69
+ }
70
+
71
+ if (!qs.page) {
72
+ qs.page = 1;
73
+ }
74
+
75
+ return await this.request({ url, method, header, qs, body });
76
+ }
77
+
78
+ /**
79
+ * Universal Auto Pagination Listing By URL and Method.
80
+ * @param {string} url URL of listed data.
81
+ * @param {string} method Method of listed data.
82
+ * @param {object} header Headers to pass to the block
83
+ * @param {object} qs Some available filters inside: Page, Limit.
84
+ * @param {object} body Some available data inside.
85
+ * @returns {object} Auto Pagination responses.
86
+ */
87
+ async *autoPaginationList({ url, method, header = {}, qs = {}, body = {} }) {
88
+ if (!qs.page) {
89
+ qs.page = 1;
90
+ }
91
+
92
+ let response = await this.list({ url, method, header, qs, body });
93
+ let currentPageCount = response?.data?.length;
94
+
95
+ yield response;
96
+
97
+ if (currentPageCount && currentPageCount === 100) {
98
+ while (currentPageCount === 100) {
99
+ qs.page = qs.page + 1;
100
+
101
+ response = await this.list({ url, method, header, qs, body });
102
+ currentPageCount = response?.data?.length;
103
+
104
+ yield response;
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Upload Attachment
111
+ * @param {object} header Headers to pass to the block
112
+ * @param {object} qs Some available filters inside: Page, Limit.
113
+ * @param {object} body Some available data inside.
114
+ * @returns {object} Universal List Response.
115
+ */
116
+ async addAttachment({ header = {}, qs = {}, body = {} }) {
117
+ return await this.module.makeRequest(
118
+ "POST",
119
+ `${this.module.apiURL}/zintegrations/action/2e52bb12-dcee-4011-848c-b1828182fbcf`,
120
+ {
121
+ mappable_parameters: {
122
+ header: {
123
+ value: JSON.stringify(header),
124
+ },
125
+ body: {
126
+ isMap: true,
127
+ value: JSON.stringify(body),
128
+ },
129
+ },
130
+ }
131
+ );
132
+ }
133
+ }
134
+
135
+ module.exports = UniversalModule;
@@ -0,0 +1,111 @@
1
+ 'use strict'
2
+
3
+ class UniversalModule {
4
+ /**
5
+ * Constructor.
6
+ * @param {class} parentModule Object of Fo class.
7
+ */
8
+ constructor (parentModule) {
9
+ this.module = parentModule
10
+ }
11
+
12
+ /**
13
+ * Universal Request By URL and Method.
14
+ * @param {string} url URL of request.
15
+ * @param {string} method Method of request.
16
+ * @param {object} qs Some available filters inside: $top, $skip, $filter, $extend.
17
+ * @param {object} body Some available data inside.
18
+ * @returns {object} Universal Request Response.
19
+ */
20
+ async request ({ url, method, qs = {}, body = {} }) {
21
+ const validateIsEmpty = this.module.validator.isEmpty({ url, method })
22
+
23
+ if (!validateIsEmpty.valid) {
24
+ return this.module.responseHandler.error(validateIsEmpty.errors)
25
+ }
26
+
27
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/80ff022b-6789-48d9-9a2c-25ecd6f19545`, {
28
+ mappable_parameters: {
29
+ url: {
30
+ value: url
31
+ },
32
+ method: {
33
+ value: method
34
+ },
35
+ qs: {
36
+ isMap: true,
37
+ value: JSON.stringify(qs)
38
+ },
39
+ body: {
40
+ isMap: true,
41
+ value: JSON.stringify(body)
42
+ }
43
+ }
44
+ })
45
+ }
46
+
47
+ /**
48
+ * Universal List By URL and Method.
49
+ * @param {string} url URL of listed data.
50
+ * @param {string} method Method of listed data.
51
+ * @param {object} qs Some available filters inside: $top, $skip, $filter, $extend.
52
+ * @param {object} body Some available data inside.
53
+ * @returns {object} Universal List Response.
54
+ */
55
+ async list ({ url, method, qs = {}, body = {} }) {
56
+ const validateIsEmpty = this.module.validator.isEmpty({ url, method })
57
+
58
+ if (!validateIsEmpty.valid) {
59
+ return this.module.responseHandler.error(validateIsEmpty.errors)
60
+ }
61
+
62
+ if (!qs.$skip) {
63
+ qs.$skip = 0
64
+ }
65
+
66
+ if (!qs.$top) {
67
+ qs.$top = 100
68
+ }
69
+
70
+ return await this.request({ url, method, qs, body })
71
+ }
72
+
73
+ /**
74
+ * Universal Auto Pagination Listing By URL and Method.
75
+ * @param {string} url URL of listed data.
76
+ * @param {string} method Method of listed data.
77
+ * @param {object} qs Some available filters inside: $top, $skip, $filter, $extend.
78
+ * @param {object} body Some available data inside.
79
+ * @returns {object} Auto Pagination responses.
80
+ */
81
+ async * autoPaginationList ({ url, method, qs = {}, body = {} }) {
82
+ if (!qs.$skip) {
83
+ qs.$skip = 0
84
+ }
85
+
86
+ if (!qs.$top) {
87
+ qs.$top = 100
88
+ }
89
+
90
+ let response = await this.list({ url, method, qs, body })
91
+ let currentPageCount = response?.data?.value?.length
92
+ let currentOffset = qs.$skip
93
+
94
+ yield response
95
+
96
+ if (currentPageCount && currentPageCount === qs.$top) {
97
+ while (currentPageCount === qs.$top) {
98
+ currentOffset = currentOffset + qs.$top
99
+
100
+ qs.$skip = currentOffset
101
+
102
+ response = await this.list({ url, method, qs, body })
103
+ currentPageCount = response?.data?.value?.length
104
+
105
+ yield response
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ module.exports = UniversalModule
@@ -0,0 +1,111 @@
1
+ 'use strict'
2
+
3
+ class UniversalModule {
4
+ /**
5
+ * Constructor.
6
+ * @param {class} parentModule Object of Fo class.
7
+ */
8
+ constructor (parentModule) {
9
+ this.module = parentModule
10
+ }
11
+
12
+ /**
13
+ * Universal Request By URL and Method.
14
+ * @param {string} url URL of request.
15
+ * @param {string} method Method of request.
16
+ * @param {object} qs Some available filters inside: $top, $skip, $filter, $extend.
17
+ * @param {object} body Some available data inside.
18
+ * @returns {object} Universal Request Response.
19
+ */
20
+ async request ({ url, method, qs = {}, body = {} }) {
21
+ const validateIsEmpty = this.module.validator.isEmpty({ url, method })
22
+
23
+ if (!validateIsEmpty.valid) {
24
+ return this.module.responseHandler.error(validateIsEmpty.errors)
25
+ }
26
+
27
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/80ff022b-6789-48d9-9a2c-25ecd6f19545`, {
28
+ mappable_parameters: {
29
+ url: {
30
+ value: url
31
+ },
32
+ method: {
33
+ value: method
34
+ },
35
+ qs: {
36
+ isMap: true,
37
+ value: JSON.stringify(qs)
38
+ },
39
+ body: {
40
+ isMap: true,
41
+ value: JSON.stringify(body)
42
+ }
43
+ }
44
+ })
45
+ }
46
+
47
+ /**
48
+ * Universal List By URL and Method.
49
+ * @param {string} url URL of listed data.
50
+ * @param {string} method Method of listed data.
51
+ * @param {object} qs Some available filters inside: $top, $skip, $filter, $extend.
52
+ * @param {object} body Some available data inside.
53
+ * @returns {object} Universal List Response.
54
+ */
55
+ async list ({ url, method, qs = {}, body = {} }) {
56
+ const validateIsEmpty = this.module.validator.isEmpty({ url, method })
57
+
58
+ if (!validateIsEmpty.valid) {
59
+ return this.module.responseHandler.error(validateIsEmpty.errors)
60
+ }
61
+
62
+ if (!qs.$skip) {
63
+ qs.$skip = 0
64
+ }
65
+
66
+ if (!qs.$top) {
67
+ qs.$top = 100
68
+ }
69
+
70
+ return await this.request({ url, method, qs, body })
71
+ }
72
+
73
+ /**
74
+ * Universal Auto Pagination Listing By URL and Method.
75
+ * @param {string} url URL of listed data.
76
+ * @param {string} method Method of listed data.
77
+ * @param {object} qs Some available filters inside: $top, $skip, $filter, $extend.
78
+ * @param {object} body Some available data inside.
79
+ * @returns {object} Auto Pagination responses.
80
+ */
81
+ async * autoPaginationList ({ url, method, qs = {}, body = {} }) {
82
+ if (!qs.$skip) {
83
+ qs.$skip = 0
84
+ }
85
+
86
+ if (!qs.$top) {
87
+ qs.$top = 100
88
+ }
89
+
90
+ let response = await this.list({ url, method, qs, body })
91
+ let currentPageCount = response?.data?.value?.length
92
+ let currentOffset = qs.$skip
93
+
94
+ yield response
95
+
96
+ if (currentPageCount && currentPageCount === qs.$top) {
97
+ while (currentPageCount === qs.$top) {
98
+ currentOffset = currentOffset + qs.$top
99
+
100
+ qs.$skip = currentOffset
101
+
102
+ response = await this.list({ url, method, qs, body })
103
+ currentPageCount = response?.data?.value?.length
104
+
105
+ yield response
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ module.exports = UniversalModule
@@ -10,8 +10,10 @@ module.exports = {
10
10
  dear: "0e456359-fe0d-4b01-9662-08bba1bdce63",
11
11
  nexvia: "5f693545-3be0-4798-bb3b-3af0b7ee2e96",
12
12
  fo: "524e1173-6d73-42ea-9d9c-0c728c6f24ea",
13
+ navision: "",
13
14
  retailExpress: "49584664-65a5-4b76-ba62-a73f7b7b3885",
14
15
  myobAcumatica: "8fd5015c-a200-4675-9e03-2047807c5693",
16
+ myobAccountRight: "",
15
17
  sybiz: "ead57add-301e-4b29-881b-1bc331c101a5",
16
18
  xero: "71648f29-7867-40d8-ac68-651b53cb3c49",
17
19
  jobready: "14d16371-3e56-40c8-9efa-8578a8f334fc",
@@ -19,5 +21,6 @@ module.exports = {
19
21
  sapb1: "de1ee5bd-d3ec-41cf-83f9-dcd2f51fcccd",
20
22
  gp: "c1fb133b-73f6-4b85-9362-59c7c2d9017f",
21
23
  edi: "6b3a284f-ca06-435c-bdf1-ad59c577a6a7",
24
+ sunsystems: "",
22
25
  },
23
26
  };