zudello-integration-sdk 1.0.0

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.
Files changed (201) hide show
  1. package/README.md +1 -0
  2. package/package.json +23 -0
  3. package/src/index.js +62 -0
  4. package/src/integrations/samples/bc-zudello/account.js +40 -0
  5. package/src/integrations/samples/bc-zudello/accountingPeriod.js +52 -0
  6. package/src/integrations/samples/bc-zudello/currency.js +42 -0
  7. package/src/integrations/samples/bc-zudello/customer.js +45 -0
  8. package/src/integrations/samples/bc-zudello/dimension.js +85 -0
  9. package/src/integrations/samples/bc-zudello/employee.js +38 -0
  10. package/src/integrations/samples/bc-zudello/fixedAsset.js +48 -0
  11. package/src/integrations/samples/bc-zudello/item.js +45 -0
  12. package/src/integrations/samples/bc-zudello/itemCategory.js +37 -0
  13. package/src/integrations/samples/bc-zudello/location.js +37 -0
  14. package/src/integrations/samples/bc-zudello/paymentMethod.js +38 -0
  15. package/src/integrations/samples/bc-zudello/paymentTerm.js +41 -0
  16. package/src/integrations/samples/bc-zudello/project.js +38 -0
  17. package/src/integrations/samples/bc-zudello/purchaseCredit.js +109 -0
  18. package/src/integrations/samples/bc-zudello/purchaseInvoice.js +138 -0
  19. package/src/integrations/samples/bc-zudello/purchaseOrder.js +150 -0
  20. package/src/integrations/samples/bc-zudello/purchaseOrderFetch.js +100 -0
  21. package/src/integrations/samples/bc-zudello/supplier.js +40 -0
  22. package/src/integrations/samples/bc-zudello/taxRate.js +39 -0
  23. package/src/integrations/samples/bc-zudello/uom.js +42 -0
  24. package/src/integrations/samples/dear-zudello/account.js +20 -0
  25. package/src/integrations/samples/dear-zudello/customer.js +23 -0
  26. package/src/integrations/samples/dear-zudello/item.js +30 -0
  27. package/src/integrations/samples/dear-zudello/location.js +19 -0
  28. package/src/integrations/samples/dear-zudello/salesOrder.js +126 -0
  29. package/src/integrations/samples/dear-zudello/supplier.js +23 -0
  30. package/src/integrations/samples/dear-zudello/taxRate.js +19 -0
  31. package/src/integrations/samples/fo-zudello/account.js +20 -0
  32. package/src/integrations/samples/fo-zudello/costCentre.js +20 -0
  33. package/src/integrations/samples/fo-zudello/department.js +20 -0
  34. package/src/integrations/samples/fo-zudello/item.js +21 -0
  35. package/src/integrations/samples/fo-zudello/location.js +20 -0
  36. package/src/integrations/samples/fo-zudello/project.js +18 -0
  37. package/src/integrations/samples/fo-zudello/subsidiary.js +20 -0
  38. package/src/integrations/samples/fo-zudello/supplier.js +23 -0
  39. package/src/integrations/samples/fo-zudello/taxRate.js +20 -0
  40. package/src/integrations/samples/intacct-zudello/account.js +56 -0
  41. package/src/integrations/samples/intacct-zudello/accountGroup.js +54 -0
  42. package/src/integrations/samples/intacct-zudello/accountingPeriod.js +67 -0
  43. package/src/integrations/samples/intacct-zudello/apBill.js +146 -0
  44. package/src/integrations/samples/intacct-zudello/apBillFetch.js +195 -0
  45. package/src/integrations/samples/intacct-zudello/costCentre.js +54 -0
  46. package/src/integrations/samples/intacct-zudello/costType.js +54 -0
  47. package/src/integrations/samples/intacct-zudello/customerCategory.js +54 -0
  48. package/src/integrations/samples/intacct-zudello/customerGroup.js +54 -0
  49. package/src/integrations/samples/intacct-zudello/department.js +54 -0
  50. package/src/integrations/samples/intacct-zudello/employee.js +51 -0
  51. package/src/integrations/samples/intacct-zudello/expense-create.js +156 -0
  52. package/src/integrations/samples/intacct-zudello/item.js +64 -0
  53. package/src/integrations/samples/intacct-zudello/itemCategory.js +54 -0
  54. package/src/integrations/samples/intacct-zudello/itemGroup.js +54 -0
  55. package/src/integrations/samples/intacct-zudello/location.js +54 -0
  56. package/src/integrations/samples/intacct-zudello/paymentTerm.js +56 -0
  57. package/src/integrations/samples/intacct-zudello/project.js +54 -0
  58. package/src/integrations/samples/intacct-zudello/projectGroup.js +54 -0
  59. package/src/integrations/samples/intacct-zudello/projectTask.js +40 -0
  60. package/src/integrations/samples/intacct-zudello/subsidiary.js +54 -0
  61. package/src/integrations/samples/intacct-zudello/supplier.js +168 -0
  62. package/src/integrations/samples/intacct-zudello/supplierCategory.js +54 -0
  63. package/src/integrations/samples/intacct-zudello/supplierGroup.js +54 -0
  64. package/src/integrations/samples/intacct-zudello/supplierV2.js +64 -0
  65. package/src/integrations/samples/intacct-zudello/taxRate.js +34 -0
  66. package/src/integrations/samples/intacct-zudello/taxSolution.js +35 -0
  67. package/src/integrations/samples/intacct-zudello/uom.js +37 -0
  68. package/src/integrations/samples/intacct-zudello/warehouse.js +54 -0
  69. package/src/integrations/samples/intacct-zudello/zone.js +54 -0
  70. package/src/integrations/samples/nexvia-zudello/account.js +20 -0
  71. package/src/integrations/samples/nexvia-zudello/costCentre.js +19 -0
  72. package/src/integrations/samples/nexvia-zudello/costType.js +19 -0
  73. package/src/integrations/samples/nexvia-zudello/currency.js +20 -0
  74. package/src/integrations/samples/nexvia-zudello/department.js +20 -0
  75. package/src/integrations/samples/nexvia-zudello/itemCategory.js +19 -0
  76. package/src/integrations/samples/nexvia-zudello/location.js +20 -0
  77. package/src/integrations/samples/nexvia-zudello/project.js +20 -0
  78. package/src/integrations/samples/nexvia-zudello/supplier.js +21 -0
  79. package/src/integrations/samples/nexvia-zudello/taxRate.js +21 -0
  80. package/src/integrations/samples/nexvia-zudello/uom.js +19 -0
  81. package/src/integrations/samples/nexvia-zudello/zone.js +20 -0
  82. package/src/integrations/samples/zenoti-zudello/location.js +20 -0
  83. package/src/integrations/samples/zenoti-zudello/product.js +32 -0
  84. package/src/integrations/samples/zenoti-zudello/purchaseOrder.js +193 -0
  85. package/src/sdk/Auth.js +42 -0
  86. package/src/sdk/Base.js +118 -0
  87. package/src/sdk/BusinessCentral.js +31 -0
  88. package/src/sdk/Dear.js +31 -0
  89. package/src/sdk/Fo.js +31 -0
  90. package/src/sdk/Intacct.js +103 -0
  91. package/src/sdk/JobReady.js +31 -0
  92. package/src/sdk/MYOBAcumatica.js +33 -0
  93. package/src/sdk/Netsuite.js +31 -0
  94. package/src/sdk/NetsuiteSOAP.js +92 -0
  95. package/src/sdk/Nexvia.js +31 -0
  96. package/src/sdk/RetailExpress.js +31 -0
  97. package/src/sdk/Sybiz.js +31 -0
  98. package/src/sdk/Zenoti.js +31 -0
  99. package/src/sdk/Zudello.js +206 -0
  100. package/src/sdk/submodules/bc/Universal.js +109 -0
  101. package/src/sdk/submodules/dear/Universal.js +110 -0
  102. package/src/sdk/submodules/fo/Universal.js +111 -0
  103. package/src/sdk/submodules/intacct/Account.js +31 -0
  104. package/src/sdk/submodules/intacct/AccountGroup.js +31 -0
  105. package/src/sdk/submodules/intacct/AccountingPeriod.js +31 -0
  106. package/src/sdk/submodules/intacct/ApAdjustment.js +35 -0
  107. package/src/sdk/submodules/intacct/ApBill.js +52 -0
  108. package/src/sdk/submodules/intacct/ApTerm.js +31 -0
  109. package/src/sdk/submodules/intacct/ArAdjustment.js +35 -0
  110. package/src/sdk/submodules/intacct/ArInvoice.js +35 -0
  111. package/src/sdk/submodules/intacct/ArTerm.js +31 -0
  112. package/src/sdk/submodules/intacct/Budget.js +31 -0
  113. package/src/sdk/submodules/intacct/Class.js +31 -0
  114. package/src/sdk/submodules/intacct/CostType.js +31 -0
  115. package/src/sdk/submodules/intacct/Customer.js +31 -0
  116. package/src/sdk/submodules/intacct/CustomerGroup.js +31 -0
  117. package/src/sdk/submodules/intacct/CustomerType.js +31 -0
  118. package/src/sdk/submodules/intacct/Department.js +31 -0
  119. package/src/sdk/submodules/intacct/Employee.js +31 -0
  120. package/src/sdk/submodules/intacct/Entity.js +31 -0
  121. package/src/sdk/submodules/intacct/File.js +26 -0
  122. package/src/sdk/submodules/intacct/Item.js +31 -0
  123. package/src/sdk/submodules/intacct/ItemGroup.js +31 -0
  124. package/src/sdk/submodules/intacct/Location.js +31 -0
  125. package/src/sdk/submodules/intacct/PoDocument.js +52 -0
  126. package/src/sdk/submodules/intacct/ProductLine.js +31 -0
  127. package/src/sdk/submodules/intacct/Project.js +31 -0
  128. package/src/sdk/submodules/intacct/ProjectGroup.js +31 -0
  129. package/src/sdk/submodules/intacct/Task.js +31 -0
  130. package/src/sdk/submodules/intacct/TaxDetail.js +31 -0
  131. package/src/sdk/submodules/intacct/TaxGroups.js +31 -0
  132. package/src/sdk/submodules/intacct/TaxSolution.js +31 -0
  133. package/src/sdk/submodules/intacct/Universal.js +139 -0
  134. package/src/sdk/submodules/intacct/Uom.js +31 -0
  135. package/src/sdk/submodules/intacct/Vendor.js +31 -0
  136. package/src/sdk/submodules/intacct/VendorGroup.js +31 -0
  137. package/src/sdk/submodules/intacct/VendorTypes.js +31 -0
  138. package/src/sdk/submodules/intacct/Warehouse.js +31 -0
  139. package/src/sdk/submodules/intacct/Zone.js +31 -0
  140. package/src/sdk/submodules/intacct/apAdjustment/Item.js +31 -0
  141. package/src/sdk/submodules/intacct/apBill/Item.js +31 -0
  142. package/src/sdk/submodules/intacct/arAdjustment/Item.js +31 -0
  143. package/src/sdk/submodules/intacct/arInvoice/Item.js +31 -0
  144. package/src/sdk/submodules/intacct/poDocument/Item.js +31 -0
  145. package/src/sdk/submodules/jobready/Universal.js +107 -0
  146. package/src/sdk/submodules/myobAcumatica/OData.js +109 -0
  147. package/src/sdk/submodules/myobAcumatica/Universal.js +109 -0
  148. package/src/sdk/submodules/netsuite/Universal.js +97 -0
  149. package/src/sdk/submodules/netsuite-soap/PurchaseOrder.js +39 -0
  150. package/src/sdk/submodules/netsuite-soap/Receipt.js +39 -0
  151. package/src/sdk/submodules/netsuite-soap/Universal.js +124 -0
  152. package/src/sdk/submodules/netsuite-soap/UniversalTransaction.js +138 -0
  153. package/src/sdk/submodules/netsuite-soap/VendorBill.js +41 -0
  154. package/src/sdk/submodules/netsuite-soap/VendorCredit.js +39 -0
  155. package/src/sdk/submodules/nexvia/Universal.js +108 -0
  156. package/src/sdk/submodules/retailExpress/Universal.js +107 -0
  157. package/src/sdk/submodules/sybiz/Universal.js +108 -0
  158. package/src/sdk/submodules/zenoti/Universal.js +110 -0
  159. package/src/sdk/submodules/zudello/Account.js +63 -0
  160. package/src/sdk/submodules/zudello/AccountGroup.js +63 -0
  161. package/src/sdk/submodules/zudello/AccountingPeriod.js +63 -0
  162. package/src/sdk/submodules/zudello/CostCentre.js +63 -0
  163. package/src/sdk/submodules/zudello/CostType.js +63 -0
  164. package/src/sdk/submodules/zudello/Currency.js +63 -0
  165. package/src/sdk/submodules/zudello/Customer.js +63 -0
  166. package/src/sdk/submodules/zudello/CustomerCategory.js +63 -0
  167. package/src/sdk/submodules/zudello/CustomerGroup.js +63 -0
  168. package/src/sdk/submodules/zudello/Department.js +63 -0
  169. package/src/sdk/submodules/zudello/Employee.js +63 -0
  170. package/src/sdk/submodules/zudello/FixedAsset.js +63 -0
  171. package/src/sdk/submodules/zudello/Item.js +63 -0
  172. package/src/sdk/submodules/zudello/ItemCategory.js +63 -0
  173. package/src/sdk/submodules/zudello/ItemGroup.js +63 -0
  174. package/src/sdk/submodules/zudello/Location.js +63 -0
  175. package/src/sdk/submodules/zudello/PaymentMethod.js +63 -0
  176. package/src/sdk/submodules/zudello/PaymentTerm.js +63 -0
  177. package/src/sdk/submodules/zudello/Project.js +63 -0
  178. package/src/sdk/submodules/zudello/ProjectGroup.js +63 -0
  179. package/src/sdk/submodules/zudello/ProjectTask.js +63 -0
  180. package/src/sdk/submodules/zudello/PurchaseOrder.js +63 -0
  181. package/src/sdk/submodules/zudello/Subsidiary.js +63 -0
  182. package/src/sdk/submodules/zudello/Supplier.js +63 -0
  183. package/src/sdk/submodules/zudello/SupplierCategory.js +63 -0
  184. package/src/sdk/submodules/zudello/SupplierGroup.js +63 -0
  185. package/src/sdk/submodules/zudello/Universal.js +31 -0
  186. package/src/sdk/submodules/zudello/Uom.js +63 -0
  187. package/src/sdk/submodules/zudello/Warehouse.js +63 -0
  188. package/src/sdk/submodules/zudello/Zone.js +63 -0
  189. package/src/sdk/submodules/zudello/tax/Rate.js +63 -0
  190. package/src/sdk/submodules/zudello/tax/Solution.js +63 -0
  191. package/src/utils/apiInstance.js +198 -0
  192. package/src/utils/config.js +18 -0
  193. package/src/utils/logger.js +122 -0
  194. package/src/utils/metadata.js +102 -0
  195. package/src/utils/miscHelper.js +24 -0
  196. package/src/utils/modelHelper.js +140 -0
  197. package/src/utils/properties.js +32 -0
  198. package/src/utils/responseHandler.js +28 -0
  199. package/src/utils/s3Client.js +128 -0
  200. package/src/utils/tags.js +32 -0
  201. package/src/utils/validator.js +73 -0
@@ -0,0 +1,103 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/intacct/Universal')
5
+ const AccountModule = require('./submodules/intacct/Account')
6
+ const AccountGroupModule = require('./submodules/intacct/AccountGroup')
7
+ const AccountingPeriodModule = require('./submodules/intacct/AccountingPeriod')
8
+ const ApTermModule = require('./submodules/intacct/ApTerm')
9
+ const BudgetModule = require('./submodules/intacct/Budget')
10
+ const ClassModule = require('./submodules/intacct/Class')
11
+ const CostTypeModule = require('./submodules/intacct/CostType')
12
+ const CustomerTypeModule = require('./submodules/intacct/CustomerType')
13
+ const CustomerGroupModule = require('./submodules/intacct/CustomerGroup')
14
+ const CustomerModule = require('./submodules/intacct/Customer')
15
+ const DepartmentModule = require('./submodules/intacct/Department')
16
+ const EmployeeModule = require('./submodules/intacct/Employee')
17
+ const EntityModule = require('./submodules/intacct/Entity')
18
+ const ItemModule = require('./submodules/intacct/Item')
19
+ const ItemGroupModule = require('./submodules/intacct/ItemGroup')
20
+ const LocationModule = require('./submodules/intacct/Location')
21
+ const ProductLineModule = require('./submodules/intacct/ProductLine')
22
+ const ProjectModule = require('./submodules/intacct/Project')
23
+ const ProjectGroupModule = require('./submodules/intacct/ProjectGroup')
24
+ const TaskModule = require('./submodules/intacct/Task')
25
+ const TaxDetailModule = require('./submodules/intacct/TaxDetail')
26
+ const TaxSolutionModule = require('./submodules/intacct/TaxSolution')
27
+ const TaxGroupsModule = require('./submodules/intacct/TaxGroups')
28
+ const UomModule = require('./submodules/intacct/Uom')
29
+ const VendorModule = require('./submodules/intacct/Vendor')
30
+ const VendorTypesModule = require('./submodules/intacct/VendorTypes')
31
+ const VendorGroupModule = require('./submodules/intacct/VendorGroup')
32
+ const WarehouseModule = require('./submodules/intacct/Warehouse')
33
+ const ApBillModule = require('./submodules/intacct/ApBill')
34
+ const ApAdjustmentModule = require('./submodules/intacct/ApAdjustment')
35
+ const PoDocumentModule = require('./submodules/intacct/PoDocument')
36
+ const ArTermModule = require('./submodules/intacct/ArTerm')
37
+ const ArInvoiceModule = require('./submodules/intacct/ArInvoice')
38
+ const ArAdjustmentModule = require('./submodules/intacct/ArAdjustment')
39
+ const FileModule = require('./submodules/intacct/File')
40
+ const ZoneModule = require('./submodules/intacct/Zone')
41
+
42
+ class IntacctSDK extends BaseSDK {
43
+ /**
44
+ * Constructor.
45
+ * @param {class} auth Auth class object with authorized api instance.
46
+ * @param {string} connectionUUID The UUID of the Connection we're working on.
47
+ */
48
+ constructor (auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
49
+ super({
50
+ auth,
51
+ connectionUUID,
52
+ organizationUUID,
53
+ apiURL,
54
+ apiVersion,
55
+ appUUIDKey: 'intacct',
56
+ integrationName: 'Intacct',
57
+ loggerClass
58
+ })
59
+
60
+ /**
61
+ * Create submodule instances.
62
+ */
63
+ this.universal = new UniversalModule(this)
64
+ this.item = new ItemModule(this)
65
+ this.itemGroup = new ItemGroupModule(this)
66
+ this.department = new DepartmentModule(this)
67
+ this.account = new AccountModule(this)
68
+ this.accountGroup = new AccountGroupModule(this)
69
+ this.accountingPeriod = new AccountingPeriodModule(this)
70
+ this.project = new ProjectModule(this)
71
+ this.projectGroup = new ProjectGroupModule(this)
72
+ this.task = new TaskModule(this)
73
+ this.taxGroups = new TaxGroupsModule(this)
74
+ this.taxDetails = new TaxDetailModule(this)
75
+ this.taxSolution = new TaxSolutionModule(this)
76
+ this.productLine = new ProductLineModule(this)
77
+ this.budget = new BudgetModule(this)
78
+ this.employee = new EmployeeModule(this)
79
+ this.apTerm = new ApTermModule(this)
80
+ this.warehouse = new WarehouseModule(this)
81
+ this.customer = new CustomerModule(this)
82
+ this.customerType = new CustomerTypeModule(this)
83
+ this.customerGroup = new CustomerGroupModule(this)
84
+ this.costType = new CostTypeModule(this)
85
+ this.vendorTypes = new VendorTypesModule(this)
86
+ this.vendorGroup = new VendorGroupModule(this)
87
+ this.vendor = new VendorModule(this)
88
+ this.location = new LocationModule(this)
89
+ this.entity = new EntityModule(this)
90
+ this.class = new ClassModule(this)
91
+ this.uom = new UomModule(this)
92
+ this.apBill = new ApBillModule(this)
93
+ this.apAdjustment = new ApAdjustmentModule(this)
94
+ this.poDocument = new PoDocumentModule(this)
95
+ this.arTerm = new ArTermModule(this)
96
+ this.arInvoice = new ArInvoiceModule(this)
97
+ this.arAdjustment = new ArAdjustmentModule(this)
98
+ this.zone = new ZoneModule(this)
99
+ this.file = new FileModule(this)
100
+ }
101
+ }
102
+
103
+ module.exports = IntacctSDK
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/jobready/Universal')
5
+
6
+ class JobReady 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: 'jobready',
20
+ integrationName: 'JobReady',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = JobReady
@@ -0,0 +1,33 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/myobAcumatica/Universal')
5
+ const ODataModule = require('./submodules/myobAcumatica/OData')
6
+
7
+ class MYOBAcumatica extends BaseSDK {
8
+ /**
9
+ * Constructor.
10
+ * @param {class} auth Auth class object with authorized api instance.
11
+ * @param {string} connectionUUID The UUID of the Connection we're working on.
12
+ */
13
+ constructor (auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
14
+ super({
15
+ auth,
16
+ connectionUUID,
17
+ organizationUUID,
18
+ apiURL,
19
+ apiVersion,
20
+ appUUIDKey: 'myobAcumatica',
21
+ integrationName: 'MYOBAcumatica',
22
+ loggerClass
23
+ })
24
+
25
+ /**
26
+ * Create submodule instances.
27
+ */
28
+ this.universal = new UniversalModule(this)
29
+ this.odata = new ODataModule(this)
30
+ }
31
+ }
32
+
33
+ module.exports = MYOBAcumatica
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/netsuite/Universal')
5
+
6
+ class NetsuiteSDK 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: 'netsuite',
20
+ integrationName: 'Netsuite',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = NetsuiteSDK
@@ -0,0 +1,92 @@
1
+ 'use strict'
2
+
3
+ const _ = require('lodash')
4
+
5
+ const BaseSDK = require('./Base')
6
+ const VendorBillModule = require('./submodules/netsuite-soap/VendorBill')
7
+ const VendorCreditModule = require('./submodules/netsuite-soap/VendorCredit')
8
+ const UniversalModule = require('./submodules/netsuite-soap/Universal')
9
+ const UniversalTransactionModule = require('./submodules/netsuite-soap/UniversalTransaction')
10
+ const PurchaseOrderModule = require('./submodules/netsuite-soap/PurchaseOrder')
11
+ const ReceiptModule = require('./submodules/netsuite-soap/Receipt')
12
+
13
+ class NetsuiteSoapSDK extends BaseSDK {
14
+ /**
15
+ * Constructor.
16
+ * @param {class} auth Auth class object with authorized api instance.
17
+ * @param {string} connectionUUID The UUID of the Connection we're working on.
18
+ */
19
+ constructor (auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
20
+ super({
21
+ auth,
22
+ connectionUUID,
23
+ organizationUUID,
24
+ apiURL,
25
+ apiVersion,
26
+ appUUIDKey: 'netsuite',
27
+ integrationName: 'NetsuiteSOAP',
28
+ loggerClass
29
+ })
30
+
31
+ this.transformToTypes = ['vendorBill', 'itemReceipt']
32
+
33
+ /**
34
+ * Create submodule instances.
35
+ */
36
+ this.vendorBill = new VendorBillModule(this)
37
+ this.vendorCredit = new VendorCreditModule(this)
38
+ this.universal = new UniversalModule(this)
39
+ this.universalTransaction = new UniversalTransactionModule(this)
40
+ this.purchaseOrder = new PurchaseOrderModule(this)
41
+ this.receipt = new ReceiptModule(this)
42
+ }
43
+
44
+ /**
45
+ * Transaction transform FROM.
46
+ * @param {array} transformFrom.
47
+ * @param {string} transformTo.
48
+ * @returns {object} Transformed Response.
49
+ */
50
+ async transform ({ transformFrom, transformTo }) {
51
+ const validateIncludes = this.validator.includes(this.transformToTypes, transformTo)
52
+
53
+ if (!validateIncludes.valid) {
54
+ return this.responseHandler.error(validateIncludes.errors)
55
+ }
56
+
57
+ const validateIsEmpty = this.validator.isEmpty({ transformFrom })
58
+
59
+ if (!validateIsEmpty.valid) {
60
+ return this.responseHandler.error(validateIsEmpty.errors)
61
+ }
62
+
63
+ return await this.makeRequest('GET', `${this.apiURL}/zintegrations/action/d751e693-6bbb-4c93-aff4-6561bba29f03`, {
64
+ mappable_parameters: {
65
+ transformFrom: {
66
+ value: transformFrom
67
+ },
68
+ transformTo: {
69
+ value: transformTo
70
+ }
71
+ }
72
+ })
73
+ }
74
+
75
+ parseFilters (entries) {
76
+ return _.map(entries, entry => {
77
+ return {
78
+ field: {
79
+ value: entry.field
80
+ },
81
+ operator: {
82
+ value: entry.operator
83
+ },
84
+ value: {
85
+ value: entry.value
86
+ }
87
+ }
88
+ })
89
+ }
90
+ }
91
+
92
+ module.exports = NetsuiteSoapSDK
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/nexvia/Universal')
5
+
6
+ class NexviaSDK 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: 'nexvia',
20
+ integrationName: 'Nexvia',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = NexviaSDK
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/retailExpress/Universal')
5
+
6
+ class RetailExpress 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: 'retailExpress',
20
+ integrationName: 'RetailExpress',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = RetailExpress
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/sybiz/Universal')
5
+
6
+ class Sybiz 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: 'sybiz',
20
+ integrationName: 'Sybiz',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = Sybiz
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ const BaseSDK = require('./Base')
4
+ const UniversalModule = require('./submodules/zenoti/Universal')
5
+
6
+ class ZenotiSDK 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: 'zenoti',
20
+ integrationName: 'Zenoti',
21
+ loggerClass
22
+ })
23
+
24
+ /**
25
+ * Create submodule instances.
26
+ */
27
+ this.universal = new UniversalModule(this)
28
+ }
29
+ }
30
+
31
+ module.exports = ZenotiSDK
@@ -0,0 +1,206 @@
1
+ 'use strict'
2
+
3
+ const _ = require('lodash')
4
+
5
+ const BaseSDK = require('./Base')
6
+ const AccountModule = require('./submodules/zudello/Account')
7
+ const AccountGroupModule = require('./submodules/zudello/AccountGroup')
8
+ const AccountingPeriodModule = require('./submodules/zudello/AccountingPeriod')
9
+ const CostCentreModule = require('./submodules/zudello/CostCentre')
10
+ const CostTypeModule = require('./submodules/zudello/CostType')
11
+ const CustomerModule = require('./submodules/zudello/Customer')
12
+ const CustomerCategoryModule = require('./submodules/zudello/CustomerCategory')
13
+ const CustomerGroupModule = require('./submodules/zudello/CustomerGroup')
14
+ const CurrencyModule = require('./submodules/zudello/Currency')
15
+ const DepartmentModule = require('./submodules/zudello/Department')
16
+ const EmployeeModule = require('./submodules/zudello/Employee')
17
+ const SubsidiaryModule = require('./submodules/zudello/Subsidiary')
18
+ const LocationModule = require('./submodules/zudello/Location')
19
+ const TaxRateModule = require('./submodules/zudello/tax/Rate')
20
+ const TaxSolutionModule = require('./submodules/zudello/tax/Solution')
21
+ const ItemModule = require('./submodules/zudello/Item')
22
+ const ItemCategoryModule = require('./submodules/zudello/ItemCategory')
23
+ const ItemGroupModule = require('./submodules/zudello/ItemGroup')
24
+ const PurchaseOrderModule = require('./submodules/zudello/PurchaseOrder')
25
+ const PaymentTermModule = require('./submodules/zudello/PaymentTerm')
26
+ const PaymentMethodModule = require('./submodules/zudello/PaymentMethod')
27
+ const ProjectModule = require('./submodules/zudello/Project')
28
+ const ProjectGroupModule = require('./submodules/zudello/ProjectGroup')
29
+ const ProjectTaskModule = require('./submodules/zudello/ProjectTask')
30
+ const SupplierCategoryModule = require('./submodules/zudello/SupplierCategory')
31
+ const SupplierGroupModule = require('./submodules/zudello/SupplierGroup')
32
+ const UomModule = require('./submodules/zudello/Uom')
33
+ const WarehouseModule = require('./submodules/zudello/Warehouse')
34
+ const ZoneModule = require('./submodules/zudello/Zone')
35
+ const SupplierModule = require('./submodules/zudello/Supplier')
36
+ const FixedAssetModule = require('./submodules/zudello/FixedAsset')
37
+ const UniversalModule = require('./submodules/zudello/Universal')
38
+
39
+ class ZudelloSDK extends BaseSDK {
40
+ /**
41
+ * Constructor.
42
+ * @param {class} auth Auth class object with authorized api instance.
43
+ * @param {string} connectionUUID The UUID of the Connection we're working on.
44
+ */
45
+ constructor (auth, organizationUUID, apiURL, apiVersion, loggerClass = null) {
46
+ super({
47
+ auth,
48
+ organizationUUID,
49
+ apiURL,
50
+ apiVersion,
51
+ isExternal: false,
52
+ integrationName: 'Zudello',
53
+ loggerClass
54
+ })
55
+
56
+ this.staticFieldsForUpdate = {
57
+ enrich: false,
58
+ extractedEvent: false,
59
+ update: true
60
+ }
61
+
62
+ /**
63
+ * Create submodule instances.
64
+ */
65
+ this.account = new AccountModule(this)
66
+ this.accountGroup = new AccountGroupModule(this)
67
+ this.accountingPeriod = new AccountingPeriodModule(this)
68
+ this.costCentre = new CostCentreModule(this)
69
+ this.costType = new CostTypeModule(this)
70
+ this.customer = new CustomerModule(this)
71
+ this.customerCategory = new CustomerCategoryModule(this)
72
+ this.customerGroup = new CustomerGroupModule(this)
73
+ this.currency = new CurrencyModule(this)
74
+ this.department = new DepartmentModule(this)
75
+ this.employee = new EmployeeModule(this)
76
+ this.subsidiary = new SubsidiaryModule(this)
77
+ this.location = new LocationModule(this)
78
+ this.item = new ItemModule(this)
79
+ this.itemCategory = new ItemCategoryModule(this)
80
+ this.itemGroup = new ItemGroupModule(this)
81
+ this.purchaseOrder = new PurchaseOrderModule(this)
82
+ this.paymentTerm = new PaymentTermModule(this)
83
+ this.paymentMethod = new PaymentMethodModule(this)
84
+ this.project = new ProjectModule(this)
85
+ this.projectGroup = new ProjectGroupModule(this)
86
+ this.projectTask = new ProjectTaskModule(this)
87
+ this.supplierCategory = new SupplierCategoryModule(this)
88
+ this.supplierGroup = new SupplierGroupModule(this)
89
+ this.warehouse = new WarehouseModule(this)
90
+ this.uom = new UomModule(this)
91
+ this.zone = new ZoneModule(this)
92
+ this.supplier = new SupplierModule(this)
93
+ this.fixedAsset = new FixedAssetModule(this)
94
+ this.universal = new UniversalModule(this)
95
+ this.tax = {
96
+ rate: new TaxRateModule(this),
97
+ solution: new TaxSolutionModule(this)
98
+ }
99
+ }
100
+
101
+ async search ({ model, select, filter, orderBy = ['-created_at'], offset = 0, limit = 100 }) {
102
+ const validateIsEmpty = this.validator.isEmpty({ model, select, filter })
103
+
104
+ if (!validateIsEmpty.valid) {
105
+ return this.responseHandler.error(validateIsEmpty.errors)
106
+ }
107
+
108
+ return await this.makeRequest('POST', `${this.apiURL}/team-data/${this.apiVersion}/resources/search`, {
109
+ model,
110
+ offset,
111
+ limit,
112
+ select,
113
+ order_by: orderBy,
114
+ filter,
115
+ exclude: {},
116
+ annotate: {}
117
+ })
118
+ }
119
+
120
+ async fetch ({ model, uuid, fetchDetails = true, simplified = true }) {
121
+ const validateIsEmpty = this.validator.isEmpty({ model, uuid })
122
+
123
+ if (!validateIsEmpty.valid) {
124
+ return this.responseHandler.error(validateIsEmpty.errors)
125
+ }
126
+
127
+ return await this.makeRequest('GET', `${this.apiURL}/team-data/${this.apiVersion}/resources`, {
128
+ model,
129
+ uuid,
130
+ fetch_details: fetchDetails,
131
+ simplified,
132
+ })
133
+ }
134
+
135
+ async getFileAttachment ({ uuid, type }) {
136
+ const validateIsEmpty = this.validator.isEmpty({ uuid, type })
137
+
138
+ if (!validateIsEmpty.valid) {
139
+ return this.responseHandler.error(validateIsEmpty.errors)
140
+ }
141
+
142
+ if (!['EXTRACTED', 'OCR'].includes(type)) {
143
+ return this.responseHandler.error('The attachment type can either be EXTRACTED or OCR')
144
+ }
145
+
146
+ return await this.makeRequest('GET', `${this.apiURL}/team-data/${this.apiVersion}/files/download/Transaction/${uuid}/${type}`, {}, {}, true)
147
+ }
148
+
149
+ async update ({ model, module = null, submodule = null, data, clearNulls = true, simplified = false, submit = false, updateStatus = false }) {
150
+ const validateIsEmpty = this.validator.isEmpty({ model, data })
151
+
152
+ if (!validateIsEmpty.valid) {
153
+ return this.responseHandler.error(validateIsEmpty.errors)
154
+ }
155
+
156
+ data = this.mapUpdateOrCreateData({
157
+ data: [data],
158
+ staticFields: {
159
+ ...this.staticFieldsForUpdate,
160
+ model,
161
+ module,
162
+ submodule
163
+ },
164
+ submit,
165
+ updateStatus
166
+ })
167
+
168
+ return await this.updateOrCreate({ data, clearNulls, simplified })
169
+ }
170
+
171
+ async updateOrCreate ({ data, clearNulls = true, simplified = false }) {
172
+ const validateIsEmpty = this.validator.isEmpty({ data })
173
+
174
+ if (!validateIsEmpty.valid) {
175
+ return this.responseHandler.error(validateIsEmpty.errors)
176
+ }
177
+
178
+ return await this.makeRequest('POST', `${this.apiURL}/team-data/${this.apiVersion}/resources/update_or_create`, {
179
+ simplified,
180
+ clear_nulls: clearNulls,
181
+ data
182
+ })
183
+ }
184
+
185
+ mapUpdateOrCreateData ({ data = [], staticFields = {}, submit = false, updateStatus = false }) {
186
+ return _.map(data, (item) => {
187
+ return {
188
+ data: {
189
+ module: staticFields.module,
190
+ submodule: staticFields.submodule,
191
+ document_type: staticFields.documentType,
192
+ ...item
193
+ },
194
+ model: staticFields.model,
195
+ submit: submit,
196
+ enrich: staticFields.enrich,
197
+ extracted_event: staticFields.extractedEvent,
198
+ update_status: updateStatus,
199
+ update: staticFields.update,
200
+ create: staticFields.create
201
+ }
202
+ })
203
+ }
204
+ }
205
+
206
+ module.exports = ZudelloSDK