@grafikr/shopify-typescript 2.5.0 → 2.6.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/global/modules/analytics.d.ts +1 -1
- package/global/modules/customerPrivacy.d.ts +2 -3
- package/package.json +7 -5
- package/type/endpoints/Cart.d.ts +1 -1
- package/type/endpoints/Product.d.ts +2 -1
- package/type/json/Cart.d.ts +6 -2
- package/type/json/LineItem.d.ts +1 -1
- package/type/json/Product.d.ts +2 -2
- package/type/json/Products/Product.d.ts +19 -0
- package/type/json/Products/ProductImage.d.ts +11 -0
- package/type/json/Products/ProductOption.d.ts +5 -0
- package/type/json/Products/ProductVariant.d.ts +26 -0
- package/type/json/Search/Article.d.ts +1 -1
- package/type/json/Search/Collection.d.ts +1 -1
- package/type/json/Search/Product.d.ts +1 -1
- package/type/liquid/Product.d.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RequireAtLeastOne } from 'type-fest';
|
|
2
2
|
|
|
3
3
|
export type Analytics = {
|
|
4
|
-
publish: (name: string, data: Record<
|
|
4
|
+
publish: (name: string, data: Record<string, unknown>) => boolean;
|
|
5
5
|
visitor: (
|
|
6
6
|
visitorInfo: RequireAtLeastOne<{ email: string; phone: string }>,
|
|
7
7
|
options: { appId: string },
|
|
@@ -31,11 +31,10 @@ export type CustomerPrivacy = {
|
|
|
31
31
|
},
|
|
32
32
|
callback: () => void,
|
|
33
33
|
): void;
|
|
34
|
-
shouldShowBanner(): boolean;
|
|
35
|
-
thirdPartyMarketingAllowed(): boolean;
|
|
36
|
-
|
|
37
34
|
/** @deprecated Use consent as an object instead */
|
|
38
35
|
setTrackingConsent(consent: boolean, callback: () => void): void;
|
|
36
|
+
shouldShowBanner(): boolean;
|
|
37
|
+
thirdPartyMarketingAllowed(): boolean;
|
|
39
38
|
/** @deprecated Use saleOfDataRegion instead */
|
|
40
39
|
shouldShowCCPABanner(): boolean;
|
|
41
40
|
/** @deprecated Use shouldShowBanner instead */
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafikr/shopify-typescript",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"format": "
|
|
6
|
+
"format": "biome format . --write",
|
|
7
|
+
"check": "biome check . --write",
|
|
8
|
+
"typecheck": "tsc --noEmit"
|
|
7
9
|
},
|
|
8
10
|
"engines": {
|
|
9
11
|
"node": ">=16.0.0"
|
|
10
12
|
},
|
|
11
13
|
"devDependencies": {
|
|
12
|
-
"
|
|
13
|
-
"typescript": "^
|
|
14
|
+
"@biomejs/biome": "2.5.7",
|
|
15
|
+
"typescript": "^6.0.0"
|
|
14
16
|
},
|
|
15
17
|
"repository": {
|
|
16
18
|
"type": "git",
|
|
@@ -21,6 +23,6 @@
|
|
|
21
23
|
"type"
|
|
22
24
|
],
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"type-fest": "^
|
|
26
|
+
"type-fest": "^5.7.0"
|
|
25
27
|
}
|
|
26
28
|
}
|
package/type/endpoints/Cart.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Product as ProductType } from '../json/Product';
|
|
2
|
+
import type { Product as ProductsListItemType } from '../json/Products/Product';
|
|
2
3
|
|
|
3
4
|
export type Product = {
|
|
4
5
|
product: ProductType;
|
|
5
6
|
};
|
|
6
7
|
|
|
7
8
|
export type Products = {
|
|
8
|
-
products: Array<
|
|
9
|
+
products: Array<ProductsListItemType>;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export type Recommendations = {
|
package/type/json/Cart.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { LineItem, UpdatedLineItem } from './LineItem';
|
|
2
1
|
import type { DiscountApplication } from './DiscountApplication';
|
|
2
|
+
import type { LineItem, UpdatedLineItem } from './LineItem';
|
|
3
3
|
|
|
4
4
|
export type Cart = {
|
|
5
5
|
token: string;
|
|
6
6
|
note: string | null;
|
|
7
|
-
attributes: Record<string,
|
|
7
|
+
attributes: Record<string, unknown>;
|
|
8
8
|
original_total_price: number;
|
|
9
9
|
total_price: number;
|
|
10
10
|
total_discount: number;
|
|
@@ -15,6 +15,10 @@ export type Cart = {
|
|
|
15
15
|
currency: string;
|
|
16
16
|
items_subtotal_price: number;
|
|
17
17
|
cart_level_discount_applications: Array<DiscountApplication>;
|
|
18
|
+
discount_codes: Array<{
|
|
19
|
+
code: string;
|
|
20
|
+
applicable: boolean;
|
|
21
|
+
}>;
|
|
18
22
|
};
|
|
19
23
|
|
|
20
24
|
export type UpdatedCart = Omit<Cart, 'cart_level_discount_applications'> & {
|
package/type/json/LineItem.d.ts
CHANGED
package/type/json/Product.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ProductVariant } from './ProductVariant';
|
|
2
|
-
import type { ProductOption } from './ProductOption';
|
|
3
1
|
import type { ProductImage } from './ProductImage';
|
|
2
|
+
import type { ProductOption } from './ProductOption';
|
|
3
|
+
import type { ProductVariant } from './ProductVariant';
|
|
4
4
|
|
|
5
5
|
export type Product = {
|
|
6
6
|
id: number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProductImage } from './ProductImage';
|
|
2
|
+
import type { ProductOption } from './ProductOption';
|
|
3
|
+
import type { ProductVariant } from './ProductVariant';
|
|
4
|
+
|
|
5
|
+
export type Product = {
|
|
6
|
+
id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
body_html: string | null;
|
|
9
|
+
vendor: string;
|
|
10
|
+
product_type: string;
|
|
11
|
+
created_at: string;
|
|
12
|
+
handle: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
published_at: string;
|
|
15
|
+
tags: Array<string>;
|
|
16
|
+
variants: Array<ProductVariant>;
|
|
17
|
+
options: Array<ProductOption>;
|
|
18
|
+
images: Array<ProductImage>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ProductImage } from '../ProductImage';
|
|
2
|
+
|
|
3
|
+
export type ProductVariant = {
|
|
4
|
+
id: number;
|
|
5
|
+
product_id: number;
|
|
6
|
+
title: string;
|
|
7
|
+
price: string;
|
|
8
|
+
sku: string | null;
|
|
9
|
+
position: number;
|
|
10
|
+
compare_at_price: string | null;
|
|
11
|
+
created_at: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
taxable: boolean;
|
|
14
|
+
grams: number;
|
|
15
|
+
available: boolean;
|
|
16
|
+
requires_shipping: boolean;
|
|
17
|
+
featured_image: ProductImage | null;
|
|
18
|
+
|
|
19
|
+
// Deprecated properties
|
|
20
|
+
/** @deprecated */
|
|
21
|
+
option1: string | null;
|
|
22
|
+
/** @deprecated */
|
|
23
|
+
option2: string | null;
|
|
24
|
+
/** @deprecated */
|
|
25
|
+
option3: string | null;
|
|
26
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FeaturedImage } from '../FeaturedImage';
|
|
2
|
-
import type { SearchItem } from './SearchItem';
|
|
3
2
|
import type { ProductVariant } from './ProductVariant';
|
|
3
|
+
import type { SearchItem } from './SearchItem';
|
|
4
4
|
|
|
5
5
|
export type Product = SearchItem & {
|
|
6
6
|
available: boolean;
|