@cloudbase/manager-node 5.5.0 → 5.5.2-beta.0

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.
@@ -64,7 +64,8 @@ class DatabaseService {
64
64
  }
65
65
  async createCollection(collectionName) {
66
66
  let { Tag } = this.getDatabaseConfig();
67
- const res = await this.collOpService.request('CreateTable', {
67
+ const res = await this.dbOpService.request('CreateTable', {
68
+ EnvId: this.envId,
68
69
  Tag,
69
70
  TableName: collectionName
70
71
  });
@@ -75,7 +76,8 @@ class DatabaseService {
75
76
  const existRes = await this.checkCollectionExists(collectionName);
76
77
  if (existRes.Exists) {
77
78
  let { Tag } = this.getDatabaseConfig();
78
- const res = await this.collOpService.request('DeleteTable', {
79
+ const res = await this.dbOpService.request('DeleteTable', {
80
+ EnvId: this.envId,
79
81
  Tag,
80
82
  TableName: collectionName
81
83
  });
@@ -87,12 +89,13 @@ class DatabaseService {
87
89
  }
88
90
  async updateCollection(collectionName, indexiesInfo) {
89
91
  let { Tag } = this.getDatabaseConfig();
90
- const res = await this.collOpService.request('UpdateTable', Object.assign({ Tag, TableName: collectionName }, indexiesInfo));
92
+ const res = await this.dbOpService.request('UpdateTable', Object.assign({ EnvId: this.envId, Tag, TableName: collectionName }, indexiesInfo));
91
93
  return res;
92
94
  }
93
95
  async describeCollection(collectionName) {
94
96
  let { Tag } = this.getDatabaseConfig();
95
- return this.collOpService.request('DescribeTable', {
97
+ return this.dbOpService.request('DescribeTable', {
98
+ EnvId: this.envId,
96
99
  Tag,
97
100
  TableName: collectionName
98
101
  });
@@ -109,7 +112,7 @@ class DatabaseService {
109
112
  if (options.MgoOffset === undefined) {
110
113
  options.MgoOffset = this.DEFAULT_MGO_OFFSET;
111
114
  }
112
- const res = await this.collOpService.request('ListTables', Object.assign({ Tag }, options));
115
+ const res = await this.dbOpService.request('ListTables', Object.assign({ EnvId: this.envId, Tag }, options));
113
116
  if (res.Tables === null) {
114
117
  // 无集合
115
118
  res.Collections = [];
@@ -22,6 +22,7 @@ const cloudApp_1 = require("./cloudApp");
22
22
  const permission_1 = require("./permission");
23
23
  const sandbox_1 = require("./sandbox");
24
24
  const aiModel_1 = require("./aiModel");
25
+ const talosSandbox_1 = require("./talosSandbox");
25
26
  class Environment {
26
27
  constructor(context, envId) {
27
28
  this.inited = false;
@@ -47,6 +48,7 @@ class Environment {
47
48
  this.cloudAppService = new cloudApp_1.CloudAppService(this);
48
49
  this.sandboxService = new sandbox_1.SandboxService(this);
49
50
  this.aiModelService = new aiModel_1.AiModelService(this);
51
+ this.talosSandboxService = new talosSandbox_1.TalosSandboxService(this);
50
52
  }
51
53
  async lazyInit() {
52
54
  if (!this.inited) {
@@ -121,6 +123,9 @@ class Environment {
121
123
  getAiModelService() {
122
124
  return this.aiModelService;
123
125
  }
126
+ getTalosSandboxService() {
127
+ return this.talosSandboxService;
128
+ }
124
129
  getCommonService(serviceType = 'tcb', serviceVersion) {
125
130
  return new common_1.CommonService(this, serviceType, serviceVersion);
126
131
  }
package/lib/index.js CHANGED
@@ -122,6 +122,9 @@ class CloudBase {
122
122
  get aiModel() {
123
123
  return this.currentEnvironment().getAiModelService();
124
124
  }
125
+ get talosSandbox() {
126
+ return this.currentEnvironment().getTalosSandboxService();
127
+ }
125
128
  get docs() {
126
129
  if (!this.docsService) {
127
130
  this.docsService = new docs_1.DocsService();