@scayle/storefront-nuxt 7.85.10 → 7.85.12

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,20 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.85.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Support passing an internal access header
8
+ **Dependencies**
9
+
10
+ - Updated dependency to @scayle/storefront-core@7.65.5
11
+
12
+ ## 7.85.11
13
+
14
+ ### Patch Changes
15
+
16
+ - Update @nuxt/module-builder to 0.8.4
17
+
3
18
  ## 7.85.10
4
19
 
5
20
  ### Patch Changes
package/dist/module.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "7.85.10",
3
+ "version": "7.85.12",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
7
7
  },
8
8
  "builder": {
9
- "@nuxt/module-builder": "0.7.1",
9
+ "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
11
11
  }
12
12
  }
package/dist/module.mjs CHANGED
@@ -48,7 +48,7 @@ export default {
48
48
  }`;
49
49
  }
50
50
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
51
- const PACKAGE_VERSION = "7.85.10";
51
+ const PACKAGE_VERSION = "7.85.12";
52
52
  const logger = createConsola({
53
53
  fancy: true,
54
54
  formatOptions: {
@@ -99,7 +99,8 @@ const module = defineNuxtModule({
99
99
  wishlistKey: "wishlist_{shopId}_{userId}",
100
100
  basketKey: "basket_{shopId}_{userId}",
101
101
  hashAlgorithm: "sha256"
102
- }
102
+ },
103
+ internalAccessHeader: ""
103
104
  },
104
105
  setup(options, nuxt) {
105
106
  const { resolve } = createResolver(import.meta.url);
@@ -1,24 +1,4 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | true | string[] | import("@scayle/storefront-core").ShopUser | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant> | {
2
- type: "failure";
3
- statusCode: number;
4
- basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
5
- } | {
6
- readonly type: "success";
7
- readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
8
- } | {
9
- readonly type: "failure";
10
- readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
11
- readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
12
- } | import("@scayle/storefront-api").BrandsEndpointResponseData | import("@scayle/storefront-api").Brand | {
13
- categories: import("@scayle/storefront-api").Category[];
14
- activeNode: undefined;
15
- } | import("@scayle/storefront-api").Category | {
16
- categories: import("@scayle/storefront-api").Category;
17
- activeNode: import("@scayle/storefront-api").Category;
18
- } | import("@scayle/storefront-core").Order | {
19
- category: string | undefined;
20
- categoryId: number | undefined;
21
- } | import("@scayle/storefront-api").Product[] | {
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | true | string[] | import("@scayle/storefront-core").ShopUser | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").Product[] | {
22
2
  count: number;
23
3
  } | {
24
4
  filters: import("@scayle/storefront-api").FiltersEndpointResponseData;
@@ -35,7 +15,24 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
35
15
  next: number;
36
16
  last: number;
37
17
  };
38
- } | import("@scayle/storefront-api").TypeaheadSuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
18
+ } | import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant> | {
19
+ type: "failure";
20
+ statusCode: number;
21
+ basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
22
+ } | {
23
+ readonly type: "success";
24
+ readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
25
+ } | {
26
+ readonly type: "failure";
27
+ readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
28
+ readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
29
+ } | import("@scayle/storefront-api").BrandsEndpointResponseData | import("@scayle/storefront-api").Brand | {
30
+ categories: import("@scayle/storefront-api").Category[];
31
+ activeNode: undefined;
32
+ } | import("@scayle/storefront-api").Category | {
33
+ categories: import("@scayle/storefront-api").Category;
34
+ activeNode: import("@scayle/storefront-api").Category;
35
+ } | import("@scayle/storefront-core").Order | import("@scayle/storefront-api").TypeaheadSuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
39
36
  user: import("@scayle/storefront-core").ShopUser | undefined;
40
37
  } | import("@scayle/storefront-api").Wishlist | Response | import("@scayle/storefront-core").ShopUserAddress[] | {
41
38
  accessToken: string;
@@ -89,7 +89,10 @@ export const buildContext = async (context) => {
89
89
  auth: {
90
90
  type: "token",
91
91
  token: sapiConfig.token
92
- }
92
+ },
93
+ additionalHeaders: $storefront.internalAccessHeader ? {
94
+ "x-internal-access": $storefront.internalAccessHeader
95
+ } : {}
93
96
  });
94
97
  const cached = new Cached($cache, $log, "", $storefront.cache?.enabled ?? true).execute;
95
98
  const { hooks } = useNitroApp();
@@ -145,6 +148,7 @@ export const buildContext = async (context) => {
145
148
  runtimeConfiguration: config,
146
149
  ip: getRequestIP(event, { xForwardedFor: true }),
147
150
  headers: createAndPurifyHeaders(getRequestHeaders(event)),
151
+ internalAccessHeader: $storefront.internalAccessHeader,
148
152
  callHook: hooks.callHook,
149
153
  callHookParallel: hooks.callHookParallel,
150
154
  callHookWith: hooks.callHookWith
@@ -911,6 +911,8 @@ declare const StorefrontConfigSchema: z.ZodIntersection<z.ZodObject<{
911
911
  prefix?: string | undefined;
912
912
  sslTransit?: boolean | undefined;
913
913
  }>]>>;
914
+ /** Undocumented property intended for internal usage only */
915
+ internalAccessHeader: z.ZodOptional<z.ZodString>;
914
916
  }, "strip", z.ZodTypeAny, {
915
917
  oauth: {
916
918
  apiHost: string;
@@ -927,6 +929,7 @@ declare const StorefrontConfigSchema: z.ZodIntersection<z.ZodObject<{
927
929
  idpKeys: string[];
928
930
  idpRedirectURL: string;
929
931
  } | undefined;
932
+ internalAccessHeader?: string | undefined;
930
933
  redis?: {
931
934
  port?: number | undefined;
932
935
  host?: string | undefined;
@@ -1000,6 +1003,7 @@ declare const StorefrontConfigSchema: z.ZodIntersection<z.ZodObject<{
1000
1003
  idpKeys: string[];
1001
1004
  idpRedirectURL: string;
1002
1005
  } | undefined;
1006
+ internalAccessHeader?: string | undefined;
1003
1007
  redis?: {
1004
1008
  port?: number | undefined;
1005
1009
  host?: string | undefined;
@@ -2728,6 +2732,8 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
2728
2732
  prefix?: string | undefined;
2729
2733
  sslTransit?: boolean | undefined;
2730
2734
  }>]>>;
2735
+ /** Undocumented property intended for internal usage only */
2736
+ internalAccessHeader: z.ZodOptional<z.ZodString>;
2731
2737
  }, "strip", z.ZodTypeAny, {
2732
2738
  oauth: {
2733
2739
  apiHost: string;
@@ -2744,6 +2750,7 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
2744
2750
  idpKeys: string[];
2745
2751
  idpRedirectURL: string;
2746
2752
  } | undefined;
2753
+ internalAccessHeader?: string | undefined;
2747
2754
  redis?: {
2748
2755
  port?: number | undefined;
2749
2756
  host?: string | undefined;
@@ -2817,6 +2824,7 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
2817
2824
  idpKeys: string[];
2818
2825
  idpRedirectURL: string;
2819
2826
  } | undefined;
2827
+ internalAccessHeader?: string | undefined;
2820
2828
  redis?: {
2821
2829
  port?: number | undefined;
2822
2830
  host?: string | undefined;
@@ -3172,6 +3180,7 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
3172
3180
  idpKeys: string[];
3173
3181
  idpRedirectURL: string;
3174
3182
  } | undefined;
3183
+ internalAccessHeader?: string | undefined;
3175
3184
  redis?: {
3176
3185
  port?: number | undefined;
3177
3186
  host?: string | undefined;
@@ -3454,6 +3463,7 @@ export declare const RuntimeConfigSchema: z.ZodObject<{
3454
3463
  idpKeys: string[];
3455
3464
  idpRedirectURL: string;
3456
3465
  } | undefined;
3466
+ internalAccessHeader?: string | undefined;
3457
3467
  redis?: {
3458
3468
  port?: number | undefined;
3459
3469
  host?: string | undefined;
@@ -147,7 +147,9 @@ const StorefrontConfigSchema = z.intersection(
147
147
  publicShopData: z.array(z.string()).optional(),
148
148
  idp: IdpSchema.optional(),
149
149
  /** @deprecated Global storefront.redis config is being removed in favor of `storefront.storage` config */
150
- redis: RedisConfigSchema.optional()
150
+ redis: RedisConfigSchema.optional(),
151
+ /** Undocumented property intended for internal usage only */
152
+ internalAccessHeader: z.string().optional()
151
153
  }),
152
154
  z.union([
153
155
  z.object({ sapi: SapiSchema, bapi: z.undefined() }),
package/dist/types.d.mts CHANGED
@@ -1,62 +1,11 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
1
2
 
2
- import type { ModulePublicRuntimeConfig } from './module.js'
3
-
4
- export interface ModuleOptions {
5
- session: {
6
- /** @default "$session" */
7
- cookieName: string,
8
-
9
- /** @default "lax" */
10
- sameSite: string,
11
- },
12
-
13
- /** @default "domain" */
14
- shopSelector: string,
15
-
16
- oauth: {
17
- /** @default "" */
18
- apiHost: string,
19
-
20
- /** @default "" */
21
- clientId: string,
22
-
23
- /** @default "" */
24
- clientSecret: string,
25
- },
26
-
27
- idp: {
28
- /** @default false */
29
- enabled: boolean,
30
-
31
- idpKeys: Array<any>,
32
-
33
- /** @default "" */
34
- idpRedirectURL: string,
35
- },
36
-
37
- appKeys: {
38
- /** @default "wishlist_{shopId}_{userId}" */
39
- wishlistKey: string,
40
-
41
- /** @default "basket_{shopId}_{userId}" */
42
- basketKey: string,
43
-
44
- /** @default "sha256" */
45
- hashAlgorithm: string,
46
- },
47
- }
3
+ import type { default as Module, ModulePublicRuntimeConfig } from './module.js'
48
4
 
49
5
  declare module '@nuxt/schema' {
50
- interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
51
- interface NuxtOptions { ['storefront']?: ModuleOptions }
52
- interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
53
- }
54
-
55
- declare module 'nuxt/schema' {
56
- interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
57
- interface NuxtOptions { ['storefront']?: ModuleOptions }
58
6
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
59
7
  }
60
8
 
9
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
61
10
 
62
- export type { AdditionalShopConfig, AppKeys, BapiConfig, CheckoutEvent, CheckoutShopConfig, ModulePublicRuntimeConfig, PublicShopConfig, RedisConfig, SapiConfig, SessionConfig, ShopConfig, ShopConfigIndexed, StorageConfig, StorageEntity, StorageProvider, StorefrontConfig } from './module.js'
11
+ export { type AdditionalShopConfig, type AppKeys, type BapiConfig, type CheckoutEvent, type CheckoutShopConfig, type ModulePublicRuntimeConfig, type PublicShopConfig, type RedisConfig, type SapiConfig, type SessionConfig, type ShopConfig, type ShopConfigIndexed, type StorageConfig, type StorageEntity, type StorageProvider, type StorefrontConfig } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1,62 +1,11 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
1
2
 
2
- import type { ModulePublicRuntimeConfig } from './module'
3
-
4
- export interface ModuleOptions {
5
- session: {
6
- /** @default "$session" */
7
- cookieName: string,
8
-
9
- /** @default "lax" */
10
- sameSite: string,
11
- },
12
-
13
- /** @default "domain" */
14
- shopSelector: string,
15
-
16
- oauth: {
17
- /** @default "" */
18
- apiHost: string,
19
-
20
- /** @default "" */
21
- clientId: string,
22
-
23
- /** @default "" */
24
- clientSecret: string,
25
- },
26
-
27
- idp: {
28
- /** @default false */
29
- enabled: boolean,
30
-
31
- idpKeys: Array<any>,
32
-
33
- /** @default "" */
34
- idpRedirectURL: string,
35
- },
36
-
37
- appKeys: {
38
- /** @default "wishlist_{shopId}_{userId}" */
39
- wishlistKey: string,
40
-
41
- /** @default "basket_{shopId}_{userId}" */
42
- basketKey: string,
43
-
44
- /** @default "sha256" */
45
- hashAlgorithm: string,
46
- },
47
- }
3
+ import type { default as Module, ModulePublicRuntimeConfig } from './module'
48
4
 
49
5
  declare module '@nuxt/schema' {
50
- interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
51
- interface NuxtOptions { ['storefront']?: ModuleOptions }
52
- interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
53
- }
54
-
55
- declare module 'nuxt/schema' {
56
- interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
57
- interface NuxtOptions { ['storefront']?: ModuleOptions }
58
6
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
59
7
  }
60
8
 
9
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
61
10
 
62
- export type { AdditionalShopConfig, AppKeys, BapiConfig, CheckoutEvent, CheckoutShopConfig, ModulePublicRuntimeConfig, PublicShopConfig, RedisConfig, SapiConfig, SessionConfig, ShopConfig, ShopConfigIndexed, StorageConfig, StorageEntity, StorageProvider, StorefrontConfig } from './module'
11
+ export { type AdditionalShopConfig, type AppKeys, type BapiConfig, type CheckoutEvent, type CheckoutShopConfig, type ModulePublicRuntimeConfig, type PublicShopConfig, type RedisConfig, type SapiConfig, type SessionConfig, type ShopConfig, type ShopConfigIndexed, type StorageConfig, type StorageEntity, type StorageProvider, type StorefrontConfig } from './module'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.85.10",
4
+ "version": "7.85.12",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -55,14 +55,13 @@
55
55
  "package:lint": "publint",
56
56
  "test": "vitest run",
57
57
  "test:ci": "vitest run",
58
- "test:watch": "vitest watch",
59
- "postinstall": "patch-package"
58
+ "test:watch": "vitest watch"
60
59
  },
61
60
  "dependencies": {
62
61
  "@nuxt/kit": "^3.12.2",
63
62
  "@opentelemetry/api": "^1.9.0",
64
63
  "@scayle/h3-session": "^0.4.0",
65
- "@scayle/storefront-core": "7.65.4",
64
+ "@scayle/storefront-core": "7.65.5",
66
65
  "@scayle/unstorage-compression-driver": "^0.1.3",
67
66
  "@vueuse/core": "11.1.0",
68
67
  "consola": "^3.2.3",
@@ -81,7 +80,7 @@
81
80
  },
82
81
  "devDependencies": {
83
82
  "@nuxt/eslint": "0.5.7",
84
- "@nuxt/module-builder": "0.7.1",
83
+ "@nuxt/module-builder": "0.8.4",
85
84
  "@nuxt/schema": "3.13.2",
86
85
  "@nuxt/test-utils": "3.14.2",
87
86
  "@scayle/eslint-config-storefront": "4.3.0",
@@ -95,7 +94,6 @@
95
94
  "node-mocks-http": "1.16.0",
96
95
  "nuxi": "3.14.0",
97
96
  "nuxt": "3.13.2",
98
- "patch-package": "8.0.0",
99
97
  "publint": "0.2.11",
100
98
  "vitest": "2.1.1",
101
99
  "vue-tsc": "2.1.6"