@temps-sdk/cli 0.1.31 → 0.1.33
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/dist/index.js +1032 -267
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -5347,6 +5347,11 @@ function keyValue(key, value) {
|
|
|
5347
5347
|
const displayValue = value === null || value === undefined ? colors.muted("not set") : String(value);
|
|
5348
5348
|
console.log(` ${colors.muted(key + ":")} ${displayValue}`);
|
|
5349
5349
|
}
|
|
5350
|
+
function list(items, prefix = icons.bullet) {
|
|
5351
|
+
if (isQuietMode())
|
|
5352
|
+
return;
|
|
5353
|
+
items.forEach((item) => console.log(` ${prefix} ${item}`));
|
|
5354
|
+
}
|
|
5350
5355
|
function box(content, title) {
|
|
5351
5356
|
if (isQuietMode())
|
|
5352
5357
|
return;
|
|
@@ -12629,8 +12634,8 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12629
12634
|
return ajv;
|
|
12630
12635
|
}
|
|
12631
12636
|
const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
|
|
12632
|
-
const
|
|
12633
|
-
addFormats(ajv,
|
|
12637
|
+
const list2 = opts.formats || formats_1.formatNames;
|
|
12638
|
+
addFormats(ajv, list2, formats, exportName);
|
|
12634
12639
|
if (opts.keywords)
|
|
12635
12640
|
(0, limit_1.default)(ajv);
|
|
12636
12641
|
return ajv;
|
|
@@ -12642,11 +12647,11 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12642
12647
|
throw new Error(`Unknown format "${name}"`);
|
|
12643
12648
|
return f;
|
|
12644
12649
|
};
|
|
12645
|
-
function addFormats(ajv,
|
|
12650
|
+
function addFormats(ajv, list2, fs2, exportName) {
|
|
12646
12651
|
var _a;
|
|
12647
12652
|
var _b;
|
|
12648
12653
|
(_a = (_b = ajv.opts.code).formats) !== null && _a !== undefined || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`);
|
|
12649
|
-
for (const f of
|
|
12654
|
+
for (const f of list2)
|
|
12650
12655
|
ajv.addFormat(f, fs2[f]);
|
|
12651
12656
|
}
|
|
12652
12657
|
module.exports = exports = formatsPlugin;
|
|
@@ -13244,14 +13249,14 @@ var require_compare_build = __commonJS((exports, module) => {
|
|
|
13244
13249
|
// node_modules/semver/functions/sort.js
|
|
13245
13250
|
var require_sort = __commonJS((exports, module) => {
|
|
13246
13251
|
var compareBuild = require_compare_build();
|
|
13247
|
-
var sort = (
|
|
13252
|
+
var sort = (list2, loose) => list2.sort((a, b) => compareBuild(a, b, loose));
|
|
13248
13253
|
module.exports = sort;
|
|
13249
13254
|
});
|
|
13250
13255
|
|
|
13251
13256
|
// node_modules/semver/functions/rsort.js
|
|
13252
13257
|
var require_rsort = __commonJS((exports, module) => {
|
|
13253
13258
|
var compareBuild = require_compare_build();
|
|
13254
|
-
var rsort = (
|
|
13259
|
+
var rsort = (list2, loose) => list2.sort((a, b) => compareBuild(b, a, loose));
|
|
13255
13260
|
module.exports = rsort;
|
|
13256
13261
|
});
|
|
13257
13262
|
|
|
@@ -15727,15 +15732,15 @@ class Emitter2 {
|
|
|
15727
15732
|
this.listeners[ev].push(fn);
|
|
15728
15733
|
}
|
|
15729
15734
|
removeListener(ev, fn) {
|
|
15730
|
-
const
|
|
15731
|
-
const i =
|
|
15735
|
+
const list2 = this.listeners[ev];
|
|
15736
|
+
const i = list2.indexOf(fn);
|
|
15732
15737
|
if (i === -1) {
|
|
15733
15738
|
return;
|
|
15734
15739
|
}
|
|
15735
|
-
if (i === 0 &&
|
|
15736
|
-
|
|
15740
|
+
if (i === 0 && list2.length === 1) {
|
|
15741
|
+
list2.length = 0;
|
|
15737
15742
|
} else {
|
|
15738
|
-
|
|
15743
|
+
list2.splice(i, 1);
|
|
15739
15744
|
}
|
|
15740
15745
|
}
|
|
15741
15746
|
emit(ev, code, signal) {
|
|
@@ -26457,15 +26462,15 @@ class Emitter3 {
|
|
|
26457
26462
|
this.listeners[ev].push(fn);
|
|
26458
26463
|
}
|
|
26459
26464
|
removeListener(ev, fn) {
|
|
26460
|
-
const
|
|
26461
|
-
const i =
|
|
26465
|
+
const list2 = this.listeners[ev];
|
|
26466
|
+
const i = list2.indexOf(fn);
|
|
26462
26467
|
if (i === -1) {
|
|
26463
26468
|
return;
|
|
26464
26469
|
}
|
|
26465
|
-
if (i === 0 &&
|
|
26466
|
-
|
|
26470
|
+
if (i === 0 && list2.length === 1) {
|
|
26471
|
+
list2.length = 0;
|
|
26467
26472
|
} else {
|
|
26468
|
-
|
|
26473
|
+
list2.splice(i, 1);
|
|
26469
26474
|
}
|
|
26470
26475
|
}
|
|
26471
26476
|
emit(ev, code, signal) {
|
|
@@ -27544,15 +27549,15 @@ class Emitter4 {
|
|
|
27544
27549
|
this.listeners[ev].push(fn);
|
|
27545
27550
|
}
|
|
27546
27551
|
removeListener(ev, fn) {
|
|
27547
|
-
const
|
|
27548
|
-
const i =
|
|
27552
|
+
const list2 = this.listeners[ev];
|
|
27553
|
+
const i = list2.indexOf(fn);
|
|
27549
27554
|
if (i === -1) {
|
|
27550
27555
|
return;
|
|
27551
27556
|
}
|
|
27552
|
-
if (i === 0 &&
|
|
27553
|
-
|
|
27557
|
+
if (i === 0 && list2.length === 1) {
|
|
27558
|
+
list2.length = 0;
|
|
27554
27559
|
} else {
|
|
27555
|
-
|
|
27560
|
+
list2.splice(i, 1);
|
|
27556
27561
|
}
|
|
27557
27562
|
}
|
|
27558
27563
|
emit(ev, code, signal) {
|
|
@@ -28606,15 +28611,15 @@ class Emitter5 {
|
|
|
28606
28611
|
this.listeners[ev].push(fn);
|
|
28607
28612
|
}
|
|
28608
28613
|
removeListener(ev, fn) {
|
|
28609
|
-
const
|
|
28610
|
-
const i =
|
|
28614
|
+
const list2 = this.listeners[ev];
|
|
28615
|
+
const i = list2.indexOf(fn);
|
|
28611
28616
|
if (i === -1) {
|
|
28612
28617
|
return;
|
|
28613
28618
|
}
|
|
28614
|
-
if (i === 0 &&
|
|
28615
|
-
|
|
28619
|
+
if (i === 0 && list2.length === 1) {
|
|
28620
|
+
list2.length = 0;
|
|
28616
28621
|
} else {
|
|
28617
|
-
|
|
28622
|
+
list2.splice(i, 1);
|
|
28618
28623
|
}
|
|
28619
28624
|
}
|
|
28620
28625
|
emit(ev, code, signal) {
|
|
@@ -29708,15 +29713,15 @@ class Emitter6 {
|
|
|
29708
29713
|
this.listeners[ev].push(fn);
|
|
29709
29714
|
}
|
|
29710
29715
|
removeListener(ev, fn) {
|
|
29711
|
-
const
|
|
29712
|
-
const i =
|
|
29716
|
+
const list2 = this.listeners[ev];
|
|
29717
|
+
const i = list2.indexOf(fn);
|
|
29713
29718
|
if (i === -1) {
|
|
29714
29719
|
return;
|
|
29715
29720
|
}
|
|
29716
|
-
if (i === 0 &&
|
|
29717
|
-
|
|
29721
|
+
if (i === 0 && list2.length === 1) {
|
|
29722
|
+
list2.length = 0;
|
|
29718
29723
|
} else {
|
|
29719
|
-
|
|
29724
|
+
list2.splice(i, 1);
|
|
29720
29725
|
}
|
|
29721
29726
|
}
|
|
29722
29727
|
emit(ev, code, signal) {
|
|
@@ -30878,15 +30883,15 @@ class Emitter7 {
|
|
|
30878
30883
|
this.listeners[ev].push(fn);
|
|
30879
30884
|
}
|
|
30880
30885
|
removeListener(ev, fn) {
|
|
30881
|
-
const
|
|
30882
|
-
const i =
|
|
30886
|
+
const list2 = this.listeners[ev];
|
|
30887
|
+
const i = list2.indexOf(fn);
|
|
30883
30888
|
if (i === -1) {
|
|
30884
30889
|
return;
|
|
30885
30890
|
}
|
|
30886
|
-
if (i === 0 &&
|
|
30887
|
-
|
|
30891
|
+
if (i === 0 && list2.length === 1) {
|
|
30892
|
+
list2.length = 0;
|
|
30888
30893
|
} else {
|
|
30889
|
-
|
|
30894
|
+
list2.splice(i, 1);
|
|
30890
30895
|
}
|
|
30891
30896
|
}
|
|
30892
30897
|
emit(ev, code, signal) {
|
|
@@ -32173,15 +32178,15 @@ class Emitter8 {
|
|
|
32173
32178
|
this.listeners[ev].push(fn);
|
|
32174
32179
|
}
|
|
32175
32180
|
removeListener(ev, fn) {
|
|
32176
|
-
const
|
|
32177
|
-
const i =
|
|
32181
|
+
const list2 = this.listeners[ev];
|
|
32182
|
+
const i = list2.indexOf(fn);
|
|
32178
32183
|
if (i === -1) {
|
|
32179
32184
|
return;
|
|
32180
32185
|
}
|
|
32181
|
-
if (i === 0 &&
|
|
32182
|
-
|
|
32186
|
+
if (i === 0 && list2.length === 1) {
|
|
32187
|
+
list2.length = 0;
|
|
32183
32188
|
} else {
|
|
32184
|
-
|
|
32189
|
+
list2.splice(i, 1);
|
|
32185
32190
|
}
|
|
32186
32191
|
}
|
|
32187
32192
|
emit(ev, code, signal) {
|
|
@@ -33795,6 +33800,7 @@ __export(exports_sdk_gen, {
|
|
|
33795
33800
|
updateApiKey: () => updateApiKey,
|
|
33796
33801
|
updateAlertRule: () => updateAlertRule,
|
|
33797
33802
|
updateAlert: () => updateAlert,
|
|
33803
|
+
updateAiProviderPreference: () => updateAiProviderPreference,
|
|
33798
33804
|
updateAiProvider: () => updateAiProvider,
|
|
33799
33805
|
updateAgent: () => updateAgent,
|
|
33800
33806
|
unlinkServiceFromProject: () => unlinkServiceFromProject,
|
|
@@ -33822,6 +33828,7 @@ __export(exports_sdk_gen, {
|
|
|
33822
33828
|
streamRunEvents: () => streamRunEvents,
|
|
33823
33829
|
streamEvents: () => streamEvents,
|
|
33824
33830
|
streamContainerMetrics: () => streamContainerMetrics,
|
|
33831
|
+
storageSummary: () => storageSummary,
|
|
33825
33832
|
stopService: () => stopService,
|
|
33826
33833
|
stopSandbox: () => stopSandbox,
|
|
33827
33834
|
stopContainer: () => stopContainer,
|
|
@@ -33898,6 +33905,7 @@ __export(exports_sdk_gen, {
|
|
|
33898
33905
|
restartSandbox: () => restartSandbox,
|
|
33899
33906
|
restartPreviewGateway: () => restartPreviewGateway,
|
|
33900
33907
|
restartContainer: () => restartContainer,
|
|
33908
|
+
resolvePermission: () => resolvePermission,
|
|
33901
33909
|
resolveAlarm: () => resolveAlarm,
|
|
33902
33910
|
resizeSandbox: () => resizeSandbox,
|
|
33903
33911
|
resetPassword: () => resetPassword,
|
|
@@ -33915,6 +33923,7 @@ __export(exports_sdk_gen, {
|
|
|
33915
33923
|
registerExternalImage: () => registerExternalImage,
|
|
33916
33924
|
regenerateDsn: () => regenerateDsn,
|
|
33917
33925
|
refreshRouteTable: () => refreshRouteTable,
|
|
33926
|
+
refreshAiProviderStatus: () => refreshAiProviderStatus,
|
|
33918
33927
|
recordSpeedMetrics: () => recordSpeedMetrics,
|
|
33919
33928
|
recordFlagExposure: () => recordFlagExposure,
|
|
33920
33929
|
recordEventMetrics: () => recordEventMetrics,
|
|
@@ -33965,6 +33974,7 @@ __export(exports_sdk_gen, {
|
|
|
33965
33974
|
listSourceMaps: () => listSourceMaps,
|
|
33966
33975
|
listSourceFiles: () => listSourceFiles,
|
|
33967
33976
|
listSourceBackups: () => listSourceBackups,
|
|
33977
|
+
listSnapshots: () => listSnapshots,
|
|
33968
33978
|
listSkills: () => listSkills,
|
|
33969
33979
|
listServices: () => listServices,
|
|
33970
33980
|
listServiceSchedules: () => listServiceSchedules,
|
|
@@ -34091,6 +34101,7 @@ __export(exports_sdk_gen, {
|
|
|
34091
34101
|
ingestLogsByPath: () => ingestLogsByPath,
|
|
34092
34102
|
ingestLogs: () => ingestLogs,
|
|
34093
34103
|
importExternalService: () => importExternalService,
|
|
34104
|
+
hasTraces: () => hasTraces,
|
|
34094
34105
|
hasPerformanceMetrics: () => hasPerformanceMetrics,
|
|
34095
34106
|
hasErrorGroups: () => hasErrorGroups,
|
|
34096
34107
|
hasAnalyticsEvents: () => hasAnalyticsEvents,
|
|
@@ -34124,6 +34135,7 @@ __export(exports_sdk_gen, {
|
|
|
34124
34135
|
getTagsByRepositoryId: () => getTagsByRepositoryId,
|
|
34125
34136
|
getStatusOverview: () => getStatusOverview,
|
|
34126
34137
|
getStaticBundle: () => getStaticBundle,
|
|
34138
|
+
getSnapshot: () => getSnapshot,
|
|
34127
34139
|
getSlowQueries: () => getSlowQueries,
|
|
34128
34140
|
getSkill: () => getSkill,
|
|
34129
34141
|
getSettings: () => getSettings,
|
|
@@ -34327,6 +34339,7 @@ __export(exports_sdk_gen, {
|
|
|
34327
34339
|
getAlertRule: () => getAlertRule,
|
|
34328
34340
|
getAlert: () => getAlert,
|
|
34329
34341
|
getAiStatusBreakdown: () => getAiStatusBreakdown,
|
|
34342
|
+
getAiProviderStatus: () => getAiProviderStatus,
|
|
34330
34343
|
getAiPageBreakdown: () => getAiPageBreakdown,
|
|
34331
34344
|
getAiDataAccess: () => getAiDataAccess,
|
|
34332
34345
|
getAiAgentTimeline: () => getAiAgentTimeline,
|
|
@@ -34386,6 +34399,7 @@ __export(exports_sdk_gen, {
|
|
|
34386
34399
|
deleteTeam: () => deleteTeam,
|
|
34387
34400
|
deleteStaticBundle: () => deleteStaticBundle,
|
|
34388
34401
|
deleteSourceMap: () => deleteSourceMap,
|
|
34402
|
+
deleteSnapshot: () => deleteSnapshot,
|
|
34389
34403
|
deleteSkill: () => deleteSkill,
|
|
34390
34404
|
deleteSessionReplay: () => deleteSessionReplay,
|
|
34391
34405
|
deleteService: () => deleteService,
|
|
@@ -34435,6 +34449,7 @@ __export(exports_sdk_gen, {
|
|
|
34435
34449
|
createWebhook: () => createWebhook,
|
|
34436
34450
|
createUser: () => createUser,
|
|
34437
34451
|
createTeam: () => createTeam,
|
|
34452
|
+
createSnapshot: () => createSnapshot,
|
|
34438
34453
|
createSlackProvider: () => createSlackProvider,
|
|
34439
34454
|
createSkill: () => createSkill,
|
|
34440
34455
|
createService: () => createService,
|
|
@@ -34689,6 +34704,22 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
|
|
|
34689
34704
|
security: [{ scheme: "bearer", type: "http" }],
|
|
34690
34705
|
url: "/ai/pricing",
|
|
34691
34706
|
...options
|
|
34707
|
+
}), updateAiProviderPreference = (options) => (options.client ?? client).put({
|
|
34708
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
34709
|
+
url: "/ai/provider-preference",
|
|
34710
|
+
...options,
|
|
34711
|
+
headers: {
|
|
34712
|
+
"Content-Type": "application/json",
|
|
34713
|
+
...options.headers
|
|
34714
|
+
}
|
|
34715
|
+
}), getAiProviderStatus = (options) => (options?.client ?? client).get({
|
|
34716
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
34717
|
+
url: "/ai/provider-status",
|
|
34718
|
+
...options
|
|
34719
|
+
}), refreshAiProviderStatus = (options) => (options?.client ?? client).post({
|
|
34720
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
34721
|
+
url: "/ai/provider-status/refresh",
|
|
34722
|
+
...options
|
|
34692
34723
|
}), listProviderKeys = (options) => (options?.client ?? client).get({
|
|
34693
34724
|
security: [{ scheme: "bearer", type: "http" }],
|
|
34694
34725
|
url: "/ai/providers",
|
|
@@ -36454,6 +36485,10 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
|
|
|
36454
36485
|
security: [{ scheme: "bearer", type: "http" }],
|
|
36455
36486
|
url: "/otel/global/traces/{trace_id}",
|
|
36456
36487
|
...options
|
|
36488
|
+
}), hasTraces = (options) => (options.client ?? client).get({
|
|
36489
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
36490
|
+
url: "/otel/has-traces/{project_id}",
|
|
36491
|
+
...options
|
|
36457
36492
|
}), getHealth = (options) => (options.client ?? client).get({
|
|
36458
36493
|
security: [{ scheme: "bearer", type: "http" }],
|
|
36459
36494
|
url: "/otel/health/{project_id}",
|
|
@@ -36827,6 +36862,14 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
|
|
|
36827
36862
|
security: [{ scheme: "bearer", type: "http" }],
|
|
36828
36863
|
url: "/projects/{project_id}/ai/conversations/{public_id}/pending-actions",
|
|
36829
36864
|
...options
|
|
36865
|
+
}), resolvePermission = (options) => (options.client ?? client).post({
|
|
36866
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
36867
|
+
url: "/projects/{project_id}/ai/conversations/{public_id}/permissions/{permission_id}/resolve",
|
|
36868
|
+
...options,
|
|
36869
|
+
headers: {
|
|
36870
|
+
"Content-Type": "application/json",
|
|
36871
|
+
...options.headers
|
|
36872
|
+
}
|
|
36830
36873
|
}), getPendingAction = (options) => (options.client ?? client).get({
|
|
36831
36874
|
security: [{ scheme: "bearer", type: "http" }],
|
|
36832
36875
|
url: "/projects/{project_id}/ai/pending-actions/{action_public_id}",
|
|
@@ -38123,6 +38166,22 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
|
|
|
38123
38166
|
security: [{ scheme: "bearer", type: "http" }],
|
|
38124
38167
|
url: "/users/{user_id}/roles/{role_type}",
|
|
38125
38168
|
...options
|
|
38169
|
+
}), listSnapshots = (options) => (options?.client ?? client).get({
|
|
38170
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
38171
|
+
url: "/v1/sandbox-snapshots",
|
|
38172
|
+
...options
|
|
38173
|
+
}), storageSummary = (options) => (options?.client ?? client).get({
|
|
38174
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
38175
|
+
url: "/v1/sandbox-snapshots/storage-summary",
|
|
38176
|
+
...options
|
|
38177
|
+
}), deleteSnapshot = (options) => (options.client ?? client).delete({
|
|
38178
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
38179
|
+
url: "/v1/sandbox-snapshots/{snap_id}",
|
|
38180
|
+
...options
|
|
38181
|
+
}), getSnapshot = (options) => (options.client ?? client).get({
|
|
38182
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
38183
|
+
url: "/v1/sandbox-snapshots/{snap_id}",
|
|
38184
|
+
...options
|
|
38126
38185
|
}), listSandboxes = (options) => (options?.client ?? client).get({
|
|
38127
38186
|
security: [{ scheme: "bearer", type: "http" }],
|
|
38128
38187
|
url: "/v1/sandboxes",
|
|
@@ -38291,6 +38350,14 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
|
|
|
38291
38350
|
security: [{ scheme: "bearer", type: "http" }],
|
|
38292
38351
|
url: "/v1/sandboxes/{id}/resume",
|
|
38293
38352
|
...options
|
|
38353
|
+
}), createSnapshot = (options) => (options.client ?? client).post({
|
|
38354
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
38355
|
+
url: "/v1/sandboxes/{id}/snapshots",
|
|
38356
|
+
...options,
|
|
38357
|
+
headers: {
|
|
38358
|
+
"Content-Type": "application/json",
|
|
38359
|
+
...options.headers
|
|
38360
|
+
}
|
|
38294
38361
|
}), sourceSandbox = (options) => (options.client ?? client).post({
|
|
38295
38362
|
security: [{ scheme: "bearer", type: "http" }],
|
|
38296
38363
|
url: "/v1/sandboxes/{id}/source",
|
|
@@ -40887,8 +40954,8 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
40887
40954
|
exports.useState = function(initialState) {
|
|
40888
40955
|
return resolveDispatcher().useState(initialState);
|
|
40889
40956
|
};
|
|
40890
|
-
exports.useSyncExternalStore = function(subscribe,
|
|
40891
|
-
return resolveDispatcher().useSyncExternalStore(subscribe,
|
|
40957
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
40958
|
+
return resolveDispatcher().useSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
40892
40959
|
};
|
|
40893
40960
|
exports.useTransition = function() {
|
|
40894
40961
|
return resolveDispatcher().useTransition();
|
|
@@ -43100,32 +43167,32 @@ It can also happen if the client has a browser extension installed which messes
|
|
|
43100
43167
|
var fiber = workInProgress2.child;
|
|
43101
43168
|
fiber !== null && (fiber.return = workInProgress2);
|
|
43102
43169
|
for (;fiber !== null; ) {
|
|
43103
|
-
var
|
|
43104
|
-
if (
|
|
43170
|
+
var list3 = fiber.dependencies;
|
|
43171
|
+
if (list3 !== null) {
|
|
43105
43172
|
var nextFiber = fiber.child;
|
|
43106
|
-
|
|
43173
|
+
list3 = list3.firstContext;
|
|
43107
43174
|
a:
|
|
43108
|
-
for (;
|
|
43109
|
-
var dependency =
|
|
43110
|
-
|
|
43175
|
+
for (;list3 !== null; ) {
|
|
43176
|
+
var dependency = list3;
|
|
43177
|
+
list3 = fiber;
|
|
43111
43178
|
for (var i = 0;i < contexts.length; i++)
|
|
43112
43179
|
if (dependency.context === contexts[i]) {
|
|
43113
|
-
|
|
43114
|
-
dependency =
|
|
43180
|
+
list3.lanes |= renderLanes2;
|
|
43181
|
+
dependency = list3.alternate;
|
|
43115
43182
|
dependency !== null && (dependency.lanes |= renderLanes2);
|
|
43116
|
-
scheduleContextWorkOnParentPath(
|
|
43183
|
+
scheduleContextWorkOnParentPath(list3.return, renderLanes2, workInProgress2);
|
|
43117
43184
|
forcePropagateEntireTree || (nextFiber = null);
|
|
43118
43185
|
break a;
|
|
43119
43186
|
}
|
|
43120
|
-
|
|
43187
|
+
list3 = dependency.next;
|
|
43121
43188
|
}
|
|
43122
43189
|
} else if (fiber.tag === 18) {
|
|
43123
43190
|
nextFiber = fiber.return;
|
|
43124
43191
|
if (nextFiber === null)
|
|
43125
43192
|
throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");
|
|
43126
43193
|
nextFiber.lanes |= renderLanes2;
|
|
43127
|
-
|
|
43128
|
-
|
|
43194
|
+
list3 = nextFiber.alternate;
|
|
43195
|
+
list3 !== null && (list3.lanes |= renderLanes2);
|
|
43129
43196
|
scheduleContextWorkOnParentPath(nextFiber, renderLanes2, workInProgress2);
|
|
43130
43197
|
nextFiber = null;
|
|
43131
43198
|
} else
|
|
@@ -44832,7 +44899,7 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next
|
|
|
44832
44899
|
}
|
|
44833
44900
|
return [newState, dispatch];
|
|
44834
44901
|
}
|
|
44835
|
-
function mountSyncExternalStore(subscribe,
|
|
44902
|
+
function mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot) {
|
|
44836
44903
|
var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook();
|
|
44837
44904
|
if (isHydrating) {
|
|
44838
44905
|
if (getServerSnapshot === undefined)
|
|
@@ -44840,28 +44907,28 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next
|
|
|
44840
44907
|
var nextSnapshot = getServerSnapshot();
|
|
44841
44908
|
didWarnUncachedGetSnapshot || nextSnapshot === getServerSnapshot() || (console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
|
|
44842
44909
|
} else {
|
|
44843
|
-
nextSnapshot =
|
|
44844
|
-
didWarnUncachedGetSnapshot || (getServerSnapshot =
|
|
44910
|
+
nextSnapshot = getSnapshot2();
|
|
44911
|
+
didWarnUncachedGetSnapshot || (getServerSnapshot = getSnapshot2(), objectIs(nextSnapshot, getServerSnapshot) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true));
|
|
44845
44912
|
if (workInProgressRoot === null)
|
|
44846
44913
|
throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
|
|
44847
|
-
(workInProgressRootRenderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber,
|
|
44914
|
+
(workInProgressRootRenderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber, getSnapshot2, nextSnapshot);
|
|
44848
44915
|
}
|
|
44849
44916
|
hook.memoizedState = nextSnapshot;
|
|
44850
|
-
getServerSnapshot = { value: nextSnapshot, getSnapshot };
|
|
44917
|
+
getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot2 };
|
|
44851
44918
|
hook.queue = getServerSnapshot;
|
|
44852
44919
|
mountEffect(subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), [subscribe]);
|
|
44853
44920
|
fiber.flags |= 2048;
|
|
44854
|
-
pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, getServerSnapshot, nextSnapshot,
|
|
44921
|
+
pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, getServerSnapshot, nextSnapshot, getSnapshot2), null);
|
|
44855
44922
|
return nextSnapshot;
|
|
44856
44923
|
}
|
|
44857
|
-
function updateSyncExternalStore(subscribe,
|
|
44924
|
+
function updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot) {
|
|
44858
44925
|
var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(), isHydrating$jscomp$0 = isHydrating;
|
|
44859
44926
|
if (isHydrating$jscomp$0) {
|
|
44860
44927
|
if (getServerSnapshot === undefined)
|
|
44861
44928
|
throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
|
|
44862
44929
|
getServerSnapshot = getServerSnapshot();
|
|
44863
|
-
} else if (getServerSnapshot =
|
|
44864
|
-
var cachedSnapshot =
|
|
44930
|
+
} else if (getServerSnapshot = getSnapshot2(), !didWarnUncachedGetSnapshot) {
|
|
44931
|
+
var cachedSnapshot = getSnapshot2();
|
|
44865
44932
|
objectIs(getServerSnapshot, cachedSnapshot) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
|
|
44866
44933
|
}
|
|
44867
44934
|
if (cachedSnapshot = !objectIs((currentHook || hook).memoizedState, getServerSnapshot))
|
|
@@ -44869,24 +44936,24 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next
|
|
|
44869
44936
|
hook = hook.queue;
|
|
44870
44937
|
var create3 = subscribeToStore.bind(null, fiber, hook, subscribe);
|
|
44871
44938
|
updateEffectImpl(2048, Passive, create3, [subscribe]);
|
|
44872
|
-
if (hook.getSnapshot !==
|
|
44939
|
+
if (hook.getSnapshot !== getSnapshot2 || cachedSnapshot || workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
|
|
44873
44940
|
fiber.flags |= 2048;
|
|
44874
|
-
pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, hook, getServerSnapshot,
|
|
44941
|
+
pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, hook, getServerSnapshot, getSnapshot2), null);
|
|
44875
44942
|
if (workInProgressRoot === null)
|
|
44876
44943
|
throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
|
|
44877
|
-
isHydrating$jscomp$0 || (renderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber,
|
|
44944
|
+
isHydrating$jscomp$0 || (renderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber, getSnapshot2, getServerSnapshot);
|
|
44878
44945
|
}
|
|
44879
44946
|
return getServerSnapshot;
|
|
44880
44947
|
}
|
|
44881
|
-
function pushStoreConsistencyCheck(fiber,
|
|
44948
|
+
function pushStoreConsistencyCheck(fiber, getSnapshot2, renderedSnapshot) {
|
|
44882
44949
|
fiber.flags |= 16384;
|
|
44883
|
-
fiber = { getSnapshot, value: renderedSnapshot };
|
|
44884
|
-
|
|
44885
|
-
|
|
44950
|
+
fiber = { getSnapshot: getSnapshot2, value: renderedSnapshot };
|
|
44951
|
+
getSnapshot2 = currentlyRenderingFiber.updateQueue;
|
|
44952
|
+
getSnapshot2 === null ? (getSnapshot2 = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot2, getSnapshot2.stores = [fiber]) : (renderedSnapshot = getSnapshot2.stores, renderedSnapshot === null ? getSnapshot2.stores = [fiber] : renderedSnapshot.push(fiber));
|
|
44886
44953
|
}
|
|
44887
|
-
function updateStoreInstance(fiber, inst, nextSnapshot,
|
|
44954
|
+
function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot2) {
|
|
44888
44955
|
inst.value = nextSnapshot;
|
|
44889
|
-
inst.getSnapshot =
|
|
44956
|
+
inst.getSnapshot = getSnapshot2;
|
|
44890
44957
|
checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
|
|
44891
44958
|
}
|
|
44892
44959
|
function subscribeToStore(fiber, inst, subscribe) {
|
|
@@ -48728,10 +48795,10 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
|
|
|
48728
48795
|
var tag = node.tag;
|
|
48729
48796
|
if ((tag === 0 || tag === 11 || tag === 15) && node.flags & 16384 && (tag = node.updateQueue, tag !== null && (tag = tag.stores, tag !== null)))
|
|
48730
48797
|
for (var i = 0;i < tag.length; i++) {
|
|
48731
|
-
var check3 = tag[i],
|
|
48798
|
+
var check3 = tag[i], getSnapshot2 = check3.getSnapshot;
|
|
48732
48799
|
check3 = check3.value;
|
|
48733
48800
|
try {
|
|
48734
|
-
if (!objectIs(
|
|
48801
|
+
if (!objectIs(getSnapshot2(), check3))
|
|
48735
48802
|
return false;
|
|
48736
48803
|
} catch (error3) {
|
|
48737
48804
|
return false;
|
|
@@ -50455,10 +50522,10 @@ Check the top-level render call using <` + componentName2 + ">.");
|
|
|
50455
50522
|
mountHookTypesDev();
|
|
50456
50523
|
return mountTransition();
|
|
50457
50524
|
},
|
|
50458
|
-
useSyncExternalStore: function(subscribe,
|
|
50525
|
+
useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
50459
50526
|
currentHookNameInDev = "useSyncExternalStore";
|
|
50460
50527
|
mountHookTypesDev();
|
|
50461
|
-
return mountSyncExternalStore(subscribe,
|
|
50528
|
+
return mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
50462
50529
|
},
|
|
50463
50530
|
useId: function() {
|
|
50464
50531
|
currentHookNameInDev = "useId";
|
|
@@ -50581,10 +50648,10 @@ Check the top-level render call using <` + componentName2 + ">.");
|
|
|
50581
50648
|
updateHookTypesDev();
|
|
50582
50649
|
return mountTransition();
|
|
50583
50650
|
},
|
|
50584
|
-
useSyncExternalStore: function(subscribe,
|
|
50651
|
+
useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
50585
50652
|
currentHookNameInDev = "useSyncExternalStore";
|
|
50586
50653
|
updateHookTypesDev();
|
|
50587
|
-
return mountSyncExternalStore(subscribe,
|
|
50654
|
+
return mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
50588
50655
|
},
|
|
50589
50656
|
useId: function() {
|
|
50590
50657
|
currentHookNameInDev = "useId";
|
|
@@ -50707,10 +50774,10 @@ Check the top-level render call using <` + componentName2 + ">.");
|
|
|
50707
50774
|
updateHookTypesDev();
|
|
50708
50775
|
return updateTransition();
|
|
50709
50776
|
},
|
|
50710
|
-
useSyncExternalStore: function(subscribe,
|
|
50777
|
+
useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
50711
50778
|
currentHookNameInDev = "useSyncExternalStore";
|
|
50712
50779
|
updateHookTypesDev();
|
|
50713
|
-
return updateSyncExternalStore(subscribe,
|
|
50780
|
+
return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
50714
50781
|
},
|
|
50715
50782
|
useId: function() {
|
|
50716
50783
|
currentHookNameInDev = "useId";
|
|
@@ -50833,10 +50900,10 @@ Check the top-level render call using <` + componentName2 + ">.");
|
|
|
50833
50900
|
updateHookTypesDev();
|
|
50834
50901
|
return rerenderTransition();
|
|
50835
50902
|
},
|
|
50836
|
-
useSyncExternalStore: function(subscribe,
|
|
50903
|
+
useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
50837
50904
|
currentHookNameInDev = "useSyncExternalStore";
|
|
50838
50905
|
updateHookTypesDev();
|
|
50839
|
-
return updateSyncExternalStore(subscribe,
|
|
50906
|
+
return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
50840
50907
|
},
|
|
50841
50908
|
useId: function() {
|
|
50842
50909
|
currentHookNameInDev = "useId";
|
|
@@ -50976,11 +51043,11 @@ Check the top-level render call using <` + componentName2 + ">.");
|
|
|
50976
51043
|
mountHookTypesDev();
|
|
50977
51044
|
return mountTransition();
|
|
50978
51045
|
},
|
|
50979
|
-
useSyncExternalStore: function(subscribe,
|
|
51046
|
+
useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
50980
51047
|
currentHookNameInDev = "useSyncExternalStore";
|
|
50981
51048
|
warnInvalidHookAccess();
|
|
50982
51049
|
mountHookTypesDev();
|
|
50983
|
-
return mountSyncExternalStore(subscribe,
|
|
51050
|
+
return mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
50984
51051
|
},
|
|
50985
51052
|
useId: function() {
|
|
50986
51053
|
currentHookNameInDev = "useId";
|
|
@@ -51127,11 +51194,11 @@ Check the top-level render call using <` + componentName2 + ">.");
|
|
|
51127
51194
|
updateHookTypesDev();
|
|
51128
51195
|
return updateTransition();
|
|
51129
51196
|
},
|
|
51130
|
-
useSyncExternalStore: function(subscribe,
|
|
51197
|
+
useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
51131
51198
|
currentHookNameInDev = "useSyncExternalStore";
|
|
51132
51199
|
warnInvalidHookAccess();
|
|
51133
51200
|
updateHookTypesDev();
|
|
51134
|
-
return updateSyncExternalStore(subscribe,
|
|
51201
|
+
return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
51135
51202
|
},
|
|
51136
51203
|
useId: function() {
|
|
51137
51204
|
currentHookNameInDev = "useId";
|
|
@@ -51278,11 +51345,11 @@ Check the top-level render call using <` + componentName2 + ">.");
|
|
|
51278
51345
|
updateHookTypesDev();
|
|
51279
51346
|
return rerenderTransition();
|
|
51280
51347
|
},
|
|
51281
|
-
useSyncExternalStore: function(subscribe,
|
|
51348
|
+
useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
51282
51349
|
currentHookNameInDev = "useSyncExternalStore";
|
|
51283
51350
|
warnInvalidHookAccess();
|
|
51284
51351
|
updateHookTypesDev();
|
|
51285
|
-
return updateSyncExternalStore(subscribe,
|
|
51352
|
+
return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
51286
51353
|
},
|
|
51287
51354
|
useId: function() {
|
|
51288
51355
|
currentHookNameInDev = "useId";
|
|
@@ -51840,15 +51907,15 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
51840
51907
|
var require_buffer_util = __commonJS((exports, module) => {
|
|
51841
51908
|
var { EMPTY_BUFFER } = require_constants3();
|
|
51842
51909
|
var FastBuffer = Buffer[Symbol.species];
|
|
51843
|
-
function concat2(
|
|
51844
|
-
if (
|
|
51910
|
+
function concat2(list3, totalLength) {
|
|
51911
|
+
if (list3.length === 0)
|
|
51845
51912
|
return EMPTY_BUFFER;
|
|
51846
|
-
if (
|
|
51847
|
-
return
|
|
51913
|
+
if (list3.length === 1)
|
|
51914
|
+
return list3[0];
|
|
51848
51915
|
const target = Buffer.allocUnsafe(totalLength);
|
|
51849
51916
|
let offset = 0;
|
|
51850
|
-
for (let i = 0;i <
|
|
51851
|
-
const buf =
|
|
51917
|
+
for (let i = 0;i < list3.length; i++) {
|
|
51918
|
+
const buf = list3[i];
|
|
51852
51919
|
target.set(buf, offset);
|
|
51853
51920
|
offset += buf.length;
|
|
51854
51921
|
}
|
|
@@ -53104,14 +53171,14 @@ var require_sender = __commonJS((exports, module) => {
|
|
|
53104
53171
|
this._bufferedBytes += params[3][kByteLength];
|
|
53105
53172
|
this._queue.push(params);
|
|
53106
53173
|
}
|
|
53107
|
-
sendFrame(
|
|
53108
|
-
if (
|
|
53174
|
+
sendFrame(list3, cb) {
|
|
53175
|
+
if (list3.length === 2) {
|
|
53109
53176
|
this._socket.cork();
|
|
53110
|
-
this._socket.write(
|
|
53111
|
-
this._socket.write(
|
|
53177
|
+
this._socket.write(list3[0]);
|
|
53178
|
+
this._socket.write(list3[1], cb);
|
|
53112
53179
|
this._socket.uncork();
|
|
53113
53180
|
} else {
|
|
53114
|
-
this._socket.write(
|
|
53181
|
+
this._socket.write(list3[0], cb);
|
|
53115
53182
|
}
|
|
53116
53183
|
}
|
|
53117
53184
|
}
|
|
@@ -55041,10 +55108,10 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
55041
55108
|
});
|
|
55042
55109
|
return [stateHook, function() {}];
|
|
55043
55110
|
},
|
|
55044
|
-
useSyncExternalStore: function useSyncExternalStore(subscribe,
|
|
55111
|
+
useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot2) {
|
|
55045
55112
|
nextHook();
|
|
55046
55113
|
nextHook();
|
|
55047
|
-
subscribe =
|
|
55114
|
+
subscribe = getSnapshot2();
|
|
55048
55115
|
hookLog.push({
|
|
55049
55116
|
displayName: null,
|
|
55050
55117
|
primitive: "SyncExternalStore",
|
|
@@ -55884,8 +55951,8 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
55884
55951
|
exports2.useState = function(initialState) {
|
|
55885
55952
|
return ReactSharedInternals.H.useState(initialState);
|
|
55886
55953
|
};
|
|
55887
|
-
exports2.useSyncExternalStore = function(subscribe,
|
|
55888
|
-
return ReactSharedInternals.H.useSyncExternalStore(subscribe,
|
|
55954
|
+
exports2.useSyncExternalStore = function(subscribe, getSnapshot2, getServerSnapshot) {
|
|
55955
|
+
return ReactSharedInternals.H.useSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
|
|
55889
55956
|
};
|
|
55890
55957
|
exports2.useTransition = function() {
|
|
55891
55958
|
return ReactSharedInternals.H.useTransition();
|
|
@@ -57024,7 +57091,7 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
57024
57091
|
module2.exports = Yallist;
|
|
57025
57092
|
Yallist.Node = Node2;
|
|
57026
57093
|
Yallist.create = Yallist;
|
|
57027
|
-
function Yallist(
|
|
57094
|
+
function Yallist(list3) {
|
|
57028
57095
|
var self2 = this;
|
|
57029
57096
|
if (!(self2 instanceof Yallist)) {
|
|
57030
57097
|
self2 = new Yallist;
|
|
@@ -57032,8 +57099,8 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
57032
57099
|
self2.tail = null;
|
|
57033
57100
|
self2.head = null;
|
|
57034
57101
|
self2.length = 0;
|
|
57035
|
-
if (
|
|
57036
|
-
|
|
57102
|
+
if (list3 && typeof list3.forEach === "function") {
|
|
57103
|
+
list3.forEach(function(item) {
|
|
57037
57104
|
self2.push(item);
|
|
57038
57105
|
});
|
|
57039
57106
|
} else if (arguments.length > 0) {
|
|
@@ -57360,11 +57427,11 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
57360
57427
|
}
|
|
57361
57428
|
self2.length++;
|
|
57362
57429
|
}
|
|
57363
|
-
function Node2(value, prev, next,
|
|
57430
|
+
function Node2(value, prev, next, list3) {
|
|
57364
57431
|
if (!(this instanceof Node2)) {
|
|
57365
|
-
return new Node2(value, prev, next,
|
|
57432
|
+
return new Node2(value, prev, next, list3);
|
|
57366
57433
|
}
|
|
57367
|
-
this.list =
|
|
57434
|
+
this.list = list3;
|
|
57368
57435
|
this.value = value;
|
|
57369
57436
|
if (prev) {
|
|
57370
57437
|
prev.next = this;
|
|
@@ -73804,15 +73871,15 @@ var require_constants4 = __commonJS((exports, module) => {
|
|
|
73804
73871
|
var require_buffer_util2 = __commonJS((exports, module) => {
|
|
73805
73872
|
var { EMPTY_BUFFER } = require_constants4();
|
|
73806
73873
|
var FastBuffer = Buffer[Symbol.species];
|
|
73807
|
-
function concat2(
|
|
73808
|
-
if (
|
|
73874
|
+
function concat2(list4, totalLength) {
|
|
73875
|
+
if (list4.length === 0)
|
|
73809
73876
|
return EMPTY_BUFFER;
|
|
73810
|
-
if (
|
|
73811
|
-
return
|
|
73877
|
+
if (list4.length === 1)
|
|
73878
|
+
return list4[0];
|
|
73812
73879
|
const target = Buffer.allocUnsafe(totalLength);
|
|
73813
73880
|
let offset = 0;
|
|
73814
|
-
for (let i = 0;i <
|
|
73815
|
-
const buf =
|
|
73881
|
+
for (let i = 0;i < list4.length; i++) {
|
|
73882
|
+
const buf = list4[i];
|
|
73816
73883
|
target.set(buf, offset);
|
|
73817
73884
|
offset += buf.length;
|
|
73818
73885
|
}
|
|
@@ -75086,14 +75153,14 @@ var require_sender2 = __commonJS((exports, module) => {
|
|
|
75086
75153
|
this._bufferedBytes += params[3][kByteLength];
|
|
75087
75154
|
this._queue.push(params);
|
|
75088
75155
|
}
|
|
75089
|
-
sendFrame(
|
|
75090
|
-
if (
|
|
75156
|
+
sendFrame(list4, cb) {
|
|
75157
|
+
if (list4.length === 2) {
|
|
75091
75158
|
this._socket.cork();
|
|
75092
|
-
this._socket.write(
|
|
75093
|
-
this._socket.write(
|
|
75159
|
+
this._socket.write(list4[0]);
|
|
75160
|
+
this._socket.write(list4[1], cb);
|
|
75094
75161
|
this._socket.uncork();
|
|
75095
75162
|
} else {
|
|
75096
|
-
this._socket.write(
|
|
75163
|
+
this._socket.write(list4[0], cb);
|
|
75097
75164
|
}
|
|
75098
75165
|
}
|
|
75099
75166
|
}
|
|
@@ -79781,7 +79848,7 @@ async function validateAndSaveToken(apiToken, apiUrl) {
|
|
|
79781
79848
|
init_spinner();
|
|
79782
79849
|
init_output();
|
|
79783
79850
|
init_sdk_gen();
|
|
79784
|
-
async function
|
|
79851
|
+
async function list2(options) {
|
|
79785
79852
|
await requireAuth();
|
|
79786
79853
|
await setupClient();
|
|
79787
79854
|
const page = options.page ? parseInt(options.page, 10) : undefined;
|
|
@@ -81183,7 +81250,10 @@ async function updateConfigAction(options) {
|
|
|
81183
81250
|
let cpuLimit = options.cpuLimit ? parseFloat(options.cpuLimit) : undefined;
|
|
81184
81251
|
let memoryLimit = options.memoryLimit ? parseInt(options.memoryLimit, 10) : undefined;
|
|
81185
81252
|
let autoDeploy = options.autoDeploy;
|
|
81186
|
-
|
|
81253
|
+
const requestTimeoutSeconds = options.requestTimeout ? parseInt(options.requestTimeout, 10) : undefined;
|
|
81254
|
+
const sseIdleTimeoutSeconds = options.sseIdleTimeout ? parseInt(options.sseIdleTimeout, 10) : undefined;
|
|
81255
|
+
const websocketIdleTimeoutSeconds = options.websocketIdleTimeout ? parseInt(options.websocketIdleTimeout, 10) : undefined;
|
|
81256
|
+
if (replicas === undefined && cpuLimit === undefined && memoryLimit === undefined && autoDeploy === undefined && requestTimeoutSeconds === undefined && sseIdleTimeoutSeconds === undefined && websocketIdleTimeoutSeconds === undefined && !options.yes) {
|
|
81187
81257
|
newline();
|
|
81188
81258
|
header("Update Deployment Configuration");
|
|
81189
81259
|
info2(`Deployment config for "${project.name}"`);
|
|
@@ -81216,7 +81286,10 @@ async function updateConfigAction(options) {
|
|
|
81216
81286
|
replicas: replicas ?? undefined,
|
|
81217
81287
|
cpuLimit: cpuLimit ?? undefined,
|
|
81218
81288
|
memoryLimit: memoryLimit ?? undefined,
|
|
81219
|
-
automaticDeploy: autoDeploy ?? undefined
|
|
81289
|
+
automaticDeploy: autoDeploy ?? undefined,
|
|
81290
|
+
requestTimeoutSeconds: requestTimeoutSeconds ?? undefined,
|
|
81291
|
+
sseIdleTimeoutSeconds: sseIdleTimeoutSeconds ?? undefined,
|
|
81292
|
+
websocketIdleTimeoutSeconds: websocketIdleTimeoutSeconds ?? undefined
|
|
81220
81293
|
}
|
|
81221
81294
|
});
|
|
81222
81295
|
if (error3) {
|
|
@@ -81237,6 +81310,12 @@ async function updateConfigAction(options) {
|
|
|
81237
81310
|
keyValue("Memory Limit", `${memoryLimit} MB`);
|
|
81238
81311
|
if (autoDeploy !== undefined)
|
|
81239
81312
|
keyValue("Auto Deploy", autoDeploy ? colors.success("Enabled") : colors.muted("Disabled"));
|
|
81313
|
+
if (requestTimeoutSeconds !== undefined)
|
|
81314
|
+
keyValue("Request Timeout", `${requestTimeoutSeconds}s`);
|
|
81315
|
+
if (sseIdleTimeoutSeconds !== undefined)
|
|
81316
|
+
keyValue("SSE Idle Timeout", `${sseIdleTimeoutSeconds}s`);
|
|
81317
|
+
if (websocketIdleTimeoutSeconds !== undefined)
|
|
81318
|
+
keyValue("WebSocket Idle Timeout", `${websocketIdleTimeoutSeconds}s`);
|
|
81240
81319
|
}
|
|
81241
81320
|
|
|
81242
81321
|
// src/commands/projects/secrets.ts
|
|
@@ -81432,13 +81511,13 @@ async function deleteAction(key, options) {
|
|
|
81432
81511
|
function registerProjectsCommands(program2) {
|
|
81433
81512
|
const projects = program2.command("projects").alias("project").alias("p").description("Manage projects");
|
|
81434
81513
|
registerProjectSecretsCommands(projects);
|
|
81435
|
-
projects.command("list").alias("ls").description("List all projects").option("--json", "Output in JSON format").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").action(
|
|
81514
|
+
projects.command("list").alias("ls").description("List all projects").option("--json", "Output in JSON format").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").action(list2);
|
|
81436
81515
|
projects.command("create").alias("new").description("Create a new project (git-based or manual deployment)").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("--repo <repository>", "Repository in owner/name format (nested groups supported: group/subgroup/name)").option("--branch <branch>", "Git branch").option("--directory <directory>", "Root directory (relative to repo)").option("--preset <preset>", "Build preset (e.g., nextjs, nodejs, static, docker)").option("--connection <id>", "Git connection ID").option("--manual", "Create a manual (non-git) project - deploy via Docker image or static files").option("--source-type <type>", "Manual deployment method: manual (flexible), docker_image, or static_files").option("--image <image>", "Docker image for the first deployment (manual mode)").option("--port <port>", "Application/container port (manual mode, default: 3000)").option("-y, --yes", "Skip optional prompts (services, env vars, set-default)").action(create);
|
|
81437
81516
|
projects.command("show").alias("get").description("Show project details").option("-p, --project <project>", "Project slug or ID").option("--json", "Output in JSON format").action(show);
|
|
81438
81517
|
projects.command("update").alias("edit").description("Update project name and description").option("-p, --project <project>", "Project slug or ID").option("-n, --name <name>", "New project name").option("-d, --description <description>", "New project description").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts, use provided values (for automation)").action(updateProjectAction);
|
|
81439
81518
|
projects.command("settings").description("Update project settings (slug, attack mode, preview environments)").option("-p, --project <project>", "Project slug or ID").option("--slug <slug>", "Project URL slug").option("--attack-mode", "Enable attack mode (CAPTCHA protection)").option("--no-attack-mode", "Disable attack mode").option("--preview-envs", "Enable preview environments").option("--no-preview-envs", "Disable preview environments").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts (for automation)").action(updateSettingsAction);
|
|
81440
81519
|
projects.command("git").description("Update git repository settings").option("-p, --project <project>", "Project slug or ID").option("--owner <owner>", "Repository owner").option("--repo <repo>", "Repository name").option("--branch <branch>", "Main branch").option("--directory <directory>", "App directory path").option("--preset <preset>", "Build preset (auto, nextjs, nodejs, static, docker, rust, go, python)").option("--connection <id>", "Git connection ID (links the project to an actual clone-access connection; omit to leave the existing connection unchanged)").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts, use provided/existing values (for automation)").action(updateGitAction);
|
|
81441
|
-
projects.command("config").description("Update deployment configuration (resources, replicas)").option("-p, --project <project>", "Project slug or ID").option("--replicas <n>", "Number of container replicas").option("--cpu-limit <limit>", "CPU limit in cores (e.g., 0.5, 1, 2)").option("--memory-limit <limit>", "Memory limit in MB").option("--auto-deploy", "Enable automatic deployments").option("--no-auto-deploy", "Disable automatic deployments").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts (for automation)").action(updateConfigAction);
|
|
81520
|
+
projects.command("config").description("Update deployment configuration (resources, replicas)").option("-p, --project <project>", "Project slug or ID").option("--replicas <n>", "Number of container replicas").option("--cpu-limit <limit>", "CPU limit in cores (e.g., 0.5, 1, 2)").option("--memory-limit <limit>", "Memory limit in MB").option("--auto-deploy", "Enable automatic deployments").option("--no-auto-deploy", "Disable automatic deployments").option("--request-timeout <seconds>", "Default timeout for regular HTTP requests, in seconds").option("--sse-idle-timeout <seconds>", "Default idle timeout for SSE streams, in seconds").option("--websocket-idle-timeout <seconds>", "Default idle timeout for WebSocket connections, in seconds").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts (for automation)").action(updateConfigAction);
|
|
81442
81521
|
projects.command("delete").alias("rm").description("Delete a project").option("-p, --project <project>", "Project slug or ID").option("-f, --force", "Skip confirmation").option("-y, --yes", "Skip confirmation (alias for --force)").action(remove);
|
|
81443
81522
|
}
|
|
81444
81523
|
|
|
@@ -86799,6 +86878,50 @@ async function watchDeployment(options) {
|
|
|
86799
86878
|
});
|
|
86800
86879
|
}
|
|
86801
86880
|
|
|
86881
|
+
// src/lib/find-triggered-deployment.ts
|
|
86882
|
+
function commitMatches(deploymentHash, requested) {
|
|
86883
|
+
const want = requested?.trim();
|
|
86884
|
+
if (!want)
|
|
86885
|
+
return true;
|
|
86886
|
+
if (!deploymentHash)
|
|
86887
|
+
return false;
|
|
86888
|
+
const have = deploymentHash.toLowerCase();
|
|
86889
|
+
const needle = want.toLowerCase();
|
|
86890
|
+
return have.startsWith(needle) || needle.startsWith(have);
|
|
86891
|
+
}
|
|
86892
|
+
function selectTriggeredDeployment(deployments, options) {
|
|
86893
|
+
for (const deployment of deployments) {
|
|
86894
|
+
if (deployment.id <= options.afterId)
|
|
86895
|
+
continue;
|
|
86896
|
+
if (!commitMatches(deployment.commit_hash, options.commit))
|
|
86897
|
+
continue;
|
|
86898
|
+
return deployment;
|
|
86899
|
+
}
|
|
86900
|
+
return null;
|
|
86901
|
+
}
|
|
86902
|
+
async function waitForTriggeredDeployment(fetchDeployments, options) {
|
|
86903
|
+
const maxAttempts = options.maxAttempts ?? 15;
|
|
86904
|
+
const intervalMs = options.intervalMs ?? 2000;
|
|
86905
|
+
const sleep2 = options.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
86906
|
+
for (let attempt2 = 0;attempt2 < maxAttempts; attempt2++) {
|
|
86907
|
+
const { deployments, error: error3 } = await fetchDeployments();
|
|
86908
|
+
if (error3) {
|
|
86909
|
+
return { ok: false, error: "fetch_failed", cause: error3 };
|
|
86910
|
+
}
|
|
86911
|
+
const match = selectTriggeredDeployment(deployments ?? [], {
|
|
86912
|
+
afterId: options.afterId,
|
|
86913
|
+
commit: options.commit
|
|
86914
|
+
});
|
|
86915
|
+
if (match) {
|
|
86916
|
+
return { ok: true, deploymentId: match.id };
|
|
86917
|
+
}
|
|
86918
|
+
if (attempt2 < maxAttempts - 1) {
|
|
86919
|
+
await sleep2(intervalMs);
|
|
86920
|
+
}
|
|
86921
|
+
}
|
|
86922
|
+
return { ok: false, error: "not_found" };
|
|
86923
|
+
}
|
|
86924
|
+
|
|
86802
86925
|
// src/commands/deploy/deploy-local-image.ts
|
|
86803
86926
|
init_sdk_gen();
|
|
86804
86927
|
init_prompts();
|
|
@@ -87943,6 +88066,15 @@ async function deploy(options) {
|
|
|
87943
88066
|
].filter(Boolean).join(`
|
|
87944
88067
|
`), `${icons.rocket} Deployment Preview`);
|
|
87945
88068
|
newline();
|
|
88069
|
+
const { data: baselineList } = await getProjectDeployments({
|
|
88070
|
+
client,
|
|
88071
|
+
path: { id: project.id },
|
|
88072
|
+
query: {
|
|
88073
|
+
per_page: 1,
|
|
88074
|
+
...environmentId ? { environment_id: environmentId } : {}
|
|
88075
|
+
}
|
|
88076
|
+
});
|
|
88077
|
+
const afterId = baselineList?.deployments?.[0]?.id ?? 0;
|
|
87946
88078
|
startSpinner("Starting deployment...");
|
|
87947
88079
|
try {
|
|
87948
88080
|
const { data, error: error3 } = await triggerProjectPipeline({
|
|
@@ -87970,43 +88102,37 @@ async function deploy(options) {
|
|
|
87970
88102
|
return;
|
|
87971
88103
|
}
|
|
87972
88104
|
startSpinner("Waiting for deployment to start...");
|
|
87973
|
-
|
|
87974
|
-
for (let attempt2 = 0;attempt2 < 15; attempt2++) {
|
|
88105
|
+
const waitResult = await waitForTriggeredDeployment(async () => {
|
|
87975
88106
|
const { data: deployList, error: deployError } = await getProjectDeployments({
|
|
87976
88107
|
client,
|
|
87977
88108
|
path: { id: project.id },
|
|
87978
88109
|
query: {
|
|
87979
|
-
per_page:
|
|
88110
|
+
per_page: 10,
|
|
87980
88111
|
...environmentId ? { environment_id: environmentId } : {}
|
|
87981
88112
|
}
|
|
87982
88113
|
});
|
|
87983
|
-
|
|
87984
|
-
|
|
87985
|
-
|
|
87986
|
-
|
|
87987
|
-
|
|
87988
|
-
}
|
|
87989
|
-
|
|
87990
|
-
if (latest?.id) {
|
|
87991
|
-
deploymentId = latest.id;
|
|
87992
|
-
break;
|
|
87993
|
-
}
|
|
87994
|
-
await new Promise((r) => setTimeout(r, 2000));
|
|
88114
|
+
return { deployments: deployList?.deployments, error: deployError };
|
|
88115
|
+
}, { afterId, commit });
|
|
88116
|
+
if (!waitResult.ok && waitResult.error === "fetch_failed") {
|
|
88117
|
+
failSpinner("Failed to fetch deployment status");
|
|
88118
|
+
info2(`Error: ${getErrorMessage(waitResult.cause)}`);
|
|
88119
|
+
info2(`Dashboard: ${colors.primary(`${webUrl}/projects/${projectName}/deployments`)}`);
|
|
88120
|
+
return;
|
|
87995
88121
|
}
|
|
87996
|
-
if (
|
|
87997
|
-
succeedSpinner(`Deployment #${deploymentId} found`);
|
|
87998
|
-
const result2 = await watchDeployment({
|
|
87999
|
-
projectId: project.id,
|
|
88000
|
-
deploymentId,
|
|
88001
|
-
timeoutSecs: 600,
|
|
88002
|
-
projectName
|
|
88003
|
-
});
|
|
88004
|
-
if (!result2.success) {
|
|
88005
|
-
process.exitCode = 1;
|
|
88006
|
-
}
|
|
88007
|
-
} else {
|
|
88122
|
+
if (!waitResult.ok) {
|
|
88008
88123
|
failSpinner("Could not locate the deployment to track");
|
|
88009
88124
|
info2(`Dashboard: ${colors.primary(`${webUrl}/projects/${projectName}/deployments`)}`);
|
|
88125
|
+
return;
|
|
88126
|
+
}
|
|
88127
|
+
succeedSpinner(`Deployment #${waitResult.deploymentId} found`);
|
|
88128
|
+
const result2 = await watchDeployment({
|
|
88129
|
+
projectId: project.id,
|
|
88130
|
+
deploymentId: waitResult.deploymentId,
|
|
88131
|
+
timeoutSecs: 600,
|
|
88132
|
+
projectName
|
|
88133
|
+
});
|
|
88134
|
+
if (!result2.success) {
|
|
88135
|
+
process.exitCode = 1;
|
|
88010
88136
|
}
|
|
88011
88137
|
} catch (err) {
|
|
88012
88138
|
failSpinner("Deployment failed");
|
|
@@ -88248,7 +88374,7 @@ async function deployImage(options) {
|
|
|
88248
88374
|
init_sdk_gen();
|
|
88249
88375
|
init_spinner();
|
|
88250
88376
|
init_output();
|
|
88251
|
-
async function
|
|
88377
|
+
async function list3(options) {
|
|
88252
88378
|
await requireAuth();
|
|
88253
88379
|
await setupClient();
|
|
88254
88380
|
const resolved = await resolveProjectSlug(options.project);
|
|
@@ -88755,7 +88881,8 @@ async function drop2(path6, options) {
|
|
|
88755
88881
|
preset: candidate.preset,
|
|
88756
88882
|
source_type: candidate.isStatic ? "static_files" : "uploaded_source",
|
|
88757
88883
|
automatic_deploy: false,
|
|
88758
|
-
storage_service_ids: []
|
|
88884
|
+
storage_service_ids: [],
|
|
88885
|
+
preset_config: candidate.preset === "docker-compose" && candidate.composePath ? { composePath: candidate.composePath } : undefined
|
|
88759
88886
|
}
|
|
88760
88887
|
});
|
|
88761
88888
|
if (created.error || !created.data)
|
|
@@ -88973,7 +89100,7 @@ function registerDeployCommands(program2) {
|
|
|
88973
89100
|
program2.command("deploy:image").alias("deploy-image").description("Deploy a pre-built Docker image").requiredOption("--image <image>", "Docker image reference (e.g., ghcr.io/org/app:v1.0)").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Target environment name", "production").option("--environment-id <id>", "Target environment ID").option("--no-wait", "Do not wait for deployment to complete").option("-y, --yes", "Skip confirmation prompts (for automation)").option("--metadata <json>", "Additional metadata (JSON format)").option("--health-check-path <path>", 'HTTP health-check path (must start with "/", e.g. /api/healthz). Overrides .temps.yaml; also updates the uptime monitor.').option("--timeout <seconds>", "Timeout in seconds for --wait", "300").action(deployImage);
|
|
88974
89101
|
program2.command("deploy:local-image").alias("deploy-local-image").description("Build and deploy a local Docker image (or deploy existing image with --image)").option("--image <image>", "Use existing local image instead of building (skips build)").option("-f, --dockerfile <path>", "Path to Dockerfile", "Dockerfile").option("-c, --context <path>", "Build context directory", ".").option("--build-arg <arg...>", "Build arguments (can be specified multiple times)").option("--no-build", "Skip building, requires --image").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Target environment name", "production").option("--environment-id <id>", "Target environment ID").option("-t, --tag <tag>", "Tag for the built/uploaded image").option("--no-wait", "Do not wait for deployment to complete").option("-y, --yes", "Skip confirmation prompts (for automation)").option("--metadata <json>", "Additional metadata (JSON format)").option("--health-check-path <path>", 'HTTP health-check path (must start with "/", e.g. /api/healthz). Overrides .temps.yaml; also updates the uptime monitor.').option("--timeout <seconds>", "Timeout in seconds for --wait", "600").action(deployLocalImage);
|
|
88975
89102
|
const deployments = program2.command("deployments").alias("deploys").description("Manage deployments");
|
|
88976
|
-
deployments.command("list").alias("ls").description("List deployments").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Filter by environment name (client-side)").option("--environment-id <id>", "Filter by environment ID (server-side)").option("-n, --limit <number>", "Limit results", "10").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").option("--json", "Output in JSON format").action(
|
|
89103
|
+
deployments.command("list").alias("ls").description("List deployments").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Filter by environment name (client-side)").option("--environment-id <id>", "Filter by environment ID (server-side)").option("-n, --limit <number>", "Limit results", "10").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").option("--json", "Output in JSON format").action(list3);
|
|
88977
89104
|
deployments.command("status").description("Show deployment status").option("-p, --project <project>", "Project slug or ID (required)").option("-d, --deployment-id <id>", "Deployment ID (required)").option("--json", "Output in JSON format").action(status);
|
|
88978
89105
|
deployments.command("rollback").description("Rollback to previous deployment").option("-p, --project <project>", "Project slug or ID (required)").option("-e, --environment <env>", "Target environment", "production").option("--to <deployment>", "Rollback to specific deployment ID").action(rollback);
|
|
88979
89106
|
deployments.command("cancel").description("Cancel a running deployment").requiredOption("-p, --project-id <id>", "Project ID").requiredOption("-d, --deployment-id <id>", "Deployment ID").option("-f, --force", "Skip confirmation").action(cancelDeploymentAction);
|
|
@@ -89650,6 +89777,7 @@ function registerEnvironmentsCommands(program2) {
|
|
|
89650
89777
|
return exportEnvVars(projectSlug, options);
|
|
89651
89778
|
});
|
|
89652
89779
|
environments.command("resources <environment>").description("View or set CPU/memory resources for an environment").option("-p, --project <project>", "Project slug or ID").option("--cpu <millicores>", "CPU limit in millicores (e.g., 500 = 0.5 CPU)").option("--memory <mb>", "Memory limit in MB (e.g., 512)").option("--cpu-request <millicores>", "CPU request in millicores (guaranteed minimum)").option("--memory-request <mb>", "Memory request in MB (guaranteed minimum)").option("--json", "Output in JSON format").action(resourcesCmd);
|
|
89780
|
+
environments.command("timeouts <environment>").description("View or set upstream request/idle timeouts for an environment").option("-p, --project <project>", "Project slug or ID").option("--request <seconds>", "Timeout for regular (non-streaming) HTTP requests, in seconds").option("--sse-idle <seconds>", "Idle timeout for Server-Sent Events streams, in seconds").option("--websocket-idle <seconds>", "Idle timeout for WebSocket connections, in seconds").option("--inherit", "Clear all three overrides (inherit the project/global defaults)").option("--json", "Output in JSON format").action(timeoutsCmd);
|
|
89653
89781
|
environments.command("force-https <environment>").description("View or set the HTTP to HTTPS redirect override for an environment").option("-p, --project <project>", "Project slug or ID").option("--enable", "Always redirect plain HTTP to HTTPS, even without a local certificate").option("--disable", "Never redirect: keep serving this environment over plain HTTP").option("--inherit", "Clear the override and follow the proxy default").option("--json", "Output in JSON format").action(forceHttpsCmd);
|
|
89654
89782
|
environments.command("scale").description("View or set the number of replicas for an environment").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Environment name or slug", "production").option("-r, --replicas <count>", "Number of replicas to set").option("--json", "Output in JSON format").action(scaleCmd);
|
|
89655
89783
|
const crons = environments.command("crons").description("Manage cron jobs").option("-p, --project <project>", "Project slug or ID").requiredOption("-e, --environment <env>", "Environment name or slug");
|
|
@@ -90427,6 +90555,123 @@ function displayResources(env4) {
|
|
|
90427
90555
|
newline();
|
|
90428
90556
|
info2(`Example: ${colors.muted("temps env resources my-project production --cpu 1000 --memory 512")}`);
|
|
90429
90557
|
}
|
|
90558
|
+
function formatTimeout(seconds) {
|
|
90559
|
+
if (seconds == null)
|
|
90560
|
+
return colors.muted("inherit (project/global default)");
|
|
90561
|
+
if (seconds === 0)
|
|
90562
|
+
return colors.muted("no timeout (explicit override)");
|
|
90563
|
+
return `${seconds}s`;
|
|
90564
|
+
}
|
|
90565
|
+
async function timeoutsCmd(environment, options) {
|
|
90566
|
+
await requireAuth();
|
|
90567
|
+
await setupClient();
|
|
90568
|
+
const resolved = await requireProjectSlug(options.project);
|
|
90569
|
+
const projectId = await getProjectId2(resolved.slug);
|
|
90570
|
+
const envs = await withSpinner("Fetching environments...", async () => {
|
|
90571
|
+
const { data, error: error3 } = await getEnvironments({
|
|
90572
|
+
client,
|
|
90573
|
+
path: { project_id: projectId }
|
|
90574
|
+
});
|
|
90575
|
+
if (error3)
|
|
90576
|
+
throw new Error(getErrorMessage(error3));
|
|
90577
|
+
return data ?? [];
|
|
90578
|
+
});
|
|
90579
|
+
const targetEnv = envs.find((e) => e.slug === environment || e.name.toLowerCase() === environment.toLowerCase());
|
|
90580
|
+
if (!targetEnv) {
|
|
90581
|
+
error2(`Environment "${environment}" not found`);
|
|
90582
|
+
info2(`Available environments: ${envs.map((e) => e.slug).join(", ")}`);
|
|
90583
|
+
return;
|
|
90584
|
+
}
|
|
90585
|
+
const hasSetOptions = options.request || options.sseIdle || options.websocketIdle;
|
|
90586
|
+
if (hasSetOptions && options.inherit) {
|
|
90587
|
+
error2("Pass either --inherit or one of --request/--sse-idle/--websocket-idle, not both");
|
|
90588
|
+
return;
|
|
90589
|
+
}
|
|
90590
|
+
if (hasSetOptions || options.inherit) {
|
|
90591
|
+
const updateBody = {};
|
|
90592
|
+
if (options.inherit) {
|
|
90593
|
+
updateBody.request_timeout_seconds = null;
|
|
90594
|
+
updateBody.sse_idle_timeout_seconds = null;
|
|
90595
|
+
updateBody.websocket_idle_timeout_seconds = null;
|
|
90596
|
+
} else {
|
|
90597
|
+
if (options.request) {
|
|
90598
|
+
const seconds = parseInt(options.request, 10);
|
|
90599
|
+
if (isNaN(seconds) || seconds < 0) {
|
|
90600
|
+
error2("--request must be 0 (no timeout) or a positive number of seconds");
|
|
90601
|
+
return;
|
|
90602
|
+
}
|
|
90603
|
+
updateBody.request_timeout_seconds = seconds;
|
|
90604
|
+
}
|
|
90605
|
+
if (options.sseIdle) {
|
|
90606
|
+
const seconds = parseInt(options.sseIdle, 10);
|
|
90607
|
+
if (isNaN(seconds) || seconds < 0) {
|
|
90608
|
+
error2("--sse-idle must be 0 (no timeout) or a positive number of seconds");
|
|
90609
|
+
return;
|
|
90610
|
+
}
|
|
90611
|
+
updateBody.sse_idle_timeout_seconds = seconds;
|
|
90612
|
+
}
|
|
90613
|
+
if (options.websocketIdle) {
|
|
90614
|
+
const seconds = parseInt(options.websocketIdle, 10);
|
|
90615
|
+
if (isNaN(seconds) || seconds < 0) {
|
|
90616
|
+
error2("--websocket-idle must be 0 (no timeout) or a positive number of seconds");
|
|
90617
|
+
return;
|
|
90618
|
+
}
|
|
90619
|
+
updateBody.websocket_idle_timeout_seconds = seconds;
|
|
90620
|
+
}
|
|
90621
|
+
}
|
|
90622
|
+
const updatedEnv = await withSpinner("Updating timeouts...", async () => {
|
|
90623
|
+
const { data, error: error3 } = await updateEnvironmentSettings({
|
|
90624
|
+
client,
|
|
90625
|
+
path: { project_id: projectId, env_id: targetEnv.id },
|
|
90626
|
+
body: updateBody
|
|
90627
|
+
});
|
|
90628
|
+
if (error3)
|
|
90629
|
+
throw new Error(getErrorMessage(error3));
|
|
90630
|
+
return data;
|
|
90631
|
+
});
|
|
90632
|
+
const config2 = updatedEnv?.deployment_config;
|
|
90633
|
+
if (options.json) {
|
|
90634
|
+
json({
|
|
90635
|
+
environment: updatedEnv?.slug,
|
|
90636
|
+
request_timeout_seconds: config2?.requestTimeoutSeconds ?? null,
|
|
90637
|
+
sse_idle_timeout_seconds: config2?.sseIdleTimeoutSeconds ?? null,
|
|
90638
|
+
websocket_idle_timeout_seconds: config2?.websocketIdleTimeoutSeconds ?? null
|
|
90639
|
+
});
|
|
90640
|
+
return;
|
|
90641
|
+
}
|
|
90642
|
+
newline();
|
|
90643
|
+
success2(`Timeouts updated for ${resolved.slug}/${environment}`);
|
|
90644
|
+
newline();
|
|
90645
|
+
keyValue("HTTP request timeout", formatTimeout(config2?.requestTimeoutSeconds));
|
|
90646
|
+
keyValue("SSE idle timeout", formatTimeout(config2?.sseIdleTimeoutSeconds));
|
|
90647
|
+
keyValue("WebSocket idle timeout", formatTimeout(config2?.websocketIdleTimeoutSeconds));
|
|
90648
|
+
} else {
|
|
90649
|
+
const config2 = targetEnv.deployment_config;
|
|
90650
|
+
if (options.json) {
|
|
90651
|
+
json({
|
|
90652
|
+
environment: targetEnv.slug,
|
|
90653
|
+
request_timeout_seconds: config2?.requestTimeoutSeconds ?? null,
|
|
90654
|
+
sse_idle_timeout_seconds: config2?.sseIdleTimeoutSeconds ?? null,
|
|
90655
|
+
websocket_idle_timeout_seconds: config2?.websocketIdleTimeoutSeconds ?? null
|
|
90656
|
+
});
|
|
90657
|
+
return;
|
|
90658
|
+
}
|
|
90659
|
+
newline();
|
|
90660
|
+
header(`${icons.folder} Request timeouts for ${resolved.slug}/${environment}`);
|
|
90661
|
+
newline();
|
|
90662
|
+
keyValue("HTTP request timeout", formatTimeout(config2?.requestTimeoutSeconds));
|
|
90663
|
+
keyValue("SSE idle timeout", formatTimeout(config2?.sseIdleTimeoutSeconds));
|
|
90664
|
+
keyValue("WebSocket idle timeout", formatTimeout(config2?.websocketIdleTimeoutSeconds));
|
|
90665
|
+
newline();
|
|
90666
|
+
info2("An unset value inherits the project default, then the operator's global default —");
|
|
90667
|
+
info2('which is "no timeout" unless an operator has configured one. Nonzero values are');
|
|
90668
|
+
info2("always clamped to the global hard ceiling regardless of what's configured here.");
|
|
90669
|
+
newline();
|
|
90670
|
+
info2(`Set it with: ${colors.muted("temps env timeouts " + environment + " --request 30 --sse-idle 900")}`);
|
|
90671
|
+
info2(`Force no timeout: ${colors.muted("temps env timeouts " + environment + " --request 0")}`);
|
|
90672
|
+
info2(`Clear overrides: ${colors.muted("temps env timeouts " + environment + " --inherit")}`);
|
|
90673
|
+
}
|
|
90674
|
+
}
|
|
90430
90675
|
function describeForceHttps(value) {
|
|
90431
90676
|
if (value === true)
|
|
90432
90677
|
return colors.success("always redirect");
|
|
@@ -94918,6 +95163,33 @@ function buildAutomationSettingsUpdate(options, currentSettings) {
|
|
|
94918
95163
|
enabled
|
|
94919
95164
|
};
|
|
94920
95165
|
}
|
|
95166
|
+
if (options.maxRequestTimeout || options.defaultHttpTimeout || options.defaultSseIdleTimeout || options.defaultWebsocketIdleTimeout) {
|
|
95167
|
+
const current = currentSettings?.request_timeouts;
|
|
95168
|
+
const fields = [
|
|
95169
|
+
["--max-request-timeout", options.maxRequestTimeout, current?.max_request_timeout_seconds ?? 600],
|
|
95170
|
+
["--default-http-timeout", options.defaultHttpTimeout, current?.default_http_timeout_seconds ?? 0],
|
|
95171
|
+
["--default-sse-idle-timeout", options.defaultSseIdleTimeout, current?.default_sse_idle_timeout_seconds ?? 0],
|
|
95172
|
+
["--default-websocket-idle-timeout", options.defaultWebsocketIdleTimeout, current?.default_websocket_idle_timeout_seconds ?? 0]
|
|
95173
|
+
];
|
|
95174
|
+
const parsed = [];
|
|
95175
|
+
for (const [flag, raw, fallback] of fields) {
|
|
95176
|
+
if (raw === undefined) {
|
|
95177
|
+
parsed.push(fallback);
|
|
95178
|
+
continue;
|
|
95179
|
+
}
|
|
95180
|
+
const value = parseInt(raw, 10);
|
|
95181
|
+
if (Number.isNaN(value)) {
|
|
95182
|
+
return { error: `${flag} must be a number, got "${raw}"` };
|
|
95183
|
+
}
|
|
95184
|
+
parsed.push(value);
|
|
95185
|
+
}
|
|
95186
|
+
updates.request_timeouts = {
|
|
95187
|
+
max_request_timeout_seconds: parsed[0],
|
|
95188
|
+
default_http_timeout_seconds: parsed[1],
|
|
95189
|
+
default_sse_idle_timeout_seconds: parsed[2],
|
|
95190
|
+
default_websocket_idle_timeout_seconds: parsed[3]
|
|
95191
|
+
};
|
|
95192
|
+
}
|
|
94921
95193
|
if (options.setting && options.value) {
|
|
94922
95194
|
switch (options.setting) {
|
|
94923
95195
|
case "external_url":
|
|
@@ -94938,7 +95210,7 @@ function buildAutomationSettingsUpdate(options, currentSettings) {
|
|
|
94938
95210
|
function registerSettingsCommands(program2) {
|
|
94939
95211
|
const settings = program2.command("settings").description("Manage platform settings");
|
|
94940
95212
|
settings.command("show").alias("get").description("Show current platform settings").option("--json", "Output in JSON format").action(showSettings);
|
|
94941
|
-
settings.command("update").alias("set").description("Update platform settings").option("-s, --setting <setting>", "Setting to update (external_url, preview_domain, letsencrypt, rate_limiting, security_headers, screenshots)").option("-v, --value <value>", "Value for the setting").option("--external-url <url>", "External URL for the platform").option("--preview-domain <domain>", "Preview domain pattern").option("--letsencrypt-email <email>", "Let's Encrypt email").option("--letsencrypt-mode <mode>", "Let's Encrypt mode (staging, production)").option("--rate-limiting-enabled <enabled>", "Enable rate limiting (true/false)").option("--rate-limiting-rpm <rpm>", "Requests per minute").option("--screenshots-enabled <enabled>", "Enable screenshots (true/false)").option("-y, --yes", "Skip confirmation prompts (for automation)").action(updateSettingsAction2);
|
|
95213
|
+
settings.command("update").alias("set").description("Update platform settings").option("-s, --setting <setting>", "Setting to update (external_url, preview_domain, letsencrypt, rate_limiting, security_headers, screenshots)").option("-v, --value <value>", "Value for the setting").option("--external-url <url>", "External URL for the platform").option("--preview-domain <domain>", "Preview domain pattern").option("--letsencrypt-email <email>", "Let's Encrypt email").option("--letsencrypt-mode <mode>", "Let's Encrypt mode (staging, production)").option("--rate-limiting-enabled <enabled>", "Enable rate limiting (true/false)").option("--rate-limiting-rpm <rpm>", "Requests per minute").option("--screenshots-enabled <enabled>", "Enable screenshots (true/false)").option("--max-request-timeout <seconds>", "Hard ceiling for all upstream request/idle timeouts, in seconds").option("--default-http-timeout <seconds>", "Default timeout for regular HTTP requests, in seconds").option("--default-sse-idle-timeout <seconds>", "Default idle timeout for SSE streams, in seconds").option("--default-websocket-idle-timeout <seconds>", "Default idle timeout for WebSocket connections, in seconds").option("-y, --yes", "Skip confirmation prompts (for automation)").action(updateSettingsAction2);
|
|
94942
95214
|
settings.command("set-external-url").description("Set the external URL for the platform").requiredOption("--url <url>", "External URL").action(setExternalUrl);
|
|
94943
95215
|
settings.command("set-preview-domain").description("Set the preview domain pattern").requiredOption("--domain <domain>", "Preview domain pattern").action(setPreviewDomain);
|
|
94944
95216
|
}
|
|
@@ -95026,7 +95298,7 @@ async function updateSettingsAction2(options) {
|
|
|
95026
95298
|
throw new Error(getErrorMessage(getError));
|
|
95027
95299
|
}
|
|
95028
95300
|
const updates = {};
|
|
95029
|
-
const isAutomation = options.yes && (options.externalUrl || options.previewDomain || options.letsencryptEmail || options.letsencryptMode || options.rateLimitingEnabled || options.screenshotsEnabled || options.setting && options.value);
|
|
95301
|
+
const isAutomation = options.yes && (options.externalUrl || options.previewDomain || options.letsencryptEmail || options.letsencryptMode || options.rateLimitingEnabled || options.screenshotsEnabled || options.maxRequestTimeout || options.defaultHttpTimeout || options.defaultSseIdleTimeout || options.defaultWebsocketIdleTimeout || options.setting && options.value);
|
|
95030
95302
|
if (isAutomation) {
|
|
95031
95303
|
const result2 = buildAutomationSettingsUpdate(options, currentSettings ?? undefined);
|
|
95032
95304
|
if ("error" in result2) {
|
|
@@ -95043,7 +95315,8 @@ async function updateSettingsAction2(options) {
|
|
|
95043
95315
|
{ name: "Let's Encrypt Settings", value: "letsencrypt" },
|
|
95044
95316
|
{ name: "Rate Limiting", value: "rate_limiting" },
|
|
95045
95317
|
{ name: "Security Headers", value: "security_headers" },
|
|
95046
|
-
{ name: "Screenshots", value: "screenshots" }
|
|
95318
|
+
{ name: "Screenshots", value: "screenshots" },
|
|
95319
|
+
{ name: "Request Timeouts", value: "request_timeouts" }
|
|
95047
95320
|
]
|
|
95048
95321
|
});
|
|
95049
95322
|
switch (settingToUpdate) {
|
|
@@ -95131,12 +95404,28 @@ async function updateSettingsAction2(options) {
|
|
|
95131
95404
|
};
|
|
95132
95405
|
break;
|
|
95133
95406
|
}
|
|
95407
|
+
case "request_timeouts": {
|
|
95408
|
+
info2("0 means no timeout. Timeouts are opt-in — existing apps are unaffected until you set a nonzero default here.");
|
|
95409
|
+
info2("The hard ceiling only applies once a timeout is actually configured; it never creates one on its own.");
|
|
95410
|
+
newline();
|
|
95411
|
+
const maxRequestTimeout = await promptNumber("Hard ceiling for all request/idle timeouts (seconds)", { default: currentSettings?.request_timeouts?.max_request_timeout_seconds ?? 600, min: 5 });
|
|
95412
|
+
const defaultHttpTimeout = await promptNumber("Default timeout for regular HTTP requests (seconds, 0 = no timeout)", { default: currentSettings?.request_timeouts?.default_http_timeout_seconds ?? 0, min: 0 });
|
|
95413
|
+
const defaultSseIdleTimeout = await promptNumber("Default idle timeout for SSE streams (seconds, 0 = no timeout)", { default: currentSettings?.request_timeouts?.default_sse_idle_timeout_seconds ?? 0, min: 0 });
|
|
95414
|
+
const defaultWebsocketIdleTimeout = await promptNumber("Default idle timeout for WebSocket connections (seconds, 0 = no timeout)", { default: currentSettings?.request_timeouts?.default_websocket_idle_timeout_seconds ?? 0, min: 0 });
|
|
95415
|
+
updates.request_timeouts = {
|
|
95416
|
+
max_request_timeout_seconds: maxRequestTimeout,
|
|
95417
|
+
default_http_timeout_seconds: defaultHttpTimeout,
|
|
95418
|
+
default_sse_idle_timeout_seconds: defaultSseIdleTimeout,
|
|
95419
|
+
default_websocket_idle_timeout_seconds: defaultWebsocketIdleTimeout
|
|
95420
|
+
};
|
|
95421
|
+
break;
|
|
95422
|
+
}
|
|
95134
95423
|
}
|
|
95135
95424
|
}
|
|
95136
95425
|
await withSpinner("Updating settings...", async () => {
|
|
95137
95426
|
const { error: error3 } = await updateSettings({
|
|
95138
95427
|
client,
|
|
95139
|
-
body: updates
|
|
95428
|
+
body: { ...currentSettings, ...updates }
|
|
95140
95429
|
});
|
|
95141
95430
|
if (error3) {
|
|
95142
95431
|
throw new Error(getErrorMessage(error3));
|
|
@@ -95148,11 +95437,13 @@ async function setExternalUrl(options) {
|
|
|
95148
95437
|
await requireAuth();
|
|
95149
95438
|
await setupClient();
|
|
95150
95439
|
await withSpinner("Updating external URL...", async () => {
|
|
95440
|
+
const { data: currentSettings, error: getError } = await getSettings({ client });
|
|
95441
|
+
if (getError) {
|
|
95442
|
+
throw new Error(getErrorMessage(getError));
|
|
95443
|
+
}
|
|
95151
95444
|
const { error: error3 } = await updateSettings({
|
|
95152
95445
|
client,
|
|
95153
|
-
body: {
|
|
95154
|
-
external_url: options.url
|
|
95155
|
-
}
|
|
95446
|
+
body: { ...currentSettings, external_url: options.url }
|
|
95156
95447
|
});
|
|
95157
95448
|
if (error3) {
|
|
95158
95449
|
throw new Error(getErrorMessage(error3));
|
|
@@ -95164,11 +95455,13 @@ async function setPreviewDomain(options) {
|
|
|
95164
95455
|
await requireAuth();
|
|
95165
95456
|
await setupClient();
|
|
95166
95457
|
await withSpinner("Updating preview domain...", async () => {
|
|
95458
|
+
const { data: currentSettings, error: getError } = await getSettings({ client });
|
|
95459
|
+
if (getError) {
|
|
95460
|
+
throw new Error(getErrorMessage(getError));
|
|
95461
|
+
}
|
|
95167
95462
|
const { error: error3 } = await updateSettings({
|
|
95168
95463
|
client,
|
|
95169
|
-
body: {
|
|
95170
|
-
preview_domain: options.domain
|
|
95171
|
-
}
|
|
95464
|
+
body: { ...currentSettings, preview_domain: options.domain }
|
|
95172
95465
|
});
|
|
95173
95466
|
if (error3) {
|
|
95174
95467
|
throw new Error(getErrorMessage(error3));
|
|
@@ -97593,6 +97886,9 @@ async function watchMetrics(projectId, environmentId, containerIds, intervalMs)
|
|
|
97593
97886
|
console.log("\x1B[?25h");
|
|
97594
97887
|
}
|
|
97595
97888
|
|
|
97889
|
+
// src/commands/docs.ts
|
|
97890
|
+
import { writeFile as writeFile6 } from "node:fs/promises";
|
|
97891
|
+
|
|
97596
97892
|
// src/cli.ts
|
|
97597
97893
|
init_source();
|
|
97598
97894
|
init_output();
|
|
@@ -98679,6 +98975,307 @@ async function getErrorDashboardAction(options) {
|
|
|
98679
98975
|
newline();
|
|
98680
98976
|
}
|
|
98681
98977
|
|
|
98978
|
+
// src/commands/metrics/query.ts
|
|
98979
|
+
init_sdk_gen();
|
|
98980
|
+
init_spinner();
|
|
98981
|
+
init_output();
|
|
98982
|
+
|
|
98983
|
+
// src/commands/analytics/period.ts
|
|
98984
|
+
function parsePeriod(period) {
|
|
98985
|
+
const now2 = new Date;
|
|
98986
|
+
const endDate = now2.toISOString();
|
|
98987
|
+
if (period === "today") {
|
|
98988
|
+
const start2 = new Date(now2.getFullYear(), now2.getMonth(), now2.getDate());
|
|
98989
|
+
return { startDate: start2.toISOString(), endDate, label: "today" };
|
|
98990
|
+
}
|
|
98991
|
+
const match = period.match(/^(\d+)(h|d|m)$/);
|
|
98992
|
+
if (!match) {
|
|
98993
|
+
throw new Error(`Invalid period "${period}". Use: today, <n>h (hours), <n>d (days), <n>m (months). Examples: 1h, 6h, 24h, 7d, 30d, 3m`);
|
|
98994
|
+
}
|
|
98995
|
+
const n = parseInt(match[1], 10);
|
|
98996
|
+
const unit = match[2];
|
|
98997
|
+
let start;
|
|
98998
|
+
let label;
|
|
98999
|
+
switch (unit) {
|
|
99000
|
+
case "h":
|
|
99001
|
+
start = new Date(now2.getTime() - n * 60 * 60 * 1000);
|
|
99002
|
+
label = n === 1 ? "last hour" : `last ${n} hours`;
|
|
99003
|
+
break;
|
|
99004
|
+
case "d":
|
|
99005
|
+
start = new Date(now2.getTime() - n * 24 * 60 * 60 * 1000);
|
|
99006
|
+
label = n === 1 ? "last day" : `last ${n} days`;
|
|
99007
|
+
break;
|
|
99008
|
+
case "m":
|
|
99009
|
+
start = new Date(now2);
|
|
99010
|
+
start.setMonth(start.getMonth() - n);
|
|
99011
|
+
label = n === 1 ? "last month" : `last ${n} months`;
|
|
99012
|
+
break;
|
|
99013
|
+
default:
|
|
99014
|
+
throw new Error(`Unknown unit "${unit}"`);
|
|
99015
|
+
}
|
|
99016
|
+
return { startDate: start.toISOString(), endDate, label };
|
|
99017
|
+
}
|
|
99018
|
+
|
|
99019
|
+
// src/commands/metrics/query.ts
|
|
99020
|
+
function seriesLabel(bucket) {
|
|
99021
|
+
if (!bucket.series_key || bucket.series_key.length === 0)
|
|
99022
|
+
return "";
|
|
99023
|
+
return bucket.series_key.map(([k, v]) => `${k}=${v}`).join(",");
|
|
99024
|
+
}
|
|
99025
|
+
async function metricsQuery(options) {
|
|
99026
|
+
await requireAuth();
|
|
99027
|
+
await setupClient();
|
|
99028
|
+
const resolved = await requireProjectSlug(options.project);
|
|
99029
|
+
if (resolved.source !== "flag") {
|
|
99030
|
+
info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
|
|
99031
|
+
}
|
|
99032
|
+
const { data: projectData, error: projectError } = await getProjectBySlug({
|
|
99033
|
+
client,
|
|
99034
|
+
path: { slug: resolved.slug }
|
|
99035
|
+
});
|
|
99036
|
+
if (projectError || !projectData) {
|
|
99037
|
+
throw new Error(`Project "${resolved.slug}" not found`);
|
|
99038
|
+
}
|
|
99039
|
+
const projectId = projectData.id;
|
|
99040
|
+
let startTime = options.startTime;
|
|
99041
|
+
let endTime = options.endTime;
|
|
99042
|
+
let periodLabel = "custom range";
|
|
99043
|
+
if (!startTime && !endTime) {
|
|
99044
|
+
const period = options.period ?? "24h";
|
|
99045
|
+
const parsed = parsePeriod(period);
|
|
99046
|
+
startTime = parsed.startDate;
|
|
99047
|
+
endTime = parsed.endDate;
|
|
99048
|
+
periodLabel = parsed.label;
|
|
99049
|
+
}
|
|
99050
|
+
if (!options.metricName) {
|
|
99051
|
+
warning2('No --metric-name given — this returns every metric bucketed together. Run "temps metrics names" to discover available names.');
|
|
99052
|
+
}
|
|
99053
|
+
const limit = options.limit ? parseInt(options.limit, 10) : 500;
|
|
99054
|
+
const data = await withSpinner("Querying metrics...", async () => {
|
|
99055
|
+
const { data: data2, error: error3 } = await queryMetrics({
|
|
99056
|
+
client,
|
|
99057
|
+
query: {
|
|
99058
|
+
project_id: projectId,
|
|
99059
|
+
metric_name: options.metricName,
|
|
99060
|
+
service_name: options.serviceName,
|
|
99061
|
+
environment: options.environment,
|
|
99062
|
+
start_time: startTime,
|
|
99063
|
+
end_time: endTime,
|
|
99064
|
+
bucket_interval: options.bucketInterval,
|
|
99065
|
+
aggregation: options.aggregation,
|
|
99066
|
+
metric_type: options.metricType,
|
|
99067
|
+
label_filters: options.labelFilters,
|
|
99068
|
+
group_by: options.groupBy,
|
|
99069
|
+
limit
|
|
99070
|
+
}
|
|
99071
|
+
});
|
|
99072
|
+
if (error3)
|
|
99073
|
+
throw new Error(getErrorMessage(error3));
|
|
99074
|
+
return data2;
|
|
99075
|
+
});
|
|
99076
|
+
const buckets = data?.data ?? [];
|
|
99077
|
+
if (options.json) {
|
|
99078
|
+
json({
|
|
99079
|
+
project: resolved.slug,
|
|
99080
|
+
metric_name: options.metricName,
|
|
99081
|
+
start_time: startTime,
|
|
99082
|
+
end_time: endTime,
|
|
99083
|
+
aggregation: options.aggregation ?? "avg",
|
|
99084
|
+
count: data?.count ?? 0,
|
|
99085
|
+
data: buckets
|
|
99086
|
+
});
|
|
99087
|
+
return;
|
|
99088
|
+
}
|
|
99089
|
+
header(`Metrics${options.metricName ? `: ${options.metricName}` : ""} — ${resolved.slug} (${periodLabel})`);
|
|
99090
|
+
if (buckets.length === 0) {
|
|
99091
|
+
newline();
|
|
99092
|
+
console.log(colors.muted(" No metric data in this window."));
|
|
99093
|
+
console.log(colors.muted(' Check the metric name with "temps metrics names -p ' + resolved.slug + '", or widen --period.'));
|
|
99094
|
+
newline();
|
|
99095
|
+
return;
|
|
99096
|
+
}
|
|
99097
|
+
const hasSeries = buckets.some((b) => b.series_key && b.series_key.length > 0);
|
|
99098
|
+
const columns = [
|
|
99099
|
+
{ header: "Bucket", accessor: (b) => new Date(b.bucket).toLocaleString(), align: "left" },
|
|
99100
|
+
...hasSeries ? [{ header: "Series", accessor: seriesLabel, align: "left" }] : [],
|
|
99101
|
+
{ header: "Avg", accessor: (b) => b.avg_value.toFixed(4), align: "right" },
|
|
99102
|
+
{ header: "Min", accessor: (b) => b.min_value.toFixed(4), align: "right" },
|
|
99103
|
+
{ header: "Max", accessor: (b) => b.max_value.toFixed(4), align: "right" },
|
|
99104
|
+
{ header: "Count", accessor: (b) => b.count, align: "right" }
|
|
99105
|
+
];
|
|
99106
|
+
printTable(buckets, columns, { style: "minimal" });
|
|
99107
|
+
newline();
|
|
99108
|
+
console.log(colors.muted(` ${buckets.length} bucket(s)`));
|
|
99109
|
+
newline();
|
|
99110
|
+
}
|
|
99111
|
+
|
|
99112
|
+
// src/commands/metrics/names.ts
|
|
99113
|
+
init_sdk_gen();
|
|
99114
|
+
init_spinner();
|
|
99115
|
+
init_output();
|
|
99116
|
+
async function metricsNames(options) {
|
|
99117
|
+
await requireAuth();
|
|
99118
|
+
await setupClient();
|
|
99119
|
+
const resolved = await requireProjectSlug(options.project);
|
|
99120
|
+
if (resolved.source !== "flag") {
|
|
99121
|
+
info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
|
|
99122
|
+
}
|
|
99123
|
+
const { data: projectData, error: projectError } = await getProjectBySlug({
|
|
99124
|
+
client,
|
|
99125
|
+
path: { slug: resolved.slug }
|
|
99126
|
+
});
|
|
99127
|
+
if (projectError || !projectData) {
|
|
99128
|
+
throw new Error(`Project "${resolved.slug}" not found`);
|
|
99129
|
+
}
|
|
99130
|
+
const names = await withSpinner("Fetching metric names...", async () => {
|
|
99131
|
+
const { data, error: error3 } = await listMetricNames({
|
|
99132
|
+
client,
|
|
99133
|
+
path: { project_id: projectData.id }
|
|
99134
|
+
});
|
|
99135
|
+
if (error3)
|
|
99136
|
+
throw new Error(getErrorMessage(error3));
|
|
99137
|
+
return data?.names ?? [];
|
|
99138
|
+
});
|
|
99139
|
+
if (options.json) {
|
|
99140
|
+
json({ project: resolved.slug, names });
|
|
99141
|
+
return;
|
|
99142
|
+
}
|
|
99143
|
+
header(`Metric Names — ${resolved.slug}`);
|
|
99144
|
+
newline();
|
|
99145
|
+
if (names.length === 0) {
|
|
99146
|
+
console.log(colors.muted(" No metrics have been ingested for this project yet."));
|
|
99147
|
+
newline();
|
|
99148
|
+
return;
|
|
99149
|
+
}
|
|
99150
|
+
list(names);
|
|
99151
|
+
newline();
|
|
99152
|
+
console.log(colors.muted(` ${names.length} metric(s). Query one with: temps metrics query -p ${resolved.slug} --metric-name <name>`));
|
|
99153
|
+
newline();
|
|
99154
|
+
}
|
|
99155
|
+
|
|
99156
|
+
// src/commands/metrics/label-keys.ts
|
|
99157
|
+
init_sdk_gen();
|
|
99158
|
+
init_spinner();
|
|
99159
|
+
init_output();
|
|
99160
|
+
async function metricsLabelKeys(options) {
|
|
99161
|
+
await requireAuth();
|
|
99162
|
+
await setupClient();
|
|
99163
|
+
const resolved = await requireProjectSlug(options.project);
|
|
99164
|
+
if (resolved.source !== "flag") {
|
|
99165
|
+
info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
|
|
99166
|
+
}
|
|
99167
|
+
const { data: projectData, error: projectError } = await getProjectBySlug({
|
|
99168
|
+
client,
|
|
99169
|
+
path: { slug: resolved.slug }
|
|
99170
|
+
});
|
|
99171
|
+
if (projectError || !projectData) {
|
|
99172
|
+
throw new Error(`Project "${resolved.slug}" not found`);
|
|
99173
|
+
}
|
|
99174
|
+
const keys2 = await withSpinner("Fetching label keys...", async () => {
|
|
99175
|
+
const { data, error: error3 } = await listMetricLabelKeys({
|
|
99176
|
+
client,
|
|
99177
|
+
query: {
|
|
99178
|
+
project_id: projectData.id,
|
|
99179
|
+
metric_name: options.metricName,
|
|
99180
|
+
start_time: options.startTime,
|
|
99181
|
+
end_time: options.endTime
|
|
99182
|
+
}
|
|
99183
|
+
});
|
|
99184
|
+
if (error3)
|
|
99185
|
+
throw new Error(getErrorMessage(error3));
|
|
99186
|
+
return data?.keys ?? [];
|
|
99187
|
+
});
|
|
99188
|
+
if (options.json) {
|
|
99189
|
+
json({ project: resolved.slug, metric_name: options.metricName, keys: keys2 });
|
|
99190
|
+
return;
|
|
99191
|
+
}
|
|
99192
|
+
header(`Label Keys — ${options.metricName} (${resolved.slug})`);
|
|
99193
|
+
newline();
|
|
99194
|
+
if (keys2.length === 0) {
|
|
99195
|
+
console.log(colors.muted(" No labels observed on this metric in the window."));
|
|
99196
|
+
newline();
|
|
99197
|
+
return;
|
|
99198
|
+
}
|
|
99199
|
+
list(keys2);
|
|
99200
|
+
newline();
|
|
99201
|
+
}
|
|
99202
|
+
|
|
99203
|
+
// src/commands/metrics/label-values.ts
|
|
99204
|
+
init_sdk_gen();
|
|
99205
|
+
init_spinner();
|
|
99206
|
+
init_output();
|
|
99207
|
+
async function metricsLabelValues(options) {
|
|
99208
|
+
await requireAuth();
|
|
99209
|
+
await setupClient();
|
|
99210
|
+
const resolved = await requireProjectSlug(options.project);
|
|
99211
|
+
if (resolved.source !== "flag") {
|
|
99212
|
+
info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
|
|
99213
|
+
}
|
|
99214
|
+
const { data: projectData, error: projectError } = await getProjectBySlug({
|
|
99215
|
+
client,
|
|
99216
|
+
path: { slug: resolved.slug }
|
|
99217
|
+
});
|
|
99218
|
+
if (projectError || !projectData) {
|
|
99219
|
+
throw new Error(`Project "${resolved.slug}" not found`);
|
|
99220
|
+
}
|
|
99221
|
+
const values2 = await withSpinner("Fetching label values...", async () => {
|
|
99222
|
+
const { data, error: error3 } = await listMetricLabelValues({
|
|
99223
|
+
client,
|
|
99224
|
+
query: {
|
|
99225
|
+
project_id: projectData.id,
|
|
99226
|
+
metric_name: options.metricName,
|
|
99227
|
+
label_key: options.labelKey,
|
|
99228
|
+
start_time: options.startTime,
|
|
99229
|
+
end_time: options.endTime
|
|
99230
|
+
}
|
|
99231
|
+
});
|
|
99232
|
+
if (error3)
|
|
99233
|
+
throw new Error(getErrorMessage(error3));
|
|
99234
|
+
return data?.values ?? [];
|
|
99235
|
+
});
|
|
99236
|
+
if (options.json) {
|
|
99237
|
+
json({
|
|
99238
|
+
project: resolved.slug,
|
|
99239
|
+
metric_name: options.metricName,
|
|
99240
|
+
label_key: options.labelKey,
|
|
99241
|
+
values: values2
|
|
99242
|
+
});
|
|
99243
|
+
return;
|
|
99244
|
+
}
|
|
99245
|
+
header(`Label Values — ${options.labelKey} on ${options.metricName} (${resolved.slug})`);
|
|
99246
|
+
newline();
|
|
99247
|
+
if (values2.length === 0) {
|
|
99248
|
+
console.log(colors.muted(" No values observed for this label in the window."));
|
|
99249
|
+
newline();
|
|
99250
|
+
return;
|
|
99251
|
+
}
|
|
99252
|
+
list(values2);
|
|
99253
|
+
newline();
|
|
99254
|
+
}
|
|
99255
|
+
|
|
99256
|
+
// src/commands/metrics/index.ts
|
|
99257
|
+
function registerMetricsCommands(program2) {
|
|
99258
|
+
const metrics = program2.command("metrics").alias("metric").description('Query OTel application metrics for debugging (not container/docker stats — see "temps containers metrics" for those)');
|
|
99259
|
+
metrics.command("names").description("List distinct metric names ingested for a project — start here if you don't know what to query").option("-p, --project <project>", "Project slug or ID").option("--json", "Output in JSON format").action(metricsNames);
|
|
99260
|
+
metrics.command("query").description("Query a metric with time bucketing and aggregation").option("-p, --project <project>", "Project slug or ID").option("--metric-name <name>", 'Metric to query (see "temps metrics names")').option("--service-name <name>", "Filter by service name").option("--environment <name>", "Filter by deployment environment name").option("--period <period>", "Time period: today, <n>h, <n>d, <n>m (e.g. 1h, 24h, 7d)", "24h").option("--start-time <iso>", "Explicit window start (RFC 3339) — overrides --period").option("--end-time <iso>", "Explicit window end (RFC 3339) — overrides --period").option("--bucket-interval <interval>", 'Bucket size, e.g. "5 minutes", "1 hour"').option("--aggregation <mode>", "Per-bucket aggregation: avg (default), sum, min, max, count, rate, p50/p95/p99, quantile:0.95").option("--metric-type <type>", "Filter by metric type: gauge, sum, histogram, exponential_histogram, summary").option("--label-filters <pairs>", "Comma-separated key=value data-point label filters, e.g. http.method=GET,http.status_code=200").option("--group-by <keys>", "Comma-separated label keys to group series by, e.g. http.method,http.route").option("--limit <n>", "Max buckets to return (default: 500, server cap: 1000)").option("--json", "Output in JSON format").action(metricsQuery);
|
|
99261
|
+
metrics.command("label-keys").description("List the label keys observed on a metric — powers filter/group-by discovery").option("-p, --project <project>", "Project slug or ID").requiredOption("--metric-name <name>", "Metric to inspect").option("--start-time <iso>", "Window start (RFC 3339); defaults to 24h before end").option("--end-time <iso>", "Window end (RFC 3339); defaults to now").option("--json", "Output in JSON format").action(metricsLabelKeys);
|
|
99262
|
+
metrics.command("label-values").description("List the distinct values seen for a label key on a metric").option("-p, --project <project>", "Project slug or ID").requiredOption("--metric-name <name>", "Metric to inspect").requiredOption("--label-key <key>", "Label key whose values to list").option("--start-time <iso>", "Window start (RFC 3339); defaults to 24h before end").option("--end-time <iso>", "Window end (RFC 3339); defaults to now").option("--json", "Output in JSON format").action(metricsLabelValues);
|
|
99263
|
+
metrics.addHelpText("after", `
|
|
99264
|
+
Discovery workflow — find a metric, then narrow it down:
|
|
99265
|
+
$ temps metrics names -p my-app
|
|
99266
|
+
$ temps metrics label-keys -p my-app --metric-name go.goroutine.count
|
|
99267
|
+
$ temps metrics label-values -p my-app --metric-name go.goroutine.count --label-key http.method
|
|
99268
|
+
|
|
99269
|
+
Examples:
|
|
99270
|
+
$ temps metrics query -p my-app --metric-name go.goroutine.count --period 24h
|
|
99271
|
+
$ temps metrics query -p my-app --metric-name http.server.duration --aggregation p95 --period 7d
|
|
99272
|
+
$ temps metrics query -p my-app --metric-name http.server.duration \\
|
|
99273
|
+
--label-filters http.method=GET,http.status_code=200 --group-by http.route
|
|
99274
|
+
$ temps metrics query -p my-app --metric-name go.goroutine.count \\
|
|
99275
|
+
--start-time 2026-08-12T10:01:12.053Z --end-time 2026-08-13T10:01:12.053Z \\
|
|
99276
|
+
--bucket-interval "15 minutes" --aggregation avg --limit 500 --json`);
|
|
99277
|
+
}
|
|
99278
|
+
|
|
98682
99279
|
// src/commands/traces/index.ts
|
|
98683
99280
|
init_sdk_gen();
|
|
98684
99281
|
init_spinner();
|
|
@@ -107074,44 +107671,6 @@ init_source();
|
|
|
107074
107671
|
init_sdk_gen();
|
|
107075
107672
|
init_spinner();
|
|
107076
107673
|
init_output();
|
|
107077
|
-
|
|
107078
|
-
// src/commands/analytics/period.ts
|
|
107079
|
-
function parsePeriod(period) {
|
|
107080
|
-
const now2 = new Date;
|
|
107081
|
-
const endDate = now2.toISOString();
|
|
107082
|
-
if (period === "today") {
|
|
107083
|
-
const start2 = new Date(now2.getFullYear(), now2.getMonth(), now2.getDate());
|
|
107084
|
-
return { startDate: start2.toISOString(), endDate, label: "today" };
|
|
107085
|
-
}
|
|
107086
|
-
const match = period.match(/^(\d+)(h|d|m)$/);
|
|
107087
|
-
if (!match) {
|
|
107088
|
-
throw new Error(`Invalid period "${period}". Use: today, <n>h (hours), <n>d (days), <n>m (months). Examples: 1h, 6h, 24h, 7d, 30d, 3m`);
|
|
107089
|
-
}
|
|
107090
|
-
const n = parseInt(match[1], 10);
|
|
107091
|
-
const unit = match[2];
|
|
107092
|
-
let start;
|
|
107093
|
-
let label;
|
|
107094
|
-
switch (unit) {
|
|
107095
|
-
case "h":
|
|
107096
|
-
start = new Date(now2.getTime() - n * 60 * 60 * 1000);
|
|
107097
|
-
label = n === 1 ? "last hour" : `last ${n} hours`;
|
|
107098
|
-
break;
|
|
107099
|
-
case "d":
|
|
107100
|
-
start = new Date(now2.getTime() - n * 24 * 60 * 60 * 1000);
|
|
107101
|
-
label = n === 1 ? "last day" : `last ${n} days`;
|
|
107102
|
-
break;
|
|
107103
|
-
case "m":
|
|
107104
|
-
start = new Date(now2);
|
|
107105
|
-
start.setMonth(start.getMonth() - n);
|
|
107106
|
-
label = n === 1 ? "last month" : `last ${n} months`;
|
|
107107
|
-
break;
|
|
107108
|
-
default:
|
|
107109
|
-
throw new Error(`Unknown unit "${unit}"`);
|
|
107110
|
-
}
|
|
107111
|
-
return { startDate: start.toISOString(), endDate, label };
|
|
107112
|
-
}
|
|
107113
|
-
|
|
107114
|
-
// src/commands/analytics/overview.ts
|
|
107115
107674
|
var SPARKLINE_WIDTH = 48;
|
|
107116
107675
|
function bucketSizeForRange(startDate, endDate) {
|
|
107117
107676
|
const hours = (Date.parse(endDate) - Date.parse(startDate)) / 3600000;
|
|
@@ -109264,8 +109823,8 @@ async function updateAction5(options) {
|
|
|
109264
109823
|
const { data, error: error3 } = await client.get({ url: "/settings/secrets" });
|
|
109265
109824
|
if (error3)
|
|
109266
109825
|
throw new Error(getErrorMessage(error3));
|
|
109267
|
-
const
|
|
109268
|
-
const found =
|
|
109826
|
+
const list4 = data;
|
|
109827
|
+
const found = list4.items.find((s) => s.name === options.name);
|
|
109269
109828
|
if (!found)
|
|
109270
109829
|
throw new Error(`Secret '${options.name}' not found`);
|
|
109271
109830
|
return found;
|
|
@@ -110035,7 +110594,7 @@ function base64Decode(b64) {
|
|
|
110035
110594
|
}
|
|
110036
110595
|
function registerSandboxCommands(program2) {
|
|
110037
110596
|
const sandbox = program2.command("sandbox").description("Manage standalone sandboxes (/v1/sandbox API)");
|
|
110038
|
-
sandbox.command("create").description("Create a new sandbox").option("--image <image>", "Docker image override (uses platform default when omitted)").option("--name <name>", "Display name for the sandbox").option("--timeout <seconds>", "Idle timeout in seconds (clamped to [60, 86400])").option("-e, --env <KEY=VAL>", "Env var baked into the container (repeatable)", (val, prev) => prev ? [...prev, val] : [val]).option("--cpu-limit <cpu>", "CPU limit (e.g., 0.5 for half a core)").option("--memory-mb <mb>", "Memory limit in megabytes").option("--git-url <url>", "Git repo URL to clone into the work dir").option("--git-rev <revision>", "Git revision to check out (requires --git-url)").option("--git-depth <n>", "Shallow clone depth (requires --git-url)").option("--git-connection <id>", "ID of a stored git provider connection; temps injects the token server-side").option("--git-username <user>", "HTTP Basic username for private repo clone (requires --git-password)").option("--git-password <token>", "HTTP Basic password/token (paired with --git-username; injected via GIT_ASKPASS)").option("--tarball-url <url>", "Tarball URL to download and extract").option("--workspace", "Create a persistent workspace: suspends when idle, wakes automatically on the next command, and is never destroyed for you").option("--project <slug>", "Seed from a temps project's connected repo (and attribute the sandbox to it). Defaults to the linked project in .temps/config.json").option("--repo <owner/name>", "Seed from a repo on one of your git connections that has no temps project").option("--branch <ref>", "Branch, tag, or SHA to check out (alias of --git-rev)").option("--new-branch <name>", "Create and switch to a new branch after cloning, based on whatever was checked out").option("--preview-password", "Generate a random preview-URL password and print it once on stdout").option("--preview-password-length <n>", "Length of the generated preview password (8..=256, default 24)").option("--json", "Output as JSON").action(createAction6);
|
|
110597
|
+
sandbox.command("create").description("Create a new sandbox").option("--image <image>", "Docker image override (uses platform default when omitted)").option("--name <name>", "Display name for the sandbox").option("--timeout <seconds>", "Idle timeout in seconds (clamped to [60, 86400])").option("-e, --env <KEY=VAL>", "Env var baked into the container (repeatable)", (val, prev) => prev ? [...prev, val] : [val]).option("--cpu-limit <cpu>", "CPU limit (e.g., 0.5 for half a core)").option("--memory-mb <mb>", "Memory limit in megabytes").option("--git-url <url>", "Git repo URL to clone into the work dir").option("--git-rev <revision>", "Git revision to check out (requires --git-url)").option("--git-depth <n>", "Shallow clone depth (requires --git-url)").option("--git-connection <id>", "ID of a stored git provider connection; temps injects the token server-side").option("--git-username <user>", "HTTP Basic username for private repo clone (requires --git-password)").option("--git-password <token>", "HTTP Basic password/token (paired with --git-username; injected via GIT_ASKPASS)").option("--tarball-url <url>", "Tarball URL to download and extract").option("--workspace", "Create a persistent workspace: suspends when idle, wakes automatically on the next command, and is never destroyed for you").option("--project <slug>", "Seed from a temps project's connected repo (and attribute the sandbox to it). Defaults to the linked project in .temps/config.json").option("--repo <owner/name>", "Seed from a repo on one of your git connections that has no temps project").option("--branch <ref>", "Branch, tag, or SHA to check out (alias of --git-rev)").option("--new-branch <name>", "Create and switch to a new branch after cloning, based on whatever was checked out").option("--preview-password", "Generate a random preview-URL password and print it once on stdout").option("--preview-password-length <n>", "Length of the generated preview password (8..=256, default 24)").option("--from-snapshot <snap-id>", "Create sandbox from a snapshot (mutually exclusive with --image)").option("--json", "Output as JSON").action(createAction6);
|
|
110039
110598
|
sandbox.command("list").alias("ls").description("List your sandboxes").option("--page <n>", "Page (1-indexed)").option("--page-size <n>", "Items per page (default 20, max 100)").option("--workspace", "Show only persistent workspaces").option("--lifecycle <class>", "Filter by lifecycle class: ephemeral | workspace").option("--project <slug>", "Show only sandboxes created from this project").option("--json", "Output as JSON").action(listAction7);
|
|
110040
110599
|
sandbox.command("show <id>").description("Show details for a sandbox").option("--json", "Output as JSON").action(showAction2);
|
|
110041
110600
|
sandbox.command("rm <id>").aliases(["stop", "destroy"]).description("Remove a sandbox permanently (aliases: stop, destroy)").option("-f, --force", "Skip confirmation prompt").action(rmAction);
|
|
@@ -110054,6 +110613,12 @@ function registerSandboxCommands(program2) {
|
|
|
110054
110613
|
fs5.command("write <id>").description("Write a file to the sandbox").requiredOption("--path <path>", "Absolute target path inside the sandbox").option("--file <localPath>", "Local source file to upload (mutually exclusive with --content)").option("--content <string>", "Inline string content to write").option("--mode <octal>", "Unix permission mask (default: 0644)").action(fsWriteAction);
|
|
110055
110614
|
fs5.command("stat <id>").description("Stat a path inside the sandbox").requiredOption("--path <path>", "Absolute path inside the sandbox").option("--json", "Output as JSON").action(fsStatAction);
|
|
110056
110615
|
fs5.command("mkdir <id>").description("Create a directory inside the sandbox (mkdir -p)").requiredOption("--path <path>", "Absolute path inside the sandbox").action(fsMkdirAction);
|
|
110616
|
+
const snaps = sandbox.command("snapshots").description("Manage sandbox snapshots (ADR-037)");
|
|
110617
|
+
sandbox.command("snapshot <id>").description("Take a snapshot of a sandbox").option("--label <label>", "Human-readable label for the snapshot").option("--wait", "Wait until the snapshot reaches ready or failed status").option("--json", "Output as JSON").action(snapshotCreateAction);
|
|
110618
|
+
snaps.command("list").alias("ls").description("List your snapshots").option("--project <id>", "Filter by project ID").option("--status <status>", "Filter by status: creating | ready | failed | deleted").option("--page <n>", "Page number (1-indexed)").option("--page-size <n>", "Items per page (default 20, max 100)").option("--json", "Output as JSON").action(snapshotListAction);
|
|
110619
|
+
snaps.command("show <snapId>").description("Show details for a snapshot").option("--json", "Output as JSON").action(snapshotShowAction);
|
|
110620
|
+
snaps.command("delete <snapId>").alias("rm").description("Delete a snapshot permanently").option("-f, --force", "Skip confirmation prompt").action(snapshotDeleteAction);
|
|
110621
|
+
snaps.command("storage").description("Show snapshot storage usage and quota").option("--json", "Output as JSON").action(snapshotStorageAction);
|
|
110057
110622
|
}
|
|
110058
110623
|
function buildSource(options) {
|
|
110059
110624
|
const gitFlags = [
|
|
@@ -110107,7 +110672,12 @@ function buildSource(options) {
|
|
|
110107
110672
|
async function createAction6(options) {
|
|
110108
110673
|
const api = await auth();
|
|
110109
110674
|
const env4 = parseEnvPairs(options.env);
|
|
110675
|
+
if (options.fromSnapshot && options.image) {
|
|
110676
|
+
throw new Error("--from-snapshot and --image are mutually exclusive");
|
|
110677
|
+
}
|
|
110110
110678
|
const body = {};
|
|
110679
|
+
if (options.fromSnapshot)
|
|
110680
|
+
body.from_snapshot = options.fromSnapshot;
|
|
110111
110681
|
if (options.image)
|
|
110112
110682
|
body.image = options.image;
|
|
110113
110683
|
if (options.name)
|
|
@@ -110550,6 +111120,171 @@ async function fsMkdirAction(id, options) {
|
|
|
110550
111120
|
}));
|
|
110551
111121
|
success2(`Directory ${colors.primary(options.path)} created`);
|
|
110552
111122
|
}
|
|
111123
|
+
function snapshotUrl(baseUrl, path7) {
|
|
111124
|
+
return `${baseUrl.replace(/\/+$/, "")}/v1/sandbox-snapshots${path7}`;
|
|
111125
|
+
}
|
|
111126
|
+
async function snapshotApiRequest(api, path7, init = {}) {
|
|
111127
|
+
const headers = new Headers(init.headers);
|
|
111128
|
+
headers.set("Authorization", `Bearer ${api.apiKey}`);
|
|
111129
|
+
if (init.body && !headers.has("Content-Type")) {
|
|
111130
|
+
headers.set("Content-Type", "application/json");
|
|
111131
|
+
}
|
|
111132
|
+
const response = await fetch(snapshotUrl(api.baseUrl, path7), { ...init, headers });
|
|
111133
|
+
if (!response.ok) {
|
|
111134
|
+
throw await readApiError(response);
|
|
111135
|
+
}
|
|
111136
|
+
if (response.status === 204) {
|
|
111137
|
+
return;
|
|
111138
|
+
}
|
|
111139
|
+
return await response.json();
|
|
111140
|
+
}
|
|
111141
|
+
function formatBytes7(bytes) {
|
|
111142
|
+
if (bytes < 1024)
|
|
111143
|
+
return `${bytes} B`;
|
|
111144
|
+
if (bytes < 1024 * 1024)
|
|
111145
|
+
return `${(bytes / 1024).toFixed(1)} KiB`;
|
|
111146
|
+
if (bytes < 1024 * 1024 * 1024)
|
|
111147
|
+
return `${(bytes / 1024 / 1024).toFixed(1)} MiB`;
|
|
111148
|
+
return `${(bytes / 1024 / 1024 / 1024).toFixed(2)} GiB`;
|
|
111149
|
+
}
|
|
111150
|
+
function snapshotStatusColor(status2) {
|
|
111151
|
+
if (status2 === "ready")
|
|
111152
|
+
return colors.success(status2);
|
|
111153
|
+
if (status2 === "failed" || status2 === "deleted")
|
|
111154
|
+
return colors.error(status2);
|
|
111155
|
+
if (status2 === "creating")
|
|
111156
|
+
return colors.warning(status2);
|
|
111157
|
+
return status2;
|
|
111158
|
+
}
|
|
111159
|
+
async function snapshotCreateAction(sandboxId, options) {
|
|
111160
|
+
const api = await auth();
|
|
111161
|
+
const body = {};
|
|
111162
|
+
if (options.label)
|
|
111163
|
+
body.label = options.label;
|
|
111164
|
+
const snap = await withSpinner("Creating snapshot…", () => apiRequest(api, `/${encodeURIComponent(sandboxId)}/snapshots`, { method: "POST", body: JSON.stringify(body) }));
|
|
111165
|
+
let finalSnap = snap;
|
|
111166
|
+
if (options.wait && snap.status === "creating") {
|
|
111167
|
+
finalSnap = await withSpinner("Waiting for snapshot to be ready…", async () => {
|
|
111168
|
+
let current = snap;
|
|
111169
|
+
let attempts = 0;
|
|
111170
|
+
const maxAttempts = 120;
|
|
111171
|
+
while (current.status === "creating" && attempts < maxAttempts) {
|
|
111172
|
+
await new Promise((r) => setTimeout(r, 5000));
|
|
111173
|
+
current = await snapshotApiRequest(api, `/${encodeURIComponent(current.id)}`);
|
|
111174
|
+
attempts++;
|
|
111175
|
+
}
|
|
111176
|
+
return current;
|
|
111177
|
+
});
|
|
111178
|
+
}
|
|
111179
|
+
if (options.json) {
|
|
111180
|
+
json(finalSnap);
|
|
111181
|
+
return;
|
|
111182
|
+
}
|
|
111183
|
+
if (finalSnap.status === "creating") {
|
|
111184
|
+
info2(`Snapshot ${colors.primary(finalSnap.id)} is still being created.`);
|
|
111185
|
+
info2(`Poll with: temps sandbox snapshots show ${finalSnap.id}`);
|
|
111186
|
+
info2(`Create sandbox from it with: temps sandbox create --from-snapshot ${finalSnap.id}`);
|
|
111187
|
+
} else if (finalSnap.status === "ready") {
|
|
111188
|
+
success2(`Snapshot ${colors.primary(finalSnap.id)} is ready`);
|
|
111189
|
+
} else {
|
|
111190
|
+
warning2(`Snapshot ${colors.primary(finalSnap.id)} is in status: ${finalSnap.status}`);
|
|
111191
|
+
}
|
|
111192
|
+
keyValue("ID", finalSnap.id);
|
|
111193
|
+
keyValue("Status", snapshotStatusColor(finalSnap.status));
|
|
111194
|
+
keyValue("Size", formatBytes7(finalSnap.size_bytes));
|
|
111195
|
+
if (finalSnap.label)
|
|
111196
|
+
keyValue("Label", finalSnap.label);
|
|
111197
|
+
keyValue("Backend", finalSnap.backend);
|
|
111198
|
+
keyValue("Created", finalSnap.created_at);
|
|
111199
|
+
}
|
|
111200
|
+
async function snapshotListAction(options) {
|
|
111201
|
+
const api = await auth();
|
|
111202
|
+
const params = new URLSearchParams;
|
|
111203
|
+
if (options.project)
|
|
111204
|
+
params.set("project_id", options.project);
|
|
111205
|
+
if (options.status)
|
|
111206
|
+
params.set("status", options.status);
|
|
111207
|
+
if (options.page)
|
|
111208
|
+
params.set("page", options.page);
|
|
111209
|
+
if (options.pageSize)
|
|
111210
|
+
params.set("page_size", options.pageSize);
|
|
111211
|
+
const qs = params.toString() ? `?${params.toString()}` : "";
|
|
111212
|
+
const res = await withSpinner("Fetching snapshots…", () => snapshotApiRequest(api, `${qs}`));
|
|
111213
|
+
if (options.json) {
|
|
111214
|
+
json(res);
|
|
111215
|
+
return;
|
|
111216
|
+
}
|
|
111217
|
+
if (res.snapshots.length === 0) {
|
|
111218
|
+
info2("No snapshots found.");
|
|
111219
|
+
return;
|
|
111220
|
+
}
|
|
111221
|
+
const columns = [
|
|
111222
|
+
{ header: "ID", accessor: (s) => colors.primary(s.id) },
|
|
111223
|
+
{ header: "Status", accessor: (s) => snapshotStatusColor(s.status) },
|
|
111224
|
+
{ header: "Backend", key: "backend" },
|
|
111225
|
+
{ header: "Label", accessor: (s) => s.label ?? "-" },
|
|
111226
|
+
{ header: "Size", accessor: (s) => formatBytes7(s.size_bytes) },
|
|
111227
|
+
{ header: "Created", key: "created_at" }
|
|
111228
|
+
];
|
|
111229
|
+
newline();
|
|
111230
|
+
printTable(res.snapshots, columns);
|
|
111231
|
+
newline();
|
|
111232
|
+
info2(`Page ${res.page} of ${Math.ceil(res.total / res.page_size)} — ${res.total} total`);
|
|
111233
|
+
}
|
|
111234
|
+
async function snapshotShowAction(snapId, options) {
|
|
111235
|
+
const api = await auth();
|
|
111236
|
+
const snap = await withSpinner("Fetching snapshot…", () => snapshotApiRequest(api, `/${encodeURIComponent(snapId)}`));
|
|
111237
|
+
if (options.json) {
|
|
111238
|
+
json(snap);
|
|
111239
|
+
return;
|
|
111240
|
+
}
|
|
111241
|
+
newline();
|
|
111242
|
+
keyValue("ID", snap.id);
|
|
111243
|
+
keyValue("Status", snapshotStatusColor(snap.status));
|
|
111244
|
+
keyValue("Backend", snap.backend);
|
|
111245
|
+
if (snap.label)
|
|
111246
|
+
keyValue("Label", snap.label);
|
|
111247
|
+
keyValue("Size", formatBytes7(snap.size_bytes));
|
|
111248
|
+
keyValue("Digest", snap.content_digest);
|
|
111249
|
+
if (snap.image_ref)
|
|
111250
|
+
keyValue("Image ref", snap.image_ref);
|
|
111251
|
+
keyValue("Created", snap.created_at);
|
|
111252
|
+
keyValue("Updated", snap.updated_at);
|
|
111253
|
+
newline();
|
|
111254
|
+
if (snap.status === "ready") {
|
|
111255
|
+
info2(`Restore with: temps sandbox create --from-snapshot ${snap.id}`);
|
|
111256
|
+
}
|
|
111257
|
+
}
|
|
111258
|
+
async function snapshotDeleteAction(snapId, options) {
|
|
111259
|
+
if (!options.force) {
|
|
111260
|
+
const confirmed = await promptConfirm({
|
|
111261
|
+
message: `Delete snapshot ${snapId}? This cannot be undone.`,
|
|
111262
|
+
default: false
|
|
111263
|
+
});
|
|
111264
|
+
if (!confirmed) {
|
|
111265
|
+
info2("Aborted.");
|
|
111266
|
+
return;
|
|
111267
|
+
}
|
|
111268
|
+
}
|
|
111269
|
+
const api = await auth();
|
|
111270
|
+
await withSpinner("Deleting snapshot…", () => snapshotApiRequest(api, `/${encodeURIComponent(snapId)}`, { method: "DELETE" }));
|
|
111271
|
+
success2(`Snapshot ${colors.primary(snapId)} deleted`);
|
|
111272
|
+
}
|
|
111273
|
+
async function snapshotStorageAction(options) {
|
|
111274
|
+
const api = await auth();
|
|
111275
|
+
const summary = await withSpinner("Fetching storage summary…", () => snapshotApiRequest(api, "/storage-summary"));
|
|
111276
|
+
if (options.json) {
|
|
111277
|
+
json(summary);
|
|
111278
|
+
return;
|
|
111279
|
+
}
|
|
111280
|
+
newline();
|
|
111281
|
+
keyValue("Snapshots", String(summary.snapshot_count));
|
|
111282
|
+
keyValue("Used", `${formatBytes7(summary.total_bytes)} / ${formatBytes7(summary.quota_bytes)}`);
|
|
111283
|
+
keyValue("Available on disk", summary.available_disk_bytes !== null ? formatBytes7(summary.available_disk_bytes) : "unknown");
|
|
111284
|
+
const pct = summary.quota_bytes > 0 ? (summary.total_bytes / summary.quota_bytes * 100).toFixed(1) : "0.0";
|
|
111285
|
+
keyValue("Quota used", `${pct}%`);
|
|
111286
|
+
newline();
|
|
111287
|
+
}
|
|
110553
111288
|
|
|
110554
111289
|
// src/commands/workflow/index.ts
|
|
110555
111290
|
init_sdk_gen();
|
|
@@ -112589,6 +113324,15 @@ async function up(projectArg, options) {
|
|
|
112589
113324
|
].filter(Boolean).join(`
|
|
112590
113325
|
`), `${icons.rocket} Deployment Preview`);
|
|
112591
113326
|
newline();
|
|
113327
|
+
const { data: baselineList } = await getProjectDeployments({
|
|
113328
|
+
client,
|
|
113329
|
+
path: { id: project.id },
|
|
113330
|
+
query: {
|
|
113331
|
+
per_page: 1,
|
|
113332
|
+
...environmentId ? { environment_id: environmentId } : {}
|
|
113333
|
+
}
|
|
113334
|
+
});
|
|
113335
|
+
const afterId = baselineList?.deployments?.[0]?.id ?? 0;
|
|
112592
113336
|
startSpinner("Starting deployment...");
|
|
112593
113337
|
try {
|
|
112594
113338
|
const { data: pipelineData, error: pipelineError } = await triggerProjectPipeline({
|
|
@@ -112616,42 +113360,36 @@ async function up(projectArg, options) {
|
|
|
112616
113360
|
return;
|
|
112617
113361
|
}
|
|
112618
113362
|
startSpinner("Waiting for deployment to start...");
|
|
112619
|
-
|
|
112620
|
-
for (let attempt2 = 0;attempt2 < 15; attempt2++) {
|
|
113363
|
+
const waitResult = await waitForTriggeredDeployment(async () => {
|
|
112621
113364
|
const { data: deployList, error: deployError } = await getProjectDeployments({
|
|
112622
113365
|
client,
|
|
112623
113366
|
path: { id: project.id },
|
|
112624
113367
|
query: {
|
|
112625
|
-
per_page:
|
|
113368
|
+
per_page: 10,
|
|
112626
113369
|
...environmentId ? { environment_id: environmentId } : {}
|
|
112627
113370
|
}
|
|
112628
113371
|
});
|
|
112629
|
-
|
|
112630
|
-
|
|
112631
|
-
|
|
112632
|
-
|
|
112633
|
-
}
|
|
112634
|
-
|
|
112635
|
-
if (latest?.id) {
|
|
112636
|
-
deploymentId = latest.id;
|
|
112637
|
-
break;
|
|
112638
|
-
}
|
|
112639
|
-
await new Promise((r) => setTimeout(r, 2000));
|
|
113372
|
+
return { deployments: deployList?.deployments, error: deployError };
|
|
113373
|
+
}, { afterId });
|
|
113374
|
+
if (!waitResult.ok && waitResult.error === "fetch_failed") {
|
|
113375
|
+
failSpinner("Failed to fetch deployment status");
|
|
113376
|
+
info2(`Error: ${getErrorMessage(waitResult.cause)}`);
|
|
113377
|
+
return;
|
|
112640
113378
|
}
|
|
112641
|
-
if (
|
|
112642
|
-
succeedSpinner(`Deployment #${deploymentId} found`);
|
|
112643
|
-
const result2 = await watchDeployment({
|
|
112644
|
-
projectId: project.id,
|
|
112645
|
-
deploymentId,
|
|
112646
|
-
timeoutSecs: 600,
|
|
112647
|
-
projectName: resolved.slug
|
|
112648
|
-
});
|
|
112649
|
-
if (!result2.success) {
|
|
112650
|
-
process.exitCode = 1;
|
|
112651
|
-
}
|
|
112652
|
-
} else {
|
|
113379
|
+
if (!waitResult.ok) {
|
|
112653
113380
|
failSpinner("Could not locate the deployment to track");
|
|
112654
113381
|
info2(`Check status: ${colors.muted("bunx @temps-sdk/cli status")}`);
|
|
113382
|
+
return;
|
|
113383
|
+
}
|
|
113384
|
+
succeedSpinner(`Deployment #${waitResult.deploymentId} found`);
|
|
113385
|
+
const result2 = await watchDeployment({
|
|
113386
|
+
projectId: project.id,
|
|
113387
|
+
deploymentId: waitResult.deploymentId,
|
|
113388
|
+
timeoutSecs: 600,
|
|
113389
|
+
projectName: resolved.slug
|
|
113390
|
+
});
|
|
113391
|
+
if (!result2.success) {
|
|
113392
|
+
process.exitCode = 1;
|
|
112655
113393
|
}
|
|
112656
113394
|
} catch (err) {
|
|
112657
113395
|
failSpinner("Deployment failed");
|
|
@@ -114158,6 +114896,7 @@ function createProgram() {
|
|
|
114158
114896
|
registerContainersCommands(program2);
|
|
114159
114897
|
registerTokensCommands(program2);
|
|
114160
114898
|
registerErrorsCommands(program2);
|
|
114899
|
+
registerMetricsCommands(program2);
|
|
114161
114900
|
registerTracesCommands(program2);
|
|
114162
114901
|
registerOtelForwardCommands(program2);
|
|
114163
114902
|
registerKvCommands(program2);
|
|
@@ -114241,7 +114980,7 @@ function extractCommandInfo(cmd2, parentName = "") {
|
|
|
114241
114980
|
flags: opt.flags,
|
|
114242
114981
|
description: opt.description || "",
|
|
114243
114982
|
defaultValue: opt.defaultValue !== undefined ? String(opt.defaultValue) : undefined,
|
|
114244
|
-
required: opt.
|
|
114983
|
+
required: opt.mandatory === true
|
|
114245
114984
|
}));
|
|
114246
114985
|
const subcommands = cmd2.commands.filter((sub) => sub.name() !== "docs").map((sub) => extractCommandInfo(sub, name));
|
|
114247
114986
|
return {
|
|
@@ -114306,8 +115045,26 @@ function generateMarkdown(commands, level = 2, format2 = "markdown") {
|
|
|
114306
115045
|
}
|
|
114307
115046
|
return md;
|
|
114308
115047
|
}
|
|
114309
|
-
function
|
|
114310
|
-
|
|
115048
|
+
function markdownAnchor(name) {
|
|
115049
|
+
return name.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
|
|
115050
|
+
}
|
|
115051
|
+
function generateCommandIndex(commands) {
|
|
115052
|
+
let index = `## Command index
|
|
115053
|
+
|
|
115054
|
+
`;
|
|
115055
|
+
index += `Use this index or search for a top-level command heading to load only the relevant group.
|
|
115056
|
+
|
|
115057
|
+
`;
|
|
115058
|
+
for (const command of commands) {
|
|
115059
|
+
index += `- [\`${command.name}\`](#${markdownAnchor(command.name)}) - ${command.description}
|
|
115060
|
+
`;
|
|
115061
|
+
}
|
|
115062
|
+
return `${index}
|
|
115063
|
+
## Commands
|
|
115064
|
+
|
|
115065
|
+
`;
|
|
115066
|
+
}
|
|
115067
|
+
function generateHeader(format2 = "markdown", version) {
|
|
114311
115068
|
const mdxMetadata = `export const metadata = {
|
|
114312
115069
|
title: 'CLI Reference',
|
|
114313
115070
|
description: 'Complete reference for the Temps CLI - all commands, options, and usage examples.',
|
|
@@ -114318,12 +115075,18 @@ function generateHeader(format2 = "markdown") {
|
|
|
114318
115075
|
|
|
114319
115076
|
> Auto-generated documentation for the Temps CLI.
|
|
114320
115077
|
>
|
|
114321
|
-
> Generated
|
|
115078
|
+
> Generated from: \`@temps-sdk/cli@${version}\`
|
|
115079
|
+
>
|
|
115080
|
+
> Apply the authorization, target-context, and secret-handling rules in
|
|
115081
|
+
> [the Temps CLI skill](../SKILL.md) before executing a command.
|
|
114322
115082
|
|
|
114323
115083
|
## Installation
|
|
114324
115084
|
|
|
114325
115085
|
\`\`\`bash
|
|
114326
|
-
bunx @temps-sdk/cli [command]
|
|
115086
|
+
bunx @temps-sdk/cli@${version} [command]
|
|
115087
|
+
|
|
115088
|
+
# Fallback when Bun is unavailable
|
|
115089
|
+
npx @temps-sdk/cli@${version} [command]
|
|
114327
115090
|
\`\`\`
|
|
114328
115091
|
|
|
114329
115092
|
## Authentication
|
|
@@ -114331,27 +115094,26 @@ bunx @temps-sdk/cli [command]
|
|
|
114331
115094
|
Before using most commands, you need to authenticate:
|
|
114332
115095
|
|
|
114333
115096
|
\`\`\`bash
|
|
114334
|
-
# Login
|
|
114335
|
-
bunx @temps-sdk/cli login
|
|
115097
|
+
# Login interactively
|
|
115098
|
+
bunx @temps-sdk/cli@${version} login
|
|
114336
115099
|
|
|
114337
115100
|
# Or configure with wizard
|
|
114338
|
-
bunx @temps-sdk/cli configure
|
|
115101
|
+
bunx @temps-sdk/cli@${version} configure
|
|
114339
115102
|
\`\`\`
|
|
114340
115103
|
|
|
114341
115104
|
## Global Options
|
|
114342
115105
|
|
|
114343
115106
|
| Flag | Description |
|
|
114344
115107
|
|------|-------------|
|
|
114345
|
-
| \`-
|
|
115108
|
+
| \`-V, --version\` | Display version number |
|
|
115109
|
+
| \`--target-context <name>\` | Target one configured server for this invocation |
|
|
114346
115110
|
| \`--no-color\` | Disable colored output |
|
|
114347
115111
|
| \`--debug\` | Enable debug output |
|
|
114348
115112
|
| \`-h, --help\` | Display help for command |
|
|
114349
115113
|
|
|
114350
|
-
## Commands
|
|
114351
|
-
|
|
114352
115114
|
`;
|
|
114353
115115
|
}
|
|
114354
|
-
function generateFooter() {
|
|
115116
|
+
function generateFooter(version) {
|
|
114355
115117
|
return `
|
|
114356
115118
|
---
|
|
114357
115119
|
|
|
@@ -114361,48 +115123,48 @@ function generateFooter() {
|
|
|
114361
115123
|
|
|
114362
115124
|
\`\`\`bash
|
|
114363
115125
|
# Login to Temps
|
|
114364
|
-
bunx @temps-sdk/cli login
|
|
115126
|
+
bunx @temps-sdk/cli@${version} login
|
|
114365
115127
|
|
|
114366
|
-
# Create a new project
|
|
114367
|
-
bunx @temps-sdk/cli projects create --name my-app
|
|
115128
|
+
# Create a new project on the intended server
|
|
115129
|
+
bunx @temps-sdk/cli@${version} --target-context production projects create --name my-app
|
|
114368
115130
|
|
|
114369
115131
|
# Deploy to production
|
|
114370
|
-
bunx @temps-sdk/cli deploy --project my-app --environment production
|
|
115132
|
+
bunx @temps-sdk/cli@${version} --target-context production deploy --project my-app --environment production
|
|
114371
115133
|
|
|
114372
115134
|
# View deployment logs
|
|
114373
|
-
bunx @temps-sdk/cli logs --project my-app --follow
|
|
115135
|
+
bunx @temps-sdk/cli@${version} deployments logs --project my-app --follow
|
|
114374
115136
|
|
|
114375
115137
|
# Stream runtime container logs
|
|
114376
|
-
bunx @temps-sdk/cli runtime-logs --project my-app
|
|
115138
|
+
bunx @temps-sdk/cli@${version} runtime-logs --project my-app
|
|
114377
115139
|
|
|
114378
115140
|
# List containers
|
|
114379
|
-
bunx @temps-sdk/cli containers list --project-id 1 --environment-id 1
|
|
115141
|
+
bunx @temps-sdk/cli@${version} containers list --project-id 1 --environment-id 1
|
|
114380
115142
|
\`\`\`
|
|
114381
115143
|
|
|
114382
115144
|
### Managing Environments
|
|
114383
115145
|
|
|
114384
115146
|
\`\`\`bash
|
|
114385
115147
|
# List environments
|
|
114386
|
-
bunx @temps-sdk/cli environments list --project my-app
|
|
115148
|
+
bunx @temps-sdk/cli@${version} environments list --project my-app
|
|
114387
115149
|
|
|
114388
|
-
# Set environment variables
|
|
114389
|
-
bunx @temps-sdk/cli environments vars set --project my-app --key DATABASE_URL
|
|
115150
|
+
# Set environment variables on the intended server
|
|
115151
|
+
bunx @temps-sdk/cli@${version} --target-context production environments vars set --project my-app --key DATABASE_URL
|
|
114390
115152
|
|
|
114391
115153
|
# View environment variables
|
|
114392
|
-
bunx @temps-sdk/cli environments vars list --project my-app
|
|
115154
|
+
bunx @temps-sdk/cli@${version} environments vars list --project my-app
|
|
114393
115155
|
\`\`\`
|
|
114394
115156
|
|
|
114395
115157
|
### Managing Domains
|
|
114396
115158
|
|
|
114397
115159
|
\`\`\`bash
|
|
114398
|
-
# Add a custom domain
|
|
114399
|
-
bunx @temps-sdk/cli domains add --project my-app --domain app.example.com
|
|
115160
|
+
# Add a custom domain on the intended server
|
|
115161
|
+
bunx @temps-sdk/cli@${version} --target-context production domains add --project my-app --domain app.example.com
|
|
114400
115162
|
|
|
114401
115163
|
# List domains
|
|
114402
|
-
bunx @temps-sdk/cli domains list --project my-app
|
|
115164
|
+
bunx @temps-sdk/cli@${version} domains list --project my-app
|
|
114403
115165
|
|
|
114404
|
-
# Remove a domain
|
|
114405
|
-
bunx @temps-sdk/cli domains remove --project my-app --domain app.example.com
|
|
115166
|
+
# Remove a domain from the intended server
|
|
115167
|
+
bunx @temps-sdk/cli@${version} --target-context production domains remove --project my-app --domain app.example.com
|
|
114406
115168
|
\`\`\`
|
|
114407
115169
|
|
|
114408
115170
|
## Environment Variables
|
|
@@ -114422,12 +115184,12 @@ Configuration is stored in:
|
|
|
114422
115184
|
- **Config file**: \`~/.temps/config.json\`
|
|
114423
115185
|
- **Credentials**: Stored securely in \`~/.temps/\` with restricted file permissions
|
|
114424
115186
|
|
|
114425
|
-
Use \`bunx @temps-sdk/cli configure show\` to view current configuration.
|
|
115187
|
+
Use \`bunx @temps-sdk/cli@${version} configure show\` to view current configuration.
|
|
114426
115188
|
|
|
114427
115189
|
## Support
|
|
114428
115190
|
|
|
114429
|
-
- Documentation: https://temps.
|
|
114430
|
-
- Issues: https://github.com/
|
|
115191
|
+
- Documentation: https://temps.sh/docs
|
|
115192
|
+
- Issues: https://github.com/gotempsh/temps/issues
|
|
114431
115193
|
`;
|
|
114432
115194
|
}
|
|
114433
115195
|
async function generateDocs(options) {
|
|
@@ -114438,12 +115200,14 @@ async function generateDocs(options) {
|
|
|
114438
115200
|
output = JSON.stringify(commands, null, 2);
|
|
114439
115201
|
} else {
|
|
114440
115202
|
const format2 = options.format === "mdx" ? "mdx" : "markdown";
|
|
114441
|
-
|
|
115203
|
+
const version = program2.version() ?? "unknown";
|
|
115204
|
+
output = generateHeader(format2, version);
|
|
115205
|
+
output += generateCommandIndex(commands);
|
|
114442
115206
|
output += generateMarkdown(commands, 2, format2);
|
|
114443
|
-
output += generateFooter();
|
|
115207
|
+
output += generateFooter(version);
|
|
114444
115208
|
}
|
|
114445
115209
|
if (options.output) {
|
|
114446
|
-
await
|
|
115210
|
+
await writeFile6(options.output, output, "utf8");
|
|
114447
115211
|
newline();
|
|
114448
115212
|
header("Documentation Generated");
|
|
114449
115213
|
console.log(`${colors.success("Written to:")} ${options.output}`);
|
|
@@ -114513,6 +115277,7 @@ function createProgram2() {
|
|
|
114513
115277
|
registerContainersCommands(program2);
|
|
114514
115278
|
registerTokensCommands(program2);
|
|
114515
115279
|
registerErrorsCommands(program2);
|
|
115280
|
+
registerMetricsCommands(program2);
|
|
114516
115281
|
registerTracesCommands(program2);
|
|
114517
115282
|
registerOtelForwardCommands(program2);
|
|
114518
115283
|
registerKvCommands(program2);
|