zudello-integration-sdk 1.0.80 → 1.0.81
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
package/src/sdk/NetsuiteSOAP.js
CHANGED
|
@@ -10,6 +10,7 @@ const UniversalTransactionModule = require("./submodules/netsuite-soap/Universal
|
|
|
10
10
|
const PurchaseOrderModule = require("./submodules/netsuite-soap/PurchaseOrder");
|
|
11
11
|
const ReceiptModule = require("./submodules/netsuite-soap/Receipt");
|
|
12
12
|
const AttachmentModule = require("./submodules/netsuite-soap/Attachment");
|
|
13
|
+
const JournalEntryModule = require("./submodules/netsuite-soap/JournalEntry");
|
|
13
14
|
|
|
14
15
|
class NetsuiteSoapSDK extends BaseSDK {
|
|
15
16
|
/**
|
|
@@ -41,6 +42,7 @@ class NetsuiteSoapSDK extends BaseSDK {
|
|
|
41
42
|
this.purchaseOrder = new PurchaseOrderModule(this);
|
|
42
43
|
this.receipt = new ReceiptModule(this);
|
|
43
44
|
this.attach = new AttachmentModule(this);
|
|
45
|
+
this.journalEntry = new JournalEntryModule(this);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
/**
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
class JournalEntryModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of Netsuite class.
|
|
7
|
+
*/
|
|
8
|
+
constructor (parentModule) {
|
|
9
|
+
this.module = parentModule
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Create journal entry.
|
|
14
|
+
* @param {object} body Body of journal entry.
|
|
15
|
+
* @returns {object} Response.
|
|
16
|
+
*/
|
|
17
|
+
async create ({ body }) {
|
|
18
|
+
return await this.module.makeRequest('POST', `${this.module.apiURL}/zintegrations/action/5c57e1c0-b0c4-4f24-a2a3-291683b67c65`, {
|
|
19
|
+
mappable_parameters: {
|
|
20
|
+
debug: {
|
|
21
|
+
value: false
|
|
22
|
+
},
|
|
23
|
+
body: {
|
|
24
|
+
value: body
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
_debug: true
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = JournalEntryModule
|
package/src/utils/trigger.js
CHANGED
|
@@ -6,7 +6,7 @@ class Trigger {
|
|
|
6
6
|
this.teamUUID = teamUUID
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
async run(uuid, data = {}) {
|
|
9
|
+
async run(uuid, data = {}, teamUUID = null) {
|
|
10
10
|
if (!this.apiInstance || !this.teamUUID || !uuid || !process.env.ZUDELLO_API_URL) {
|
|
11
11
|
return
|
|
12
12
|
}
|
|
@@ -19,7 +19,7 @@ class Trigger {
|
|
|
19
19
|
data
|
|
20
20
|
}
|
|
21
21
|
}, {
|
|
22
|
-
'x-team': this.teamUUID
|
|
22
|
+
'x-team': teamUUID || this.teamUUID
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
25
|
}
|