ui.shipaid.com 0.2.6 → 0.2.7
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/widget.es.js +578 -0
- package/dist/widget.iife.js +577 -0
- package/package.json +2 -2
- package/types/scss.d.ts +0 -5
- package/types/shipaid.ts +0 -54
- package/types/shopify.ts +0 -90
- package/types/vite-env.d.ts +0 -9
- package/types/widget.ts +0 -15
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui.shipaid.com",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/widget.umd.js",
|
|
7
7
|
"unpkg": "dist/widget.iife.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"types": "dist-types/src/shipaid-widget.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist-types",
|
|
15
|
-
"
|
|
15
|
+
"dist"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
18
|
"develop": "vite",
|
package/types/scss.d.ts
DELETED
package/types/shipaid.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export interface ProtectionSettingsProductVariant {
|
|
2
|
-
id?: string
|
|
3
|
-
sku?: string
|
|
4
|
-
price?: string
|
|
5
|
-
title?: string
|
|
6
|
-
selectedOptions?: { name?: string, value?: string }[]
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface ProtectionSettingsProduct {
|
|
10
|
-
// Making these optional, as it is stored as a jsonb field, so we can't guarantee the format it returns.
|
|
11
|
-
id?: string
|
|
12
|
-
title?: string
|
|
13
|
-
options?: { name: string, value: string }[]
|
|
14
|
-
variants?: {
|
|
15
|
-
edges?: {
|
|
16
|
-
node?: ProtectionSettingsProductVariant
|
|
17
|
-
}[]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ProtectionSettings {
|
|
22
|
-
product?: ProtectionSettingsProduct
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ProtectionSettingsPercentage extends ProtectionSettings {
|
|
26
|
-
protectionType: 'PERCENTAGE'
|
|
27
|
-
percentage: number
|
|
28
|
-
minimumFee: number
|
|
29
|
-
}
|
|
30
|
-
export interface ProtectionSettingsFixed extends ProtectionSettings {
|
|
31
|
-
protectionType: 'FIXED'
|
|
32
|
-
defaultFee?: number
|
|
33
|
-
// Making these optional, as it is stored as a jsonb field, so we can't guarantee the format it returns.
|
|
34
|
-
rules?: {
|
|
35
|
-
fee?: number
|
|
36
|
-
rangeLower?: number
|
|
37
|
-
rangeUpper?: number
|
|
38
|
-
}[]
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ShipAidStore {
|
|
42
|
-
store: string;
|
|
43
|
-
currency: string
|
|
44
|
-
widgetAutoOptIn?: boolean
|
|
45
|
-
widgetShowCart?: boolean
|
|
46
|
-
excludedProductSkus?: string[]
|
|
47
|
-
planActive: boolean
|
|
48
|
-
protectionSettings: ProtectionSettingsFixed | ProtectionSettingsPercentage
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface ShipAidStoreQuery {
|
|
52
|
-
data: null | { store: ShipAidStore }
|
|
53
|
-
errors?: { message: string }[]
|
|
54
|
-
}
|
package/types/shopify.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
/* eslint-disable camelcase */
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
Shopify?: {
|
|
7
|
-
shop?: string
|
|
8
|
-
locale?: string
|
|
9
|
-
designMode?: boolean
|
|
10
|
-
currency?: {
|
|
11
|
-
active?: string
|
|
12
|
-
}
|
|
13
|
-
Checkout?: Record<string, string>
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface ShopifyCart {
|
|
19
|
-
token: string;
|
|
20
|
-
note?: null;
|
|
21
|
-
original_total_price: number;
|
|
22
|
-
total_price: number;
|
|
23
|
-
total_discount: number;
|
|
24
|
-
total_weight: number;
|
|
25
|
-
item_count: number;
|
|
26
|
-
items?: ShopifyCartItem[];
|
|
27
|
-
requires_shipping: boolean;
|
|
28
|
-
currency: string;
|
|
29
|
-
items_subtotal_price: number;
|
|
30
|
-
cart_level_discount_applications?: (null)[] | null;
|
|
31
|
-
sections?: Record<string, string>
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ShopifyCartItem {
|
|
35
|
-
id: number;
|
|
36
|
-
index: number;
|
|
37
|
-
position: number;
|
|
38
|
-
properties?: null;
|
|
39
|
-
quantity: number;
|
|
40
|
-
variant_id: number;
|
|
41
|
-
key: string;
|
|
42
|
-
title: string;
|
|
43
|
-
price: number;
|
|
44
|
-
original_price: number;
|
|
45
|
-
discounted_price: number;
|
|
46
|
-
line_price: number;
|
|
47
|
-
original_line_price: number;
|
|
48
|
-
total_discount: number;
|
|
49
|
-
discounts?: (null)[] | null;
|
|
50
|
-
sku: string;
|
|
51
|
-
grams: number;
|
|
52
|
-
vendor: string;
|
|
53
|
-
taxable: boolean;
|
|
54
|
-
product_id: number;
|
|
55
|
-
product_has_only_default_variant: boolean;
|
|
56
|
-
gift_card: boolean;
|
|
57
|
-
final_price: number;
|
|
58
|
-
final_line_price: number;
|
|
59
|
-
url: string;
|
|
60
|
-
featured_image: FeaturedImage;
|
|
61
|
-
image: string;
|
|
62
|
-
handle: string;
|
|
63
|
-
requires_shipping: boolean;
|
|
64
|
-
product_type: string;
|
|
65
|
-
product_title: string;
|
|
66
|
-
product_description: string;
|
|
67
|
-
variant_title?: null;
|
|
68
|
-
variant_options?: (string)[] | null;
|
|
69
|
-
options_with_values?: (OptionsWithValuesEntity)[] | null;
|
|
70
|
-
line_level_discount_allocations?: (null)[] | null;
|
|
71
|
-
line_level_total_discount: number;
|
|
72
|
-
sections?: Record<string, string>
|
|
73
|
-
}
|
|
74
|
-
export interface FeaturedImage {
|
|
75
|
-
aspect_ratio: number;
|
|
76
|
-
alt: string;
|
|
77
|
-
height: number;
|
|
78
|
-
url: string;
|
|
79
|
-
width: number;
|
|
80
|
-
}
|
|
81
|
-
export interface OptionsWithValuesEntity {
|
|
82
|
-
name: string;
|
|
83
|
-
value: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface ShopifyCartAddPayload {
|
|
87
|
-
id: number | string
|
|
88
|
-
quantity?: number
|
|
89
|
-
sections?: string
|
|
90
|
-
}
|
package/types/vite-env.d.ts
DELETED
package/types/widget.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export enum Events {
|
|
2
|
-
LOADED = 'shipaid-loaded',
|
|
3
|
-
STATUS_UPDATE = 'shipaid-protection-status'
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface State {
|
|
7
|
-
loading: boolean
|
|
8
|
-
success: boolean | null
|
|
9
|
-
error: boolean | string | null
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface FetchHelper {
|
|
13
|
-
get: <Data>(url: string) => Promise<Data>
|
|
14
|
-
post: <Data>(url: string, body: unknown) => Promise<Data>
|
|
15
|
-
}
|