silgi 0.7.53 → 0.7.55
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/_chunks/index.mjs
CHANGED
package/dist/core/index.d.mts
CHANGED
|
@@ -22,6 +22,7 @@ declare function mergeServices<T extends ServiceType<SilgiSchema>[]>(servicesOrA
|
|
|
22
22
|
declare function mergeShared<T extends SilgiRuntimeSharedExtends[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
|
|
23
23
|
|
|
24
24
|
declare function getEvent<T>(event?: SilgiEvents): T;
|
|
25
|
+
declare function getEventContext<T>(): T;
|
|
25
26
|
|
|
26
27
|
declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces, Record<string, BaseSchemaType<StandardSchemaV1>>>>>(silgiType: T): {
|
|
27
28
|
[K in keyof T]: {
|
|
@@ -256,4 +257,4 @@ declare function useSilgiCLI(): SilgiCLI;
|
|
|
256
257
|
*/
|
|
257
258
|
declare function tryUseSilgiCLI(): SilgiCLI | null;
|
|
258
259
|
|
|
259
|
-
export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
|
|
260
|
+
export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, getEventContext, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare function mergeServices<T extends ServiceType<SilgiSchema>[]>(servicesOrA
|
|
|
22
22
|
declare function mergeShared<T extends SilgiRuntimeSharedExtends[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
|
|
23
23
|
|
|
24
24
|
declare function getEvent<T>(event?: SilgiEvents): T;
|
|
25
|
+
declare function getEventContext<T>(): T;
|
|
25
26
|
|
|
26
27
|
declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces, Record<string, BaseSchemaType<StandardSchemaV1>>>>>(silgiType: T): {
|
|
27
28
|
[K in keyof T]: {
|
|
@@ -256,4 +257,4 @@ declare function useSilgiCLI(): SilgiCLI;
|
|
|
256
257
|
*/
|
|
257
258
|
declare function tryUseSilgiCLI(): SilgiCLI | null;
|
|
258
259
|
|
|
259
|
-
export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
|
|
260
|
+
export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, getEventContext, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
|
package/dist/core/index.mjs
CHANGED
|
@@ -683,7 +683,19 @@ function mergeShared(sharedOrArray) {
|
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
function getEvent(event) {
|
|
686
|
-
|
|
686
|
+
const silgi = useSilgi();
|
|
687
|
+
if (silgi.options.present === "h3" || silgi.options.present === "nitro" || silgi.options.present === "nuxt") {
|
|
688
|
+
return event.event;
|
|
689
|
+
}
|
|
690
|
+
return event;
|
|
691
|
+
}
|
|
692
|
+
function getEventContext() {
|
|
693
|
+
const event = getEvent();
|
|
694
|
+
const silgi = useSilgi();
|
|
695
|
+
if (silgi.options.present === "h3" || silgi.options.present === "nitro" || silgi.options.present === "nuxt") {
|
|
696
|
+
return event.context;
|
|
697
|
+
}
|
|
698
|
+
return event;
|
|
687
699
|
}
|
|
688
700
|
|
|
689
701
|
function createSchema(silgiType) {
|
|
@@ -710,4 +722,4 @@ function tryUseSilgiCLI() {
|
|
|
710
722
|
return silgiCLICtx.tryUse();
|
|
711
723
|
}
|
|
712
724
|
|
|
713
|
-
export { ErrorCategory, ErrorFactory, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgi, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
|
|
725
|
+
export { ErrorCategory, ErrorFactory, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, getEventContext, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgi, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export interface PresetOptions {
|
|
|
2
2
|
}
|
|
3
3
|
export declare const presetsWithConfig: readonly [];
|
|
4
4
|
export type PresetName = "h3" | "nitro" | "npm-package" | "nuxt";
|
|
5
|
-
export type PresetNameInput = "h3" | "nitro" | "npm-package" | "nuxt"
|
|
5
|
+
export type PresetNameInput = "h3" | "nitro" | "npm-package" | "nuxt";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silgi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.55",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"lint": "eslint .",
|
|
174
174
|
"lint:fix": "eslint . --fix",
|
|
175
175
|
"silgi": "tsx cli/index.ts",
|
|
176
|
-
"release": "pnpm unbuild && pnpm publish --no-git-checks --access public",
|
|
176
|
+
"release": "pnpm gen-presets && pnpm unbuild && pnpm publish --no-git-checks --access public",
|
|
177
177
|
"generate": "pnpm --filter './examples/**' silgi:prepare",
|
|
178
178
|
"gen-presets": "pnpm jiti scripts/gen-presets.ts",
|
|
179
179
|
"all:delete": "find . -type d \\( -name \"node_modules\" -o -name \"dist\" \\) -prune -exec rm -rf {} +"
|