silgi 0.3.10 → 0.3.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/dist/cli/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import consola from 'consola';
|
|
|
3
3
|
|
|
4
4
|
const name = "silgi";
|
|
5
5
|
const type = "module";
|
|
6
|
-
const version = "0.3.
|
|
6
|
+
const version = "0.3.12";
|
|
7
7
|
const packageManager = "pnpm@9.15.1";
|
|
8
8
|
const sideEffects = false;
|
|
9
9
|
const exports = {
|
|
@@ -83,8 +83,8 @@ const peerDependencies = {
|
|
|
83
83
|
nitropack: "^2.10.4",
|
|
84
84
|
nuxt: "^3.15.3",
|
|
85
85
|
typescript: "^5.7.3",
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
vue: "^3.5.13",
|
|
87
|
+
zod: "^3.24.1"
|
|
88
88
|
};
|
|
89
89
|
const peerDependenciesMeta = {
|
|
90
90
|
"@nuxt/kit": {
|
|
@@ -99,10 +99,10 @@ const peerDependenciesMeta = {
|
|
|
99
99
|
nuxt: {
|
|
100
100
|
optional: true
|
|
101
101
|
},
|
|
102
|
-
|
|
102
|
+
vue: {
|
|
103
103
|
optional: true
|
|
104
104
|
},
|
|
105
|
-
|
|
105
|
+
zod: {
|
|
106
106
|
optional: true
|
|
107
107
|
}
|
|
108
108
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import type { SilgiRouterTypes } from 'silgi';
|
|
2
|
-
import { type FetchResult, type UseFetchOptions } from 'nuxt/app';
|
|
3
|
-
import type { FetchError } from 'ofetch';
|
|
4
1
|
import type { AvailableRouterMethod } from 'nitropack';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import type { FetchError } from 'ofetch';
|
|
3
|
+
import type { SilgiRouterTypes } from 'silgi';
|
|
4
|
+
import { type AsyncData, type FetchResult, type UseFetchOptions } from 'nuxt/app';
|
|
5
|
+
export type KeysOf<T> = Array<T extends T ? keyof T extends string ? keyof T : never : never>;
|
|
6
|
+
export type PickFrom<T, K extends Array<string>> = T extends Array<any> ? T : T extends Record<string, any> ? keyof T extends K[number] ? T : K[number] extends never ? T : Pick<T, K[number]> : T;
|
|
7
|
+
export declare function useSilgiFetch<ResT = void, ErrorT = FetchError, ReqT extends keyof SilgiRouterTypes = keyof SilgiRouterTypes, Method extends AvailableRouterMethod<ReqT> = ResT extends void ? 'get' extends AvailableRouterMethod<ReqT> ? 'get' : AvailableRouterMethod<ReqT> : AvailableRouterMethod<ReqT>, _ResT = ResT extends void ? FetchResult<ReqT, Method> : ResT, DataT = SilgiRouterTypes[ReqT][Method] extends {
|
|
8
|
+
output: any;
|
|
9
|
+
} ? SilgiRouterTypes[ReqT][Method]['output'] : any, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = SilgiRouterTypes[ReqT][Method] extends {
|
|
10
|
+
output: infer T;
|
|
11
|
+
} ? T : never>(url: ReqT | (() => ReqT), options?: Omit<UseFetchOptions<any, any, any, any, ReqT>, 'method' | 'body'> & {
|
|
12
|
+
method?: keyof SilgiRouterTypes[ReqT];
|
|
11
13
|
body?: SilgiRouterTypes[ReqT][Method] extends {
|
|
12
14
|
input: any;
|
|
13
15
|
} ? SilgiRouterTypes[ReqT][Method]['input'] : never;
|
|
14
|
-
}):
|
|
16
|
+
}): AsyncData<DefaultT | PickFrom<DataT, PickKeys>, ErrorT | null>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as SilgiConfig, c as SilgiHelper, d as SilgiRouterTypes, S as SilgiOptions, M as ModuleOptions, e as ModuleDefinition, f as SilgiModule, B as BaseSchemaType, g as SilgiServiceInterface, h as DefaultNamespaces, i as Silgi, j as SilgiOperation, k as MergedSilgiSchema, l as ServiceType, m as SilgiSchema, R as RequiredServiceType, n as SilgiModuleShared } from './shared/silgi.ClpvycKI.mjs';
|
|
2
2
|
export { F as Awaitable, G as CreateScope, D as DeepPartial, C as DefaultHooks, A as DefaultMethods, E as ExtendShared, u as ExtractInputFromURI, v as ExtractOutputFromURI, w as ExtractRouterParamsFromURI, s as SilgiDefaultShared, o as SilgiEvent, z as SilgiHook, p as SilgiModuleMethods, a as SilgiModuleOptions, q as SilgiModules, r as SilgiNamespaces, x as SilgiStorageBase, t as SilgiURIs, U as URIsTypes, y as silgi } from './shared/silgi.ClpvycKI.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { FetchContext, FetchOptions } from 'ofetch';
|
|
4
4
|
import { LoadConfigOptions } from 'c12';
|
|
5
5
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
6
6
|
import * as unctx_index from 'unctx/index';
|
|
@@ -59,7 +59,6 @@ declare class SilgiError extends Error {
|
|
|
59
59
|
type FetchResponseData<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
|
|
60
60
|
output: any;
|
|
61
61
|
} ? SilgiRouterTypes[Route][Method]['output'] : never;
|
|
62
|
-
type FetchResponseError<T extends Record<string | number, any>> = FetchError;
|
|
63
62
|
type MethodOption<M, P> = 'get' extends keyof P ? {
|
|
64
63
|
method?: M;
|
|
65
64
|
} : {
|
|
@@ -194,4 +193,4 @@ declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces,
|
|
|
194
193
|
};
|
|
195
194
|
};
|
|
196
195
|
|
|
197
|
-
export { DefaultNamespaces, type ExtendContext, type FetchResponseData, type
|
|
196
|
+
export { DefaultNamespaces, type ExtendContext, type FetchResponseData, type FilterMethods, MergedSilgiSchema, type MethodOption, type Namespaces, type ParamsOption, type RequestBodyOption, type RouterParams, ServiceType, Silgi, SilgiError, type SilgiFetchClient, SilgiHelper, type SilgiModuleContext, SilgiModuleShared, SilgiOptions, SilgiRouterTypes, SilgiSchema, createResolver, createSchema, createService, createShared, createSilgi, createSilgiFetch, defineSilgiModule, loadSilgiConfig, mergeSchemas, mergeServices, mergeShared, normalizeResult, parseURI, relativeWithDot, silgiCtx, silgiFetchRequestInterceptor, tryUseSilgi, useHook, useShared, useSilgi };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as SilgiConfig, c as SilgiHelper, d as SilgiRouterTypes, S as SilgiOptions, M as ModuleOptions, e as ModuleDefinition, f as SilgiModule, B as BaseSchemaType, g as SilgiServiceInterface, h as DefaultNamespaces, i as Silgi, j as SilgiOperation, k as MergedSilgiSchema, l as ServiceType, m as SilgiSchema, R as RequiredServiceType, n as SilgiModuleShared } from './shared/silgi.ClpvycKI.js';
|
|
2
2
|
export { F as Awaitable, G as CreateScope, D as DeepPartial, C as DefaultHooks, A as DefaultMethods, E as ExtendShared, u as ExtractInputFromURI, v as ExtractOutputFromURI, w as ExtractRouterParamsFromURI, s as SilgiDefaultShared, o as SilgiEvent, z as SilgiHook, p as SilgiModuleMethods, a as SilgiModuleOptions, q as SilgiModules, r as SilgiNamespaces, x as SilgiStorageBase, t as SilgiURIs, U as URIsTypes, y as silgi } from './shared/silgi.ClpvycKI.js';
|
|
3
|
-
import {
|
|
3
|
+
import { FetchContext, FetchOptions } from 'ofetch';
|
|
4
4
|
import { LoadConfigOptions } from 'c12';
|
|
5
5
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
6
6
|
import * as unctx_index from 'unctx/index';
|
|
@@ -59,7 +59,6 @@ declare class SilgiError extends Error {
|
|
|
59
59
|
type FetchResponseData<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
|
|
60
60
|
output: any;
|
|
61
61
|
} ? SilgiRouterTypes[Route][Method]['output'] : never;
|
|
62
|
-
type FetchResponseError<T extends Record<string | number, any>> = FetchError;
|
|
63
62
|
type MethodOption<M, P> = 'get' extends keyof P ? {
|
|
64
63
|
method?: M;
|
|
65
64
|
} : {
|
|
@@ -194,4 +193,4 @@ declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces,
|
|
|
194
193
|
};
|
|
195
194
|
};
|
|
196
195
|
|
|
197
|
-
export { DefaultNamespaces, type ExtendContext, type FetchResponseData, type
|
|
196
|
+
export { DefaultNamespaces, type ExtendContext, type FetchResponseData, type FilterMethods, MergedSilgiSchema, type MethodOption, type Namespaces, type ParamsOption, type RequestBodyOption, type RouterParams, ServiceType, Silgi, SilgiError, type SilgiFetchClient, SilgiHelper, type SilgiModuleContext, SilgiModuleShared, SilgiOptions, SilgiRouterTypes, SilgiSchema, createResolver, createSchema, createService, createShared, createSilgi, createSilgiFetch, defineSilgiModule, loadSilgiConfig, mergeSchemas, mergeServices, mergeShared, normalizeResult, parseURI, relativeWithDot, silgiCtx, silgiFetchRequestInterceptor, tryUseSilgi, useHook, useShared, useSilgi };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silgi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.12",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"nitropack": "^2.10.4",
|
|
67
67
|
"nuxt": "^3.15.3",
|
|
68
68
|
"typescript": "^5.7.3",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
69
|
+
"vue": "^3.5.13",
|
|
70
|
+
"zod": "^3.24.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependenciesMeta": {
|
|
73
73
|
"@nuxt/kit": {
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"nuxt": {
|
|
83
83
|
"optional": true
|
|
84
84
|
},
|
|
85
|
-
"
|
|
85
|
+
"vue": {
|
|
86
86
|
"optional": true
|
|
87
87
|
},
|
|
88
|
-
"
|
|
88
|
+
"zod": {
|
|
89
89
|
"optional": true
|
|
90
90
|
}
|
|
91
91
|
},
|