akanjs 2.3.9-rc.0 → 2.3.9-rc.2
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/constant/fieldInfo.ts
CHANGED
|
@@ -26,7 +26,8 @@ export type ParamFieldType =
|
|
|
26
26
|
})
|
|
27
27
|
| EnumInstance<string, any>;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
type ConstantFieldEnumType = EnumInstance<string, any>;
|
|
30
|
+
export type ConstantFieldType = typeof PrimitiveScalar | ConstantModelRef | MapConstructor | ConstantFieldEnumType;
|
|
30
31
|
export type ConstantFieldTypeInput =
|
|
31
32
|
| ConstantFieldType
|
|
32
33
|
| ConstantFieldType[]
|
package/package.json
CHANGED
package/signal/endpointInfo.ts
CHANGED
|
@@ -344,10 +344,22 @@ export type BuildEndpoint<SrvModule extends ServiceModel = ServiceModel> = {
|
|
|
344
344
|
};
|
|
345
345
|
|
|
346
346
|
export const buildEndpoint = {
|
|
347
|
-
query:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
347
|
+
query: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(
|
|
348
|
+
returnRef: Returns,
|
|
349
|
+
signalOption?: SignalOption<Returns, Nullable>,
|
|
350
|
+
) => new EndpointInfo("query", returnRef, signalOption),
|
|
351
|
+
mutation: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(
|
|
352
|
+
returnRef: Returns,
|
|
353
|
+
signalOption?: SignalOption<Returns, Nullable>,
|
|
354
|
+
) => new EndpointInfo("mutation", returnRef, signalOption),
|
|
355
|
+
pubsub: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(
|
|
356
|
+
returnRef: Returns,
|
|
357
|
+
signalOption?: SignalOption<Returns, Nullable>,
|
|
358
|
+
) => new EndpointInfo("pubsub", returnRef, signalOption),
|
|
359
|
+
message: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(
|
|
360
|
+
returnRef: Returns,
|
|
361
|
+
signalOption?: SignalOption<Returns, Nullable>,
|
|
362
|
+
) => new EndpointInfo("message", returnRef, signalOption),
|
|
351
363
|
} as unknown as BuildEndpoint<any>;
|
|
352
364
|
|
|
353
365
|
export type EndpointBuilder<SrvModule extends ServiceModel = ServiceModel> = (builder: BuildEndpoint<SrvModule>) => {
|
package/signal/internalInfo.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Any, type
|
|
1
|
+
import { Any, type FIELD_META, type PromiseOrObject } from "akanjs/base";
|
|
2
2
|
import type {
|
|
3
3
|
ConstantCls,
|
|
4
4
|
ConstantField,
|
|
@@ -209,7 +209,10 @@ export type InternalBuilder<
|
|
|
209
209
|
} & { [key: string]: InternalInfo<InternalType> };
|
|
210
210
|
|
|
211
211
|
export const buildInternal = {
|
|
212
|
-
resolveField:
|
|
212
|
+
resolveField: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(
|
|
213
|
+
returnRef: Returns,
|
|
214
|
+
signalOption?: Pick<SignalOption<Returns, Nullable>, "nullable">,
|
|
215
|
+
) =>
|
|
213
216
|
new InternalInfo("resolveField", returnRef, signalOption),
|
|
214
217
|
interval: (scheduleTime: number, signalOption?: SignalOption) =>
|
|
215
218
|
new InternalInfo("interval", Any, {
|
|
@@ -248,7 +251,10 @@ export const buildInternal = {
|
|
|
248
251
|
scheduleType: "destroy",
|
|
249
252
|
...signalOption,
|
|
250
253
|
}),
|
|
251
|
-
process:
|
|
254
|
+
process: <Returns extends ConstantFieldTypeInput, Nullable extends boolean = false>(
|
|
255
|
+
returnRef: Returns,
|
|
256
|
+
signalOption?: SignalOption<Returns, Nullable>,
|
|
257
|
+
) =>
|
|
252
258
|
new InternalInfo("process", returnRef, {
|
|
253
259
|
serverMode: "all",
|
|
254
260
|
...signalOption,
|
|
@@ -4,7 +4,8 @@ import type { ConstantModelRef } from "./via.d.ts";
|
|
|
4
4
|
export type ParamFieldType = (typeof PrimitiveScalar & {
|
|
5
5
|
[CLIENT_VALUE]: string | number | boolean | Dayjs;
|
|
6
6
|
}) | EnumInstance<string, any>;
|
|
7
|
-
|
|
7
|
+
type ConstantFieldEnumType = EnumInstance<string, any>;
|
|
8
|
+
export type ConstantFieldType = typeof PrimitiveScalar | ConstantModelRef | MapConstructor | ConstantFieldEnumType;
|
|
8
9
|
export type ConstantFieldTypeInput = ConstantFieldType | ConstantFieldType[] | ConstantFieldType[][] | ConstantFieldType[][][];
|
|
9
10
|
export type FieldToValue<Field, MapValue = any> = Field extends null ? FieldToValue<Exclude<Field, null>> | null : Field extends MapConstructor ? Map<string, FieldToValue<MapValue>> : Field extends (infer F)[] ? FieldToValue<F>[] : Field extends typeof PrimitiveScalar | StringConstructor | BooleanConstructor | DateConstructor ? Field[typeof SERVER_VALUE] : Field extends ConstantModelRef ? UnCls<Field> : Field extends {
|
|
10
11
|
[SERVER_VALUE]: infer V;
|