zudello-integration-sdk 1.0.53 → 1.0.54

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/README.md CHANGED
@@ -1 +1,18 @@
1
- # integration-sdk
1
+ # Integration SDK
2
+
3
+ ## Update Flow
4
+ #### Integration SDK
5
+ - Increment version in package.json
6
+ - Commit changes
7
+ - Run: `npm publish`
8
+
9
+ #### Integration Local
10
+ - Update `zudello-integration-sdk` version in package.json
11
+ - Increment version in package.json
12
+ - Commit changes
13
+ - Run: `npm publish`
14
+
15
+ **NOTE:** Users will need to run the following to update their global install:
16
+ ```
17
+ npm install -g zudello-execute-local@latest
18
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudello-integration-sdk",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "Zudello Integrations SDK",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
@@ -27,7 +27,7 @@ const handler = async (providedData) => {
27
27
  "invoiceDate": moment(_.get(data, "data.date_issued")).format('YYYY-MM-DD'),
28
28
  "postingDate": datePosted,
29
29
  "pricesIncludeTax": _.get(data, "tax_included"),
30
- "vendorInvoiceNumber": _.get(data, "data.document_number"), // Must be passed as a string regardless of type
30
+ "vendorInvoiceNumber": _.get(data, "data.document_number"), // Must be passed as a string regardless of type
31
31
  "vendorNumber": _.get(data, "data.supplier.code") // Must be passed as a string regardless of type
32
32
  }
33
33
 
@@ -9,7 +9,7 @@ class Dynamic365SDK extends BaseSDK {
9
9
  * @param {class} auth Auth class object with authorized api instance.
10
10
  * @param {string} connectionUUID The UUID of the Connection we're working on.
11
11
  */
12
- constructor (auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
12
+ constructor(auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
13
13
  super({
14
14
  auth,
15
15
  connectionUUID,
@@ -5,7 +5,7 @@ class UniversalModule {
5
5
  * Constructor.
6
6
  * @param {class} parentModule Object of BusinessCentral class.
7
7
  */
8
- constructor (parentModule) {
8
+ constructor(parentModule) {
9
9
  this.module = parentModule
10
10
  }
11
11
 
@@ -19,7 +19,7 @@ class UniversalModule {
19
19
  * @param {string} apiGroup API Group.
20
20
  * @returns {object} Universal Request Response.
21
21
  */
22
- async request ({ url, method, qs = {}, body = {}, apiProvider = null, apiGroup = null }) {
22
+ async request({ url, method, qs = {}, body = {}, apiProvider = null, apiGroup = null }) {
23
23
  const validateIsEmpty = this.module.validator.isEmpty({ url, method })
24
24
 
25
25
  if (!validateIsEmpty.valid) {
@@ -60,13 +60,13 @@ class UniversalModule {
60
60
  })
61
61
  }
62
62
 
63
- /**
64
- * Attach a File to Business Central.
65
- * @param {string} fileURL URL of the file to be attached.
66
- * @param {string} url URL of request.
67
- * @returns {object} Universal Request Response.
68
- */
69
- async attach ({ fileURL, url, apiProvider = null, apiGroup = null }) {
63
+ /**
64
+ * Attach a File to Business Central.
65
+ * @param {string} fileURL URL of the file to be attached.
66
+ * @param {string} url URL of request.
67
+ * @returns {object} Universal Request Response.
68
+ */
69
+ async attach({ fileURL, url, apiProvider = null, apiGroup = null }) {
70
70
  const validateIsEmpty = this.module.validator.isEmpty({ url, fileURL })
71
71
 
72
72
  if (!validateIsEmpty.valid) {
@@ -108,7 +108,7 @@ class UniversalModule {
108
108
  * @param {string} apiGroup API Group.
109
109
  * @returns {object} Universal List Response.
110
110
  */
111
- async list ({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
111
+ async list({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
112
112
  const validateIsEmpty = this.module.validator.isEmpty({ url, method })
113
113
 
114
114
  if (!validateIsEmpty.valid) {
@@ -135,7 +135,7 @@ class UniversalModule {
135
135
  * @param {string} apiGroup API Group.
136
136
  * @returns {object} Auto Pagination responses.
137
137
  */
138
- async * autoPaginationList ({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
138
+ async * autoPaginationList({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
139
139
  if (!qs.$skip) {
140
140
  qs.$skip = 0
141
141
  }
@@ -5,7 +5,7 @@ class UniversalModule {
5
5
  * Constructor.
6
6
  * @param {class} parentModule Object of BusinessCentral class.
7
7
  */
8
- constructor (parentModule) {
8
+ constructor(parentModule) {
9
9
  this.module = parentModule
10
10
  }
11
11
 
@@ -19,7 +19,7 @@ class UniversalModule {
19
19
  * @param {string} apiGroup API Group.
20
20
  * @returns {object} Universal Request Response.
21
21
  */
22
- async request ({ url, method, qs = {}, body = {} }) {
22
+ async request({ url, method, qs = {}, body = {} }) {
23
23
  const validateIsEmpty = this.module.validator.isEmpty({ url, method })
24
24
 
25
25
  if (!validateIsEmpty.valid) {
@@ -48,14 +48,17 @@ class UniversalModule {
48
48
  })
49
49
  }
50
50
 
51
- /**
52
- * Attach a File to Business Central.
53
- * @param {string} fileURL URL of the file to be attached.
54
- * @param {string} url URL of request.
51
+ /**
52
+ * Attach a file to SharePoint from a URL.
53
+ * @param {string} driveID The ID of the SharePoint drive.
54
+ * @param {string} folderID The ID of the folder where the file will be attached.
55
+ * @param {string} url URL of the file to be attached.
56
+ * @param {string} fileName The name to be given to the file when attached.
57
+ * @param {string} mimeType The MIME type of the file.
55
58
  * @returns {object} Universal Request Response.
56
59
  */
57
- async attach ({ driveID, folderID, url, fileName, mimeType }) {
58
- const validateIsEmpty = this.module.validator.isEmpty({ url, fileURL })
60
+ async attach({ driveID, folderID, url, fileName, mimeType }) {
61
+ const validateIsEmpty = this.module.validator.isEmpty({ driveID, folderID, url, fileName, mimeType })
59
62
 
60
63
  if (!validateIsEmpty.valid) {
61
64
  return this.module.responseHandler.error(validateIsEmpty.errors)
@@ -72,7 +75,7 @@ class UniversalModule {
72
75
  value: url
73
76
  },
74
77
  fileName: {
75
- value: fileName
78
+ value: fileName
76
79
  },
77
80
  mimeType: {
78
81
  value: mimeType
@@ -93,7 +96,7 @@ class UniversalModule {
93
96
  * @param {string} apiGroup API Group.
94
97
  * @returns {object} Universal List Response.
95
98
  */
96
- async list ({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
99
+ async list({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
97
100
  const validateIsEmpty = this.module.validator.isEmpty({ url, method })
98
101
 
99
102
  if (!validateIsEmpty.valid) {
@@ -120,7 +123,7 @@ class UniversalModule {
120
123
  * @param {string} apiGroup API Group.
121
124
  * @returns {object} Auto Pagination responses.
122
125
  */
123
- async * autoPaginationList ({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
126
+ async * autoPaginationList({ url, method, qs = {}, apiProvider = null, apiGroup = null }) {
124
127
  if (!qs.$skip) {
125
128
  qs.$skip = 0
126
129
  }