zudello-integration-sdk 1.0.31 → 1.0.33

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.31",
3
+ "version": "1.0.33",
4
4
  "description": "Zudello Integrations SDK",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
@@ -36,6 +36,7 @@ const PoDocumentModule = require("./submodules/intacct/PoDocument");
36
36
  const ArTermModule = require("./submodules/intacct/ArTerm");
37
37
  const ArInvoiceModule = require("./submodules/intacct/ArInvoice");
38
38
  const ArAdjustmentModule = require("./submodules/intacct/ArAdjustment");
39
+ const JournalModule = require("./submodules/intacct/Journal");
39
40
  const FileModule = require("./submodules/intacct/File");
40
41
  const ZoneModule = require("./submodules/intacct/Zone");
41
42
 
@@ -95,6 +96,7 @@ class IntacctSDK extends BaseSDK {
95
96
  this.arTerm = new ArTermModule(this);
96
97
  this.arInvoice = new ArInvoiceModule(this);
97
98
  this.arAdjustment = new ArAdjustmentModule(this);
99
+ this.journal = new JournalModule(this);
98
100
  this.zone = new ZoneModule(this);
99
101
  this.file = new FileModule(this);
100
102
  }
@@ -13,6 +13,23 @@ class ApAdjustmentModule {
13
13
  this.item = new ApAdjustmentItemModule(parentModule)
14
14
  }
15
15
 
16
+ /**
17
+ * Creates AP Adjustment.
18
+ * @returns {object} Create AP Adjustmnet Response.
19
+ */
20
+ async create ({ ...fields }) {
21
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/c1da53d1-140f-4476-8d74-42558d1d8fab`, {
22
+ mappable_parameters: {
23
+ debug: {
24
+ value: false
25
+ },
26
+ ...fields
27
+ }
28
+ }, {
29
+ _debug: true
30
+ })
31
+ }
32
+
16
33
  /**
17
34
  * Reuse Universal Listing with type APADJUSTMENT.
18
35
  * @returns {object} List Response.
@@ -0,0 +1,48 @@
1
+ 'use strict'
2
+
3
+ class JournalModule {
4
+ /**
5
+ * Constructor.
6
+ * @param {class} parentModule Object of Intacct class.
7
+ */
8
+ constructor (parentModule) {
9
+ this.module = parentModule
10
+ }
11
+
12
+ /**
13
+ * Creates Journal.
14
+ * @returns {object} Create Journal Response.
15
+ */
16
+ async create ({ ...fields }) {
17
+ return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/3b8a9f62-0a3f-472e-b7ad-c01af6b5c6e3`, {
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 JOURNAL.
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: 'GLBATCH', include, exclude, filters, orderBy, entity, showPrivate, pageSize, offset, returnFormat })
35
+ }
36
+
37
+ /**
38
+ * Reuse Universal Auto Pagination Listing with type GLACCOUNT.
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: 'GLBATCH', include, exclude, filters, orderBy, entity, showPrivate, pageSize, offset, returnFormat })) {
43
+ yield response
44
+ }
45
+ }
46
+ }
47
+
48
+ module.exports = JournalModule