@scayle/storefront-nuxt 7.47.0 → 7.48.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,5 +1,17 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.48.0
4
+
5
+ ### Minor Changes
6
+
7
+ - We added support for Identity Provider (IDP), enhancing our authentication and identity management capabilities.
8
+
9
+ ### Patch Changes
10
+
11
+ - Fix runtime crash when using md5 for appKeys
12
+ - Updated dependencies
13
+ - @scayle/storefront-core@7.34.0
14
+
3
15
  ## 7.47.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, M as ModuleOptions, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.5af220a0.mjs';
1
+ export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, M as ModuleOptions, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.8b6c06b3.mjs';
2
2
  export { rpcCall } from './rpc.mjs';
3
3
  export * from '@scayle/storefront-core';
4
4
  export { LogLevel } from '@scayle/storefront-core';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, M as ModuleOptions, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.5af220a0.js';
1
+ export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, M as ModuleOptions, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.8b6c06b3.js';
2
2
  export { rpcCall } from './rpc.js';
3
3
  export * from '@scayle/storefront-core';
4
4
  export { LogLevel } from '@scayle/storefront-core';
package/dist/module.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { M as ModuleOptions } from './shared/storefront-nuxt.5af220a0.mjs';
3
- export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.5af220a0.mjs';
2
+ import { M as ModuleOptions } from './shared/storefront-nuxt.8b6c06b3.mjs';
3
+ export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.8b6c06b3.mjs';
4
4
  export { LogLevel } from '@scayle/storefront-core';
5
5
  import '@scayle/unstorage-compression-driver';
6
6
  import 'unstorage';
package/dist/module.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { M as ModuleOptions } from './shared/storefront-nuxt.5af220a0.js';
3
- export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.5af220a0.js';
2
+ import { M as ModuleOptions } from './shared/storefront-nuxt.8b6c06b3.js';
3
+ export { g as AdditionalShopConfig, A as AppKeys, f as AuthenticationConfig, B as BapiConfig, b as CacheConfig, k as CheckoutEvent, C as CheckoutShopConfig, O as OauthConfig, P as PublicShopConfig, e as RedirectsConfig, R as RedisConfig, a as SessionConfig, h as ShopConfig, i as ShopConfigIndexed, d as StorageConfig, c as StorageEntity, S as StorageProvider, j as StorefrontConfig } from './shared/storefront-nuxt.8b6c06b3.js';
4
4
  export { LogLevel } from '@scayle/storefront-core';
5
5
  import '@scayle/unstorage-compression-driver';
6
6
  import 'unstorage';
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.7.0"
6
6
  },
7
- "version": "7.46.1"
7
+ "version": "7.47.0"
8
8
  }
package/dist/module.mjs CHANGED
@@ -39,9 +39,10 @@ export default {
39
39
  ${usesCompression ? "compression" : ""}
40
40
  }`;
41
41
  }
42
+ const PACKAGE_NAME = "@scayle/storefront-nuxt";
42
43
  const module = defineNuxtModule({
43
44
  meta: {
44
- name: "@scayle/storefront-nuxt",
45
+ name: PACKAGE_NAME,
45
46
  configKey: "storefront",
46
47
  compatibility: {
47
48
  nuxt: "^3.7.0"
@@ -81,6 +82,11 @@ const module = defineNuxtModule({
81
82
  clientId: "",
82
83
  clientSecret: ""
83
84
  },
85
+ idp: {
86
+ enabled: false,
87
+ idpKeys: [],
88
+ idpRedirectURL: ""
89
+ },
84
90
  appKeys: {
85
91
  wishlistKey: "wishlist_{shopId}_{userId}",
86
92
  basketKey: "basket_{shopId}_{userId}",
@@ -104,7 +110,7 @@ const module = defineNuxtModule({
104
110
  config.optimizeDeps = config.optimizeDeps || {};
105
111
  config.optimizeDeps.include = config.optimizeDeps.include || [];
106
112
  config.optimizeDeps.include.push(
107
- "@scayle/storefront-nuxt",
113
+ PACKAGE_NAME,
108
114
  "@scayle/storefront-core",
109
115
  "@aboutyou/backbone",
110
116
  "slugify"
@@ -234,6 +240,12 @@ const module = defineNuxtModule({
234
240
  addImportsDir(resolve("runtime/composables/storefront"));
235
241
  addImportsDir(resolve("runtime/composables/core"));
236
242
  addImportsDir(resolve("runtime/utils"));
243
+ nuxt.options.build.transpile = [
244
+ ...nuxt.options.build?.transpile || [],
245
+ PACKAGE_NAME,
246
+ "@scayle/storefront-core",
247
+ "crypto-js"
248
+ ];
237
249
  }
238
250
  });
239
251
 
package/dist/rpc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
2
2
  import { NuxtApp } from 'nuxt/app';
3
- import { P as PublicShopConfig } from './shared/storefront-nuxt.5af220a0.mjs';
3
+ import { P as PublicShopConfig } from './shared/storefront-nuxt.8b6c06b3.mjs';
4
4
  import '@scayle/unstorage-compression-driver';
5
5
  import 'unstorage';
6
6
 
package/dist/rpc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
2
2
  import { NuxtApp } from 'nuxt/app';
3
- import { P as PublicShopConfig } from './shared/storefront-nuxt.5af220a0.js';
3
+ import { P as PublicShopConfig } from './shared/storefront-nuxt.8b6c06b3.js';
4
4
  import '@scayle/unstorage-compression-driver';
5
5
  import 'unstorage';
6
6
 
package/dist/rpc.mjs CHANGED
@@ -8,7 +8,7 @@ const rpcCall = (nuxtApp, method, shop) => {
8
8
  payload: params
9
9
  },
10
10
  headers: {
11
- "x-shop-id": String(shop.shopId)
11
+ "x-shop-id": shop.shopId.toString()
12
12
  }
13
13
  });
14
14
  return data;
@@ -0,0 +1,12 @@
1
+ export declare const useIDP: () => Promise<{
2
+ data: import("vue").Ref<{
3
+ [k: string]: string;
4
+ }>;
5
+ fetching: import("vue").Ref<boolean>;
6
+ fetch: () => Promise<void>;
7
+ error: import("vue").Ref<import("nuxt/app").NuxtError | undefined>;
8
+ status: import("vue").Ref<import("../core/useRpc").Status>;
9
+ handleIDPLoginCallback: (params: string) => Promise<{
10
+ message: string;
11
+ }>;
12
+ }>;
@@ -0,0 +1,26 @@
1
+ import { useNuxtApp } from "nuxt/app";
2
+ import { useRpc } from "../core/useRpc.mjs";
3
+ import { rpcCall } from "./../../rpc/rpcCall.mjs";
4
+ import { useCurrentShop } from "./useCurrentShop.mjs";
5
+ import { toValue } from "#imports";
6
+ export const useIDP = async () => {
7
+ const nuxtApp = useNuxtApp();
8
+ const shop = useCurrentShop();
9
+ const { data, fetching, fetch, error, status } = await useRpc(
10
+ "getExternalIdpRedirect",
11
+ "getExternalIdpRedirect"
12
+ );
13
+ const handleIDPLoginCallback = rpcCall(
14
+ nuxtApp,
15
+ "handleIDPLoginCallback",
16
+ toValue(shop)
17
+ );
18
+ return {
19
+ data,
20
+ fetching,
21
+ fetch,
22
+ error,
23
+ status,
24
+ handleIDPLoginCallback
25
+ };
26
+ };
@@ -8,6 +8,7 @@ export const buildContext = async (context) => {
8
8
  const { $cache, $shopConfig, $storefront, $log, session, config } = context;
9
9
  const bapiConfig = $shopConfig.bapi ?? $storefront.bapi;
10
10
  const appKeys = $shopConfig.appKeys ?? $storefront.appKeys;
11
+ const idpConfig = $shopConfig.idp ?? $storefront.idp;
11
12
  return {
12
13
  cached: new Cached($cache, $log, "", $storefront.cache?.enabled ?? true).execute,
13
14
  bapiClient: initBapi({
@@ -45,6 +46,7 @@ export const buildContext = async (context) => {
45
46
  clientSecret: $storefront.oauth.clientSecret,
46
47
  apiHost: $storefront.oauth.apiHost
47
48
  },
49
+ idp: idpConfig,
48
50
  log: $log,
49
51
  get user() {
50
52
  return session.data?.user ?? void 0;
@@ -8,7 +8,7 @@ export const rpcCall = (nuxtApp, method, shop) => {
8
8
  payload: params
9
9
  },
10
10
  headers: {
11
- "x-shop-id": String(shop.shopId)
11
+ "x-shop-id": shop.shopId.toString()
12
12
  }
13
13
  });
14
14
  return data;
@@ -1,4 +1,4 @@
1
- import { LogLevel, HashAlgorithm, WithParams, ShopUser } from '@scayle/storefront-core';
1
+ import { LogLevel, HashAlgorithm, IDPConfig, WithParams, ShopUser } from '@scayle/storefront-core';
2
2
  import { CompressionEncodings } from '@scayle/unstorage-compression-driver';
3
3
  import { BuiltinDriverName, BuiltinDriverOptions } from 'unstorage';
4
4
 
@@ -126,11 +126,13 @@ interface ShopConfig extends AdditionalShopConfig {
126
126
  bapi?: BapiConfig;
127
127
  appKeys?: AppKeys;
128
128
  storage?: StorageConfig;
129
+ idp?: IDPConfig;
129
130
  }
130
131
  type ShopConfigIndexed = Record<string, ShopConfig>;
131
132
  interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' | 'path' | 'locale' | 'currency' | 'currencyFractionDigits'> {
132
133
  checkout: Pick<CheckoutShopConfig, 'host'>;
133
134
  apiBasePath: string;
135
+ idp?: IDPConfig;
134
136
  }
135
137
  interface StorefrontConfig {
136
138
  session?: SessionConfig;
@@ -145,6 +147,7 @@ interface StorefrontConfig {
145
147
  cache?: CacheConfig;
146
148
  publicShopData?: (keyof AdditionalShopConfig)[];
147
149
  withParams?: WithParams;
150
+ idp?: IDPConfig;
148
151
  }
149
152
  type ModuleOptions = StorefrontConfig & {
150
153
  shopSelector: 'domain' | 'path';
@@ -1,4 +1,4 @@
1
- import { LogLevel, HashAlgorithm, WithParams, ShopUser } from '@scayle/storefront-core';
1
+ import { LogLevel, HashAlgorithm, IDPConfig, WithParams, ShopUser } from '@scayle/storefront-core';
2
2
  import { CompressionEncodings } from '@scayle/unstorage-compression-driver';
3
3
  import { BuiltinDriverName, BuiltinDriverOptions } from 'unstorage';
4
4
 
@@ -126,11 +126,13 @@ interface ShopConfig extends AdditionalShopConfig {
126
126
  bapi?: BapiConfig;
127
127
  appKeys?: AppKeys;
128
128
  storage?: StorageConfig;
129
+ idp?: IDPConfig;
129
130
  }
130
131
  type ShopConfigIndexed = Record<string, ShopConfig>;
131
132
  interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' | 'path' | 'locale' | 'currency' | 'currencyFractionDigits'> {
132
133
  checkout: Pick<CheckoutShopConfig, 'host'>;
133
134
  apiBasePath: string;
135
+ idp?: IDPConfig;
134
136
  }
135
137
  interface StorefrontConfig {
136
138
  session?: SessionConfig;
@@ -145,6 +147,7 @@ interface StorefrontConfig {
145
147
  cache?: CacheConfig;
146
148
  publicShopData?: (keyof AdditionalShopConfig)[];
147
149
  withParams?: WithParams;
150
+ idp?: IDPConfig;
148
151
  }
149
152
  type ModuleOptions = StorefrontConfig & {
150
153
  shopSelector: 'domain' | 'path';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.47.0",
4
+ "version": "7.48.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -62,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "@nuxt/kit": "3.8.2",
64
64
  "@scayle/h3-session": "0.3.4",
65
- "@scayle/storefront-core": "7.33.0",
65
+ "@scayle/storefront-core": "7.34.0",
66
66
  "@scayle/unstorage-compression-driver": "0.1.1",
67
67
  "@vueuse/core": "10.7.0",
68
68
  "consola": "3.2.3",