@warmhub/cli 0.58.0 → 0.59.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/dist/wh.js +242 -105
- package/package.json +1 -1
package/dist/wh.js
CHANGED
|
@@ -18531,6 +18531,12 @@ var DEFAULT_MAX_OPS_PER_STREAM = 1e6;
|
|
|
18531
18531
|
var DEFAULT_STREAM_APPEND_CHUNK_SIZE = 1000;
|
|
18532
18532
|
var MAX_STREAM_APPEND_OPERATION_COUNT = 1e4;
|
|
18533
18533
|
// ../../packages/rules/src/commit-types.ts
|
|
18534
|
+
var COMMIT_OPERATION_KINDS = [
|
|
18535
|
+
"shape",
|
|
18536
|
+
"thing",
|
|
18537
|
+
"assertion",
|
|
18538
|
+
"collection"
|
|
18539
|
+
];
|
|
18534
18540
|
function inferOperationKind(op) {
|
|
18535
18541
|
if (op.kind === "shape" || op.kind === "thing" || op.kind === "assertion" || op.kind === "collection") {
|
|
18536
18542
|
return op.kind;
|
|
@@ -21379,6 +21385,15 @@ function nestedObjectFields(typeDef) {
|
|
|
21379
21385
|
}
|
|
21380
21386
|
return fields;
|
|
21381
21387
|
}
|
|
21388
|
+
// ../../packages/rules/src/subscribable-events.ts
|
|
21389
|
+
var COMMIT_EVENT_TYPE = "commit";
|
|
21390
|
+
var REPO_RENAMED_EVENT_TYPE = "repo.renamed";
|
|
21391
|
+
var ORG_RENAMED_EVENT_TYPE = "org.renamed";
|
|
21392
|
+
var SUBSCRIBABLE_EVENT_TYPES = [
|
|
21393
|
+
COMMIT_EVENT_TYPE,
|
|
21394
|
+
REPO_RENAMED_EVENT_TYPE,
|
|
21395
|
+
ORG_RENAMED_EVENT_TYPE
|
|
21396
|
+
];
|
|
21382
21397
|
// ../../packages/rules/src/system-components/system.ts
|
|
21383
21398
|
var SYSTEM_COMPONENT_ID = "com.warmhub.system";
|
|
21384
21399
|
var SYSTEM_REGISTERED_COMPONENT_REF = "warmhub/system";
|
|
@@ -21442,7 +21457,7 @@ function findSystemComponent(componentId) {
|
|
|
21442
21457
|
// ../../packages/sdk-ts/package.json
|
|
21443
21458
|
var package_default = {
|
|
21444
21459
|
name: "@warmhub/sdk-ts",
|
|
21445
|
-
version: "0.
|
|
21460
|
+
version: "0.59.0",
|
|
21446
21461
|
private: false,
|
|
21447
21462
|
type: "module",
|
|
21448
21463
|
description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -22052,6 +22067,27 @@ function chunkArray(items, chunkSize) {
|
|
|
22052
22067
|
}
|
|
22053
22068
|
return chunks;
|
|
22054
22069
|
}
|
|
22070
|
+
function toSubscriptionRef(args) {
|
|
22071
|
+
const [first, repoName, name] = args;
|
|
22072
|
+
return typeof first === "string" ? { orgName: first, repoName, name } : first;
|
|
22073
|
+
}
|
|
22074
|
+
function toSubscriptionListRef(args) {
|
|
22075
|
+
const [first, repoName] = args;
|
|
22076
|
+
return typeof first === "string" ? { orgName: first, repoName } : first;
|
|
22077
|
+
}
|
|
22078
|
+
function toSubscriptionBindRef(args) {
|
|
22079
|
+
const [first, repoName, subscriptionName, credentialSetName] = args;
|
|
22080
|
+
return typeof first === "string" ? {
|
|
22081
|
+
orgName: first,
|
|
22082
|
+
repoName,
|
|
22083
|
+
subscriptionName,
|
|
22084
|
+
credentialSetName
|
|
22085
|
+
} : first;
|
|
22086
|
+
}
|
|
22087
|
+
function toSubscriptionUnbindRef(args) {
|
|
22088
|
+
const [first, repoName, subscriptionName] = args;
|
|
22089
|
+
return typeof first === "string" ? { orgName: first, repoName, subscriptionName } : first;
|
|
22090
|
+
}
|
|
22055
22091
|
function sanitizeSubscriptionCreateInput(input) {
|
|
22056
22092
|
const {
|
|
22057
22093
|
actionContainer: _actionContainer,
|
|
@@ -23019,35 +23055,24 @@ class WarmHubClient {
|
|
|
23019
23055
|
throw toWarmHubError(error);
|
|
23020
23056
|
}
|
|
23021
23057
|
},
|
|
23022
|
-
get: async (
|
|
23058
|
+
get: async (...args) => {
|
|
23023
23059
|
try {
|
|
23024
|
-
const result = await this.trpc.subscription.get.query(
|
|
23025
|
-
orgName,
|
|
23026
|
-
repoName,
|
|
23027
|
-
name
|
|
23028
|
-
});
|
|
23060
|
+
const result = await this.trpc.subscription.get.query(toSubscriptionRef(args));
|
|
23029
23061
|
return normalizeSubscriptionInfo(result);
|
|
23030
23062
|
} catch (error) {
|
|
23031
23063
|
throw toWarmHubError(error);
|
|
23032
23064
|
}
|
|
23033
23065
|
},
|
|
23034
|
-
reveal: async (
|
|
23066
|
+
reveal: async (...args) => {
|
|
23035
23067
|
try {
|
|
23036
|
-
return await this.trpc.subscription.reveal.query(
|
|
23037
|
-
orgName,
|
|
23038
|
-
repoName,
|
|
23039
|
-
name
|
|
23040
|
-
});
|
|
23068
|
+
return await this.trpc.subscription.reveal.query(toSubscriptionRef(args));
|
|
23041
23069
|
} catch (error) {
|
|
23042
23070
|
throw toWarmHubError(error);
|
|
23043
23071
|
}
|
|
23044
23072
|
},
|
|
23045
|
-
list: async (
|
|
23073
|
+
list: async (...args) => {
|
|
23046
23074
|
try {
|
|
23047
|
-
const result = await this.trpc.subscription.list.query(
|
|
23048
|
-
orgName,
|
|
23049
|
-
repoName
|
|
23050
|
-
});
|
|
23075
|
+
const result = await this.trpc.subscription.list.query(toSubscriptionListRef(args));
|
|
23051
23076
|
return normalizeSubscriptionList(result);
|
|
23052
23077
|
} catch (error) {
|
|
23053
23078
|
throw toWarmHubError(error);
|
|
@@ -23061,58 +23086,37 @@ class WarmHubClient {
|
|
|
23061
23086
|
throw toWarmHubError(error);
|
|
23062
23087
|
}
|
|
23063
23088
|
},
|
|
23064
|
-
pause: async (
|
|
23089
|
+
pause: async (...args) => {
|
|
23065
23090
|
try {
|
|
23066
|
-
return await this.trpc.subscription.pause.mutate(
|
|
23067
|
-
orgName,
|
|
23068
|
-
repoName,
|
|
23069
|
-
name
|
|
23070
|
-
});
|
|
23091
|
+
return await this.trpc.subscription.pause.mutate(toSubscriptionRef(args));
|
|
23071
23092
|
} catch (error) {
|
|
23072
23093
|
throw toWarmHubError(error);
|
|
23073
23094
|
}
|
|
23074
23095
|
},
|
|
23075
|
-
resume: async (
|
|
23096
|
+
resume: async (...args) => {
|
|
23076
23097
|
try {
|
|
23077
|
-
return await this.trpc.subscription.resume.mutate(
|
|
23078
|
-
orgName,
|
|
23079
|
-
repoName,
|
|
23080
|
-
name
|
|
23081
|
-
});
|
|
23098
|
+
return await this.trpc.subscription.resume.mutate(toSubscriptionRef(args));
|
|
23082
23099
|
} catch (error) {
|
|
23083
23100
|
throw toWarmHubError(error);
|
|
23084
23101
|
}
|
|
23085
23102
|
},
|
|
23086
|
-
remove: async (
|
|
23103
|
+
remove: async (...args) => {
|
|
23087
23104
|
try {
|
|
23088
|
-
return await this.trpc.subscription.remove.mutate(
|
|
23089
|
-
orgName,
|
|
23090
|
-
repoName,
|
|
23091
|
-
name
|
|
23092
|
-
});
|
|
23105
|
+
return await this.trpc.subscription.remove.mutate(toSubscriptionRef(args));
|
|
23093
23106
|
} catch (error) {
|
|
23094
23107
|
throw toWarmHubError(error);
|
|
23095
23108
|
}
|
|
23096
23109
|
},
|
|
23097
|
-
bindCredentials: async (
|
|
23110
|
+
bindCredentials: async (...args) => {
|
|
23098
23111
|
try {
|
|
23099
|
-
return await this.trpc.subscription.bindCredentials.mutate(
|
|
23100
|
-
orgName,
|
|
23101
|
-
repoName,
|
|
23102
|
-
subscriptionName,
|
|
23103
|
-
credentialSetName
|
|
23104
|
-
});
|
|
23112
|
+
return await this.trpc.subscription.bindCredentials.mutate(toSubscriptionBindRef(args));
|
|
23105
23113
|
} catch (error) {
|
|
23106
23114
|
throw toWarmHubError(error);
|
|
23107
23115
|
}
|
|
23108
23116
|
},
|
|
23109
|
-
unbindCredentials: async (
|
|
23117
|
+
unbindCredentials: async (...args) => {
|
|
23110
23118
|
try {
|
|
23111
|
-
return await this.trpc.subscription.unbindCredentials.mutate(
|
|
23112
|
-
orgName,
|
|
23113
|
-
repoName,
|
|
23114
|
-
subscriptionName
|
|
23115
|
-
});
|
|
23119
|
+
return await this.trpc.subscription.unbindCredentials.mutate(toSubscriptionUnbindRef(args));
|
|
23116
23120
|
} catch (error) {
|
|
23117
23121
|
throw toWarmHubError(error);
|
|
23118
23122
|
}
|
|
@@ -31087,7 +31091,7 @@ var handleTemplate = async (ctx, { flags, args }) => {
|
|
|
31087
31091
|
if (operationType !== "add" && operationType !== "revise" && operationType !== "retract") {
|
|
31088
31092
|
throw new CliError(2 /* UserInput */, "USER_INPUT", `Invalid --operation "${operationType}". Must be "add", "revise", or "retract".`);
|
|
31089
31093
|
}
|
|
31090
|
-
const validKinds = operationType === "retract" ?
|
|
31094
|
+
const validKinds = operationType === "retract" ? COMMIT_OPERATION_KINDS : ["thing", "assertion"];
|
|
31091
31095
|
if (!validKinds.includes(flags.kind ?? "thing")) {
|
|
31092
31096
|
throw new CliError(2 /* UserInput */, "USER_INPUT", `Invalid --kind "${flags.kind}". Must be one of: ${validKinds.join(", ")}.`);
|
|
31093
31097
|
}
|
|
@@ -31432,7 +31436,11 @@ var GLOBAL_FLAGS = [
|
|
|
31432
31436
|
description: "Output mode: pretty|json (default: pretty)"
|
|
31433
31437
|
},
|
|
31434
31438
|
{ long: "json", type: "boolean", description: "Alias for --format json" },
|
|
31435
|
-
{
|
|
31439
|
+
{
|
|
31440
|
+
long: "live",
|
|
31441
|
+
type: "boolean",
|
|
31442
|
+
description: "Live mode (polls for updates)"
|
|
31443
|
+
},
|
|
31436
31444
|
{
|
|
31437
31445
|
long: "max-updates",
|
|
31438
31446
|
type: "number",
|
|
@@ -36471,10 +36479,19 @@ function renderSubscriptionLog(out, statusOut, c, subscriptionName, result) {
|
|
|
36471
36479
|
}
|
|
36472
36480
|
}
|
|
36473
36481
|
}
|
|
36482
|
+
var orgScopeFlag = flag.string({
|
|
36483
|
+
description: "Org slug for an org-scoped subscription (org.renamed); use instead of --repo"
|
|
36484
|
+
});
|
|
36474
36485
|
var createFlags8 = {
|
|
36475
36486
|
on: flag.string({
|
|
36476
36487
|
description: "Shape to subscribe to"
|
|
36477
36488
|
}),
|
|
36489
|
+
event: flag.string({
|
|
36490
|
+
description: "Event to watch: commit (default), repo.renamed, or org.renamed"
|
|
36491
|
+
}),
|
|
36492
|
+
org: flag.string({
|
|
36493
|
+
description: "Org slug for an org-scoped subscription (org.renamed)"
|
|
36494
|
+
}),
|
|
36478
36495
|
kind: flag.string({
|
|
36479
36496
|
description: "Subscription kind (webhook; the default)"
|
|
36480
36497
|
}),
|
|
@@ -36519,18 +36536,34 @@ var updateFlags4 = {
|
|
|
36519
36536
|
description: "Clear the fallback webhook URL"
|
|
36520
36537
|
}),
|
|
36521
36538
|
"allow-trace-reentry": createFlags8["allow-trace-reentry"],
|
|
36522
|
-
name: createFlags8.name
|
|
36539
|
+
name: createFlags8.name,
|
|
36540
|
+
org: orgScopeFlag
|
|
36523
36541
|
};
|
|
36524
36542
|
var logFlags = {
|
|
36525
36543
|
limit: flag.number({ description: "Max deliveries to return" })
|
|
36526
36544
|
};
|
|
36527
36545
|
var listFlags5 = {
|
|
36528
|
-
limit: flag.number({ description: "Max subscriptions to return" })
|
|
36546
|
+
limit: flag.number({ description: "Max subscriptions to return" }),
|
|
36547
|
+
org: orgScopeFlag
|
|
36548
|
+
};
|
|
36549
|
+
function resolveSubScope(ctx, flags) {
|
|
36550
|
+
if (typeof flags.org === "string" && flags.org) {
|
|
36551
|
+
return { orgName: flags.org };
|
|
36552
|
+
}
|
|
36553
|
+
const { org, repo } = resolveRepoContext(ctx);
|
|
36554
|
+
return { orgName: org, repoName: repo };
|
|
36555
|
+
}
|
|
36556
|
+
function scopeLabel(scope) {
|
|
36557
|
+
return scope.repoName ? `${scope.orgName}/${scope.repoName}` : scope.orgName;
|
|
36558
|
+
}
|
|
36559
|
+
var scopeFlags = {
|
|
36560
|
+
org: orgScopeFlag
|
|
36529
36561
|
};
|
|
36530
36562
|
var viewFlags5 = {
|
|
36531
36563
|
"show-secrets": flag.boolean({
|
|
36532
36564
|
description: "Reveal the raw webhook URL(s) instead of the redacted origin (audit-logged)"
|
|
36533
|
-
})
|
|
36565
|
+
}),
|
|
36566
|
+
org: orgScopeFlag
|
|
36534
36567
|
};
|
|
36535
36568
|
function buildSubscriptionPatchArgs(flags, usage, example) {
|
|
36536
36569
|
const args = {};
|
|
@@ -36576,22 +36609,83 @@ function buildSubscriptionMutationArgs(flags, usage, example) {
|
|
|
36576
36609
|
}
|
|
36577
36610
|
return mutationArgs;
|
|
36578
36611
|
}
|
|
36612
|
+
function parseEventType(raw, _usage, example) {
|
|
36613
|
+
if (raw === undefined) {
|
|
36614
|
+
return COMMIT_EVENT_TYPE;
|
|
36615
|
+
}
|
|
36616
|
+
if (SUBSCRIBABLE_EVENT_TYPES.includes(raw)) {
|
|
36617
|
+
return raw;
|
|
36618
|
+
}
|
|
36619
|
+
usageError(`--event must be one of: ${SUBSCRIBABLE_EVENT_TYPES.join(", ")}`, example);
|
|
36620
|
+
}
|
|
36621
|
+
function rejectCommitFlags(flags, eventType) {
|
|
36622
|
+
for (const f of ["on", "filter", "source"]) {
|
|
36623
|
+
const v = flags[f];
|
|
36624
|
+
if (typeof v === "string" && v.length > 0) {
|
|
36625
|
+
usageError(`--${f} is not valid for ${eventType} subscriptions — rename events have no shape or filter`, `wh sub create rename-hook --event ${eventType} --webhook-url https://example.com/hook`);
|
|
36626
|
+
}
|
|
36627
|
+
}
|
|
36628
|
+
}
|
|
36579
36629
|
var handleCreate7 = async (ctx, { flags, args }) => {
|
|
36580
36630
|
const name = args[0] ?? flags.name;
|
|
36581
|
-
const usage = "Usage: wh sub create <name> --repo org/repo [--
|
|
36631
|
+
const usage = "Usage: wh sub create <name> (--repo org/repo | --org org) [--event commit|repo.renamed|org.renamed] [options]";
|
|
36582
36632
|
const example = `wh sub create signal-hook --repo myorg/myrepo --on Signal --filter '{"shape":"Signal"}' --webhook-url https://example.com/hook`;
|
|
36583
36633
|
if (!name) {
|
|
36584
36634
|
usageError(usage, example);
|
|
36585
36635
|
}
|
|
36586
36636
|
rejectRemovedCronFlags(flags);
|
|
36587
36637
|
const kind = parseKind(flags.kind, usage, example);
|
|
36588
|
-
const
|
|
36589
|
-
const
|
|
36590
|
-
const sourceRepoRef = typeof flags.source === "string" ? flags.source : undefined;
|
|
36591
|
-
const webhookUrl = createArgs.webhookUrl;
|
|
36638
|
+
const eventType = parseEventType(flags.event, usage, example);
|
|
36639
|
+
const webhookUrl = typeof flags["webhook-url"] === "string" ? flags["webhook-url"] : typeof flags.url === "string" ? flags.url : undefined;
|
|
36592
36640
|
if (!webhookUrl) {
|
|
36593
36641
|
usageError(usage, example);
|
|
36594
36642
|
}
|
|
36643
|
+
const fallbackWebhookUrl = typeof flags["fallback-webhook-url"] === "string" ? flags["fallback-webhook-url"] : undefined;
|
|
36644
|
+
const allowTraceReentry = flags["allow-trace-reentry"] === true;
|
|
36645
|
+
const renameExtras = {
|
|
36646
|
+
...fallbackWebhookUrl ? { fallbackWebhookUrl } : {},
|
|
36647
|
+
...allowTraceReentry ? { allowTraceReentry: true } : {}
|
|
36648
|
+
};
|
|
36649
|
+
if (eventType === "org.renamed") {
|
|
36650
|
+
const orgName = typeof flags.org === "string" ? flags.org : undefined;
|
|
36651
|
+
if (!orgName) {
|
|
36652
|
+
usageError("org.renamed subscriptions are org-scoped — pass --org <org> (not --repo)", "wh sub create org-rename-hook --org myorg --event org.renamed --webhook-url https://example.com/hook");
|
|
36653
|
+
}
|
|
36654
|
+
rejectCommitFlags(flags, eventType);
|
|
36655
|
+
const result2 = await ctx.client.subscription.create({
|
|
36656
|
+
orgName,
|
|
36657
|
+
name,
|
|
36658
|
+
eventType,
|
|
36659
|
+
kind,
|
|
36660
|
+
webhookUrl,
|
|
36661
|
+
...renameExtras
|
|
36662
|
+
});
|
|
36663
|
+
writeOutput(ctx, result2, () => {
|
|
36664
|
+
const c = ctx.colors;
|
|
36665
|
+
ctx.status(`${c.green}Created subscription${c.reset} ${c.cyan}${name}${c.reset} on org ${c.cyan}${orgName}${c.reset} (org.renamed)`);
|
|
36666
|
+
});
|
|
36667
|
+
return;
|
|
36668
|
+
}
|
|
36669
|
+
const { org, repo } = resolveRepoContext(ctx);
|
|
36670
|
+
if (eventType === "repo.renamed") {
|
|
36671
|
+
rejectCommitFlags(flags, eventType);
|
|
36672
|
+
const result2 = await ctx.client.subscription.create({
|
|
36673
|
+
orgName: org,
|
|
36674
|
+
repoName: repo,
|
|
36675
|
+
name,
|
|
36676
|
+
eventType,
|
|
36677
|
+
kind,
|
|
36678
|
+
webhookUrl,
|
|
36679
|
+
...renameExtras
|
|
36680
|
+
});
|
|
36681
|
+
writeOutput(ctx, result2, () => {
|
|
36682
|
+
const c = ctx.colors;
|
|
36683
|
+
ctx.status(`${c.green}Created subscription${c.reset} ${c.cyan}${name}${c.reset} on ${c.cyan}${org}/${repo}${c.reset} (repo.renamed)`);
|
|
36684
|
+
});
|
|
36685
|
+
return;
|
|
36686
|
+
}
|
|
36687
|
+
const createArgs = buildSubscriptionMutationArgs(flags, usage, example);
|
|
36688
|
+
const sourceRepoRef = typeof flags.source === "string" ? flags.source : undefined;
|
|
36595
36689
|
const result = await ctx.client.subscription.create({
|
|
36596
36690
|
orgName: org,
|
|
36597
36691
|
repoName: repo,
|
|
@@ -36611,24 +36705,24 @@ var handleCreate7 = async (ctx, { flags, args }) => {
|
|
|
36611
36705
|
};
|
|
36612
36706
|
var handleUpdate4 = async (ctx, { flags, args }) => {
|
|
36613
36707
|
const name = args[0] ?? flags.name;
|
|
36614
|
-
const usage = "Usage: wh sub update <name> --repo org/repo [options]";
|
|
36708
|
+
const usage = "Usage: wh sub update <name> (--repo org/repo | --org org) [options]";
|
|
36615
36709
|
const example = "wh sub update signal-hook --repo myorg/myrepo";
|
|
36616
36710
|
if (!name) {
|
|
36617
36711
|
usageError(usage, example);
|
|
36618
36712
|
}
|
|
36619
36713
|
rejectRemovedCronFlags(flags);
|
|
36620
|
-
const
|
|
36621
|
-
const
|
|
36714
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36715
|
+
const scopeArg = scope.repoName ? `--repo ${scopeLabel(scope)}` : `--org ${scope.orgName}`;
|
|
36716
|
+
const existing = await ctx.client.subscription.get({ ...scope, name });
|
|
36622
36717
|
if (existing.kind !== "webhook") {
|
|
36623
|
-
throw new CliError(2 /* UserInput */, "USER_INPUT", `Subscription "${name}" has kind "${existing.kind}", which is no longer supported and cannot be updated`, undefined, `Delete it with: wh sub delete ${name}
|
|
36718
|
+
throw new CliError(2 /* UserInput */, "USER_INPUT", `Subscription "${name}" has kind "${existing.kind}", which is no longer supported and cannot be updated`, undefined, `Delete it with: wh sub delete ${name} ${scopeArg}`);
|
|
36624
36719
|
}
|
|
36625
36720
|
if (flags.kind && flags.kind !== existing.kind) {
|
|
36626
36721
|
usageError(usage, example);
|
|
36627
36722
|
}
|
|
36628
36723
|
const patchArgs = buildSubscriptionPatchArgs(flags, usage, example);
|
|
36629
36724
|
const result = await ctx.client.subscription.update({
|
|
36630
|
-
|
|
36631
|
-
repoName: repo,
|
|
36725
|
+
...scope,
|
|
36632
36726
|
name,
|
|
36633
36727
|
...patchArgs.shapeName != null ? { shapeName: patchArgs.shapeName } : {},
|
|
36634
36728
|
...patchArgs.filterJson != null ? {
|
|
@@ -36642,17 +36736,17 @@ var handleUpdate4 = async (ctx, { flags, args }) => {
|
|
|
36642
36736
|
});
|
|
36643
36737
|
writeOutput(ctx, result, () => {
|
|
36644
36738
|
const c = ctx.colors;
|
|
36645
|
-
ctx.status(`${c.green}Updated subscription${c.reset} ${c.cyan}${name}${c.reset} on ${c.cyan}${
|
|
36739
|
+
ctx.status(`${c.green}Updated subscription${c.reset} ${c.cyan}${name}${c.reset} on ${c.cyan}${scopeLabel(scope)}${c.reset}`);
|
|
36646
36740
|
});
|
|
36647
36741
|
};
|
|
36648
36742
|
var handleView8 = async (ctx, { args, flags }) => {
|
|
36649
36743
|
const name = args[0];
|
|
36650
36744
|
if (!name) {
|
|
36651
|
-
usageError("Usage: wh sub view <name> [--show-secrets]
|
|
36745
|
+
usageError("Usage: wh sub view <name> [--show-secrets] (--repo org/repo | --org org)", "wh sub view signal-hook --repo myorg/myrepo");
|
|
36652
36746
|
}
|
|
36653
|
-
const
|
|
36654
|
-
const sub = await ctx.client.subscription.get(
|
|
36655
|
-
const revealed = flags["show-secrets"] ? await ctx.client.subscription.reveal(
|
|
36747
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36748
|
+
const sub = await ctx.client.subscription.get({ ...scope, name });
|
|
36749
|
+
const revealed = flags["show-secrets"] ? await ctx.client.subscription.reveal({ ...scope, name }) : undefined;
|
|
36656
36750
|
writeOutput(ctx, revealed ? { ...sub, ...revealed } : sub, () => {
|
|
36657
36751
|
const c = ctx.colors;
|
|
36658
36752
|
ctx.out(`${c.bold}${sub.name}${c.reset}`);
|
|
@@ -36679,16 +36773,17 @@ var handleView8 = async (ctx, { args, flags }) => {
|
|
|
36679
36773
|
});
|
|
36680
36774
|
};
|
|
36681
36775
|
var handleList7 = async (ctx, { flags }) => {
|
|
36682
|
-
const
|
|
36683
|
-
const
|
|
36776
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36777
|
+
const label = scopeLabel(scope);
|
|
36778
|
+
const all = await ctx.client.subscription.list(scope);
|
|
36684
36779
|
const items = all.slice(0, flags.limit ?? all.length);
|
|
36685
36780
|
writePageOutput(ctx, items, { limit: flags.limit ?? all.length, nextCursor: null }, () => {
|
|
36686
36781
|
const c = ctx.colors;
|
|
36687
36782
|
if (!items.length) {
|
|
36688
|
-
ctx.status(`${c.dim}No subscriptions in ${
|
|
36783
|
+
ctx.status(`${c.dim}No subscriptions in ${label}${c.reset}`);
|
|
36689
36784
|
return;
|
|
36690
36785
|
}
|
|
36691
|
-
ctx.out(`${c.bold}Subscriptions:${c.reset} ${c.cyan}${
|
|
36786
|
+
ctx.out(`${c.bold}Subscriptions:${c.reset} ${c.cyan}${label}${c.reset}`);
|
|
36692
36787
|
for (const sub of items) {
|
|
36693
36788
|
const active = sub.active ? `${c.green}active` : `${c.yellow}paused`;
|
|
36694
36789
|
let line = ` ${c.cyan}${sub.name}${c.reset} ${c.dim}[${sub.kind}]${c.reset} ${active}${c.reset}`;
|
|
@@ -36699,37 +36794,37 @@ var handleList7 = async (ctx, { flags }) => {
|
|
|
36699
36794
|
}
|
|
36700
36795
|
});
|
|
36701
36796
|
};
|
|
36702
|
-
var handlePause = async (ctx, { args }) => {
|
|
36797
|
+
var handlePause = async (ctx, { args, flags }) => {
|
|
36703
36798
|
const name = args[0];
|
|
36704
36799
|
if (!name) {
|
|
36705
|
-
usageError("Usage: wh sub pause <name>
|
|
36800
|
+
usageError("Usage: wh sub pause <name> (--repo org/repo | --org org)", "wh sub pause signal-hook --repo myorg/myrepo");
|
|
36706
36801
|
}
|
|
36707
|
-
const
|
|
36708
|
-
const result = await ctx.client.subscription.pause(
|
|
36802
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36803
|
+
const result = await ctx.client.subscription.pause({ ...scope, name });
|
|
36709
36804
|
writeOutput(ctx, result, () => {
|
|
36710
36805
|
const c = ctx.colors;
|
|
36711
36806
|
ctx.status(`${c.yellow}Paused subscription${c.reset} ${c.cyan}${name}${c.reset}`);
|
|
36712
36807
|
});
|
|
36713
36808
|
};
|
|
36714
|
-
var handleResume = async (ctx, { args }) => {
|
|
36809
|
+
var handleResume = async (ctx, { args, flags }) => {
|
|
36715
36810
|
const name = args[0];
|
|
36716
36811
|
if (!name) {
|
|
36717
|
-
usageError("Usage: wh sub resume <name>
|
|
36812
|
+
usageError("Usage: wh sub resume <name> (--repo org/repo | --org org)", "wh sub resume signal-hook --repo myorg/myrepo");
|
|
36718
36813
|
}
|
|
36719
|
-
const
|
|
36720
|
-
const result = await ctx.client.subscription.resume(
|
|
36814
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36815
|
+
const result = await ctx.client.subscription.resume({ ...scope, name });
|
|
36721
36816
|
writeOutput(ctx, result, () => {
|
|
36722
36817
|
const c = ctx.colors;
|
|
36723
36818
|
ctx.status(`${c.green}Resumed subscription${c.reset} ${c.cyan}${name}${c.reset}`);
|
|
36724
36819
|
});
|
|
36725
36820
|
};
|
|
36726
|
-
var handleDelete3 = async (ctx, { args }) => {
|
|
36821
|
+
var handleDelete3 = async (ctx, { args, flags }) => {
|
|
36727
36822
|
const name = args[0];
|
|
36728
36823
|
if (!name) {
|
|
36729
|
-
usageError("Usage: wh sub delete <name>
|
|
36824
|
+
usageError("Usage: wh sub delete <name> (--repo org/repo | --org org)", "wh sub delete signal-hook --repo myorg/myrepo");
|
|
36730
36825
|
}
|
|
36731
|
-
const
|
|
36732
|
-
const result = await ctx.client.subscription.remove(
|
|
36826
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36827
|
+
const result = await ctx.client.subscription.remove({ ...scope, name });
|
|
36733
36828
|
writeOutput(ctx, result, () => {
|
|
36734
36829
|
const c = ctx.colors;
|
|
36735
36830
|
ctx.status(`${c.red}Deleted subscription${c.reset} ${c.cyan}${name}${c.reset}`);
|
|
@@ -36738,28 +36833,36 @@ var handleDelete3 = async (ctx, { args }) => {
|
|
|
36738
36833
|
var bindFlags = {
|
|
36739
36834
|
credentials: flag.string({
|
|
36740
36835
|
description: "Name of the credential set to bind"
|
|
36741
|
-
})
|
|
36836
|
+
}),
|
|
36837
|
+
org: orgScopeFlag
|
|
36742
36838
|
};
|
|
36743
36839
|
var handleBind = async (ctx, { flags, args }) => {
|
|
36744
36840
|
const name = args[0];
|
|
36745
36841
|
const setName = flags.credentials;
|
|
36746
36842
|
if (!name || !setName) {
|
|
36747
|
-
usageError("Usage: wh sub bind <name> --credentials <setName>
|
|
36843
|
+
usageError("Usage: wh sub bind <name> --credentials <setName> (--repo org/repo | --org org)", "wh sub bind signal-hook --credentials webhook-keys --repo myorg/myrepo");
|
|
36748
36844
|
}
|
|
36749
|
-
const
|
|
36750
|
-
const result = await ctx.client.subscription.bindCredentials(
|
|
36845
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36846
|
+
const result = await ctx.client.subscription.bindCredentials({
|
|
36847
|
+
...scope,
|
|
36848
|
+
subscriptionName: name,
|
|
36849
|
+
credentialSetName: setName
|
|
36850
|
+
});
|
|
36751
36851
|
writeOutput(ctx, result, () => {
|
|
36752
36852
|
const c = ctx.colors;
|
|
36753
36853
|
ctx.status(`${c.green}Bound${c.reset} ${c.cyan}${setName}${c.reset} to ${c.cyan}${name}${c.reset}`);
|
|
36754
36854
|
});
|
|
36755
36855
|
};
|
|
36756
|
-
var handleUnbind = async (ctx, { args }) => {
|
|
36856
|
+
var handleUnbind = async (ctx, { args, flags }) => {
|
|
36757
36857
|
const name = args[0];
|
|
36758
36858
|
if (!name) {
|
|
36759
|
-
usageError("Usage: wh sub unbind <name>
|
|
36859
|
+
usageError("Usage: wh sub unbind <name> (--repo org/repo | --org org)", "wh sub unbind signal-hook --repo myorg/myrepo");
|
|
36760
36860
|
}
|
|
36761
|
-
const
|
|
36762
|
-
const result = await ctx.client.subscription.unbindCredentials(
|
|
36861
|
+
const scope = resolveSubScope(ctx, flags);
|
|
36862
|
+
const result = await ctx.client.subscription.unbindCredentials({
|
|
36863
|
+
...scope,
|
|
36864
|
+
subscriptionName: name
|
|
36865
|
+
});
|
|
36763
36866
|
writeOutput(ctx, result, () => {
|
|
36764
36867
|
const c = ctx.colors;
|
|
36765
36868
|
ctx.status(`${c.yellow}Unbound${c.reset} credentials from ${c.cyan}${name}${c.reset}`);
|
|
@@ -36844,6 +36947,12 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36844
36947
|
"# Subscribe to shape retracts only",
|
|
36845
36948
|
` $ wh sub create shape-retracts --repo myorg/myrepo --kind webhook --filter '{"all":[{"kind":"shape"},{"operation":"retract"}]}' --webhook-url https://hooks.example.com/shapes`,
|
|
36846
36949
|
"",
|
|
36950
|
+
"# Subscribe to repo renames (metadata event — no shape/filter)",
|
|
36951
|
+
" $ wh sub create repo-rename-hook --repo myorg/myrepo --event repo.renamed --webhook-url https://example.com/hook",
|
|
36952
|
+
"",
|
|
36953
|
+
"# Subscribe to org renames (org-scoped — use --org, not --repo)",
|
|
36954
|
+
" $ wh sub create org-rename-hook --org myorg --event org.renamed --webhook-url https://example.com/hook",
|
|
36955
|
+
"",
|
|
36847
36956
|
"# Webhook auth: create a credential set with WEBHOOK_* keys, then bind it to the subscription.",
|
|
36848
36957
|
"# See `wh credential set --help` for supported key names and `wh sub bind --help`.",
|
|
36849
36958
|
" $ wh credential create webhook-keys --repo myorg/myrepo",
|
|
@@ -36860,7 +36969,9 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36860
36969
|
flags: updateFlags4,
|
|
36861
36970
|
examples: [
|
|
36862
36971
|
"# Update only the webhook URL",
|
|
36863
|
-
" $ wh sub update signal-hook --repo myorg/myrepo --webhook-url https://example.com/v2/hook"
|
|
36972
|
+
" $ wh sub update signal-hook --repo myorg/myrepo --webhook-url https://example.com/v2/hook",
|
|
36973
|
+
"# Repoint an org-scoped (org.renamed) rename hook in place",
|
|
36974
|
+
" $ wh sub update org-rename-hook --org myorg --webhook-url https://example.com/v2/hook"
|
|
36864
36975
|
],
|
|
36865
36976
|
handler: handleUpdate4
|
|
36866
36977
|
},
|
|
@@ -36872,7 +36983,9 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36872
36983
|
flags: viewFlags5,
|
|
36873
36984
|
examples: [
|
|
36874
36985
|
"wh sub view signal-hook --repo myorg/myrepo",
|
|
36875
|
-
"wh sub view signal-hook --show-secrets --repo myorg/myrepo"
|
|
36986
|
+
"wh sub view signal-hook --show-secrets --repo myorg/myrepo",
|
|
36987
|
+
"# Org-scoped (org.renamed) subscription",
|
|
36988
|
+
" $ wh sub view org-rename-hook --org myorg"
|
|
36876
36989
|
],
|
|
36877
36990
|
handler: handleView8
|
|
36878
36991
|
},
|
|
@@ -36882,7 +36995,12 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36882
36995
|
summary: "List all subscriptions",
|
|
36883
36996
|
args: "",
|
|
36884
36997
|
flags: listFlags5,
|
|
36885
|
-
examples: [
|
|
36998
|
+
examples: [
|
|
36999
|
+
"wh sub list --repo myorg/myrepo",
|
|
37000
|
+
"wh sub list --limit 10",
|
|
37001
|
+
"# Org-scoped (org.renamed) subscriptions",
|
|
37002
|
+
" $ wh sub list --org myorg"
|
|
37003
|
+
],
|
|
36886
37004
|
handler: handleList7
|
|
36887
37005
|
},
|
|
36888
37006
|
log: {
|
|
@@ -36922,7 +37040,12 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36922
37040
|
prime: true,
|
|
36923
37041
|
summary: "Pause a subscription",
|
|
36924
37042
|
args: "<name>",
|
|
36925
|
-
|
|
37043
|
+
flags: scopeFlags,
|
|
37044
|
+
examples: [
|
|
37045
|
+
"wh sub pause signal-hook --repo myorg/myrepo",
|
|
37046
|
+
"# Org-scoped (org.renamed) subscription",
|
|
37047
|
+
" $ wh sub pause org-rename-hook --org myorg"
|
|
37048
|
+
],
|
|
36926
37049
|
handler: handlePause
|
|
36927
37050
|
},
|
|
36928
37051
|
resume: {
|
|
@@ -36930,7 +37053,11 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36930
37053
|
prime: true,
|
|
36931
37054
|
summary: "Resume a paused subscription",
|
|
36932
37055
|
args: "<name>",
|
|
36933
|
-
|
|
37056
|
+
flags: scopeFlags,
|
|
37057
|
+
examples: [
|
|
37058
|
+
"wh sub resume signal-hook --repo myorg/myrepo",
|
|
37059
|
+
" $ wh sub resume org-rename-hook --org myorg"
|
|
37060
|
+
],
|
|
36934
37061
|
handler: handleResume
|
|
36935
37062
|
},
|
|
36936
37063
|
bind: {
|
|
@@ -36941,7 +37068,9 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36941
37068
|
flags: bindFlags,
|
|
36942
37069
|
examples: [
|
|
36943
37070
|
"# Bind credentials to inject auth headers on webhook delivery",
|
|
36944
|
-
" $ wh sub bind signal-hook --credentials webhook-keys --repo myorg/myrepo"
|
|
37071
|
+
" $ wh sub bind signal-hook --credentials webhook-keys --repo myorg/myrepo",
|
|
37072
|
+
"# Org-scoped (org.renamed) subscription + org-scoped credential set",
|
|
37073
|
+
" $ wh sub bind org-rename-hook --credentials org-webhook-keys --org myorg"
|
|
36945
37074
|
],
|
|
36946
37075
|
handler: handleBind
|
|
36947
37076
|
},
|
|
@@ -36950,7 +37079,11 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36950
37079
|
prime: true,
|
|
36951
37080
|
summary: "Remove credential binding from a subscription",
|
|
36952
37081
|
args: "<name>",
|
|
36953
|
-
|
|
37082
|
+
flags: scopeFlags,
|
|
37083
|
+
examples: [
|
|
37084
|
+
"wh sub unbind signal-hook --repo myorg/myrepo",
|
|
37085
|
+
" $ wh sub unbind org-rename-hook --org myorg"
|
|
37086
|
+
],
|
|
36954
37087
|
handler: handleUnbind
|
|
36955
37088
|
},
|
|
36956
37089
|
delete: {
|
|
@@ -36958,7 +37091,11 @@ var SUB_DOMAIN = defineDomain({
|
|
|
36958
37091
|
prime: true,
|
|
36959
37092
|
summary: "Delete a subscription",
|
|
36960
37093
|
args: "<name>",
|
|
36961
|
-
|
|
37094
|
+
flags: scopeFlags,
|
|
37095
|
+
examples: [
|
|
37096
|
+
"wh sub delete signal-hook --repo myorg/myrepo",
|
|
37097
|
+
" $ wh sub delete org-rename-hook --org myorg"
|
|
37098
|
+
],
|
|
36962
37099
|
handler: handleDelete3
|
|
36963
37100
|
}
|
|
36964
37101
|
}
|
|
@@ -37714,7 +37851,7 @@ var GLOBAL_FLAGS2 = [
|
|
|
37714
37851
|
{
|
|
37715
37852
|
long: "live",
|
|
37716
37853
|
type: "boolean",
|
|
37717
|
-
description: "
|
|
37854
|
+
description: "Live mode (polls for updates)"
|
|
37718
37855
|
},
|
|
37719
37856
|
{
|
|
37720
37857
|
long: "max-updates",
|
|
@@ -38737,7 +38874,7 @@ function resolveLogLevel(flags, env) {
|
|
|
38737
38874
|
// package.json
|
|
38738
38875
|
var package_default3 = {
|
|
38739
38876
|
name: "@warmhub/cli",
|
|
38740
|
-
version: "0.
|
|
38877
|
+
version: "0.59.0",
|
|
38741
38878
|
private: false,
|
|
38742
38879
|
type: "module",
|
|
38743
38880
|
description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -39378,4 +39515,4 @@ if (!updateCheckSuppressedByArgv && shouldRunUpdateCheck(updateEligibility)) {
|
|
|
39378
39515
|
var interceptedExitCode = await maybeHandleComponentShellBoundary(dispatchArgv);
|
|
39379
39516
|
process.exitCode = interceptedExitCode === undefined ? await runCli(dispatchArgv, { version: package_default3.version }) : interceptedExitCode;
|
|
39380
39517
|
|
|
39381
|
-
//# debugId=
|
|
39518
|
+
//# debugId=133777AA8F34C0BB64756E2164756E21
|
package/package.json
CHANGED