kollab 0.1.26 → 0.1.27

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.
package/dist/index.js CHANGED
@@ -20110,6 +20110,7 @@ function domainOutput(view) {
20110
20110
  records: domainRecords(view),
20111
20111
  nextAction: view?.nextAction ?? (view?.domainStatus === "active" ? view.certificateStatus === "ready" ? "done" : "wait_certificate" : view ? "add_records" : "none"),
20112
20112
  url: view ? `https://${view.domain}` : null,
20113
+ ...view?.warnings ? { warnings: view.warnings, appStatus: view.appStatus } : {},
20113
20114
  certificateStatus: view?.certificateStatus ?? "not_started",
20114
20115
  certificateCheckedAt: view?.certificateCheckedAt ?? null,
20115
20116
  ...view?.errorCode?.startsWith("HOSTED_APP_DOMAIN_OWNERSHIP_") ? { errorCode: view.errorCode, message: domainErrorHint(view.errorCode) } : {}
@@ -20128,6 +20129,7 @@ function domainInstructions(view, recordsOnly = false) {
20128
20129
  ...lines,
20129
20130
  "If your DNS provider offers proxying, choose DNS only. Remove conflicting AAAA records.",
20130
20131
  `Status: ${view.domainStatus}; certificate: ${view.certificateStatus ?? "not_started"}; next: ${domainOutput(view).nextAction}`,
20132
+ ...(view.warnings ?? []).map((warning) => warning.message),
20131
20133
  ...view.errorCode ? [domainErrorHint(view.errorCode)] : [],
20132
20134
  ...view.dnsObserved ? [`Observed: ${view.dnsObserved}`] : []
20133
20135
  ].join("\n");
@@ -20304,6 +20306,15 @@ function withHostedAppSource(result, source) {
20304
20306
  if (!result.ok || typeof result.data !== "object" || result.data === null) return result;
20305
20307
  return { ...result, data: { ...result.data, conversationId: source.conversationId, artifactId: source.artifactId } };
20306
20308
  }
20309
+ function requirePublished(result) {
20310
+ if (!result.ok) return result;
20311
+ const app = result.data;
20312
+ return app?.status === "published" ? result : {
20313
+ ...result,
20314
+ ok: false,
20315
+ error: `${app?.errorCode ?? "HOSTED_APP_NOT_PUBLISHED"}: \u7F51\u7AD9\u5C1A\u672A\u53D1\u5E03\u6210\u529F\uFF08${app?.status ?? "unknown"}\uFF09\uFF0C\u8BF7\u67E5\u770B app info \u540E\u91CD\u65B0\u53D1\u5E03\uFF1B\u4E0D\u8981\u7EE7\u7EED\u7ED1\u5B9A\u57DF\u540D\u3002`
20316
+ };
20317
+ }
20307
20318
  function registerHostedAppCommands(program2) {
20308
20319
  const app = program2.command("app").description("Deploy and manage user Hosted Apps");
20309
20320
  app.addHelpText("after", `
@@ -20321,7 +20332,7 @@ A .zip needs app.manifest.json, or a plain static site with index.html at its ro
20321
20332
  const creds = await requireHostedAppCredentials();
20322
20333
  const source = await resolveHostedAppSource(creds, requireSpaceId(creds), options);
20323
20334
  const result = await api(creds, "POST", "/hosted-apps", source);
20324
- printResult(withHostedAppSource(result, source));
20335
+ printResult(requirePublished(withHostedAppSource(result, source)));
20325
20336
  } catch (error) {
20326
20337
  emitError(error instanceof Error ? error.message : String(error));
20327
20338
  }
@@ -20334,7 +20345,7 @@ A .zip needs app.manifest.json, or a plain static site with index.html at its ro
20334
20345
  if (Boolean(options.conversationId) !== Boolean(options.sourceRoot))
20335
20346
  throw new Error("--conversation-id and --source-root must be used together");
20336
20347
  const rootPath = options.sourceRoot === "." ? "" : options.sourceRoot;
20337
- printResult(await api(
20348
+ printResult(requirePublished(await api(
20338
20349
  creds,
20339
20350
  "POST",
20340
20351
  `/hosted-apps/${encodeURIComponent(options.id)}/update-from-source`,
@@ -20343,13 +20354,13 @@ A .zip needs app.manifest.json, or a plain static site with index.html at its ro
20343
20354
  rootPath,
20344
20355
  kind: /\.html?$/i.test(rootPath ?? "") ? "html" : "directory"
20345
20356
  } : {}
20346
- ));
20357
+ )));
20347
20358
  return;
20348
20359
  }
20349
20360
  if (options.sourceRoot) throw new Error("--source-root requires a Task source update without --file");
20350
20361
  const source = await resolveHostedAppSource(creds, requireSpaceId(creds), { ...options, file: options.file });
20351
20362
  const result = await api(creds, "POST", `/hosted-apps/${encodeURIComponent(options.id)}/deployments`, source);
20352
- printResult(withHostedAppSource(result, source));
20363
+ printResult(requirePublished(withHostedAppSource(result, source)));
20353
20364
  } catch (error) {
20354
20365
  emitError(error instanceof Error ? error.message : String(error));
20355
20366
  }
@@ -20658,8 +20669,8 @@ var fs6 = __toESM(require("fs"));
20658
20669
  var path6 = __toESM(require("path"));
20659
20670
  var UNKNOWN_VERSION = "0.0.0";
20660
20671
  function injectedVersion() {
20661
- if ("0.1.26".length > 0) {
20662
- return "0.1.26";
20672
+ if ("0.1.27".length > 0) {
20673
+ return "0.1.27";
20663
20674
  }
20664
20675
  return null;
20665
20676
  }
@@ -33096,6 +33096,7 @@ function domainOutput(view) {
33096
33096
  records: domainRecords(view),
33097
33097
  nextAction: view?.nextAction ?? (view?.domainStatus === "active" ? view.certificateStatus === "ready" ? "done" : "wait_certificate" : view ? "add_records" : "none"),
33098
33098
  url: view ? `https://${view.domain}` : null,
33099
+ ...view?.warnings ? { warnings: view.warnings, appStatus: view.appStatus } : {},
33099
33100
  certificateStatus: view?.certificateStatus ?? "not_started",
33100
33101
  certificateCheckedAt: view?.certificateCheckedAt ?? null,
33101
33102
  ...view?.errorCode?.startsWith("HOSTED_APP_DOMAIN_OWNERSHIP_") ? { errorCode: view.errorCode, message: domainErrorHint(view.errorCode) } : {}
@@ -33114,6 +33115,7 @@ function domainInstructions(view, recordsOnly = false) {
33114
33115
  ...lines,
33115
33116
  "If your DNS provider offers proxying, choose DNS only. Remove conflicting AAAA records.",
33116
33117
  `Status: ${view.domainStatus}; certificate: ${view.certificateStatus ?? "not_started"}; next: ${domainOutput(view).nextAction}`,
33118
+ ...(view.warnings ?? []).map((warning) => warning.message),
33117
33119
  ...view.errorCode ? [domainErrorHint(view.errorCode)] : [],
33118
33120
  ...view.dnsObserved ? [`Observed: ${view.dnsObserved}`] : []
33119
33121
  ].join("\n");
@@ -33290,6 +33292,15 @@ function withHostedAppSource(result, source) {
33290
33292
  if (!result.ok || typeof result.data !== "object" || result.data === null) return result;
33291
33293
  return { ...result, data: { ...result.data, conversationId: source.conversationId, artifactId: source.artifactId } };
33292
33294
  }
33295
+ function requirePublished(result) {
33296
+ if (!result.ok) return result;
33297
+ const app = result.data;
33298
+ return app?.status === "published" ? result : {
33299
+ ...result,
33300
+ ok: false,
33301
+ error: `${app?.errorCode ?? "HOSTED_APP_NOT_PUBLISHED"}: \u7F51\u7AD9\u5C1A\u672A\u53D1\u5E03\u6210\u529F\uFF08${app?.status ?? "unknown"}\uFF09\uFF0C\u8BF7\u67E5\u770B app info \u540E\u91CD\u65B0\u53D1\u5E03\uFF1B\u4E0D\u8981\u7EE7\u7EED\u7ED1\u5B9A\u57DF\u540D\u3002`
33302
+ };
33303
+ }
33293
33304
  function registerHostedAppCommands(program3) {
33294
33305
  const app = program3.command("app").description("Deploy and manage user Hosted Apps");
33295
33306
  app.addHelpText("after", `
@@ -33307,7 +33318,7 @@ A .zip needs app.manifest.json, or a plain static site with index.html at its ro
33307
33318
  const creds = await requireHostedAppCredentials();
33308
33319
  const source = await resolveHostedAppSource(creds, requireSpaceId(creds), options);
33309
33320
  const result = await api(creds, "POST", "/hosted-apps", source);
33310
- printResult(withHostedAppSource(result, source));
33321
+ printResult(requirePublished(withHostedAppSource(result, source)));
33311
33322
  } catch (error62) {
33312
33323
  emitError(error62 instanceof Error ? error62.message : String(error62));
33313
33324
  }
@@ -33320,7 +33331,7 @@ A .zip needs app.manifest.json, or a plain static site with index.html at its ro
33320
33331
  if (Boolean(options.conversationId) !== Boolean(options.sourceRoot))
33321
33332
  throw new Error("--conversation-id and --source-root must be used together");
33322
33333
  const rootPath = options.sourceRoot === "." ? "" : options.sourceRoot;
33323
- printResult(await api(
33334
+ printResult(requirePublished(await api(
33324
33335
  creds,
33325
33336
  "POST",
33326
33337
  `/hosted-apps/${encodeURIComponent(options.id)}/update-from-source`,
@@ -33329,13 +33340,13 @@ A .zip needs app.manifest.json, or a plain static site with index.html at its ro
33329
33340
  rootPath,
33330
33341
  kind: /\.html?$/i.test(rootPath ?? "") ? "html" : "directory"
33331
33342
  } : {}
33332
- ));
33343
+ )));
33333
33344
  return;
33334
33345
  }
33335
33346
  if (options.sourceRoot) throw new Error("--source-root requires a Task source update without --file");
33336
33347
  const source = await resolveHostedAppSource(creds, requireSpaceId(creds), { ...options, file: options.file });
33337
33348
  const result = await api(creds, "POST", `/hosted-apps/${encodeURIComponent(options.id)}/deployments`, source);
33338
- printResult(withHostedAppSource(result, source));
33349
+ printResult(requirePublished(withHostedAppSource(result, source)));
33339
33350
  } catch (error62) {
33340
33351
  emitError(error62 instanceof Error ? error62.message : String(error62));
33341
33352
  }
@@ -33652,8 +33663,8 @@ var fs6 = __toESM(require("fs"));
33652
33663
  var path6 = __toESM(require("path"));
33653
33664
  var UNKNOWN_VERSION = "0.0.0";
33654
33665
  function injectedVersion() {
33655
- if ("0.1.26".length > 0) {
33656
- return "0.1.26";
33666
+ if ("0.1.27".length > 0) {
33667
+ return "0.1.27";
33657
33668
  }
33658
33669
  return null;
33659
33670
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kollab",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "Kollab workspace CLI",
5
5
  "bin": {
6
6
  "kollab": "dist/index.js"