@akanjs/signal 0.9.51 → 0.9.52

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.
@@ -226,7 +226,8 @@ const databaseFetchOf = (signal, option = {}) => {
226
226
  initModel: `init${className}`,
227
227
  getModelInit: `get${className}Init`,
228
228
  addModelFiles: `add${className}Files`,
229
- addFiles: `addFiles`
229
+ addFiles: `addFiles`,
230
+ modelSortKeys: `${fieldName}SortKeys`
230
231
  };
231
232
  const fetch = serviceFetchOf(signal);
232
233
  const util = {
@@ -281,7 +282,8 @@ const databaseFetchOf = (signal, option = {}) => {
281
282
  [names.getModelEdit]: async (id, option2) => {
282
283
  const modelEdit = await global.builtFetch[names.editModel](id, option2);
283
284
  return modelEdit[names.modelEdit];
284
- }
285
+ },
286
+ [names.modelSortKeys]: signal.filter?.sortKeys
285
287
  };
286
288
  const sliceUtil = Object.fromEntries(
287
289
  signal.slices.reduce((acc, { sliceName, argLength, defaultArgs }) => {
@@ -23,6 +23,7 @@ module.exports = __toCommonJS(signalInfo_exports);
23
23
  var import_base = require("@akanjs/base");
24
24
  var import_common = require("@akanjs/common");
25
25
  var import_constant = require("@akanjs/constant");
26
+ var import_document = require("@akanjs/document");
26
27
  var import_client = require("./client");
27
28
  var import_fetchInfo = require("./fetchInfo");
28
29
  var import_signalDecorators = require("./signalDecorators");
@@ -124,7 +125,13 @@ const signalInfo = {
124
125
  const refName = signalInfo.getRefNameTemp(sigRef);
125
126
  const { slices, prefix } = (0, import_signalDecorators.getSigMeta)(sigRef);
126
127
  const gqlMetaMap = (0, import_signalDecorators.getGqlMetaMapOnPrototype)(sigRef.prototype);
127
- const serializedSignal = { refName, slices, prefix, endpoint: {} };
128
+ const serializedSignal = {
129
+ refName,
130
+ slices,
131
+ prefix,
132
+ endpoint: {},
133
+ filter: import_document.documentInfo.getSerializedFilter(refName)
134
+ };
128
135
  gqlMetaMap.forEach((gqlMeta, key) => {
129
136
  if (!["Query", "Mutation", "Pubsub", "Message"].includes(gqlMeta.type))
130
137
  return;
@@ -203,7 +203,8 @@ const databaseFetchOf = (signal, option = {}) => {
203
203
  initModel: `init${className}`,
204
204
  getModelInit: `get${className}Init`,
205
205
  addModelFiles: `add${className}Files`,
206
- addFiles: `addFiles`
206
+ addFiles: `addFiles`,
207
+ modelSortKeys: `${fieldName}SortKeys`
207
208
  };
208
209
  const fetch = serviceFetchOf(signal);
209
210
  const util = {
@@ -258,7 +259,8 @@ const databaseFetchOf = (signal, option = {}) => {
258
259
  [names.getModelEdit]: async (id, option2) => {
259
260
  const modelEdit = await global.builtFetch[names.editModel](id, option2);
260
261
  return modelEdit[names.modelEdit];
261
- }
262
+ },
263
+ [names.modelSortKeys]: signal.filter?.sortKeys
262
264
  };
263
265
  const sliceUtil = Object.fromEntries(
264
266
  signal.slices.reduce((acc, { sliceName, argLength, defaultArgs }) => {
@@ -1,6 +1,7 @@
1
1
  import { baseClientEnv, getNonArrayModel, scalarNameMap } from "@akanjs/base";
2
2
  import { lowerlize } from "@akanjs/common";
3
3
  import { constantInfo } from "@akanjs/constant";
4
+ import { documentInfo } from "@akanjs/document";
4
5
  import { client } from "./client";
5
6
  import { databaseFetchOf, serviceFetchOf } from "./fetchInfo";
6
7
  import {
@@ -110,7 +111,13 @@ const signalInfo = {
110
111
  const refName = signalInfo.getRefNameTemp(sigRef);
111
112
  const { slices, prefix } = getSigMeta(sigRef);
112
113
  const gqlMetaMap = getGqlMetaMapOnPrototype(sigRef.prototype);
113
- const serializedSignal = { refName, slices, prefix, endpoint: {} };
114
+ const serializedSignal = {
115
+ refName,
116
+ slices,
117
+ prefix,
118
+ endpoint: {},
119
+ filter: documentInfo.getSerializedFilter(refName)
120
+ };
114
121
  gqlMetaMap.forEach((gqlMeta, key) => {
115
122
  if (!["Query", "Mutation", "Pubsub", "Message"].includes(gqlMeta.type))
116
123
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/signal",
3
- "version": "0.9.51",
3
+ "version": "0.9.52",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/gql.d.ts CHANGED
@@ -77,6 +77,8 @@ type BasicMethods<T extends string, Input, Full, Light extends {
77
77
  [K in `add${_CapitalizedT}Files`]: (fileList: FileList, parentId?: string, option?: FetchPolicy) => Promise<ProtoFile[]>;
78
78
  } & {
79
79
  [K in `merge${_CapitalizedT}`]: (modelOrId: Full | string, data: Partial<DocumentModel<Input>>, option?: FetchPolicy) => Promise<Full>;
80
+ } & {
81
+ [K in `${T}SortKeys`]?: string[];
80
82
  };
81
83
  type ViewEditMethods<T extends string, Full, _CapitalizedT extends string = Capitalize<T>> = {
82
84
  [K in `view${_CapitalizedT}`]: (id: string, option?: FetchPolicy) => Promise<ViewReturn<T, Full>>;
@@ -68,6 +68,12 @@ export interface SerializedEndpoint {
68
68
  returns: SerializedReturns;
69
69
  args: SerializedArg[];
70
70
  }
71
+ export interface SerializedFilter {
72
+ filter: {
73
+ [key: string]: SerializedArg[];
74
+ };
75
+ sortKeys: string[];
76
+ }
71
77
  export interface SerializedSignal {
72
78
  refName: string;
73
79
  slices: SliceMeta[];
@@ -75,4 +81,5 @@ export interface SerializedSignal {
75
81
  endpoint: {
76
82
  [key: string]: SerializedEndpoint;
77
83
  };
84
+ filter?: SerializedFilter;
78
85
  }