@shopify/shopify-api 15.0.0 → 15.0.1

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.
@@ -96,6 +96,7 @@ export function begin(config: ConfigInterface): OAuthBegin {
96
96
  expires: new Date(Date.now() + 60000),
97
97
  sameSite: 'lax',
98
98
  secure: true,
99
+ httpOnly: true,
99
100
  path: callbackPath,
100
101
  });
101
102
 
@@ -225,6 +226,7 @@ export function callback(config: ConfigInterface): OAuthCallback {
225
226
  expires: session.expires,
226
227
  sameSite: 'lax',
227
228
  secure: true,
229
+ httpOnly: true,
228
230
  path: cookiePath,
229
231
  });
230
232
  }
@@ -28,6 +28,7 @@ export function getUserAgent(config: ConfigInterface): string {
28
28
  const REDACTED_LOG_VALUE = '****';
29
29
 
30
30
  // These headers carry reusable credentials and must not reach the logs.
31
+ // Keep in sync with SENSITIVE_HEADERS in @shopify/graphql-client.
31
32
  const SENSITIVE_LOG_HEADERS = new Set([
32
33
  'authorization',
33
34
  'cookie',
package/lib/version.ts CHANGED
@@ -1 +1 @@
1
- export const SHOPIFY_API_LIBRARY_VERSION = '15.0.0';
1
+ export const SHOPIFY_API_LIBRARY_VERSION = '15.0.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/shopify-api",
3
- "version": "15.0.0",
3
+ "version": "15.0.1",
4
4
  "description": "Shopify API Library for Node - accelerate development with support for authentication, graphql proxy, webhooks",
5
5
  "types": "./dist/ts/lib/index.d.ts",
6
6
  "module": "./dist/esm/lib/index.mjs",
@@ -71,9 +71,9 @@
71
71
  "Storefront API"
72
72
  ],
73
73
  "dependencies": {
74
- "@shopify/admin-api-client": "^2.0.0",
75
- "@shopify/graphql-client": "^2.0.0",
76
- "@shopify/storefront-api-client": "^2.0.0",
74
+ "@shopify/admin-api-client": "^2.0.1",
75
+ "@shopify/graphql-client": "^2.0.1",
76
+ "@shopify/storefront-api-client": "^2.0.1",
77
77
  "compare-versions": "^6.1.1",
78
78
  "isbot": "^5.2.0",
79
79
  "jose": "^5.9.6",
@@ -91,9 +91,13 @@ export class Cookies {
91
91
  name,
92
92
  value,
93
93
  ...Object.fromEntries(
94
- opts.map((opt) =>
95
- splitN(opt, '=', 2).map((value) => value.trim()),
96
- ),
94
+ opts.map((opt) => {
95
+ const [key, value] = splitN(opt, '=', 2).map((value) =>
96
+ value.trim(),
97
+ );
98
+ // Flag attributes like HttpOnly have no value
99
+ return [key, value ?? true];
100
+ }),
97
101
  ),
98
102
  },
99
103
  ];
@@ -111,8 +115,12 @@ export class Cookies {
111
115
  let result = '';
112
116
  result += `${data.name}=${data.value};`;
113
117
  result += Object.entries(data)
114
- .filter(([key]) => !['name', 'value', 'expires'].includes(key))
115
- .map(([key, value]) => `${key}=${value}`)
118
+ .filter(
119
+ ([key, value]) =>
120
+ !['name', 'value', 'expires'].includes(key) && value !== false,
121
+ )
122
+ // Boolean attributes are flags, so only write them when true
123
+ .map(([key, value]) => (value === true ? key : `${key}=${value}`))
116
124
  .join('; ');
117
125
  if (data.expires) {
118
126
  result += ';';
@@ -180,6 +188,7 @@ export class Cookies {
180
188
 
181
189
  set(name: string, value: string, opts: Partial<CookieData> = {}): void {
182
190
  this.outgoingCookieJar[name] = {
191
+ httpOnly: true,
183
192
  ...opts,
184
193
  name,
185
194
  value,