@akinon/next 1.101.0-snapshot-ZERO-3648-20250926111417 → 1.101.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/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @akinon/next
2
2
 
3
- ## 1.101.0-snapshot-ZERO-3648-20250926111417
3
+ ## 1.101.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - fcbbea7: ZERO-3648: Add virtual try-on feature with localization support
7
+ - 4e863f7: ZERO-3654: add null check for resetMasterpassState in PaymentOptionResetMiddleware
8
8
 
9
9
  ## 1.100.0
10
10
 
@@ -21,8 +21,7 @@ enum Plugin {
21
21
  Akifast = 'pz-akifast',
22
22
  MultiBasket = 'pz-multi-basket',
23
23
  SavedCard = 'pz-saved-card',
24
- FlowPayment = 'pz-flow-payment',
25
- VirtualTryOn = 'pz-virtual-try-on'
24
+ FlowPayment = 'pz-flow-payment'
26
25
  }
27
26
 
28
27
  export enum Component {
@@ -48,8 +47,7 @@ export enum Component {
48
47
  AkifastCheckoutButton = 'CheckoutButton',
49
48
  MultiBasket = 'MultiBasket',
50
49
  SavedCard = 'SavedCardOption',
51
- FlowPayment = 'FlowPayment',
52
- VirtualTryOnPlugin = 'VirtualTryOnPlugin'
50
+ FlowPayment = 'FlowPayment'
53
51
  }
54
52
 
55
53
  const PluginComponents = new Map([
@@ -83,8 +81,7 @@ const PluginComponents = new Map([
83
81
  ],
84
82
  [Plugin.MultiBasket, [Component.MultiBasket]],
85
83
  [Plugin.SavedCard, [Component.SavedCard]],
86
- [Plugin.FlowPayment, [Component.FlowPayment]],
87
- [Plugin.VirtualTryOn, [Component.VirtualTryOnPlugin]]
84
+ [Plugin.FlowPayment, [Component.FlowPayment]]
88
85
  ]);
89
86
 
90
87
  const getPlugin = (component: Component) => {
@@ -151,8 +148,6 @@ export default function PluginModule({
151
148
  promise = import(`${'@akinon/pz-saved-card'}`);
152
149
  } else if (plugin === Plugin.FlowPayment) {
153
150
  promise = import(`${'@akinon/pz-flow-payment'}`);
154
- } else if (plugin === Plugin.VirtualTryOn) {
155
- promise = import(`${'@akinon/pz-virtual-try-on'}`);
156
151
  }
157
152
  } catch (error) {
158
153
  logger.error(error);
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.101.0-snapshot-ZERO-3648-20250926111417",
4
+ "version": "1.101.0",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -35,7 +35,7 @@
35
35
  "set-cookie-parser": "2.6.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@akinon/eslint-plugin-projectzero": "1.101.0-snapshot-ZERO-3648-20250926111417",
38
+ "@akinon/eslint-plugin-projectzero": "1.101.0",
39
39
  "@babel/core": "7.26.10",
40
40
  "@babel/preset-env": "7.26.9",
41
41
  "@babel/preset-typescript": "7.27.0",
package/plugins.js CHANGED
@@ -16,6 +16,5 @@ module.exports = [
16
16
  'pz-tabby-extension',
17
17
  'pz-apple-pay',
18
18
  'pz-tamara-extension',
19
- 'pz-flow-payment',
20
- 'pz-virtual-try-on'
19
+ 'pz-flow-payment'
21
20
  ];
@@ -22,7 +22,9 @@ export const paymentOptionResetMiddleware: Middleware = ({
22
22
  dispatch(setBankAccounts([]));
23
23
  dispatch(setSelectedBankAccountPk(null));
24
24
  dispatch(setCardType(null));
25
- dispatch(resetMasterpassState());
25
+ if(resetMasterpassState){
26
+ dispatch(resetMasterpassState());
27
+ }
26
28
  }
27
29
 
28
30
  return result;
@@ -1,209 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
-
3
- const VIRTUAL_TRY_ON_API_URL = process.env.NEXT_PUBLIC_VIRTUAL_TRY_ON_API_URL;
4
-
5
- export async function GET(request: NextRequest) {
6
- try {
7
- const { searchParams } = new URL(request.url);
8
- const endpoint = searchParams.get('endpoint');
9
-
10
- if (endpoint === 'limited-categories') {
11
- const externalUrl = `${VIRTUAL_TRY_ON_API_URL}/api/v1/limited-categories`;
12
-
13
- const response = await fetch(externalUrl, {
14
- method: 'GET',
15
- headers: {
16
- Accept: 'application/json',
17
- ...(request.headers.get('authorization') && {
18
- Authorization: request.headers.get('authorization')!
19
- })
20
- }
21
- });
22
-
23
- let responseData: any;
24
- const responseText = await response.text();
25
-
26
- try {
27
- responseData = responseText ? JSON.parse(responseText) : {};
28
- } catch (parseError) {
29
- responseData = { category_ids: [] };
30
- }
31
-
32
- if (!response.ok) {
33
- responseData = { category_ids: [] };
34
- }
35
-
36
- return NextResponse.json(responseData, {
37
- status: response.ok ? response.status : 200,
38
- headers: {
39
- 'Access-Control-Allow-Origin': '*',
40
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, OPTIONS',
41
- 'Access-Control-Allow-Headers': 'Content-Type, Accept, Authorization'
42
- }
43
- });
44
- }
45
-
46
- return NextResponse.json(
47
- { error: 'Invalid endpoint for GET method' },
48
- { status: 400 }
49
- );
50
- } catch (error) {
51
- return NextResponse.json({ category_ids: [] }, { status: 200 });
52
- }
53
- }
54
-
55
- export async function POST(request: NextRequest) {
56
- try {
57
- const { searchParams } = new URL(request.url);
58
- const endpoint = searchParams.get('endpoint');
59
-
60
- const body = await request.json();
61
-
62
- let externalUrl: string;
63
- if (endpoint === 'feedback') {
64
- externalUrl = `${VIRTUAL_TRY_ON_API_URL}/api/v1/feedback`;
65
- } else {
66
- externalUrl = `${VIRTUAL_TRY_ON_API_URL}/api/v1/virtual-try-on`;
67
- }
68
-
69
- const httpMethod = endpoint === 'feedback' ? 'PUT' : 'POST';
70
-
71
- const response = await fetch(externalUrl, {
72
- method: httpMethod,
73
- headers: {
74
- 'Content-Type': 'application/json',
75
- ...(httpMethod === 'POST' && { Accept: 'application/json' }),
76
- ...(request.headers.get('authorization') && {
77
- Authorization: request.headers.get('authorization')!
78
- })
79
- },
80
- body: JSON.stringify(body)
81
- });
82
-
83
- let responseData: any;
84
- const responseText = await response.text();
85
-
86
- if (endpoint === 'feedback') {
87
- try {
88
- responseData = responseText ? JSON.parse(responseText) : {};
89
- } catch (parseError) {
90
- responseData = { error: 'Invalid JSON response from feedback API' };
91
- }
92
- } else {
93
- try {
94
- responseData = responseText ? JSON.parse(responseText) : {};
95
- } catch (parseError) {
96
- responseData = { error: 'Invalid JSON response' };
97
- }
98
- }
99
-
100
- if (!response.ok && responseData.error) {
101
- let userFriendlyMessage = responseData.error;
102
-
103
- if (
104
- typeof responseData.error === 'string' &&
105
- (responseData.error.includes('duplicate key value') ||
106
- responseData.error.includes('image_pk'))
107
- ) {
108
- userFriendlyMessage =
109
- 'This image has already been processed. Please try with a different image.';
110
- } else if (responseData.error.includes('bulk insert images')) {
111
- userFriendlyMessage =
112
- 'There was an issue processing your image. Please try again with a different image.';
113
- }
114
-
115
- return NextResponse.json(
116
- {
117
- ...responseData,
118
- message: userFriendlyMessage
119
- },
120
- {
121
- status: response.status,
122
- headers: {
123
- 'Access-Control-Allow-Origin': '*',
124
- 'Access-Control-Allow-Methods': 'POST, OPTIONS',
125
- 'Access-Control-Allow-Headers':
126
- 'Content-Type, Accept, Authorization'
127
- }
128
- }
129
- );
130
- }
131
-
132
- return NextResponse.json(responseData, {
133
- status: response.status,
134
- headers: {
135
- 'Access-Control-Allow-Origin': '*',
136
- 'Access-Control-Allow-Methods': 'POST, OPTIONS',
137
- 'Access-Control-Allow-Headers': 'Content-Type, Accept, Authorization'
138
- }
139
- });
140
- } catch (error) {
141
- return NextResponse.json(
142
- {
143
- status: 'error',
144
- message:
145
- 'Internal server error occurred during virtual try-on processing'
146
- },
147
- { status: 500 }
148
- );
149
- }
150
- }
151
-
152
- export async function PUT(request: NextRequest) {
153
- try {
154
- const { searchParams } = new URL(request.url);
155
- const endpoint = searchParams.get('endpoint');
156
-
157
- if (endpoint !== 'feedback') {
158
- return NextResponse.json(
159
- { error: 'PUT method only supports feedback endpoint' },
160
- { status: 400 }
161
- );
162
- }
163
-
164
- const body = await request.json();
165
-
166
- const externalUrl = `${VIRTUAL_TRY_ON_API_URL}/api/v1/feedback`;
167
-
168
- const response = await fetch(externalUrl, {
169
- method: 'PUT',
170
- headers: {
171
- 'Content-Type': 'application/json',
172
- ...(request.headers.get('authorization') && {
173
- Authorization: request.headers.get('authorization')!
174
- })
175
- },
176
- body: JSON.stringify(body)
177
- });
178
-
179
- const responseData = await response.json();
180
-
181
- return NextResponse.json(responseData, {
182
- status: response.status,
183
- headers: {
184
- 'Access-Control-Allow-Origin': '*',
185
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, OPTIONS',
186
- 'Access-Control-Allow-Headers': 'Content-Type, Accept, Authorization'
187
- }
188
- });
189
- } catch (error) {
190
- return NextResponse.json(
191
- {
192
- status: 'error',
193
- message: 'Internal server error occurred during feedback submission'
194
- },
195
- { status: 500 }
196
- );
197
- }
198
- }
199
-
200
- export async function OPTIONS() {
201
- return new NextResponse(null, {
202
- status: 200,
203
- headers: {
204
- 'Access-Control-Allow-Origin': '*',
205
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, OPTIONS',
206
- 'Access-Control-Allow-Headers': 'Content-Type, Accept, Authorization'
207
- }
208
- });
209
- }