corebasic 1.0.249 → 1.0.251

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.
@@ -84,6 +84,7 @@ export const get = (feature) => {
84
84
  let { api, service = SERVICE_ADDRESS, topic } = baseFeature ? baseFeature : (SLYP_FEATURES_LIST[feature] ?? throwError());
85
85
  return { api, service, topic };
86
86
  };
87
+ // export const send = async <K extends keyof FeatureTypes> (meta: Partial<FeatureMeta>, feature: K, data?: Parameters<FeatureTypes[K]>[0]["data"], params?: FeatureParams): Promise<Awaited<ReturnType<FeatureTypes[K]>>> => {
87
88
  export const send = async (meta, feature, data, params) => {
88
89
  const throwError = () => { throw new Error(`Feature ${feature} not found in internal or external list during inter feature call`); };
89
90
  const baseFeature = getFeature(feature);
@@ -17,6 +17,7 @@ g_this.Types ??= { Remotes: {} };
17
17
  // ================
18
18
  function init(partial) {
19
19
  return {
20
+ _id: "",
20
21
  created: 0,
21
22
  updated: 0,
22
23
  createdBy: "",
package/libs/features.ts CHANGED
@@ -187,8 +187,9 @@ export const get = (feature: string) => {
187
187
  }
188
188
 
189
189
 
190
-
191
- export const send = async <K extends keyof FeatureTypes> (meta: Partial<FeatureMeta>, feature: K, data?: Parameters<FeatureTypes[K]>[0], params?: FeatureParams): Promise<Awaited<ReturnType<FeatureTypes[K]>>> => {
190
+ type HandlerInput<T> = T extends Handler<infer I, any> ? I : never
191
+ // export const send = async <K extends keyof FeatureTypes> (meta: Partial<FeatureMeta>, feature: K, data?: Parameters<FeatureTypes[K]>[0]["data"], params?: FeatureParams): Promise<Awaited<ReturnType<FeatureTypes[K]>>> => {
192
+ export const send = async <K extends keyof FeatureTypes> (meta: Partial<FeatureMeta>, feature: K, data?: HandlerInput<FeatureTypes[K]>, params?: FeatureParams): Promise<Awaited<ReturnType<FeatureTypes[K]>>> => {
192
193
  const throwError = () => {throw new Error(`Feature ${feature} not found in internal or external list during inter feature call`)}
193
194
  const baseFeature: FeatureEntry | undefined = getFeature(feature)
194
195
  let {api, service = SERVICE_ADDRESS} = baseFeature ? baseFeature as FeatureEntry & {service: string} : (SLYP_FEATURES_LIST[feature] ?? throwError())
package/libs/schemas.ts CHANGED
@@ -14,6 +14,7 @@ g_this.Types ??= {Remotes: {}};
14
14
 
15
15
  function init(partial?: Partial<DefaultSchema>): DefaultSchema {
16
16
  return {
17
+ _id: "",
17
18
  created: 0,
18
19
  updated: 0,
19
20
  createdBy: "",
@@ -27,6 +28,7 @@ function init(partial?: Partial<DefaultSchema>): DefaultSchema {
27
28
  }
28
29
  declare global {
29
30
  type DefaultSchema = {
31
+ _id: string
30
32
  created: number
31
33
  updated: number
32
34
  createdBy: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.249",
4
+ "version": "1.0.251",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "./index.ts",