sfmc-sdk 2.1.3 → 3.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.
@@ -17,7 +17,7 @@ jobs:
17
17
  runs-on: ubuntu-latest
18
18
  strategy:
19
19
  matrix:
20
- node: [20, 22, 24]
20
+ node: ["20.19", 22, 24, 25]
21
21
  name: Run Tests with node ${{ matrix.node }}
22
22
  steps:
23
23
  - uses: actions/checkout@v4
@@ -1 +1 @@
1
- {"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../lib/rest.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;IACI;;;;;;OAMG;IACH,wBAHW,MAAM,WACN,MAAM,EAUhB;IAPG,UAAsB;IACtB,aAAsB;IACtB,4BAIC;IAGL;;;;;OAKG;IACH,SAHW,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;;OAMG;IACH,mCAEC;IACD;;;;;;OAMG;IACH,qBAEC;IACD;;;;;;;OAOG;IACH,aALW,MAAM,aACN,MAAM,kBACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAmFzB;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,oBACR,MAAM,GACJ,OAAO,OAAQ,CAmB3B;IACD;;;;;;;OAOG;IACH,UALW,MAAM,WACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;;;OAOG;IACH,SALW,MAAM,WACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;;;OAOG;IACH,WALW,MAAM,WACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;OAKG;IACH,YAHW,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAWzB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,qBACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAiDzB;CACJ"}
1
+ {"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../lib/rest.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;IACI;;;;;;OAMG;IACH,wBAHW,MAAM,WACN,MAAM,EAUhB;IAPG,UAAsB;IACtB,aAAsB;IACtB,4BAIC;IAGL;;;;;OAKG;IACH,SAHW,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;;OAMG;IACH,mCAEC;IACD;;;;;;OAMG;IACH,qBAEC;IACD;;;;;;;OAOG;IACH,aALW,MAAM,aACN,MAAM,kBACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAoFzB;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,oBACR,MAAM,GACJ,OAAO,OAAQ,CAmB3B;IACD;;;;;;;OAOG;IACH,UALW,MAAM,WACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;;;OAOG;IACH,SALW,MAAM,WACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;;;OAOG;IACH,WALW,MAAM,WACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAUzB;IACD;;;;;OAKG;IACH,YAHW,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAWzB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,qBACN,MAAM,YACN,MAAM,GACJ,OAAO,CAAE,GAAG,CAAC,CAiDzB;CACJ"}
package/eslint.config.js CHANGED
@@ -7,9 +7,9 @@ import js from '@eslint/js';
7
7
 
8
8
  export default [
9
9
  js.configs.recommended,
10
- mochaPlugin.configs.flat.recommended,
10
+ mochaPlugin.configs.recommended,
11
11
  jsdoc.configs['flat/recommended'],
12
- eslintPluginUnicorn.configs['flat/recommended'],
12
+ eslintPluginUnicorn.configs.recommended,
13
13
  {
14
14
  files: ['**/*.js'],
15
15
  plugins: {
package/lib/rest.js CHANGED
@@ -79,7 +79,8 @@ export default class Rest {
79
79
  const isLegacyApi = this._isLegacyApi(baseUrl);
80
80
  const queryParameters = new URLSearchParams(url.split('?')[1]);
81
81
  let collector;
82
- let shouldPaginate = false;
82
+ /** @type {boolean} */
83
+ let shouldPaginate;
83
84
  let pageSizeKey = '$pageSize';
84
85
  let pageKey = '$page';
85
86
  let countKey = 'count';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfmc-sdk",
3
- "version": "2.1.3",
3
+ "version": "3.0.0",
4
4
  "description": "Libarary to simplify SFMC requests with updated dependencies and less overhead",
5
5
  "main": "./lib/index.js",
6
6
  "exports": {
@@ -35,7 +35,7 @@
35
35
  "license": "BSD-3-Clause",
36
36
  "dependencies": {
37
37
  "axios": "^1.7.2",
38
- "fast-xml-parser": "5.3.4",
38
+ "fast-xml-parser": "5.3.7",
39
39
  "p-limit": "5.0.0"
40
40
  },
41
41
  "keywords": [
@@ -50,30 +50,30 @@
50
50
  "sdk"
51
51
  ],
52
52
  "devDependencies": {
53
- "@eslint/js": "9.39.2",
54
- "@types/mocha": "10.0.7",
55
- "@types/node": "25.2.1",
53
+ "@eslint/js": "10.0.1",
54
+ "@types/mocha": "10.0.10",
55
+ "@types/node": "25.3.0",
56
56
  "assert": "2.1.0",
57
- "axios-mock-adapter": "1.22.0",
58
- "c8": "10.1.2",
59
- "chai": "5.1.1",
60
- "eslint": "9.39.2",
61
- "eslint-config-prettier": "9.1.0",
62
- "eslint-plugin-jsdoc": "62.5.2",
63
- "eslint-plugin-mocha": "10.4.3",
64
- "eslint-plugin-prettier": "5.1.3",
65
- "eslint-plugin-unicorn": "62.0.0",
57
+ "axios-mock-adapter": "2.1.0",
58
+ "c8": "10.1.3",
59
+ "chai": "6.2.2",
60
+ "eslint": "10.0.0",
61
+ "eslint-config-prettier": "10.1.8",
62
+ "eslint-plugin-jsdoc": "62.7.0",
63
+ "eslint-plugin-mocha": "11.2.0",
64
+ "eslint-plugin-prettier": "5.5.5",
65
+ "eslint-plugin-unicorn": "63.0.0",
66
66
  "husky": "9.1.7",
67
67
  "mocha": "11.7.5",
68
68
  "npm-run-all": "4.1.5",
69
- "prettier": "3.3.2",
70
- "prettier-eslint": "16.3.0",
71
- "sinon": "18.0.0",
69
+ "prettier": "3.8.1",
70
+ "prettier-eslint": "16.4.2",
71
+ "sinon": "21.0.1",
72
72
  "typescript": "5.9.3"
73
73
  },
74
74
  "engines": {
75
75
  "npm": ">=9",
76
- "node": ">=18"
76
+ "node": "^20.19.0 || ^22.13.0 || >=24"
77
77
  },
78
78
  "type": "module"
79
79
  }
package/test/soap.test.js CHANGED
@@ -12,17 +12,19 @@ const addHandler = (metadata) => {
12
12
  asymmetricMatch: XMLValidator.validate,
13
13
  },
14
14
  {
15
- /**
16
- * matcher based on headers
17
- *
18
- * @param {object} headers which should be passed for matching
19
- * @returns {boolean} if value matches
20
- */
21
- asymmetricMatch(headers) {
22
- return (
23
- headers['SOAPAction'] === metadata.action &&
24
- headers['Content-Type'] === 'text/xml'
25
- );
15
+ headers: {
16
+ /**
17
+ * matcher based on headers
18
+ *
19
+ * @param {object} headers which should be passed for matching
20
+ * @returns {boolean} if value matches
21
+ */
22
+ asymmetricMatch(headers) {
23
+ return (
24
+ headers['SOAPAction'] === metadata.action &&
25
+ headers['Content-Type'] === 'text/xml'
26
+ );
27
+ },
26
28
  },
27
29
  }
28
30
  ).reply(metadata.status, metadata.response, {
@@ -74,17 +76,19 @@ describe('soap', function () {
74
76
  asymmetricMatch: XMLValidator.validate,
75
77
  },
76
78
  {
77
- /**
78
- * matcher based on headers
79
- *
80
- * @param {object} headers which should be passed for matching
81
- * @returns {boolean} if value matches
82
- */
83
- asymmetricMatch(headers) {
84
- return (
85
- headers['SOAPAction'] === resources.retrieveBulkDataExtension.action &&
86
- headers['Content-Type'] === 'text/xml'
87
- );
79
+ headers: {
80
+ /**
81
+ * matcher based on headers
82
+ *
83
+ * @param {object} headers which should be passed for matching
84
+ * @returns {boolean} if value matches
85
+ */
86
+ asymmetricMatch(headers) {
87
+ return (
88
+ headers['SOAPAction'] === resources.retrieveBulkDataExtension.action &&
89
+ headers['Content-Type'] === 'text/xml'
90
+ );
91
+ },
88
92
  },
89
93
  }
90
94
  )
@@ -101,17 +105,19 @@ describe('soap', function () {
101
105
  asymmetricMatch: XMLValidator.validate,
102
106
  },
103
107
  {
104
- /**
105
- * matcher based on headers
106
- *
107
- * @param {object} headers which should be passed for matching
108
- * @returns {boolean} if value matches
109
- */
110
- asymmetricMatch(headers) {
111
- return (
112
- headers['SOAPAction'] === resources.retrieveDataExtension.action &&
113
- headers['Content-Type'] === 'text/xml'
114
- );
108
+ headers: {
109
+ /**
110
+ * matcher based on headers
111
+ *
112
+ * @param {object} headers which should be passed for matching
113
+ * @returns {boolean} if value matches
114
+ */
115
+ asymmetricMatch(headers) {
116
+ return (
117
+ headers['SOAPAction'] === resources.retrieveDataExtension.action &&
118
+ headers['Content-Type'] === 'text/xml'
119
+ );
120
+ },
115
121
  },
116
122
  }
117
123
  )
@@ -383,17 +389,19 @@ describe('soap', function () {
383
389
  asymmetricMatch: XMLValidator.validate,
384
390
  },
385
391
  {
386
- /**
387
- * matcher based on headers
388
- *
389
- * @param {object} headers which should be passed for matching
390
- * @returns {boolean} if value matches
391
- */
392
- asymmetricMatch(headers) {
393
- return (
394
- headers['SOAPAction'] === resources.retrieveDataExtension.action &&
395
- headers['Content-Type'] === 'text/xml'
396
- );
392
+ headers: {
393
+ /**
394
+ * matcher based on headers
395
+ *
396
+ * @param {object} headers which should be passed for matching
397
+ * @returns {boolean} if value matches
398
+ */
399
+ asymmetricMatch(headers) {
400
+ return (
401
+ headers['SOAPAction'] === resources.retrieveDataExtension.action &&
402
+ headers['Content-Type'] === 'text/xml'
403
+ );
404
+ },
397
405
  },
398
406
  }
399
407
  )
package/tsconfig.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compilerOptions": {
5
5
  "module": "nodenext",
6
6
  "moduleResolution": "nodenext",
7
- "target": "es2022",
7
+ "target": "es2023",
8
8
  "checkJs": true,
9
9
  "skipLibCheck": true,
10
10
  // Tells TypeScript to read JS files, as
@@ -4,7 +4,7 @@
4
4
  "compilerOptions": {
5
5
  "module": "nodenext",
6
6
  "moduleResolution": "nodenext",
7
- "target": "es2022",
7
+ "target": "es2023",
8
8
  "checkJs": true,
9
9
  "skipLibCheck": true,
10
10
  "noEmit": true
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "module": "nodenext",
5
5
  "moduleResolution": "nodenext",
6
- "target": "es2022",
6
+ "target": "es2023",
7
7
  "checkJs": true,
8
8
  "skipLibCheck": true,
9
9
  "allowJs": true,