@liquidmetal-ai/raindrop 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +327 -89
- package/bundle/build-CBEGQPJT.js +62 -0
- package/bundle/{chunk-IEF2XC25.js → chunk-2PH3PHH3.js} +5 -3
- package/bundle/{chunk-4HZ22KOV.js → chunk-3CMR7ES5.js} +4 -4
- package/bundle/{chunk-JSBM2JYW.js → chunk-3EYKCHIK.js} +1 -1
- package/bundle/chunk-5XHDP4VK.js +1697 -0
- package/bundle/{chunk-TSQK4HH6.js → chunk-674GMSXY.js} +1 -1
- package/bundle/{chunk-PS3WZBDF.js → chunk-6L4V66WZ.js} +1105 -2728
- package/bundle/{chunk-5245CEUM.js → chunk-AGG7JZVH.js} +2 -2
- package/bundle/{chunk-3GFKUF5D.js → chunk-B3IY2XS6.js} +4 -2
- package/bundle/{chunk-WIDI65NO.js → chunk-CBAXTRCS.js} +1 -1
- package/bundle/{chunk-JLVDTXO2.js → chunk-DPV5HIG7.js} +4 -4
- package/bundle/{chunk-36GNZK4A.js → chunk-EVXLXWP7.js} +1 -1
- package/bundle/{chunk-4YVU5KEQ.js → chunk-HN3AAKRY.js} +4 -2
- package/bundle/{chunk-NVNEQXHN.js → chunk-IGLE4Y3B.js} +7 -5
- package/bundle/{chunk-FGSYWVBA.js → chunk-IQ6HFRA6.js} +1 -1
- package/bundle/{chunk-O3QZDJ75.js → chunk-JQONDSHY.js} +2 -2
- package/bundle/{chunk-W4IPOFZC.js → chunk-KADMFJLN.js} +8 -6
- package/bundle/chunk-KG5BLUGU.js +246 -0
- package/bundle/{chunk-V5LHJTYS.js → chunk-KLOYSTZY.js} +13 -2
- package/bundle/{chunk-ETC5VU7H.js → chunk-KXHVSLAI.js} +1 -1
- package/bundle/{chunk-Y4WFGNPM.js → chunk-L6FRQULN.js} +1 -1
- package/bundle/{chunk-3QCVYSRU.js → chunk-LT3BFQ4O.js} +1 -1
- package/bundle/{chunk-KQZJHBNG.js → chunk-MBLKVNI5.js} +1 -1
- package/bundle/{chunk-6AIUQUUM.js → chunk-MFMVJZW6.js} +71 -15
- package/bundle/{chunk-25T7MEKO.js → chunk-MJBLNWG3.js} +1 -1
- package/bundle/{chunk-MSJ33O5Y.js → chunk-NRCQIE3Z.js} +95 -115
- package/bundle/{chunk-XKKPPSPC.js → chunk-OCYTN4IH.js} +2 -2
- package/bundle/{chunk-2GAMWFJE.js → chunk-QEF5D4VE.js} +1 -1
- package/bundle/{chunk-4B3QYXBA.js → chunk-T7MQCLXF.js} +5 -3
- package/bundle/{chunk-LDFYPOXJ.js → chunk-TFQY5TSY.js} +1 -1
- package/bundle/{chunk-BWK4MC7Y.js → chunk-USZXZZAR.js} +8 -6
- package/bundle/{chunk-ER2RCPCY.js → chunk-V54KHS5B.js} +2 -2
- package/bundle/{chunk-YSKASURB.js → chunk-V6J23FL2.js} +1 -1
- package/bundle/{chunk-UHSTDJ7X.js → chunk-VN2QYX4C.js} +1 -1
- package/bundle/{chunk-Z4OWKG7J.js → chunk-VOT5MMEY.js} +1 -1
- package/bundle/{chunk-W6GU26WO.js → chunk-WG6BDFPZ.js} +1 -1
- package/bundle/{chunk-AK77X5GL.js → chunk-XX74I5RK.js} +4 -2
- package/bundle/{chunk-6BT265R3.js → chunk-YQCRWPNI.js} +1 -1
- package/bundle/commands/annotation/get.js +3 -3
- package/bundle/commands/annotation/list.js +3 -3
- package/bundle/commands/annotation/put.js +3 -3
- package/bundle/commands/auth/apikey.js +2 -2
- package/bundle/commands/auth/list.js +2 -2
- package/bundle/commands/auth/login.js +2 -2
- package/bundle/commands/auth/logout.js +2 -2
- package/bundle/commands/auth/select.js +3 -3
- package/bundle/commands/bucket/create-credential.js +2 -2
- package/bundle/commands/bucket/delete-credential.js +2 -2
- package/bundle/commands/bucket/get-credential.js +2 -2
- package/bundle/commands/bucket/list-credentials.js +2 -2
- package/bundle/commands/build/actor/setup.js +124 -0
- package/bundle/commands/build/branch.js +10 -10
- package/bundle/commands/build/bucket-events/setup.js +146 -0
- package/bundle/commands/build/checkout.js +8 -8
- package/bundle/commands/build/clone.js +6 -6
- package/bundle/commands/build/delete.js +8 -8
- package/bundle/commands/build/deploy.js +10 -10
- package/bundle/commands/build/env/get.js +3 -3
- package/bundle/commands/build/env/list.js +2 -2
- package/bundle/commands/build/env/set.js +3 -3
- package/bundle/commands/build/env.js +2 -2
- package/bundle/commands/build/features.js +192 -0
- package/bundle/commands/build/find.js +4 -4
- package/bundle/commands/build/generate.js +52 -3
- package/bundle/commands/build/init-workspace.js +3 -3
- package/bundle/commands/build/init.js +15 -3
- package/bundle/commands/build/list.js +5 -5
- package/bundle/commands/build/queue/setup.js +133 -0
- package/bundle/commands/build/sandbox.js +6 -6
- package/bundle/commands/build/smartbucket/setup.js +165 -0
- package/bundle/commands/build/smartmemory/setup.js +171 -0
- package/bundle/commands/build/smartsql/setup.js +167 -0
- package/bundle/commands/build/start.js +2 -2
- package/bundle/commands/build/status.js +5 -5
- package/bundle/commands/build/stop.js +2 -2
- package/bundle/commands/build/stripe/dashboard.js +3 -3
- package/bundle/commands/build/stripe/onboard.js +3 -3
- package/bundle/commands/build/stripe/setup.js +3 -3
- package/bundle/commands/build/stripe/start.js +14 -14
- package/bundle/commands/build/stripe/status.js +3 -3
- package/bundle/commands/build/stripe/subscription/create.js +4 -4
- package/bundle/commands/build/stripe/subscription/get.js +4 -4
- package/bundle/commands/build/stripe/subscription/update.js +4 -4
- package/bundle/commands/build/tools/check.js +2 -2
- package/bundle/commands/build/tools/fmt.js +2 -2
- package/bundle/commands/build/unsandbox.js +6 -6
- package/bundle/commands/build/upload.js +5 -5
- package/bundle/commands/build/validate.js +85 -14
- package/bundle/commands/build/workos/delete.js +6 -6
- package/bundle/commands/build/workos/env/attach.js +3 -3
- package/bundle/commands/build/workos/env/attached.js +3 -3
- package/bundle/commands/build/workos/env/create.js +3 -3
- package/bundle/commands/build/workos/env/delete.js +3 -3
- package/bundle/commands/build/workos/env/detach.js +3 -3
- package/bundle/commands/build/workos/env/dev-login.js +3 -3
- package/bundle/commands/build/workos/env/get.js +3 -3
- package/bundle/commands/build/workos/env/list.js +3 -3
- package/bundle/commands/build/workos/env/set.js +3 -3
- package/bundle/commands/build/workos/invite.js +3 -3
- package/bundle/commands/build/workos/jwt.js +172 -0
- package/bundle/commands/build/workos/setup.js +3 -3
- package/bundle/commands/build/workos/status.js +3 -3
- package/bundle/commands/dns/create.js +2 -2
- package/bundle/commands/dns/delete.js +6 -6
- package/bundle/commands/dns/get.js +6 -6
- package/bundle/commands/dns/list.js +3 -3
- package/bundle/commands/dns/records/create.js +2 -2
- package/bundle/commands/dns/records/delete.js +3 -3
- package/bundle/commands/dns/records/get.js +2 -2
- package/bundle/commands/dns/records/list.js +2 -2
- package/bundle/commands/dns/records/update.js +2 -2
- package/bundle/commands/doctor.js +309 -0
- package/bundle/commands/logs/query.js +3 -3
- package/bundle/commands/logs/tail.js +3 -3
- package/bundle/commands/mcp/install-claude.js +2 -2
- package/bundle/commands/mcp/install-gemini.js +2 -2
- package/bundle/commands/mcp/install-goose.js +2 -2
- package/bundle/commands/mcp/status.js +2 -2
- package/bundle/commands/object/delete.js +5 -37
- package/bundle/commands/object/get.js +5 -37
- package/bundle/commands/object/list.js +7 -39
- package/bundle/commands/object/put.js +5 -37
- package/bundle/commands/query/chunk-search.js +14 -46
- package/bundle/commands/query/document.js +17 -55
- package/bundle/commands/query/events.js +2 -2
- package/bundle/commands/query/reindex.js +2 -2
- package/bundle/commands/query/search.js +14 -46
- package/bundle/commands/tail.js +2 -2
- package/bundle/index.js +1 -1
- package/dist/commands/build/actor/setup.d.ts +22 -0
- package/dist/commands/build/actor/setup.d.ts.map +1 -0
- package/dist/commands/build/actor/setup.js +116 -0
- package/dist/commands/build/bucket-events/setup.d.ts +22 -0
- package/dist/commands/build/bucket-events/setup.d.ts.map +1 -0
- package/dist/commands/build/bucket-events/setup.js +134 -0
- package/dist/commands/build/features.d.ts +19 -0
- package/dist/commands/build/features.d.ts.map +1 -0
- package/dist/commands/build/features.js +97 -0
- package/dist/commands/build/generate.d.ts +2 -0
- package/dist/commands/build/generate.d.ts.map +1 -1
- package/dist/commands/build/generate.js +52 -0
- package/dist/commands/build/init.d.ts.map +1 -1
- package/dist/commands/build/init.js +10 -0
- package/dist/commands/build/queue/setup.d.ts +21 -0
- package/dist/commands/build/queue/setup.d.ts.map +1 -0
- package/dist/commands/build/queue/setup.js +120 -0
- package/dist/commands/build/smartbucket/setup.d.ts +23 -0
- package/dist/commands/build/smartbucket/setup.d.ts.map +1 -0
- package/dist/commands/build/smartbucket/setup.js +167 -0
- package/dist/commands/build/smartmemory/setup.d.ts +23 -0
- package/dist/commands/build/smartmemory/setup.d.ts.map +1 -0
- package/dist/commands/build/smartmemory/setup.js +172 -0
- package/dist/commands/build/smartsql/setup.d.ts +23 -0
- package/dist/commands/build/smartsql/setup.d.ts.map +1 -0
- package/dist/commands/build/smartsql/setup.js +169 -0
- package/dist/commands/build/validate.d.ts +2 -0
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +80 -8
- package/dist/commands/build/workos/jwt.d.ts +23 -0
- package/dist/commands/build/workos/jwt.d.ts.map +1 -0
- package/dist/commands/build/workos/jwt.js +172 -0
- package/dist/commands/doctor.d.ts +27 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +328 -0
- package/dist/commands/object/delete.d.ts +0 -2
- package/dist/commands/object/delete.d.ts.map +1 -1
- package/dist/commands/object/delete.js +3 -38
- package/dist/commands/object/get.d.ts +0 -2
- package/dist/commands/object/get.d.ts.map +1 -1
- package/dist/commands/object/get.js +3 -38
- package/dist/commands/object/list.d.ts +0 -2
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +5 -40
- package/dist/commands/object/put.d.ts +0 -2
- package/dist/commands/object/put.d.ts.map +1 -1
- package/dist/commands/object/put.js +3 -38
- package/dist/commands/query/chunk-search.d.ts +0 -2
- package/dist/commands/query/chunk-search.d.ts.map +1 -1
- package/dist/commands/query/chunk-search.js +12 -46
- package/dist/commands/query/document.d.ts +1 -3
- package/dist/commands/query/document.d.ts.map +1 -1
- package/dist/commands/query/document.js +16 -60
- package/dist/commands/query/search.d.ts +0 -2
- package/dist/commands/query/search.d.ts.map +1 -1
- package/dist/commands/query/search.js +12 -46
- package/dist/feature-catalog.d.ts +28 -0
- package/dist/feature-catalog.d.ts.map +1 -0
- package/dist/feature-catalog.js +104 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/oclif.manifest.json +4811 -3433
- package/package.json +3 -3
- package/templates/examples/smartbucket-minimal.ts.hbs +87 -0
- package/templates/examples/smartmemory-minimal.ts.hbs +82 -0
- package/templates/examples/smartsql-minimal.ts.hbs +69 -0
- package/templates/handlers/actor/index.test.ts.hbs +48 -85
- package/templates/handlers/actor/index.ts.hbs +16 -316
- package/templates/handlers/bucket-event-notification/index.ts.hbs +32 -235
- package/templates/handlers/bucket-event-observer.ts.hbs +79 -0
- package/templates/handlers/http-service/index.test.ts.hbs +3 -0
- package/templates/handlers/http-service/index.ts.hbs +43 -15
- package/templates/handlers/queue-consumer-setup.ts.hbs +45 -0
- package/templates/handlers/task/index.test.ts.hbs +30 -112
- package/templates/handlers/task/index.ts.hbs +19 -58
- package/templates/init/RAINDROP.md.hbs +97 -1
- package/templates/init/eslint.config.js +43 -0
- package/templates/init/package.json.hbs +4 -1
- package/templates/init/tsconfig.json +3 -3
- package/bundle/chunk-23UBI7BN.js +0 -48
- package/bundle/chunk-2QWMBNE3.js +0 -384
- package/bundle/chunk-45IYWQDC.js +0 -384
- package/bundle/chunk-5YUO23QU.js +0 -4585
- package/bundle/chunk-6MIGCNUO.js +0 -75
- package/bundle/chunk-7ZJWA6HP.js +0 -805
- package/bundle/chunk-AIYVX2M7.js +0 -44
- package/bundle/chunk-BB5TNIEM.js +0 -48
- package/bundle/chunk-BUR3HFKH.js +0 -488
- package/bundle/chunk-BYSBS7KT.js +0 -488
- package/bundle/chunk-CX3RWI62.js +0 -28658
- package/bundle/chunk-DLH7MI57.js +0 -305
- package/bundle/chunk-E3WJIYJZ.js +0 -12148
- package/bundle/chunk-EX7NOPRF.js +0 -12148
- package/bundle/chunk-F76JQS2J.js +0 -231
- package/bundle/chunk-FBOXMVKD.js +0 -28679
- package/bundle/chunk-FTPZ6SQW.js +0 -238909
- package/bundle/chunk-H3CFZ7ZH.js +0 -74
- package/bundle/chunk-HXOILVWA.js +0 -384
- package/bundle/chunk-IMP7O5AC.js +0 -22452
- package/bundle/chunk-IPYOAKRE.js +0 -231
- package/bundle/chunk-J7HN6XF2.js +0 -4461
- package/bundle/chunk-JOLOAALA.js +0 -231
- package/bundle/chunk-JZ2G4Q35.js +0 -4585
- package/bundle/chunk-KVAWPWF7.js +0 -231
- package/bundle/chunk-MEUAAIXV.js +0 -28657
- package/bundle/chunk-QBWFE57Z.js +0 -384
- package/bundle/chunk-SP3LOXPC.js +0 -46
- package/bundle/chunk-T7C564PR.js +0 -28678
- package/bundle/chunk-UFH545WJ.js +0 -22452
- package/bundle/chunk-UHVMPWM5.js +0 -315
- package/bundle/chunk-VB7ZTSZV.js +0 -1089
- package/bundle/chunk-VBIJDFMJ.js +0 -384
- package/bundle/chunk-VR7RLTE3.js +0 -231
- package/bundle/chunk-WFZUJLEC.js +0 -231
- package/bundle/chunk-YDGJTLVZ.js +0 -133
- package/bundle/chunk-YPNQ7UFK.js +0 -502
- package/bundle/chunk-YXFDRMSN.js +0 -384
- package/dist/lib/dns-utils.d.ts +0 -7
- package/dist/lib/dns-utils.d.ts.map +0 -1
- package/dist/lib/dns-utils.js +0 -44
package/bundle/chunk-YXFDRMSN.js
DELETED
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
checkAndDisplayKillswitchStatus
|
|
3
|
-
} from "./chunk-IEF2XC25.js";
|
|
4
|
-
import {
|
|
5
|
-
source_default
|
|
6
|
-
} from "./chunk-YSKASURB.js";
|
|
7
|
-
import {
|
|
8
|
-
BaseCommand
|
|
9
|
-
} from "./chunk-MSJ33O5Y.js";
|
|
10
|
-
import {
|
|
11
|
-
ApplicationsResponseSchema,
|
|
12
|
-
EPOCH_TS,
|
|
13
|
-
UnitState,
|
|
14
|
-
__toESM,
|
|
15
|
-
init_cjs_shims,
|
|
16
|
-
require_lib,
|
|
17
|
-
timestampDate,
|
|
18
|
-
toJsonString
|
|
19
|
-
} from "./chunk-PS3WZBDF.js";
|
|
20
|
-
|
|
21
|
-
// src/commands/build/list.ts
|
|
22
|
-
init_cjs_shims();
|
|
23
|
-
var import_core = __toESM(require_lib(), 1);
|
|
24
|
-
var statusString = {
|
|
25
|
-
[UnitState.UNSPECIFIED]: "<unknown>",
|
|
26
|
-
[UnitState.PENDING]: "pending...",
|
|
27
|
-
[UnitState.STARTING]: "starting...",
|
|
28
|
-
[UnitState.RUNNING]: "running",
|
|
29
|
-
[UnitState.STOPPING]: "stopping...",
|
|
30
|
-
[UnitState.STOPPED]: "stopped",
|
|
31
|
-
[UnitState.DELETING]: "deleting...",
|
|
32
|
-
[UnitState.DELETED]: "deleted"
|
|
33
|
-
};
|
|
34
|
-
var List = class extends BaseCommand {
|
|
35
|
-
static args = {};
|
|
36
|
-
static description = "list Raindrop catalog resources";
|
|
37
|
-
static examples = [
|
|
38
|
-
`<%= config.bin %> <%= command.id %>
|
|
39
|
-
List applications in compact view (default).
|
|
40
|
-
|
|
41
|
-
<%= config.bin %> <%= command.id %> -o tree
|
|
42
|
-
Show applications in tree view with version hierarchy.
|
|
43
|
-
|
|
44
|
-
<%= config.bin %> <%= command.id %> -o log
|
|
45
|
-
Show git-log style view with branch visualization.
|
|
46
|
-
|
|
47
|
-
<%= config.bin %> <%= command.id %> --app demo-fts --limit 5
|
|
48
|
-
Show only demo-fts application, limited to 5 versions.
|
|
49
|
-
|
|
50
|
-
<%= config.bin %> <%= command.id %> --active
|
|
51
|
-
Show only running/active versions.
|
|
52
|
-
`
|
|
53
|
-
];
|
|
54
|
-
static flags = {
|
|
55
|
-
...BaseCommand.HIDDEN_FLAGS,
|
|
56
|
-
all: import_core.Flags.boolean({ char: "a", description: "show deleted resources", default: false }),
|
|
57
|
-
output: import_core.Flags.string({
|
|
58
|
-
char: "o",
|
|
59
|
-
description: "output format",
|
|
60
|
-
default: "compact",
|
|
61
|
-
options: ["text", "table", "json", "log", "compact", "tree"]
|
|
62
|
-
}),
|
|
63
|
-
app: import_core.Flags.string({
|
|
64
|
-
description: "filter by application name",
|
|
65
|
-
required: false
|
|
66
|
-
}),
|
|
67
|
-
limit: import_core.Flags.integer({
|
|
68
|
-
char: "n",
|
|
69
|
-
description: "limit number of versions shown per application",
|
|
70
|
-
required: false
|
|
71
|
-
}),
|
|
72
|
-
active: import_core.Flags.boolean({
|
|
73
|
-
description: "show only running/active versions",
|
|
74
|
-
default: false
|
|
75
|
-
}),
|
|
76
|
-
impersonate: import_core.Flags.string({
|
|
77
|
-
char: "i",
|
|
78
|
-
description: "impersonate organization",
|
|
79
|
-
required: false,
|
|
80
|
-
hidden: true
|
|
81
|
-
}),
|
|
82
|
-
manifest: import_core.Flags.string({
|
|
83
|
-
char: "m",
|
|
84
|
-
description: "project manifest",
|
|
85
|
-
required: false,
|
|
86
|
-
default: "raindrop.manifest",
|
|
87
|
-
hidden: true
|
|
88
|
-
})
|
|
89
|
-
};
|
|
90
|
-
// Build a version tree from applications
|
|
91
|
-
buildVersionTree(applications) {
|
|
92
|
-
const nodesMap = /* @__PURE__ */ new Map();
|
|
93
|
-
const rootNodes = [];
|
|
94
|
-
applications.forEach((app) => {
|
|
95
|
-
const node = {
|
|
96
|
-
versionId: app.versionId,
|
|
97
|
-
previousVersionId: app.previousVersionId || null,
|
|
98
|
-
application: app,
|
|
99
|
-
children: [],
|
|
100
|
-
branch: app.branch
|
|
101
|
-
};
|
|
102
|
-
nodesMap.set(app.versionId, node);
|
|
103
|
-
});
|
|
104
|
-
for (const node of nodesMap.values()) {
|
|
105
|
-
if (node.previousVersionId && nodesMap.has(node.previousVersionId)) {
|
|
106
|
-
nodesMap.get(node.previousVersionId).children.push(node);
|
|
107
|
-
} else {
|
|
108
|
-
rootNodes.push(node);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return { rootNodes, nodesMap };
|
|
112
|
-
}
|
|
113
|
-
// Render the version tree in git-log style with branch lines
|
|
114
|
-
renderGitLogStyle(applications) {
|
|
115
|
-
const groups = this.groupApplicationsByName(applications);
|
|
116
|
-
const result = [];
|
|
117
|
-
for (const [_appName, appVersions] of groups) {
|
|
118
|
-
result.push("");
|
|
119
|
-
const firstApp = appVersions[0];
|
|
120
|
-
if (!firstApp) continue;
|
|
121
|
-
const formattedAppName = this.formatAppName(firstApp);
|
|
122
|
-
result.push(source_default.bold.underline(`=== ${formattedAppName} ===`));
|
|
123
|
-
result.push("");
|
|
124
|
-
const { rootNodes } = this.buildVersionTree(appVersions);
|
|
125
|
-
const columnMap = /* @__PURE__ */ new Map();
|
|
126
|
-
let maxColumn = 0;
|
|
127
|
-
const assignColumns = (node, parentColumn) => {
|
|
128
|
-
if (columnMap.has(node.versionId)) return;
|
|
129
|
-
if (parentColumn !== void 0) {
|
|
130
|
-
columnMap.set(node.versionId, parentColumn);
|
|
131
|
-
} else {
|
|
132
|
-
columnMap.set(node.versionId, maxColumn++);
|
|
133
|
-
}
|
|
134
|
-
node.children.forEach((child) => {
|
|
135
|
-
assignColumns(child, columnMap.get(node.versionId));
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
rootNodes.forEach((root) => assignColumns(root));
|
|
139
|
-
const flattenedNodes = [];
|
|
140
|
-
const flatten = (node) => {
|
|
141
|
-
flattenedNodes.push(node);
|
|
142
|
-
node.children.forEach((child) => flatten(child));
|
|
143
|
-
};
|
|
144
|
-
rootNodes.forEach((root) => flatten(root));
|
|
145
|
-
flattenedNodes.sort((a, b) => {
|
|
146
|
-
const aTime = timestampDate(a.application.createdAt || EPOCH_TS).getTime() || 0;
|
|
147
|
-
const bTime = timestampDate(b.application.createdAt || EPOCH_TS).getTime() || 0;
|
|
148
|
-
return bTime - aTime;
|
|
149
|
-
});
|
|
150
|
-
const processed = /* @__PURE__ */ new Set();
|
|
151
|
-
const linesInUse = /* @__PURE__ */ new Set();
|
|
152
|
-
for (const node of flattenedNodes) {
|
|
153
|
-
if (processed.has(node.versionId)) continue;
|
|
154
|
-
processed.add(node.versionId);
|
|
155
|
-
const app = node.application;
|
|
156
|
-
const column = columnMap.get(node.versionId) || 0;
|
|
157
|
-
linesInUse.add(column);
|
|
158
|
-
const date = timestampDate(app.createdAt || EPOCH_TS);
|
|
159
|
-
const timestamp = date.toLocaleString("en-US", {
|
|
160
|
-
weekday: "short",
|
|
161
|
-
month: "short",
|
|
162
|
-
day: "numeric",
|
|
163
|
-
year: "numeric",
|
|
164
|
-
hour: "numeric",
|
|
165
|
-
minute: "numeric",
|
|
166
|
-
second: "numeric",
|
|
167
|
-
hour12: false,
|
|
168
|
-
timeZoneName: "short"
|
|
169
|
-
});
|
|
170
|
-
let graphLine = "";
|
|
171
|
-
for (let i = 0; i <= maxColumn; i++) {
|
|
172
|
-
if (i === column) {
|
|
173
|
-
graphLine += "*";
|
|
174
|
-
} else if (linesInUse.has(i)) {
|
|
175
|
-
graphLine += "|";
|
|
176
|
-
} else {
|
|
177
|
-
graphLine += " ";
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
let branchInfo = "";
|
|
181
|
-
if (app.branch) {
|
|
182
|
-
branchInfo = ` (${app.branch})`;
|
|
183
|
-
}
|
|
184
|
-
let parentInfo = "";
|
|
185
|
-
if (app.previousVersionId) {
|
|
186
|
-
parentInfo = ` [parent: ${app.previousVersionId}]`;
|
|
187
|
-
}
|
|
188
|
-
const versionLine = `${graphLine} ${source_default.yellow("version")} ${source_default.yellow(app.versionId)}${source_default.cyan(branchInfo)}${source_default.dim(parentInfo)}`;
|
|
189
|
-
result.push(versionLine);
|
|
190
|
-
graphLine = graphLine.replace("*", "|");
|
|
191
|
-
let statusColor;
|
|
192
|
-
if (app.state === UnitState.RUNNING) {
|
|
193
|
-
statusColor = source_default.green;
|
|
194
|
-
} else if (app.state === UnitState.DELETING) {
|
|
195
|
-
statusColor = source_default.yellow;
|
|
196
|
-
} else if (app.state === UnitState.DELETED) {
|
|
197
|
-
statusColor = source_default.red;
|
|
198
|
-
} else {
|
|
199
|
-
statusColor = source_default.gray;
|
|
200
|
-
}
|
|
201
|
-
result.push(`${graphLine} ${source_default.bold("Status:")} ${statusColor(statusString[app.state])}`);
|
|
202
|
-
result.push(`${graphLine} ${source_default.bold("Date:")} ${source_default.dim(timestamp)}`);
|
|
203
|
-
result.push(`${graphLine} `);
|
|
204
|
-
result.push(`${graphLine} ${source_default.bold(this.formatAppName(app))}`);
|
|
205
|
-
result.push(`${graphLine}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return result.join("\n");
|
|
209
|
-
}
|
|
210
|
-
// Helper function to format app name with privileged indicator
|
|
211
|
-
formatAppName(app) {
|
|
212
|
-
const privilegedIcon = app.privileged ? source_default.magenta("\u{1F512} ") : "";
|
|
213
|
-
return `${privilegedIcon}${app.name}`;
|
|
214
|
-
}
|
|
215
|
-
// Group applications by name
|
|
216
|
-
groupApplicationsByName(applications) {
|
|
217
|
-
const groups = /* @__PURE__ */ new Map();
|
|
218
|
-
for (const app of applications) {
|
|
219
|
-
const name = app.name;
|
|
220
|
-
if (!groups.has(name)) {
|
|
221
|
-
groups.set(name, []);
|
|
222
|
-
}
|
|
223
|
-
groups.get(name).push(app);
|
|
224
|
-
}
|
|
225
|
-
for (const apps of groups.values()) {
|
|
226
|
-
apps.sort((a, b) => {
|
|
227
|
-
const aTime = timestampDate(a.createdAt || EPOCH_TS).getTime();
|
|
228
|
-
const bTime = timestampDate(b.createdAt || EPOCH_TS).getTime();
|
|
229
|
-
return bTime - aTime;
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
return groups;
|
|
233
|
-
}
|
|
234
|
-
// Render compact view
|
|
235
|
-
renderCompactView(applications) {
|
|
236
|
-
const groups = this.groupApplicationsByName(applications);
|
|
237
|
-
const result = [];
|
|
238
|
-
const sortedGroups = Array.from(groups.entries()).sort((a, b) => {
|
|
239
|
-
const aLatest = a[1][0];
|
|
240
|
-
const bLatest = b[1][0];
|
|
241
|
-
if (!aLatest || !bLatest) return 0;
|
|
242
|
-
const aTime = timestampDate(aLatest.createdAt || EPOCH_TS).getTime();
|
|
243
|
-
const bTime = timestampDate(bLatest.createdAt || EPOCH_TS).getTime();
|
|
244
|
-
return bTime - aTime;
|
|
245
|
-
});
|
|
246
|
-
for (const [_appName, versions] of sortedGroups) {
|
|
247
|
-
const activeVersions2 = versions.filter((v) => v.state === UnitState.RUNNING);
|
|
248
|
-
const deletedVersions = versions.filter((v) => v.state === UnitState.DELETED || v.state === UnitState.DELETING);
|
|
249
|
-
const firstVersion = versions[0];
|
|
250
|
-
if (!firstVersion) continue;
|
|
251
|
-
const formattedAppName = this.formatAppName(firstVersion);
|
|
252
|
-
result.push(`
|
|
253
|
-
${source_default.bold(formattedAppName)} ${source_default.dim(`(${versions.length} version${versions.length !== 1 ? "s" : ""})`)}`);
|
|
254
|
-
let shown = 0;
|
|
255
|
-
for (const version of activeVersions2) {
|
|
256
|
-
if (this.flags.limit && shown >= this.flags.limit) break;
|
|
257
|
-
const date = timestampDate(version.createdAt || EPOCH_TS).toLocaleDateString();
|
|
258
|
-
const branch = version.branch ? source_default.cyan(` (${version.branch})`) : "";
|
|
259
|
-
const status = source_default.green(statusString[version.state]);
|
|
260
|
-
result.push(` \u2514\u2500 ${source_default.yellow(version.versionId)}...${branch} - ${status} - ${source_default.dim(date)}`);
|
|
261
|
-
shown++;
|
|
262
|
-
}
|
|
263
|
-
if (!this.flags.active && deletedVersions.length > 0) {
|
|
264
|
-
const remaining = this.flags.limit ? Math.max(0, this.flags.limit - shown) : deletedVersions.length;
|
|
265
|
-
const toShow = Math.min(remaining, deletedVersions.length);
|
|
266
|
-
for (let i = 0; i < toShow && i < 3; i++) {
|
|
267
|
-
const version = deletedVersions[i];
|
|
268
|
-
if (!version) continue;
|
|
269
|
-
const date = timestampDate(version.createdAt || EPOCH_TS).toLocaleDateString();
|
|
270
|
-
const status = version.state === UnitState.DELETING ? source_default.yellow(statusString[version.state]) : source_default.red(statusString[version.state]);
|
|
271
|
-
result.push(` \u2514\u2500 ${source_default.gray(version.versionId)}... - ${status} - ${source_default.dim(date)}`);
|
|
272
|
-
}
|
|
273
|
-
if (deletedVersions.length > toShow) {
|
|
274
|
-
result.push(source_default.dim(` ... ${deletedVersions.length - toShow} more deleted versions`));
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
const totalApps = sortedGroups.length;
|
|
279
|
-
const totalVersions = applications.length;
|
|
280
|
-
const activeVersions = applications.filter((app) => app.state === UnitState.RUNNING).length;
|
|
281
|
-
result.push("");
|
|
282
|
-
result.push(source_default.dim("\u2500".repeat(50)));
|
|
283
|
-
result.push(source_default.dim(`Total: ${totalApps} applications, ${totalVersions} versions (${activeVersions} active)`));
|
|
284
|
-
return result.join("\n");
|
|
285
|
-
}
|
|
286
|
-
// Render tree view for a specific application
|
|
287
|
-
renderTreeView(applications) {
|
|
288
|
-
const groups = this.groupApplicationsByName(applications);
|
|
289
|
-
const result = [];
|
|
290
|
-
for (const [_appName, versions] of groups) {
|
|
291
|
-
const firstVersion = versions[0];
|
|
292
|
-
if (!firstVersion) continue;
|
|
293
|
-
const formattedAppName = this.formatAppName(firstVersion);
|
|
294
|
-
result.push(`
|
|
295
|
-
${source_default.bold.underline(`=== ${formattedAppName} ===`)}`);
|
|
296
|
-
const { rootNodes } = this.buildVersionTree(versions);
|
|
297
|
-
const renderNode = (node, prefix = "", isLast = true) => {
|
|
298
|
-
const app = node.application;
|
|
299
|
-
const date = timestampDate(app.createdAt || EPOCH_TS).toLocaleDateString();
|
|
300
|
-
const branch = app.branch ? source_default.cyan(` (${app.branch})`) : "";
|
|
301
|
-
let status;
|
|
302
|
-
if (app.state === UnitState.RUNNING) {
|
|
303
|
-
status = source_default.green(statusString[app.state]);
|
|
304
|
-
} else if (app.state === UnitState.DELETING) {
|
|
305
|
-
status = source_default.yellow(statusString[app.state]);
|
|
306
|
-
} else if (app.state === UnitState.DELETED) {
|
|
307
|
-
status = source_default.red(statusString[app.state]);
|
|
308
|
-
} else {
|
|
309
|
-
status = source_default.gray(statusString[app.state]);
|
|
310
|
-
}
|
|
311
|
-
const current = app.state === UnitState.RUNNING && app.branch === "main" ? source_default.bold.green(" \u2190 current") : "";
|
|
312
|
-
const connector = isLast ? "\u2514\u2500" : "\u251C\u2500";
|
|
313
|
-
const shortId = source_default.yellow(app.versionId);
|
|
314
|
-
result.push(`${prefix}${connector} ${shortId}...${branch} - ${status} - ${source_default.dim(date)}${current}`);
|
|
315
|
-
const childPrefix = prefix + (isLast ? " " : "\u2502 ");
|
|
316
|
-
node.children.forEach((child, index) => {
|
|
317
|
-
renderNode(child, childPrefix, index === node.children.length - 1);
|
|
318
|
-
});
|
|
319
|
-
};
|
|
320
|
-
rootNodes.forEach((root, index) => {
|
|
321
|
-
renderNode(root, "", index === rootNodes.length - 1);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
return result.join("\n");
|
|
325
|
-
}
|
|
326
|
-
async listApplications() {
|
|
327
|
-
const { client: catalogService, organizationId: defaultOrganizationId, userId } = await this.catalogService();
|
|
328
|
-
const organizationId = this.flags.impersonate ?? defaultOrganizationId;
|
|
329
|
-
if (this.flags.output === "log" || this.flags.output === "table") {
|
|
330
|
-
this.log(source_default.dim(`Listing applications for organization ${organizationId}`));
|
|
331
|
-
}
|
|
332
|
-
const resp = await catalogService.applications({
|
|
333
|
-
userId,
|
|
334
|
-
organizationId,
|
|
335
|
-
showDeleted: this.flags.all
|
|
336
|
-
});
|
|
337
|
-
let applications = resp.applications;
|
|
338
|
-
if (this.flags.app) {
|
|
339
|
-
applications = applications.filter((app) => app.name === this.flags.app);
|
|
340
|
-
}
|
|
341
|
-
if (this.flags.active) {
|
|
342
|
-
applications = applications.filter((app) => app.state === UnitState.RUNNING);
|
|
343
|
-
}
|
|
344
|
-
if (this.flags.output === "log") {
|
|
345
|
-
this.log(this.renderGitLogStyle(applications));
|
|
346
|
-
} else if (this.flags.output === "compact") {
|
|
347
|
-
this.log(this.renderCompactView(applications));
|
|
348
|
-
} else if (this.flags.output === "tree") {
|
|
349
|
-
this.log(this.renderTreeView(applications));
|
|
350
|
-
} else if (this.flags.output === "table") {
|
|
351
|
-
console.table(
|
|
352
|
-
applications.reduce(
|
|
353
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
354
|
-
(acc, a) => {
|
|
355
|
-
const dateStr = a.createdAt ? timestampDate(a.createdAt).toISOString() : "";
|
|
356
|
-
acc[dateStr] = {
|
|
357
|
-
...a,
|
|
358
|
-
status: statusString[a.state],
|
|
359
|
-
locked: a.lock ? "locked" : "",
|
|
360
|
-
privileged: a.privileged ? "system" : "user"
|
|
361
|
-
};
|
|
362
|
-
return acc;
|
|
363
|
-
},
|
|
364
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
365
|
-
{}
|
|
366
|
-
),
|
|
367
|
-
["organizationId", "name", "versionId", "branch", "status", "locked", "privileged", ...this.flags.all ? ["deletedAt"] : []]
|
|
368
|
-
);
|
|
369
|
-
} else if (this.flags.output === "json") {
|
|
370
|
-
console.log(toJsonString(ApplicationsResponseSchema, resp, { prettySpaces: 2 }));
|
|
371
|
-
} else {
|
|
372
|
-
this.log(this.renderCompactView(applications));
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
async run() {
|
|
376
|
-
await checkAndDisplayKillswitchStatus(this);
|
|
377
|
-
await this.listApplications();
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
export {
|
|
382
|
-
statusString,
|
|
383
|
-
List
|
|
384
|
-
};
|
package/dist/lib/dns-utils.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { StrictClient } from '../strict-client.js';
|
|
2
|
-
import { DnsService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/dns_pb';
|
|
3
|
-
/**
|
|
4
|
-
* Resolves a DNS name to its corresponding zone ID by searching through all DNS zones
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolveDnsNameToZoneId(dnsClient: StrictClient<typeof DnsService>, organizationId: string, userId: string, dnsName: string): Promise<string>;
|
|
7
|
-
//# sourceMappingURL=dns-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dns-utils.d.ts","sourceRoot":"","sources":["../../src/lib/dns-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAW,MAAM,qDAAqD,CAAC;AAE1F;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,YAAY,CAAC,OAAO,UAAU,CAAC,EAC1C,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAiDjB"}
|
package/dist/lib/dns-utils.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves a DNS name to its corresponding zone ID by searching through all DNS zones
|
|
3
|
-
*/
|
|
4
|
-
export async function resolveDnsNameToZoneId(dnsClient, organizationId, userId, dnsName) {
|
|
5
|
-
try {
|
|
6
|
-
// Normalize the DNS name - remove trailing dot if present
|
|
7
|
-
const normalizedDnsName = dnsName.endsWith('.') ? dnsName.slice(0, -1) : dnsName;
|
|
8
|
-
let pageToken;
|
|
9
|
-
do {
|
|
10
|
-
const response = await dnsClient.listDNSZones({
|
|
11
|
-
organizationId,
|
|
12
|
-
userId,
|
|
13
|
-
pageSize: 100, // Use a larger page size for efficiency
|
|
14
|
-
pageToken,
|
|
15
|
-
});
|
|
16
|
-
if (response.zones) {
|
|
17
|
-
// Look for exact match first
|
|
18
|
-
const exactMatch = response.zones.find((zone) => zone.fullyQualifiedDomainName === normalizedDnsName);
|
|
19
|
-
if (exactMatch?.zoneId) {
|
|
20
|
-
return exactMatch.zoneId;
|
|
21
|
-
}
|
|
22
|
-
// If no exact match, look for zones where the DNS name is a subdomain
|
|
23
|
-
const parentZone = response.zones.find((zone) => {
|
|
24
|
-
if (!zone.fullyQualifiedDomainName)
|
|
25
|
-
return false;
|
|
26
|
-
// Check if dnsName ends with the zone's FQDN (indicating it's a subdomain of this zone)
|
|
27
|
-
const zoneFqdn = zone.fullyQualifiedDomainName;
|
|
28
|
-
return normalizedDnsName.endsWith(`.${zoneFqdn}`) || normalizedDnsName === zoneFqdn;
|
|
29
|
-
});
|
|
30
|
-
if (parentZone?.zoneId) {
|
|
31
|
-
return parentZone.zoneId;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
pageToken = response.nextPageToken;
|
|
35
|
-
} while (pageToken);
|
|
36
|
-
throw new Error(`No DNS zone found for domain name: ${dnsName}`);
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
if (error instanceof Error) {
|
|
40
|
-
throw error;
|
|
41
|
-
}
|
|
42
|
-
throw new Error(`Failed to resolve DNS name to zone ID: ${error}`);
|
|
43
|
-
}
|
|
44
|
-
}
|