akanjs 2.3.5-rc.5 → 2.3.5-rc.6

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.
@@ -416,7 +416,18 @@ export type ConstantFetchViewOf<Cnst> = Cnst extends {
416
416
  _StateLight: infer StateLight;
417
417
  _StateInsight: infer StateInsight;
418
418
  }
419
- ? ConstantFetchView<RefName, CapRefName, Input, Full, Light, Insight, PurifiedInput, DefaultInput, StateLight, StateInsight>
419
+ ? ConstantFetchView<
420
+ RefName,
421
+ CapRefName,
422
+ Input,
423
+ Full,
424
+ Light,
425
+ Insight,
426
+ PurifiedInput,
427
+ DefaultInput,
428
+ StateLight,
429
+ StateInsight
430
+ >
420
431
  : never;
421
432
 
422
433
  export interface ScalarConstantModel<
@@ -18,6 +18,9 @@ export type FetchProxySignalInput<
18
18
 
19
19
  export type FetchSignalInput = FetchProxySignalInput | DatabaseSignal | ServiceSignal;
20
20
 
21
+ export type IsAny<Type> = 0 extends 1 & Type ? true : false;
22
+ export type SafeFetchPart<Type, Fallback = unknown> = IsAny<Type> extends true ? Fallback : Type;
23
+
21
24
  type MergeFetchParts<First, Second> = [First] extends [never]
22
25
  ? Second
23
26
  : [Second] extends [never]
@@ -62,15 +62,15 @@ type PubsubSubscribeFn<E, Context> = (
62
62
  ]
63
63
  ) => () => void;
64
64
 
65
- type PrimaryFetchFn<E, Context, ReqType = EndpInfoReqType<E>> =
66
- ReqType extends "query" | "mutation"
67
- ? QueryOrMutationFetchFn<E, Context>
68
- : ReqType extends "message"
69
- ? MessageEmitFn<E, Context>
70
- : never;
65
+ type PrimaryFetchFn<E, Context, ReqType = EndpInfoReqType<E>> = ReqType extends "query" | "mutation"
66
+ ? QueryOrMutationFetchFn<E, Context>
67
+ : ReqType extends "message"
68
+ ? MessageEmitFn<E, Context>
69
+ : never;
71
70
 
72
71
  type UploadLikeArg = FileList | File | File[];
73
- type HasUploadLikeArg<Args extends readonly unknown[]> = Extract<Args[number], UploadLikeArg> extends never ? false : true;
72
+ type HasUploadLikeArg<Args extends readonly unknown[]> =
73
+ Extract<Args[number], UploadLikeArg> extends never ? false : true;
74
74
  type RestApiArg<Arg> = Arg extends FileList ? FileList : Arg extends File | File[] ? FileList : Arg;
75
75
  type RestApiArgs<Args extends readonly unknown[]> = {
76
76
  [K in keyof Args]: RestApiArg<Args[K]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "2.3.5-rc.5",
3
+ "version": "2.3.5-rc.6",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -275,19 +275,7 @@ export type SliceBuilder<
275
275
  > = (
276
276
  init: (
277
277
  signalOption?: SignalOption,
278
- ) => SliceInfo<
279
- _Payload["refName"],
280
- _Input,
281
- _Full,
282
- _Light,
283
- _Insight,
284
- _Filter,
285
- _Payload["srvs"],
286
- [],
287
- [],
288
- [],
289
- []
290
- >,
278
+ ) => SliceInfo<_Payload["refName"], _Input, _Full, _Light, _Insight, _Filter, _Payload["srvs"], [], [], [], []>,
291
279
  ) => {
292
280
  [key: string]: SliceInfo<_Payload["refName"], _Input, _Full, _Light, _Insight, _Filter, _Payload["srvs"]>;
293
281
  };
@@ -12,6 +12,8 @@ export type FetchProxySignalInput<FetchType = unknown, SliceMetaObj extends Reco
12
12
  _SliceMetaObj: SliceMetaObj;
13
13
  };
14
14
  export type FetchSignalInput = FetchProxySignalInput | DatabaseSignal | ServiceSignal;
15
+ export type IsAny<Type> = 0 extends 1 & Type ? true : false;
16
+ export type SafeFetchPart<Type, Fallback = unknown> = IsAny<Type> extends true ? Fallback : Type;
15
17
  type MergeFetchParts<First, Second> = [First] extends [never] ? Second : [Second] extends [never] ? First : Assign<First, Second>;
16
18
  export type FetchTypeOfSignal<Signal extends FetchSignalInput> = Signal extends {
17
19
  _FetchType: infer FetchType;
@@ -58,10 +58,6 @@ export type SlicePayloadOf<SrvModule extends ServiceModel> = ConstantFetchViewOf
58
58
  light: unknown;
59
59
  insight: unknown;
60
60
  } ? SlicePayload<SrvModule["srv"]["refName"], CnstView["input"], CnstView["full"], CnstView["light"], CnstView["insight"], NonNullable<SrvModule["db"]>["_Filter"], SrvModule["srvMap"]> : never;
61
- export type SliceBuilder<SrvModule extends ServiceModel, _Payload extends SlicePayload = SlicePayloadOf<SrvModule>, _Input = _Payload["input"], _Full = _Payload["full"], _Light = _Payload["light"], _Insight = _Payload["insight"], _Filter extends FilterInstance = _Payload["filter"], _Sort = ExtractSort<_Filter>> = (init: (signalOption?: SignalOption) => SliceInfo<_Payload["refName"], _Input, _Full, _Light, _Insight, _Filter, _Payload["srvs"], [
62
- ], [
63
- ], [
64
- ], [
65
- ]>) => {
61
+ export type SliceBuilder<SrvModule extends ServiceModel, _Payload extends SlicePayload = SlicePayloadOf<SrvModule>, _Input = _Payload["input"], _Full = _Payload["full"], _Light = _Payload["light"], _Insight = _Payload["insight"], _Filter extends FilterInstance = _Payload["filter"], _Sort = ExtractSort<_Filter>> = (init: (signalOption?: SignalOption) => SliceInfo<_Payload["refName"], _Input, _Full, _Light, _Insight, _Filter, _Payload["srvs"], [], [], [], []>) => {
66
62
  [key: string]: SliceInfo<_Payload["refName"], _Input, _Full, _Light, _Insight, _Filter, _Payload["srvs"]>;
67
63
  };