@vue-storefront/next 6.1.1-rc.0 → 7.0.0-next.1
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/{chunk-FWCSY2DS.mjs → chunk-WNQUEZJF.mjs} +22 -1
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +35 -13
- package/dist/index.mjs +17 -14
- package/dist/{types-B9h_AU7R.d.mts → types-B00HMKAX.d.mts} +8 -8
- package/dist/{types-B9h_AU7R.d.ts → types-B00HMKAX.d.ts} +8 -8
- package/package.json +8 -8
|
@@ -29,9 +29,30 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
var __async = (__this, __arguments, generator) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
var fulfilled = (value) => {
|
|
35
|
+
try {
|
|
36
|
+
step(generator.next(value));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
reject(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var rejected = (value) => {
|
|
42
|
+
try {
|
|
43
|
+
step(generator.throw(value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
32
52
|
|
|
33
53
|
export {
|
|
34
54
|
__spreadValues,
|
|
35
55
|
__spreadProps,
|
|
36
|
-
__objRest
|
|
56
|
+
__objRest,
|
|
57
|
+
__async
|
|
37
58
|
};
|
package/dist/client.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SDKApi } from '@alokai/connect/sdk';
|
|
2
|
-
import { S as SfContract, C as CreateSdkContextReturn } from './types-
|
|
3
|
-
export { M as Maybe, b as SfState, a as SfStateProps, c as createSfStateProvider } from './types-
|
|
2
|
+
import { S as SfContract, C as CreateSdkContextReturn } from './types-B00HMKAX.mjs';
|
|
3
|
+
export { M as Maybe, b as SfState, a as SfStateProps, c as createSfStateProvider } from './types-B00HMKAX.mjs';
|
|
4
4
|
import 'next/headers';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SDKApi } from '@alokai/connect/sdk';
|
|
2
|
-
import { S as SfContract, C as CreateSdkContextReturn } from './types-
|
|
3
|
-
export { M as Maybe, b as SfState, a as SfStateProps, c as createSfStateProvider } from './types-
|
|
2
|
+
import { S as SfContract, C as CreateSdkContextReturn } from './types-B00HMKAX.js';
|
|
3
|
+
export { M as Maybe, b as SfState, a as SfStateProps, c as createSfStateProvider } from './types-B00HMKAX.js';
|
|
4
4
|
import 'next/headers';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
package/dist/client.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _alokai_connect_logger from '@alokai/connect/logger';
|
|
|
2
2
|
import { NextRequest, NextResponse } from 'next/server';
|
|
3
3
|
import { buildModule } from '@alokai/connect/sdk';
|
|
4
4
|
export { defineGetConfigSwitcherHeader } from '@alokai/connect/sdk';
|
|
5
|
-
import { d as CreateSdkOptions, e as Config, f as CreateSdkReturn, I as InjectedContext } from './types-
|
|
5
|
+
import { d as CreateSdkOptions, e as Config, f as CreateSdkReturn, I as InjectedContext } from './types-B00HMKAX.mjs';
|
|
6
6
|
import 'next/headers';
|
|
7
7
|
import 'react';
|
|
8
8
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _alokai_connect_logger from '@alokai/connect/logger';
|
|
|
2
2
|
import { NextRequest, NextResponse } from 'next/server';
|
|
3
3
|
import { buildModule } from '@alokai/connect/sdk';
|
|
4
4
|
export { defineGetConfigSwitcherHeader } from '@alokai/connect/sdk';
|
|
5
|
-
import { d as CreateSdkOptions, e as Config, f as CreateSdkReturn, I as InjectedContext } from './types-
|
|
5
|
+
import { d as CreateSdkOptions, e as Config, f as CreateSdkReturn, I as InjectedContext } from './types-B00HMKAX.js';
|
|
6
6
|
import 'next/headers';
|
|
7
7
|
import 'react';
|
|
8
8
|
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,26 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
33
33
|
return to;
|
|
34
34
|
};
|
|
35
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
var __async = (__this, __arguments, generator) => {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
var fulfilled = (value) => {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.next(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var rejected = (value) => {
|
|
46
|
+
try {
|
|
47
|
+
step(generator.throw(value));
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reject(e);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
53
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
54
|
+
});
|
|
55
|
+
};
|
|
36
56
|
|
|
37
57
|
// src/index.ts
|
|
38
58
|
var src_exports = {};
|
|
@@ -132,19 +152,21 @@ function normalizeRequestHeaders(requestHeaders) {
|
|
|
132
152
|
function resolveDynamicContext(context) {
|
|
133
153
|
return __spreadProps(__spreadValues({}, context), {
|
|
134
154
|
getRequestHeaders() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Object.
|
|
141
|
-
(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
155
|
+
return __async(this, null, function* () {
|
|
156
|
+
var _a2;
|
|
157
|
+
const normalizedHeaders = normalizeRequestHeaders(
|
|
158
|
+
yield (_a2 = context.getRequestHeaders) == null ? void 0 : _a2.call(context)
|
|
159
|
+
);
|
|
160
|
+
const requestHeaders = Object.fromEntries(
|
|
161
|
+
Object.entries(normalizedHeaders).filter(
|
|
162
|
+
([key]) => !BLACKLISTED_HEADERS.has(key)
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
if (context.getLocale) {
|
|
166
|
+
requestHeaders["x-alokai-locale"] = context.getLocale();
|
|
167
|
+
}
|
|
168
|
+
return requestHeaders;
|
|
169
|
+
});
|
|
148
170
|
}
|
|
149
171
|
});
|
|
150
172
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
__async,
|
|
2
3
|
__spreadProps,
|
|
3
4
|
__spreadValues
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WNQUEZJF.mjs";
|
|
5
6
|
|
|
6
7
|
// src/logger/index.ts
|
|
7
8
|
import { LoggerFactory, LoggerType } from "@alokai/connect/logger";
|
|
@@ -88,19 +89,21 @@ function normalizeRequestHeaders(requestHeaders) {
|
|
|
88
89
|
function resolveDynamicContext(context) {
|
|
89
90
|
return __spreadProps(__spreadValues({}, context), {
|
|
90
91
|
getRequestHeaders() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Object.
|
|
97
|
-
(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
92
|
+
return __async(this, null, function* () {
|
|
93
|
+
var _a2;
|
|
94
|
+
const normalizedHeaders = normalizeRequestHeaders(
|
|
95
|
+
yield (_a2 = context.getRequestHeaders) == null ? void 0 : _a2.call(context)
|
|
96
|
+
);
|
|
97
|
+
const requestHeaders = Object.fromEntries(
|
|
98
|
+
Object.entries(normalizedHeaders).filter(
|
|
99
|
+
([key]) => !BLACKLISTED_HEADERS.has(key)
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
if (context.getLocale) {
|
|
103
|
+
requestHeaders["x-alokai-locale"] = context.getLocale();
|
|
104
|
+
}
|
|
105
|
+
return requestHeaders;
|
|
106
|
+
});
|
|
104
107
|
}
|
|
105
108
|
});
|
|
106
109
|
}
|
|
@@ -107,8 +107,11 @@ interface CreateSdkOptions {
|
|
|
107
107
|
middleware: MiddlewareConfig;
|
|
108
108
|
multistore?: MultistoreConfig;
|
|
109
109
|
}
|
|
110
|
-
type Cookies = ReturnType<typeof cookies
|
|
111
|
-
type
|
|
110
|
+
type Cookies = Awaited<ReturnType<typeof cookies>>;
|
|
111
|
+
type RequestHeaders = {
|
|
112
|
+
cookies: Cookies;
|
|
113
|
+
headers: Headers;
|
|
114
|
+
} | Headers | undefined;
|
|
112
115
|
type GetSdkContext = {
|
|
113
116
|
/**
|
|
114
117
|
* A function that returns the current locale string;
|
|
@@ -117,13 +120,10 @@ type GetSdkContext = {
|
|
|
117
120
|
/**
|
|
118
121
|
* A function that returns the request headers.
|
|
119
122
|
*/
|
|
120
|
-
getRequestHeaders?: () =>
|
|
121
|
-
cookies: Cookies;
|
|
122
|
-
headers: NextHeaders;
|
|
123
|
-
} | NextHeaders;
|
|
123
|
+
getRequestHeaders?: () => Promise<RequestHeaders> | RequestHeaders;
|
|
124
124
|
};
|
|
125
125
|
type DynamicContext = {
|
|
126
|
-
getRequestHeaders: () => Record<string, string | string[]
|
|
126
|
+
getRequestHeaders: () => Promise<Record<string, string | string[]>>;
|
|
127
127
|
};
|
|
128
128
|
type StaticContext = {
|
|
129
129
|
buildModule: typeof buildModule;
|
|
@@ -164,7 +164,7 @@ interface CreateSdkReturn<TConfig extends Record<string, any>> {
|
|
|
164
164
|
*
|
|
165
165
|
* export const getServerSideProps: GetServerSideProps = async ({ req, locale }) => {
|
|
166
166
|
* const sdk = await getSdk({
|
|
167
|
-
* getRequestHeaders: () => req.headers,
|
|
167
|
+
* getRequestHeaders: () => Promise.resolve(req.headers),
|
|
168
168
|
* getLocale: () => locale,
|
|
169
169
|
* });
|
|
170
170
|
* const { products } = await sdk.unified.getProducts();
|
|
@@ -107,8 +107,11 @@ interface CreateSdkOptions {
|
|
|
107
107
|
middleware: MiddlewareConfig;
|
|
108
108
|
multistore?: MultistoreConfig;
|
|
109
109
|
}
|
|
110
|
-
type Cookies = ReturnType<typeof cookies
|
|
111
|
-
type
|
|
110
|
+
type Cookies = Awaited<ReturnType<typeof cookies>>;
|
|
111
|
+
type RequestHeaders = {
|
|
112
|
+
cookies: Cookies;
|
|
113
|
+
headers: Headers;
|
|
114
|
+
} | Headers | undefined;
|
|
112
115
|
type GetSdkContext = {
|
|
113
116
|
/**
|
|
114
117
|
* A function that returns the current locale string;
|
|
@@ -117,13 +120,10 @@ type GetSdkContext = {
|
|
|
117
120
|
/**
|
|
118
121
|
* A function that returns the request headers.
|
|
119
122
|
*/
|
|
120
|
-
getRequestHeaders?: () =>
|
|
121
|
-
cookies: Cookies;
|
|
122
|
-
headers: NextHeaders;
|
|
123
|
-
} | NextHeaders;
|
|
123
|
+
getRequestHeaders?: () => Promise<RequestHeaders> | RequestHeaders;
|
|
124
124
|
};
|
|
125
125
|
type DynamicContext = {
|
|
126
|
-
getRequestHeaders: () => Record<string, string | string[]
|
|
126
|
+
getRequestHeaders: () => Promise<Record<string, string | string[]>>;
|
|
127
127
|
};
|
|
128
128
|
type StaticContext = {
|
|
129
129
|
buildModule: typeof buildModule;
|
|
@@ -164,7 +164,7 @@ interface CreateSdkReturn<TConfig extends Record<string, any>> {
|
|
|
164
164
|
*
|
|
165
165
|
* export const getServerSideProps: GetServerSideProps = async ({ req, locale }) => {
|
|
166
166
|
* const sdk = await getSdk({
|
|
167
|
-
* getRequestHeaders: () => req.headers,
|
|
167
|
+
* getRequestHeaders: () => Promise.resolve(req.headers),
|
|
168
168
|
* getLocale: () => locale,
|
|
169
169
|
* });
|
|
170
170
|
* const { products } = await sdk.unified.getProducts();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@vue-storefront/next",
|
|
3
3
|
"description": "Alokai dedicated features for Next.js",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "7.0.0-next.1",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"zustand": "^4.5.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@alokai/connect": "^1.
|
|
34
|
+
"@alokai/connect": "^1.3.0-next.0",
|
|
35
35
|
"@types/react": "18.3.2",
|
|
36
36
|
"@types/react-dom": "18.3.0",
|
|
37
37
|
"eslint": "9.23.0",
|
|
38
|
-
"next": "
|
|
38
|
+
"next": "15.5.6",
|
|
39
39
|
"prettier": "3.3.2",
|
|
40
|
-
"react": "
|
|
41
|
-
"react-dom": "
|
|
40
|
+
"react": "19.2.0",
|
|
41
|
+
"react-dom": "19.2.0",
|
|
42
42
|
"start-server-and-test": "^2.0.11",
|
|
43
43
|
"tsup": "8.3.0",
|
|
44
44
|
"vitest": "2.1.9"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@alokai/connect": "^1.
|
|
48
|
-
"next": "^
|
|
49
|
-
"react": "^
|
|
47
|
+
"@alokai/connect": "^1.3.0-next.0",
|
|
48
|
+
"next": "^15.0.0",
|
|
49
|
+
"react": "^19.0.0"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"npm": ">=8.0.0",
|