@dainprotocol/cli 1.0.48 → 1.1.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.
@@ -60,7 +60,7 @@ function deploy(options) {
60
60
  deployPath = "".concat(basePath).concat(START_DEPLOY_URI);
61
61
  _a.label = 1;
62
62
  case 1:
63
- _a.trys.push([1, 7, , 8]);
63
+ _a.trys.push([1, 6, , 7]);
64
64
  return [4 /*yield*/, loadAndValidateEnvVariables()];
65
65
  case 2:
66
66
  envArray = _a.sent();
@@ -81,20 +81,15 @@ function deploy(options) {
81
81
  spinner.succeed('Deployment completed successfully.');
82
82
  spinner.info('You can access logs using `dain logs -w` command.');
83
83
  console.log('-----------------------');
84
- return [4 /*yield*/, fetch(result.service.url, {
85
- method: 'GET',
86
- })];
87
- case 6:
88
- _a.sent();
89
84
  process.exit(0);
90
- return [3 /*break*/, 8];
91
- case 7:
85
+ return [3 /*break*/, 7];
86
+ case 6:
92
87
  error_1 = _a.sent();
93
88
  spinner.fail('Deployment failed.');
94
89
  (0, utils_1.logError)('Error during deployment: ', error_1);
95
90
  process.exit(1);
96
- return [3 /*break*/, 8];
97
- case 8: return [2 /*return*/];
91
+ return [3 /*break*/, 7];
92
+ case 7: return [2 /*return*/];
98
93
  }
99
94
  });
100
95
  });
@@ -222,7 +217,7 @@ var recursiveStatusUntilRunning = function (config, deploymentId) { return __awa
222
217
  if (statusResult.status === 'RUNNING') {
223
218
  return [2 /*return*/];
224
219
  }
225
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 15000); })];
220
+ return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
226
221
  case 2:
227
222
  _a.sent();
228
223
  return [4 /*yield*/, recursiveStatusUntilRunning(config, deploymentId)];
@@ -55,14 +55,14 @@ var ora_1 = __importDefault(require("ora"));
55
55
  var utils_1 = require("../utils");
56
56
  function logs(options_1) {
57
57
  return __awaiter(this, arguments, void 0, function (options, isWatching) {
58
- var config, orgId, _a, apiKey, deploymentId, logsUrl, spinner, result, formatLogs, error_1;
58
+ var config, _a, apiKey, deploymentId, logsUrl, orgId, spinner, result, formatLogs, error_1;
59
59
  if (isWatching === void 0) { isWatching = false; }
60
60
  return __generator(this, function (_b) {
61
61
  switch (_b.label) {
62
62
  case 0:
63
63
  config = (0, utils_1.getDainConfig)(options.config);
64
+ _a = initializeConfig(config), apiKey = _a.apiKey, deploymentId = _a.deploymentId, logsUrl = _a.logsUrl;
64
65
  orgId = 'hackathon';
65
- _a = initializeConfig(config, orgId), apiKey = _a.apiKey, deploymentId = _a.deploymentId, logsUrl = _a.logsUrl;
66
66
  if (!orgId || !deploymentId) {
67
67
  (0, utils_1.logError)('Org ID or deployment ID not found');
68
68
  return [2 /*return*/];
@@ -100,9 +100,10 @@ function logs(options_1) {
100
100
  });
101
101
  });
102
102
  }
103
- var initializeConfig = function (config, orgId) {
103
+ var initializeConfig = function (config) {
104
104
  var baseUrl = config['platform-base-url'] || 'https://codegen-deploy-service.dainapp.com/';
105
105
  var apiKey = config['api-key'];
106
+ var orgId = (0, utils_1.extractOrgId)(apiKey);
106
107
  var deploymentId = config['deployment-id'];
107
108
  var logsUrl = "".concat(baseUrl, "/codegen-deploy/logs/").concat(orgId, "/").concat(deploymentId);
108
109
  return { baseUrl: baseUrl, apiKey: apiKey, orgId: orgId, deploymentId: deploymentId, logsUrl: logsUrl };
package/dist/index.js CHANGED
File without changes
@@ -10,14 +10,14 @@
10
10
  "deploy": "dain deploy"
11
11
  },
12
12
  "dependencies": {
13
- "@dainprotocol/service-sdk": "^1.0.85",
13
+ "@dainprotocol/service-sdk": "^1.0.75",
14
14
  "zod": "^3.23.8",
15
15
  "hono": "^4.6.3",
16
16
  "ts-node": "^10.4.0",
17
17
  "typescript": "^5.5.4",
18
18
  "@types/express": "^4.17.13",
19
19
  "@types/node": "^22.5.4",
20
- "axios": "^1.7.5",
20
+ "axios": "^1.7.5",
21
21
  "@dainprotocol/cli": "^1.0.31"
22
22
  }
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dainprotocol/cli",
3
- "version": "1.0.48",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@ai-sdk/anthropic": "^0.0.50",
24
- "@dainprotocol/service-sdk": "^1.0.85",
24
+ "@dainprotocol/service-sdk": "^1.0.69",
25
25
  "@dainprotocol/tunnel": "^1.0.5",
26
26
  "@types/fs-extra": "^11.0.4",
27
27
  "@types/localtunnel": "^2.0.4",
@@ -43,4 +43,4 @@
43
43
  "ts-node": "^10.9.2",
44
44
  "typescript": "^5.5.4"
45
45
  }
46
- }
46
+ }
@@ -10,14 +10,14 @@
10
10
  "deploy": "dain deploy"
11
11
  },
12
12
  "dependencies": {
13
- "@dainprotocol/service-sdk": "^1.0.85",
13
+ "@dainprotocol/service-sdk": "^1.0.75",
14
14
  "zod": "^3.23.8",
15
15
  "hono": "^4.6.3",
16
16
  "ts-node": "^10.4.0",
17
17
  "typescript": "^5.5.4",
18
18
  "@types/express": "^4.17.13",
19
19
  "@types/node": "^22.5.4",
20
- "axios": "^1.7.5",
20
+ "axios": "^1.7.5",
21
21
  "@dainprotocol/cli": "^1.0.31"
22
22
  }
23
23
  }