@swishapp/sdk 0.108.0 → 0.110.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/intents/handlers/initiate-checkout-handler.d.ts +22 -0
- package/dist/intents/handlers/initiate-sign-in-handler.d.ts +13 -0
- package/dist/intents/handlers/open-list-menu-handler.d.ts +2 -2
- package/dist/intents/handlers/share-list-handler.d.ts +2 -2
- package/dist/intents/hooks/after-share-list-hook.d.ts +2 -2
- package/dist/intents/types.d.ts +10 -4
- package/dist/options/swish-options.d.ts +1 -2
- package/dist/options/types.d.ts +1 -10
- package/dist/storefront-api/storefront-api-client.d.ts +1 -71
- package/dist/swish.d.ts +0 -3
- package/dist/swish.js +51 -51
- package/package.json +1 -1
- package/dist/utils/shopify-badge-utils.d.ts +0 -22
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { IntentHandler } from "../intent-handler";
|
|
3
|
+
import { IntentResponse, SuccessIntentResponse } from "../types";
|
|
4
|
+
export declare const InitiateCheckoutIntentDataSchema: v.UnionSchema<[v.ObjectSchema<{
|
|
5
|
+
readonly variantId: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>]>, v.NumberSchema<undefined>], undefined>, v.TransformAction<string | number, number>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>]>;
|
|
6
|
+
readonly quantity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>, 1>;
|
|
7
|
+
}, undefined>, v.ObjectSchema<{
|
|
8
|
+
readonly items: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
9
|
+
readonly variantId: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string>]>, v.NumberSchema<undefined>], undefined>, v.TransformAction<string | number, number>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>]>;
|
|
10
|
+
readonly quantity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>, 1>;
|
|
11
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
12
|
+
variantId: number;
|
|
13
|
+
quantity: number;
|
|
14
|
+
}[], 1, undefined>]>;
|
|
15
|
+
}, undefined>], undefined>;
|
|
16
|
+
export type InitiateCheckoutIntentData = v.InferInput<typeof InitiateCheckoutIntentDataSchema>;
|
|
17
|
+
export type InitiateCheckoutSuccessResponse = SuccessIntentResponse<{
|
|
18
|
+
checkoutUrl: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare class InitiateCheckoutHandler extends IntentHandler<"initiate:checkout"> {
|
|
21
|
+
invoke(data: InitiateCheckoutIntentData): Promise<IntentResponse<"initiate:checkout">>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { IntentHandler } from "../intent-handler";
|
|
3
|
+
import { IntentResponse, SuccessIntentResponse } from "../types";
|
|
4
|
+
export declare const InitiateSignInIntentDataSchema: v.ObjectSchema<{
|
|
5
|
+
readonly returnTo: v.StringSchema<undefined>;
|
|
6
|
+
}, undefined>;
|
|
7
|
+
export type InitiateSignInIntentData = v.InferInput<typeof InitiateSignInIntentDataSchema>;
|
|
8
|
+
export type InitiateSignInSuccessResponse = SuccessIntentResponse<void>;
|
|
9
|
+
export declare class InitiateSignInHandler extends IntentHandler<"initiate:sign-in"> {
|
|
10
|
+
invoke(data: InitiateSignInIntentData): Promise<IntentResponse<"initiate:sign-in">>;
|
|
11
|
+
private scheduleRedirect;
|
|
12
|
+
private redirectToSignIn;
|
|
13
|
+
}
|
|
@@ -10,6 +10,6 @@ export declare const OpenListMenuIntentDataSchema: v.ObjectSchema<{
|
|
|
10
10
|
}, undefined>;
|
|
11
11
|
export type OpenListMenuIntentData = v.InferInput<typeof OpenListMenuIntentDataSchema>;
|
|
12
12
|
export type OpenListMenuSuccessResponse = EditListSuccessResponse | DeleteListSuccessResponse | EditListAccessSuccessResponse | ShareListSuccessResponse;
|
|
13
|
-
export declare class OpenListMenuHandler extends IntentHandler<"open:list-menu" | "edit:list" | "delete:list" | "edit:list-access" | "share
|
|
14
|
-
invoke(data: OpenListMenuIntentData): Promise<IntentResponse<"open:list-menu" | "edit:list" | "delete:list" | "edit:list-access" | "share
|
|
13
|
+
export declare class OpenListMenuHandler extends IntentHandler<"open:list-menu" | "edit:list" | "delete:list" | "edit:list-access" | "initiate:share"> {
|
|
14
|
+
invoke(data: OpenListMenuIntentData): Promise<IntentResponse<"open:list-menu" | "edit:list" | "delete:list" | "edit:list-access" | "initiate:share">>;
|
|
15
15
|
}
|
|
@@ -11,6 +11,6 @@ export type ShareListSuccessResponse = SuccessIntentResponse<{
|
|
|
11
11
|
method: "native" | "clipboard";
|
|
12
12
|
publicListId?: string;
|
|
13
13
|
}>;
|
|
14
|
-
export declare class ShareListHandler extends IntentHandler<"share
|
|
15
|
-
invoke(data: ShareListIntentData): Promise<IntentResponse<"share
|
|
14
|
+
export declare class ShareListHandler extends IntentHandler<"initiate:share"> {
|
|
15
|
+
invoke(data: ShareListIntentData): Promise<IntentResponse<"initiate:share">>;
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IntentHook } from "../intent-hook";
|
|
2
2
|
import { IntentResponse } from "../types";
|
|
3
|
-
export declare class AfterShareListHook extends IntentHook<"share
|
|
4
|
-
invoke(response: IntentResponse<"share
|
|
3
|
+
export declare class AfterShareListHook extends IntentHook<"initiate:share"> {
|
|
4
|
+
invoke(response: IntentResponse<"initiate:share">): Promise<void>;
|
|
5
5
|
}
|
package/dist/intents/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CreateListIntentData, CreateListSuccessResponse } from "./handlers/create-list-handler";
|
|
2
2
|
import type { CreateCartLineIntentData, CreateCartLineSuccessResponse } from "./handlers/create-cart-line-handler";
|
|
3
|
+
import type { InitiateCheckoutIntentData, InitiateCheckoutSuccessResponse } from "./handlers/initiate-checkout-handler";
|
|
3
4
|
import type { DeleteListIntentData, DeleteListSuccessResponse } from "./handlers/delete-list-handler";
|
|
4
5
|
import type { EditItemListsIntentData, EditItemListsSuccessResponse } from "./handlers/edit-item-lists-handler";
|
|
5
6
|
import type { EditItemVariantIntentData, EditItemVariantSuccessResponse } from "./handlers/edit-item-variant-handler";
|
|
@@ -19,12 +20,13 @@ import { OpenProfileSuccessResponse } from "./handlers/open-profile-handler";
|
|
|
19
20
|
import type { OpenQuickBuyIntentData, OpenQuickBuySuccessResponse } from "./handlers/open-quick-buy-handler";
|
|
20
21
|
import { OpenSavesSuccessResponse } from "./handlers/open-saves-handler";
|
|
21
22
|
import type { OpenSignInIntentData, OpenSignInSuccessResponse } from "./handlers/open-sign-in-handler";
|
|
23
|
+
import type { InitiateSignInIntentData, InitiateSignInSuccessResponse } from "./handlers/initiate-sign-in-handler";
|
|
22
24
|
import type { SaveItemIntentData, SaveItemSuccessResponse } from "./handlers/save-item-handler";
|
|
23
25
|
import type { ShareListIntentData, ShareListSuccessResponse } from "./handlers/share-list-handler";
|
|
24
26
|
import { ToastIntentData, ToastSuccessResponse } from "./handlers/show-toast-handler";
|
|
25
27
|
import type { UnsaveItemIntentData, UnsaveItemSuccessResponse } from "./handlers/unsave-item-handler";
|
|
26
|
-
export type { CreateCartLineSuccessResponse, CreateListSuccessResponse, DeleteListSuccessResponse, EditItemListsSuccessResponse, EditItemVariantSuccessResponse, EditListAccessSuccessResponse, EditListSuccessResponse, SaveItemSuccessResponse, ShareListSuccessResponse, ToastSuccessResponse, UnsaveItemSuccessResponse, };
|
|
27
|
-
export type Intent = "create:cart-line" | "save:item" | "edit:item-variant" | "edit:item-lists" | "unsave:item" | "edit:list" | "edit:list-access" | "delete:list" | "create:list" | "share
|
|
28
|
+
export type { CreateCartLineSuccessResponse, InitiateCheckoutSuccessResponse, CreateListSuccessResponse, DeleteListSuccessResponse, EditItemListsSuccessResponse, EditItemVariantSuccessResponse, EditListAccessSuccessResponse, EditListSuccessResponse, SaveItemSuccessResponse, ShareListSuccessResponse, ToastSuccessResponse, UnsaveItemSuccessResponse, };
|
|
29
|
+
export type Intent = "create:cart-line" | "initiate:checkout" | "save:item" | "edit:item-variant" | "edit:item-lists" | "unsave:item" | "edit:list" | "edit:list-access" | "delete:list" | "create:list" | "initiate:share" | "open:home" | "open:list" | "open:lists" | "open:orders" | "open:order" | "open:saves" | "open:notifications" | "open:profile" | "open:product" | "open:list-menu" | "open:order-menu" | "open:list-detail-page-menu" | "initiate:sign-in" | "open:sign-in" | "open:quick-buy" | "show:toast";
|
|
28
30
|
export type IntentQueryParam = `${string}=${string}`;
|
|
29
31
|
export type IntentQueryWithParams = `${Intent},${IntentQueryParam}`;
|
|
30
32
|
export type IntentResponse<I extends Intent = Intent> = ClosedIntentResponse<I> | ErrorIntentResponse<I> | IntentToSuccessResponse<I>;
|
|
@@ -52,6 +54,7 @@ export interface SuccessIntentResponse<T, I extends Intent = Intent> extends Int
|
|
|
52
54
|
}
|
|
53
55
|
interface IntentDataMap {
|
|
54
56
|
"create:cart-line": CreateCartLineIntentData;
|
|
57
|
+
"initiate:checkout": InitiateCheckoutIntentData;
|
|
55
58
|
"save:item": SaveItemIntentData;
|
|
56
59
|
"edit:item-variant": EditItemVariantIntentData;
|
|
57
60
|
"edit:item-lists": EditItemListsIntentData;
|
|
@@ -60,7 +63,7 @@ interface IntentDataMap {
|
|
|
60
63
|
"edit:list-access": EditListAccessIntentData;
|
|
61
64
|
"delete:list": DeleteListIntentData;
|
|
62
65
|
"create:list": CreateListIntentData;
|
|
63
|
-
"share
|
|
66
|
+
"initiate:share": ShareListIntentData;
|
|
64
67
|
"open:home": void;
|
|
65
68
|
"open:list": OpenListIntentData;
|
|
66
69
|
"open:lists": void;
|
|
@@ -73,12 +76,14 @@ interface IntentDataMap {
|
|
|
73
76
|
"open:list-menu": OpenListMenuIntentData;
|
|
74
77
|
"open:order-menu": OpenOrderMenuIntentData;
|
|
75
78
|
"open:list-detail-page-menu": OpenListDetailPageMenuIntentData;
|
|
79
|
+
"initiate:sign-in": InitiateSignInIntentData;
|
|
76
80
|
"open:sign-in": OpenSignInIntentData | undefined;
|
|
77
81
|
"open:quick-buy": OpenQuickBuyIntentData;
|
|
78
82
|
"show:toast": ToastIntentData;
|
|
79
83
|
}
|
|
80
84
|
interface IntentSuccessResponseMap {
|
|
81
85
|
"create:cart-line": CreateCartLineSuccessResponse;
|
|
86
|
+
"initiate:checkout": InitiateCheckoutSuccessResponse;
|
|
82
87
|
"save:item": SaveItemSuccessResponse;
|
|
83
88
|
"edit:item-variant": EditItemVariantSuccessResponse;
|
|
84
89
|
"edit:item-lists": EditItemListsSuccessResponse | UnsaveItemSuccessResponse;
|
|
@@ -87,7 +92,7 @@ interface IntentSuccessResponseMap {
|
|
|
87
92
|
"edit:list-access": EditListAccessSuccessResponse;
|
|
88
93
|
"delete:list": DeleteListSuccessResponse;
|
|
89
94
|
"create:list": CreateListSuccessResponse;
|
|
90
|
-
"share
|
|
95
|
+
"initiate:share": ShareListSuccessResponse;
|
|
91
96
|
"open:home": OpenHomeSuccessResponse;
|
|
92
97
|
"open:list": OpenListSuccessResponse;
|
|
93
98
|
"open:lists": OpenListsSuccessResponse;
|
|
@@ -100,6 +105,7 @@ interface IntentSuccessResponseMap {
|
|
|
100
105
|
"open:list-menu": OpenListMenuSuccessResponse;
|
|
101
106
|
"open:order-menu": OpenOrderMenuSuccessResponse;
|
|
102
107
|
"open:list-detail-page-menu": OpenListDetailPageMenuSuccessResponse;
|
|
108
|
+
"initiate:sign-in": InitiateSignInSuccessResponse;
|
|
103
109
|
"open:sign-in": OpenSignInSuccessResponse;
|
|
104
110
|
"open:quick-buy": OpenQuickBuySuccessResponse;
|
|
105
111
|
"show:toast": ToastSuccessResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntentOptions } from "../intents/intents";
|
|
2
2
|
import { StorefrontApiOptions, SwishClientConfig } from "../swish";
|
|
3
|
-
import { StorefrontContext,
|
|
3
|
+
import { StorefrontContext, SwishFeaturesOptions, SwishMetafieldOptions, SwishOptions, SwishProductOptions, SwishUiOptions } from "./types";
|
|
4
4
|
export type SwishOptionsInput = {
|
|
5
5
|
storefrontApi: StorefrontApiOptions;
|
|
6
6
|
storefrontContext: StorefrontContext;
|
|
@@ -8,7 +8,6 @@ export type SwishOptionsInput = {
|
|
|
8
8
|
version: string;
|
|
9
9
|
};
|
|
10
10
|
swishUi?: SwishUiOptions;
|
|
11
|
-
badges?: SwishBadgeOptions;
|
|
12
11
|
productOptions?: SwishProductOptions;
|
|
13
12
|
metafields?: SwishMetafieldOptions;
|
|
14
13
|
features?: SwishFeaturesOptions;
|
package/dist/options/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IntentOptions } from "../intents/intents";
|
|
2
2
|
import { CountryCode, LanguageCode } from "../storefront-api/types/storefront.types";
|
|
3
|
-
import {
|
|
4
|
-
import { Badge } from "../utils/shopify-badge-utils";
|
|
3
|
+
import { GetProductOptionsQuery, Intent, StorefrontApiOptions, SwishClientConfig } from "../swish";
|
|
5
4
|
export interface SwishOptions {
|
|
6
5
|
storefrontApi: StorefrontApiOptions;
|
|
7
6
|
storefrontContext: StorefrontContext;
|
|
@@ -12,20 +11,12 @@ export interface SwishOptions {
|
|
|
12
11
|
features: SwishFeaturesOptions;
|
|
13
12
|
intents: IntentOptions;
|
|
14
13
|
metafields: SwishMetafieldOptions;
|
|
15
|
-
badges: SwishBadgeOptions;
|
|
16
14
|
productOptions: SwishProductOptions;
|
|
17
15
|
}
|
|
18
16
|
export interface SwishMetafieldOptions {
|
|
19
17
|
product: `${string}.${string}`[];
|
|
20
18
|
productVariant: `${string}.${string}`[];
|
|
21
19
|
}
|
|
22
|
-
export interface SwishBadgeOptions {
|
|
23
|
-
getBadges: (args: {
|
|
24
|
-
product: GetProductCardDataQuery["product"];
|
|
25
|
-
variant?: GetProductCardDataWithVariantQuery["variant"];
|
|
26
|
-
defaultBadges: string[];
|
|
27
|
-
}) => (string | Badge)[];
|
|
28
|
-
}
|
|
29
20
|
export interface SwishProductOptions {
|
|
30
21
|
sortValues: (args: {
|
|
31
22
|
option: NonNullable<GetProductOptionsQuery["product"]>["options"][number];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ResponseErrors } from "@shopify/graphql-client";
|
|
2
2
|
import { StorefrontContext, SwishMetafieldOptions, SwishProductOptions } from "../options/types";
|
|
3
|
-
import { ShopifyBadgesUtils } from "../utils/shopify-badge-utils";
|
|
4
3
|
import { LoadProductCardDataArgs } from "./load-product-card-data";
|
|
5
4
|
import { LoadProductDetailDataArgs } from "./load-product-detail-data";
|
|
6
5
|
import { LoadProductIdArgs } from "./load-product-id";
|
|
@@ -30,9 +29,8 @@ export declare class StorefrontApiClient {
|
|
|
30
29
|
private readonly options;
|
|
31
30
|
private readonly context;
|
|
32
31
|
private readonly metafields;
|
|
33
|
-
private readonly badges;
|
|
34
32
|
private readonly productOptions;
|
|
35
|
-
constructor(options: StorefrontApiOptions, context: StorefrontContext,
|
|
33
|
+
constructor(options: StorefrontApiOptions, context: StorefrontContext, productOptions: SwishProductOptions, metafields?: SwishMetafieldOptions);
|
|
36
34
|
fetch(input: string | URL | Request, init?: RequestInit): Promise<Response>;
|
|
37
35
|
query: <TData, TVariables extends Record<string, unknown>>(query: string, variables: TVariables) => Promise<{
|
|
38
36
|
data: (TData extends undefined ? any : TData) | undefined;
|
|
@@ -49,78 +47,10 @@ export declare class StorefrontApiClient {
|
|
|
49
47
|
loadProductCardData: (args: ArgsWithoutDefaults<LoadProductCardDataArgs>) => Promise<{
|
|
50
48
|
data: import("./storefront-api-client").GetProductCardDataQuery | import("./storefront-api-client").GetProductCardDataWithVariantQuery | undefined;
|
|
51
49
|
errors: ResponseErrors | null;
|
|
52
|
-
} | {
|
|
53
|
-
data: {
|
|
54
|
-
badges: import("../utils/shopify-badge-utils").Badge[];
|
|
55
|
-
product?: import("./types/storefront.types").Maybe<(Pick<import("./types/storefront.types").Product, "id" | "availableForSale" | "isGiftCard" | "onlineStoreUrl" | "description" | "descriptionHtml" | "handle" | "productType" | "tags" | "title"> & {
|
|
56
|
-
category?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").TaxonomyCategory, "id" | "name">>;
|
|
57
|
-
compareAtPriceRange: {
|
|
58
|
-
maxVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
59
|
-
minVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
60
|
-
};
|
|
61
|
-
featuredImage?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Image, "id" | "altText" | "url" | "thumbhash">>;
|
|
62
|
-
options: Array<Pick<import("./types/storefront.types").ProductOption, "id" | "name">>;
|
|
63
|
-
priceRange: {
|
|
64
|
-
maxVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
65
|
-
minVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
66
|
-
};
|
|
67
|
-
variantsCount?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Count, "count">>;
|
|
68
|
-
metafields: Array<import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Metafield, "key" | "namespace" | "value">>>;
|
|
69
|
-
})>;
|
|
70
|
-
variant?: import("./types/storefront.types").Maybe<(Pick<import("./types/storefront.types").ProductVariant, "id" | "availableForSale" | "currentlyNotInStock" | "sku" | "title"> & {
|
|
71
|
-
compareAtPrice?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">>;
|
|
72
|
-
image?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Image, "id" | "altText" | "url" | "thumbhash">>;
|
|
73
|
-
price: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
74
|
-
selectedOptions: Array<Pick<import("./types/storefront.types").SelectedOption, "name" | "value">>;
|
|
75
|
-
metafields: Array<import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Metafield, "key" | "namespace" | "value">>>;
|
|
76
|
-
})>;
|
|
77
|
-
};
|
|
78
|
-
errors: ResponseErrors | null;
|
|
79
50
|
}>;
|
|
80
51
|
loadProductDetailData: (args: ArgsWithoutDefaults<LoadProductDetailDataArgs>) => Promise<{
|
|
81
52
|
data: import("./storefront-api-client").GetProductDetailDataQuery | import("./storefront-api-client").GetProductDetailDataWithVariantQuery | undefined;
|
|
82
53
|
errors: ResponseErrors | null;
|
|
83
|
-
} | {
|
|
84
|
-
data: {
|
|
85
|
-
badges: import("../utils/shopify-badge-utils").Badge[];
|
|
86
|
-
product?: import("./types/storefront.types").Maybe<(Pick<import("./types/storefront.types").Product, "id" | "availableForSale" | "isGiftCard" | "onlineStoreUrl" | "description" | "descriptionHtml" | "handle" | "productType" | "tags" | "title" | "encodedVariantAvailability" | "encodedVariantExistence"> & {
|
|
87
|
-
category?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").TaxonomyCategory, "id" | "name">>;
|
|
88
|
-
compareAtPriceRange: {
|
|
89
|
-
maxVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
90
|
-
minVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
91
|
-
};
|
|
92
|
-
featuredImage?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Image, "id" | "altText" | "url" | "thumbhash">>;
|
|
93
|
-
options: Array<(Pick<import("./types/storefront.types").ProductOption, "id" | "name"> & {
|
|
94
|
-
optionValues: Array<(Pick<import("./types/storefront.types").ProductOptionValue, "name"> & {
|
|
95
|
-
swatch?: import("./types/storefront.types").Maybe<(Pick<import("./types/storefront.types").ProductOptionValueSwatch, "color"> & {
|
|
96
|
-
image?: import("./types/storefront.types").Maybe<{
|
|
97
|
-
previewImage?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Image, "url">>;
|
|
98
|
-
}>;
|
|
99
|
-
})>;
|
|
100
|
-
firstSelectableVariant?: import("./types/storefront.types").Maybe<(Pick<import("./types/storefront.types").ProductVariant, "id"> & {
|
|
101
|
-
image?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Image, "id" | "altText" | "url" | "thumbhash">>;
|
|
102
|
-
})>;
|
|
103
|
-
})>;
|
|
104
|
-
})>;
|
|
105
|
-
priceRange: {
|
|
106
|
-
maxVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
107
|
-
minVariantPrice: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
108
|
-
};
|
|
109
|
-
variantsCount?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Count, "count" | "precision">>;
|
|
110
|
-
metafields: Array<import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Metafield, "key" | "namespace" | "value">>>;
|
|
111
|
-
images: {
|
|
112
|
-
nodes: Array<Pick<import("./types/storefront.types").Image, "id" | "altText" | "url" | "thumbhash">>;
|
|
113
|
-
};
|
|
114
|
-
})>;
|
|
115
|
-
variant?: import("./types/storefront.types").Maybe<(Pick<import("./types/storefront.types").ProductVariant, "id" | "availableForSale" | "currentlyNotInStock" | "sku" | "title"> & {
|
|
116
|
-
compareAtPrice?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">>;
|
|
117
|
-
image?: import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Image, "id" | "altText" | "url" | "thumbhash">>;
|
|
118
|
-
price: Pick<import("./types/storefront.types").MoneyV2, "amount" | "currencyCode">;
|
|
119
|
-
selectedOptions: Array<Pick<import("./types/storefront.types").SelectedOption, "name" | "value">>;
|
|
120
|
-
metafields: Array<import("./types/storefront.types").Maybe<Pick<import("./types/storefront.types").Metafield, "key" | "namespace" | "value">>>;
|
|
121
|
-
})>;
|
|
122
|
-
};
|
|
123
|
-
errors: ResponseErrors | null;
|
|
124
54
|
}>;
|
|
125
55
|
loadProductImages: (args: ArgsWithoutDefaults<LoadProductImagesArgs>) => Promise<{
|
|
126
56
|
data: (Pick<import("./types/storefront.types").Image, "id" | "altText" | "url" | "thumbhash"> | undefined)[];
|
package/dist/swish.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ import { SwishApi } from "./swish-api/swish-api-client";
|
|
|
11
11
|
import { SwishUiElement } from "./swish-ui/swish-ui-element";
|
|
12
12
|
import { copyToClipboard } from "./utils/copy-to-clipboard";
|
|
13
13
|
import { RequireUiComponentOptions } from "./swish-ui/types";
|
|
14
|
-
import { ShopifyBadgesUtils } from "./utils/shopify-badge-utils";
|
|
15
14
|
export declare const VERSION: string;
|
|
16
15
|
export declare const swishSdkUrl: string;
|
|
17
16
|
export declare const createSwish: (optionsInput: SwishOptionsInput) => Promise<SwishApp>;
|
|
@@ -21,7 +20,6 @@ declare class SwishApp {
|
|
|
21
20
|
private readonly storefrontApi;
|
|
22
21
|
private readonly ajaxApi;
|
|
23
22
|
private readonly ajaxApiPublisher;
|
|
24
|
-
private readonly swishBadges;
|
|
25
23
|
private readonly swishOptions;
|
|
26
24
|
private readonly swishUi;
|
|
27
25
|
readonly events: EventBus;
|
|
@@ -29,7 +27,6 @@ declare class SwishApp {
|
|
|
29
27
|
constructor(options: SwishOptions);
|
|
30
28
|
get options(): SwishOptions;
|
|
31
29
|
get storefrontContext(): import("./swish").StorefrontContext;
|
|
32
|
-
get badges(): ShopifyBadgesUtils;
|
|
33
30
|
get api(): SwishApi;
|
|
34
31
|
get storefront(): StorefrontApiClient;
|
|
35
32
|
get ajax(): AjaxApiClient;
|