@strivacity/sdk-nuxt 4.0.0-beta.0 → 4.0.0-beta.2

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.
Files changed (124) hide show
  1. package/README.md +171 -101
  2. package/dist/module.mjs +5 -4
  3. package/package.json +2 -2
  4. package/project.json +3 -0
  5. package/src/module.ts +7 -3
  6. package/src/runtime/composables/use-native-login.ts +27 -159
  7. package/src/runtime/composables/use-strivacity.ts +217 -67
  8. package/src/runtime/middleware/auth.server.ts +10 -1
  9. package/src/runtime/plugins/strivacity.client.ts +17 -0
  10. package/src/runtime/server/plugins/auth.server.ts +66 -30
  11. package/src/runtime/storages/default.ts +22 -67
  12. package/src/runtime/types.ts +7 -36
  13. package/src/runtime/utils/core.ts +2 -0
  14. package/testing/stubs/app.ts +8 -0
  15. package/testing/tests/composables.spec.ts +105 -4
  16. package/testing/tests/module.spec.ts +46 -0
  17. package/testing/tests/server/plugin.spec.ts +48 -10
  18. package/testing/tests/server/routes.spec.ts +2 -2
  19. package/.nuxt/app-component.mjs +0 -1
  20. package/.nuxt/app.config.mjs +0 -21
  21. package/.nuxt/component-chunk.mjs +0 -1
  22. package/.nuxt/component-names.mjs +0 -1
  23. package/.nuxt/components.d.ts +0 -66
  24. package/.nuxt/components.islands.mjs +0 -8
  25. package/.nuxt/components.plugin.mjs +0 -5
  26. package/.nuxt/css.mjs +0 -0
  27. package/.nuxt/error-component.mjs +0 -1
  28. package/.nuxt/fetch.d.ts +0 -1
  29. package/.nuxt/fetch.mjs +0 -8
  30. package/.nuxt/global-polyfills.mjs +0 -4
  31. package/.nuxt/imports.d.ts +0 -41
  32. package/.nuxt/imports.mjs +0 -42
  33. package/.nuxt/island-renderer.mjs +0 -2
  34. package/.nuxt/layouts.mjs +0 -2
  35. package/.nuxt/manifest/meta/cb11df97-b0c9-4a91-9d4b-60c25c918599.json +0 -1
  36. package/.nuxt/middleware.mjs +0 -7
  37. package/.nuxt/nitro.client.mjs +0 -2
  38. package/.nuxt/nuxt.config.mjs +0 -103
  39. package/.nuxt/nuxt.d.ts +0 -19
  40. package/.nuxt/nuxt.node.d.ts +0 -13
  41. package/.nuxt/nuxt.shared.d.ts +0 -7
  42. package/.nuxt/pages.mjs +0 -2
  43. package/.nuxt/paths.mjs +0 -15
  44. package/.nuxt/plugins.client.mjs +0 -14
  45. package/.nuxt/plugins.server.mjs +0 -10
  46. package/.nuxt/root-component.mjs +0 -1
  47. package/.nuxt/route-rules.mjs +0 -22
  48. package/.nuxt/router.options.mjs +0 -2
  49. package/.nuxt/schema/nuxt.schema.d.ts +0 -17
  50. package/.nuxt/schema/nuxt.schema.json +0 -3
  51. package/.nuxt/test-component-wrapper.mjs +0 -1
  52. package/.nuxt/tsconfig.app.json +0 -211
  53. package/.nuxt/tsconfig.json +0 -212
  54. package/.nuxt/tsconfig.node.json +0 -117
  55. package/.nuxt/tsconfig.server.json +0 -161
  56. package/.nuxt/tsconfig.shared.json +0 -165
  57. package/.nuxt/types/app.config.d.ts +0 -35
  58. package/.nuxt/types/build.d.ts +0 -0
  59. package/.nuxt/types/builder-env.d.ts +0 -1
  60. package/.nuxt/types/components.d.ts +0 -71
  61. package/.nuxt/types/imports.d.ts +0 -2
  62. package/.nuxt/types/layouts.d.ts +0 -16
  63. package/.nuxt/types/middleware.d.ts +0 -11
  64. package/.nuxt/types/modules.d.ts +0 -59
  65. package/.nuxt/types/nitro-config.d.ts +0 -14
  66. package/.nuxt/types/nitro-imports.d.ts +0 -20
  67. package/.nuxt/types/nitro-layouts.d.ts +0 -17
  68. package/.nuxt/types/nitro-nuxt.d.ts +0 -75
  69. package/.nuxt/types/nitro-routes.d.ts +0 -38
  70. package/.nuxt/types/nitro.d.ts +0 -3
  71. package/.nuxt/types/plugins.d.ts +0 -30
  72. package/.nuxt/types/runtime-config.d.ts +0 -38
  73. package/.nuxt/types/shared-app.config.d.ts +0 -28
  74. package/.nuxt/types/shared-imports.d.ts +0 -2
  75. package/.nuxt/types/vue-shim.d.ts +0 -0
  76. package/.nuxt/unhead-options.mjs +0 -5
  77. package/.nuxt/unhead.config.mjs +0 -1
  78. package/dist/module.d.mts +0 -7
  79. package/dist/module.json +0 -9
  80. package/dist/module.mjs.map +0 -1
  81. package/dist/runtime/composables/use-native-login-context.d.ts +0 -10
  82. package/dist/runtime/composables/use-native-login-context.js +0 -9
  83. package/dist/runtime/composables/use-native-login.d.ts +0 -10
  84. package/dist/runtime/composables/use-native-login.js +0 -143
  85. package/dist/runtime/composables/use-session.d.ts +0 -8
  86. package/dist/runtime/composables/use-session.js +0 -2
  87. package/dist/runtime/composables/use-strivacity.d.ts +0 -9
  88. package/dist/runtime/composables/use-strivacity.js +0 -77
  89. package/dist/runtime/middleware/auth.server.d.ts +0 -2
  90. package/dist/runtime/middleware/auth.server.js +0 -12
  91. package/dist/runtime/server/api/auth/backchannel-logout.get.d.ts +0 -2
  92. package/dist/runtime/server/api/auth/backchannel-logout.get.js +0 -2
  93. package/dist/runtime/server/api/auth/callback.get.d.ts +0 -2
  94. package/dist/runtime/server/api/auth/callback.get.js +0 -2
  95. package/dist/runtime/server/api/auth/entry.get.d.ts +0 -2
  96. package/dist/runtime/server/api/auth/entry.get.js +0 -2
  97. package/dist/runtime/server/api/auth/login.get.d.ts +0 -2
  98. package/dist/runtime/server/api/auth/login.get.js +0 -2
  99. package/dist/runtime/server/api/auth/logout.get.d.ts +0 -2
  100. package/dist/runtime/server/api/auth/logout.get.js +0 -2
  101. package/dist/runtime/server/api/auth/refresh.get.d.ts +0 -2
  102. package/dist/runtime/server/api/auth/refresh.get.js +0 -2
  103. package/dist/runtime/server/api/auth/register.get.d.ts +0 -2
  104. package/dist/runtime/server/api/auth/register.get.js +0 -2
  105. package/dist/runtime/server/api/auth/revoke.get.d.ts +0 -2
  106. package/dist/runtime/server/api/auth/revoke.get.js +0 -2
  107. package/dist/runtime/server/composables/use-strivacity.d.ts +0 -2
  108. package/dist/runtime/server/composables/use-strivacity.js +0 -9
  109. package/dist/runtime/server/plugins/auth.server.d.ts +0 -10
  110. package/dist/runtime/server/plugins/auth.server.js +0 -66
  111. package/dist/runtime/server/utils/helpers.d.ts +0 -18
  112. package/dist/runtime/server/utils/helpers.js +0 -39
  113. package/dist/runtime/storages/core.d.ts +0 -1
  114. package/dist/runtime/storages/core.js +0 -13
  115. package/dist/runtime/storages/default.d.ts +0 -21
  116. package/dist/runtime/storages/default.js +0 -71
  117. package/dist/runtime/types.d.ts +0 -219
  118. package/dist/runtime/types.js +0 -1
  119. package/dist/runtime/utils/core.d.ts +0 -1
  120. package/dist/runtime/utils/core.js +0 -64
  121. package/dist/runtime/utils/noop.d.ts +0 -1
  122. package/dist/runtime/utils/noop.js +0 -3
  123. package/dist/types.d.mts +0 -9
  124. /package/src/runtime/server/api/auth/{backchannel-logout.get.ts → backchannel-logout.post.ts} +0 -0
@@ -1,10 +1,13 @@
1
1
  import type { H3Event } from 'h3';
2
- import type { EncryptedCookieStorageOptions, ServerStorage, SessionIdCookieStorageOptions } from '@strivacity/sdk-core/types';
3
- import type { NuxtServerStorage } from '../types';
2
+ import type { CookieJar, EncryptedCookieStorageOptions, ServerStorage, SessionIdCookieStorageOptions } from '@strivacity/sdk-core/types';
3
+ import type { CookieOptions, NuxtServerStorage } from '../types';
4
4
  import { getCookie, setCookie, deleteCookie, toWebRequest } from 'h3';
5
- import { encryptString, decryptString } from '@strivacity/sdk-core/utils/crypto';
6
- import { COOKIE_CONTEXT, COOKIE_CHUNK_SIZE } from '@strivacity/sdk-core/server';
7
- import { createSessionIdCookieStorage as createSessionIdCookieStorageBase } from '@strivacity/sdk-core/storages/server';
5
+ import {
6
+ createSessionIdCookieStorage as createSessionIdCookieStorageBase,
7
+ readEncryptedCookie,
8
+ writeEncryptedCookie,
9
+ deleteEncryptedCookie,
10
+ } from '@strivacity/sdk-core/storages/server';
8
11
 
9
12
  /**
10
13
  * Creates a session storage that puts a random unique id value cookie on the client and keeping the actual session data in the given `storage`.
@@ -41,71 +44,23 @@ export function createEncryptedCookieStorage(secret: string, options?: Encrypted
41
44
  ...options?.defaultCookieOptions,
42
45
  };
43
46
 
44
- const storage: NuxtServerStorage = {
45
- async get(key, event) {
46
- if (!event) {
47
- return null;
47
+ const createJar = (event: H3Event): CookieJar<CookieOptions> => ({
48
+ get: (name) => getCookie(event, name),
49
+ set: (name, value, cookieOptions) => void setCookie(event, name, value, cookieOptions),
50
+ delete: (name, cookieOptions) => deleteCookie(event, name, cookieOptions),
51
+ });
52
+
53
+ return {
54
+ get: async (key, event) => (event ? await readEncryptedCookie(createJar(event), key, secret) : null),
55
+ set: async (key, value, event, cookieOptions = {}) => {
56
+ if (event) {
57
+ await writeEncryptedCookie(createJar(event), key, value, secret, { ...defaultCookieOptions, ...cookieOptions });
48
58
  }
49
-
50
- const cookie = getCookie(event, key) ?? null;
51
-
52
- if (cookie) {
53
- return await decryptString(cookie, secret, COOKIE_CONTEXT);
54
- }
55
-
56
- const cookieChunks: Array<string> = [];
57
-
58
- for (let i = 0; ; i++) {
59
- const chunk = getCookie(event, `${key}.${i}`);
60
-
61
- if (!chunk) {
62
- break;
63
- }
64
-
65
- cookieChunks.push(chunk);
66
- }
67
-
68
- if (cookieChunks.length === 0) {
69
- return null;
70
- }
71
-
72
- return await decryptString(cookieChunks.join(''), secret, COOKIE_CONTEXT);
73
59
  },
74
-
75
- async set(key, value, event, cookieOptions = {}) {
76
- if (!event) {
77
- return;
60
+ delete: async (key, event, cookieOptions = {}) => {
61
+ if (event) {
62
+ await deleteEncryptedCookie(createJar(event), key, { ...defaultCookieOptions, ...cookieOptions });
78
63
  }
79
-
80
- cookieOptions = { ...defaultCookieOptions, ...cookieOptions };
81
-
82
- await storage.delete(key, event, cookieOptions);
83
-
84
- const encrypted = await encryptString(value, secret, COOKIE_CONTEXT);
85
-
86
- if (encrypted.length <= COOKIE_CHUNK_SIZE) {
87
- setCookie(event, key, encrypted, cookieOptions);
88
- } else {
89
- for (let i = 0; i * COOKIE_CHUNK_SIZE < encrypted.length; i++) {
90
- setCookie(event, `${key}.${i}`, encrypted.slice(i * COOKIE_CHUNK_SIZE, (i + 1) * COOKIE_CHUNK_SIZE), cookieOptions);
91
- }
92
- }
93
- },
94
-
95
- async delete(key, event, cookieOptions = {}) {
96
- if (!event) {
97
- return;
98
- }
99
-
100
- deleteCookie(event, key, cookieOptions);
101
-
102
- for (let i = 0; getCookie(event, `${key}.${i}`); i++) {
103
- deleteCookie(event, `${key}.${i}`, cookieOptions);
104
- }
105
-
106
- return Promise.resolve();
107
64
  },
108
65
  };
109
-
110
- return storage;
111
66
  }
@@ -12,12 +12,10 @@ import type {
12
12
  EmbeddedFlow,
13
13
  NativeFlowMessage,
14
14
  initFlow,
15
- FallbackError,
16
- NativeParams,
17
15
  NativeFlowState,
18
- SessionData,
19
16
  LogoutTokenClaims,
20
17
  BaseServerSDK,
18
+ NativeLoginControllerOptions,
21
19
  } from '@strivacity/sdk-core';
22
20
 
23
21
  declare module '@nuxt/schema' {
@@ -210,38 +208,10 @@ export type LoginContext = {
210
208
  setMessage: (formId: string, widgetId: string, value: NativeFlowMessage) => void;
211
209
  };
212
210
 
213
- export type UseNativeLoginOptions = {
214
- /**
215
- * Optional parameters to be passed to the login session request. These parameters will be sent to the `authorizationUri` endpoint.
216
- */
217
- params?: NativeParams;
218
-
219
- /**
220
- * A render function called when the user successfully completes the login flow.
221
- * This can be used to perform any necessary actions after a successful login, such as redirecting the user or updating the application state. Defaults to `null`.
222
- */
223
- onLogin?: (session: SessionData) => void | Promise<void>;
224
-
225
- /**
226
- * Called when the fallback flow is triggered, typically due to an error or unsupported environment. Receives a `FallbackError` object containing the hosted URL to redirect to.
227
- */
228
- onFallback?: (error: FallbackError) => void | Promise<void>;
229
-
230
- /**
231
- * Called when the login flow is closed by the user. This can be used to perform any necessary cleanup or state updates in the application. Defaults to `null`.
232
- */
233
- onClose?: () => void | Promise<void>;
234
-
235
- /**
236
- * Called when an error occurs during the login session initialization or flow. Receives an `Error` object describing the issue.
237
- */
238
- onError?: (error: Error) => void | Promise<void>;
239
-
240
- /**
241
- * Called when a global message is received during the login flow. This can be used to display messages to the user or log them for debugging purposes.
242
- */
243
- onGlobalMessage?: (message: NativeFlowMessage) => void | Promise<void>;
244
- };
211
+ /**
212
+ * Callbacks and parameters of the native login flow. See `NativeLoginControllerOptions` in `@strivacity/sdk-core`.
213
+ */
214
+ export type UseNativeLoginOptions = NativeLoginControllerOptions;
245
215
 
246
216
  /**
247
217
  * Extends the base SDKStorage interface with optional back-channel logout support.
@@ -255,11 +225,12 @@ export type NuxtServerStorage = SDKStorage<
255
225
  };
256
226
 
257
227
  export type NuxtServerSDKOptions<Storage extends NuxtServerStorage = NuxtServerStorage, StateStorage extends SDKStorage = SDKStorage> = ServerSDKOptions<
228
+ H3Event,
258
229
  Storage,
259
230
  StateStorage
260
231
  >;
261
232
 
262
- export type NuxtServerSDKInitConfig = ServerSDKInitConfig &
233
+ export type NuxtServerSDKInitConfig = ServerSDKInitConfig<H3Event> &
263
234
  Partial<Omit<NuxtServerSDKOptions, 'storage' | 'stateStorage' | 'logging' | 'httpClient'>> & {
264
235
  /**
265
236
  * Optional path to a custom storage factory module.
@@ -17,6 +17,7 @@ export {
17
17
  buildCookieString,
18
18
  buildEndSessionUrl,
19
19
  createDefaultLogging,
20
+ createNativeLoginController,
20
21
  createHttpClient,
21
22
  createSession,
22
23
  createState,
@@ -53,6 +54,7 @@ export {
53
54
  serializeState,
54
55
  submitLoginForm,
55
56
  timestamp,
57
+ toClientSession,
56
58
  toSafeRedirect,
57
59
  unflattenObject,
58
60
  verifyIdToken,
@@ -4,3 +4,11 @@
4
4
  export function useRuntimeConfig() {
5
5
  return { public: { strivacity: {} } };
6
6
  }
7
+
8
+ export function tryUseNuxtApp() {
9
+ return null;
10
+ }
11
+
12
+ export function defineNuxtPlugin<T>(plugin: T) {
13
+ return plugin;
14
+ }
@@ -25,6 +25,107 @@ afterEach(() => {
25
25
  vi.doUnmock('../../src/runtime/composables/use-session');
26
26
  });
27
27
 
28
+ describe('useStrivacity during SSR', () => {
29
+ const future = () => Math.floor(Date.now() / 1000) + 3600;
30
+
31
+ async function importForRequest(session: SessionData | undefined, publicOptions: Record<string, unknown> = { serverSessionUri: '/auth/login' }) {
32
+ const { ref } = await import('vue');
33
+ vi.doMock('#app', () => ({ tryUseNuxtApp: () => ({ ssrContext: {} }), useRuntimeConfig: () => ({ public: { strivacity: publicOptions } }) }));
34
+ vi.doMock('../../src/runtime/composables/use-session', () => ({ useSession: () => ref(session) }));
35
+
36
+ return import('../../src/runtime/composables/use-strivacity');
37
+ }
38
+
39
+ test('never creates an sdk instance on the server', async () => {
40
+ const core = await import('@strivacity/sdk-core');
41
+ const { useStrivacity } = await importForRequest(undefined);
42
+
43
+ useStrivacity();
44
+
45
+ expect(core.initFlow).not.toHaveBeenCalled();
46
+ });
47
+
48
+ test("derives the read-only state from the current request's session", async () => {
49
+ const session = { access_token: 'access-token', expires_at: future(), claims: { sub: 'alice' } } as unknown as SessionData;
50
+ const { useStrivacity } = await importForRequest(session);
51
+
52
+ const ctx = useStrivacity<RedirectFlow>();
53
+
54
+ expect(ctx.loading.value).toBe(false);
55
+ expect(ctx.isAuthenticated.value).toBe(true);
56
+ expect(ctx.idTokenClaims.value).toEqual({ sub: 'alice' });
57
+ expect(ctx.accessToken.value).toBe('access-token');
58
+ expect(ctx.refreshToken.value).toBeNull();
59
+ expect(ctx.sdk.options).toEqual({ serverSessionUri: '/auth/login' });
60
+ expect(ctx.sdk.session).toEqual(session);
61
+ await expect(ctx.sdk.isAuthenticated).resolves.toBe(true);
62
+ });
63
+
64
+ test('keeps no state between requests: the same module instance reflects only the current request session', async () => {
65
+ const { ref } = await import('vue');
66
+ let requestSession: SessionData | undefined = { access_token: 'alice-token', expires_at: future(), claims: { sub: 'alice' } } as unknown as SessionData;
67
+ vi.doMock('#app', () => ({
68
+ tryUseNuxtApp: () => ({ ssrContext: {} }),
69
+ useRuntimeConfig: () => ({ public: { strivacity: { serverSessionUri: '/auth/login' } } }),
70
+ }));
71
+ vi.doMock('../../src/runtime/composables/use-session', () => ({ useSession: () => ref(requestSession) }));
72
+ const { useStrivacity } = await import('../../src/runtime/composables/use-strivacity');
73
+
74
+ const alice = useStrivacity<RedirectFlow>();
75
+ requestSession = undefined;
76
+ const anonymous = useStrivacity<RedirectFlow>();
77
+
78
+ expect(alice.idTokenClaims.value).toEqual({ sub: 'alice' });
79
+ expect(anonymous.isAuthenticated.value).toBe(false);
80
+ expect(anonymous.idTokenClaims.value).toBeNull();
81
+ expect(anonymous.accessToken.value).toBeNull();
82
+ });
83
+
84
+ test('stays loading and unauthenticated with client-managed sessions, since the server cannot see browser storage', async () => {
85
+ const { useStrivacity } = await importForRequest(undefined, { serverSessionUri: false });
86
+
87
+ const ctx = useStrivacity<RedirectFlow>();
88
+
89
+ expect(ctx.loading.value).toBe(true);
90
+ expect(ctx.isAuthenticated.value).toBe(false);
91
+ });
92
+
93
+ test('throws a descriptive error for authentication methods, and keeps event subscriptions as no-ops', async () => {
94
+ const { useStrivacity } = await importForRequest(undefined);
95
+
96
+ const ctx = useStrivacity<RedirectFlow>();
97
+
98
+ expect(() => ctx.login()).toThrow('login() is only available in the browser');
99
+ expect(() => ctx.sdk.logout()).toThrow('sdk.logout() is only available in the browser');
100
+ expect(ctx.sdk.logging).toBeUndefined();
101
+ expect(() => ctx.subscribeToAllEvents(() => undefined).dispose()).not.toThrow();
102
+ await expect(ctx.checkAuthentication()).resolves.toBe(false);
103
+ });
104
+ });
105
+
106
+ describe('useStrivacity hydration', () => {
107
+ test('the browser context starts from the same state the server rendered with (server-managed), so hydration matches', async () => {
108
+ const { ref } = await import('vue');
109
+ const session = { access_token: 'access-token', expires_at: Math.floor(Date.now() / 1000) + 3600, claims: { sub: 'alice' } } as unknown as SessionData;
110
+ const options = { serverSessionUri: '/auth/login' };
111
+ let ssrContext: object | undefined = {};
112
+ vi.doMock('#app', () => ({ tryUseNuxtApp: () => (ssrContext ? { ssrContext } : null), useRuntimeConfig: () => ({ public: { strivacity: options } }) }));
113
+ vi.doMock('../../src/runtime/composables/use-session', () => ({ useSession: () => ref(session) }));
114
+ await mockInitFlow(createMockFlow<RedirectFlow>());
115
+ const { useStrivacity } = await import('../../src/runtime/composables/use-strivacity');
116
+
117
+ const server = useStrivacity<RedirectFlow>();
118
+ ssrContext = undefined;
119
+ const browser = useStrivacity<RedirectFlow>();
120
+
121
+ for (const key of ['loading', 'language', 'isAuthenticated', 'idTokenClaims', 'accessToken', 'accessTokenExpired', 'accessTokenExpirationDate'] as const) {
122
+ expect(browser[key].value, key).toEqual(server[key].value);
123
+ }
124
+ expect(browser.loading.value).toBe(false);
125
+ expect(browser.isAuthenticated.value).toBe(true);
126
+ });
127
+ });
128
+
28
129
  describe('useStrivacity', () => {
29
130
  test('initializes the underlying flow through core sdk initFlow with the runtime config merged with the logging/httpClient factories', async () => {
30
131
  const flow = createMockFlow<RedirectFlow>();
@@ -33,7 +134,7 @@ describe('useStrivacity', () => {
33
134
  const publicOptions = { mode: 'redirect', issuer: 'https://brandtegrity.io', clientId: 'client-id', redirectUri: 'https://brandtegrity.io/callback' };
34
135
  const logging = { debug: vi.fn() };
35
136
  const httpClient = { request: vi.fn() };
36
- vi.doMock('#app', () => ({ useRuntimeConfig: () => ({ public: { strivacity: publicOptions } }) }));
137
+ vi.doMock('#app', () => ({ tryUseNuxtApp: () => null, useRuntimeConfig: () => ({ public: { strivacity: publicOptions } }) }));
37
138
  vi.doMock('#strivacity-options-logging', () => ({ default: () => logging }));
38
139
  vi.doMock('#strivacity-options-httpClient', () => ({ default: () => httpClient }));
39
140
 
@@ -65,7 +166,7 @@ describe('useStrivacity', () => {
65
166
  const { useStrivacity } = await import('../../src/runtime/composables/use-strivacity');
66
167
  const ctx = useStrivacity<RedirectFlow>();
67
168
 
68
- expect(ctx.sdk.session).toBe(session);
169
+ expect(ctx.sdk.session).toEqual(session);
69
170
  });
70
171
 
71
172
  test('only initializes the flow once: a second call within the same module instance reuses the same sdk instance', async () => {
@@ -167,7 +268,7 @@ describe('useStrivacity', () => {
167
268
  ['checkAuthentication', [{ autoRefresh: false }], true],
168
269
  ['tokenExchange', [{ code: 'abc' }], undefined],
169
270
  ['handleCallback', ['https://brandtegrity.io/callback?code=abc'], undefined],
170
- ['refresh', [], undefined],
271
+ ['refresh', [{ returnTo: '/orders' }], undefined],
171
272
  ['revoke', [], undefined],
172
273
  ['logout', [{ postLogoutRedirectUri: 'https://brandtegrity.io' }], undefined],
173
274
  ['login', [{ scopes: ['openid'] }], undefined],
@@ -330,7 +431,7 @@ describe('useNativeLogin', () => {
330
431
  });
331
432
 
332
433
  test('calls onLogin and leaves the tracked state untouched when the sdk already has a session', async () => {
333
- const session = { access_token: 'access-token' } as unknown as SessionData;
434
+ const session = { access_token: 'access-token', expires_at: Math.floor(Date.now() / 1000) + 3600 } as unknown as SessionData;
334
435
  vi.doMock('../../src/runtime/composables/use-session', () => ({ useSession: () => ({ value: session }) }));
335
436
 
336
437
  const sdk = createMockFlow<NativeFlow>();
@@ -0,0 +1,46 @@
1
+ import { describe, test, expect, vi, beforeEach } from 'vitest';
2
+
3
+ vi.mock('@nuxt/kit', () => ({
4
+ defineNuxtModule: (definition: unknown) => definition,
5
+ createResolver: () => ({ resolve: (path: string) => path }),
6
+ resolvePath: (path: string) => Promise.resolve(path),
7
+ addImportsDir: vi.fn(),
8
+ addServerImportsDir: vi.fn(),
9
+ addServerHandler: vi.fn(),
10
+ addServerPlugin: vi.fn(),
11
+ addRouteMiddleware: vi.fn(),
12
+ addPlugin: vi.fn(),
13
+ }));
14
+
15
+ function createNuxt() {
16
+ return { options: { runtimeConfig: { public: {} }, alias: {}, nitro: { alias: {} } } };
17
+ }
18
+
19
+ type ModuleDefinition = { setup: (options: Record<string, unknown>, nuxt: ReturnType<typeof createNuxt>) => Promise<void> };
20
+
21
+ beforeEach(() => {
22
+ vi.clearAllMocks();
23
+ });
24
+
25
+ describe('sdk-nuxt module', () => {
26
+ test('prepends its session middleware, so app middleware (incl. *.global.ts) already sees the loaded session', async () => {
27
+ const kit = await import('@nuxt/kit');
28
+ const module = (await import('../../src/module')).default as unknown as ModuleDefinition;
29
+
30
+ await module.setup({ issuer: 'https://brandtegrity.io', clientId: 'client-id', redirectUri: 'https://brandtegrity.io/callback' }, createNuxt());
31
+
32
+ expect(kit.addRouteMiddleware).toHaveBeenCalledWith(expect.objectContaining({ name: 'strivacity', global: true }), { prepend: true });
33
+ });
34
+
35
+ test('does not register the session middleware with client-managed sessions', async () => {
36
+ const kit = await import('@nuxt/kit');
37
+ const module = (await import('../../src/module')).default as unknown as ModuleDefinition;
38
+
39
+ await module.setup(
40
+ { issuer: 'https://brandtegrity.io', clientId: 'client-id', redirectUri: 'https://brandtegrity.io/callback', serverSessionUri: null },
41
+ createNuxt(),
42
+ );
43
+
44
+ expect(kit.addRouteMiddleware).not.toHaveBeenCalled();
45
+ });
46
+ });
@@ -30,16 +30,34 @@ async function installPlugin(strivacityConfig: Record<string, unknown>) {
30
30
 
31
31
  plugin(app);
32
32
 
33
- // setupAuthPlugin() is fired via `void` (not awaited) and chains several dynamic imports
34
- // (the four '#strivacity-options-*' factories) before it registers the hook, which on a cold
35
- // module cache (every test resets it) can outlast a single microtask tick.
36
- await vi.waitFor(() => expect(hook).toHaveBeenCalled());
37
- const requestHook = hook.mock.calls[0]?.[1] as ((event: H3Event) => void) | undefined;
33
+ // The "request" hook is registered synchronously by the plugin itself, before any of the awaited
34
+ // '#strivacity-options-*' dynamic imports resolve - the hook function is what awaits readiness.
35
+ expect(hook).toHaveBeenCalled();
36
+ const requestHook = hook.mock.calls[0]?.[1] as ((event: H3Event) => Promise<void>) | undefined;
38
37
 
39
38
  return { hook, requestHook };
40
39
  }
41
40
 
42
41
  describe('auth.server nitro plugin', () => {
42
+ test('registers the "request" hook synchronously, before the async option-factory imports resolve', async () => {
43
+ let resolveStorageImport: (mod: { default: () => undefined }) => void = () => undefined;
44
+ vi.doMock('#strivacity-options-storage', () => new Promise((resolve) => (resolveStorageImport = resolve)));
45
+ vi.doMock('#imports', () => ({
46
+ useRuntimeConfig: () => ({ strivacity: createServerOptions({ storage: createMockStorage(), stateStorage: createMockStorage() }) }),
47
+ }));
48
+
49
+ const plugin = (await import('../../../src/runtime/server/plugins/auth.server')).default;
50
+ const { app, hook } = createFakeNitroApp();
51
+
52
+ plugin(app);
53
+
54
+ // the hook must already be registered even though the '#strivacity-options-storage' import above
55
+ // is still pending - a request arriving this early must not slip past the hook entirely.
56
+ expect(hook).toHaveBeenCalledWith('request', expect.any(Function));
57
+
58
+ resolveStorageImport({ default: () => undefined });
59
+ });
60
+
43
61
  test('registers a "request" hook that wires a fully-shaped sdk onto the event context', async () => {
44
62
  const storage = createMockStorage();
45
63
  const stateStorage = createMockStorage();
@@ -48,7 +66,7 @@ describe('auth.server nitro plugin', () => {
48
66
  expect(hook).toHaveBeenCalledWith('request', expect.any(Function));
49
67
 
50
68
  const event = { context: {} } as unknown as H3Event;
51
- requestHook!(event);
69
+ await requestHook!(event);
52
70
 
53
71
  const sdk = event.context.strivacity.sdk;
54
72
  expect(sdk.options).toBeDefined();
@@ -81,7 +99,7 @@ describe('auth.server nitro plugin', () => {
81
99
  const { requestHook } = await installPlugin(createServerOptions({ storage, stateStorage }));
82
100
 
83
101
  const event = { context: {} } as unknown as H3Event;
84
- requestHook!(event);
102
+ await requestHook!(event);
85
103
  const sdk = event.context.strivacity.sdk;
86
104
 
87
105
  await expect(sdk.getSession()).resolves.toBeNull();
@@ -97,7 +115,7 @@ describe('auth.server nitro plugin', () => {
97
115
 
98
116
  const existingSdk = { marker: 'existing' };
99
117
  const event = { context: { strivacity: { sdk: existingSdk } } } as unknown as H3Event;
100
- requestHook!(event);
118
+ await requestHook!(event);
101
119
 
102
120
  expect(event.context.strivacity.sdk).toBe(existingSdk);
103
121
  });
@@ -117,7 +135,7 @@ describe('auth.server nitro plugin', () => {
117
135
  const { requestHook } = await installPlugin(createServerOptions({ storage: configuredStorage, stateStorage: createMockStorage() }));
118
136
 
119
137
  const event = { context: {} } as unknown as H3Event;
120
- requestHook!(event);
138
+ await requestHook!(event);
121
139
  const sdk = event.context.strivacity.sdk;
122
140
 
123
141
  const session = getMockStorage(customStorage).generateSession(undefined, null);
@@ -132,7 +150,27 @@ describe('auth.server nitro plugin', () => {
132
150
 
133
151
  const event = createFakeH3Event();
134
152
 
135
- expect(() => requestHook!(event)).not.toThrow();
153
+ await expect(requestHook!(event)).resolves.toBeUndefined();
136
154
  await expect(event.context.strivacity.sdk.getSession()).resolves.toBeNull();
137
155
  });
156
+
157
+ test('logs the error and wires a stub sdk that fails every request with a clear 500, instead of silently leaving the context unset, when setup fails (e.g. missing secret)', async () => {
158
+ const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined);
159
+
160
+ const { requestHook } = await installPlugin(createServerOptions({ storage: undefined, stateStorage: createMockStorage(), secret: undefined }));
161
+
162
+ const event = { context: {} } as unknown as H3Event;
163
+ await requestHook!(event);
164
+
165
+ expect(consoleErrorSpy).toHaveBeenCalledWith(
166
+ '[@strivacity/sdk-nuxt] Failed to initialize the Strivacity server SDK:',
167
+ expect.objectContaining({ message: 'Secret is required for encrypted cookie storage' }),
168
+ );
169
+
170
+ expect(() => event.context.strivacity.sdk.getSession()).toThrow(
171
+ expect.objectContaining({ statusCode: 500, statusMessage: 'Strivacity SDK failed to initialize' }),
172
+ );
173
+
174
+ consoleErrorSpy.mockRestore();
175
+ });
138
176
  });
@@ -7,7 +7,7 @@ import refreshHandler from '../../../src/runtime/server/api/auth/refresh.get';
7
7
  import revokeHandler from '../../../src/runtime/server/api/auth/revoke.get';
8
8
  import entryHandler from '../../../src/runtime/server/api/auth/entry.get';
9
9
  import logoutHandler from '../../../src/runtime/server/api/auth/logout.get';
10
- import backchannelLogoutHandler from '../../../src/runtime/server/api/auth/backchannel-logout.get';
10
+ import backchannelLogoutHandler from '../../../src/runtime/server/api/auth/backchannel-logout.post';
11
11
 
12
12
  function createFakeEvent(sdk: Record<string, ReturnType<typeof vi.fn>>): H3Event {
13
13
  return { context: { strivacity: { sdk } } } as unknown as H3Event;
@@ -21,7 +21,7 @@ test.each([
21
21
  ['revoke.get', revokeHandler, 'handleRevoke'],
22
22
  ['entry.get', entryHandler, 'handleEntry'],
23
23
  ['logout.get', logoutHandler, 'handleLogout'],
24
- ['backchannel-logout.get', backchannelLogoutHandler, 'handleBackChannelLogout'],
24
+ ['backchannel-logout.post', backchannelLogoutHandler, 'handleBackChannelLogout'],
25
25
  ] as const)('%s dispatches to sdk.%s with the event', async (_name, handler, sdkMethod) => {
26
26
  const response = new Response(null, { status: 204 });
27
27
  const sdk = { [sdkMethod]: vi.fn().mockResolvedValue(response) };
@@ -1 +0,0 @@
1
- export { default } from "/home/runner/work/sdk-js/sdk-js/node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/welcome.vue";
@@ -1,21 +0,0 @@
1
-
2
- import { defuFn } from 'defu'
3
-
4
- const inlineConfig = {
5
- "nuxt": {}
6
- }
7
-
8
- /** client **/
9
- import { _replaceAppConfig } from '#app/config'
10
-
11
- // Vite - webpack is handled directly in #app/config
12
- if (import.meta.dev && !import.meta.nitro && import.meta.hot) {
13
- import.meta.hot.accept((newModule) => {
14
- _replaceAppConfig(newModule.default)
15
- })
16
- }
17
- /** client-end **/
18
-
19
-
20
-
21
- export default /*@__PURE__*/ defuFn(inlineConfig)
@@ -1 +0,0 @@
1
- export default {}
@@ -1 +0,0 @@
1
- export const componentNames = ["NuxtWelcome","NuxtLayout","NuxtErrorBoundary","ClientOnly","DevOnly","ServerPlaceholder","NuxtLink","NuxtLoadingIndicator","NuxtTime","NuxtRouteAnnouncer","NuxtAnnouncer","NuxtImg","NuxtPicture","NuxtPage","NoScript","Link","Base","Title","Meta","Style","Head","Html","Body","NuxtIsland"]
@@ -1,66 +0,0 @@
1
-
2
- import type { DefineComponent, SlotsType } from 'vue'
3
- type IslandComponent<T> = DefineComponent<{}, {refresh: () => Promise<void>}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, SlotsType<{ fallback: { error: unknown } }>> & T
4
-
5
- type HydrationStrategies = {
6
- hydrateOnVisible?: IntersectionObserverInit | true
7
- hydrateOnIdle?: number | true
8
- hydrateOnInteraction?: keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap> | true
9
- hydrateOnMediaQuery?: string
10
- hydrateAfter?: number
11
- hydrateWhen?: boolean
12
- hydrateNever?: true
13
- }
14
- type LazyComponent<T> = DefineComponent<HydrationStrategies, {}, {}, {}, {}, {}, {}, { hydrated: () => void }> & T
15
-
16
-
17
- export const NuxtWelcome: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/welcome.vue")['default']
18
- export const NuxtLayout: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-layout")['default']
19
- export const NuxtErrorBoundary: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-error-boundary.vue")['default']
20
- export const ClientOnly: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/client-only")['default']
21
- export const DevOnly: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/dev-only")['default']
22
- export const ServerPlaceholder: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/server-placeholder")['default']
23
- export const NuxtLink: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-link")['default']
24
- export const NuxtLoadingIndicator: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default']
25
- export const NuxtTime: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-time.vue")['default']
26
- export const NuxtRouteAnnouncer: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-route-announcer")['default']
27
- export const NuxtAnnouncer: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-announcer")['default']
28
- export const NuxtImg: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-stubs")['NuxtImg']
29
- export const NuxtPicture: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-stubs")['NuxtPicture']
30
- export const NuxtPage: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/pages/runtime/page-placeholder")['default']
31
- export const NoScript: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['NoScript']
32
- export const Link: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Link']
33
- export const Base: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Base']
34
- export const Title: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Title']
35
- export const Meta: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Meta']
36
- export const Style: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Style']
37
- export const Head: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Head']
38
- export const Html: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Html']
39
- export const Body: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Body']
40
- export const NuxtIsland: typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-island")['default']
41
- export const LazyNuxtWelcome: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/welcome.vue")['default']>
42
- export const LazyNuxtLayout: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-layout")['default']>
43
- export const LazyNuxtErrorBoundary: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-error-boundary.vue")['default']>
44
- export const LazyClientOnly: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/client-only")['default']>
45
- export const LazyDevOnly: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/dev-only")['default']>
46
- export const LazyServerPlaceholder: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/server-placeholder")['default']>
47
- export const LazyNuxtLink: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-link")['default']>
48
- export const LazyNuxtLoadingIndicator: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default']>
49
- export const LazyNuxtTime: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-time.vue")['default']>
50
- export const LazyNuxtRouteAnnouncer: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-route-announcer")['default']>
51
- export const LazyNuxtAnnouncer: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-announcer")['default']>
52
- export const LazyNuxtImg: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-stubs")['NuxtImg']>
53
- export const LazyNuxtPicture: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-stubs")['NuxtPicture']>
54
- export const LazyNuxtPage: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/pages/runtime/page-placeholder")['default']>
55
- export const LazyNoScript: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['NoScript']>
56
- export const LazyLink: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Link']>
57
- export const LazyBase: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Base']>
58
- export const LazyTitle: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Title']>
59
- export const LazyMeta: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Meta']>
60
- export const LazyStyle: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Style']>
61
- export const LazyHead: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Head']>
62
- export const LazyHtml: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Html']>
63
- export const LazyBody: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/head/runtime/components")['Body']>
64
- export const LazyNuxtIsland: LazyComponent<typeof import("../../../node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-island")['default']>
65
-
66
- export const componentNames: string[]
@@ -1,8 +0,0 @@
1
- import { defineAsyncComponent } from 'vue'
2
- export const islandComponents = import.meta.client ? Object.create(null) : Object.assign(Object.create(null), {
3
-
4
- })
5
- export const pageIslandRoutes = import.meta.client ? Object.create(null) : Object.assign(Object.create(null), {
6
-
7
- })
8
- export const providePageIslandDepth = () => {}
@@ -1,5 +0,0 @@
1
-
2
- import { defineNuxtPlugin } from '#app/nuxt'
3
- export default defineNuxtPlugin({
4
- name: 'nuxt:global-components',
5
- })
package/.nuxt/css.mjs DELETED
File without changes
@@ -1 +0,0 @@
1
- export { default } from "/home/runner/work/sdk-js/sdk-js/node_modules/.pnpm/nuxt@4.5.2_6ed97a1f3ddf9a9523af906298c85ee8/node_modules/nuxt/dist/app/components/nuxt-error-page.vue";