@arrowsphere/api-client 3.227.0 → 3.228.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.
package/CHANGELOG.md CHANGED
@@ -3,9 +3,17 @@
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [3.228.0] - 2025.12.09
7
+
8
+ ### Added
9
+
10
+ - [Project Security] Update multiple libraries to fix security vulnerabilities and add ci to check vulnerabilities
11
+
12
+
6
13
  ## [3.227.0] - 2025.11.26
7
14
 
8
15
  ### Added
16
+
9
17
  - [campaigns] Add field campaignPopup and all subfield needed
10
18
 
11
19
  ## [3.226.0] - 2025.11.20
package/Makefile CHANGED
@@ -1,14 +1,47 @@
1
+ .PHONY: help install build clean test test-unit audit check-deps dedupe audits check-registry
2
+
3
+ help:
4
+ @echo "\033[1;36mInstallation:\033[0m" \
5
+ && echo " \033[1;32minstall \033[0m : Install dependencies (yarn install --frozen-lockfile)" \
6
+ && echo " \033[1;32minstall-mutable \033[0m : Update yarn.lock from package.json (yarn install)" \
7
+ && echo "" \
8
+ && echo "\033[1;36mBuild & Clean:\033[0m" \
9
+ && echo " \033[1;32mbuild \033[0m : Build the project (yarn build)" \
10
+ && echo " \033[1;32mclean \033[0m : Remove build and node_modules folders" \
11
+ && echo "" \
12
+ && echo "\033[1;36mTests:\033[0m" \
13
+ && echo " \033[1;32mtest \033[0m : Run unit tests" \
14
+ && echo " \033[1;32mtest-unit \033[0m : Run unit tests (alias for test)" \
15
+ && echo "" \
16
+ && echo "\033[1;36mAudit & Dependencies:\033[0m" \
17
+ && echo " \033[1;32maudit \033[0m : Security audit of dependencies (yarn audit)" \
18
+ && echo " \033[1;32mcheck-deps \033[0m : Check for unused dependencies (depcheck)" \
19
+ && echo " \033[1;32mdedupe \033[0m : Deduplicate dependencies in yarn.lock" \
20
+ && echo " \033[1;32mcheck-registry\033[0m : Ensure all dependencies come from npmjs.org or yarnpkg.com"
21
+
1
22
  install:
23
+ yarn install --frozen-lockfile
24
+
25
+ install-mutable:
2
26
  yarn install
3
27
 
4
28
  build:
5
29
  yarn build
6
30
 
7
31
  clean:
8
- rm -rf build \
9
- node_modules
32
+ rm -rf build node_modules
10
33
 
11
34
  test: test-unit
12
35
 
13
36
  test-unit:
14
37
  yarn test
38
+
39
+ audit:
40
+ yarn audit
41
+
42
+ dedupe:
43
+ yarn dedupe && yarn install --frozen-lockfile
44
+
45
+ check-registry:
46
+ @echo "\033[1;36mChecking that all dependencies come from npmjs.org or yarnpkg.com...\033[0m"
47
+ @awk '/^ resolved / {print $$2}' yarn.lock | grep -Ev 'npmjs.org|yarnpkg.com' && (echo '\033[1;31mSome dependencies are not from npmjs.org or yarnpkg.com!\033[0m' && exit 1) || echo '\033[1;32mAll dependencies are from npmjs.org or yarnpkg.com.\033[0m'
package/README.md CHANGED
@@ -10,6 +10,10 @@ It should be the only way to make calls to ArrowSphere's API with Node.js code.
10
10
 
11
11
  To use this package, you need valid access to ArrowSphere, with a valid API key.
12
12
 
13
+ # ⚠️ Security Disclaimer
14
+
15
+ **Please exercise extreme caution when installing new dependencies. Always verify the source and reputation of any library before adding it to your project, to avoid introducing malicious packages.**
16
+
13
17
  ## Installation
14
18
 
15
19
  Install the latest version with
@@ -1,8 +1,7 @@
1
- import { GraphQLClient } from 'graphql-request';
2
- import * as Dom from 'graphql-request/dist/types.dom';
3
1
  import { Options } from './abstractRestfulClient';
4
2
  import { GetProductsType } from './catalog';
5
3
  import { AbstractHttpClient } from './AbstractHttpClient';
4
+ import { GraphQLClient } from 'graphql-request';
6
5
  export declare type GraphQLResponseTypes = GetProductsType;
7
6
  export declare abstract class AbstractGraphQLClient extends AbstractHttpClient {
8
7
  /**
@@ -10,7 +9,7 @@ export declare abstract class AbstractGraphQLClient extends AbstractHttpClient {
10
9
  * Use getClientInstance() to access it.
11
10
  */
12
11
  protected graphQLClient: GraphQLClient;
13
- protected optionsHeader?: Dom.RequestInit['headers'];
12
+ protected optionsHeader?: RequestInit['headers'];
14
13
  protected options: Options;
15
14
  private getClientInstance;
16
15
  setOptions(options: Options): this;
@@ -24,10 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.AbstractGraphQLClient = void 0;
27
- const graphql_request_1 = require("graphql-request");
28
27
  const path = __importStar(require("path"));
29
28
  const json_to_graphql_query_1 = require("json-to-graphql-query");
30
29
  const AbstractHttpClient_1 = require("./AbstractHttpClient");
30
+ const graphql_request_1 = require("graphql-request");
31
31
  class AbstractGraphQLClient extends AbstractHttpClient_1.AbstractHttpClient {
32
32
  constructor() {
33
33
  super(...arguments);
@@ -34,7 +34,7 @@ export declare enum FileUploadKeys {
34
34
  }
35
35
  export declare type Payload = Record<string, unknown> | Array<Payload>;
36
36
  export interface PayloadWithFile {
37
- [FileUploadKeys.Fields]?: Record<string, unknown>;
37
+ [FileUploadKeys.Fields]?: Record<string, File>;
38
38
  [FileUploadKeys.File]?: File;
39
39
  }
40
40
  export declare type Options = {
@@ -209,7 +209,7 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
209
209
  * @param options - Options to send
210
210
  */
211
211
  async postFile(payload, parameters = {}, headers = {}, options = {}) {
212
- var _a;
212
+ var _a, _b;
213
213
  if (!payload[FileUploadKeys.File]) {
214
214
  throw new Error('File upload required');
215
215
  }
@@ -220,8 +220,8 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
220
220
  headers: this.prepareHeaders(headers),
221
221
  };
222
222
  const formData = new FormData();
223
- formData.append(FileUploadKeys.File, payload[FileUploadKeys.File]);
224
- for (const [key, value] of Object.entries((_a = payload[FileUploadKeys.Fields]) !== null && _a !== void 0 ? _a : {})) {
223
+ formData.append(FileUploadKeys.File, (_a = payload[FileUploadKeys.File]) !== null && _a !== void 0 ? _a : '');
224
+ for (const [key, value] of Object.entries((_b = payload[FileUploadKeys.Fields]) !== null && _b !== void 0 ? _b : {})) {
225
225
  console.log(`${key}: ${value}`);
226
226
  formData.set(key, value);
227
227
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/ArrowSphere/nodejs-api-client.git"
6
6
  },
7
- "version": "3.227.0",
7
+ "version": "3.228.0",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",
@@ -34,9 +34,9 @@
34
34
  "@types/validatorjs": "3.15.0",
35
35
  "@types/chai": "4.2.15",
36
36
  "@types/chai-as-promised": "7.1.3",
37
- "@types/lodash": "^4.14.191",
37
+ "@types/lodash": "4.14.191",
38
38
  "@types/mocha": "8.2.0",
39
- "@types/node": "^18.19.9",
39
+ "@types/node": "18.19.9",
40
40
  "@types/sinon": "9.0.10",
41
41
  "@types/sinon-chai": "3.2.5",
42
42
  "@typescript-eslint/eslint-plugin": "5.58.0",
@@ -53,14 +53,12 @@
53
53
  "lint-staged": "13.2.1",
54
54
  "mocha": "10.2.0",
55
55
  "mocha-suppress-logs": "0.3.1",
56
- "nock": "13.0.7",
56
+ "nock": "14.0.10",
57
57
  "nyc": "15.1.0",
58
58
  "prettier": "2.2.1",
59
- "rimraf": "5.0.0",
60
59
  "sinon": "9.2.4",
61
60
  "sinon-chai": "3.5.0",
62
- "source-map-support": "0.5.19",
63
- "ts-node": "^10.9.1",
61
+ "ts-node": "10.9.1",
64
62
  "typescript": "4.7.4"
65
63
  },
66
64
  "husky": {
@@ -82,12 +80,12 @@
82
80
  "test": "tests"
83
81
  },
84
82
  "dependencies": {
85
- "axios": "1.8.2",
86
- "graphql": "^16.3.0",
87
- "graphql-request": "4.2.0",
88
- "json-to-graphql-query": "^2.2.5",
89
- "lodash": "^4.17.21",
90
- "type-fest": "^2.19.0",
83
+ "axios": "1.13.2",
84
+ "graphql": "16.8.1",
85
+ "graphql-request": "7.3.5",
86
+ "json-to-graphql-query": "2.2.5",
87
+ "lodash": "4.17.21",
88
+ "type-fest": "2.19.0",
91
89
  "validatorjs": "3.22.1"
92
90
  }
93
91
  }