@amerged/ohmyhost-cli 0.1.60 → 0.1.63
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-NRFJFQTV.js} +468 -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 +29 -0
- package/src/apps/product-cli/src/command.ts +210 -0
- package/src/apps/product-cli/src/product-api.ts +109 -0
- package/src/packages/contracts/package.json +5 -0
- package/src/packages/contracts/src/connection-management.ts +107 -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 +53 -0
- package/src/packages/sdk-ts/src/generated/sdk.gen.ts +314 -0
- package/src/packages/sdk-ts/src/generated/types.gen.ts +463 -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", "import", "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,103 @@ 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
|
+
"--connection"
|
|
44417
|
+
]);
|
|
44418
|
+
const org = options["--organization"];
|
|
44419
|
+
if (!org || !ORGANIZATION_ULID.test(org))
|
|
44420
|
+
throw new InvalidCommandError();
|
|
44421
|
+
const exact7 = (names) => Object.keys(options).every((k) => names.includes(k)) && names.every((k) => Object.hasOwn(options, k));
|
|
44422
|
+
const scoped = () => options["--project"] && options["--environment"] && ORGANIZATION_ULID.test(options["--project"]) && ORGANIZATION_ULID.test(options["--environment"]);
|
|
44423
|
+
if (operation === "list" && exact7(["--organization"]))
|
|
44424
|
+
return { kind: "connection-list", organizationId: org, credentialStore };
|
|
44425
|
+
if (operation === "begin" && (exact7(["--organization", "--idempotency-key"]) || scoped() && exact7(["--organization", "--project", "--environment", "--idempotency-key"])))
|
|
44426
|
+
return {
|
|
44427
|
+
kind: "connection-begin",
|
|
44428
|
+
organizationId: org,
|
|
44429
|
+
...options["--project"] ? { projectId: options["--project"], 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 === "import" && scoped() && ORGANIZATION_ULID.test(options["--grant"] ?? "") && exact7([
|
|
44450
|
+
"--organization",
|
|
44451
|
+
"--project",
|
|
44452
|
+
"--environment",
|
|
44453
|
+
"--grant",
|
|
44454
|
+
"--provider-organization",
|
|
44455
|
+
"--team",
|
|
44456
|
+
"--connection",
|
|
44457
|
+
"--idempotency-key"
|
|
44458
|
+
])) {
|
|
44459
|
+
const projectId = options["--project"], environmentId = options["--environment"], grantId = options["--grant"], idempotencyKey = options["--idempotency-key"];
|
|
44460
|
+
const providerOrganizationId = Number(options["--provider-organization"]), teamId = Number(options["--team"]), connectionId = Number(options["--connection"]);
|
|
44461
|
+
if (!projectId || !environmentId || !grantId || !idempotencyKey || [providerOrganizationId, teamId, connectionId].some((n) => !Number.isSafeInteger(n) || n < 1))
|
|
44462
|
+
throw new InvalidCommandError();
|
|
44463
|
+
return {
|
|
44464
|
+
kind: "connection-import",
|
|
44465
|
+
organizationId: org,
|
|
44466
|
+
projectId,
|
|
44467
|
+
environmentId,
|
|
44468
|
+
grantId,
|
|
44469
|
+
providerOrganizationId,
|
|
44470
|
+
teamId,
|
|
44471
|
+
connectionId,
|
|
44472
|
+
idempotencyKey,
|
|
44473
|
+
credentialStore
|
|
44474
|
+
};
|
|
44475
|
+
}
|
|
44476
|
+
if (operation === "discover" && (!options["--project"] && !options["--environment"] || scoped()) && ORGANIZATION_ULID.test(options["--grant"] ?? "") && Object.keys(options).every((k) => [
|
|
44477
|
+
"--organization",
|
|
44478
|
+
"--project",
|
|
44479
|
+
"--environment",
|
|
44480
|
+
"--grant",
|
|
44481
|
+
"--provider-organization",
|
|
44482
|
+
"--team"
|
|
44483
|
+
].includes(k))) {
|
|
44484
|
+
const number = (v) => v && /^[1-9][0-9]{0,14}$/u.test(v) && Number.isSafeInteger(Number(v)) ? Number(v) : void 0;
|
|
44485
|
+
const providerOrganizationId = number(options["--provider-organization"]), teamId = number(options["--team"]);
|
|
44486
|
+
if (options["--provider-organization"] && !providerOrganizationId || options["--team"] && (!teamId || !providerOrganizationId))
|
|
44487
|
+
throw new InvalidCommandError();
|
|
44488
|
+
return {
|
|
44489
|
+
kind: "connection-discover",
|
|
44490
|
+
organizationId: org,
|
|
44491
|
+
...options["--project"] ? { projectId: options["--project"], environmentId: options["--environment"] } : {},
|
|
44492
|
+
grantId: options["--grant"] ?? "",
|
|
44493
|
+
...providerOrganizationId ? { providerOrganizationId } : {},
|
|
44494
|
+
...teamId ? { teamId } : {},
|
|
44495
|
+
credentialStore
|
|
44496
|
+
};
|
|
44497
|
+
}
|
|
44498
|
+
throw new InvalidCommandError();
|
|
44499
|
+
}
|
|
44401
44500
|
if (first === "organization" && values[0] === "mcp-connections") {
|
|
44402
44501
|
values.shift();
|
|
44403
44502
|
const subcommand = values.shift();
|
|
@@ -46305,7 +46404,7 @@ function exact3(value, keys) {
|
|
|
46305
46404
|
|
|
46306
46405
|
// packages/contracts/dist/credit-pricing.js
|
|
46307
46406
|
function assertOrganizationCreditUsage(value) {
|
|
46308
|
-
const
|
|
46407
|
+
const record9 = (input, keys) => {
|
|
46309
46408
|
if (!input || typeof input !== "object" || Array.isArray(input) || Object.keys(input).sort().join() !== keys.split(",").sort().join())
|
|
46310
46409
|
throw new TypeError("Invalid usage fields");
|
|
46311
46410
|
return input;
|
|
@@ -46313,30 +46412,30 @@ function assertOrganizationCreditUsage(value) {
|
|
|
46313
46412
|
const identifier2 = (input) => typeof input === "string" && /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u.test(input);
|
|
46314
46413
|
const amount = (input) => typeof input === "string" && /^(0|[1-9][0-9]{0,37})$/u.test(input);
|
|
46315
46414
|
const instant2 = (input) => typeof input === "string" && Number.isFinite(Date.parse(input)) && new Date(input).toISOString() === input;
|
|
46316
|
-
const report =
|
|
46415
|
+
const report = record9(value, "organization_id,as_of,unit,period,from,projects,days");
|
|
46317
46416
|
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
46417
|
throw new TypeError("Invalid usage report");
|
|
46319
46418
|
let previous = "";
|
|
46320
46419
|
for (const input of report["projects"]) {
|
|
46321
|
-
const project =
|
|
46420
|
+
const project = record9(input, "project_id,used_micros");
|
|
46322
46421
|
if (!identifier2(project["project_id"]) || String(project["project_id"]) <= previous || !amount(project["used_micros"]))
|
|
46323
46422
|
throw new TypeError("Invalid usage project");
|
|
46324
46423
|
previous = String(project["project_id"]);
|
|
46325
46424
|
}
|
|
46326
46425
|
let previousDay = "";
|
|
46327
46426
|
for (const input of report["days"]) {
|
|
46328
|
-
const day =
|
|
46427
|
+
const day = record9(input, "day,projects");
|
|
46329
46428
|
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
46429
|
throw new TypeError("Invalid usage day");
|
|
46331
46430
|
previousDay = day["day"];
|
|
46332
46431
|
previous = "";
|
|
46333
46432
|
for (const projectInput of day["projects"]) {
|
|
46334
|
-
const project =
|
|
46433
|
+
const project = record9(projectInput, "project_id,meters");
|
|
46335
46434
|
if (!identifier2(project["project_id"]) || String(project["project_id"]) <= previous || !Array.isArray(project["meters"]) || project["meters"].length > 1e3)
|
|
46336
46435
|
throw new TypeError("Invalid usage project");
|
|
46337
46436
|
previous = String(project["project_id"]);
|
|
46338
46437
|
for (const meterInput of project["meters"]) {
|
|
46339
|
-
const meter =
|
|
46438
|
+
const meter = record9(meterInput, "environment_id,meter,unit,rate_card_id,quantity,charged_micros");
|
|
46340
46439
|
if (meter["environment_id"] !== null && !identifier2(meter["environment_id"]))
|
|
46341
46440
|
throw new TypeError("Invalid usage environment");
|
|
46342
46441
|
for (const key of ["meter", "unit", "rate_card_id"])
|
|
@@ -46421,7 +46520,7 @@ function exact4(v, keys) {
|
|
|
46421
46520
|
// apps/product-cli/package.json
|
|
46422
46521
|
var package_default = {
|
|
46423
46522
|
name: "@ohmyhost/product-cli",
|
|
46424
|
-
version: "0.1.
|
|
46523
|
+
version: "0.1.63",
|
|
46425
46524
|
private: true,
|
|
46426
46525
|
ohmyhost: {
|
|
46427
46526
|
deployment: "production",
|
|
@@ -46736,6 +46835,12 @@ var HELP_USAGE = Object.freeze({
|
|
|
46736
46835
|
logout: "ohmyhost logout [--profile-name NAME] [--revoke] --json (removes only the selected saved login)",
|
|
46737
46836
|
whoami: "ohmyhost whoami [--profile-name NAME] --json (the effective user, organization and saved login)",
|
|
46738
46837
|
"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)",
|
|
46838
|
+
"connection begin": "ohmyhost connection begin --organization ULID [--project ULID --environment ULID] --idempotency-key KEY --json",
|
|
46839
|
+
"connection list": "ohmyhost connection list --organization ULID --json",
|
|
46840
|
+
"connection status": "ohmyhost connection status --organization ULID --request HASH --json",
|
|
46841
|
+
"connection discover": "ohmyhost connection discover --organization ULID [--project ULID --environment ULID] --grant ULID [--provider-organization ID] [--team ID] --json",
|
|
46842
|
+
"connection import": "ohmyhost connection import --organization ULID --grant ULID --project ULID --environment ULID --provider-organization ID --team ID --connection ID --idempotency-key KEY --json",
|
|
46843
|
+
"connection disconnect": "ohmyhost connection disconnect --organization ULID --grant ULID --idempotency-key KEY --yes --json",
|
|
46739
46844
|
"github connect": "ohmyhost github connect --organization ULID --idempotency-key KEY --json (connect once, then link covered repositories without another browser consent)",
|
|
46740
46845
|
"github status": "ohmyhost github status --organization ULID --json",
|
|
46741
46846
|
"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 +47140,13 @@ var ProductCli = class {
|
|
|
47035
47140
|
...github.status === "connected" ? {} : { next_action: this.githubConnectAction(command.organizationId) }
|
|
47036
47141
|
});
|
|
47037
47142
|
}
|
|
47143
|
+
if (command.kind === "connection-begin" || command.kind === "connection-list" || command.kind === "connection-status" || command.kind === "connection-discover" || command.kind === "connection-import" || command.kind === "connection-disconnect") {
|
|
47144
|
+
const api = await this.authenticatedApi(command.credentialStore, signal);
|
|
47145
|
+
if (!api.connection)
|
|
47146
|
+
throw new ResponseContractError();
|
|
47147
|
+
const result = await api.connection(command);
|
|
47148
|
+
return success(name, { status: "ok", result });
|
|
47149
|
+
}
|
|
47038
47150
|
if (command.kind === "organization-mcp-connections-list") {
|
|
47039
47151
|
const api = await this.authenticatedApi(command.credentialStore, signal);
|
|
47040
47152
|
const page = parseOrganizationMcpConnectionList(await api.listOrganizationMcpConnections(command.organizationId));
|
|
@@ -49053,6 +49165,18 @@ var parsedCommandName = (command) => {
|
|
|
49053
49165
|
return "github status";
|
|
49054
49166
|
if (command.kind === "github-disconnect")
|
|
49055
49167
|
return "github disconnect";
|
|
49168
|
+
if (command.kind === "connection-begin")
|
|
49169
|
+
return "connection begin";
|
|
49170
|
+
if (command.kind === "connection-list")
|
|
49171
|
+
return "connection list";
|
|
49172
|
+
if (command.kind === "connection-status")
|
|
49173
|
+
return "connection status";
|
|
49174
|
+
if (command.kind === "connection-discover")
|
|
49175
|
+
return "connection discover";
|
|
49176
|
+
if (command.kind === "connection-import")
|
|
49177
|
+
return "connection import";
|
|
49178
|
+
if (command.kind === "connection-disconnect")
|
|
49179
|
+
return "connection disconnect";
|
|
49056
49180
|
if (command.kind === "organization-mcp-connections-list")
|
|
49057
49181
|
return "organization mcp-connections list";
|
|
49058
49182
|
if (command.kind === "organization-mcp-connection-revoke")
|
|
@@ -49347,12 +49471,12 @@ function buildClientParams(args, fields) {
|
|
|
49347
49471
|
};
|
|
49348
49472
|
const map = buildKeyMap(fields);
|
|
49349
49473
|
function writeSlot(slot, key, value) {
|
|
49350
|
-
let
|
|
49351
|
-
if (
|
|
49352
|
-
|
|
49353
|
-
params[slot] =
|
|
49474
|
+
let record9 = params[slot];
|
|
49475
|
+
if (record9 === void 0) {
|
|
49476
|
+
record9 = /* @__PURE__ */ Object.create(null);
|
|
49477
|
+
params[slot] = record9;
|
|
49354
49478
|
}
|
|
49355
|
-
|
|
49479
|
+
record9[key] = value;
|
|
49356
49480
|
}
|
|
49357
49481
|
let config;
|
|
49358
49482
|
for (const [index, arg] of args.entries()) {
|
|
@@ -50206,6 +50330,132 @@ var rotateProjectPreviewToken = (parameters, options) => {
|
|
|
50206
50330
|
...params
|
|
50207
50331
|
});
|
|
50208
50332
|
};
|
|
50333
|
+
var listConnections = (parameters, options) => {
|
|
50334
|
+
const params = buildClientParams([parameters], [
|
|
50335
|
+
{
|
|
50336
|
+
args: [
|
|
50337
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50338
|
+
{ in: "path", key: "organization_id" },
|
|
50339
|
+
{ in: "query", key: "scope" }
|
|
50340
|
+
]
|
|
50341
|
+
}
|
|
50342
|
+
]);
|
|
50343
|
+
return (options?.client ?? client).get({
|
|
50344
|
+
responseStyle: "data",
|
|
50345
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50346
|
+
url: "/v1/organizations/{organization_id}/connections",
|
|
50347
|
+
...options,
|
|
50348
|
+
...params
|
|
50349
|
+
});
|
|
50350
|
+
};
|
|
50351
|
+
var beginConnection = (parameters, options) => {
|
|
50352
|
+
const params = buildClientParams([parameters], [
|
|
50353
|
+
{
|
|
50354
|
+
args: [
|
|
50355
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50356
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
50357
|
+
{ in: "path", key: "organization_id" },
|
|
50358
|
+
{ key: "connectionBegin", map: "body" }
|
|
50359
|
+
]
|
|
50360
|
+
}
|
|
50361
|
+
]);
|
|
50362
|
+
return (options?.client ?? client).post({
|
|
50363
|
+
responseStyle: "data",
|
|
50364
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50365
|
+
url: "/v1/organizations/{organization_id}/connections/begin",
|
|
50366
|
+
...options,
|
|
50367
|
+
...params,
|
|
50368
|
+
headers: {
|
|
50369
|
+
"Content-Type": "application/json",
|
|
50370
|
+
...options?.headers,
|
|
50371
|
+
...params.headers
|
|
50372
|
+
}
|
|
50373
|
+
});
|
|
50374
|
+
};
|
|
50375
|
+
var getConnectionRequest = (parameters, options) => {
|
|
50376
|
+
const params = buildClientParams([parameters], [
|
|
50377
|
+
{
|
|
50378
|
+
args: [
|
|
50379
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50380
|
+
{ in: "path", key: "organization_id" },
|
|
50381
|
+
{ in: "path", key: "request_id" }
|
|
50382
|
+
]
|
|
50383
|
+
}
|
|
50384
|
+
]);
|
|
50385
|
+
return (options?.client ?? client).get({
|
|
50386
|
+
responseStyle: "data",
|
|
50387
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50388
|
+
url: "/v1/organizations/{organization_id}/connections/requests/{request_id}",
|
|
50389
|
+
...options,
|
|
50390
|
+
...params
|
|
50391
|
+
});
|
|
50392
|
+
};
|
|
50393
|
+
var discoverConnection = (parameters, options) => {
|
|
50394
|
+
const params = buildClientParams([parameters], [
|
|
50395
|
+
{
|
|
50396
|
+
args: [
|
|
50397
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50398
|
+
{ in: "path", key: "organization_id" },
|
|
50399
|
+
{ in: "path", key: "grant_id" },
|
|
50400
|
+
{ in: "query", key: "project_id" },
|
|
50401
|
+
{ in: "query", key: "environment_id" },
|
|
50402
|
+
{ in: "query", key: "provider_organization_id" },
|
|
50403
|
+
{ in: "query", key: "team_id" }
|
|
50404
|
+
]
|
|
50405
|
+
}
|
|
50406
|
+
]);
|
|
50407
|
+
return (options?.client ?? client).get({
|
|
50408
|
+
responseStyle: "data",
|
|
50409
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50410
|
+
url: "/v1/organizations/{organization_id}/connections/{grant_id}/catalog",
|
|
50411
|
+
...options,
|
|
50412
|
+
...params
|
|
50413
|
+
});
|
|
50414
|
+
};
|
|
50415
|
+
var importConnection = (parameters, options) => {
|
|
50416
|
+
const params = buildClientParams([parameters], [
|
|
50417
|
+
{
|
|
50418
|
+
args: [
|
|
50419
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50420
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
50421
|
+
{ in: "path", key: "organization_id" },
|
|
50422
|
+
{ in: "path", key: "grant_id" },
|
|
50423
|
+
{ key: "connectionImportRequest", map: "body" }
|
|
50424
|
+
]
|
|
50425
|
+
}
|
|
50426
|
+
]);
|
|
50427
|
+
return (options?.client ?? client).post({
|
|
50428
|
+
responseStyle: "data",
|
|
50429
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50430
|
+
url: "/v1/organizations/{organization_id}/connections/{grant_id}/imports",
|
|
50431
|
+
...options,
|
|
50432
|
+
...params,
|
|
50433
|
+
headers: {
|
|
50434
|
+
"Content-Type": "application/json",
|
|
50435
|
+
...options?.headers,
|
|
50436
|
+
...params.headers
|
|
50437
|
+
}
|
|
50438
|
+
});
|
|
50439
|
+
};
|
|
50440
|
+
var disconnectConnection = (parameters, options) => {
|
|
50441
|
+
const params = buildClientParams([parameters], [
|
|
50442
|
+
{
|
|
50443
|
+
args: [
|
|
50444
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
50445
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
50446
|
+
{ in: "path", key: "organization_id" },
|
|
50447
|
+
{ in: "path", key: "grant_id" }
|
|
50448
|
+
]
|
|
50449
|
+
}
|
|
50450
|
+
]);
|
|
50451
|
+
return (options?.client ?? client).delete({
|
|
50452
|
+
responseStyle: "data",
|
|
50453
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
50454
|
+
url: "/v1/organizations/{organization_id}/connections/{grant_id}",
|
|
50455
|
+
...options,
|
|
50456
|
+
...params
|
|
50457
|
+
});
|
|
50458
|
+
};
|
|
50209
50459
|
var getNativeAuthConfiguration = (parameters, options) => {
|
|
50210
50460
|
const params = buildClientParams([parameters], [
|
|
50211
50461
|
{
|
|
@@ -54057,6 +54307,82 @@ function checkedResponse(kind, value) {
|
|
|
54057
54307
|
}
|
|
54058
54308
|
}
|
|
54059
54309
|
|
|
54310
|
+
// packages/contracts/dist/connection-management.js
|
|
54311
|
+
var ulid5 = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;
|
|
54312
|
+
function record8(raw, keys) {
|
|
54313
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
54314
|
+
throw new TypeError("Invalid connection response");
|
|
54315
|
+
const value = raw;
|
|
54316
|
+
if (Object.keys(value).length !== keys.length || keys.some((key) => !Object.hasOwn(value, key)))
|
|
54317
|
+
throw new TypeError("Invalid connection response");
|
|
54318
|
+
return value;
|
|
54319
|
+
}
|
|
54320
|
+
function date2(raw) {
|
|
54321
|
+
if (typeof raw !== "string" || !Number.isFinite(Date.parse(raw)))
|
|
54322
|
+
throw new TypeError("Invalid connection response");
|
|
54323
|
+
}
|
|
54324
|
+
function items(raw) {
|
|
54325
|
+
if (!Array.isArray(raw) || raw.length > 1e4)
|
|
54326
|
+
throw new TypeError("Invalid connection response");
|
|
54327
|
+
for (const row of raw) {
|
|
54328
|
+
const v = record8(row, ["id", "name"]);
|
|
54329
|
+
if (!Number.isSafeInteger(v["id"]) || Number(v["id"]) < 1 || typeof v["name"] !== "string" || !v["name"] || v["name"].length > 1024)
|
|
54330
|
+
throw new TypeError("Invalid connection response");
|
|
54331
|
+
}
|
|
54332
|
+
}
|
|
54333
|
+
function parseConnectionResponse(kind, raw, expectedOrigin) {
|
|
54334
|
+
if (kind === "connection-begin") {
|
|
54335
|
+
const v = record8(raw, ["request_id", "url", "expires_at"]);
|
|
54336
|
+
date2(v["expires_at"]);
|
|
54337
|
+
if (typeof v["request_id"] !== "string" || !/^[a-f0-9]{64}$/u.test(v["request_id"]) || typeof v["url"] !== "string")
|
|
54338
|
+
throw new TypeError("Invalid connection response");
|
|
54339
|
+
const url = new URL(v["url"]);
|
|
54340
|
+
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") ?? ""))
|
|
54341
|
+
throw new TypeError("Invalid connection response");
|
|
54342
|
+
} else if (kind === "connection-status") {
|
|
54343
|
+
const v = record8(raw, ["state", "expires_at"]);
|
|
54344
|
+
date2(v["expires_at"]);
|
|
54345
|
+
if (!["pending", "consumed", "expired"].includes(String(v["state"])))
|
|
54346
|
+
throw new TypeError("Invalid connection response");
|
|
54347
|
+
} else if (kind === "connection-disconnect") {
|
|
54348
|
+
const v = record8(raw, ["state"]);
|
|
54349
|
+
if (!["disconnected", "revocation_pending"].includes(String(v["state"])))
|
|
54350
|
+
throw new TypeError("Invalid connection response");
|
|
54351
|
+
} else if (kind === "connection-import") {
|
|
54352
|
+
const v = record8(raw, [
|
|
54353
|
+
"id",
|
|
54354
|
+
"grant_id",
|
|
54355
|
+
"project_id",
|
|
54356
|
+
"environment_id",
|
|
54357
|
+
"provider_organization_id",
|
|
54358
|
+
"team_id",
|
|
54359
|
+
"connection_id"
|
|
54360
|
+
]);
|
|
54361
|
+
for (const key of ["id", "grant_id", "project_id", "environment_id"])
|
|
54362
|
+
if (typeof v[key] !== "string" || !ulid5.test(v[key]))
|
|
54363
|
+
throw new TypeError("Invalid connection response");
|
|
54364
|
+
for (const key of ["provider_organization_id", "team_id", "connection_id"])
|
|
54365
|
+
if (!Number.isSafeInteger(v[key]) || Number(v[key]) < 1)
|
|
54366
|
+
throw new TypeError("Invalid connection response");
|
|
54367
|
+
} else if (kind === "connection-discover") {
|
|
54368
|
+
const v = record8(raw, ["organizations", "teams", "connections"]);
|
|
54369
|
+
items(v["organizations"]);
|
|
54370
|
+
items(v["teams"]);
|
|
54371
|
+
items(v["connections"]);
|
|
54372
|
+
} else {
|
|
54373
|
+
const v = record8(raw, ["connections"]);
|
|
54374
|
+
if (!Array.isArray(v["connections"]) || v["connections"].length > 1e4)
|
|
54375
|
+
throw new TypeError("Invalid connection response");
|
|
54376
|
+
for (const row of v["connections"]) {
|
|
54377
|
+
const grant = record8(row, ["id", "provider", "state", "created_at"]);
|
|
54378
|
+
date2(grant["created_at"]);
|
|
54379
|
+
if (typeof grant["id"] !== "string" || !ulid5.test(grant["id"]) || grant["provider"] !== "make" || !["active", "refreshing", "reconnect_required", "disconnecting", "disconnected"].includes(String(grant["state"])))
|
|
54380
|
+
throw new TypeError("Invalid connection response");
|
|
54381
|
+
}
|
|
54382
|
+
}
|
|
54383
|
+
return raw;
|
|
54384
|
+
}
|
|
54385
|
+
|
|
54060
54386
|
// apps/product-cli/dist/product-api.js
|
|
54061
54387
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
54062
54388
|
|
|
@@ -54719,8 +55045,8 @@ function parsePreviewView(value, scope) {
|
|
|
54719
55045
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
54720
55046
|
throw new TypeError("Invalid preview response");
|
|
54721
55047
|
const row = value;
|
|
54722
|
-
const
|
|
54723
|
-
if (Object.keys(row).sort().join(",") !== "environment,id,project_id,source,status,url" || typeof row["id"] !== "string" || !
|
|
55048
|
+
const ulid6 = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;
|
|
55049
|
+
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
55050
|
throw new TypeError("Invalid preview response");
|
|
54725
55051
|
if (row["source"] !== null) {
|
|
54726
55052
|
const source = row["source"];
|
|
@@ -54830,7 +55156,7 @@ function normalizeEgressOrigins(value) {
|
|
|
54830
55156
|
}
|
|
54831
55157
|
function forbiddenEgressHostname(hostname) {
|
|
54832
55158
|
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("]");
|
|
55159
|
+
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
55160
|
}
|
|
54835
55161
|
function parseOhmyhostConfigYaml(source) {
|
|
54836
55162
|
if (typeof source !== "string") {
|
|
@@ -54869,13 +55195,69 @@ function isRecordValue(value) {
|
|
|
54869
55195
|
function hasExactKeys(value, keys) {
|
|
54870
55196
|
return Object.keys(value).sort().join(",") === [...keys].sort().join(",");
|
|
54871
55197
|
}
|
|
55198
|
+
async function executeConnectionCommand(client2, origin, command) {
|
|
55199
|
+
const organization_id = command.organizationId;
|
|
55200
|
+
if ((command.kind === "connection-begin" || command.kind === "connection-discover") && command.projectId === void 0 !== (command.environmentId === void 0))
|
|
55201
|
+
throw new TypeError("Invalid connection scope");
|
|
55202
|
+
let result;
|
|
55203
|
+
switch (command.kind) {
|
|
55204
|
+
case "connection-begin":
|
|
55205
|
+
result = await beginConnection({
|
|
55206
|
+
organization_id,
|
|
55207
|
+
"Idempotency-Key": command.idempotencyKey,
|
|
55208
|
+
connectionBegin: {
|
|
55209
|
+
provider: "make",
|
|
55210
|
+
...command.projectId ? { project_id: command.projectId, environment_id: command.environmentId } : {}
|
|
55211
|
+
}
|
|
55212
|
+
}, { client: client2 });
|
|
55213
|
+
break;
|
|
55214
|
+
case "connection-list":
|
|
55215
|
+
result = await listConnections({ organization_id, scope: "workspace" }, { client: client2 });
|
|
55216
|
+
break;
|
|
55217
|
+
case "connection-status":
|
|
55218
|
+
result = await getConnectionRequest({ organization_id, request_id: command.requestId }, { client: client2 });
|
|
55219
|
+
break;
|
|
55220
|
+
case "connection-discover":
|
|
55221
|
+
result = await discoverConnection({
|
|
55222
|
+
organization_id,
|
|
55223
|
+
grant_id: command.grantId,
|
|
55224
|
+
...command.projectId ? { project_id: command.projectId, environment_id: command.environmentId } : {},
|
|
55225
|
+
...command.providerOrganizationId === void 0 ? {} : { provider_organization_id: command.providerOrganizationId },
|
|
55226
|
+
...command.teamId === void 0 ? {} : { team_id: command.teamId }
|
|
55227
|
+
}, { client: client2 });
|
|
55228
|
+
break;
|
|
55229
|
+
case "connection-import":
|
|
55230
|
+
result = await importConnection({
|
|
55231
|
+
organization_id,
|
|
55232
|
+
grant_id: command.grantId,
|
|
55233
|
+
"Idempotency-Key": command.idempotencyKey,
|
|
55234
|
+
connectionImportRequest: {
|
|
55235
|
+
project_id: command.projectId,
|
|
55236
|
+
environment_id: command.environmentId,
|
|
55237
|
+
provider_organization_id: command.providerOrganizationId,
|
|
55238
|
+
team_id: command.teamId,
|
|
55239
|
+
connection_id: command.connectionId
|
|
55240
|
+
}
|
|
55241
|
+
}, { client: client2 });
|
|
55242
|
+
break;
|
|
55243
|
+
case "connection-disconnect":
|
|
55244
|
+
result = await disconnectConnection({ organization_id, grant_id: command.grantId, "Idempotency-Key": command.idempotencyKey }, { client: client2 });
|
|
55245
|
+
break;
|
|
55246
|
+
}
|
|
55247
|
+
return parseConnectionResponse(command.kind, result, origin);
|
|
55248
|
+
}
|
|
54872
55249
|
var GeneratedSdkProductApi = class {
|
|
54873
55250
|
#client;
|
|
55251
|
+
#connectionOrigin;
|
|
54874
55252
|
managedSource;
|
|
54875
55253
|
constructor(baseUrl, accessToken, fetch2) {
|
|
55254
|
+
this.#connectionOrigin = new URL(baseUrl).origin;
|
|
54876
55255
|
this.#client = createClient({ auth: accessToken, baseUrl, fetch: fetch2, throwOnError: true });
|
|
54877
55256
|
this.managedSource = new GeneratedSdkManagedSourceApi(() => this.#client);
|
|
54878
55257
|
}
|
|
55258
|
+
async connection(command) {
|
|
55259
|
+
return executeConnectionCommand(this.#client, this.#connectionOrigin, command);
|
|
55260
|
+
}
|
|
54879
55261
|
async changeDatabaseCompute(input) {
|
|
54880
55262
|
return changeDatabaseCompute({
|
|
54881
55263
|
project_id: input.projectId,
|
|
@@ -56131,8 +56513,8 @@ function pnpmLockedVersion(document2, packageName) {
|
|
|
56131
56513
|
}
|
|
56132
56514
|
return null;
|
|
56133
56515
|
}
|
|
56134
|
-
function ownValue(
|
|
56135
|
-
return isRecord4(
|
|
56516
|
+
function ownValue(record9, key) {
|
|
56517
|
+
return isRecord4(record9) && Object.hasOwn(record9, key) ? record9[key] : void 0;
|
|
56136
56518
|
}
|
|
56137
56519
|
function isRecord4(value) {
|
|
56138
56520
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -56348,7 +56730,7 @@ function astroConfigFindings(text, path2, mode) {
|
|
|
56348
56730
|
if ("finding" in lexed)
|
|
56349
56731
|
return [lexed.finding];
|
|
56350
56732
|
const tokens = lexed.tokens;
|
|
56351
|
-
const hasPropertyKey = (
|
|
56733
|
+
const hasPropertyKey = (items2, name) => items2.some((token, index) => token.value === name && items2[index + 1]?.value === ":");
|
|
56352
56734
|
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
56735
|
return invalid7 ? [diagnostic({ code: "astro_config_unsupported", path: path2 })] : [];
|
|
56354
56736
|
}
|
|
@@ -59528,6 +59910,7 @@ export {
|
|
|
59528
59910
|
executeNativeAuth,
|
|
59529
59911
|
GeneratedSdkManagedSourceApi,
|
|
59530
59912
|
assertDatabaseTableAnswer,
|
|
59913
|
+
executeConnectionCommand,
|
|
59531
59914
|
GeneratedSdkProductApi,
|
|
59532
59915
|
RepositoryInitError,
|
|
59533
59916
|
RepositoryInitBlockedError,
|