zudello-integration-sdk 1.0.28 → 1.0.30

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,24 +1,24 @@
1
1
  {
2
- "name": "zudello-integration-sdk",
3
- "version": "1.0.28",
4
- "description": "Zudello Integrations SDK",
5
- "main": "./src/index.js",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/zudello/integration-sdk.git"
9
- },
10
- "files": [
11
- "src"
12
- ],
13
- "dependencies": {
14
- "@aws-sdk/client-s3": "^3.658.0",
15
- "axios": "^1.6.7",
16
- "circular-json": "^0.5.9",
17
- "dotenv": "^16.4.5",
18
- "lodash": "^4.17.21",
19
- "moment-timezone": "^0.5.45",
20
- "perf_hooks": "^0.0.1",
21
- "standard": "^17.1.0"
22
- },
23
- "license": "MIT"
2
+ "name": "zudello-integration-sdk",
3
+ "version": "1.0.30",
4
+ "description": "Zudello Integrations SDK",
5
+ "main": "./src/index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/zudello/integration-sdk.git"
9
+ },
10
+ "files": [
11
+ "src"
12
+ ],
13
+ "dependencies": {
14
+ "@aws-sdk/client-s3": "^3.658.0",
15
+ "axios": "^1.6.7",
16
+ "circular-json": "^0.5.9",
17
+ "dotenv": "^16.4.5",
18
+ "lodash": "^4.17.21",
19
+ "moment-timezone": "^0.5.45",
20
+ "perf_hooks": "^0.0.1",
21
+ "standard": "^17.1.0"
22
+ },
23
+ "license": "MIT"
24
24
  }
@@ -188,6 +188,7 @@ class ZudelloSDK extends BaseSDK {
188
188
  simplified = false,
189
189
  submit = false,
190
190
  updateStatus = false,
191
+ enrich = false
191
192
  }) {
192
193
  const validateIsEmpty = this.validator.isEmpty({ model, data });
193
194
 
@@ -199,6 +200,7 @@ class ZudelloSDK extends BaseSDK {
199
200
  data: [data],
200
201
  staticFields: {
201
202
  ...this.staticFieldsForUpdate,
203
+ enrich,
202
204
  model,
203
205
  module,
204
206
  submodule,
@@ -3,7 +3,7 @@
3
3
  class UniversalModule {
4
4
  /**
5
5
  * Constructor.
6
- * @param {class} parentModule Object of SAP B1 class.
6
+ * @param {class} parentModule Object of GP class.
7
7
  */
8
8
  constructor(parentModule) {
9
9
  this.module = parentModule;
@@ -19,7 +19,7 @@ class UniversalModule {
19
19
  * @returns {object} Universal Request Response.
20
20
  */
21
21
  async request({ command = "fetch_sql", qs = {}, body = {} }) {
22
- const validateIsEmpty = this.module.validator.isEmpty({ url, method });
22
+ const validateIsEmpty = this.module.validator.isEmpty({ command });
23
23
 
24
24
  if (!validateIsEmpty.valid) {
25
25
  return this.module.responseHandler.error(validateIsEmpty.errors);
@@ -53,17 +53,18 @@ class UniversalModule {
53
53
  * Universal List By URL.
54
54
  * @param {number} offset Offset of listed data.
55
55
  * @param {number} limit Limit of listed data.
56
- * @param {string} query Query of listed data.
57
56
  * @returns {object} Universal List Response.
58
57
  */
59
- async list({ offset = 0, limit = 100, query = "" }) {
60
- return await this.request({
61
- body: {
62
- query,
63
- offset,
64
- limit,
65
- },
66
- });
58
+ async list({ command = "fetch_sql", qs = {}, body = {}, offset = 0, limit = 10 }) {
59
+ const validateIsEmpty = this.module.validator.isEmpty({ command, sql: body.sql });
60
+
61
+ if (!validateIsEmpty.valid) {
62
+ return this.module.responseHandler.error(validateIsEmpty.errors);
63
+ }
64
+
65
+ body.sql = `${body.sql} OFFSET ${offset} LIMIT ${limit};`;
66
+
67
+ return await this.request({ command, qs, body });
67
68
  }
68
69
  }
69
70
 
@@ -9,7 +9,7 @@ class CreditModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class ExpenseModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class InvoiceModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class CreditModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class ExpenseModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class InvoiceModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class ExpenseModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class CreditModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class InvoiceModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {
@@ -9,7 +9,7 @@ class ExpenseModule {
9
9
  this.module = parentModule;
10
10
  }
11
11
 
12
- async create({ data }) {
12
+ async create({ body }) {
13
13
  const validateIsEmpty = this.module.validator.isEmpty({ body });
14
14
 
15
15
  if (!validateIsEmpty.valid) {