@akinon/next 1.21.0-rc.6 → 1.21.0-rc.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/CHANGELOG.md +8 -0
- package/bin/pz-install-plugins.js +1 -1
- package/data/client/user.ts +18 -2
- package/data/urls.ts +2 -1
- package/package.json +2 -2
- package/types/gtm.ts +48 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.21.0-rc.7
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5ace3508: ZERO-2439: Add anonymous tracking page
|
|
8
|
+
- be04d041: ZERO-2452: UA events converted to be compatible with GA4 and types are declared
|
|
9
|
+
- c75e1e45: ZERO-2452: GA4 support for gtm events
|
|
10
|
+
|
|
3
11
|
## 1.21.0-rc.6
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -37,7 +37,7 @@ const protectedPackages = ['@akinon/next', 'next'];
|
|
|
37
37
|
const pluginsToRemove = Object.keys(packageJson.dependencies || {}).filter(
|
|
38
38
|
(dep) =>
|
|
39
39
|
dep.startsWith('@akinon/') &&
|
|
40
|
-
installedPlugins.includes(dep.replace('@akinon/', '')) &&
|
|
40
|
+
!installedPlugins.includes(dep.replace('@akinon/', '')) &&
|
|
41
41
|
!protectedPackages.includes(dep)
|
|
42
42
|
);
|
|
43
43
|
|
package/data/client/user.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { api } from './api';
|
|
2
2
|
import { user } from '../urls';
|
|
3
|
-
import { ForgotPasswordFormType } from '../../types';
|
|
3
|
+
import { ForgotPasswordFormType, Order } from '../../types';
|
|
4
4
|
import { buildClientRequestUrl } from '../../utils';
|
|
5
5
|
|
|
6
6
|
interface GetCaptchaResponse {
|
|
@@ -84,6 +84,21 @@ const userApi = api.injectEndpoints({
|
|
|
84
84
|
contentType: 'application/json'
|
|
85
85
|
})
|
|
86
86
|
})
|
|
87
|
+
}),
|
|
88
|
+
getAnonymousTracking: build.mutation<
|
|
89
|
+
Order,
|
|
90
|
+
{ email: string; number: string }
|
|
91
|
+
>({
|
|
92
|
+
query: ({ email, number }) => ({
|
|
93
|
+
url: buildClientRequestUrl(user.anonymousOrderTracking, {
|
|
94
|
+
useFormData: true
|
|
95
|
+
}),
|
|
96
|
+
method: 'POST',
|
|
97
|
+
body: {
|
|
98
|
+
email,
|
|
99
|
+
number
|
|
100
|
+
}
|
|
101
|
+
})
|
|
87
102
|
})
|
|
88
103
|
}),
|
|
89
104
|
overrideExisting: false
|
|
@@ -95,5 +110,6 @@ export const {
|
|
|
95
110
|
useConfirmEmailVerificationQuery,
|
|
96
111
|
useValidateCaptchaMutation,
|
|
97
112
|
useLogoutMutation,
|
|
98
|
-
useForgotPasswordMutation
|
|
113
|
+
useForgotPasswordMutation,
|
|
114
|
+
useGetAnonymousTrackingMutation
|
|
99
115
|
} = userApi;
|
package/data/urls.ts
CHANGED
|
@@ -172,7 +172,8 @@ export const user = {
|
|
|
172
172
|
`/users/email-set-primary/${token}/`,
|
|
173
173
|
confirmEmailVerification: (token: string) =>
|
|
174
174
|
`/users/registration/account-confirm-email/${token}/`,
|
|
175
|
-
csrfToken: '/csrf_token/'
|
|
175
|
+
csrfToken: '/csrf_token/',
|
|
176
|
+
anonymousOrderTracking: '/users/orders/anonymous'
|
|
176
177
|
};
|
|
177
178
|
|
|
178
179
|
export const b2b = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.21.0-rc.
|
|
4
|
+
"version": "1.21.0-rc.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|
|
33
33
|
"@typescript-eslint/parser": "6.7.4",
|
|
34
34
|
"eslint": "^8.14.0",
|
|
35
|
-
"@akinon/eslint-plugin-projectzero": "1.21.0-rc.
|
|
35
|
+
"@akinon/eslint-plugin-projectzero": "1.21.0-rc.7",
|
|
36
36
|
"eslint-config-prettier": "8.5.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/types/gtm.ts
CHANGED
|
@@ -14,3 +14,51 @@ export interface GTMUserType {
|
|
|
14
14
|
gender: string;
|
|
15
15
|
emailAllowed: boolean;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
export interface GA4EventItem {
|
|
19
|
+
item_id: string | number;
|
|
20
|
+
item_name: string | number;
|
|
21
|
+
coupon?: string | number;
|
|
22
|
+
discount?: string | null;
|
|
23
|
+
index?: number;
|
|
24
|
+
item_brand?: string;
|
|
25
|
+
item_category?: string;
|
|
26
|
+
item_category2?: string;
|
|
27
|
+
item_category3?: string;
|
|
28
|
+
item_category4?: string;
|
|
29
|
+
item_category5?: string;
|
|
30
|
+
item_list_id?: string;
|
|
31
|
+
item_list_name?: string;
|
|
32
|
+
item_variant?: string;
|
|
33
|
+
price?: string | number;
|
|
34
|
+
quantity?: number;
|
|
35
|
+
sale_status?: string;
|
|
36
|
+
stock_status?: string;
|
|
37
|
+
discount_percent?: number;
|
|
38
|
+
discount_price?: string;
|
|
39
|
+
product_gender?: string;
|
|
40
|
+
product_size?: string;
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface GA4EventParams {
|
|
45
|
+
item_list_id?: string;
|
|
46
|
+
item_list_name?: string;
|
|
47
|
+
value?: number;
|
|
48
|
+
currency?: string;
|
|
49
|
+
shipping_tier?: string;
|
|
50
|
+
coupon?: string;
|
|
51
|
+
selected_shipping_option?: string;
|
|
52
|
+
creative_name?: string;
|
|
53
|
+
creative_slot?: string;
|
|
54
|
+
promotion_id?: string;
|
|
55
|
+
promotion_name?: string;
|
|
56
|
+
items?: GA4EventItem[];
|
|
57
|
+
transaction_id?: string;
|
|
58
|
+
tax?: number;
|
|
59
|
+
shipping?: number;
|
|
60
|
+
shipping_country?: string;
|
|
61
|
+
shipping_city?: string;
|
|
62
|
+
payment_method?: string;
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
}
|