@betterstore/sdk 0.2.9 → 0.2.11

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
@@ -1,5 +1,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.2.11
4
+
5
+ ### Patch Changes
6
+
7
+ - debug tools added
8
+
9
+ ## 0.2.10
10
+
11
+ ### Patch Changes
12
+
13
+ - cors test
14
+
3
15
  ## 0.2.9
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -63,7 +63,10 @@ var createApiClient = (apiKey) => {
63
63
  baseURL: API_BASE_URL,
64
64
  headers: {
65
65
  "Content-Type": "application/json",
66
- Authorization: `Bearer ${apiKey}`
66
+ Authorization: `Bearer ${apiKey}`,
67
+ "Access-Control-Allow-Origin": "*",
68
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
69
+ "Access-Control-Allow-Headers": "Content-Type, Authorization"
67
70
  }
68
71
  });
69
72
  client.interceptors.response.use(
@@ -83,10 +86,12 @@ var createApiClient = (apiKey) => {
83
86
  apiError.status = 503;
84
87
  apiError.message = "Service unavailable - no response from server";
85
88
  apiError.code = "SERVICE_UNAVAILABLE";
89
+ apiError.details = error.request;
86
90
  } else {
87
91
  apiError.status = 500;
88
92
  apiError.message = "Request configuration error";
89
93
  apiError.code = "REQUEST_SETUP_ERROR";
94
+ apiError.details = error;
90
95
  }
91
96
  throw apiError;
92
97
  }
package/dist/index.mjs CHANGED
@@ -27,7 +27,10 @@ var createApiClient = (apiKey) => {
27
27
  baseURL: API_BASE_URL,
28
28
  headers: {
29
29
  "Content-Type": "application/json",
30
- Authorization: `Bearer ${apiKey}`
30
+ Authorization: `Bearer ${apiKey}`,
31
+ "Access-Control-Allow-Origin": "*",
32
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
33
+ "Access-Control-Allow-Headers": "Content-Type, Authorization"
31
34
  }
32
35
  });
33
36
  client.interceptors.response.use(
@@ -47,10 +50,12 @@ var createApiClient = (apiKey) => {
47
50
  apiError.status = 503;
48
51
  apiError.message = "Service unavailable - no response from server";
49
52
  apiError.code = "SERVICE_UNAVAILABLE";
53
+ apiError.details = error.request;
50
54
  } else {
51
55
  apiError.status = 500;
52
56
  apiError.message = "Request configuration error";
53
57
  apiError.code = "REQUEST_SETUP_ERROR";
58
+ apiError.details = error;
54
59
  }
55
60
  throw apiError;
56
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -29,7 +29,7 @@
29
29
  "axios": "^1.8.2"
30
30
  },
31
31
  "scripts": {
32
- "prerelease": "changeset && changeset version && git add .",
32
+ "prep": "changeset && changeset version && git add .",
33
33
  "build": "tsup src/index.ts --format cjs,esm --dts",
34
34
  "lint": "tsc",
35
35
  "format:check": "prettier --check --ignore-path .prettierignore .",