@dainprotocol/cli 1.1.0 → 1.1.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.
@@ -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, 6, , 7]);
63
+ _a.trys.push([1, 7, , 8]);
64
64
  return [4 /*yield*/, loadAndValidateEnvVariables()];
65
65
  case 2:
66
66
  envArray = _a.sent();
@@ -81,15 +81,20 @@ 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
- process.exit(0);
85
- return [3 /*break*/, 7];
84
+ return [4 /*yield*/, fetch(result.service.url, {
85
+ method: 'GET',
86
+ })];
86
87
  case 6:
88
+ _a.sent();
89
+ process.exit(0);
90
+ return [3 /*break*/, 8];
91
+ case 7:
87
92
  error_1 = _a.sent();
88
93
  spinner.fail('Deployment failed.');
89
94
  (0, utils_1.logError)('Error during deployment: ', error_1);
90
95
  process.exit(1);
91
- return [3 /*break*/, 7];
92
- case 7: return [2 /*return*/];
96
+ return [3 /*break*/, 8];
97
+ case 8: return [2 /*return*/];
93
98
  }
94
99
  });
95
100
  });
@@ -217,7 +222,7 @@ var recursiveStatusUntilRunning = function (config, deploymentId) { return __awa
217
222
  if (statusResult.status === 'RUNNING') {
218
223
  return [2 /*return*/];
219
224
  }
220
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
225
+ return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 15000); })];
221
226
  case 2:
222
227
  _a.sent();
223
228
  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, _a, apiKey, deploymentId, logsUrl, orgId, spinner, result, formatLogs, error_1;
58
+ var config, orgId, _a, apiKey, deploymentId, logsUrl, 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;
65
64
  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,10 +100,9 @@ function logs(options_1) {
100
100
  });
101
101
  });
102
102
  }
103
- var initializeConfig = function (config) {
103
+ var initializeConfig = function (config, orgId) {
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);
107
106
  var deploymentId = config['deployment-id'];
108
107
  var logsUrl = "".concat(baseUrl, "/codegen-deploy/logs/").concat(orgId, "/").concat(deploymentId);
109
108
  return { baseUrl: baseUrl, apiKey: apiKey, orgId: orgId, deploymentId: deploymentId, logsUrl: logsUrl };
@@ -10,14 +10,14 @@
10
10
  "deploy": "dain deploy"
11
11
  },
12
12
  "dependencies": {
13
- "@dainprotocol/service-sdk": "^1.0.75",
13
+ "@dainprotocol/service-sdk": "^1.0.85",
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.1.0",
3
+ "version": "1.1.1",
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.69",
24
+ "@dainprotocol/service-sdk": "^1.0.85",
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.75",
13
+ "@dainprotocol/service-sdk": "^1.0.85",
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
  }