@volvel/cli 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +21 -3
- package/dist/screens/assets/{MarkdownBody-fUbNZkUB.js → MarkdownBody-BOV5WGbT.js} +1 -1
- package/dist/screens/assets/index-B6g2-AGi.js +588 -0
- package/dist/screens/index.html +1 -1
- package/dist/volvel.mjs +371 -22
- package/package.json +11 -6
- package/dist/screens/assets/index-DIiB-Jty.js +0 -581
package/dist/screens/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>App</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-B6g2-AGi.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
|
|
9
9
|
<link rel="stylesheet" crossorigin href="./assets/index-C33eAIGD.css">
|
|
10
10
|
</head>
|
package/dist/volvel.mjs
CHANGED
|
@@ -16338,6 +16338,11 @@ function appPolicy(development) {
|
|
|
16338
16338
|
].join("; ");
|
|
16339
16339
|
}
|
|
16340
16340
|
var APP_POLICY = appPolicy();
|
|
16341
|
+
var CODE_APP_SANDBOX = "sandbox allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads allow-modals";
|
|
16342
|
+
function codeAppPolicy(development) {
|
|
16343
|
+
return `${appPolicy(development)}; ${CODE_APP_SANDBOX}`;
|
|
16344
|
+
}
|
|
16345
|
+
var CODE_APP_POLICY = codeAppPolicy();
|
|
16341
16346
|
var WIDGET_POLICY = "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src data: blob:; sandbox allow-scripts";
|
|
16342
16347
|
|
|
16343
16348
|
// ../../node_modules/.pnpm/typebox@1.4.7/node_modules/typebox/build/system/memory/memory.mjs
|
|
@@ -20745,7 +20750,20 @@ function derivedToolName(prefix, path3) {
|
|
|
20745
20750
|
const name = `${prefix}_${path3.replace(/\//g, "__").replace(/-/g, "_")}`;
|
|
20746
20751
|
return name.length <= 64 ? name : name.slice(0, 64);
|
|
20747
20752
|
}
|
|
20748
|
-
var RESERVED_TOOL_NAMES = [
|
|
20753
|
+
var RESERVED_TOOL_NAMES = [
|
|
20754
|
+
"get_run",
|
|
20755
|
+
"get_flow_run",
|
|
20756
|
+
"list_approvals",
|
|
20757
|
+
"decide_approval",
|
|
20758
|
+
"get_health",
|
|
20759
|
+
"get_figures",
|
|
20760
|
+
"get_instance_health",
|
|
20761
|
+
"list_tenants",
|
|
20762
|
+
"get_tenant_health",
|
|
20763
|
+
"get_tenant_figures",
|
|
20764
|
+
"get_instance_figures",
|
|
20765
|
+
"why_runs_wait"
|
|
20766
|
+
];
|
|
20749
20767
|
function toolNameOf(resource) {
|
|
20750
20768
|
if (resource.kind !== "script" && resource.kind !== "flow")
|
|
20751
20769
|
return void 0;
|
|
@@ -21278,7 +21296,7 @@ function checkFlow(body) {
|
|
|
21278
21296
|
var SURFACES = ["app", "dashboard"];
|
|
21279
21297
|
var CATEGORIES = ["records", "action", "understand", "organize", "content"];
|
|
21280
21298
|
var DATA_SHAPES = ["rows", "summary", "record", "approvals"];
|
|
21281
|
-
var SOURCE_KINDS = ["table", "query", "sql", "approvals"];
|
|
21299
|
+
var SOURCE_KINDS = ["table", "query", "sql", "approvals", "figures"];
|
|
21282
21300
|
var EVENT_GIVES = ["record", "group", "nothing"];
|
|
21283
21301
|
var TABS = ["data", "display", "actions", "rules"];
|
|
21284
21302
|
var CONTROLS = [
|
|
@@ -21856,6 +21874,7 @@ var list = defineWidget({
|
|
|
21856
21874
|
events: { rowClick: { gives: "record", label: "When a record is clicked" } },
|
|
21857
21875
|
layout: { min: { w: 3, h: 4 }, default: { w: 4, h: 8 }, phone: "stack" }
|
|
21858
21876
|
});
|
|
21877
|
+
var SUMMARY_SOURCES = ["table", "query", "sql", "figures"];
|
|
21859
21878
|
var stat = defineWidget({
|
|
21860
21879
|
type: "core/stat",
|
|
21861
21880
|
version: "1.0.0",
|
|
@@ -21864,7 +21883,14 @@ var stat = defineWidget({
|
|
|
21864
21883
|
category: "understand",
|
|
21865
21884
|
icon: "hash",
|
|
21866
21885
|
surfaces: ["app", "dashboard"],
|
|
21867
|
-
data: {
|
|
21886
|
+
data: {
|
|
21887
|
+
value: {
|
|
21888
|
+
shape: "summary",
|
|
21889
|
+
sources: SUMMARY_SOURCES,
|
|
21890
|
+
values: { min: 1, max: 1 },
|
|
21891
|
+
breakdowns: { min: 0, max: 0 }
|
|
21892
|
+
}
|
|
21893
|
+
},
|
|
21868
21894
|
dataHints: [
|
|
21869
21895
|
{
|
|
21870
21896
|
of: "value",
|
|
@@ -21995,7 +22021,14 @@ var chart = defineWidget({
|
|
|
21995
22021
|
category: "understand",
|
|
21996
22022
|
icon: "chart",
|
|
21997
22023
|
surfaces: ["app", "dashboard"],
|
|
21998
|
-
data: {
|
|
22024
|
+
data: {
|
|
22025
|
+
rows: {
|
|
22026
|
+
shape: "summary",
|
|
22027
|
+
sources: SUMMARY_SOURCES,
|
|
22028
|
+
values: { min: 1, max: 6 },
|
|
22029
|
+
breakdowns: { min: 1, max: 2 }
|
|
22030
|
+
}
|
|
22031
|
+
},
|
|
21999
22032
|
dataHints: [
|
|
22000
22033
|
{
|
|
22001
22034
|
of: "rows",
|
|
@@ -22273,7 +22306,14 @@ var pivot = defineWidget({
|
|
|
22273
22306
|
category: "understand",
|
|
22274
22307
|
icon: "grid",
|
|
22275
22308
|
surfaces: ["app", "dashboard"],
|
|
22276
|
-
data: {
|
|
22309
|
+
data: {
|
|
22310
|
+
rows: {
|
|
22311
|
+
shape: "summary",
|
|
22312
|
+
sources: SUMMARY_SOURCES,
|
|
22313
|
+
values: { min: 1, max: 1 },
|
|
22314
|
+
breakdowns: { min: 2, max: 3 }
|
|
22315
|
+
}
|
|
22316
|
+
},
|
|
22277
22317
|
dataHints: [
|
|
22278
22318
|
{
|
|
22279
22319
|
of: "rows",
|
|
@@ -23145,7 +23185,14 @@ var goal = defineWidget({
|
|
|
23145
23185
|
icon: "target",
|
|
23146
23186
|
surfaces: ["app", "dashboard"],
|
|
23147
23187
|
// The second value, when there is one, is where `goalFrom` reads the goal: a column of the source, summed or the like.
|
|
23148
|
-
data: {
|
|
23188
|
+
data: {
|
|
23189
|
+
value: {
|
|
23190
|
+
shape: "summary",
|
|
23191
|
+
sources: SUMMARY_SOURCES,
|
|
23192
|
+
values: { min: 1, max: 2 },
|
|
23193
|
+
breakdowns: { min: 0, max: 0 }
|
|
23194
|
+
}
|
|
23195
|
+
},
|
|
23149
23196
|
dataHints: [
|
|
23150
23197
|
{
|
|
23151
23198
|
of: "value",
|
|
@@ -23486,6 +23533,200 @@ var LABS_WIDGETS = [];
|
|
|
23486
23533
|
// ../manifest/dist/page.js
|
|
23487
23534
|
var import__ = __toESM(require__(), 1);
|
|
23488
23535
|
|
|
23536
|
+
// ../manifest/dist/figures.js
|
|
23537
|
+
var FIGURE_FACTS = {
|
|
23538
|
+
"runs.started": {
|
|
23539
|
+
label: "Runs started",
|
|
23540
|
+
unit: "count",
|
|
23541
|
+
help: "Script runs a worker took, first attempts and retries alike."
|
|
23542
|
+
},
|
|
23543
|
+
"runs.succeeded": {
|
|
23544
|
+
label: "Runs succeeded",
|
|
23545
|
+
unit: "count",
|
|
23546
|
+
help: "Script runs that ended well."
|
|
23547
|
+
},
|
|
23548
|
+
"runs.failed": {
|
|
23549
|
+
label: "Runs failed",
|
|
23550
|
+
unit: "count",
|
|
23551
|
+
help: "Script runs that ended in a failure of the script, its input or its output."
|
|
23552
|
+
},
|
|
23553
|
+
"runs.timed_out": {
|
|
23554
|
+
label: "Runs timed out",
|
|
23555
|
+
unit: "count",
|
|
23556
|
+
help: "Script runs stopped at their time limit."
|
|
23557
|
+
},
|
|
23558
|
+
"runs.lost": {
|
|
23559
|
+
label: "Runs lost",
|
|
23560
|
+
unit: "count",
|
|
23561
|
+
help: "Script runs that failed because their worker stopped answering, with no retries left."
|
|
23562
|
+
},
|
|
23563
|
+
"runs.cancelled": {
|
|
23564
|
+
label: "Runs canceled",
|
|
23565
|
+
unit: "count",
|
|
23566
|
+
help: "Script runs canceled before they ended."
|
|
23567
|
+
},
|
|
23568
|
+
"runs.ms": {
|
|
23569
|
+
label: "Run time",
|
|
23570
|
+
unit: "ms",
|
|
23571
|
+
help: "The time script runs took from start to end, added up."
|
|
23572
|
+
},
|
|
23573
|
+
"queue_wait.ms": {
|
|
23574
|
+
label: "Time waited",
|
|
23575
|
+
unit: "ms",
|
|
23576
|
+
help: "How long first attempts waited from when they were due to when a worker took them, added up."
|
|
23577
|
+
},
|
|
23578
|
+
"queue_wait.count": {
|
|
23579
|
+
label: "Waits measured",
|
|
23580
|
+
unit: "count",
|
|
23581
|
+
help: "First attempts whose wait is in Time waited."
|
|
23582
|
+
},
|
|
23583
|
+
"queue_wait.ms.max": {
|
|
23584
|
+
label: "Longest wait",
|
|
23585
|
+
unit: "ms",
|
|
23586
|
+
help: "The longest a first attempt waited."
|
|
23587
|
+
},
|
|
23588
|
+
"memory.mb": {
|
|
23589
|
+
label: "Memory held",
|
|
23590
|
+
unit: "mb",
|
|
23591
|
+
help: "The most memory each script run held, added up over the runs that reported it."
|
|
23592
|
+
},
|
|
23593
|
+
"memory.count": {
|
|
23594
|
+
label: "Runs measured",
|
|
23595
|
+
unit: "count",
|
|
23596
|
+
help: "Script runs whose memory is in Memory held."
|
|
23597
|
+
},
|
|
23598
|
+
"memory.mb.max": {
|
|
23599
|
+
label: "Most memory",
|
|
23600
|
+
unit: "mb",
|
|
23601
|
+
help: "The most memory any one script run held."
|
|
23602
|
+
},
|
|
23603
|
+
"requests.count": {
|
|
23604
|
+
label: "Requests",
|
|
23605
|
+
unit: "count",
|
|
23606
|
+
help: "Requests to the API about the tenant."
|
|
23607
|
+
},
|
|
23608
|
+
"requests.ms": {
|
|
23609
|
+
label: "Request time",
|
|
23610
|
+
unit: "ms",
|
|
23611
|
+
help: "The time those requests took, added up."
|
|
23612
|
+
},
|
|
23613
|
+
"requests.errors": {
|
|
23614
|
+
label: "Request errors",
|
|
23615
|
+
unit: "count",
|
|
23616
|
+
help: "Requests the instance failed with an error of its own (5xx other than 503)."
|
|
23617
|
+
},
|
|
23618
|
+
"rows.returned": {
|
|
23619
|
+
label: "Rows returned",
|
|
23620
|
+
unit: "count",
|
|
23621
|
+
help: "Rows the tenant's data calls returned: read through the API, a widget, a query or a script, or given back after a write."
|
|
23622
|
+
},
|
|
23623
|
+
"refused.auth": {
|
|
23624
|
+
label: "Refused: sign-in or permission",
|
|
23625
|
+
unit: "count",
|
|
23626
|
+
help: "Requests refused as not signed in (401) or not allowed (403)."
|
|
23627
|
+
},
|
|
23628
|
+
"refused.rate": {
|
|
23629
|
+
label: "Refused: too fast or busy",
|
|
23630
|
+
unit: "count",
|
|
23631
|
+
help: "Requests refused for coming too fast (429) or the instance being busy (503)."
|
|
23632
|
+
},
|
|
23633
|
+
"refused.webhook": {
|
|
23634
|
+
label: "Refused: webhooks",
|
|
23635
|
+
unit: "count",
|
|
23636
|
+
help: "Webhook calls refused: a bad signature, body or input, a paused trigger, a filter, or too many at once."
|
|
23637
|
+
},
|
|
23638
|
+
"queued.max": {
|
|
23639
|
+
label: "Most runs due",
|
|
23640
|
+
unit: "count",
|
|
23641
|
+
help: "The most runs due at once and not yet taken, looked at each minute."
|
|
23642
|
+
},
|
|
23643
|
+
"wait.no_worker.max": {
|
|
23644
|
+
label: "Waiting for a worker",
|
|
23645
|
+
unit: "count",
|
|
23646
|
+
help: "The most runs due at once with no worker of the tenant (or of their pool) connected to take them, looked at each minute. For managed workers: none had been started yet."
|
|
23647
|
+
},
|
|
23648
|
+
"wait.busy.max": {
|
|
23649
|
+
label: "Waiting for a free worker",
|
|
23650
|
+
unit: "count",
|
|
23651
|
+
help: "The most runs due at once while the tenant's workers were connected and busy with other scripts, looked at each minute. They start when one of those ends: more workers, or a higher concurrency, would start them sooner."
|
|
23652
|
+
},
|
|
23653
|
+
"wait.workspace_limit": {
|
|
23654
|
+
label: "Waited: workspace limit",
|
|
23655
|
+
unit: "count",
|
|
23656
|
+
help: "Times a worker asked for a run that was due and its workspace was at its limit of runs at once."
|
|
23657
|
+
},
|
|
23658
|
+
"wait.slots": {
|
|
23659
|
+
label: "Waited: no run slot",
|
|
23660
|
+
unit: "count",
|
|
23661
|
+
help: "Times a worker asked for a run that was due and its machine had no run slot free."
|
|
23662
|
+
},
|
|
23663
|
+
"wait.share": {
|
|
23664
|
+
label: "Waited: fair share",
|
|
23665
|
+
unit: "count",
|
|
23666
|
+
help: "Times a worker asked for a run that was due and its tenant had its fair share of a machine other tenants were waiting for."
|
|
23667
|
+
},
|
|
23668
|
+
"wait.memory": {
|
|
23669
|
+
label: "Waited: memory",
|
|
23670
|
+
unit: "count",
|
|
23671
|
+
help: "Times a worker asked for a run that was due and its machine was below its memory floor."
|
|
23672
|
+
},
|
|
23673
|
+
"runs.ended": {
|
|
23674
|
+
label: "Runs ended",
|
|
23675
|
+
unit: "count",
|
|
23676
|
+
derived: true,
|
|
23677
|
+
help: "Script runs that ended, however they ended."
|
|
23678
|
+
},
|
|
23679
|
+
"runs.failed_share": {
|
|
23680
|
+
label: "Failed share",
|
|
23681
|
+
unit: "share",
|
|
23682
|
+
derived: true,
|
|
23683
|
+
help: "The share of ended script runs that did not succeed."
|
|
23684
|
+
},
|
|
23685
|
+
"runs.avg_ms": {
|
|
23686
|
+
label: "Average run time",
|
|
23687
|
+
unit: "ms",
|
|
23688
|
+
derived: true,
|
|
23689
|
+
help: "How long an ended script run took on average."
|
|
23690
|
+
},
|
|
23691
|
+
"queue_wait.avg_ms": {
|
|
23692
|
+
label: "Average wait",
|
|
23693
|
+
unit: "ms",
|
|
23694
|
+
derived: true,
|
|
23695
|
+
help: "How long a first attempt waited on average."
|
|
23696
|
+
},
|
|
23697
|
+
"memory.avg_mb": {
|
|
23698
|
+
label: "Average memory",
|
|
23699
|
+
unit: "mb",
|
|
23700
|
+
derived: true,
|
|
23701
|
+
help: "The most memory a script run held, on average."
|
|
23702
|
+
},
|
|
23703
|
+
"requests.avg_ms": {
|
|
23704
|
+
label: "Average request time",
|
|
23705
|
+
unit: "ms",
|
|
23706
|
+
derived: true,
|
|
23707
|
+
help: "How long a request about the tenant took on average."
|
|
23708
|
+
},
|
|
23709
|
+
"refused.count": {
|
|
23710
|
+
label: "Refused",
|
|
23711
|
+
unit: "count",
|
|
23712
|
+
derived: true,
|
|
23713
|
+
help: "Requests and webhook calls refused, for any reason."
|
|
23714
|
+
},
|
|
23715
|
+
"wait.count": {
|
|
23716
|
+
label: "Waits",
|
|
23717
|
+
unit: "count",
|
|
23718
|
+
derived: true,
|
|
23719
|
+
help: "Times a worker asked for a due run and was turned away, for any reason."
|
|
23720
|
+
}
|
|
23721
|
+
};
|
|
23722
|
+
var FIGURE_NAMES = Object.keys(FIGURE_FACTS);
|
|
23723
|
+
var COUNTED_FIGURES = FIGURE_NAMES.filter((name) => !FIGURE_FACTS[name].derived);
|
|
23724
|
+
var PERIOD_MS = {
|
|
23725
|
+
"5m": 5 * 6e4,
|
|
23726
|
+
hour: 36e5,
|
|
23727
|
+
day: 864e5
|
|
23728
|
+
};
|
|
23729
|
+
|
|
23489
23730
|
// ../manifest/dist/parts.js
|
|
23490
23731
|
function filterWidgets(widgets, roles) {
|
|
23491
23732
|
return widgets.filter((widget) => roles.get(widget.type)?.role === "filters");
|
|
@@ -23712,6 +23953,41 @@ var sourceSchema = {
|
|
|
23712
23953
|
},
|
|
23713
23954
|
required: ["approvals"],
|
|
23714
23955
|
additionalProperties: false
|
|
23956
|
+
},
|
|
23957
|
+
{
|
|
23958
|
+
type: "object",
|
|
23959
|
+
properties: {
|
|
23960
|
+
figures: {
|
|
23961
|
+
type: "object",
|
|
23962
|
+
description: "The tenant's figures, counted by the instance every five minutes: runs, requests, refusals and why runs waited. On a dashboard, for a member who holds figures:read.",
|
|
23963
|
+
properties: {
|
|
23964
|
+
names: {
|
|
23965
|
+
type: "array",
|
|
23966
|
+
minItems: 1,
|
|
23967
|
+
maxItems: 6,
|
|
23968
|
+
uniqueItems: true,
|
|
23969
|
+
items: { enum: [...FIGURE_NAMES] },
|
|
23970
|
+
description: "The figures to read, by name."
|
|
23971
|
+
},
|
|
23972
|
+
every: {
|
|
23973
|
+
enum: ["5m", "hour", "day", "all"],
|
|
23974
|
+
description: "The length of each period, or `all` for one figure over the whole span. Default: hour."
|
|
23975
|
+
},
|
|
23976
|
+
by: {
|
|
23977
|
+
const: "workspace",
|
|
23978
|
+
description: "A row for each workspace in each period. Needs `scope: tenant`."
|
|
23979
|
+
},
|
|
23980
|
+
scope: {
|
|
23981
|
+
enum: ["workspace", "tenant"],
|
|
23982
|
+
description: "Whose figures: this workspace's (the default) or the whole tenant's."
|
|
23983
|
+
}
|
|
23984
|
+
},
|
|
23985
|
+
required: ["names"],
|
|
23986
|
+
additionalProperties: false
|
|
23987
|
+
}
|
|
23988
|
+
},
|
|
23989
|
+
required: ["figures"],
|
|
23990
|
+
additionalProperties: false
|
|
23715
23991
|
}
|
|
23716
23992
|
]
|
|
23717
23993
|
};
|
|
@@ -24388,6 +24664,41 @@ function checkWidgets(widgets, context2, at = "/body") {
|
|
|
24388
24664
|
}
|
|
24389
24665
|
continue;
|
|
24390
24666
|
}
|
|
24667
|
+
if ("figures" in source) {
|
|
24668
|
+
const figures = source.figures;
|
|
24669
|
+
if (declared.shape !== "summary" || !(declared.sources ?? []).includes("figures")) {
|
|
24670
|
+
say(`${where}/source`, `${definition.title} can't read figures`);
|
|
24671
|
+
continue;
|
|
24672
|
+
}
|
|
24673
|
+
if (context2.surface !== "dashboard") {
|
|
24674
|
+
say(`${where}/source`, "figures are read on a dashboard, not on an app's page");
|
|
24675
|
+
continue;
|
|
24676
|
+
}
|
|
24677
|
+
for (const [which, name2] of figures.names.entries()) {
|
|
24678
|
+
if (!(name2 in FIGURE_FACTS))
|
|
24679
|
+
say(`${where}/source/figures/names/${which}`, `there is no figure "${name2}"`);
|
|
24680
|
+
}
|
|
24681
|
+
if (figures.by && figures.scope !== "tenant")
|
|
24682
|
+
say(`${where}/source/figures/by`, "breaks the tenant's figures down: set `scope: tenant`");
|
|
24683
|
+
const values2 = declared.values ?? { min: 1, max: 1 };
|
|
24684
|
+
const breakdowns = declared.breakdowns ?? { min: 0, max: 1 };
|
|
24685
|
+
const have = (figures.every === "all" ? 0 : 1) + (figures.by ? 1 : 0);
|
|
24686
|
+
if (figures.names.length < values2.min || figures.names.length > values2.max)
|
|
24687
|
+
say(`${where}/source/figures/names`, values2.min === values2.max ? `${definition.title} reads ${values2.min === 1 ? "one figure" : `${values2.min} figures`}` : `${definition.title} reads ${values2.min} to ${values2.max} figures`);
|
|
24688
|
+
if (have < breakdowns.min || have > breakdowns.max)
|
|
24689
|
+
say(`${where}/source/figures`, `${definition.title} is broken down ${breakdowns.min === breakdowns.max ? breakdowns.min : `${breakdowns.min} to ${breakdowns.max}`} way${breakdowns.max === 1 ? "" : "s"}, and these figures are ${have} (the period, and \`by\`)`);
|
|
24690
|
+
(input.filters ?? []).forEach((binding, bound) => {
|
|
24691
|
+
const path3 = `${where}/filters/${bound}`;
|
|
24692
|
+
const filter2 = byName.get(binding.filter);
|
|
24693
|
+
if (!filter2)
|
|
24694
|
+
say(`${path3}/filter`, `the page has no filter "${binding.filter}"`);
|
|
24695
|
+
else if (filter2.type !== "date_range")
|
|
24696
|
+
say(path3, "figures are narrowed by a range of dates only");
|
|
24697
|
+
else if (binding.column !== void 0 && binding.column !== "at")
|
|
24698
|
+
say(`${path3}/column`, 'a range of dates narrows figures by the column "at"');
|
|
24699
|
+
});
|
|
24700
|
+
continue;
|
|
24701
|
+
}
|
|
24391
24702
|
if (declared.shape === "approvals") {
|
|
24392
24703
|
say(`${where}/source`, `${definition.title} reads approvals: choose which`);
|
|
24393
24704
|
continue;
|
|
@@ -26204,7 +26515,7 @@ var widgetKind = {
|
|
|
26204
26515
|
sources: {
|
|
26205
26516
|
type: "array",
|
|
26206
26517
|
items: { enum: [...SOURCE_KINDS], description: "Where it may come from." },
|
|
26207
|
-
description: "Where it may come from: a table, a query, SQL or
|
|
26518
|
+
description: "Where it may come from: a table, a query, SQL, approvals or figures."
|
|
26208
26519
|
},
|
|
26209
26520
|
values: rangeOf("For a summary: how many values it may work out."),
|
|
26210
26521
|
breakdowns: rangeOf("For a summary: how many ways it may be broken down.")
|
|
@@ -33246,6 +33557,8 @@ var BUILTIN_ROLE_NAMES = [
|
|
|
33246
33557
|
"deployer",
|
|
33247
33558
|
"developer",
|
|
33248
33559
|
"doc_writer",
|
|
33560
|
+
"instance_operator",
|
|
33561
|
+
"instance_reader",
|
|
33249
33562
|
"operator_admin",
|
|
33250
33563
|
"portal_reader",
|
|
33251
33564
|
"portal_user",
|
|
@@ -33274,6 +33587,15 @@ var PERMISSION_KINDS = [
|
|
|
33274
33587
|
write: "Create, rename, import and delete tenants."
|
|
33275
33588
|
}
|
|
33276
33589
|
},
|
|
33590
|
+
{
|
|
33591
|
+
kind: "figures",
|
|
33592
|
+
label: "Figures",
|
|
33593
|
+
group: "Tenant",
|
|
33594
|
+
scope: "tenant",
|
|
33595
|
+
verbs: {
|
|
33596
|
+
read: "See how the tenant's runs, requests and refusals have gone, and why runs waited: counts and times, never rows, inputs or outputs."
|
|
33597
|
+
}
|
|
33598
|
+
},
|
|
33277
33599
|
{
|
|
33278
33600
|
kind: "access_grant",
|
|
33279
33601
|
label: "Operator access",
|
|
@@ -56418,11 +56740,14 @@ async function startDevServer(options) {
|
|
|
56418
56740
|
// The sign-in pages are the instance's, reached through this server, so that a person
|
|
56419
56741
|
// who signs in comes back here and not to the instance.
|
|
56420
56742
|
portal: `/portal/${options.tenant.slug}`,
|
|
56421
|
-
principal: { id: null, ...options.principal }
|
|
56743
|
+
principal: { id: null, ...options.principal },
|
|
56744
|
+
// Sandboxed as when deployed (decision 0008): the page sends no cookie. This server adds the
|
|
56745
|
+
// developer's key to what it sends on to the instance, so the page needs no token of its own.
|
|
56746
|
+
token: null
|
|
56422
56747
|
};
|
|
56423
56748
|
const theme = `/api/v1/tenants/${options.tenant.id}/workspaces/${options.workspace.id}/theme.css`;
|
|
56424
56749
|
const nonce = randomBytes2(16).toString("base64");
|
|
56425
|
-
const policy = options.strict === false ? void 0 :
|
|
56750
|
+
const policy = options.strict === false ? void 0 : codeAppPolicy({ nonce, connect: DEV_SOCKETS });
|
|
56426
56751
|
const own = /* @__PURE__ */ new Map();
|
|
56427
56752
|
const settings2 = viteSettings(resolve6(directory, app.source), plugins);
|
|
56428
56753
|
const server = await vite.createServer({
|
|
@@ -56468,6 +56793,8 @@ async function startDevServer(options) {
|
|
|
56468
56793
|
port: options.port,
|
|
56469
56794
|
strictPort: false,
|
|
56470
56795
|
...policy ? { headers: { "content-security-policy": policy } } : {},
|
|
56796
|
+
// A sandboxed page asks for its modules as a page with no origin (`Origin: null`) would.
|
|
56797
|
+
cors: true,
|
|
56471
56798
|
proxy: {
|
|
56472
56799
|
"/portal": {
|
|
56473
56800
|
target: instance,
|
|
@@ -57360,7 +57687,7 @@ async function runLocally(args, io) {
|
|
|
57360
57687
|
await rm4(file, { force: true });
|
|
57361
57688
|
}
|
|
57362
57689
|
}
|
|
57363
|
-
var STARTER_SDK_RANGE = "^0.
|
|
57690
|
+
var STARTER_SDK_RANGE = "^0.7.0";
|
|
57364
57691
|
var STARTER = {
|
|
57365
57692
|
"package.json": `${JSON.stringify({
|
|
57366
57693
|
name: "tenant-repository",
|
|
@@ -57658,6 +57985,8 @@ async function pull(args, io) {
|
|
|
57658
57985
|
// dist/tenant-move.js
|
|
57659
57986
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
57660
57987
|
import { open, rename, rm as rm6, stat as stat3 } from "node:fs/promises";
|
|
57988
|
+
import { request as httpRequest2 } from "node:http";
|
|
57989
|
+
import { request as httpsRequest2 } from "node:https";
|
|
57661
57990
|
import { basename, resolve as resolve11 } from "node:path";
|
|
57662
57991
|
import { Readable, Transform } from "node:stream";
|
|
57663
57992
|
import { pipeline } from "node:stream/promises";
|
|
@@ -57674,6 +58003,32 @@ function passphrase(io) {
|
|
|
57674
58003
|
}
|
|
57675
58004
|
var megabytes = (bytes) => `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
57676
58005
|
var duration = (seconds) => seconds < 60 ? `${Math.round(seconds)} s` : `${Math.floor(seconds / 60)} min ${Math.round(seconds % 60)} s`;
|
|
58006
|
+
function sendStream(url, headers, body) {
|
|
58007
|
+
const target = new URL(url);
|
|
58008
|
+
const send = target.protocol === "https:" ? httpsRequest2 : httpRequest2;
|
|
58009
|
+
return new Promise((done, fail) => {
|
|
58010
|
+
const req = send(target, { method: "POST", headers }, (res) => {
|
|
58011
|
+
const chunks = [];
|
|
58012
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
58013
|
+
res.on("error", fail);
|
|
58014
|
+
res.on("end", () => {
|
|
58015
|
+
const answer = new Headers();
|
|
58016
|
+
for (const [name, value] of Object.entries(res.headers)) {
|
|
58017
|
+
if (value !== void 0)
|
|
58018
|
+
answer.set(name, Array.isArray(value) ? value.join(", ") : value);
|
|
58019
|
+
}
|
|
58020
|
+
const status = res.statusCode ?? 0;
|
|
58021
|
+
const content = status === 204 || status === 304 ? null : Buffer.concat(chunks);
|
|
58022
|
+
done(new Response(content, { status, headers: answer }));
|
|
58023
|
+
});
|
|
58024
|
+
});
|
|
58025
|
+
req.on("error", fail);
|
|
58026
|
+
pipeline(body, req).catch((error) => {
|
|
58027
|
+
req.destroy(error);
|
|
58028
|
+
fail(error);
|
|
58029
|
+
});
|
|
58030
|
+
});
|
|
58031
|
+
}
|
|
57677
58032
|
function counting(io, verb, total) {
|
|
57678
58033
|
const started = Date.now();
|
|
57679
58034
|
let bytes = 0;
|
|
@@ -57835,18 +58190,12 @@ async function tenantImport(args, io, settings2, api) {
|
|
|
57835
58190
|
const reading = createReadStream(file);
|
|
57836
58191
|
reading.on("error", (error) => counted.stream.destroy(error));
|
|
57837
58192
|
reading.pipe(counted.stream);
|
|
57838
|
-
const sent = await
|
|
57839
|
-
|
|
57840
|
-
|
|
57841
|
-
|
|
57842
|
-
|
|
57843
|
-
|
|
57844
|
-
"x-export-passphrase": secret
|
|
57845
|
-
},
|
|
57846
|
-
body: Readable.toWeb(counted.stream),
|
|
57847
|
-
// Node needs this said to send a body as it is read.
|
|
57848
|
-
duplex: "half"
|
|
57849
|
-
}).catch((error) => {
|
|
58193
|
+
const sent = await sendStream(`${base}/instance/tenant-imports/staged?name=${encodeURIComponent(basename(file))}`, {
|
|
58194
|
+
...headers,
|
|
58195
|
+
"content-type": "application/x-tar",
|
|
58196
|
+
"content-length": String(size),
|
|
58197
|
+
"x-export-passphrase": secret
|
|
58198
|
+
}, counted.stream).catch((error) => {
|
|
57850
58199
|
counted.done();
|
|
57851
58200
|
throw new CliError(`The file could not be sent to ${settings2.url}. ${error.cause?.message ?? error.message}`);
|
|
57852
58201
|
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volvel/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The volvel command: builds a tenant's repository and deploys it, runs scripts, and moves tenants between instances.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/volveldev/Volvel.git",
|
|
10
|
+
"directory": "packages/cli"
|
|
11
|
+
},
|
|
7
12
|
"bin": {
|
|
8
13
|
"volvel": "./dist/volvel.mjs"
|
|
9
14
|
},
|
|
@@ -24,14 +29,14 @@
|
|
|
24
29
|
},
|
|
25
30
|
"devDependencies": {
|
|
26
31
|
"@marcbachmann/cel-js": "^8.0.0",
|
|
27
|
-
"@volvel/control-plane": "0.6.0",
|
|
28
32
|
"@volvel/compose": "0.5.0",
|
|
29
|
-
"@volvel/docs-engine": "0.
|
|
30
|
-
"@volvel/
|
|
33
|
+
"@volvel/docs-engine": "0.7.0",
|
|
34
|
+
"@volvel/control-plane": "0.7.0",
|
|
35
|
+
"@volvel/docs-site": "0.7.0",
|
|
31
36
|
"@volvel/example-acme": "0.0.0",
|
|
32
37
|
"@volvel/manifest": "0.0.0",
|
|
33
|
-
"@volvel/markup": "0.
|
|
34
|
-
"@volvel/worker": "0.
|
|
38
|
+
"@volvel/markup": "0.7.0",
|
|
39
|
+
"@volvel/worker": "0.7.0"
|
|
35
40
|
},
|
|
36
41
|
"scripts": {
|
|
37
42
|
"bundle": "node bundle.mjs"
|