Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit c84a84f

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/supertest-and-types/supertest-6.3.4
2 parents 535d57f + 5c787c8 commit c84a84f

File tree

8 files changed

+57
-11
lines changed

8 files changed

+57
-11
lines changed

.changeset/curly-boxes-switch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@shopify/graphql-client": patch
3+
---
4+
5+
Fix GraphQL client validations for store hosts starting with http

.changeset/silly-spiders-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@shopify/shopify-api": patch
3+
---
4+
5+
Fix linked reference for session in token exchange docs

dev.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: shopify-api-js
2+
3+
type: node
4+
5+
up:
6+
- node:
7+
version: v18.19.0
8+
yarn: 1.22.21
9+
packages:
10+
- .
11+
env:
12+
NODE_ENV: "development"
13+
14+
commands:
15+
server:
16+
run: yarn dev

packages/graphql-client/src/api-client-utilities/tests/validation.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@ describe("validateDomainAndGetStoreUrl())", () => {
7373
});
7474
expect(domain).toEqual(`https://${domainOnly}`);
7575
});
76+
77+
it("returns a store url when a protocol-less store domain starting with http is provided", () => {
78+
const domainOnly = "http-test-store.myshopify.io";
79+
80+
const domain = validateDomainAndGetStoreUrl({
81+
client,
82+
storeDomain: domainOnly,
83+
});
84+
expect(domain).toEqual(`https://${domainOnly}`);
85+
});
86+
87+
it("returns a store url when a protocol-less store domain starting with https is provided", () => {
88+
const domainOnly = "https-test-store.myshopify.io";
89+
90+
const domain = validateDomainAndGetStoreUrl({
91+
client,
92+
storeDomain: domainOnly,
93+
});
94+
expect(domain).toEqual(`https://${domainOnly}`);
95+
});
7696
});
7797

7898
describe("validateRequiredApiVersion()", () => {

packages/graphql-client/src/api-client-utilities/validations.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ export function validateDomainAndGetStoreUrl({
1414

1515
const trimmedDomain = storeDomain.trim();
1616

17-
const protocolUrl = trimmedDomain.startsWith("http")
18-
? trimmedDomain
19-
: `https://${trimmedDomain}`;
17+
const protocolUrl =
18+
trimmedDomain.startsWith("http:") || trimmedDomain.startsWith("https:")
19+
? trimmedDomain
20+
: `https://${trimmedDomain}`;
2021

2122
const url = new URL(protocolUrl);
2223
url.protocol = "https";

packages/shopify-api/docs/reference/auth/tokenExchange.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ A Shopify domain name in the form `{exampleshop}.myshopify.com`.
7171

7272
`Promise<Session>`
7373

74-
See [Session](../session/README.md) reference.
75-
76-
74+
The new Shopify [Session object](../../../lib/session/session.ts), containing the API access token.
7775

76+
[Back to shopify.auth](./README.md)

packages/shopify-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"@cloudflare/workers-types": "^4.20240129.0",
8585
"@swc/core": "^1.3.107",
8686
"@types/express": "^4.17.13",
87-
"@types/node": "^20.11.6",
87+
"@types/node": "^20.11.17",
8888
"@types/node-fetch": "^2.6.11",
8989
"@types/supertest": "^6.0.2",
9090
"@types/uuid": "^9.0.0",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,10 +3174,10 @@
31743174
dependencies:
31753175
"@types/node" "*"
31763176

3177-
"@types/node@*", "@types/node@^20.11.6":
3178-
version "20.11.6"
3179-
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.6.tgz#6adf4241460e28be53836529c033a41985f85b6e"
3180-
integrity sha512-+EOokTnksGVgip2PbYbr3xnR7kZigh4LbybAfBAw5BpnQ+FqBYUsvCEjYd70IXKlbohQ64mzEYmMtlWUY8q//Q==
3177+
"@types/node@*", "@types/node@^20.11.17":
3178+
version "20.11.17"
3179+
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.17.tgz#cdd642d0e62ef3a861f88ddbc2b61e32578a9292"
3180+
integrity sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==
31813181
dependencies:
31823182
undici-types "~5.26.4"
31833183

0 commit comments

Comments
 (0)