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.
- package/dist/libs/features.js +1 -0
- package/dist/libs/schemas.js +1 -0
- package/libs/features.ts +3 -2
- package/libs/schemas.ts +2 -0
- package/package.json +1 -1
package/dist/libs/features.js
CHANGED
|
@@ -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);
|
package/dist/libs/schemas.js
CHANGED
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
|