@sonic-commerce/storefront-types 0.23.4 → 0.25.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/dist/schema.d.ts +4 -2
- 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.25.0, 54 named schemas.
|
|
3
3
|
|
|
4
4
|
export type { paths, components, operations } from "./schema";
|
|
5
5
|
import type { components } from "./schema";
|
package/dist/schema.d.ts
CHANGED
|
@@ -505,7 +505,7 @@ export interface paths {
|
|
|
505
505
|
};
|
|
506
506
|
/**
|
|
507
507
|
* List categories
|
|
508
|
-
* @description Active, non-internal categories only. `parent_id=null` returns roots.
|
|
508
|
+
* @description Active, non-internal categories only. `parent_id=null` returns roots. Sorted by `rank` then `name` by default; `rank` is per parent, so filter by `parent_id` to get one level in the merchant's order.
|
|
509
509
|
*/
|
|
510
510
|
get: {
|
|
511
511
|
parameters: {
|
|
@@ -672,7 +672,7 @@ export interface paths {
|
|
|
672
672
|
};
|
|
673
673
|
/**
|
|
674
674
|
* Get the category tree
|
|
675
|
-
* @description The full nested menu in one request. Unpaginated; nesting is capped at 8 levels.
|
|
675
|
+
* @description The full nested menu in one request. Unpaginated; nesting is capped at 8 levels. Every `children` array is already in the merchant's order (`rank`, then `name`).
|
|
676
676
|
*/
|
|
677
677
|
get: {
|
|
678
678
|
parameters: {
|
|
@@ -3612,6 +3612,7 @@ export interface components {
|
|
|
3612
3612
|
name?: string;
|
|
3613
3613
|
handle?: string;
|
|
3614
3614
|
description?: string | null;
|
|
3615
|
+
/** @description Merchant-set position among categories with the same parent, starting at 0. Each parent numbers its own children, so compare `rank` only between siblings. */
|
|
3615
3616
|
rank?: number;
|
|
3616
3617
|
parent_id?: string | null;
|
|
3617
3618
|
thumbnail?: string | null;
|
|
@@ -3628,6 +3629,7 @@ export interface components {
|
|
|
3628
3629
|
id: string;
|
|
3629
3630
|
name: string;
|
|
3630
3631
|
handle: string;
|
|
3632
|
+
/** @description Merchant-set position among categories with the same parent, starting at 0. Each parent numbers its own children, so compare `rank` only between siblings. */
|
|
3631
3633
|
rank: number;
|
|
3632
3634
|
thumbnail: string | null;
|
|
3633
3635
|
children: components["schemas"]["CategoryTreeNode"][];
|
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.25.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": {
|