@cosmoner/sdk 1.20.0 → 1.21.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.
@@ -49,7 +49,7 @@ export interface DeploymentPreviews {
49
49
  export interface DeploymentService {
50
50
  name: string;
51
51
  /** Defaulted to `service` when the file does not say. */
52
- type: "service" | "static";
52
+ type: "service" | "static" | "worker";
53
53
  source_dir?: string;
54
54
  build?: DeploymentBuild;
55
55
  run_command?: string;
package/dist/index.js CHANGED
@@ -1784,7 +1784,7 @@ function sleep(ms) {
1784
1784
  }
1785
1785
 
1786
1786
  // src/version.ts
1787
- var VERSION = "1.20.0";
1787
+ var VERSION = "1.21.0";
1788
1788
  var USER_AGENT = `cosmoner-node/${VERSION}`;
1789
1789
 
1790
1790
  // src/transport.ts
@@ -1984,7 +1984,7 @@ var SERVICE_FIELDS = {
1984
1984
  pattern: /^[a-z0-9][a-z0-9-]*$/,
1985
1985
  patternMessage: "Service names must be lowercase letters, numbers, or hyphens, and start with a letter or number"
1986
1986
  },
1987
- type: { kind: "string", enum: ["service", "static"], default: "service" },
1987
+ type: { kind: "string", enum: ["service", "static", "worker"], default: "service" },
1988
1988
  source_dir: { kind: "string", maxLength: 512 },
1989
1989
  build: { kind: "object", fields: BUILD_FIELDS },
1990
1990
  run_command: { kind: "string", maxLength: 1024 },
@@ -2183,6 +2183,17 @@ function checkService(service, _raw, path, issues) {
2183
2183
  "port does not apply to a static site \u2014 the platform serves it"
2184
2184
  );
2185
2185
  }
2186
+ if (service.type === "worker") {
2187
+ for (const key of ["port", "http_port", "internal_port"]) {
2188
+ if (service[key] !== void 0) {
2189
+ issues.error([...path, key], `${key} does not apply to a worker \u2014 nothing connects to it`);
2190
+ }
2191
+ }
2192
+ const previews = isMapping(service.previews) ? service.previews : void 0;
2193
+ if (previews?.enabled === true) {
2194
+ issues.error([...path, "previews"], "Workers have no previews \u2014 a preview is a URL to open");
2195
+ }
2196
+ }
2186
2197
  const legacyPorts = ["http_port", "internal_port"].filter(
2187
2198
  (key) => service[key] !== void 0
2188
2199
  );
package/dist/index.mjs CHANGED
@@ -1709,7 +1709,7 @@ function sleep(ms) {
1709
1709
  }
1710
1710
 
1711
1711
  // src/version.ts
1712
- var VERSION = "1.20.0";
1712
+ var VERSION = "1.21.0";
1713
1713
  var USER_AGENT = `cosmoner-node/${VERSION}`;
1714
1714
 
1715
1715
  // src/transport.ts
@@ -1909,7 +1909,7 @@ var SERVICE_FIELDS = {
1909
1909
  pattern: /^[a-z0-9][a-z0-9-]*$/,
1910
1910
  patternMessage: "Service names must be lowercase letters, numbers, or hyphens, and start with a letter or number"
1911
1911
  },
1912
- type: { kind: "string", enum: ["service", "static"], default: "service" },
1912
+ type: { kind: "string", enum: ["service", "static", "worker"], default: "service" },
1913
1913
  source_dir: { kind: "string", maxLength: 512 },
1914
1914
  build: { kind: "object", fields: BUILD_FIELDS },
1915
1915
  run_command: { kind: "string", maxLength: 1024 },
@@ -2108,6 +2108,17 @@ function checkService(service, _raw, path, issues) {
2108
2108
  "port does not apply to a static site \u2014 the platform serves it"
2109
2109
  );
2110
2110
  }
2111
+ if (service.type === "worker") {
2112
+ for (const key of ["port", "http_port", "internal_port"]) {
2113
+ if (service[key] !== void 0) {
2114
+ issues.error([...path, key], `${key} does not apply to a worker \u2014 nothing connects to it`);
2115
+ }
2116
+ }
2117
+ const previews = isMapping(service.previews) ? service.previews : void 0;
2118
+ if (previews?.enabled === true) {
2119
+ issues.error([...path, "previews"], "Workers have no previews \u2014 a preview is a URL to open");
2120
+ }
2121
+ }
2111
2122
  const legacyPorts = ["http_port", "internal_port"].filter(
2112
2123
  (key) => service[key] !== void 0
2113
2124
  );
@@ -126,7 +126,7 @@ export interface CreateAppDraftParams extends ProjectScopedParams {
126
126
  size: string;
127
127
  /** A region slug from `client.catalog.appRegions()`. */
128
128
  region: string;
129
- appType?: "service" | "static";
129
+ appType?: "service" | "static" | "worker";
130
130
  gitProvider?: "github" | "gitlab" | "bitbucket";
131
131
  /** `owner/repo`. */
132
132
  gitRepo?: string;
package/dist/version.d.ts CHANGED
@@ -8,5 +8,5 @@
8
8
  * the release workflow runs that straight after `npm version`, and
9
9
  * `version.test.ts` fails the build if the two ever disagree.
10
10
  */
11
- export declare const VERSION = "1.20.0";
12
- export declare const USER_AGENT = "cosmoner-node/1.20.0";
11
+ export declare const VERSION = "1.21.0";
12
+ export declare const USER_AGENT = "cosmoner-node/1.21.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmoner/sdk",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Cosmoner SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",