@akanjs/signal 0.9.48 → 0.9.49

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/src/fetch.d.ts CHANGED
@@ -1,42 +1,44 @@
1
1
  export declare const fetch: {
2
- publishPing: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<void>;
3
2
  ping: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
4
3
  pingBody: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
5
4
  pingParam: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
6
- pingQuery: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
5
+ pingQuery: (args_0?: string | null | undefined, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string | null>;
7
6
  pingEvery: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
8
7
  pingUser: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
9
8
  pingAdmin: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
10
- cleanup: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
11
- wsPing: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => void;
12
9
  getDictionary: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<Record<string, Record<string, string>>>;
10
+ getAllDictionary: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<Record<string, Record<string, Record<string, string>>>>;
11
+ cleanup: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<boolean>;
12
+ wsPing: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => void;
13
+ getSignals: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<import("./signalInfo").SerializedSignal[]>;
13
14
  listenWsPing: (handleEvent: (data: string & {
14
15
  __Returns__: "Emit";
15
16
  }) => any, options?: import("@akanjs/common").FetchPolicy) => () => void;
16
- subscribePubsubPing: (onData: (data: Omit<string & {
17
+ subscribePubsubPing: (onData: (data: string & {
17
18
  __Returns__: "Subscribe";
18
- }, "__Returns__">) => void, fetchPolicy?: import("@akanjs/common").FetchPolicy<any> | undefined) => () => void;
19
+ }) => void, fetchPolicy?: import("@akanjs/common").FetchPolicy<any> | undefined) => () => void;
19
20
  client: import("./client").Client;
20
21
  clone: (option?: {
21
22
  jwt: string | null;
22
23
  }) => Omit<{
23
- wsPing: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => void;
24
+ wsPing: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => void;
24
25
  listenWsPing: (handleEvent: (data: string & {
25
26
  __Returns__: "Emit";
26
27
  }) => any, options?: import("@akanjs/common").FetchPolicy) => () => void;
27
- subscribePubsubPing: (onData: (data: Omit<string & {
28
+ subscribePubsubPing: (onData: (data: string & {
28
29
  __Returns__: "Subscribe";
29
- }, "__Returns__">) => void, fetchPolicy?: import("@akanjs/common").FetchPolicy<any> | undefined) => () => void;
30
- publishPing: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<void>;
30
+ }) => void, fetchPolicy?: import("@akanjs/common").FetchPolicy<any> | undefined) => () => void;
31
31
  ping: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
32
32
  pingBody: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
33
33
  pingParam: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
34
- pingQuery: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
34
+ pingQuery: (args_0?: string | null | undefined, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string | null>;
35
35
  pingEvery: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
36
36
  pingUser: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
37
37
  pingAdmin: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
38
- cleanup: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<string>;
39
38
  getDictionary: (args_0: string, option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<Record<string, Record<string, string>>>;
39
+ getAllDictionary: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<Record<string, Record<string, Record<string, string>>>>;
40
+ cleanup: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<boolean>;
41
+ getSignals: (option?: import("@akanjs/common").FetchPolicy<any> | undefined) => Promise<import("./signalInfo").SerializedSignal[]>;
40
42
  } & typeof globalThis.fetch & {
41
43
  client: import("./client").Client;
42
44
  clone: (option?: {
@@ -0,0 +1,19 @@
1
+ import { Client } from "./client";
2
+ import { SerializedSignal } from "./signalInfo";
3
+ declare global {
4
+ var builtFetch: typeof global.fetch & {
5
+ client: Client;
6
+ } & {
7
+ [key: string]: (...args: any[]) => Promise<any>;
8
+ };
9
+ }
10
+ export declare const serviceFetchOf: <Fetch = {
11
+ [key: string]: any;
12
+ }>(signal: SerializedSignal) => Fetch;
13
+ export declare const databaseFetchOf: <Fetch = {
14
+ [key: string]: any;
15
+ }>(signal: SerializedSignal, option?: {
16
+ overwrite?: {
17
+ [key: string]: any;
18
+ };
19
+ }) => Fetch;
package/src/gql.d.ts CHANGED
@@ -1,24 +1,16 @@
1
1
  import { DataList, type GetActionObject, type GetStateObject, type MergeAll, type MergedValues, type Prettify, type PromiseOrObject, Type, Upload } from "@akanjs/base";
2
2
  import { FetchPolicy } from "@akanjs/common";
3
- import { ConstantModel, DefaultOf, DocumentModel, FilterType, ProtoFile, QueryOf, type ScalarConstantModel, SortOf } from "@akanjs/constant";
3
+ import { ConstantModel, DefaultOf, DocumentModel, ProtoFile, QueryOf } from "@akanjs/constant";
4
+ import type { FilterType, SortOf } from "@akanjs/document";
5
+ import { AnyVariables } from "@urql/core";
4
6
  import { type Client } from ".";
5
- import { type ArgMeta, type DefaultSignal, type GqlMeta, type SliceMeta } from "./signalDecorators";
7
+ import { type DefaultSignal, type SliceMeta } from "./signalDecorators";
6
8
  export declare class GqlStorage {
7
9
  }
8
- export declare class FragmentStorage {
9
- }
10
- export declare class PurifyStorage {
11
- }
12
- export declare class DefaultStorage {
13
- }
14
- export declare class CrystalizeStorage {
15
- }
16
- export type PurifyFunc<Input, _DefaultInput = DefaultOf<Input>, _DocInput = DocumentModel<Input>> = (self: _DefaultInput, isChild?: boolean) => _DocInput | null;
17
- export type CrystalizeFunc<Model> = (self: GetStateObject<Model>, isChild?: boolean) => Model;
18
10
  export interface FetchInitForm<Input, Full, Filter extends FilterType, _DefaultInput = DefaultOf<Input>, _Sort = SortOf<Filter>> {
19
11
  page?: number;
20
12
  limit?: number;
21
- sort?: _Sort | symbol;
13
+ sort?: _Sort;
22
14
  default?: Partial<_DefaultInput>;
23
15
  invalidate?: boolean;
24
16
  insight?: boolean;
@@ -57,13 +49,6 @@ export type ServerEdit<T extends string, Model> = {
57
49
  [K in `${T}ViewAt`]: Date;
58
50
  };
59
51
  export type ClientEdit<T extends string, Model> = PromiseOrObject<ServerEdit<T, Model>>;
60
- export type GqlScalarUtil<T extends string, Input, Model, Default, DefaultInput, Doc, DocInput, _CapitalizedT extends string = Capitalize<T>> = {
61
- [K in `default${_CapitalizedT}`]: Default;
62
- } & {
63
- [K in `purify${_CapitalizedT}`]: PurifyFunc<Input, DefaultInput, DocInput>;
64
- } & {
65
- [K in `crystalize${_CapitalizedT}`]: CrystalizeFunc<Model>;
66
- };
67
52
  type RemoveLast3<T extends any[]> = T extends [...infer Rest, any, any, any] ? Rest : T;
68
53
  export type FilterListArgs<Args extends any[]> = PartialNullableArgs<ConvertArgs<RemoveLast3<FilterInternalArgs<Args>>>>;
69
54
  type FetchOption<Input, Full, Filter extends FilterType, _DefaultInput = DefaultOf<Input>, _Sort = SortOf<Filter>> = FetchPolicy & FetchInitForm<Input, Full, Filter, _DefaultInput, _Sort>;
@@ -89,10 +74,6 @@ type InitReturn<T extends string, Light extends {
89
74
  type BasicMethods<T extends string, Input, Full, Light extends {
90
75
  id: string;
91
76
  }, Insight, _CapitalizedT extends string = Capitalize<T>> = {
92
- [K in `lightCrystalize${_CapitalizedT}`]: CrystalizeFunc<Light>;
93
- } & {
94
- [K in `default${_CapitalizedT}Insight`]: Insight;
95
- } & {
96
77
  [K in `add${_CapitalizedT}Files`]: (fileList: FileList, parentId?: string, option?: FetchPolicy) => Promise<ProtoFile[]>;
97
78
  } & {
98
79
  [K in `merge${_CapitalizedT}`]: (modelOrId: Full | string, data: Partial<DocumentModel<Input>>, option?: FetchPolicy) => Promise<Full>;
@@ -139,7 +120,7 @@ export type DbGraphQL<T extends string, Input, Full, Light extends {
139
120
  }, Insight, Filter extends FilterType, Fetch, Signal, _CapitalizedT extends string = Capitalize<T>, _Default = DefaultOf<Full>, _DefaultInput = DefaultOf<Input>, _DefaultState = GetStateObject<Full>, _DefaultStateInput = GetStateObject<Input>, _Doc = DocumentModel<Full>, _DocInput = DocumentModel<Input>, _QueryOfDoc = QueryOf<DocumentModel<Full>>, _Query = GetActionObject<Filter>, _Sort = SortOf<Filter>, _DynamicSliceArgMap = DynamicSliceArgMap<T, Input, Full, Filter, Signal, _CapitalizedT, _DefaultInput, _Sort>> = {
140
121
  refName: string;
141
122
  slices: SliceMeta[];
142
- } & GetWsMessageOf<Signal> & GetWsPubsubOf<Signal> & GqlScalarUtil<T, Input, Full, _Default, _DefaultInput, _Doc, _DocInput, _CapitalizedT> & BasicMethods<T, Input, Full, Light, Insight, _CapitalizedT> & ViewEditMethods<T, Full, _CapitalizedT> & InitMethods<T, Input, Full, Light, Insight, Filter, _CapitalizedT, _QueryOfDoc, _DefaultInput, _Sort> & Fetch & DynamicListMethods<T, Input, Full, Light, Insight, Filter, Signal, _CapitalizedT, _DefaultInput, _Sort, _DynamicSliceArgMap>;
123
+ } & GetWsMessageOf<Signal> & GetWsPubsubOf<Signal> & BasicMethods<T, Input, Full, Light, Insight, _CapitalizedT> & ViewEditMethods<T, Full, _CapitalizedT> & InitMethods<T, Input, Full, Light, Insight, Filter, _CapitalizedT, _QueryOfDoc, _DefaultInput, _Sort> & Fetch & DynamicListMethods<T, Input, Full, Light, Insight, Filter, Signal, _CapitalizedT, _DefaultInput, _Sort, _DynamicSliceArgMap>;
143
124
  type IsInternalArg<T> = T extends {
144
125
  __InternalArg__: any;
145
126
  } ? true : false;
@@ -169,49 +150,35 @@ type ListenMethods<Sig> = {
169
150
  [K in keyof Sig as K extends string ? HasMarker<Sig[K], "Emit"> extends true ? `listen${Capitalize<K>}` : never : never]: Sig[K] extends (...args: any) => infer R ? (handleEvent: (data: Awaited<R>) => any, options?: FetchPolicy) => () => void : never;
170
151
  };
171
152
  export type GetWsMessageOf<Sig> = EmitMethods<Sig> & ListenMethods<Sig>;
153
+ type RemoveReturnMeta<Return> = Return extends infer R & {
154
+ __Returns__: any;
155
+ } ? R : Return;
172
156
  type GenerateSubscribeMethod<Fn> = Fn extends (...args: infer Args) => infer R ? (...args: [
173
157
  ...args: FilterOutInternalArgs<Args>,
174
- onData: (data: Omit<Awaited<R>, "__Returns__">) => void,
158
+ onData: (data: RemoveReturnMeta<Awaited<R>>) => void,
175
159
  fetchPolicy?: FetchPolicy
176
160
  ]) => () => void : never;
177
161
  export type GetWsPubsubOf<Sig> = {
178
162
  [K in keyof Sig as K extends string ? HasMarker<Sig[K], "Subscribe"> extends true ? `subscribe${Capitalize<K>}` : never : never]: GenerateSubscribeMethod<Sig[K]>;
179
163
  };
180
- export declare const scalarUtilOf: <T extends string, Model, _Default, _Doc>(cnst: ScalarConstantModel<T, Model, _Default, _Doc>) => GqlScalarUtil<T, Model, Model, _Default, _Default, _Doc, _Doc>;
181
164
  type LightWeightFetch<Fetch, Full, Light> = {
182
165
  [K in keyof Fetch]: Fetch[K] extends (...args: infer Args) => Promise<Full[]> ? (...args: Args) => Promise<Light[]> : Fetch[K];
183
166
  };
184
167
  export declare const getGqlOnStorage: (refName: string) => {
185
168
  [key: string]: any;
186
169
  };
170
+ export declare const setGqlOnStorage: (refName: string, modelGql: any) => void;
187
171
  export declare const gqlOf: <T extends string, Input, Full extends {
188
172
  id: string;
189
173
  }, Light extends {
190
174
  id: string;
191
- }, Insight, Filter extends FilterType, Signal, _CapitalizedT extends string, _Default, _DefaultInput, _DefaultState, _DefaultStateInput, _Doc, _DocInput, _QueryOfDoc, _Query, _Sort, _SignalAction = GetActionObject<Signal>>(constant: ConstantModel<T, Input, Full, Light, Insight, Filter, _CapitalizedT, _Default, _DefaultInput, _DefaultState, _DefaultStateInput, _Doc, _DocInput, _QueryOfDoc, _Query, _Sort>, sigRef: Type<Signal>, option?: {
175
+ }, Insight, Filter extends FilterType, Signal, _CapitalizedT extends string, _Default, _DefaultInput, _DefaultState, _DefaultStateInput, _DefaultInsight, _PurifiedInput, _Doc, _DocInput, _QueryOfDoc, _Sort = SortOf<Filter>, _SignalAction = GetActionObject<Signal>>(constant: ConstantModel<T, Input, Full, Light, Insight, _CapitalizedT, _Default, _DefaultInput, _DefaultState, _DefaultStateInput, _DefaultInsight, _PurifiedInput, _Doc, _DocInput, _QueryOfDoc>, filterRef: Type<Filter>, sigRef: Type<Signal>, option?: {
192
176
  overwrite?: {
193
177
  [key: string]: any;
194
178
  };
195
- }) => DbGraphQL<T, Input, Full, Light, Insight, Filter, LightWeightFetch<GetQueryMutationOf<_SignalAction & DefaultSignal<T, Input, Full, Light, Insight, Filter, _CapitalizedT, _DocInput, _QueryOfDoc, _Sort>, Full>, Full, Light>, _SignalAction, _CapitalizedT, _Default, _DefaultInput, _DefaultState, _DefaultStateInput, _Doc, _DocInput, _QueryOfDoc, _Sort>;
196
- export declare const makeDefault: <T>(target: Type<T>, option?: {
197
- isChild?: boolean;
198
- overwrite?: any;
199
- }) => DefaultOf<T>;
200
- export declare const makePurify: <I>(target: Type<I>, option?: {
201
- overwrite?: any;
202
- }) => PurifyFunc<I>;
203
- export declare const makeCrystalize: <M>(target: Type<M>, option?: {
204
- overwrite?: any;
205
- partial?: string[];
206
- }) => CrystalizeFunc<M>;
207
- export declare const makeFragment: (target: Type, option?: {
208
- overwrite?: any;
209
- excludeSelf?: boolean;
210
- partial?: string[];
211
- }) => string;
212
- export declare const getGqlStr: (modelRef: Type, gqlMeta: GqlMeta, argMetas: ArgMeta[], returnRef: Type, partial?: string[]) => string;
213
- export declare const serializeArg: (argMeta: ArgMeta, value: any) => object[] | null;
214
- export declare const deserializeArg: (argMeta: ArgMeta, value: any) => object[] | null;
179
+ }) => DbGraphQL<T, Input, Full, Light, Insight, Filter, LightWeightFetch<GetQueryMutationOf<_SignalAction & DefaultSignal<T, Input, Full, Light, Insight, Filter, _CapitalizedT, _PurifiedInput, _QueryOfDoc, _Sort>, Full>, Full, Light>, _SignalAction, _CapitalizedT, _Default, _DefaultInput, _DefaultState, _DefaultStateInput, _Doc, _DocInput, _QueryOfDoc, _Sort>;
180
+ export declare const query: <Query = any>(fetchClient: Client, query: string, variables?: AnyVariables, option?: FetchPolicy) => Promise<NonNullable<Query> | undefined>;
181
+ export declare const mutate: <Mutation = any>(fetchClient: Client, mutation: string, variables?: AnyVariables, option?: FetchPolicy) => Promise<NonNullable<Mutation> | undefined>;
215
182
  export declare const fetchOf: <Signal, _SignalAction = GetActionObject<Signal>>(sigRef: Type<Signal>) => GetWsMessageOf<_SignalAction> & GetWsPubsubOf<_SignalAction> & GetQueryMutationOf<_SignalAction>;
216
183
  type CustomFetch<T> = Omit<T, "client" | "clone"> & {
217
184
  client: Client;
@@ -219,5 +186,5 @@ type CustomFetch<T> = Omit<T, "client" | "clone"> & {
219
186
  jwt: string | null;
220
187
  }) => CustomFetch<T>;
221
188
  };
222
- export declare const makeFetch: <Fetches extends object[]>(...fetches: [...Fetches]) => Prettify<CustomFetch<MergeAll<Fetches>>>;
189
+ export declare const makeFetch: <Fetches extends object[]>(...fetches: Fetches) => Prettify<CustomFetch<MergeAll<Fetches>>>;
223
190
  export {};
@@ -0,0 +1,9 @@
1
+ import { Type } from "@akanjs/base";
2
+ import { SerializedEndpoint } from ".";
3
+ export declare const makeFragment: (modelRef: Type, option?: {
4
+ overwrite?: any;
5
+ excludeSelf?: boolean;
6
+ partial?: string[];
7
+ }) => string;
8
+ export declare const getGqlStr: (modelRef: Type, key: string, endpoint: SerializedEndpoint, returnRef: Type, partial?: string[]) => string;
9
+ export declare function graphql(literals: string | readonly string[], ...args: any[]): string;
package/src/index.d.ts CHANGED
@@ -6,3 +6,8 @@ export * from "./doc";
6
6
  export * from "./baseFetch";
7
7
  export * from "./base.signal";
8
8
  export * from "./fetch";
9
+ export * from "./signalInfo";
10
+ export * from "./apiInfo";
11
+ export * from "./sliceInfo";
12
+ export * from "./fetchInfo";
13
+ export * from "./graphql";
@@ -0,0 +1,74 @@
1
+ import { JSON, PromiseOrObject, Type, UnType } from "@akanjs/base";
2
+ import { ConstantFieldTypeInput, DocumentModel, FieldToValue, PlainTypeToFieldType } from "@akanjs/constant";
3
+ import { GetInternalArg } from "./apiInfo";
4
+ import { ArgType, InternalArgType, Job, SignalOption } from "./signalDecorators";
5
+ type InternalApiType = "resolveField" | "interval" | "cron" | "timeout" | "init" | "destroy" | "process";
6
+ interface InternalApiArgProps<Nullable extends boolean = false> {
7
+ nullable?: Nullable;
8
+ }
9
+ export declare class InternalApiInfo<ReqType extends InternalApiType, Srvs extends {
10
+ [key: string]: any;
11
+ } = {
12
+ [key: string]: any;
13
+ }, Args extends any[] = [], InternalArgs extends any[] = [], Returns extends ConstantFieldTypeInput = ConstantFieldTypeInput, Parent extends DocumentModel<any> = DocumentModel<any>, Nullable extends boolean = false> {
14
+ #private;
15
+ readonly type: ReqType;
16
+ readonly args: {
17
+ type: Extract<ArgType, "Msg">;
18
+ name: string;
19
+ argRef: any;
20
+ option?: InternalApiArgProps<boolean>;
21
+ }[];
22
+ readonly internalArgs: {
23
+ type: InternalArgType;
24
+ option?: InternalApiArgProps<boolean>;
25
+ }[];
26
+ readonly returnRef: Returns;
27
+ readonly signalOption: SignalOption<Returns, Nullable>;
28
+ execFn: ((...args: [...Args, ...InternalArgs]) => any) | null;
29
+ constructor(type: ReqType, returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>);
30
+ msg<ExplicitType, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>, Nullable extends boolean = false, _FieldToValue = FieldToValue<Arg>>(name: string, argRef: Arg, option?: InternalApiArgProps<Nullable>): InternalApiInfo<ReqType, Srvs, [...Args, arg: _FieldToValue | (Nullable extends true ? undefined : never)], InternalArgs, Returns, Parent, Nullable>;
31
+ with<ArgType extends InternalArgType, Nullable extends boolean = false>(argType: ArgType, option?: InternalApiArgProps<Nullable>): InternalApiInfo<ReqType, Srvs, Args, [...InternalArgs, arg: ArgType extends "Job" ? Job : ArgType extends "Parent" ? Parent : GetInternalArg<ArgType> | (Nullable extends true ? null : never)], Returns, Parent, Nullable>;
32
+ exec(query: (this: {
33
+ [K in keyof Srvs as K extends string ? Uncapitalize<K> : never]: Srvs[K];
34
+ }, ...args: [...Args, ...InternalArgs]) => ReqType extends "process" | "resolveField" ? PromiseOrObject<DocumentModel<FieldToValue<Returns>> | (Nullable extends true ? null : never)> : PromiseOrObject<void>): this;
35
+ applyApiMeta(sigRef: Type, key: string): void;
36
+ }
37
+ export declare const makeInternalApiBuilder: <Srvs extends {
38
+ [key: string]: any;
39
+ } = {
40
+ [key: string]: any;
41
+ }, Parent extends DocumentModel<any> = DocumentModel<any>>() => {
42
+ resolveField: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: Pick<SignalOption<Returns, Nullable>, "nullable">) => InternalApiInfo<"resolveField", Srvs, [], [], Returns, Parent, Nullable>;
43
+ interval: <Nullable_2 extends boolean = false>(scheduleTime: number, signalOption?: SignalOption<typeof JSON, Nullable_2>) => InternalApiInfo<"interval", Srvs, [], [], typeof JSON, Parent, Nullable_2>;
44
+ cron: <Nullable_2 extends boolean = false>(scheduleCron: string, signalOption?: SignalOption<typeof JSON, Nullable_2>) => InternalApiInfo<"cron", Srvs, [], [], typeof JSON, Parent, Nullable_2>;
45
+ timeout: <Nullable_2 extends boolean = false>(timeout: number, signalOption?: SignalOption<typeof JSON, Nullable_2>) => InternalApiInfo<"timeout", Srvs, [], [], typeof JSON, Parent, Nullable_2>;
46
+ initialize: <Nullable_2 extends boolean = false>(signalOption?: SignalOption<typeof JSON, Nullable_2>) => InternalApiInfo<"init", Srvs, [], [], typeof JSON, Parent, Nullable_2>;
47
+ destroy: <Nullable_2 extends boolean = false>(signalOption?: SignalOption<typeof JSON, Nullable_2>) => InternalApiInfo<"destroy", Srvs, [], [], typeof JSON, Parent, Nullable_2>;
48
+ process: <Returns extends ConstantFieldTypeInput, Nullable_1 extends boolean = false>(returnRef: Returns, signalOption?: SignalOption<Returns, Nullable_1>) => InternalApiInfo<"process", Srvs, [], [], Returns, Parent, Nullable_1>;
49
+ };
50
+ export type BuildInternalApiSignal<SigBuilder extends InternalApiBuilder<any>, _ApiMap = ReturnType<SigBuilder>> = {
51
+ [K in keyof _ApiMap as _ApiMap[K] extends InternalApiInfo<"process", any, any, any, any, any, any> ? K : never]: _ApiMap[K] extends InternalApiInfo<infer ReqType, any, infer Args, any, infer Returns, any, infer Nullable> ? (...args: Args) => ReqType extends "process" ? Promise<(FieldToValue<Returns> | (Nullable extends true ? null : never)) & {
52
+ __Returns__: "Done";
53
+ }> : never : never;
54
+ };
55
+ export type InternalApiBuilder<Srvs extends {
56
+ [key: string]: Type;
57
+ } = {
58
+ [key: string]: Type;
59
+ }, Parent extends DocumentModel<any> = DocumentModel<any>, _ThisSrvs extends {
60
+ [key: string]: any;
61
+ } = {
62
+ [K in keyof Srvs as K extends string ? Uncapitalize<K> : never]: UnType<Srvs[K]>;
63
+ }> = (builder: {
64
+ resolveField: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: Pick<SignalOption<Returns, Nullable>, "nullable">) => InternalApiInfo<"resolveField", _ThisSrvs, [], [], Returns, Parent, Nullable>;
65
+ interval: <Nullable extends boolean = false>(scheduleTime: number, signalOption?: SignalOption<typeof JSON, Nullable>) => InternalApiInfo<"interval", _ThisSrvs, [], [], typeof JSON, Parent, Nullable>;
66
+ cron: <Nullable extends boolean = false>(scheduleCron: string, signalOption?: SignalOption<typeof JSON, Nullable>) => InternalApiInfo<"cron", _ThisSrvs, [], [], typeof JSON, Parent, Nullable>;
67
+ timeout: <Nullable extends boolean = false>(timeout: number, signalOption?: SignalOption<typeof JSON, Nullable>) => InternalApiInfo<"timeout", _ThisSrvs, [], [], typeof JSON, Parent, Nullable>;
68
+ initialize: <Nullable extends boolean = false>(signalOption?: SignalOption<typeof JSON, Nullable>) => InternalApiInfo<"init", _ThisSrvs, [], [], typeof JSON, Parent, Nullable>;
69
+ destroy: <Nullable extends boolean = false>(signalOption?: SignalOption<typeof JSON, Nullable>) => InternalApiInfo<"destroy", _ThisSrvs, [], [], typeof JSON, Parent, Nullable>;
70
+ process: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>) => InternalApiInfo<"process", _ThisSrvs, [], [], Returns, Parent, Nullable>;
71
+ }) => {
72
+ [key: string]: InternalApiInfo<any, any, any, any, any, any, any>;
73
+ };
74
+ export {};
@@ -1,15 +1,21 @@
1
1
  import "reflect-metadata";
2
- import { BaseObject, Dayjs, Enum, Environment, SingleFieldType, Type } from "@akanjs/base";
3
- import { ConstantModel, DocumentModel, FilterType, QueryOf, ReturnType, SortOf } from "@akanjs/constant";
2
+ import { BaseObject, Dayjs, Enum, Environment, type MergeAllActionTypes, SingleFieldType, Type, UnType } from "@akanjs/base";
3
+ import { ConstantModel, DocumentModel, GqlReturn, PurifiedModel, QueryOf } from "@akanjs/constant";
4
+ import type { Doc, FilterType, SortOf } from "@akanjs/document";
5
+ import type { ServiceModule } from "@akanjs/service";
4
6
  import type { Job as BullJob } from "bull";
5
7
  import type { Request as ExpressRequest, Response as ExpressResponse } from "express";
6
8
  import type { Socket } from "socket.io";
9
+ import { BuildSliceSignal, SliceApiBuilder } from ".";
10
+ import { type ApiBuilder, type BuildApiSignal } from "./apiInfo";
11
+ import { BuildInternalApiSignal, InternalApiBuilder } from "./internalApiInfo";
7
12
  export declare const ssoTypes: readonly ["github", "google", "facebook", "apple", "naver", "kakao"];
8
13
  export type SSOType = (typeof ssoTypes)[number];
9
14
  export declare class SignalStorage {
10
15
  }
11
16
  export declare const getAllSignalRefs: () => Type[];
12
17
  export declare const getSignalRefsOnStorage: (refName: string) => Type[];
18
+ export declare const setSignalRefOnStorage: (refName: string, signalRef: Type) => void;
13
19
  export type Resolve<T> = T;
14
20
  export declare const resolve: <T>(data: any) => Resolve<T>;
15
21
  export declare const emit: <T>(data: any) => Resolve<T> & {
@@ -32,8 +38,8 @@ interface TimerOption {
32
38
  lock?: boolean;
33
39
  enabled?: boolean;
34
40
  }
35
- export interface SignalOption<Response = any> extends InitOption, TimerOption {
36
- nullable?: boolean;
41
+ export interface SignalOption<Response = any, Nullable extends boolean = false, _Key = keyof UnType<Response>> extends InitOption, TimerOption {
42
+ nullable?: Nullable;
37
43
  name?: string;
38
44
  default?: boolean;
39
45
  path?: string;
@@ -41,7 +47,7 @@ export interface SignalOption<Response = any> extends InitOption, TimerOption {
41
47
  sso?: SSOType;
42
48
  serverMode?: "federation" | "batch" | "all";
43
49
  timeout?: number;
44
- partial?: (keyof Response)[] | readonly (keyof Response)[];
50
+ partial?: _Key[] | readonly _Key[];
45
51
  cache?: number;
46
52
  scheduleType?: "init" | "destroy" | "cron" | "interval" | "timeout";
47
53
  scheduleCron?: string;
@@ -50,14 +56,14 @@ export interface SignalOption<Response = any> extends InitOption, TimerOption {
50
56
  enabled?: boolean;
51
57
  }
52
58
  export interface ResolveFieldMeta {
53
- returns: ReturnType;
59
+ returns: GqlReturn;
54
60
  argsOption: ArgsOption;
55
61
  key: string;
56
62
  descriptor: PropertyDescriptor;
57
63
  }
58
64
  export declare const signalTypes: readonly ["graphql", "restapi"];
59
65
  export type SignalType = (typeof signalTypes)[number];
60
- export declare const endpointTypes: readonly ["Query", "Mutation", "Message", "Pubsub", "Process", "Schedule"];
66
+ export declare const endpointTypes: readonly ["Query", "Mutation", "Message", "Pubsub", "Process", "Schedule", "ResolveField"];
61
67
  export type EndpointType = (typeof endpointTypes)[number];
62
68
  export declare const guardTypes: readonly ["Public", "None", "User", "Admin", "SuperAdmin", "Every", "Owner"];
63
69
  export type GuardType = (typeof guardTypes)[number];
@@ -69,7 +75,7 @@ export declare const internalArgTypes: readonly ["Account", "Me", "Self", "UserI
69
75
  export type InternalArgType = (typeof internalArgTypes)[number];
70
76
  export interface GqlMeta {
71
77
  returns: (of?: any) => Type;
72
- signalOption: SignalOption;
78
+ signalOption: SignalOption<any, any, any>;
73
79
  key: string;
74
80
  descriptor: PropertyDescriptor;
75
81
  guards: GuardType[];
@@ -78,11 +84,11 @@ export interface GqlMeta {
78
84
  export interface ArgsOption {
79
85
  nullable?: boolean;
80
86
  example?: string | number | boolean | Dayjs;
81
- enum?: Enum<string | number>;
87
+ enum?: Enum;
82
88
  }
83
89
  export interface ArgMeta {
84
90
  name: string;
85
- returns: ReturnType;
91
+ returns: GqlReturn;
86
92
  argsOption: ArgsOption;
87
93
  key: string;
88
94
  idx: number;
@@ -102,17 +108,14 @@ export interface SliceMeta {
102
108
  argLength: number;
103
109
  defaultArgs: any[];
104
110
  }
111
+ export declare const getDefaultArg: (argRef: Type | Type[]) => object;
105
112
  export interface SignalMeta {
106
113
  refName: string;
107
114
  slices: SliceMeta[];
108
115
  returns?: (of?: any) => Type;
109
116
  prefix?: string;
117
+ enabled: boolean;
110
118
  }
111
- interface SignalDecoratorInput {
112
- name: string;
113
- prefix?: string;
114
- }
115
- export declare function Signal(returnsOrObj: (() => Type) | SignalDecoratorInput): (target: Type) => void;
116
119
  export declare const createArgMetaDecorator: (type: InternalArgType) => (option?: {
117
120
  nullable?: boolean;
118
121
  }) => (prototype: object, key: string, idx: number) => void;
@@ -212,7 +215,7 @@ export declare const Job: (option?: {
212
215
  export type Job = {
213
216
  __InternalArg__: "Job";
214
217
  } & BullJob;
215
- type Guard = <Response extends SingleFieldType>(returns: ReturnType<Response>, signalOption?: SignalOption<UnType<Response>>, guards?: GuardType[]) => MethodDecorator;
218
+ type Guard = <Response extends SingleFieldType>(returns: GqlReturn<Response>, signalOption?: SignalOption<UnType<Response>>, guards?: GuardType[]) => MethodDecorator;
216
219
  export declare const Query: {
217
220
  Public: Guard;
218
221
  Every: Guard;
@@ -261,20 +264,57 @@ export declare const Schedule: {
261
264
  Timeout: (timeout: number, options?: TimerOption) => MethodDecorator;
262
265
  Destroy: (options?: InitOption) => MethodDecorator;
263
266
  };
264
- export declare function ResolveField(returns: ReturnType, argsOption?: ArgsOption): (target: any, key: string, descriptor: PropertyDescriptor) => void;
267
+ export declare function ResolveField(returns: GqlReturn, argsOption?: ArgsOption): (target: any, key: string, descriptor: PropertyDescriptor) => void;
265
268
  export declare const Arg: {
266
- Body: (name: string, returns: ReturnType, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
267
- Param: (name: string, returns: ReturnType, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
268
- Query: (name: string, returns: ReturnType, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
269
- Upload: (name: string, returns: ReturnType, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
270
- Msg: (name: string, returns: ReturnType, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
271
- Room: (name: string, returns: ReturnType, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
269
+ Body: (name: string, returns: GqlReturn, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
270
+ Param: (name: string, returns: GqlReturn, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
271
+ Query: (name: string, returns: GqlReturn, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
272
+ Upload: (name: string, returns: GqlReturn, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
273
+ Msg: (name: string, returns: GqlReturn, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
274
+ Room: (name: string, returns: GqlReturn, argsOption?: ArgsOption) => (prototype: object, key: string, idx: number) => void;
272
275
  };
273
276
  export declare function Parent(): (prototype: object, key: string, idx: number) => void;
274
- export declare function LogSignal<Srv>(srv: Srv): Type<{ [K in keyof Srv as K extends string ? Uncapitalize<K> : never]: Srv[K]; }>;
275
- type UnType<Class> = Class extends Type<infer T> ? T : never;
276
- export type DefaultSignal<T extends string, Input, Full, Light, Insight, Filter extends FilterType, _CapitalizedT extends string = Capitalize<T>, _DocInput = DocumentModel<Input>, _QueryOfDoc = QueryOf<DocumentModel<Full>>, _Sort = SortOf<Filter>> = DefaultSignalWithQuerySort<T, Input, Full, Light, Insight, Filter, _CapitalizedT, _DocInput, _QueryOfDoc, _Sort>;
277
- type DefaultSignalWithQuerySort<T extends string, Input, Full, Light, Insight, Filter, _CapitalizedT extends string = Capitalize<T>, _DocInput = DocumentModel<Input>, _QueryOfDoc = QueryOf<DocumentModel<Full>>, _Sort = SortOf<Filter>> = {
277
+ interface SigOptionV2 {
278
+ guards?: {
279
+ get: GuardType;
280
+ cru: GuardType;
281
+ };
282
+ prefix?: string;
283
+ }
284
+ type ExtendedGqlReturn<Return, Input, Full, Light, Insight> = Full extends Return ? Full : Full[] extends Return ? Full[] : Light extends Return ? Light : Light[] extends Return ? Light[] : Insight extends Return ? Insight : Return;
285
+ type ExtendSignals<Input, Full, Light, Insight, LibSignals extends Type[], _Endpoints = MergeAllActionTypes<LibSignals>> = {
286
+ [K in keyof _Endpoints as _Endpoints[K] extends (...args: any) => any ? K : never]: _Endpoints[K] extends (...args: infer Args) => Promise<infer Return & {
287
+ __Returns__?: infer Rts;
288
+ }> ? (...args: Args) => Promise<ExtendedGqlReturn<Return, Input, Full, Light, Insight> & (Rts extends unknown ? unknown : {
289
+ __Returns__: Rts;
290
+ })> : _Endpoints[K] extends (...args: infer Args) => infer Return & {
291
+ __Returns__?: infer Rts;
292
+ } ? (...args: Args) => ExtendedGqlReturn<Return, Input, Full, Light, Insight> & (Rts extends unknown ? unknown : {
293
+ __Returns__: Rts;
294
+ }) : never;
295
+ };
296
+ export interface SrvOption<T extends string, Srv extends {
297
+ [key: string]: Type;
298
+ }, Input = never, Full = never, Light = never, Insight = never> {
299
+ ref: T;
300
+ srv: Srv;
301
+ cnst?: ConstantModel<T, Input, Full, Light, Insight>;
302
+ }
303
+ export declare function internal<Srv extends {
304
+ [key: string]: any;
305
+ }, Full, InternalBuilder extends InternalApiBuilder<Srv, Doc<Full>>, LibInternals extends Type[]>(srv: ServiceModule<string, Srv, any, Full, any, any>, internalBuilder: InternalBuilder, ...libInternals: LibInternals): Type<BuildInternalApiSignal<InternalBuilder> & ExtendSignals<any, Full, any, any, LibInternals>>;
306
+ export declare function slice<T extends string, Input, Full extends BaseObject & {
307
+ status: string;
308
+ }, Light extends BaseObject, Insight extends {
309
+ count: number;
310
+ }, Srv extends {
311
+ [key: string]: any;
312
+ }, SliceBuilder extends SliceApiBuilder<Full, Light, Insight, Srv>, LibSlices extends Type[]>(srv: ServiceModule<T, Srv, Input, Full, Light, Insight>, option: SigOptionV2, sliceBuilder: SliceBuilder, ...libSlices: LibSlices): Type<BuildSliceSignal<T, SliceBuilder, Full, Light, Insight> & ExtendSignals<Input, Full, Light, Insight, LibSlices>>;
313
+ export declare function endpoint<Input, Full, Light, Insight, Srv extends {
314
+ [key: string]: any;
315
+ }, Builder extends ApiBuilder<Srv>, LibSignals extends Type[]>(srv: ServiceModule<string, Srv, Input, Full, Light, Insight>, builder: Builder, ...libSignals: LibSignals): Type<BuildApiSignal<Builder> & ExtendSignals<Input, Full, Light, Insight, LibSignals>>;
316
+ export declare const mergeSignals: <Endpoint, Internal, Slice = unknown>(signalRef: Type<Endpoint>, internalRef: Type<Internal>, sliceRef?: Type<Slice>) => Type<Endpoint & Internal & Slice>;
317
+ export type DefaultSignal<T extends string, Input, Full, Light, Insight, Filter extends FilterType, _CapitalizedT extends string = Capitalize<T>, _PurifiedInput = PurifiedModel<Input>, _QueryOfDoc = QueryOf<DocumentModel<Full>>, _Sort = SortOf<Filter>> = {
278
318
  [K in T]: (id: string) => Promise<Full>;
279
319
  } & {
280
320
  [K in `light${_CapitalizedT}`]: (id: string) => Promise<Light>;
@@ -283,32 +323,21 @@ type DefaultSignalWithQuerySort<T extends string, Input, Full, Light, Insight, F
283
323
  } & {
284
324
  [K in `${T}Insight`]: (query: _QueryOfDoc) => Promise<Insight>;
285
325
  } & {
286
- [K in `${T}Exists`]: (query: _QueryOfDoc) => Promise<boolean>;
287
- } & {
288
- [K in `create${_CapitalizedT}`]: (data: _DocInput, account: Account) => Promise<Full>;
326
+ [K in `create${_CapitalizedT}`]: (data: _PurifiedInput, account: Account) => Promise<Full>;
289
327
  } & {
290
- [K in `update${_CapitalizedT}`]: (id: string, data: _DocInput, account: Account) => Promise<Full>;
328
+ [K in `update${_CapitalizedT}`]: (id: string, data: _PurifiedInput, account: Account) => Promise<Full>;
291
329
  } & {
292
330
  [K in `remove${_CapitalizedT}`]: (id: string, account: Account) => Promise<Full>;
293
331
  };
294
- export declare function DbSignal<Srv>(constant: ConstantModel<string, any, BaseObject & {
295
- status: string;
296
- }, BaseObject, {
297
- count: number;
298
- }, any>, srv: Srv, option: {
299
- guards: {
300
- get: Guard;
301
- cru: Guard;
302
- };
303
- omit?: ("get" | "list" | "insight" | "exist" | "create" | "update" | "remove")[];
304
- }): Type<{ [K in keyof Srv as K extends string ? Uncapitalize<K> : never]: Srv[K]; }>;
305
332
  export declare const getSigMeta: (sigRef: Type) => SignalMeta;
333
+ export declare const setSigMeta: (sigRef: Type, sigMeta: SignalMeta) => void;
306
334
  export declare const getGqlMeta: (sigRef: Type, key: string) => GqlMeta;
307
335
  export declare const getGqlMetaMapOnPrototype: (prototype: object) => Map<string, GqlMeta>;
308
336
  export declare const getGqlMetas: (sigRef: Type) => GqlMeta[];
309
337
  export declare const setGqlMetaMapOnPrototype: (prototype: object, gqlMetaMap: Map<string, GqlMeta>) => void;
310
338
  export declare const getArgMetas: (sigRef: Type, key: string) => [ArgMeta[], InternalArgMeta[]];
311
339
  export declare const setArgMetas: (sigRef: Type, key: string, argMetas: ArgMeta[], internalArgMetas: InternalArgMeta[]) => void;
340
+ export declare const getResolveFieldMetaMapOnPrototype: (prototype: object) => Map<string, ResolveFieldMeta>;
312
341
  export declare const getResolveFieldMetas: (sigRef: Type) => ResolveFieldMeta[];
313
342
  export declare const getControllerPrefix: (sigMeta: SignalMeta) => string | undefined;
314
343
  export declare const getControllerPath: (gqlMeta: GqlMeta, paramArgMetas: ArgMeta[]) => string;
@@ -0,0 +1,78 @@
1
+ import { GqlScalarName, Type } from "@akanjs/base";
2
+ import { ArgsOption, ArgType, SignalOption, SliceMeta } from "./signalDecorators";
3
+ export declare const signalInfo: {
4
+ database: Map<string, Type>;
5
+ service: Map<string, Type>;
6
+ serializedSignals: SerializedSignal[];
7
+ setDatabase(refName: string, signal: Type): void;
8
+ getDatabase(refName: string): Type | undefined;
9
+ setRefNameTemp(sigRef: Type, refName: string): void;
10
+ getRefNameTemp(sigRef: Type): string;
11
+ setPrefixTemp(sigRef: Type, prefix: string): void;
12
+ getPrefixTemp(sigRef: Type): string | undefined;
13
+ setHandlerKey(execFn: (...args: any) => any, key: string): void;
14
+ getHandlerKey(execFn: (...args: any) => any): string;
15
+ setService(refName: string, signal: Type): void;
16
+ getService(refName: string): Type | undefined;
17
+ registerSignals<Signals extends Type[]>(...signals: Signals): Signals;
18
+ serialize(sigRef: Type): SerializedSignal;
19
+ initialize(): object;
20
+ buildFetch(signals?: SerializedSignal[], cnstInfo?: {
21
+ database: Map<string, import("@akanjs/constant").ConstantModel<any, any, any, any, any, any, import("@akanjs/constant").DefaultOf<any>, import("@akanjs/constant").DefaultOf<any>, import("@akanjs/base").GetStateObject<any>, import("@akanjs/base").GetStateObject<any>, import("@akanjs/constant").DefaultOf<any>, any, any, any, import("mongoose").FilterQuery<any>>>;
22
+ scalar: Map<string, import("@akanjs/constant").ScalarConstantModel<any, any, any, any, any>>;
23
+ modelRefNameMap: Map<Type, string>;
24
+ getRefName<AllowEmpty extends boolean = false>(modelRef: Type, { allowEmpty }?: {
25
+ allowEmpty?: AllowEmpty;
26
+ }): AllowEmpty extends true ? string | undefined : string;
27
+ getModelType<AllowEmpty extends boolean = false>(modelRef: Type, { allowEmpty }?: {
28
+ allowEmpty?: AllowEmpty;
29
+ }): AllowEmpty extends true ? import("@akanjs/constant").ModelType | undefined : import("@akanjs/constant").ModelType;
30
+ setModelType(modelRef: Type, modelType: import("@akanjs/constant").ModelType): void;
31
+ isObject(modelRef: Type): boolean;
32
+ isFull(modelRef: Type): boolean;
33
+ isLight(modelRef: Type): boolean;
34
+ isInsight(modelRef: Type): boolean;
35
+ isFilter(modelRef: Type): boolean;
36
+ isScalar(modelRef: Type): boolean;
37
+ setDatabase(refName: string, cnst: import("@akanjs/constant").ConstantModel<any, any, any, any, any, any>): void;
38
+ getDatabase<AllowEmpty extends boolean = false>(refName: string, { allowEmpty }?: {
39
+ allowEmpty?: AllowEmpty;
40
+ }): AllowEmpty extends true ? import("@akanjs/constant").ConstantModel<any, any, any, any, any, any> | undefined : import("@akanjs/constant").ConstantModel<any, any, any, any, any, any>;
41
+ setScalar(refName: string, cnst: import("@akanjs/constant").ScalarConstantModel<any, any, any, any, any>): void;
42
+ getScalar<AllowEmpty extends boolean = false>(refName: string, { allowEmpty }?: {
43
+ allowEmpty?: AllowEmpty;
44
+ }): AllowEmpty extends true ? import("@akanjs/constant").ScalarConstantModel<any, any, any, any, any> | undefined : import("@akanjs/constant").ScalarConstantModel<any, any, any, any, any>;
45
+ getModelRef(refName: string, modelType: "input" | "full" | "light" | "insight" | "scalar"): Type | import("@akanjs/base").GqlScalar;
46
+ }): object;
47
+ registerClient: (cnst: any) => Promise<{
48
+ fetch: typeof fetch;
49
+ signals: SerializedSignal[];
50
+ }>;
51
+ };
52
+ export interface SerializedReturns {
53
+ refName: Exclude<GqlScalarName, "Map" | "Upload"> | (string & {});
54
+ modelType: "input" | "full" | "light" | "insight" | "scalar";
55
+ arrDepth: number;
56
+ }
57
+ export interface SerializedArg {
58
+ type: ArgType;
59
+ refName: Exclude<GqlScalarName, "Map"> | (string & {});
60
+ modelType: "input" | "insight" | "scalar";
61
+ name: string;
62
+ argsOption: ArgsOption;
63
+ arrDepth: number;
64
+ }
65
+ export interface SerializedEndpoint {
66
+ type: "query" | "mutation" | "pubsub" | "message";
67
+ signalOption?: SignalOption<any, any, any>;
68
+ returns: SerializedReturns;
69
+ args: SerializedArg[];
70
+ }
71
+ export interface SerializedSignal {
72
+ refName: string;
73
+ slices: SliceMeta[];
74
+ prefix?: string;
75
+ endpoint: {
76
+ [key: string]: SerializedEndpoint;
77
+ };
78
+ }