@akinon/next 1.72.0-rc.14 → 1.72.0-rc.16

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,5 +1,17 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.72.0-rc.16
4
+
5
+ ### Minor Changes
6
+
7
+ - 94eb8252: ZERO-3069: Add selectNameSpaceMainBasket mutation
8
+
9
+ ## 1.72.0-rc.15
10
+
11
+ ### Minor Changes
12
+
13
+ - ed55a810: ZERO-3023: fix session cookie persistence after browser restart
14
+
3
15
  ## 1.72.0-rc.14
4
16
 
5
17
  ### Minor Changes
package/api/auth.ts CHANGED
@@ -132,9 +132,12 @@ const nextAuthOptions = (req: NextApiRequest, res: NextApiResponse) => {
132
132
  }
133
133
 
134
134
  if (sessionId) {
135
+ const maxAge = 30 * 24 * 60 * 60; // 30 days in seconds
136
+ const cookieOptions = `Path=/; HttpOnly; Secure; Max-Age=${maxAge}`;
137
+
135
138
  res.setHeader('Set-Cookie', [
136
- `osessionid=${sessionId}; Path=/; HttpOnly; Secure;`,
137
- `sessionid=${sessionId}; Path=/; HttpOnly; Secure;` // required to get 3D redirection form
139
+ `osessionid=${sessionId}; ${cookieOptions}`,
140
+ `sessionid=${sessionId}; ${cookieOptions}` // required to get 3D redirection form
138
141
  ]);
139
142
  }
140
143
 
@@ -59,6 +59,20 @@ export const basketApi = api.injectEndpoints({
59
59
  transformResponse: (response: { baskets: Basket }) => response.baskets,
60
60
  invalidatesTags: ['MultiBasket', 'Basket']
61
61
  }),
62
+ selectNameSpaceMainBasket: build.mutation<Basket, { namespace: string }>({
63
+ query: ({ namespace }) => ({
64
+ url: buildClientRequestUrl(
65
+ basket.selectNameSpaceMainBasket(namespace),
66
+ {
67
+ contentType: 'application/json'
68
+ }
69
+ ),
70
+ method: 'POST',
71
+ body: { namespace }
72
+ }),
73
+ transformResponse: (response: { baskets: Basket }) => response.baskets,
74
+ invalidatesTags: ['MultiBasket', 'Basket']
75
+ }),
62
76
  updateQuantity: build.mutation<
63
77
  UpdateQuantityResponse,
64
78
  UpdateQuantityRequest
@@ -115,6 +129,7 @@ export const {
115
129
  useGetAllBasketsQuery,
116
130
  useRemoveBasketMutation,
117
131
  useSelectMainBasketMutation,
132
+ useSelectNameSpaceMainBasketMutation,
118
133
  useUpdateQuantityMutation,
119
134
  useClearBasketMutation,
120
135
  useApplyVoucherCodeMutation,
package/data/urls.ts CHANGED
@@ -76,7 +76,9 @@ export const basket = {
76
76
  getBasketDetail: (namespace: string) => `/baskets/basket/${namespace}/`,
77
77
  getAllBaskets: '/baskets/basket-list/',
78
78
  removeBasket: (pk: number) => `/baskets/basket-list/${pk}/`,
79
- selectMainBasket: (pk: number) => `/baskets/basket-list/id/${pk}/main/`
79
+ selectMainBasket: (pk: number) => `/baskets/basket-list/id/${pk}/main/`,
80
+ selectNameSpaceMainBasket: (namespace: string) =>
81
+ `/baskets/basket-list/ns/${namespace}/main/`
80
82
  };
81
83
 
82
84
  export const category = {
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.72.0-rc.14",
4
+ "version": "1.72.0-rc.16",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "set-cookie-parser": "2.6.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@akinon/eslint-plugin-projectzero": "1.72.0-rc.14",
33
+ "@akinon/eslint-plugin-projectzero": "1.72.0-rc.16",
34
34
  "@types/react-redux": "7.1.30",
35
35
  "@types/set-cookie-parser": "2.4.7",
36
36
  "@typescript-eslint/eslint-plugin": "6.7.4",