@tokenbuddy/tb-admin 1.0.36 → 1.0.37
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/src/cli.js +92 -19
- package/dist/src/config.d.ts +7 -1
- package/dist/src/config.js +16 -4
- package/dist/src/display-format.js +6 -14
- package/dist/src/init-command.d.ts +50 -0
- package/dist/src/init-command.js +347 -0
- package/dist/src/providers/fly-io.d.ts +3 -0
- package/dist/src/providers/fly-io.js +137 -0
- package/dist/src/providers/provider-definition.d.ts +38 -0
- package/dist/src/providers/provider-definition.js +2 -0
- package/dist/src/seller.d.ts +2 -0
- package/dist/src/seller.js +30 -13
- package/dist/src/server-cmd.d.ts +1 -0
- package/dist/src/server-cmd.js +9 -2
- package/dist/src/ui-actions.d.ts +3 -0
- package/dist/src/ui-actions.js +199 -27
- package/dist/src/ui-command.js +3 -2
- package/dist/src/ui-state.d.ts +1 -3
- package/dist/src/ui-state.js +4 -8
- package/dist/src/ui-static.js +43 -15
- package/dist/src/workdir.d.ts +21 -0
- package/dist/src/workdir.js +50 -0
- package/package.json +8 -2
- package/templates/providers/fly.io/admin.toml.example +18 -0
- package/templates/providers/fly.io/deploy-secrets/bootstrap/README.md +18 -0
- package/templates/providers/fly.io/deploy-secrets/bootstrap/admin-web.example.env +3 -0
- package/templates/providers/fly.io/deploy-secrets/bootstrap/cloudflare-r2.example.env +6 -0
- package/templates/providers/fly.io/deploy-secrets/bootstrap/registry-signing-key.example.json +6 -0
- package/templates/providers/fly.io/deploy-secrets/bootstrap/registry.example.json +14 -0
- package/templates/providers/fly.io/deploy-secrets/bootstrap/tb-registry.example.yaml +14 -0
- package/templates/providers/fly.io/deploy-secrets/seller-configs/README.md +13 -0
- package/templates/providers/fly.io/deploy-secrets/seller-configs/seller.example.yaml +35 -0
- package/templates/providers/fly.io/env/deploy.env.example +12 -0
- package/templates/providers/fly.io/fly/fly.tb-registry.toml +31 -0
- package/templates/providers/fly.io/fly/fly.tb-seller.toml +25 -0
- package/templates/providers/fly.io/provider.toml.example +10 -0
- package/dist/src/bootstrap-registry.d.ts.map +0 -1
- package/dist/src/bootstrap-registry.js.map +0 -1
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/client.d.ts.map +0 -1
- package/dist/src/client.js.map +0 -1
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js.map +0 -1
- package/dist/src/display-format.d.ts.map +0 -1
- package/dist/src/display-format.js.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/provider.d.ts.map +0 -1
- package/dist/src/provider.js.map +0 -1
- package/dist/src/seller.d.ts.map +0 -1
- package/dist/src/seller.js.map +0 -1
- package/dist/src/server-cmd.d.ts.map +0 -1
- package/dist/src/server-cmd.js.map +0 -1
- package/dist/src/ui-actions.d.ts.map +0 -1
- package/dist/src/ui-actions.js.map +0 -1
- package/dist/src/ui-command.d.ts.map +0 -1
- package/dist/src/ui-command.js.map +0 -1
- package/dist/src/ui-server.d.ts.map +0 -1
- package/dist/src/ui-server.js.map +0 -1
- package/dist/src/ui-state.d.ts.map +0 -1
- package/dist/src/ui-state.js.map +0 -1
- package/dist/src/ui-static.d.ts.map +0 -1
- package/dist/src/ui-static.js.map +0 -1
- package/dist/src/upstream-balance-probe.d.ts.map +0 -1
- package/dist/src/upstream-balance-probe.js.map +0 -1
- package/dist/src/vendor-client.d.ts.map +0 -1
- package/dist/src/vendor-client.js.map +0 -1
- package/dist/src/vendor-commands.d.ts.map +0 -1
- package/dist/src/vendor-commands.js.map +0 -1
- package/src/bootstrap-registry.ts +0 -90
- package/src/cli.ts +0 -1614
- package/src/client.ts +0 -179
- package/src/config.ts +0 -194
- package/src/display-format.ts +0 -411
- package/src/index.ts +0 -11
- package/src/provider.ts +0 -150
- package/src/seller.ts +0 -538
- package/src/server-cmd.ts +0 -362
- package/src/ui-actions.ts +0 -1040
- package/src/ui-command.ts +0 -44
- package/src/ui-server.ts +0 -353
- package/src/ui-state.ts +0 -1318
- package/src/ui-static.ts +0 -673
- package/src/upstream-balance-probe.ts +0 -13
- package/src/vendor-client.ts +0 -23
- package/src/vendor-commands.ts +0 -65
- package/tests/admin.test.ts +0 -2162
- package/tests/seller.test.ts +0 -388
- package/tests/ui-state-fleet.test.ts +0 -526
- package/tests/ui-static-row.test.ts +0 -467
- package/tests/vendor-cli.test.ts +0 -241
- package/tsconfig.json +0 -8
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
BalanceProbeCache,
|
|
3
|
-
defaultBalanceProbeCache,
|
|
4
|
-
probeUpstreamBalance
|
|
5
|
-
} from "@tokenbuddy/contracts";
|
|
6
|
-
export type {
|
|
7
|
-
BalanceCurrency,
|
|
8
|
-
BalanceProbeConfig,
|
|
9
|
-
BalanceProbeOptions,
|
|
10
|
-
BalanceProbeTemplate,
|
|
11
|
-
BalanceSnapshot,
|
|
12
|
-
BalanceSource
|
|
13
|
-
} from "@tokenbuddy/contracts";
|
package/src/vendor-client.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type alias for the seller entry shape vendor commands work with.
|
|
3
|
-
* Mirrors the server-side `SellerRegistryEntry` but stays decoupled
|
|
4
|
-
* from `wallet-bootstrap`'s internal types so this package does not
|
|
5
|
-
* become a build-time dependency of the registry service.
|
|
6
|
-
*/
|
|
7
|
-
export interface SellerRegistryEntry {
|
|
8
|
-
id: string;
|
|
9
|
-
name?: string;
|
|
10
|
-
profile?: string;
|
|
11
|
-
app?: string;
|
|
12
|
-
url: string;
|
|
13
|
-
status?: string;
|
|
14
|
-
region?: string;
|
|
15
|
-
modelsCount?: number;
|
|
16
|
-
sampleModels?: string[];
|
|
17
|
-
models?: string[];
|
|
18
|
-
supportedProtocols: string[];
|
|
19
|
-
paymentMethods: string[];
|
|
20
|
-
recommendedFor?: string[];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { RegistryVendorClient, RegistryAdminClient } from "./client.js";
|
package/src/vendor-commands.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import { RegistryVendorClient, SellerRegistryEntry } from "./vendor-client.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* vendor CLI helpers for the `bootstrap sellers` and
|
|
6
|
-
* `bootstrap release` subcommands. Step 5 of the registry redesign.
|
|
7
|
-
*
|
|
8
|
-
* - `bootstrap sellers add --file <path>`: stage a single seller
|
|
9
|
-
* for inclusion in the next release request submitted by this
|
|
10
|
-
* vendor. The server validates the payload shape, persists it to
|
|
11
|
-
* `seller_pending`, and returns a `pendingSeller` row.
|
|
12
|
-
* - `bootstrap release submit --note <text> --staged <id>`: submit
|
|
13
|
-
* a release request that includes one or more staged sellers.
|
|
14
|
-
* - `bootstrap release list`: list the vendor's release requests.
|
|
15
|
-
* - `bootstrap release show <id>`: show one release request.
|
|
16
|
-
* - `bootstrap release force-publish <id>`: super-admin path; the
|
|
17
|
-
* vendor token cannot force-publish itself (the platform owns
|
|
18
|
-
* the scheduler loop in Step 7), but we keep the command here
|
|
19
|
-
* so CI scripts have a single entry point.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export interface StageSellerInput {
|
|
23
|
-
client: RegistryVendorClient;
|
|
24
|
-
file: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export async function stageSellerFromFile({ client, file }: StageSellerInput): Promise<{ pendingSeller: unknown }> {
|
|
28
|
-
const content = fs.readFileSync(file, "utf8");
|
|
29
|
-
const parsed = JSON.parse(content) as SellerRegistryEntry;
|
|
30
|
-
if (!parsed.id || typeof parsed.id !== "string") {
|
|
31
|
-
throw new Error(`seller id is required in ${file}`);
|
|
32
|
-
}
|
|
33
|
-
return client.stageSeller(parsed);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface SubmitReleaseInput {
|
|
37
|
-
client: RegistryVendorClient;
|
|
38
|
-
stagedSellerIds: string[];
|
|
39
|
-
note?: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export async function submitRelease({ client, stagedSellerIds, note }: SubmitReleaseInput): Promise<{ releaseRequest: unknown }> {
|
|
43
|
-
if (stagedSellerIds.length === 0) {
|
|
44
|
-
throw new Error("at least one --staged <seller-id> is required");
|
|
45
|
-
}
|
|
46
|
-
return client.submitRelease({ stagedSellerIds, note });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function printReleaseRequestSummary(record: any): string {
|
|
50
|
-
if (!record) {
|
|
51
|
-
return "no release request";
|
|
52
|
-
}
|
|
53
|
-
const summary = record.payloadSummary || { count: 0, sellerIds: [] };
|
|
54
|
-
return [
|
|
55
|
-
`id: #${record.id}`,
|
|
56
|
-
`status: ${record.status}`,
|
|
57
|
-
`vendor: ${record.vendorId}`,
|
|
58
|
-
`sellers: ${summary.count} (${(summary.sellerIds || []).join(", ") || "—"})`,
|
|
59
|
-
`submittedAt: ${record.submittedAt || "—"}`,
|
|
60
|
-
`decidedAt: ${record.decidedAt || "—"}`,
|
|
61
|
-
`version: ${record.publishedVersion !== null && record.publishedVersion !== undefined ? `v${record.publishedVersion}` : "—"}`,
|
|
62
|
-
record.note ? `note: ${record.note}` : null,
|
|
63
|
-
record.errorMessage ? `error: ${record.errorMessage}` : null
|
|
64
|
-
].filter(Boolean).join("\n");
|
|
65
|
-
}
|