@swishapp/sdk 0.133.0 → 0.134.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/dist/ajax-api/ajax-api-client.d.ts +11 -0
- package/dist/customiser/index.d.ts +1 -0
- package/dist/customiser/mount.d.ts +13 -0
- package/dist/dom/create-placement.d.ts +2 -2
- package/dist/dom/page-type.d.ts +7 -0
- package/dist/elements/swish-save-element.d.ts +1 -1
- package/dist/events/event-bus.d.ts +1 -1
- package/dist/intents/intents.d.ts +62 -3
- package/dist/options/schemas.d.ts +60 -0
- package/dist/options/swish-options.d.ts +3 -0
- package/dist/options/types.d.ts +7 -0
- package/dist/state/index.d.ts +1 -0
- package/dist/storefront-api/load-product-handle.d.ts +11 -0
- package/dist/storefront-api/load-product-images.d.ts +1 -1
- package/dist/storefront-api/load-product.d.ts +2 -50
- package/dist/storefront-api/queries/fragments.d.ts +1 -1
- package/dist/storefront-api/queries/index.d.ts +3 -2
- package/dist/storefront-api/storefront-api-client.d.ts +11 -54
- package/dist/storefront-api/types/storefront.generated.d.ts +167 -149
- package/dist/storefront-api/types/storefront.types.d.ts +1334 -411
- package/dist/swish-ui/swish-ui.d.ts +10 -4
- package/dist/swish.d.ts +15 -2
- package/dist/swish.js +42 -29
- package/dist/types.d.ts +21 -3
- package/package.json +4 -4
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetProductQuery, SwishApp } from "./swish";
|
|
1
|
+
import type { GetProductQuery, SwishApp, SwishOptions } from "./swish";
|
|
2
2
|
export interface SwishUiManifest {
|
|
3
3
|
scripts: Record<string, string>;
|
|
4
4
|
prerender: Record<string, string>;
|
|
@@ -18,5 +18,23 @@ declare global {
|
|
|
18
18
|
swish: SwishApp;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Product and variant metafields keyed by `namespace`, then by `key`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* product.metafields.custom?.combined_listing_parent
|
|
26
|
+
* product.metafields["$app:swish"]?.setup
|
|
27
|
+
*/
|
|
28
|
+
export type Metafields = Record<string, Record<string, string>>;
|
|
29
|
+
type RawProduct = NonNullable<GetProductQuery["product"]>;
|
|
30
|
+
type RawProductVariant = NonNullable<GetProductQuery["variantNode"]>;
|
|
31
|
+
export type ProductVariant = Omit<RawProductVariant, "metafields"> & {
|
|
32
|
+
metafields: Metafields;
|
|
33
|
+
};
|
|
34
|
+
export type Product = Omit<RawProduct, "metafields" | "selectedOrFirstAvailableVariant" | "variant"> & {
|
|
35
|
+
metafields: Metafields;
|
|
36
|
+
selectedOrFirstAvailableVariant: ProductVariant | null;
|
|
37
|
+
variant?: ProductVariant | null;
|
|
38
|
+
};
|
|
39
|
+
export type PreviewOptions = Omit<SwishOptions, "auth" | "storefront" | "context">;
|
|
40
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swishapp/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.134.0",
|
|
4
4
|
"description": "JS SDK for Swish.",
|
|
5
5
|
"author": "Swish",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"@swishapp/api-client": "0.43.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@
|
|
23
|
+
"@graphql-codegen/cli": "^7.0.0",
|
|
24
|
+
"@shopify/api-codegen-preset": "^2.0.0",
|
|
24
25
|
"concurrently": "^9.2.1",
|
|
25
26
|
"esbuild": "^0.27.2",
|
|
26
|
-
"graphql-
|
|
27
|
-
"graphql-config": "^5.1.5",
|
|
27
|
+
"graphql-config": "^5.1.6",
|
|
28
28
|
"rimraf": "^6.1.2",
|
|
29
29
|
"typescript": "^5.9.3"
|
|
30
30
|
},
|