@sonic-commerce/storefront-types 0.23.4 → 0.24.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/README.md +5 -5
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @sonic-commerce/storefront-types
|
|
2
2
|
|
|
3
|
-
TypeScript types for the Sonic Commerce storefront API (`/
|
|
3
|
+
TypeScript types for the Sonic Commerce storefront API (`/v1`).
|
|
4
4
|
|
|
5
5
|
Types only — no runtime code, nothing to import at run time, nothing added to
|
|
6
6
|
your bundle. Generated from the API's OpenAPI document, which is itself
|
|
@@ -29,7 +29,7 @@ import type { paths, Product } from "@sonic-commerce/storefront-types";
|
|
|
29
29
|
|
|
30
30
|
// Server-side only — the Store ID is not meant for a browser bundle.
|
|
31
31
|
const api = createClient<paths>({
|
|
32
|
-
baseUrl: "https://api.example.com/
|
|
32
|
+
baseUrl: "https://api.example.com/v1",
|
|
33
33
|
headers: {
|
|
34
34
|
"x-store-id": process.env.SONIC_STORE_ID!,
|
|
35
35
|
"x-publishable-key": process.env.PUBLISHABLE_KEY!,
|
|
@@ -61,7 +61,7 @@ await api.POST("/carts", {
|
|
|
61
61
|
|
|
62
62
|
A missing or unknown Store ID or publishable key is answered `404 Not found`.
|
|
63
63
|
|
|
64
|
-
A store with its own **custom domain** can use `https://<that domain>/
|
|
64
|
+
A store with its own **custom domain** can use `https://<that domain>/v1`
|
|
65
65
|
instead; there the hostname names the store and `x-store-id` / `x-shopper-ip`
|
|
66
66
|
are not needed. Per-store subdomains are not served.
|
|
67
67
|
|
|
@@ -93,7 +93,7 @@ const cart = data?.data as Cart | undefined; // shipping_total present
|
|
|
93
93
|
|
|
94
94
|
## Versioning
|
|
95
95
|
|
|
96
|
-
The package version tracks the API version: `0.23.0` describes the `/
|
|
96
|
+
The package version tracks the API version: `0.23.0` describes the `/v1`
|
|
97
97
|
surface as of release 0.23.0.
|
|
98
98
|
|
|
99
99
|
While the API is pre-1.0, **breaking changes ship in a minor bump** (0.23 →
|
|
@@ -109,4 +109,4 @@ reaches 1.0.
|
|
|
109
109
|
## Other languages
|
|
110
110
|
|
|
111
111
|
The OpenAPI 3.1 document these types are generated from is served live at
|
|
112
|
-
`GET /
|
|
112
|
+
`GET /v1/openapi.json`. Any generator that reads OpenAPI can target it.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by scripts/build.mjs from app/openapi/public-api.json — do not edit.
|
|
2
|
-
// Spec version 0.
|
|
2
|
+
// Spec version 0.24.0, 54 named schemas.
|
|
3
3
|
|
|
4
4
|
export type { paths, components, operations } from "./schema";
|
|
5
5
|
import type { components } from "./schema";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonic-commerce/storefront-types",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript types for the Sonic Commerce storefront API (/
|
|
3
|
+
"version": "0.24.0",
|
|
4
|
+
"description": "TypeScript types for the Sonic Commerce storefront API (/v1).",
|
|
5
5
|
"keywords": ["sonic-commerce", "openapi", "types", "storefront"],
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": {
|