@amerged/ohmyhost-cli 0.1.13 → 0.1.14

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.
@@ -2209,10 +2209,10 @@ var require_resolve = __commonJS({
2209
2209
  }
2210
2210
  return count;
2211
2211
  }
2212
- function getFullPath(resolver, id2 = "", normalize) {
2212
+ function getFullPath(resolver, id3 = "", normalize) {
2213
2213
  if (normalize !== false)
2214
- id2 = normalizeId(id2);
2215
- const p = resolver.parse(id2);
2214
+ id3 = normalizeId(id3);
2215
+ const p = resolver.parse(id3);
2216
2216
  return _getFullPath(resolver, p);
2217
2217
  }
2218
2218
  exports.getFullPath = getFullPath;
@@ -2222,13 +2222,13 @@ var require_resolve = __commonJS({
2222
2222
  }
2223
2223
  exports._getFullPath = _getFullPath;
2224
2224
  var TRAILING_SLASH_HASH = /#\/?$/;
2225
- function normalizeId(id2) {
2226
- return id2 ? id2.replace(TRAILING_SLASH_HASH, "") : "";
2225
+ function normalizeId(id3) {
2226
+ return id3 ? id3.replace(TRAILING_SLASH_HASH, "") : "";
2227
2227
  }
2228
2228
  exports.normalizeId = normalizeId;
2229
- function resolveUrl(resolver, baseId, id2) {
2230
- id2 = normalizeId(id2);
2231
- return resolver.resolve(baseId, id2);
2229
+ function resolveUrl(resolver, baseId, id3) {
2230
+ id3 = normalizeId(id3);
2231
+ return resolver.resolve(baseId, id3);
2232
2232
  }
2233
2233
  exports.resolveUrl = resolveUrl;
2234
2234
  var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
@@ -2998,8 +2998,8 @@ var require_compile = __commonJS({
2998
2998
  if (Object.keys(root.schema).length > 0 && refPath === baseId) {
2999
2999
  return getJsonPointer.call(this, p, root);
3000
3000
  }
3001
- const id2 = (0, resolve_1.normalizeId)(refPath);
3002
- const schOrRef = this.refs[id2] || this.schemas[id2];
3001
+ const id3 = (0, resolve_1.normalizeId)(refPath);
3002
+ const schOrRef = this.refs[id3] || this.schemas[id3];
3003
3003
  if (typeof schOrRef == "string") {
3004
3004
  const sch = resolveSchema.call(this, root, schOrRef);
3005
3005
  if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
@@ -3010,7 +3010,7 @@ var require_compile = __commonJS({
3010
3010
  return;
3011
3011
  if (!schOrRef.validate)
3012
3012
  compileSchema.call(this, schOrRef);
3013
- if (id2 === (0, resolve_1.normalizeId)(ref)) {
3013
+ if (id3 === (0, resolve_1.normalizeId)(ref)) {
3014
3014
  const { schema } = schOrRef;
3015
3015
  const { schemaId } = this.opts;
3016
3016
  const schId = schema[schemaId];
@@ -3710,7 +3710,7 @@ var require_schemes = __commonJS({
3710
3710
  serialize: httpSerialize
3711
3711
  }
3712
3712
  );
3713
- var https = (
3713
+ var https2 = (
3714
3714
  /** @type {SchemeHandler} */
3715
3715
  {
3716
3716
  scheme: "https",
@@ -3759,7 +3759,7 @@ var require_schemes = __commonJS({
3759
3759
  /** @type {Record<SchemeName, SchemeHandler>} */
3760
3760
  {
3761
3761
  http,
3762
- https,
3762
+ https: https2,
3763
3763
  ws,
3764
3764
  wss,
3765
3765
  urn,
@@ -4425,15 +4425,15 @@ var require_core = __commonJS({
4425
4425
  this.addSchema(sch, void 0, _meta, _validateSchema);
4426
4426
  return this;
4427
4427
  }
4428
- let id2;
4428
+ let id3;
4429
4429
  if (typeof schema === "object") {
4430
4430
  const { schemaId } = this.opts;
4431
- id2 = schema[schemaId];
4432
- if (id2 !== void 0 && typeof id2 != "string") {
4431
+ id3 = schema[schemaId];
4432
+ if (id3 !== void 0 && typeof id3 != "string") {
4433
4433
  throw new Error(`schema ${schemaId} must be string`);
4434
4434
  }
4435
4435
  }
4436
- key = (0, resolve_1.normalizeId)(key || id2);
4436
+ key = (0, resolve_1.normalizeId)(key || id3);
4437
4437
  this._checkUnique(key);
4438
4438
  this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
4439
4439
  return this;
@@ -4512,11 +4512,11 @@ var require_core = __commonJS({
4512
4512
  case "object": {
4513
4513
  const cacheKey = schemaKeyRef;
4514
4514
  this._cache.delete(cacheKey);
4515
- let id2 = schemaKeyRef[this.opts.schemaId];
4516
- if (id2) {
4517
- id2 = (0, resolve_1.normalizeId)(id2);
4518
- delete this.schemas[id2];
4519
- delete this.refs[id2];
4515
+ let id3 = schemaKeyRef[this.opts.schemaId];
4516
+ if (id3) {
4517
+ id3 = (0, resolve_1.normalizeId)(id3);
4518
+ delete this.schemas[id3];
4519
+ delete this.refs[id3];
4520
4520
  }
4521
4521
  return this;
4522
4522
  }
@@ -4623,10 +4623,10 @@ var require_core = __commonJS({
4623
4623
  }
4624
4624
  }
4625
4625
  _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
4626
- let id2;
4626
+ let id3;
4627
4627
  const { schemaId } = this.opts;
4628
4628
  if (typeof schema == "object") {
4629
- id2 = schema[schemaId];
4629
+ id3 = schema[schemaId];
4630
4630
  } else {
4631
4631
  if (this.opts.jtd)
4632
4632
  throw new Error("schema must be object");
@@ -4636,7 +4636,7 @@ var require_core = __commonJS({
4636
4636
  let sch = this._cache.get(schema);
4637
4637
  if (sch !== void 0)
4638
4638
  return sch;
4639
- baseId = (0, resolve_1.normalizeId)(id2 || baseId);
4639
+ baseId = (0, resolve_1.normalizeId)(id3 || baseId);
4640
4640
  const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
4641
4641
  sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });
4642
4642
  this._cache.set(sch.schema, sch);
@@ -4649,9 +4649,9 @@ var require_core = __commonJS({
4649
4649
  this.validateSchema(schema, true);
4650
4650
  return sch;
4651
4651
  }
4652
- _checkUnique(id2) {
4653
- if (this.schemas[id2] || this.refs[id2]) {
4654
- throw new Error(`schema with key or id "${id2}" already exists`);
4652
+ _checkUnique(id3) {
4653
+ if (this.schemas[id3] || this.refs[id3]) {
4654
+ throw new Error(`schema with key or id "${id3}" already exists`);
4655
4655
  }
4656
4656
  }
4657
4657
  _compileSchemaEnv(sch) {
@@ -5016,8 +5016,8 @@ var require_multipleOf = __commonJS({
5016
5016
  const { gen, data, schemaCode, it } = cxt;
5017
5017
  const prec = it.opts.multipleOfPrecision;
5018
5018
  const res = gen.let("res");
5019
- const invalid3 = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
5020
- cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid3}))`);
5019
+ const invalid4 = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
5020
+ cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid4}))`);
5021
5021
  }
5022
5022
  };
5023
5023
  exports.default = def;
@@ -15068,6 +15068,28 @@ var recognizedCommandLabel = (argv) => {
15068
15068
  }
15069
15069
  if (value === "function" && values[0] === "runs")
15070
15070
  return "function runs";
15071
+ if (value === "mail") {
15072
+ if (values[0] === "setup")
15073
+ return "mail setup";
15074
+ if (values[0] === "status")
15075
+ return "mail status";
15076
+ if (values[0] === "webhook") {
15077
+ if (values[1] === "set")
15078
+ return "mail webhook set";
15079
+ if (values[1] === "verify")
15080
+ return "mail webhook verify";
15081
+ if (values[1] === "disable")
15082
+ return "mail webhook disable";
15083
+ }
15084
+ if (values[0] === "messages") {
15085
+ if (values[1] === "list")
15086
+ return "mail messages list";
15087
+ if (values[1] === "get")
15088
+ return "mail messages get";
15089
+ if (values[1] === "retry")
15090
+ return "mail messages retry";
15091
+ }
15092
+ }
15071
15093
  if (value === "mail" && values[0] === "domain") {
15072
15094
  if (values[1] === "set")
15073
15095
  return "mail domain set";
@@ -16104,32 +16126,82 @@ var parseProductCliCommand = (argv) => {
16104
16126
  }
16105
16127
  throw new InvalidCommandError();
16106
16128
  }
16107
- if (first === "mail" && values[0] === "domain" && values[1] === "set") {
16129
+ if (first === "mail") {
16108
16130
  if (yes || wait || follow || stdin)
16109
16131
  throw new InvalidCommandError();
16110
- values.splice(0, 2);
16111
- const options = parseOptions(values, ["--project", "--domain", "--idempotency-key"]);
16112
- if (!/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u.test(options["--domain"])) {
16113
- throw new InvalidCommandError();
16114
- }
16115
- return {
16116
- kind: "mail-domain-set",
16117
- projectId: options["--project"],
16118
- domain: options["--domain"],
16119
- idempotencyKey: options["--idempotency-key"],
16120
- credentialStore
16132
+ const area = values.shift();
16133
+ const sub = area === "webhook" || area === "messages" || area === "domain" ? values.shift() : void 0;
16134
+ const options = parseOptionalOptions(values, [
16135
+ "--project",
16136
+ "--environment",
16137
+ "--domain",
16138
+ "--sending",
16139
+ "--receiving",
16140
+ "--url",
16141
+ "--idempotency-key",
16142
+ "--message",
16143
+ "--after"
16144
+ ]);
16145
+ const required = (key) => {
16146
+ const value = options[key];
16147
+ if (!value)
16148
+ throw new InvalidCommandError();
16149
+ return value;
16121
16150
  };
16122
- }
16123
- if (first === "mail" && values[0] === "domain" && values[1] === "status") {
16124
- if (yes || wait || follow || stdin)
16151
+ const scope = { projectId: required("--project"), environmentId: required("--environment") };
16152
+ let request, label;
16153
+ if (area === "setup" || area === "domain" && sub === "set") {
16154
+ const sending = required("--sending"), receiving = required("--receiving");
16155
+ if (!["true", "false"].includes(sending) || !["true", "false"].includes(receiving))
16156
+ throw new InvalidCommandError();
16157
+ request = {
16158
+ ...scope,
16159
+ action: "configure",
16160
+ domain: required("--domain"),
16161
+ sending: sending === "true",
16162
+ receiving: receiving === "true",
16163
+ idempotencyKey: required("--idempotency-key")
16164
+ };
16165
+ label = area === "domain" ? "mail domain set" : "mail setup";
16166
+ } else if (area === "status" || area === "domain" && sub === "status") {
16167
+ request = { ...scope, action: "status" };
16168
+ label = area === "domain" ? "mail domain status" : "mail status";
16169
+ } else if (area === "webhook" && sub === "set") {
16170
+ request = {
16171
+ ...scope,
16172
+ action: "webhook_set",
16173
+ url: required("--url"),
16174
+ idempotencyKey: required("--idempotency-key")
16175
+ };
16176
+ label = "mail webhook set";
16177
+ } else if (area === "webhook" && (sub === "verify" || sub === "disable")) {
16178
+ request = {
16179
+ ...scope,
16180
+ action: sub === "verify" ? "webhook_verify" : "webhook_disable",
16181
+ idempotencyKey: required("--idempotency-key")
16182
+ };
16183
+ label = sub === "verify" ? "mail webhook verify" : "mail webhook disable";
16184
+ } else if (area === "messages" && sub === "list") {
16185
+ request = {
16186
+ ...scope,
16187
+ action: "messages_list",
16188
+ ...options["--after"] ? { after: options["--after"] } : {}
16189
+ };
16190
+ label = "mail messages list";
16191
+ } else if (area === "messages" && sub === "get") {
16192
+ request = { ...scope, action: "message_get", messageId: required("--message") };
16193
+ label = "mail messages get";
16194
+ } else if (area === "messages" && sub === "retry") {
16195
+ request = {
16196
+ ...scope,
16197
+ action: "message_retry",
16198
+ messageId: required("--message"),
16199
+ idempotencyKey: required("--idempotency-key")
16200
+ };
16201
+ label = "mail messages retry";
16202
+ } else
16125
16203
  throw new InvalidCommandError();
16126
- values.splice(0, 2);
16127
- const options = parseOptions(values, ["--project"]);
16128
- return {
16129
- kind: "mail-domain-status",
16130
- projectId: options["--project"],
16131
- credentialStore
16132
- };
16204
+ return { kind: "managed-mail", request, label, credentialStore };
16133
16205
  }
16134
16206
  throw new InvalidCommandError();
16135
16207
  };
@@ -16320,12 +16392,12 @@ function classifyFrameworkVersion(framework, version2) {
16320
16392
  return VERIFIED_VERSIONS[framework].has(version2) ? versionAdmission("verified", "verified_fixture") : versionAdmission("experimental", "inside_admitted_window");
16321
16393
  }
16322
16394
  function parseVersionSpec(version2) {
16323
- const exact3 = EXACT_VERSION.exec(version2);
16324
- const match = exact3 ?? (/^[~^](.*)$/u.exec(version2)?.[1] ? EXACT_VERSION.exec(version2.slice(1)) : null);
16395
+ const exact4 = EXACT_VERSION.exec(version2);
16396
+ const match = exact4 ?? (/^[~^](.*)$/u.exec(version2)?.[1] ? EXACT_VERSION.exec(version2.slice(1)) : null);
16325
16397
  if (match === null)
16326
16398
  return null;
16327
16399
  const tuple = [Number(match[1]), Number(match[2]), Number(match[3])];
16328
- return tuple.every(Number.isSafeInteger) ? Object.freeze({ exact: exact3 !== null, version: tuple }) : null;
16400
+ return tuple.every(Number.isSafeInteger) ? Object.freeze({ exact: exact4 !== null, version: tuple }) : null;
16329
16401
  }
16330
16402
  function insideAdmittedWindow(framework, version2) {
16331
16403
  switch (framework) {
@@ -16349,8 +16421,8 @@ function versionAdmission(classification, reason) {
16349
16421
  }
16350
16422
  var FRAMEWORK_CONVERSION_DETAILS = Object.freeze({
16351
16423
  database_binding_private: Object.freeze({
16352
- render: (path) => `"${path}" reads a managed database connection string. Hyperdrive, DATABASE_URL and postgres:// URLs never reach a customer Worker; call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database". Commit the change, then plan again.`,
16353
- pattern: /^"([^"]+)" reads a managed database connection string\. Hyperdrive, DATABASE_URL and postgres:\/\/ URLs never reach a customer Worker; call the database with createPrivateDatabaseClient from "@ohmyhost\/customer-runtime\/database"\. Commit the change, then plan again\.$/u
16424
+ render: (path) => `"${path}" reads a managed database connection string. HYPERDRIVE is retired; DATABASE_URL and postgres:// URLs never reach a customer Worker. Call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database". Commit the change, then plan again.`,
16425
+ pattern: /^"([^"]+)" reads a managed database connection string\. HYPERDRIVE is retired; DATABASE_URL and postgres:\/\/ URLs never reach a customer Worker\. Call the database with createPrivateDatabaseClient from "@ohmyhost\/customer-runtime\/database"\. Commit the change, then plan again\.$/u
16354
16426
  }),
16355
16427
  database_driver_unsupported: Object.freeze({
16356
16428
  render: (path) => `"${path}" imports a PostgreSQL socket driver. Outbound connect() is disabled for customer Workers, so it can never open a connection; call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database". Commit the change, then plan again.`,
@@ -16955,7 +17027,7 @@ var parsePaidDomain = (value) => {
16955
17027
  ]);
16956
17028
  const status = input["status"];
16957
17029
  const hostname = input["hostname"];
16958
- const records = input["validation_records"];
17030
+ const records2 = input["validation_records"];
16959
17031
  if (![
16960
17032
  "not_configured",
16961
17033
  "pending",
@@ -16968,7 +17040,7 @@ var parsePaidDomain = (value) => {
16968
17040
  "paid_plan_required",
16969
17041
  "insufficient_organization_credits",
16970
17042
  "project_budget_exceeded"
16971
- ].includes(input["suspension_reason"]) || status === "suspended" !== (input["suspension_reason"] !== null) || status === "suspended" && input["url"] !== null || input["environment"] !== "prod" || !isSaasCnameTarget(input["cname_target"]) || hostname !== null && !isPaidHostname(hostname) || input["custom_hostname_status"] !== null && typeof input["custom_hostname_status"] !== "string" || input["ssl_status"] !== null && typeof input["ssl_status"] !== "string" || !Array.isArray(records) || records.length > 16 || !records.every(isPaidValidationRecord) || input["url"] !== null && input["url"] !== `https://${String(hostname)}`) {
17043
+ ].includes(input["suspension_reason"]) || status === "suspended" !== (input["suspension_reason"] !== null) || status === "suspended" && input["url"] !== null || input["environment"] !== "prod" || !isSaasCnameTarget(input["cname_target"]) || hostname !== null && !isPaidHostname(hostname) || input["custom_hostname_status"] !== null && typeof input["custom_hostname_status"] !== "string" || input["ssl_status"] !== null && typeof input["ssl_status"] !== "string" || !Array.isArray(records2) || records2.length > 16 || !records2.every(isPaidValidationRecord) || input["url"] !== null && input["url"] !== `https://${String(hostname)}`) {
16972
17044
  throw new ResponseContractError();
16973
17045
  }
16974
17046
  return input;
@@ -17295,10 +17367,10 @@ var parseProjectStatus = (value) => {
17295
17367
  const ids = /* @__PURE__ */ new Set(), names = /* @__PURE__ */ new Set();
17296
17368
  for (const raw of environments) {
17297
17369
  const environment = exactRecord2(raw, ["id", "name"]);
17298
- const id2 = environment["id"], name = environment["name"];
17299
- if (!isUlid(id2) || name !== "dev" && name !== "prod" || ids.has(id2) || names.has(name))
17370
+ const id3 = environment["id"], name = environment["name"];
17371
+ if (!isUlid(id3) || name !== "dev" && name !== "prod" || ids.has(id3) || names.has(name))
17300
17372
  throw new ResponseContractError();
17301
- ids.add(id2);
17373
+ ids.add(id3);
17302
17374
  names.add(name);
17303
17375
  }
17304
17376
  }
@@ -17442,45 +17514,6 @@ var parseEnvironmentSecretDeletion = (value) => {
17442
17514
  function validDelivery(input) {
17443
17515
  return Number.isSafeInteger(input["desired_generation"]) && Number(input["desired_generation"]) >= 0 && Number.isSafeInteger(input["applied_generation"]) && Number(input["applied_generation"]) >= 0 && Number(input["applied_generation"]) <= Number(input["desired_generation"]) && ["not_deployed", "pending", "ready", "failed"].includes(String(input["delivery_state"])) && (input["runtime_provider"] === null || input["runtime_provider"] === "wfp") && Number.isSafeInteger(input["applied_secret_count"]) && Number(input["applied_secret_count"]) >= 0 && Number(input["applied_secret_count"]) <= 100 && (input["last_error"] === null || typeof input["last_error"] === "string" && /^[A-Z][A-Z0-9_]{0,63}$/u.test(input["last_error"]));
17444
17516
  }
17445
- var parseProjectMailDomain = (value) => {
17446
- const input = exactRecord2(value, [
17447
- "domain",
17448
- "status",
17449
- "configured_at",
17450
- "name_servers",
17451
- "change_id",
17452
- "observed_at",
17453
- "verification_issue",
17454
- "next_check_after_seconds"
17455
- ]);
17456
- if (typeof input["domain"] !== "string" || !/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u.test(input["domain"]) || !isIsoInstant(input["configured_at"])) {
17457
- throw new ResponseContractError();
17458
- }
17459
- if (input["status"] === "configured") {
17460
- if (input["name_servers"] !== void 0 || input["change_id"] !== void 0 || input["observed_at"] !== void 0 || input["verification_issue"] !== void 0 || input["next_check_after_seconds"] !== void 0) {
17461
- throw new ResponseContractError();
17462
- }
17463
- return input;
17464
- }
17465
- if (!["delegation_required", "ready", "verification_pending", "verification_failed"].includes(String(input["status"])) || !Array.isArray(input["name_servers"]) || input["name_servers"].length !== 4 || new Set(input["name_servers"]).size !== 4 || input["name_servers"].some((nameServer) => typeof nameServer !== "string" || !/^ns-[0-9]{1,4}\.awsdns-[0-9]{1,2}\.(?:com|net|org|co\.uk)$/u.test(nameServer)) || typeof input["change_id"] !== "string" || !/^C[A-Z0-9]{8,31}$/u.test(input["change_id"])) {
17466
- throw new ResponseContractError();
17467
- }
17468
- if (input["observed_at"] !== void 0) {
17469
- if (![
17470
- null,
17471
- "identity_missing",
17472
- "identity_verification_failed",
17473
- "dkim_verification_failed",
17474
- "dkim_records_changed",
17475
- "tenant_association_missing"
17476
- ].includes(input["verification_issue"]))
17477
- throw new ResponseContractError();
17478
- if (!isIsoInstant(input["observed_at"]) || input["next_check_after_seconds"] !== (input["status"] === "ready" ? null : 3600))
17479
- throw new ResponseContractError();
17480
- } else if (input["next_check_after_seconds"] !== void 0 || input["verification_issue"] !== void 0 || ["verification_pending", "verification_failed"].includes(String(input["status"])))
17481
- throw new ResponseContractError();
17482
- return input;
17483
- };
17484
17517
  var parseDeploymentPlan = (value) => {
17485
17518
  const input = exactRecord2(value, [
17486
17519
  "id",
@@ -17611,15 +17644,15 @@ var parseOperation = (value) => {
17611
17644
  "reconciliation",
17612
17645
  "progress"
17613
17646
  ]);
17614
- const id2 = input["id"];
17647
+ const id3 = input["id"];
17615
17648
  const state = input["state"];
17616
17649
  const createdAt = input["created_at"];
17617
17650
  const updatedAt = input["updated_at"];
17618
17651
  const result = input["result"];
17619
17652
  const blockingOperationId = input["blocking_operation_id"];
17620
- if (blockingOperationId !== void 0 && (state !== "queued" || !isUlid(blockingOperationId) || blockingOperationId === id2))
17653
+ if (blockingOperationId !== void 0 && (state !== "queued" || !isUlid(blockingOperationId) || blockingOperationId === id3))
17621
17654
  throw new ResponseContractError();
17622
- if (!isUlid(id2) || !isOperationState(state) || !isIsoInstant(createdAt) || !isIsoInstant(updatedAt) || result !== void 0 && !isRecord(result)) {
17655
+ if (!isUlid(id3) || !isOperationState(state) || !isIsoInstant(createdAt) || !isIsoInstant(updatedAt) || result !== void 0 && !isRecord(result)) {
17623
17656
  throw new ResponseContractError();
17624
17657
  }
17625
17658
  let progress;
@@ -17659,7 +17692,7 @@ var parseOperation = (value) => {
17659
17692
  throw new ResponseContractError();
17660
17693
  }
17661
17694
  return {
17662
- id: id2,
17695
+ id: id3,
17663
17696
  state,
17664
17697
  created_at: createdAt,
17665
17698
  updated_at: updatedAt,
@@ -17866,7 +17899,7 @@ function exact2(v, keys) {
17866
17899
  // apps/product-cli/package.json
17867
17900
  var package_default = {
17868
17901
  name: "@ohmyhost/product-cli",
17869
- version: "0.1.13",
17902
+ version: "0.1.14",
17870
17903
  private: true,
17871
17904
  ohmyhost: {
17872
17905
  deployment: "production",
@@ -18263,8 +18296,16 @@ var HELP_USAGE = Object.freeze({
18263
18296
  "function runs": "ohmyhost function runs --project ULID --environment ENVIRONMENT_ULID [--limit 1-100] --json",
18264
18297
  "secret set": `printf '%s' "$SECRET_VALUE" | ohmyhost secret set NAME --project ULID --environment ENVIRONMENT_ULID --idempotency-key KEY --stdin [--wait] --json`,
18265
18298
  "secret delete": "ohmyhost secret delete NAME --project ULID --environment ENVIRONMENT_ULID --idempotency-key KEY [--wait] --json",
18266
- "mail domain set": "ohmyhost mail domain set --project ULID --domain DOMAIN --idempotency-key KEY --json",
18267
- "mail domain status": "ohmyhost mail domain status --project ULID --json"
18299
+ "mail setup": "ohmyhost mail setup --project ULID --environment ULID --domain DOMAIN --sending true --receiving false --idempotency-key KEY --json",
18300
+ "mail status": "ohmyhost mail status --project ULID --environment ULID --json",
18301
+ "mail webhook set": "ohmyhost mail webhook set --project ULID --environment ULID --url HTTPS_URL --idempotency-key KEY --json",
18302
+ "mail webhook verify": "ohmyhost mail webhook verify --project ULID --environment ULID --idempotency-key KEY --json",
18303
+ "mail webhook disable": "ohmyhost mail webhook disable --project ULID --environment ULID --idempotency-key KEY --json",
18304
+ "mail messages list": "ohmyhost mail messages list --project ULID --environment ULID [--after ULID] --json",
18305
+ "mail messages get": "ohmyhost mail messages get --project ULID --environment ULID --message ULID --json",
18306
+ "mail messages retry": "ohmyhost mail messages retry --project ULID --environment ULID --message ULID --idempotency-key KEY --json",
18307
+ "mail domain set": "ohmyhost mail domain set --project ULID --environment ULID --domain DOMAIN --sending true --receiving false --idempotency-key KEY --json",
18308
+ "mail domain status": "ohmyhost mail domain status --project ULID --environment ULID --json"
18268
18309
  });
18269
18310
  var HELP_COMMANDS = Object.freeze(Object.entries(HELP_USAGE).map(([command, usage]) => Object.freeze({ command, usage })));
18270
18311
  var cliMetadataResult = (kind, topic) => kind === "help" ? success("help", {
@@ -18642,10 +18683,12 @@ var ProductCli = class {
18642
18683
  return await this.listFunctionRuns(command, signal);
18643
18684
  if (command.kind === "secret-set")
18644
18685
  return await this.putEnvironmentSecret(command, signal);
18645
- if (command.kind === "mail-domain-set")
18646
- return await this.configureMailDomain(command, signal);
18647
- if (command.kind === "mail-domain-status")
18648
- return await this.getMailDomain(command, signal);
18686
+ if (command.kind === "managed-mail") {
18687
+ const api = await this.authenticatedApi(command.credentialStore, signal);
18688
+ if (!api.managedMail)
18689
+ throw new Error("Mail unavailable");
18690
+ return success(command.label, { mail: await api.managedMail(command.request) });
18691
+ }
18649
18692
  return await this.deleteEnvironmentSecret(command, signal);
18650
18693
  } catch (error) {
18651
18694
  if (error instanceof UserTokenFileError)
@@ -18979,26 +19022,26 @@ var ProductCli = class {
18979
19022
  }
18980
19023
  async applyPaidDomain(command, signal) {
18981
19024
  const api = await this.authenticatedApi(command.credentialStore, signal);
18982
- const domain = parsePaidDomain(await api.applyPaidDomain({
19025
+ const domain2 = parsePaidDomain(await api.applyPaidDomain({
18983
19026
  projectId: command.projectId,
18984
19027
  hostname: command.hostname,
18985
19028
  idempotencyKey: command.idempotencyKey
18986
19029
  }));
18987
- return success("domain paid apply", { status: domain.status, domain });
19030
+ return success("domain paid apply", { status: domain2.status, domain: domain2 });
18988
19031
  }
18989
19032
  async getPaidDomain(command, signal) {
18990
19033
  const api = await this.authenticatedApi(command.credentialStore, signal);
18991
- const domain = parsePaidDomain(await api.getPaidDomain(command.projectId));
18992
- return success("domain paid status", { status: domain.status, domain });
19034
+ const domain2 = parsePaidDomain(await api.getPaidDomain(command.projectId));
19035
+ return success("domain paid status", { status: domain2.status, domain: domain2 });
18993
19036
  }
18994
19037
  async deletePaidDomain(command, signal) {
18995
19038
  const api = await this.authenticatedApi(command.credentialStore, signal);
18996
- const domain = parsePaidDomain(await api.deletePaidDomain({
19039
+ const domain2 = parsePaidDomain(await api.deletePaidDomain({
18997
19040
  projectId: command.projectId,
18998
19041
  hostname: command.hostname,
18999
19042
  idempotencyKey: command.idempotencyKey
19000
19043
  }));
19001
- return success("domain paid delete", { status: domain.status, domain });
19044
+ return success("domain paid delete", { status: domain2.status, domain: domain2 });
19002
19045
  }
19003
19046
  async linkSource(command, signal) {
19004
19047
  const api = await this.authenticatedApi(command.credentialStore, signal);
@@ -19218,20 +19261,6 @@ var ProductCli = class {
19218
19261
  }
19219
19262
  throw new ProductCliFailure(8, "secret_delivery_wait_timeout", true, "Run 'ohmyhost secret list --json' to inspect delivery metadata.");
19220
19263
  }
19221
- async configureMailDomain(command, signal) {
19222
- const api = await this.authenticatedApi(command.credentialStore, signal);
19223
- const mailDomain = parseProjectMailDomain(await api.configureMailDomain({
19224
- projectId: command.projectId,
19225
- domain: command.domain,
19226
- idempotencyKey: command.idempotencyKey
19227
- }));
19228
- return success("mail domain set", { status: mailDomain.status, mail_domain: mailDomain });
19229
- }
19230
- async getMailDomain(command, signal) {
19231
- const api = await this.authenticatedApi(command.credentialStore, signal);
19232
- const mailDomain = parseProjectMailDomain(await api.getMailDomain(command.projectId));
19233
- return success("mail domain status", { status: mailDomain.status, mail_domain: mailDomain });
19234
- }
19235
19264
  async waitForOperation(api, initial, signal) {
19236
19265
  let operation = initial;
19237
19266
  for (let attempt = 0; attempt < 120 && (operation.state === "queued" || operation.state === "running") && operation.reconciliation?.state !== "required"; attempt += 1) {
@@ -19520,10 +19549,8 @@ var parsedCommandName = (command) => {
19520
19549
  return "secret set";
19521
19550
  if (command.kind === "secret-delete")
19522
19551
  return "secret delete";
19523
- if (command.kind === "mail-domain-set")
19524
- return "mail domain set";
19525
- if (command.kind === "mail-domain-status")
19526
- return "mail domain status";
19552
+ if (command.kind === "managed-mail")
19553
+ return command.label;
19527
19554
  return command.kind;
19528
19555
  };
19529
19556
  var boundedSignal = (parent, timeoutMs) => AbortSignal.any([parent, AbortSignal.timeout(timeoutMs)]);
@@ -19626,17 +19653,6 @@ var diagnosticDescriptor = (error, signal) => {
19626
19653
  return { category: "internal", subsystem: "runtime", errorKind: "unexpected" };
19627
19654
  };
19628
19655
 
19629
- // packages/contracts/dist/feedback.js
19630
- var identifier = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;
19631
- function parseFeedbackReceipt(value) {
19632
- if (typeof value !== "object" || value === null || Array.isArray(value))
19633
- throw new TypeError("Feedback was not acknowledged");
19634
- const v = value;
19635
- if (Object.keys(v).sort().join(",") !== "id,organization_id,submitted_at" || typeof v["id"] !== "string" || !identifier.test(v["id"]) || typeof v["organization_id"] !== "string" || !identifier.test(v["organization_id"]) || typeof v["submitted_at"] !== "string" || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u.test(v["submitted_at"]) || !Number.isFinite(Date.parse(v["submitted_at"])) || new Date(v["submitted_at"]).toISOString() !== v["submitted_at"])
19636
- throw new TypeError("Feedback was not acknowledged");
19637
- return v;
19638
- }
19639
-
19640
19656
  // packages/sdk-ts/dist/generated/core/bodySerializer.gen.js
19641
19657
  var jsonBodySerializer = {
19642
19658
  bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
@@ -20219,27 +20235,27 @@ var Interceptors = class {
20219
20235
  clear() {
20220
20236
  this.fns = [];
20221
20237
  }
20222
- eject(id2) {
20223
- const index = this.getInterceptorIndex(id2);
20238
+ eject(id3) {
20239
+ const index = this.getInterceptorIndex(id3);
20224
20240
  if (this.fns[index]) {
20225
20241
  this.fns[index] = null;
20226
20242
  }
20227
20243
  }
20228
- exists(id2) {
20229
- const index = this.getInterceptorIndex(id2);
20244
+ exists(id3) {
20245
+ const index = this.getInterceptorIndex(id3);
20230
20246
  return Boolean(this.fns[index]);
20231
20247
  }
20232
- getInterceptorIndex(id2) {
20233
- if (typeof id2 === "number") {
20234
- return this.fns[id2] ? id2 : -1;
20248
+ getInterceptorIndex(id3) {
20249
+ if (typeof id3 === "number") {
20250
+ return this.fns[id3] ? id3 : -1;
20235
20251
  }
20236
- return this.fns.indexOf(id2);
20252
+ return this.fns.indexOf(id3);
20237
20253
  }
20238
- update(id2, fn) {
20239
- const index = this.getInterceptorIndex(id2);
20254
+ update(id3, fn) {
20255
+ const index = this.getInterceptorIndex(id3);
20240
20256
  if (this.fns[index]) {
20241
20257
  this.fns[index] = fn;
20242
- return id2;
20258
+ return id3;
20243
20259
  }
20244
20260
  return false;
20245
20261
  }
@@ -21301,47 +21317,6 @@ var applyPaidProjectDomain = (parameters, options) => {
21301
21317
  }
21302
21318
  });
21303
21319
  };
21304
- var getProjectMailDomain = (parameters, options) => {
21305
- const params = buildClientParams([parameters], [
21306
- {
21307
- args: [
21308
- { in: "headers", key: "X-Request-Id" },
21309
- { in: "path", key: "project_id" }
21310
- ]
21311
- }
21312
- ]);
21313
- return (options?.client ?? client).get({
21314
- responseStyle: "data",
21315
- security: [{ scheme: "bearer", type: "http" }],
21316
- url: "/v1/projects/{project_id}/mail-domain",
21317
- ...options,
21318
- ...params
21319
- });
21320
- };
21321
- var configureProjectMailDomain = (parameters, options) => {
21322
- const params = buildClientParams([parameters], [
21323
- {
21324
- args: [
21325
- { in: "headers", key: "X-Request-Id" },
21326
- { in: "headers", key: "Idempotency-Key" },
21327
- { in: "path", key: "project_id" },
21328
- { key: "configureProjectMailDomainRequest", map: "body" }
21329
- ]
21330
- }
21331
- ]);
21332
- return (options?.client ?? client).put({
21333
- responseStyle: "data",
21334
- security: [{ scheme: "bearer", type: "http" }],
21335
- url: "/v1/projects/{project_id}/mail-domain",
21336
- ...options,
21337
- ...params,
21338
- headers: {
21339
- "Content-Type": "application/json",
21340
- ...options?.headers,
21341
- ...params.headers
21342
- }
21343
- });
21344
- };
21345
21320
  var planDeployment = (parameters, options) => {
21346
21321
  const params = buildClientParams([parameters], [
21347
21322
  {
@@ -21808,6 +21783,384 @@ var streamOperationEvents = (parameters, options) => {
21808
21783
  ...params
21809
21784
  });
21810
21785
  };
21786
+ var getManagedMailDomain = (parameters, options) => {
21787
+ const params = buildClientParams([parameters], [
21788
+ {
21789
+ args: [
21790
+ { in: "headers", key: "X-Request-Id" },
21791
+ { in: "path", key: "project_id" },
21792
+ { in: "path", key: "environment_id" }
21793
+ ]
21794
+ }
21795
+ ]);
21796
+ return (options?.client ?? client).get({
21797
+ responseStyle: "data",
21798
+ security: [{ scheme: "bearer", type: "http" }],
21799
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail-domain",
21800
+ ...options,
21801
+ ...params
21802
+ });
21803
+ };
21804
+ var configureManagedMailDomain = (parameters, options) => {
21805
+ const params = buildClientParams([parameters], [
21806
+ {
21807
+ args: [
21808
+ { in: "headers", key: "X-Request-Id" },
21809
+ { in: "headers", key: "Idempotency-Key" },
21810
+ { in: "path", key: "project_id" },
21811
+ { in: "path", key: "environment_id" },
21812
+ { key: "managedMailDomainRequest", map: "body" }
21813
+ ]
21814
+ }
21815
+ ]);
21816
+ return (options?.client ?? client).put({
21817
+ responseStyle: "data",
21818
+ security: [{ scheme: "bearer", type: "http" }],
21819
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail-domain",
21820
+ ...options,
21821
+ ...params,
21822
+ headers: {
21823
+ "Content-Type": "application/json",
21824
+ ...options?.headers,
21825
+ ...params.headers
21826
+ }
21827
+ });
21828
+ };
21829
+ var disableManagedMailReceiving = (parameters, options) => {
21830
+ const params = buildClientParams([parameters], [
21831
+ {
21832
+ args: [
21833
+ { in: "headers", key: "X-Request-Id" },
21834
+ { in: "headers", key: "Idempotency-Key" },
21835
+ { in: "path", key: "project_id" },
21836
+ { in: "path", key: "environment_id" }
21837
+ ]
21838
+ }
21839
+ ]);
21840
+ return (options?.client ?? client).delete({
21841
+ responseStyle: "data",
21842
+ security: [{ scheme: "bearer", type: "http" }],
21843
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail-webhook",
21844
+ ...options,
21845
+ ...params
21846
+ });
21847
+ };
21848
+ var prepareManagedMailWebhook = (parameters, options) => {
21849
+ const params = buildClientParams([parameters], [
21850
+ {
21851
+ args: [
21852
+ { in: "headers", key: "X-Request-Id" },
21853
+ { in: "headers", key: "Idempotency-Key" },
21854
+ { in: "path", key: "project_id" },
21855
+ { in: "path", key: "environment_id" },
21856
+ { key: "managedMailWebhookRequest", map: "body" }
21857
+ ]
21858
+ }
21859
+ ]);
21860
+ return (options?.client ?? client).put({
21861
+ responseStyle: "data",
21862
+ security: [{ scheme: "bearer", type: "http" }],
21863
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail-webhook",
21864
+ ...options,
21865
+ ...params,
21866
+ headers: {
21867
+ "Content-Type": "application/json",
21868
+ ...options?.headers,
21869
+ ...params.headers
21870
+ }
21871
+ });
21872
+ };
21873
+ var verifyManagedMailWebhook = (parameters, options) => {
21874
+ const params = buildClientParams([parameters], [
21875
+ {
21876
+ args: [
21877
+ { in: "headers", key: "X-Request-Id" },
21878
+ { in: "headers", key: "Idempotency-Key" },
21879
+ { in: "path", key: "project_id" },
21880
+ { in: "path", key: "environment_id" }
21881
+ ]
21882
+ }
21883
+ ]);
21884
+ return (options?.client ?? client).post({
21885
+ responseStyle: "data",
21886
+ security: [{ scheme: "bearer", type: "http" }],
21887
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail-webhook/verify",
21888
+ ...options,
21889
+ ...params
21890
+ });
21891
+ };
21892
+ var listManagedMailMessages = (parameters, options) => {
21893
+ const params = buildClientParams([parameters], [
21894
+ {
21895
+ args: [
21896
+ { in: "headers", key: "X-Request-Id" },
21897
+ { in: "path", key: "project_id" },
21898
+ { in: "path", key: "environment_id" },
21899
+ { in: "query", key: "after" }
21900
+ ]
21901
+ }
21902
+ ]);
21903
+ return (options?.client ?? client).get({
21904
+ responseStyle: "data",
21905
+ security: [{ scheme: "bearer", type: "http" }],
21906
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail/messages",
21907
+ ...options,
21908
+ ...params
21909
+ });
21910
+ };
21911
+ var getManagedMailMessage = (parameters, options) => {
21912
+ const params = buildClientParams([parameters], [
21913
+ {
21914
+ args: [
21915
+ { in: "headers", key: "X-Request-Id" },
21916
+ { in: "path", key: "project_id" },
21917
+ { in: "path", key: "environment_id" },
21918
+ { in: "path", key: "message_id" }
21919
+ ]
21920
+ }
21921
+ ]);
21922
+ return (options?.client ?? client).get({
21923
+ responseStyle: "data",
21924
+ security: [{ scheme: "bearer", type: "http" }],
21925
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail/messages/{message_id}",
21926
+ ...options,
21927
+ ...params
21928
+ });
21929
+ };
21930
+ var retryManagedMailMessage = (parameters, options) => {
21931
+ const params = buildClientParams([parameters], [
21932
+ {
21933
+ args: [
21934
+ { in: "headers", key: "X-Request-Id" },
21935
+ { in: "headers", key: "Idempotency-Key" },
21936
+ { in: "path", key: "project_id" },
21937
+ { in: "path", key: "environment_id" },
21938
+ { in: "path", key: "message_id" }
21939
+ ]
21940
+ }
21941
+ ]);
21942
+ return (options?.client ?? client).post({
21943
+ responseStyle: "data",
21944
+ security: [{ scheme: "bearer", type: "http" }],
21945
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail/messages/{message_id}/retry",
21946
+ ...options,
21947
+ ...params
21948
+ });
21949
+ };
21950
+
21951
+ // packages/sdk-ts/dist/managed-mail-response.js
21952
+ var ULID = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;
21953
+ function assertManagedMailResponse(value, input) {
21954
+ const r = object2(value);
21955
+ if (input.action === "configure" || input.action === "status" || input.action === "webhook_verify") {
21956
+ exact3(r, [
21957
+ "domain_id",
21958
+ "domain",
21959
+ "environment_id",
21960
+ "sending",
21961
+ "receiving",
21962
+ "status",
21963
+ "configured_at",
21964
+ "observed_at",
21965
+ "dns_records",
21966
+ "webhook",
21967
+ "next_check_after_seconds"
21968
+ ], ["dns"]);
21969
+ id2(r["domain_id"]);
21970
+ domain(r["domain"]);
21971
+ if (r["environment_id"] !== input.environmentId)
21972
+ invalid3();
21973
+ for (const key of ["sending", "receiving"])
21974
+ if (!["disabled", "pending", "ready", "failed"].includes(String(r[key])))
21975
+ invalid3();
21976
+ if (!["ready", "verification_pending"].includes(String(r["status"])))
21977
+ invalid3();
21978
+ time(r["configured_at"]);
21979
+ if (r["observed_at"] !== null)
21980
+ time(r["observed_at"]);
21981
+ records(r["dns_records"]);
21982
+ if (r["next_check_after_seconds"] !== null && r["next_check_after_seconds"] !== 60)
21983
+ invalid3();
21984
+ if (r["webhook"] !== null) {
21985
+ const hook = object2(r["webhook"]);
21986
+ exact3(hook, ["url", "verified"]);
21987
+ https(hook["url"]);
21988
+ if (typeof hook["verified"] !== "boolean")
21989
+ invalid3();
21990
+ }
21991
+ if (r["dns"] !== void 0) {
21992
+ const dns = object2(r["dns"]);
21993
+ exact3(dns, ["status", "records"]);
21994
+ if (!["configured", "action_required", "conflict"].includes(String(dns["status"])))
21995
+ invalid3();
21996
+ records(dns["records"]);
21997
+ }
21998
+ return;
21999
+ }
22000
+ if (input.action === "webhook_set") {
22001
+ exact3(r, ["url", "signing_secret", "status"]);
22002
+ if (r["url"] !== input.url || r["status"] !== "verification_required" || typeof r["signing_secret"] !== "string" || !/^whsec_[A-Za-z0-9+/]{43}=$/u.test(r["signing_secret"]))
22003
+ invalid3();
22004
+ return;
22005
+ }
22006
+ if (input.action === "webhook_disable") {
22007
+ exact3(r, ["status"]);
22008
+ if (r["status"] !== "disabled")
22009
+ invalid3();
22010
+ return;
22011
+ }
22012
+ if (input.action === "messages_list") {
22013
+ exact3(r, ["items"]);
22014
+ if (!Array.isArray(r["items"]) || r["items"].length > 50)
22015
+ invalid3();
22016
+ for (const value2 of r["items"]) {
22017
+ const item = object2(value2);
22018
+ exact3(item, ["message_id", "received_at", "state", "attempts"]);
22019
+ id2(item["message_id"]);
22020
+ time(item["received_at"]);
22021
+ if (!["pending", "delivering", "delivered", "delivery_failed", "expired"].includes(String(item["state"])) || !Number.isInteger(item["attempts"]) || Number(item["attempts"]) < 0 || Number(item["attempts"]) > 4)
22022
+ invalid3();
22023
+ }
22024
+ return;
22025
+ }
22026
+ if (input.action === "message_retry") {
22027
+ exact3(r, ["attempted"], ["delivered"]);
22028
+ if (typeof r["attempted"] !== "boolean" || r["delivered"] !== void 0 && typeof r["delivered"] !== "boolean")
22029
+ invalid3();
22030
+ return;
22031
+ }
22032
+ if (input.action !== "message_get")
22033
+ invalid3();
22034
+ if (r["status"] === "expired") {
22035
+ exact3(r, ["status"]);
22036
+ return;
22037
+ }
22038
+ exact3(r, [
22039
+ "id",
22040
+ "domain",
22041
+ "received_at",
22042
+ "expires_at",
22043
+ "from",
22044
+ "to",
22045
+ "subject",
22046
+ "text",
22047
+ "html",
22048
+ "message_id",
22049
+ "attachments"
22050
+ ]);
22051
+ if (r["id"] !== input.messageId)
22052
+ invalid3();
22053
+ domain(r["domain"]);
22054
+ time(r["received_at"]);
22055
+ time(r["expires_at"]);
22056
+ if (Date.parse(String(r["expires_at"])) - Date.parse(String(r["received_at"])) !== 72 * 36e5)
22057
+ invalid3();
22058
+ for (const key of ["from", "subject", "message_id"])
22059
+ if (typeof r[key] !== "string")
22060
+ invalid3();
22061
+ for (const key of ["text", "html"])
22062
+ if (r[key] !== null && typeof r[key] !== "string")
22063
+ invalid3();
22064
+ if (!Array.isArray(r["to"]) || r["to"].some((v) => typeof v !== "string" || v.slice(v.lastIndexOf("@") + 1).toLowerCase() !== r["domain"]))
22065
+ invalid3();
22066
+ if (!Array.isArray(r["attachments"]))
22067
+ invalid3();
22068
+ for (const value2 of r["attachments"]) {
22069
+ const a = object2(value2);
22070
+ exact3(a, ["id", "filename", "content_type", "download_path"]);
22071
+ if (typeof a["id"] !== "string" || !/^[A-Za-z0-9_-]{1,128}$/u.test(a["id"]) || a["filename"] !== null && typeof a["filename"] !== "string" || typeof a["content_type"] !== "string" || a["download_path"] !== `/v1/projects/${input.projectId}/environments/${input.environmentId}/mail/messages/${input.messageId}/attachments/${a["id"]}`)
22072
+ invalid3();
22073
+ }
22074
+ }
22075
+ function object2(v) {
22076
+ if (typeof v !== "object" || v === null || Array.isArray(v))
22077
+ invalid3();
22078
+ return v;
22079
+ }
22080
+ function exact3(v, required, optional = []) {
22081
+ if (required.some((k) => !(k in v)) || Object.keys(v).some((k) => !required.includes(k) && !optional.includes(k)))
22082
+ invalid3();
22083
+ }
22084
+ function id2(v) {
22085
+ if (typeof v !== "string" || !ULID.test(v))
22086
+ invalid3();
22087
+ }
22088
+ function domain(v) {
22089
+ if (typeof v !== "string" || !/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u.test(v))
22090
+ invalid3();
22091
+ }
22092
+ function time(v) {
22093
+ if (typeof v !== "string" || !Number.isFinite(Date.parse(v)) || new Date(v).toISOString() !== v)
22094
+ invalid3();
22095
+ }
22096
+ function https(v) {
22097
+ if (typeof v !== "string" || !v.startsWith("https://"))
22098
+ invalid3();
22099
+ }
22100
+ function records(v) {
22101
+ if (!Array.isArray(v))
22102
+ invalid3();
22103
+ for (const value of v) {
22104
+ const r = object2(value);
22105
+ exact3(r, ["type", "name", "value", "purpose", "status"], ["priority"]);
22106
+ if (!["TXT", "CNAME", "MX"].includes(String(r["type"])) || ["name", "value", "purpose", "status"].some((k) => typeof r[k] !== "string") || r["type"] === "MX" && (!Number.isInteger(r["priority"]) || Number(r["priority"]) < 0 || Number(r["priority"]) > 65535))
22107
+ invalid3();
22108
+ }
22109
+ }
22110
+ function invalid3() {
22111
+ throw new TypeError("Mail response contract invalid");
22112
+ }
22113
+
22114
+ // packages/sdk-ts/dist/managed-mail.js
22115
+ function requestManagedMail(client2, input) {
22116
+ const scope = { project_id: input.projectId, environment_id: input.environmentId };
22117
+ switch (input.action) {
22118
+ case "configure":
22119
+ return configureManagedMailDomain({
22120
+ ...scope,
22121
+ "Idempotency-Key": input.idempotencyKey,
22122
+ managedMailDomainRequest: {
22123
+ domain: input.domain,
22124
+ sending: input.sending,
22125
+ receiving: input.receiving
22126
+ }
22127
+ }, { client: client2 });
22128
+ case "status":
22129
+ return getManagedMailDomain(scope, { client: client2 });
22130
+ case "webhook_set":
22131
+ return prepareManagedMailWebhook({
22132
+ ...scope,
22133
+ "Idempotency-Key": input.idempotencyKey,
22134
+ managedMailWebhookRequest: { url: input.url }
22135
+ }, { client: client2 });
22136
+ case "webhook_verify":
22137
+ return verifyManagedMailWebhook({ ...scope, "Idempotency-Key": input.idempotencyKey }, { client: client2 });
22138
+ case "webhook_disable":
22139
+ return disableManagedMailReceiving({ ...scope, "Idempotency-Key": input.idempotencyKey }, { client: client2 });
22140
+ case "messages_list":
22141
+ return listManagedMailMessages({ ...scope, ...input.after ? { after: input.after } : {} }, { client: client2 });
22142
+ case "message_get":
22143
+ return getManagedMailMessage({ ...scope, message_id: input.messageId }, { client: client2 });
22144
+ case "message_retry":
22145
+ return retryManagedMailMessage({ ...scope, message_id: input.messageId, "Idempotency-Key": input.idempotencyKey }, { client: client2 });
22146
+ }
22147
+ }
22148
+ async function executeManagedMail(client2, input) {
22149
+ const result = await requestManagedMail(client2, input);
22150
+ assertManagedMailResponse(result, input);
22151
+ return result;
22152
+ }
22153
+
22154
+ // packages/contracts/dist/feedback.js
22155
+ var identifier = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;
22156
+ function parseFeedbackReceipt(value) {
22157
+ if (typeof value !== "object" || value === null || Array.isArray(value))
22158
+ throw new TypeError("Feedback was not acknowledged");
22159
+ const v = value;
22160
+ if (Object.keys(v).sort().join(",") !== "id,organization_id,submitted_at" || typeof v["id"] !== "string" || !identifier.test(v["id"]) || typeof v["organization_id"] !== "string" || !identifier.test(v["organization_id"]) || typeof v["submitted_at"] !== "string" || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u.test(v["submitted_at"]) || !Number.isFinite(Date.parse(v["submitted_at"])) || new Date(v["submitted_at"]).toISOString() !== v["submitted_at"])
22161
+ throw new TypeError("Feedback was not acknowledged");
22162
+ return v;
22163
+ }
21811
22164
 
21812
22165
  // apps/product-cli/dist/product-api.js
21813
22166
  var GeneratedSdkProductApi = class {
@@ -22177,15 +22530,8 @@ var GeneratedSdkProductApi = class {
22177
22530
  secret_name: input.name
22178
22531
  }, { client: this.#client });
22179
22532
  }
22180
- async configureMailDomain(input) {
22181
- return configureProjectMailDomain({
22182
- "Idempotency-Key": input.idempotencyKey,
22183
- project_id: input.projectId,
22184
- configureProjectMailDomainRequest: { domain: input.domain }
22185
- }, { client: this.#client });
22186
- }
22187
- async getMailDomain(projectId) {
22188
- return getProjectMailDomain({ project_id: projectId }, { client: this.#client });
22533
+ managedMail(input) {
22534
+ return executeManagedMail(this.#client, input);
22189
22535
  }
22190
22536
  };
22191
22537
 
@@ -23229,7 +23575,7 @@ async function databaseContractBlockers(config, applicationDirectory, files) {
23229
23575
  if (DATABASE_PRIVATE_BINDING_PATTERN.test(source)) {
23230
23576
  blockers.push({
23231
23577
  code: "database_binding_private",
23232
- message: `${path} reaches for a managed database connection string. Hyperdrive, DATABASE_URL and postgres:// URLs are platform-private and never reach a customer Worker. Call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database".`
23578
+ message: `${path} reaches for a managed database connection string. HYPERDRIVE is retired; DATABASE_URL and postgres:// URLs never reach a customer Worker. Call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database".`
23233
23579
  });
23234
23580
  }
23235
23581
  if (DATABASE_SOCKET_DRIVER_PATTERN.test(source)) {
@@ -23252,8 +23598,8 @@ function migrationFilenameBlockers(files, configuredPath, provider) {
23252
23598
  return [];
23253
23599
  const root = configuredPath ?? "postgres/migrations";
23254
23600
  const prefix = `${root}/`;
23255
- const invalid3 = files.filter((path) => path.startsWith(prefix)).map((path) => path.slice(prefix.length)).some((path) => !/^(?:[A-Za-z0-9][A-Za-z0-9._-]*\/)*\d{14}_[a-z0-9][a-z0-9_-]*\.sql$/u.test(path));
23256
- return invalid3 ? [
23601
+ const invalid4 = files.filter((path) => path.startsWith(prefix)).map((path) => path.slice(prefix.length)).some((path) => !/^(?:[A-Za-z0-9][A-Za-z0-9._-]*\/)*\d{14}_[a-z0-9][a-z0-9_-]*\.sql$/u.test(path));
23602
+ return invalid4 ? [
23257
23603
  {
23258
23604
  code: "migration_filename_noncanonical",
23259
23605
  message: "Rename every PostgreSQL migration to YYYYMMDDHHMMSS_name.sql before initialization."