This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,074 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { _karbonClientHooks } from '../composables/storipress-base-client' | ||
import { defineNuxtPlugin } from '#imports' | ||
|
||
export default defineNuxtPlugin((nuxt) => { | ||
_karbonClientHooks.hook('karbon:request', async (ctx) => { | ||
await nuxt.hooks.callHookParallel('karbon:request', ctx) | ||
}) | ||
|
||
_karbonClientHooks.hook('karbon:response', async (ctx) => { | ||
await nuxt.hooks.callHookParallel('karbon:response', ctx) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { clientHooks } from '@storipress/karbon/internal' | ||
import { type _karbonClientHooks } from '../../composables/storipress-base-client' | ||
import { defineNitroPlugin } from '#imports' | ||
|
||
const hooks: typeof _karbonClientHooks = clientHooks | ||
|
||
export default defineNitroPlugin((nitro) => { | ||
hooks.hook('karbon:request', (ctx) => { | ||
return nitro.hooks.callHookParallel('karbon:request', ctx) | ||
}) | ||
hooks.hook('karbon:response', (ctx) => { | ||
return nitro.hooks.callHookParallel('karbon:response', ctx) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default defineNuxtPlugin(() => { | ||
const nuxt = useNuxtApp() | ||
nuxt.hooks.hook('karbon:request', (ctx) => { | ||
console.log('nuxt request', ctx) | ||
}) | ||
nuxt.hooks.hook('karbon:response', (ctx) => { | ||
console.log('nuxt response', ctx) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineNitroPlugin } from '#imports' | ||
|
||
export default defineNitroPlugin((nitro) => { | ||
nitro.hooks.hook('karbon:request', (ctx) => { | ||
console.log('nitro request', ctx) | ||
}) | ||
nitro.hooks.hook('karbon:response', (ctx) => { | ||
console.log('nitro response', ctx) | ||
}) | ||
}) |
Oops, something went wrong.