@cloudbase/cli 2.5.1-alpha.0 → 2.5.1-alpha.1
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/lib/utils/dts.js +18 -9
- package/package.json +1 -1
package/lib/utils/dts.js
CHANGED
|
@@ -24,19 +24,28 @@ function generateDataModelDTS(dataModelList) {
|
|
|
24
24
|
};
|
|
25
25
|
})));
|
|
26
26
|
const result = `
|
|
27
|
-
import {
|
|
27
|
+
import { DataModelMethods } from "@cloudbase/wx-cloud-client-sdk";
|
|
28
28
|
${dtsList.map((item) => item.dts).join('\n')}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
|
|
30
|
+
interface IModels {
|
|
31
|
+
${dtsList
|
|
32
32
|
.map((item) => {
|
|
33
33
|
return `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/**
|
|
35
|
+
* 数据模型:${item.title}
|
|
36
|
+
*/
|
|
37
|
+
${item.name}: DataModelMethods<${getModelInterfaceName(item.name)}>;`;
|
|
38
38
|
})
|
|
39
|
-
.join('\n')}
|
|
39
|
+
.join('\n')}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module "@cloudbase/wx-cloud-client-sdk" {
|
|
43
|
+
interface OrmClient extends IModels {}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare global {
|
|
47
|
+
interface WxCloud {
|
|
48
|
+
models: IModels;
|
|
40
49
|
}
|
|
41
50
|
}`;
|
|
42
51
|
return result;
|