@amerged/ohmyhost-cli 0.1.60 → 0.1.62
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/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-DYRDZNIR.js → chunk-WER7CYZD.js} +383 -85
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/src/apps/product-cli/package.json +1 -1
- package/src/apps/product-cli/src/cli.ts +25 -0
- package/src/apps/product-cli/src/command.ts +149 -0
- package/src/apps/product-cli/src/product-api.ts +83 -0
- package/src/packages/contracts/package.json +5 -0
- package/src/packages/contracts/src/connection-management.ts +90 -0
- package/src/packages/contracts/src/index.ts +2 -0
- package/src/packages/sdk-ts/package.json +1 -1
- package/src/packages/sdk-ts/src/generated/index.ts +45 -0
- package/src/packages/sdk-ts/src/generated/sdk.gen.ts +263 -0
- package/src/packages/sdk-ts/src/generated/types.gen.ts +376 -0
|
@@ -8114,12 +8114,12 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
|
|
|
8114
8114
|
return (type << 12) + permissions;
|
|
8115
8115
|
}
|
|
8116
8116
|
var MAX_UINT32 = 2 ** 32;
|
|
8117
|
-
function SecondsNanoseconds(givenSeconds, givenNanoseconds, milliseconds,
|
|
8117
|
+
function SecondsNanoseconds(givenSeconds, givenNanoseconds, milliseconds, date3) {
|
|
8118
8118
|
if (givenSeconds !== void 0 && givenNanoseconds !== void 0) {
|
|
8119
8119
|
return [givenSeconds, givenNanoseconds];
|
|
8120
8120
|
}
|
|
8121
8121
|
if (milliseconds === void 0) {
|
|
8122
|
-
milliseconds =
|
|
8122
|
+
milliseconds = date3.valueOf();
|
|
8123
8123
|
}
|
|
8124
8124
|
const seconds = Math.floor(milliseconds / 1e3);
|
|
8125
8125
|
const nanoseconds = (milliseconds - seconds * 1e3) * 1e6;
|
|
@@ -20698,14 +20698,14 @@ var require_codegen = __commonJS({
|
|
|
20698
20698
|
return replaceName(expr);
|
|
20699
20699
|
if (!canOptimize(expr))
|
|
20700
20700
|
return expr;
|
|
20701
|
-
return new code_1._Code(expr._items.reduce((
|
|
20701
|
+
return new code_1._Code(expr._items.reduce((items2, c) => {
|
|
20702
20702
|
if (c instanceof code_1.Name)
|
|
20703
20703
|
c = replaceName(c);
|
|
20704
20704
|
if (c instanceof code_1._Code)
|
|
20705
|
-
|
|
20705
|
+
items2.push(...c._items);
|
|
20706
20706
|
else
|
|
20707
|
-
|
|
20708
|
-
return
|
|
20707
|
+
items2.push(c);
|
|
20708
|
+
return items2;
|
|
20709
20709
|
}, []));
|
|
20710
20710
|
function replaceName(n) {
|
|
20711
20711
|
const c = constants5[n.str];
|
|
@@ -20863,7 +20863,7 @@ var require_util = __commonJS({
|
|
|
20863
20863
|
mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
|
|
20864
20864
|
mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)),
|
|
20865
20865
|
mergeValues: (from, to) => from === true ? true : Math.max(from, to),
|
|
20866
|
-
resultToName: (gen,
|
|
20866
|
+
resultToName: (gen, items2) => gen.var("items", items2)
|
|
20867
20867
|
})
|
|
20868
20868
|
};
|
|
20869
20869
|
function evaluatedPropsToName(gen, ps) {
|
|
@@ -21371,13 +21371,13 @@ var require_defaults = __commonJS({
|
|
|
21371
21371
|
var codegen_1 = require_codegen();
|
|
21372
21372
|
var util_1 = require_util();
|
|
21373
21373
|
function assignDefaults(it, ty) {
|
|
21374
|
-
const { properties, items } = it.schema;
|
|
21374
|
+
const { properties, items: items2 } = it.schema;
|
|
21375
21375
|
if (ty === "object" && properties) {
|
|
21376
21376
|
for (const key in properties) {
|
|
21377
21377
|
assignDefault(it, key, properties[key].default);
|
|
21378
21378
|
}
|
|
21379
|
-
} else if (ty === "array" && Array.isArray(
|
|
21380
|
-
|
|
21379
|
+
} else if (ty === "array" && Array.isArray(items2)) {
|
|
21380
|
+
items2.forEach((sch, i) => assignDefault(it, i, sch.default));
|
|
21381
21381
|
}
|
|
21382
21382
|
}
|
|
21383
21383
|
exports.assignDefaults = assignDefaults;
|
|
@@ -22181,11 +22181,11 @@ var require_validate = __commonJS({
|
|
|
22181
22181
|
gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
|
|
22182
22182
|
}
|
|
22183
22183
|
}
|
|
22184
|
-
function assignEvaluated({ gen, evaluated, props, items }) {
|
|
22184
|
+
function assignEvaluated({ gen, evaluated, props, items: items2 }) {
|
|
22185
22185
|
if (props instanceof codegen_1.Name)
|
|
22186
22186
|
gen.assign((0, codegen_1._)`${evaluated}.props`, props);
|
|
22187
|
-
if (
|
|
22188
|
-
gen.assign((0, codegen_1._)`${evaluated}.items`,
|
|
22187
|
+
if (items2 instanceof codegen_1.Name)
|
|
22188
|
+
gen.assign((0, codegen_1._)`${evaluated}.items`, items2);
|
|
22189
22189
|
}
|
|
22190
22190
|
function schemaKeywords(it, types, typeErrors, errsCount) {
|
|
22191
22191
|
const { gen, schema, data, allErrors, opts, self } = it;
|
|
@@ -22648,12 +22648,12 @@ var require_compile = __commonJS({
|
|
|
22648
22648
|
validate.source = { validateName, validateCode, scopeValues: gen._values };
|
|
22649
22649
|
}
|
|
22650
22650
|
if (this.opts.unevaluated) {
|
|
22651
|
-
const { props, items } = schemaCxt;
|
|
22651
|
+
const { props, items: items2 } = schemaCxt;
|
|
22652
22652
|
validate.evaluated = {
|
|
22653
22653
|
props: props instanceof codegen_1.Name ? void 0 : props,
|
|
22654
|
-
items:
|
|
22654
|
+
items: items2 instanceof codegen_1.Name ? void 0 : items2,
|
|
22655
22655
|
dynamicProps: props instanceof codegen_1.Name,
|
|
22656
|
-
dynamicItems:
|
|
22656
|
+
dynamicItems: items2 instanceof codegen_1.Name
|
|
22657
22657
|
};
|
|
22658
22658
|
if (validate.source)
|
|
22659
22659
|
validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
|
|
@@ -24719,8 +24719,8 @@ var require_ref2 = __commonJS({
|
|
|
24719
24719
|
it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
|
|
24720
24720
|
}
|
|
24721
24721
|
} else {
|
|
24722
|
-
const
|
|
24723
|
-
it.items = util_1.mergeEvaluated.items(gen,
|
|
24722
|
+
const items2 = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`);
|
|
24723
|
+
it.items = util_1.mergeEvaluated.items(gen, items2, it.items, codegen_1.Name);
|
|
24724
24724
|
}
|
|
24725
24725
|
}
|
|
24726
24726
|
}
|
|
@@ -25260,28 +25260,28 @@ var require_additionalItems = __commonJS({
|
|
|
25260
25260
|
error,
|
|
25261
25261
|
code(cxt) {
|
|
25262
25262
|
const { parentSchema, it } = cxt;
|
|
25263
|
-
const { items } = parentSchema;
|
|
25264
|
-
if (!Array.isArray(
|
|
25263
|
+
const { items: items2 } = parentSchema;
|
|
25264
|
+
if (!Array.isArray(items2)) {
|
|
25265
25265
|
(0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
25266
25266
|
return;
|
|
25267
25267
|
}
|
|
25268
|
-
validateAdditionalItems(cxt,
|
|
25268
|
+
validateAdditionalItems(cxt, items2);
|
|
25269
25269
|
}
|
|
25270
25270
|
};
|
|
25271
|
-
function validateAdditionalItems(cxt,
|
|
25271
|
+
function validateAdditionalItems(cxt, items2) {
|
|
25272
25272
|
const { gen, schema, data, keyword, it } = cxt;
|
|
25273
25273
|
it.items = true;
|
|
25274
25274
|
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
25275
25275
|
if (schema === false) {
|
|
25276
|
-
cxt.setParams({ len:
|
|
25277
|
-
cxt.pass((0, codegen_1._)`${len} <= ${
|
|
25276
|
+
cxt.setParams({ len: items2.length });
|
|
25277
|
+
cxt.pass((0, codegen_1._)`${len} <= ${items2.length}`);
|
|
25278
25278
|
} else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
25279
|
-
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${
|
|
25279
|
+
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items2.length}`);
|
|
25280
25280
|
gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
|
|
25281
25281
|
cxt.ok(valid);
|
|
25282
25282
|
}
|
|
25283
25283
|
function validateItems(valid) {
|
|
25284
|
-
gen.forRange("i",
|
|
25284
|
+
gen.forRange("i", items2.length, len, (i) => {
|
|
25285
25285
|
cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
|
|
25286
25286
|
if (!it.allErrors)
|
|
25287
25287
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
@@ -26420,16 +26420,16 @@ var require_unevaluatedItems = __commonJS({
|
|
|
26420
26420
|
error,
|
|
26421
26421
|
code(cxt) {
|
|
26422
26422
|
const { gen, schema, data, it } = cxt;
|
|
26423
|
-
const
|
|
26424
|
-
if (
|
|
26423
|
+
const items2 = it.items || 0;
|
|
26424
|
+
if (items2 === true)
|
|
26425
26425
|
return;
|
|
26426
26426
|
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
26427
26427
|
if (schema === false) {
|
|
26428
|
-
cxt.setParams({ len:
|
|
26429
|
-
cxt.fail((0, codegen_1._)`${len} > ${
|
|
26428
|
+
cxt.setParams({ len: items2 });
|
|
26429
|
+
cxt.fail((0, codegen_1._)`${len} > ${items2}`);
|
|
26430
26430
|
} else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
26431
|
-
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${
|
|
26432
|
-
gen.if((0, codegen_1.not)(valid), () => validateItems(valid,
|
|
26431
|
+
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items2}`);
|
|
26432
|
+
gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items2));
|
|
26433
26433
|
cxt.ok(valid);
|
|
26434
26434
|
}
|
|
26435
26435
|
it.items = true;
|
|
@@ -29033,13 +29033,13 @@ var require_stringifyCollection = __commonJS({
|
|
|
29033
29033
|
const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
29034
29034
|
return stringify2(collection, ctx, options);
|
|
29035
29035
|
}
|
|
29036
|
-
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
29036
|
+
function stringifyBlockCollection({ comment, items: items2 }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
29037
29037
|
const { indent, options: { commentString } } = ctx;
|
|
29038
29038
|
const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
|
|
29039
29039
|
let chompKeep = false;
|
|
29040
29040
|
const lines = [];
|
|
29041
|
-
for (let i = 0; i <
|
|
29042
|
-
const item =
|
|
29041
|
+
for (let i = 0; i < items2.length; ++i) {
|
|
29042
|
+
const item = items2[i];
|
|
29043
29043
|
let comment2 = null;
|
|
29044
29044
|
if (identity.isNode(item)) {
|
|
29045
29045
|
if (!chompKeep && item.spaceBefore)
|
|
@@ -29082,7 +29082,7 @@ ${indent}${line}` : "\n";
|
|
|
29082
29082
|
onChompKeep();
|
|
29083
29083
|
return str;
|
|
29084
29084
|
}
|
|
29085
|
-
function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
|
|
29085
|
+
function stringifyFlowCollection({ items: items2 }, ctx, { flowChars, itemIndent }) {
|
|
29086
29086
|
const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
|
|
29087
29087
|
itemIndent += indentStep;
|
|
29088
29088
|
const itemCtx = Object.assign({}, ctx, {
|
|
@@ -29093,8 +29093,8 @@ ${indent}${line}` : "\n";
|
|
|
29093
29093
|
let reqNewline = false;
|
|
29094
29094
|
let linesAtValue = 0;
|
|
29095
29095
|
const lines = [];
|
|
29096
|
-
for (let i = 0; i <
|
|
29097
|
-
const item =
|
|
29096
|
+
for (let i = 0; i < items2.length; ++i) {
|
|
29097
|
+
const item = items2[i];
|
|
29098
29098
|
let comment = null;
|
|
29099
29099
|
if (identity.isNode(item)) {
|
|
29100
29100
|
if (item.spaceBefore)
|
|
@@ -29125,7 +29125,7 @@ ${indent}${line}` : "\n";
|
|
|
29125
29125
|
reqNewline = true;
|
|
29126
29126
|
let str = stringify.stringify(item, itemCtx, () => comment = null);
|
|
29127
29127
|
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
|
|
29128
|
-
if (i <
|
|
29128
|
+
if (i < items2.length - 1) {
|
|
29129
29129
|
str += ",";
|
|
29130
29130
|
} else if (ctx.options.trailingComma) {
|
|
29131
29131
|
if (ctx.options.lineWidth > 0) {
|
|
@@ -29182,9 +29182,9 @@ var require_YAMLMap = __commonJS({
|
|
|
29182
29182
|
var identity = require_identity();
|
|
29183
29183
|
var Pair = require_Pair();
|
|
29184
29184
|
var Scalar = require_Scalar();
|
|
29185
|
-
function findPair(
|
|
29185
|
+
function findPair(items2, key) {
|
|
29186
29186
|
const k = identity.isScalar(key) ? key.value : key;
|
|
29187
|
-
for (const it of
|
|
29187
|
+
for (const it of items2) {
|
|
29188
29188
|
if (identity.isPair(it)) {
|
|
29189
29189
|
if (it.key === key || it.key === k)
|
|
29190
29190
|
return it;
|
|
@@ -30291,15 +30291,15 @@ var require_timestamp = __commonJS({
|
|
|
30291
30291
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
30292
30292
|
const [, year, month, day, hour, minute, second] = match.map(Number);
|
|
30293
30293
|
const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
|
|
30294
|
-
let
|
|
30294
|
+
let date3 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
|
|
30295
30295
|
const tz = match[8];
|
|
30296
30296
|
if (tz && tz !== "Z") {
|
|
30297
30297
|
let d = parseSexagesimal(tz, false);
|
|
30298
30298
|
if (Math.abs(d) < 30)
|
|
30299
30299
|
d *= 60;
|
|
30300
|
-
|
|
30300
|
+
date3 -= 6e4 * d;
|
|
30301
30301
|
}
|
|
30302
|
-
return new Date(
|
|
30302
|
+
return new Date(date3);
|
|
30303
30303
|
},
|
|
30304
30304
|
stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
|
|
30305
30305
|
};
|
|
@@ -31132,12 +31132,12 @@ var require_util_map_includes = __commonJS({
|
|
|
31132
31132
|
"node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.js"(exports) {
|
|
31133
31133
|
"use strict";
|
|
31134
31134
|
var identity = require_identity();
|
|
31135
|
-
function mapIncludes(ctx,
|
|
31135
|
+
function mapIncludes(ctx, items2, search) {
|
|
31136
31136
|
const { uniqueKeys } = ctx.options;
|
|
31137
31137
|
if (uniqueKeys === false)
|
|
31138
31138
|
return false;
|
|
31139
31139
|
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
|
|
31140
|
-
return
|
|
31140
|
+
return items2.some((pair) => isEqual(pair.key, search));
|
|
31141
31141
|
}
|
|
31142
31142
|
exports.mapIncludes = mapIncludes;
|
|
31143
31143
|
}
|
|
@@ -38784,14 +38784,14 @@ function isFrameworkConversionDiagnosticCode(value) {
|
|
|
38784
38784
|
function parseFrameworkConversionDiagnostic(value) {
|
|
38785
38785
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
38786
38786
|
return null;
|
|
38787
|
-
const
|
|
38788
|
-
const code = Object.hasOwn(
|
|
38789
|
-
const path2 = Object.hasOwn(
|
|
38787
|
+
const record9 = value;
|
|
38788
|
+
const code = Object.hasOwn(record9, "code") ? record9["code"] : void 0;
|
|
38789
|
+
const path2 = Object.hasOwn(record9, "path") ? record9["path"] : void 0;
|
|
38790
38790
|
if (!isFrameworkConversionDiagnosticCode(code) || typeof path2 !== "string")
|
|
38791
38791
|
return null;
|
|
38792
38792
|
const definition = DETAIL_DEFINITIONS[code];
|
|
38793
|
-
const fields = Object.entries(definition.fields ?? {}).map(([name, grammar]) => [name, grammar, Object.hasOwn(
|
|
38794
|
-
if (Object.keys(
|
|
38793
|
+
const fields = Object.entries(definition.fields ?? {}).map(([name, grammar]) => [name, grammar, Object.hasOwn(record9, name) ? record9[name] : void 0]);
|
|
38794
|
+
if (Object.keys(record9).length !== fields.length + 2 || pathClassOf(definition, path2) === null || fields.some(([, grammar, field]) => !fieldMatches(grammar, field)))
|
|
38795
38795
|
return null;
|
|
38796
38796
|
return Object.freeze(Object.fromEntries([
|
|
38797
38797
|
["code", code],
|
|
@@ -40103,10 +40103,10 @@ function parseDeploymentMailProgress(value) {
|
|
|
40103
40103
|
if (typeof value2 !== "object" || value2 === null || Array.isArray(value2))
|
|
40104
40104
|
invalid3();
|
|
40105
40105
|
const item = value2;
|
|
40106
|
-
const
|
|
40107
|
-
if (!["MX", "TXT", "CNAME"].includes(String(
|
|
40106
|
+
const record9 = exactRecord(item, item["priority"] === void 0 ? ["type", "name", "value", "status"] : ["type", "name", "value", "status", "priority"]);
|
|
40107
|
+
if (!["MX", "TXT", "CNAME"].includes(String(record9["type"])) || typeof record9["name"] !== "string" || record9["name"].length === 0 || record9["name"].length > 253 || /[\r\n\0]/u.test(record9["name"]) || !(record9["name"] === row["domain"] || record9["name"].endsWith(`.${row["domain"]}`)) || typeof record9["value"] !== "string" || record9["value"].length === 0 || record9["value"].length > 4096 || /[\r\n\0]/u.test(record9["value"]) || typeof record9["status"] !== "string" || record9["status"].length === 0 || record9["status"].length > 32 || /[\r\n\0]/u.test(record9["status"]) || record9["type"] === "MX" && (!Number.isSafeInteger(record9["priority"]) || Number(record9["priority"]) < 0 || Number(record9["priority"]) > 65535) || record9["type"] !== "MX" && record9["priority"] !== void 0)
|
|
40108
40108
|
invalid3();
|
|
40109
|
-
return Object.freeze({ ...
|
|
40109
|
+
return Object.freeze({ ...record9 });
|
|
40110
40110
|
});
|
|
40111
40111
|
return Object.freeze({ ...row, dns_records: records2 });
|
|
40112
40112
|
}
|
|
@@ -41610,8 +41610,8 @@ var isPaidValidationRecord = (value) => {
|
|
|
41610
41610
|
if (typeof value !== "object" || value === null || Array.isArray(value) || Object.keys(value).sort().join(",") !== "content,name,purpose,type") {
|
|
41611
41611
|
return false;
|
|
41612
41612
|
}
|
|
41613
|
-
const
|
|
41614
|
-
return (
|
|
41613
|
+
const record9 = value;
|
|
41614
|
+
return (record9["type"] === "CNAME" || record9["type"] === "TXT") && boundedString(record9["name"], 1, 253) && boundedString(record9["content"], 1, 2048) && ["traffic", "ownership", "ssl", "dcv_delegation"].includes(String(record9["purpose"]));
|
|
41615
41615
|
};
|
|
41616
41616
|
var isHttpsUrlValue = (value) => typeof value === "string" && isHttpsUrl(value);
|
|
41617
41617
|
|
|
@@ -41756,7 +41756,7 @@ async function prepareLocalSourcePublication(input) {
|
|
|
41756
41756
|
request = { ...request, expected_commit_sha: link2.source.last_confirmed_commit_sha };
|
|
41757
41757
|
}
|
|
41758
41758
|
parseManagedSourceRequest("upload", request);
|
|
41759
|
-
const
|
|
41759
|
+
const record9 = {
|
|
41760
41760
|
version: 1,
|
|
41761
41761
|
...scope,
|
|
41762
41762
|
operation_id: null,
|
|
@@ -41765,16 +41765,16 @@ async function prepareLocalSourcePublication(input) {
|
|
|
41765
41765
|
request
|
|
41766
41766
|
};
|
|
41767
41767
|
if (original !== null) {
|
|
41768
|
-
assertSameAttempt(original,
|
|
41768
|
+
assertSameAttempt(original, record9);
|
|
41769
41769
|
} else
|
|
41770
|
-
await writePending(
|
|
41770
|
+
await writePending(record9, true);
|
|
41771
41771
|
return {
|
|
41772
41772
|
request,
|
|
41773
41773
|
accepted: async (operation) => {
|
|
41774
41774
|
const current = await readPending(scope, replay);
|
|
41775
41775
|
if (current === null)
|
|
41776
41776
|
throw new LocalSourcePublicationError("source_publication_missing");
|
|
41777
|
-
assertSameAttempt(current,
|
|
41777
|
+
assertSameAttempt(current, record9);
|
|
41778
41778
|
if (current.operation_id !== null && current.operation_id !== operation.id)
|
|
41779
41779
|
throw new ResponseContractError();
|
|
41780
41780
|
if (!replay)
|
|
@@ -41793,7 +41793,7 @@ async function prepareLocalSourcePublication(input) {
|
|
|
41793
41793
|
const current = await readPending(scope);
|
|
41794
41794
|
if (current === null || current.operation_id !== null)
|
|
41795
41795
|
return;
|
|
41796
|
-
assertSameAttempt(current,
|
|
41796
|
+
assertSameAttempt(current, record9);
|
|
41797
41797
|
} catch (error2) {
|
|
41798
41798
|
if (error2 instanceof LocalSourcePublicationError && (error2.code === "source_publication_scope_mismatch" || error2.code === "source_publication_pending"))
|
|
41799
41799
|
return;
|
|
@@ -41996,12 +41996,12 @@ async function readRecord(path2) {
|
|
|
41996
41996
|
await handle?.close();
|
|
41997
41997
|
}
|
|
41998
41998
|
}
|
|
41999
|
-
async function writePending(
|
|
42000
|
-
const parent = join3(
|
|
41999
|
+
async function writePending(record9, create, completed = false) {
|
|
42000
|
+
const parent = join3(record9.directory, ".ohmyhost");
|
|
42001
42001
|
for (const directory of [
|
|
42002
42002
|
parent,
|
|
42003
|
-
|
|
42004
|
-
join3(
|
|
42003
|
+
record9.metadata_directory,
|
|
42004
|
+
join3(record9.metadata_directory, "publications")
|
|
42005
42005
|
]) {
|
|
42006
42006
|
try {
|
|
42007
42007
|
await fs2.mkdir(directory, { mode: 448 });
|
|
@@ -42012,10 +42012,10 @@ async function writePending(record8, create, completed = false) {
|
|
|
42012
42012
|
await checkedDirectory(directory);
|
|
42013
42013
|
await fs2.chmod(directory, 448);
|
|
42014
42014
|
}
|
|
42015
|
-
const target = completed ? completedPath(
|
|
42015
|
+
const target = completed ? completedPath(record9) : pendingPath(record9);
|
|
42016
42016
|
const temporary = create ? target : `${target}.${randomUUID()}.tmp`;
|
|
42017
42017
|
try {
|
|
42018
|
-
await fs2.writeFile(temporary, `${JSON.stringify(
|
|
42018
|
+
await fs2.writeFile(temporary, `${JSON.stringify(record9)}
|
|
42019
42019
|
`, { mode: 384, flag: "wx" });
|
|
42020
42020
|
if (!create)
|
|
42021
42021
|
await fs2.rename(temporary, target);
|
|
@@ -43613,6 +43613,8 @@ var recognizedCommandLabel = (argv) => {
|
|
|
43613
43613
|
return value;
|
|
43614
43614
|
if (value === "profile" && values[0] === "list")
|
|
43615
43615
|
return "profile list";
|
|
43616
|
+
if (value === "connection" && ["begin", "list", "status", "discover", "disconnect"].includes(values[0] ?? ""))
|
|
43617
|
+
return `connection ${values[0]}`;
|
|
43616
43618
|
if (value === "github" && values[0] === "connect")
|
|
43617
43619
|
return "github connect";
|
|
43618
43620
|
if (value === "github" && values[0] === "status")
|
|
@@ -44398,6 +44400,77 @@ var parseProductCliCommand = (argv) => {
|
|
|
44398
44400
|
credentialStore
|
|
44399
44401
|
} : { kind: "github-status", organizationId, credentialStore };
|
|
44400
44402
|
}
|
|
44403
|
+
if (first === "connection") {
|
|
44404
|
+
const operation = values.shift();
|
|
44405
|
+
if (wait || follow || stdin || yes !== (operation === "disconnect"))
|
|
44406
|
+
throw new InvalidCommandError();
|
|
44407
|
+
const options = parseOptionalOptions(values, [
|
|
44408
|
+
"--organization",
|
|
44409
|
+
"--project",
|
|
44410
|
+
"--environment",
|
|
44411
|
+
"--grant",
|
|
44412
|
+
"--request",
|
|
44413
|
+
"--idempotency-key",
|
|
44414
|
+
"--provider-organization",
|
|
44415
|
+
"--team"
|
|
44416
|
+
]);
|
|
44417
|
+
const org = options["--organization"];
|
|
44418
|
+
if (!org || !ORGANIZATION_ULID.test(org))
|
|
44419
|
+
throw new InvalidCommandError();
|
|
44420
|
+
const exact7 = (names) => Object.keys(options).every((k) => names.includes(k)) && names.every((k) => Object.hasOwn(options, k));
|
|
44421
|
+
const scoped = () => options["--project"] && options["--environment"] && ORGANIZATION_ULID.test(options["--project"]) && ORGANIZATION_ULID.test(options["--environment"]);
|
|
44422
|
+
if (operation === "list" && exact7(["--organization"]))
|
|
44423
|
+
return { kind: "connection-list", organizationId: org, credentialStore };
|
|
44424
|
+
if (operation === "begin" && scoped() && exact7(["--organization", "--project", "--environment", "--idempotency-key"]))
|
|
44425
|
+
return {
|
|
44426
|
+
kind: "connection-begin",
|
|
44427
|
+
organizationId: org,
|
|
44428
|
+
projectId: options["--project"] ?? "",
|
|
44429
|
+
environmentId: options["--environment"] ?? "",
|
|
44430
|
+
idempotencyKey: options["--idempotency-key"] ?? "",
|
|
44431
|
+
credentialStore
|
|
44432
|
+
};
|
|
44433
|
+
if (operation === "status" && exact7(["--organization", "--request"]) && /^[a-f0-9]{64}$/u.test(options["--request"] ?? ""))
|
|
44434
|
+
return {
|
|
44435
|
+
kind: "connection-status",
|
|
44436
|
+
organizationId: org,
|
|
44437
|
+
requestId: options["--request"] ?? "",
|
|
44438
|
+
credentialStore
|
|
44439
|
+
};
|
|
44440
|
+
if (operation === "disconnect" && exact7(["--organization", "--grant", "--idempotency-key"]) && ORGANIZATION_ULID.test(options["--grant"] ?? ""))
|
|
44441
|
+
return {
|
|
44442
|
+
kind: "connection-disconnect",
|
|
44443
|
+
organizationId: org,
|
|
44444
|
+
grantId: options["--grant"] ?? "",
|
|
44445
|
+
idempotencyKey: options["--idempotency-key"] ?? "",
|
|
44446
|
+
yes: true,
|
|
44447
|
+
credentialStore
|
|
44448
|
+
};
|
|
44449
|
+
if (operation === "discover" && scoped() && ORGANIZATION_ULID.test(options["--grant"] ?? "") && Object.keys(options).every((k) => [
|
|
44450
|
+
"--organization",
|
|
44451
|
+
"--project",
|
|
44452
|
+
"--environment",
|
|
44453
|
+
"--grant",
|
|
44454
|
+
"--provider-organization",
|
|
44455
|
+
"--team"
|
|
44456
|
+
].includes(k))) {
|
|
44457
|
+
const number = (v) => v && /^[1-9][0-9]{0,14}$/u.test(v) && Number.isSafeInteger(Number(v)) ? Number(v) : void 0;
|
|
44458
|
+
const providerOrganizationId = number(options["--provider-organization"]), teamId = number(options["--team"]);
|
|
44459
|
+
if (options["--provider-organization"] && !providerOrganizationId || options["--team"] && (!teamId || !providerOrganizationId))
|
|
44460
|
+
throw new InvalidCommandError();
|
|
44461
|
+
return {
|
|
44462
|
+
kind: "connection-discover",
|
|
44463
|
+
organizationId: org,
|
|
44464
|
+
projectId: options["--project"] ?? "",
|
|
44465
|
+
environmentId: options["--environment"] ?? "",
|
|
44466
|
+
grantId: options["--grant"] ?? "",
|
|
44467
|
+
...providerOrganizationId ? { providerOrganizationId } : {},
|
|
44468
|
+
...teamId ? { teamId } : {},
|
|
44469
|
+
credentialStore
|
|
44470
|
+
};
|
|
44471
|
+
}
|
|
44472
|
+
throw new InvalidCommandError();
|
|
44473
|
+
}
|
|
44401
44474
|
if (first === "organization" && values[0] === "mcp-connections") {
|
|
44402
44475
|
values.shift();
|
|
44403
44476
|
const subcommand = values.shift();
|
|
@@ -46305,7 +46378,7 @@ function exact3(value, keys) {
|
|
|
46305
46378
|
|
|
46306
46379
|
// packages/contracts/dist/credit-pricing.js
|
|
46307
46380
|
function assertOrganizationCreditUsage(value) {
|
|
46308
|
-
const
|
|
46381
|
+
const record9 = (input, keys) => {
|
|
46309
46382
|
if (!input || typeof input !== "object" || Array.isArray(input) || Object.keys(input).sort().join() !== keys.split(",").sort().join())
|
|
46310
46383
|
throw new TypeError("Invalid usage fields");
|
|
46311
46384
|
return input;
|
|
@@ -46313,30 +46386,30 @@ function assertOrganizationCreditUsage(value) {
|
|
|
46313
46386
|
const identifier2 = (input) => typeof input === "string" && /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u.test(input);
|
|
46314
46387
|
const amount = (input) => typeof input === "string" && /^(0|[1-9][0-9]{0,37})$/u.test(input);
|
|
46315
46388
|
const instant2 = (input) => typeof input === "string" && Number.isFinite(Date.parse(input)) && new Date(input).toISOString() === input;
|
|
46316
|
-
const report =
|
|
46389
|
+
const report = record9(value, "organization_id,as_of,unit,period,from,projects,days");
|
|
46317
46390
|
if (!identifier2(report["organization_id"]) || !instant2(report["as_of"]) || !instant2(report["from"]) || report["unit"] !== "microcredits" || typeof report["period"] !== "string" || !/^20[0-9]{2}-(0[1-9]|1[0-2])$/u.test(report["period"]) || !Array.isArray(report["projects"]) || report["projects"].length > 1e3 || !Array.isArray(report["days"]) || report["days"].length > 15)
|
|
46318
46391
|
throw new TypeError("Invalid usage report");
|
|
46319
46392
|
let previous = "";
|
|
46320
46393
|
for (const input of report["projects"]) {
|
|
46321
|
-
const project =
|
|
46394
|
+
const project = record9(input, "project_id,used_micros");
|
|
46322
46395
|
if (!identifier2(project["project_id"]) || String(project["project_id"]) <= previous || !amount(project["used_micros"]))
|
|
46323
46396
|
throw new TypeError("Invalid usage project");
|
|
46324
46397
|
previous = String(project["project_id"]);
|
|
46325
46398
|
}
|
|
46326
46399
|
let previousDay = "";
|
|
46327
46400
|
for (const input of report["days"]) {
|
|
46328
|
-
const day =
|
|
46401
|
+
const day = record9(input, "day,projects");
|
|
46329
46402
|
if (typeof day["day"] !== "string" || !/^20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/u.test(day["day"]) || day["day"] <= previousDay || !Array.isArray(day["projects"]) || day["projects"].length > 1e3)
|
|
46330
46403
|
throw new TypeError("Invalid usage day");
|
|
46331
46404
|
previousDay = day["day"];
|
|
46332
46405
|
previous = "";
|
|
46333
46406
|
for (const projectInput of day["projects"]) {
|
|
46334
|
-
const project =
|
|
46407
|
+
const project = record9(projectInput, "project_id,meters");
|
|
46335
46408
|
if (!identifier2(project["project_id"]) || String(project["project_id"]) <= previous || !Array.isArray(project["meters"]) || project["meters"].length > 1e3)
|
|
46336
46409
|
throw new TypeError("Invalid usage project");
|
|
46337
46410
|
previous = String(project["project_id"]);
|
|
46338
46411
|
for (const meterInput of project["meters"]) {
|
|
46339
|
-
const meter =
|
|
46412
|
+
const meter = record9(meterInput, "environment_id,meter,unit,rate_card_id,quantity,charged_micros");
|
|
46340
46413
|
if (meter["environment_id"] !== null && !identifier2(meter["environment_id"]))
|
|
46341
46414
|
throw new TypeError("Invalid usage environment");
|
|
46342
46415
|
for (const key of ["meter", "unit", "rate_card_id"])
|
|
@@ -46421,7 +46494,7 @@ function exact4(v, keys) {
|
|
|
46421
46494
|
// apps/product-cli/package.json
|
|
46422
46495
|
var package_default = {
|
|
46423
46496
|
name: "@ohmyhost/product-cli",
|
|
46424
|
-
version: "0.1.
|
|
46497
|
+
version: "0.1.62",
|
|
46425
46498
|
private: true,
|
|
46426
46499
|
ohmyhost: {
|
|
46427
46500
|
deployment: "production",
|
|
@@ -46736,6 +46809,11 @@ var HELP_USAGE = Object.freeze({
|
|
|
46736
46809
|
logout: "ohmyhost logout [--profile-name NAME] [--revoke] --json (removes only the selected saved login)",
|
|
46737
46810
|
whoami: "ohmyhost whoami [--profile-name NAME] --json (the effective user, organization and saved login)",
|
|
46738
46811
|
"profile list": "ohmyhost profile list --json (saved logins on this computer: name, user and organization, never a token; pass --profile-name NAME or set OHMYHOST_PROFILE to choose one)",
|
|
46812
|
+
"connection begin": "ohmyhost connection begin --organization ULID --project ULID --environment ULID --idempotency-key KEY --json",
|
|
46813
|
+
"connection list": "ohmyhost connection list --organization ULID --json",
|
|
46814
|
+
"connection status": "ohmyhost connection status --organization ULID --request HASH --json",
|
|
46815
|
+
"connection discover": "ohmyhost connection discover --organization ULID --project ULID --environment ULID --grant ULID [--provider-organization ID] [--team ID] --json",
|
|
46816
|
+
"connection disconnect": "ohmyhost connection disconnect --organization ULID --grant ULID --idempotency-key KEY --yes --json",
|
|
46739
46817
|
"github connect": "ohmyhost github connect --organization ULID --idempotency-key KEY --json (connect once, then link covered repositories without another browser consent)",
|
|
46740
46818
|
"github status": "ohmyhost github status --organization ULID --json",
|
|
46741
46819
|
"github disconnect": "ohmyhost github disconnect --organization ULID --yes --json (Owner only; revokes the workspace GitHub connection and every repository grant under it, so auto-deploy and linked sources stop at once; the GitHub App stays installed for other workspaces, and github connect starts a new connection)",
|
|
@@ -47035,6 +47113,13 @@ var ProductCli = class {
|
|
|
47035
47113
|
...github.status === "connected" ? {} : { next_action: this.githubConnectAction(command.organizationId) }
|
|
47036
47114
|
});
|
|
47037
47115
|
}
|
|
47116
|
+
if (command.kind === "connection-begin" || command.kind === "connection-list" || command.kind === "connection-status" || command.kind === "connection-discover" || command.kind === "connection-disconnect") {
|
|
47117
|
+
const api = await this.authenticatedApi(command.credentialStore, signal);
|
|
47118
|
+
if (!api.connection)
|
|
47119
|
+
throw new ResponseContractError();
|
|
47120
|
+
const result = await api.connection(command);
|
|
47121
|
+
return success(name, { status: "ok", result });
|
|
47122
|
+
}
|
|
47038
47123
|
if (command.kind === "organization-mcp-connections-list") {
|
|
47039
47124
|
const api = await this.authenticatedApi(command.credentialStore, signal);
|
|
47040
47125
|
const page = parseOrganizationMcpConnectionList(await api.listOrganizationMcpConnections(command.organizationId));
|
|
@@ -49053,6 +49138,16 @@ var parsedCommandName = (command) => {
|
|
|
49053
49138
|
return "github status";
|
|
49054
49139
|
if (command.kind === "github-disconnect")
|
|
49055
49140
|
return "github disconnect";
|
|
49141
|
+
if (command.kind === "connection-begin")
|
|
49142
|
+
return "connection begin";
|
|
49143
|
+
if (command.kind === "connection-list")
|
|
49144
|
+
return "connection list";
|
|
49145
|
+
if (command.kind === "connection-status")
|
|
49146
|
+
return "connection status";
|
|
49147
|
+
if (command.kind === "connection-discover")
|
|
49148
|
+
return "connection discover";
|
|
49149
|
+
if (command.kind === "connection-disconnect")
|
|
49150
|
+
return "connection disconnect";
|
|
49056
49151
|
if (command.kind === "organization-mcp-connections-list")
|
|
49057
49152
|
return "organization mcp-connections list";
|
|
49058
49153
|
if (command.kind === "organization-mcp-connection-revoke")
|
|
@@ -49347,12 +49442,12 @@ function buildClientParams(args, fields) {
|
|
|
49347
49442
|
};
|
|
49348
49443
|
const map = buildKeyMap(fields);
|
|
49349
49444
|
function writeSlot(slot, key, value) {
|
|
49350
|
-
let
|
|
49351
|
-
if (
|
|
49352
|
-
|
|
49353
|
-
params[slot] =
|
|
49445
|
+
let record9 = params[slot];
|
|
49446
|
+
if (record9 === void 0) {
|
|
49447
|
+
record9 = /* @__PURE__ */ Object.create(null);
|
|
49448
|
+
params[slot] = record9;
|
|
49354
49449
|
}
|
|
49355
|
-
|
|
49450
|
+
record9[key] = value;
|
|
49356
49451
|
}
|
|
49357
49452
|
let config;
|
|
49358
49453
|
for (const [index, arg] of args.entries()) {
|
|
@@ -50206,6 +50301,106 @@ var rotateProjectPreviewToken = (parameters, options) => {
|
|
|
50206
50301
|
...params
|
|
50207
50302
|
});
|
|
50208
50303
|
};
|
|
50304
|
+
var listConnections = (parameters, options) => {
|
|
50305
|
+
const params = buildClientParams([parameters], [
|
|
50306
|
+
{
|
|
50307
|
+
args: [
|
|
50308
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50309
|
+
{ in: "path", key: "organization_id" }
|
|
50310
|
+
]
|
|
50311
|
+
}
|
|
50312
|
+
]);
|
|
50313
|
+
return (options?.client ?? client).get({
|
|
50314
|
+
responseStyle: "data",
|
|
50315
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50316
|
+
url: "/v1/organizations/{organization_id}/connections",
|
|
50317
|
+
...options,
|
|
50318
|
+
...params
|
|
50319
|
+
});
|
|
50320
|
+
};
|
|
50321
|
+
var beginConnection = (parameters, options) => {
|
|
50322
|
+
const params = buildClientParams([parameters], [
|
|
50323
|
+
{
|
|
50324
|
+
args: [
|
|
50325
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50326
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
50327
|
+
{ in: "path", key: "organization_id" },
|
|
50328
|
+
{ key: "connectionBegin", map: "body" }
|
|
50329
|
+
]
|
|
50330
|
+
}
|
|
50331
|
+
]);
|
|
50332
|
+
return (options?.client ?? client).post({
|
|
50333
|
+
responseStyle: "data",
|
|
50334
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50335
|
+
url: "/v1/organizations/{organization_id}/connections/begin",
|
|
50336
|
+
...options,
|
|
50337
|
+
...params,
|
|
50338
|
+
headers: {
|
|
50339
|
+
"Content-Type": "application/json",
|
|
50340
|
+
...options?.headers,
|
|
50341
|
+
...params.headers
|
|
50342
|
+
}
|
|
50343
|
+
});
|
|
50344
|
+
};
|
|
50345
|
+
var getConnectionRequest = (parameters, options) => {
|
|
50346
|
+
const params = buildClientParams([parameters], [
|
|
50347
|
+
{
|
|
50348
|
+
args: [
|
|
50349
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50350
|
+
{ in: "path", key: "organization_id" },
|
|
50351
|
+
{ in: "path", key: "request_id" }
|
|
50352
|
+
]
|
|
50353
|
+
}
|
|
50354
|
+
]);
|
|
50355
|
+
return (options?.client ?? client).get({
|
|
50356
|
+
responseStyle: "data",
|
|
50357
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50358
|
+
url: "/v1/organizations/{organization_id}/connections/requests/{request_id}",
|
|
50359
|
+
...options,
|
|
50360
|
+
...params
|
|
50361
|
+
});
|
|
50362
|
+
};
|
|
50363
|
+
var discoverConnection = (parameters, options) => {
|
|
50364
|
+
const params = buildClientParams([parameters], [
|
|
50365
|
+
{
|
|
50366
|
+
args: [
|
|
50367
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50368
|
+
{ in: "path", key: "organization_id" },
|
|
50369
|
+
{ in: "path", key: "grant_id" },
|
|
50370
|
+
{ in: "query", key: "project_id" },
|
|
50371
|
+
{ in: "query", key: "environment_id" },
|
|
50372
|
+
{ in: "query", key: "provider_organization_id" },
|
|
50373
|
+
{ in: "query", key: "team_id" }
|
|
50374
|
+
]
|
|
50375
|
+
}
|
|
50376
|
+
]);
|
|
50377
|
+
return (options?.client ?? client).get({
|
|
50378
|
+
responseStyle: "data",
|
|
50379
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50380
|
+
url: "/v1/organizations/{organization_id}/connections/{grant_id}/catalog",
|
|
50381
|
+
...options,
|
|
50382
|
+
...params
|
|
50383
|
+
});
|
|
50384
|
+
};
|
|
50385
|
+
var disconnectConnection = (parameters, options) => {
|
|
50386
|
+
const params = buildClientParams([parameters], [
|
|
50387
|
+
{
|
|
50388
|
+
args: [
|
|
50389
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50390
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
50391
|
+
{ in: "path", key: "organization_id" },
|
|
50392
|
+
{ in: "path", key: "grant_id" }
|
|
50393
|
+
]
|
|
50394
|
+
}
|
|
50395
|
+
]);
|
|
50396
|
+
return (options?.client ?? client).delete({
|
|
50397
|
+
responseStyle: "data",
|
|
50398
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50399
|
+
url: "/v1/organizations/{organization_id}/connections/{grant_id}",
|
|
50400
|
+
...options,
|
|
50401
|
+
...params
|
|
50402
|
+
});
|
|
50403
|
+
};
|
|
50209
50404
|
var getNativeAuthConfiguration = (parameters, options) => {
|
|
50210
50405
|
const params = buildClientParams([parameters], [
|
|
50211
50406
|
{
|
|
@@ -54057,6 +54252,66 @@ function checkedResponse(kind, value) {
|
|
|
54057
54252
|
}
|
|
54058
54253
|
}
|
|
54059
54254
|
|
|
54255
|
+
// packages/contracts/dist/connection-management.js
|
|
54256
|
+
var ulid5 = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;
|
|
54257
|
+
function record8(raw, keys) {
|
|
54258
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
54259
|
+
throw new TypeError("Invalid connection response");
|
|
54260
|
+
const value = raw;
|
|
54261
|
+
if (Object.keys(value).length !== keys.length || keys.some((key) => !Object.hasOwn(value, key)))
|
|
54262
|
+
throw new TypeError("Invalid connection response");
|
|
54263
|
+
return value;
|
|
54264
|
+
}
|
|
54265
|
+
function date2(raw) {
|
|
54266
|
+
if (typeof raw !== "string" || !Number.isFinite(Date.parse(raw)))
|
|
54267
|
+
throw new TypeError("Invalid connection response");
|
|
54268
|
+
}
|
|
54269
|
+
function items(raw) {
|
|
54270
|
+
if (!Array.isArray(raw) || raw.length > 1e4)
|
|
54271
|
+
throw new TypeError("Invalid connection response");
|
|
54272
|
+
for (const row of raw) {
|
|
54273
|
+
const v = record8(row, ["id", "name"]);
|
|
54274
|
+
if (!Number.isSafeInteger(v["id"]) || Number(v["id"]) < 1 || typeof v["name"] !== "string" || !v["name"] || v["name"].length > 1024)
|
|
54275
|
+
throw new TypeError("Invalid connection response");
|
|
54276
|
+
}
|
|
54277
|
+
}
|
|
54278
|
+
function parseConnectionResponse(kind, raw, expectedOrigin) {
|
|
54279
|
+
if (kind === "connection-begin") {
|
|
54280
|
+
const v = record8(raw, ["request_id", "url", "expires_at"]);
|
|
54281
|
+
date2(v["expires_at"]);
|
|
54282
|
+
if (typeof v["request_id"] !== "string" || !/^[a-f0-9]{64}$/u.test(v["request_id"]) || typeof v["url"] !== "string")
|
|
54283
|
+
throw new TypeError("Invalid connection response");
|
|
54284
|
+
const url = new URL(v["url"]);
|
|
54285
|
+
if (!["https://app.ohmyho.st", "https://dev.app.ohmyho.st"].includes(url.origin) || expectedOrigin !== void 0 && url.origin !== expectedOrigin || url.pathname !== "/connections/authorize" || url.hash || url.searchParams.size !== 1 || !/^[A-Za-z0-9_-]{43}$/u.test(url.searchParams.get("request") ?? ""))
|
|
54286
|
+
throw new TypeError("Invalid connection response");
|
|
54287
|
+
} else if (kind === "connection-status") {
|
|
54288
|
+
const v = record8(raw, ["state", "expires_at"]);
|
|
54289
|
+
date2(v["expires_at"]);
|
|
54290
|
+
if (!["pending", "consumed", "expired"].includes(String(v["state"])))
|
|
54291
|
+
throw new TypeError("Invalid connection response");
|
|
54292
|
+
} else if (kind === "connection-disconnect") {
|
|
54293
|
+
const v = record8(raw, ["state"]);
|
|
54294
|
+
if (!["disconnected", "revocation_pending"].includes(String(v["state"])))
|
|
54295
|
+
throw new TypeError("Invalid connection response");
|
|
54296
|
+
} else if (kind === "connection-discover") {
|
|
54297
|
+
const v = record8(raw, ["organizations", "teams", "connections"]);
|
|
54298
|
+
items(v["organizations"]);
|
|
54299
|
+
items(v["teams"]);
|
|
54300
|
+
items(v["connections"]);
|
|
54301
|
+
} else {
|
|
54302
|
+
const v = record8(raw, ["connections"]);
|
|
54303
|
+
if (!Array.isArray(v["connections"]) || v["connections"].length > 1e4)
|
|
54304
|
+
throw new TypeError("Invalid connection response");
|
|
54305
|
+
for (const row of v["connections"]) {
|
|
54306
|
+
const grant = record8(row, ["id", "provider", "state", "created_at"]);
|
|
54307
|
+
date2(grant["created_at"]);
|
|
54308
|
+
if (typeof grant["id"] !== "string" || !ulid5.test(grant["id"]) || grant["provider"] !== "make" || !["active", "refreshing", "reconnect_required", "disconnecting", "disconnected"].includes(String(grant["state"])))
|
|
54309
|
+
throw new TypeError("Invalid connection response");
|
|
54310
|
+
}
|
|
54311
|
+
}
|
|
54312
|
+
return raw;
|
|
54313
|
+
}
|
|
54314
|
+
|
|
54060
54315
|
// apps/product-cli/dist/product-api.js
|
|
54061
54316
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
54062
54317
|
|
|
@@ -54719,8 +54974,8 @@ function parsePreviewView(value, scope) {
|
|
|
54719
54974
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
54720
54975
|
throw new TypeError("Invalid preview response");
|
|
54721
54976
|
const row = value;
|
|
54722
|
-
const
|
|
54723
|
-
if (Object.keys(row).sort().join(",") !== "environment,id,project_id,source,status,url" || typeof row["id"] !== "string" || !
|
|
54977
|
+
const ulid6 = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;
|
|
54978
|
+
if (Object.keys(row).sort().join(",") !== "environment,id,project_id,source,status,url" || typeof row["id"] !== "string" || !ulid6.test(row["id"]) || typeof row["project_id"] !== "string" || !ulid6.test(row["project_id"]) || row["environment"] !== "dev" && row["environment"] !== "prod" || !["cold", "starting", "ready", "sleeping"].includes(String(row["status"])) || typeof row["url"] !== "string" || !/^https:\/\/[a-z2-7]{51}[aq]\.preview(?:\.dev)?\.omh\.st$/u.test(row["url"]) || scope !== void 0 && (row["project_id"] !== scope.projectId || row["environment"] !== scope.environment))
|
|
54724
54979
|
throw new TypeError("Invalid preview response");
|
|
54725
54980
|
if (row["source"] !== null) {
|
|
54726
54981
|
const source = row["source"];
|
|
@@ -54830,7 +55085,7 @@ function normalizeEgressOrigins(value) {
|
|
|
54830
55085
|
}
|
|
54831
55086
|
function forbiddenEgressHostname(hostname) {
|
|
54832
55087
|
const normalized = hostname.toLowerCase();
|
|
54833
|
-
return /(?:^|\.)ohmyho-(?:mail|storage)-gateway-[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\.workers\.dev\.?$/u.test(normalized) || normalized === "localhost" || normalized.endsWith(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".internal") || /^\d{1,3}(?:\.\d{1,3}){3}$/u.test(normalized) || normalized.startsWith("[") || normalized.endsWith("]");
|
|
55088
|
+
return /(?:^|\.)ohmyho-(?:mail|storage)-gateway-[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\.workers\.dev\.?$/u.test(normalized) || normalized.replace(/\.+$/u, "") === "connect.ohmyho.st" || normalized.replace(/\.+$/u, "").endsWith(".connect.ohmyho.st") || normalized === "localhost" || normalized.endsWith(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".internal") || /^\d{1,3}(?:\.\d{1,3}){3}$/u.test(normalized) || normalized.startsWith("[") || normalized.endsWith("]");
|
|
54834
55089
|
}
|
|
54835
55090
|
function parseOhmyhostConfigYaml(source) {
|
|
54836
55091
|
if (typeof source !== "string") {
|
|
@@ -54869,13 +55124,55 @@ function isRecordValue(value) {
|
|
|
54869
55124
|
function hasExactKeys(value, keys) {
|
|
54870
55125
|
return Object.keys(value).sort().join(",") === [...keys].sort().join(",");
|
|
54871
55126
|
}
|
|
55127
|
+
async function executeConnectionCommand(client2, origin, command) {
|
|
55128
|
+
const organization_id = command.organizationId;
|
|
55129
|
+
let result;
|
|
55130
|
+
switch (command.kind) {
|
|
55131
|
+
case "connection-begin":
|
|
55132
|
+
result = await beginConnection({
|
|
55133
|
+
organization_id,
|
|
55134
|
+
"Idempotency-Key": command.idempotencyKey,
|
|
55135
|
+
connectionBegin: {
|
|
55136
|
+
provider: "make",
|
|
55137
|
+
project_id: command.projectId,
|
|
55138
|
+
environment_id: command.environmentId
|
|
55139
|
+
}
|
|
55140
|
+
}, { client: client2 });
|
|
55141
|
+
break;
|
|
55142
|
+
case "connection-list":
|
|
55143
|
+
result = await listConnections({ organization_id }, { client: client2 });
|
|
55144
|
+
break;
|
|
55145
|
+
case "connection-status":
|
|
55146
|
+
result = await getConnectionRequest({ organization_id, request_id: command.requestId }, { client: client2 });
|
|
55147
|
+
break;
|
|
55148
|
+
case "connection-discover":
|
|
55149
|
+
result = await discoverConnection({
|
|
55150
|
+
organization_id,
|
|
55151
|
+
grant_id: command.grantId,
|
|
55152
|
+
project_id: command.projectId,
|
|
55153
|
+
environment_id: command.environmentId,
|
|
55154
|
+
...command.providerOrganizationId === void 0 ? {} : { provider_organization_id: command.providerOrganizationId },
|
|
55155
|
+
...command.teamId === void 0 ? {} : { team_id: command.teamId }
|
|
55156
|
+
}, { client: client2 });
|
|
55157
|
+
break;
|
|
55158
|
+
case "connection-disconnect":
|
|
55159
|
+
result = await disconnectConnection({ organization_id, grant_id: command.grantId, "Idempotency-Key": command.idempotencyKey }, { client: client2 });
|
|
55160
|
+
break;
|
|
55161
|
+
}
|
|
55162
|
+
return parseConnectionResponse(command.kind, result, origin);
|
|
55163
|
+
}
|
|
54872
55164
|
var GeneratedSdkProductApi = class {
|
|
54873
55165
|
#client;
|
|
55166
|
+
#connectionOrigin;
|
|
54874
55167
|
managedSource;
|
|
54875
55168
|
constructor(baseUrl, accessToken, fetch2) {
|
|
55169
|
+
this.#connectionOrigin = new URL(baseUrl).origin;
|
|
54876
55170
|
this.#client = createClient({ auth: accessToken, baseUrl, fetch: fetch2, throwOnError: true });
|
|
54877
55171
|
this.managedSource = new GeneratedSdkManagedSourceApi(() => this.#client);
|
|
54878
55172
|
}
|
|
55173
|
+
async connection(command) {
|
|
55174
|
+
return executeConnectionCommand(this.#client, this.#connectionOrigin, command);
|
|
55175
|
+
}
|
|
54879
55176
|
async changeDatabaseCompute(input) {
|
|
54880
55177
|
return changeDatabaseCompute({
|
|
54881
55178
|
project_id: input.projectId,
|
|
@@ -56131,8 +56428,8 @@ function pnpmLockedVersion(document2, packageName) {
|
|
|
56131
56428
|
}
|
|
56132
56429
|
return null;
|
|
56133
56430
|
}
|
|
56134
|
-
function ownValue(
|
|
56135
|
-
return isRecord4(
|
|
56431
|
+
function ownValue(record9, key) {
|
|
56432
|
+
return isRecord4(record9) && Object.hasOwn(record9, key) ? record9[key] : void 0;
|
|
56136
56433
|
}
|
|
56137
56434
|
function isRecord4(value) {
|
|
56138
56435
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -56348,7 +56645,7 @@ function astroConfigFindings(text, path2, mode) {
|
|
|
56348
56645
|
if ("finding" in lexed)
|
|
56349
56646
|
return [lexed.finding];
|
|
56350
56647
|
const tokens = lexed.tokens;
|
|
56351
|
-
const hasPropertyKey = (
|
|
56648
|
+
const hasPropertyKey = (items2, name) => items2.some((token, index) => token.value === name && items2[index + 1]?.value === ":");
|
|
56352
56649
|
const invalid7 = hasNonRootProperty(tokens, ["base"], ["", "/"]) || ["srcDir", "outDir", "serverEntry", "client", "server", "assetsPrefix"].some((name) => hasPropertyKey(tokens, name)) || (mode === "edge" ? !text.includes("@astrojs/cloudflare") || !hasProperty(tokens, "output", "server") || !hasProperty(tokens, "session", "false") || !hasProperty(tokens, "imageService", "passthrough") || hasPropertyKey(tokens, "cache") : text.includes("@astrojs/cloudflare") || hasPropertyKey(tokens, "adapter") || hasProperty(tokens, "output", "server"));
|
|
56353
56650
|
return invalid7 ? [diagnostic({ code: "astro_config_unsupported", path: path2 })] : [];
|
|
56354
56651
|
}
|
|
@@ -59528,6 +59825,7 @@ export {
|
|
|
59528
59825
|
executeNativeAuth,
|
|
59529
59826
|
GeneratedSdkManagedSourceApi,
|
|
59530
59827
|
assertDatabaseTableAnswer,
|
|
59828
|
+
executeConnectionCommand,
|
|
59531
59829
|
GeneratedSdkProductApi,
|
|
59532
59830
|
RepositoryInitError,
|
|
59533
59831
|
RepositoryInitBlockedError,
|