@intuned/runtime-dev 1.0.6-cli.8.0.7 → 1.0.6-cli.8.0.9

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.
@@ -13,6 +13,7 @@ _dotenv.default.config({
13
13
  _commander.program.description("Deploy an Intuned project to be public").argument("[project-name]", "Name of the project to deploy").option("-w, --workspace-id <id>", "Your Intuned workspace ID").option("-k, --api-key <key>", "Your Intuned API key").action(async (projectName, options) => {
14
14
  try {
15
15
  const _projectName = projectName || (await (0, _utils2.getSettingIntunedJSON)("projectName"));
16
+ console.log("Project name: ", _projectName);
16
17
  if (!_projectName) {
17
18
  throw new Error("Project name is required");
18
19
  }
@@ -168,24 +168,26 @@ async function deployProject(projectName, auth) {
168
168
  if (!response.ok) {
169
169
  throw new Error(`Error deploying project`);
170
170
  }
171
- const data = await response.json();
172
- if (!data) {
173
- throw new Error("Project not deployed");
174
- }
175
171
  const startTime = Date.now();
176
- const checkInterval = setInterval(async () => {
177
- const status = await checkIntunedProjectDeployStatus(workspaceId, projectName, apiKey);
178
- if (status === "completed" || status === "failed" || status === "not_found") {
179
- clearInterval(checkInterval);
180
- return status === "completed";
181
- }
182
- const elapsedTime = Date.now() - startTime;
183
- if (elapsedTime > _constants.PROJECT_DEPLOY_TIMEOUT) {
184
- clearInterval(checkInterval);
185
- throw new Error(`Deployment timed out after ${Math.floor(_constants.PROJECT_DEPLOY_TIMEOUT / 1000 / 60)} minutes`);
186
- }
187
- }, 5000);
188
- return false;
172
+ return new Promise((resolve, reject) => {
173
+ const checkInterval = setInterval(async () => {
174
+ try {
175
+ const status = await checkIntunedProjectDeployStatus(workspaceId, projectName, apiKey);
176
+ if (status === "completed" || status === "failed" || status === "not_found") {
177
+ clearInterval(checkInterval);
178
+ resolve(status === "completed");
179
+ }
180
+ const elapsedTime = Date.now() - startTime;
181
+ if (elapsedTime > _constants.PROJECT_DEPLOY_TIMEOUT) {
182
+ clearInterval(checkInterval);
183
+ reject(new Error(`Deployment timed out after ${Math.floor(_constants.PROJECT_DEPLOY_TIMEOUT / 1000 / 60)} minutes`));
184
+ }
185
+ } catch (error) {
186
+ clearInterval(checkInterval);
187
+ reject(error);
188
+ }
189
+ }, 5000);
190
+ });
189
191
  }
190
192
  const validateProjectName = projectName => {
191
193
  const nameSchema = _zod.z.string().min(1, "Project Name is required").max(50, "Name must be 50 characters or less").regex(/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/, "Name can only contain lowercase letters, numbers, hyphens, and underscores in between").refine(value => !_zod.z.string().uuid().safeParse(value).success, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.0.6-cli.8.0.7",
3
+ "version": "1.0.6-cli.8.0.9",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",