@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.
Files changed (2) hide show
  1. package/lib/utils/dts.js +18 -9
  2. 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 { type DataModelMethods } from "@cloudbase/wx-cloud-client-sdk";
27
+ import { DataModelMethods } from "@cloudbase/wx-cloud-client-sdk";
28
28
  ${dtsList.map((item) => item.dts).join('\n')}
29
- declare module "@cloudbase/wx-cloud-client-sdk" {
30
- interface OrmClient {
31
- ${dtsList
29
+
30
+ interface IModels {
31
+ ${dtsList
32
32
  .map((item) => {
33
33
  return `
34
- /**
35
- * 数据模型:${item.title}
36
- */
37
- ${item.name}: DataModelMethods<${getModelInterfaceName(item.name)}>;`;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cli",
3
- "version": "2.5.1-alpha.0",
3
+ "version": "2.5.1-alpha.1",
4
4
  "description": "cli tool for cloudbase",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {