@warmhub/cli 0.149.0 → 0.150.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 +124 -160
- package/package.json +1 -1
package/dist/wh.js
CHANGED
|
@@ -18474,6 +18474,55 @@ function decodeBytes(encoded) {
|
|
|
18474
18474
|
return bytes;
|
|
18475
18475
|
}
|
|
18476
18476
|
|
|
18477
|
+
// ../../packages/rules/src/wref-version.ts
|
|
18478
|
+
function splitVersionSelector(value) {
|
|
18479
|
+
const allMatch = value.match(/^(.+)@ALL$/i);
|
|
18480
|
+
if (allMatch) {
|
|
18481
|
+
const base = allMatch[1];
|
|
18482
|
+
if (!base) {
|
|
18483
|
+
throw new Error(`Invalid versioned wref "${value}"`);
|
|
18484
|
+
}
|
|
18485
|
+
return {
|
|
18486
|
+
base,
|
|
18487
|
+
version: { type: "all" }
|
|
18488
|
+
};
|
|
18489
|
+
}
|
|
18490
|
+
const headMatch = value.match(/^(.+)@HEAD$/i);
|
|
18491
|
+
if (headMatch) {
|
|
18492
|
+
const base = headMatch[1];
|
|
18493
|
+
if (!base) {
|
|
18494
|
+
throw new Error(`Invalid versioned wref "${value}"`);
|
|
18495
|
+
}
|
|
18496
|
+
return {
|
|
18497
|
+
base,
|
|
18498
|
+
version: { type: "head" }
|
|
18499
|
+
};
|
|
18500
|
+
}
|
|
18501
|
+
const pinnedMatch = value.match(/^(.+)@v(\d+)$/);
|
|
18502
|
+
if (pinnedMatch) {
|
|
18503
|
+
const base = pinnedMatch[1];
|
|
18504
|
+
const rawVersion = pinnedMatch[2];
|
|
18505
|
+
if (!base || !rawVersion) {
|
|
18506
|
+
throw new Error(`Invalid versioned wref "${value}"`);
|
|
18507
|
+
}
|
|
18508
|
+
const n = Number.parseInt(rawVersion, 10);
|
|
18509
|
+
if (n < 1) {
|
|
18510
|
+
throw new Error(`Invalid versioned wref "${value}": version must be >= 1`);
|
|
18511
|
+
}
|
|
18512
|
+
if (!Number.isSafeInteger(n)) {
|
|
18513
|
+
throw new Error(`Invalid versioned wref "${value}": version is too large to represent exactly`);
|
|
18514
|
+
}
|
|
18515
|
+
return {
|
|
18516
|
+
base,
|
|
18517
|
+
version: { type: "pinned", n }
|
|
18518
|
+
};
|
|
18519
|
+
}
|
|
18520
|
+
return {
|
|
18521
|
+
base: value,
|
|
18522
|
+
version: { type: "unspecified" }
|
|
18523
|
+
};
|
|
18524
|
+
}
|
|
18525
|
+
|
|
18477
18526
|
// ../../packages/rules/src/durable-id.ts
|
|
18478
18527
|
var THING_SCHEME = 1;
|
|
18479
18528
|
var REPO_SCHEME = 2;
|
|
@@ -18541,15 +18590,18 @@ function decodeDurableId(token) {
|
|
|
18541
18590
|
function isDurableId(token) {
|
|
18542
18591
|
return decodeDurableId(token) !== null;
|
|
18543
18592
|
}
|
|
18544
|
-
var VERSION_SELECTOR_RE = /^(?:v0*[1-9]\d*|[Hh][Ee][Aa][Dd]|[Aa][Ll][Ll])$/;
|
|
18545
18593
|
function parseDurableReferenceToken(raw) {
|
|
18546
|
-
|
|
18547
|
-
|
|
18548
|
-
|
|
18594
|
+
let split;
|
|
18595
|
+
try {
|
|
18596
|
+
split = splitVersionSelector(raw);
|
|
18597
|
+
} catch {
|
|
18598
|
+
return null;
|
|
18599
|
+
}
|
|
18600
|
+
const { base: core, version } = split;
|
|
18549
18601
|
if (decodeDurableId(core) === null)
|
|
18550
18602
|
return null;
|
|
18551
18603
|
const stripped = core.startsWith("wh:") ? core.slice(3) : core;
|
|
18552
|
-
return { durableId: stripped.toUpperCase(),
|
|
18604
|
+
return { durableId: stripped.toUpperCase(), version };
|
|
18553
18605
|
}
|
|
18554
18606
|
function decodeRepoDurableId(token) {
|
|
18555
18607
|
const payload = unpackToken(REPO_SCHEME, token, UUID_BYTES);
|
|
@@ -18647,7 +18699,7 @@ function stripWrefVersion(wref) {
|
|
|
18647
18699
|
return wref.replace(/@(?:v\d+|[Hh][Ee][Aa][Dd]|[Aa][Ll][Ll])$/, "");
|
|
18648
18700
|
}
|
|
18649
18701
|
function parseWref(raw) {
|
|
18650
|
-
const { base: durableBase, version: durableVersion } =
|
|
18702
|
+
const { base: durableBase, version: durableVersion } = splitVersionSelector(raw);
|
|
18651
18703
|
const durable = decodeDurableId(durableBase);
|
|
18652
18704
|
if (durable) {
|
|
18653
18705
|
return {
|
|
@@ -18685,7 +18737,7 @@ function isForeignShapeWref(parts, source) {
|
|
|
18685
18737
|
}
|
|
18686
18738
|
function parseCanonicalWref(raw) {
|
|
18687
18739
|
const body = raw.slice(3);
|
|
18688
|
-
const { base, version } =
|
|
18740
|
+
const { base, version } = splitVersionSelector(body);
|
|
18689
18741
|
const segments = base.split("/");
|
|
18690
18742
|
if (segments.length < 3) {
|
|
18691
18743
|
throw new Error(`Invalid canonical wref "${raw}": expected org/repo/name`);
|
|
@@ -18698,57 +18750,10 @@ function parseCanonicalWref(raw) {
|
|
|
18698
18750
|
return { kind: "canonical-thing", org, repo, name, version };
|
|
18699
18751
|
}
|
|
18700
18752
|
function parseLocalWref(raw) {
|
|
18701
|
-
const { base, version } =
|
|
18753
|
+
const { base, version } = splitVersionSelector(raw);
|
|
18702
18754
|
parseThingName(base, "thing name");
|
|
18703
18755
|
return { kind: "local-thing", name: base, version };
|
|
18704
18756
|
}
|
|
18705
|
-
function extractVersion(value) {
|
|
18706
|
-
const allMatch = value.match(/^(.+)@ALL$/i);
|
|
18707
|
-
if (allMatch) {
|
|
18708
|
-
const base = allMatch[1];
|
|
18709
|
-
if (!base) {
|
|
18710
|
-
throw new Error(`Invalid versioned wref "${value}"`);
|
|
18711
|
-
}
|
|
18712
|
-
return {
|
|
18713
|
-
base,
|
|
18714
|
-
version: { type: "all" }
|
|
18715
|
-
};
|
|
18716
|
-
}
|
|
18717
|
-
const headMatch = value.match(/^(.+)@HEAD$/i);
|
|
18718
|
-
if (headMatch) {
|
|
18719
|
-
const base = headMatch[1];
|
|
18720
|
-
if (!base) {
|
|
18721
|
-
throw new Error(`Invalid versioned wref "${value}"`);
|
|
18722
|
-
}
|
|
18723
|
-
return {
|
|
18724
|
-
base,
|
|
18725
|
-
version: { type: "head" }
|
|
18726
|
-
};
|
|
18727
|
-
}
|
|
18728
|
-
const pinnedMatch = value.match(/^(.+)@v(\d+)$/);
|
|
18729
|
-
if (pinnedMatch) {
|
|
18730
|
-
const base = pinnedMatch[1];
|
|
18731
|
-
const rawVersion = pinnedMatch[2];
|
|
18732
|
-
if (!base || !rawVersion) {
|
|
18733
|
-
throw new Error(`Invalid versioned wref "${value}"`);
|
|
18734
|
-
}
|
|
18735
|
-
const n = Number.parseInt(rawVersion, 10);
|
|
18736
|
-
if (n < 1) {
|
|
18737
|
-
throw new Error(`Invalid versioned wref "${value}": version must be >= 1`);
|
|
18738
|
-
}
|
|
18739
|
-
if (!Number.isSafeInteger(n)) {
|
|
18740
|
-
throw new Error(`Invalid versioned wref "${value}": version is too large to represent exactly`);
|
|
18741
|
-
}
|
|
18742
|
-
return {
|
|
18743
|
-
base,
|
|
18744
|
-
version: { type: "pinned", n }
|
|
18745
|
-
};
|
|
18746
|
-
}
|
|
18747
|
-
return {
|
|
18748
|
-
base: value,
|
|
18749
|
-
version: { type: "unspecified" }
|
|
18750
|
-
};
|
|
18751
|
-
}
|
|
18752
18757
|
|
|
18753
18758
|
// ../../packages/rules/src/commit-types.ts
|
|
18754
18759
|
var COMMIT_OPERATIONS = [
|
|
@@ -46860,7 +46865,7 @@ function createStreamingSubmissionHandle(input, deps) {
|
|
|
46860
46865
|
// ../../packages/sdk-ts/package.json
|
|
46861
46866
|
var package_default = {
|
|
46862
46867
|
name: "@warmhub/sdk-ts",
|
|
46863
|
-
version: "0.
|
|
46868
|
+
version: "0.148.0",
|
|
46864
46869
|
private: false,
|
|
46865
46870
|
type: "module",
|
|
46866
46871
|
description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -54459,7 +54464,7 @@ function styleDurableId(token, c) {
|
|
|
54459
54464
|
const parsed = parseDurableReferenceToken(token);
|
|
54460
54465
|
if (parsed) {
|
|
54461
54466
|
const prefix = token.startsWith("wh:") ? "wh:" : "";
|
|
54462
|
-
const selector = parsed.
|
|
54467
|
+
const selector = parsed.version.type === "unspecified" ? "" : token.slice(token.lastIndexOf("@"));
|
|
54463
54468
|
const core2 = token.slice(prefix.length, token.length - selector.length);
|
|
54464
54469
|
return `${dimPart(prefix, c)}${styleBands(core2, THING_BANDS, c)}${dimPart(selector, c)}`;
|
|
54465
54470
|
}
|
|
@@ -54494,7 +54499,7 @@ function labeledRef(c, value, label) {
|
|
|
54494
54499
|
if (!parsed)
|
|
54495
54500
|
return null;
|
|
54496
54501
|
const styled = styleDurableId(value, c);
|
|
54497
|
-
const pin = parsed.
|
|
54502
|
+
const pin = parsed.version.type === "pinned" ? parsed.version.n : undefined;
|
|
54498
54503
|
return `${pinnedWref(c, label, pin)} ${c.dim}(${c.reset}${styled}${c.dim})${c.reset}`;
|
|
54499
54504
|
}
|
|
54500
54505
|
function refDisplay(c, value, decorations, version2) {
|
|
@@ -68969,7 +68974,6 @@ var createFlags9 = {
|
|
|
68969
68974
|
"webhook-url": flag.string({
|
|
68970
68975
|
description: "Webhook destination URL (required)"
|
|
68971
68976
|
}),
|
|
68972
|
-
url: flag.string({ description: "Alias for --webhook-url" }),
|
|
68973
68977
|
"fallback-webhook-url": flag.string({
|
|
68974
68978
|
description: "Optional fallback webhook URL for terminal action failures"
|
|
68975
68979
|
}),
|
|
@@ -68992,7 +68996,6 @@ var updateFlags4 = {
|
|
|
68992
68996
|
"webhook-url": flag.string({
|
|
68993
68997
|
description: "Webhook destination URL"
|
|
68994
68998
|
}),
|
|
68995
|
-
url: createFlags9.url,
|
|
68996
68999
|
"fallback-webhook-url": createFlags9["fallback-webhook-url"],
|
|
68997
69000
|
"clear-fallback-webhook-url": flag.boolean({
|
|
68998
69001
|
description: "Clear the fallback webhook URL"
|
|
@@ -69034,11 +69037,6 @@ function parseFilterJson(raw, usage, example) {
|
|
|
69034
69037
|
}
|
|
69035
69038
|
return parseJsonObject(raw, "--filter");
|
|
69036
69039
|
}
|
|
69037
|
-
function parseOptionalFilterJson(raw, usage, example) {
|
|
69038
|
-
if (raw === undefined)
|
|
69039
|
-
return;
|
|
69040
|
-
return parseFilterJson(raw, usage, example);
|
|
69041
|
-
}
|
|
69042
69040
|
function filterIsShapeKindOnly(node) {
|
|
69043
69041
|
const k = node.kind;
|
|
69044
69042
|
if (k === "shape") {
|
|
@@ -69069,7 +69067,7 @@ function parseKind(raw, usage, example) {
|
|
|
69069
69067
|
if (raw === "cron") {
|
|
69070
69068
|
cronRemovedError();
|
|
69071
69069
|
}
|
|
69072
|
-
usageError(usage, example);
|
|
69070
|
+
return usageError(usage, example);
|
|
69073
69071
|
}
|
|
69074
69072
|
function parseEventType(raw, _usage, example) {
|
|
69075
69073
|
if (raw === undefined) {
|
|
@@ -69078,63 +69076,37 @@ function parseEventType(raw, _usage, example) {
|
|
|
69078
69076
|
const parsed = SUBSCRIBABLE_EVENT_TYPES.find((candidate) => candidate === raw);
|
|
69079
69077
|
if (parsed)
|
|
69080
69078
|
return parsed;
|
|
69081
|
-
usageError(`--event must be one of: ${SUBSCRIBABLE_EVENT_TYPES.join(", ")}`, example);
|
|
69079
|
+
return usageError(`--event must be one of: ${SUBSCRIBABLE_EVENT_TYPES.join(", ")}`, example);
|
|
69082
69080
|
}
|
|
69083
69081
|
function buildSubscriptionPatchArgs(flags, usage, example) {
|
|
69084
|
-
|
|
69085
|
-
|
|
69086
|
-
|
|
69087
|
-
|
|
69088
|
-
|
|
69089
|
-
|
|
69090
|
-
}
|
|
69091
|
-
const webhookUrl = typeof flags["webhook-url"] === "string" ? flags["webhook-url"] : typeof flags.url === "string" ? flags.url : undefined;
|
|
69092
|
-
if (webhookUrl) {
|
|
69093
|
-
args.webhookUrl = webhookUrl;
|
|
69094
|
-
}
|
|
69095
|
-
if (flags["clear-fallback-webhook-url"] === true) {
|
|
69096
|
-
args.fallbackWebhookUrl = null;
|
|
69097
|
-
} else if (typeof flags["fallback-webhook-url"] === "string") {
|
|
69098
|
-
args.fallbackWebhookUrl = flags["fallback-webhook-url"];
|
|
69099
|
-
}
|
|
69100
|
-
if (flags["allow-trace-reentry"] === true) {
|
|
69101
|
-
args.allowTraceReentry = true;
|
|
69102
|
-
}
|
|
69103
|
-
return args;
|
|
69082
|
+
return {
|
|
69083
|
+
...flags.on ? { shapeName: flags.on } : {},
|
|
69084
|
+
...flags.filter ? { filterJson: parseFilterJson(flags.filter, usage, example) } : {},
|
|
69085
|
+
...flags["webhook-url"] ? { webhookUrl: flags["webhook-url"] } : {},
|
|
69086
|
+
...flags["clear-fallback-webhook-url"] ? { fallbackWebhookUrl: null } : flags["fallback-webhook-url"] !== undefined ? { fallbackWebhookUrl: flags["fallback-webhook-url"] } : {},
|
|
69087
|
+
...flags["allow-trace-reentry"] ? { allowTraceReentry: true } : {}
|
|
69088
|
+
};
|
|
69104
69089
|
}
|
|
69105
|
-
function
|
|
69106
|
-
const
|
|
69107
|
-
|
|
69108
|
-
|
|
69109
|
-
if (typeof flags.on === "string" && flags.on) {
|
|
69110
|
-
mutationArgs.shapeName = flags.on;
|
|
69111
|
-
} else if (!isShapeLifecycleFilter) {
|
|
69112
|
-
usageError(usage, example);
|
|
69090
|
+
function buildSubscriptionMatcherArgs(flags, usage, example) {
|
|
69091
|
+
const filterJson = parseFilterJson(flags.filter, usage, example);
|
|
69092
|
+
if (flags.on) {
|
|
69093
|
+
return { filterJson, shapeName: flags.on };
|
|
69113
69094
|
}
|
|
69114
|
-
|
|
69115
|
-
if (!webhookUrl) {
|
|
69095
|
+
if (!filterIsShapeKindOnly(filterJson)) {
|
|
69116
69096
|
usageError(usage, example);
|
|
69117
69097
|
}
|
|
69118
|
-
|
|
69119
|
-
if (typeof flags["fallback-webhook-url"] === "string") {
|
|
69120
|
-
mutationArgs.fallbackWebhookUrl = flags["fallback-webhook-url"];
|
|
69121
|
-
}
|
|
69122
|
-
if (flags["allow-trace-reentry"] === true) {
|
|
69123
|
-
mutationArgs.allowTraceReentry = true;
|
|
69124
|
-
}
|
|
69125
|
-
return mutationArgs;
|
|
69098
|
+
return { filterJson };
|
|
69126
69099
|
}
|
|
69127
69100
|
function rejectCommitOnlyFlags(flags, eventType, correctiveExample) {
|
|
69128
69101
|
for (const f of ["on", "filter", "source"]) {
|
|
69129
|
-
|
|
69130
|
-
if (typeof v === "string" && v.length > 0) {
|
|
69102
|
+
if (flags[f]) {
|
|
69131
69103
|
usageError(`--${f} is not valid for ${eventType} subscriptions — metadata events have no shape, filter, or source`, correctiveExample ?? `wh sub create metadata-hook ${isOrgScopedEventType(eventType) ? "--org myorg" : "--repo myorg/myrepo"} --event ${eventType} --webhook-url https://example.com/hook`);
|
|
69132
69104
|
}
|
|
69133
69105
|
}
|
|
69134
69106
|
}
|
|
69135
69107
|
function resolveSubScope(ctx, flags, correctiveExample) {
|
|
69136
69108
|
rejectConflictingSubScope(ctx, flags, correctiveExample);
|
|
69137
|
-
if (
|
|
69109
|
+
if (flags.org) {
|
|
69138
69110
|
return { orgName: flags.org };
|
|
69139
69111
|
}
|
|
69140
69112
|
const { org, repo: repo2 } = resolveRepoContext(ctx);
|
|
@@ -69153,18 +69125,18 @@ function scopeLabel(scope) {
|
|
|
69153
69125
|
var handleCreate8 = async (ctx, { flags, args }) => {
|
|
69154
69126
|
const name = args[0] ?? flags.name;
|
|
69155
69127
|
const usage = `Usage: wh sub create <name> (--repo org/repo | --org org) [--event ${SUBSCRIBABLE_EVENT_TYPES.join("|")}] [options]`;
|
|
69156
|
-
const example = `wh sub create
|
|
69128
|
+
const example = `wh sub create sensor-hook --repo myorg/myrepo --on Sensor --filter '{"shape":"Sensor"}' --webhook-url https://example.com/hook`;
|
|
69157
69129
|
if (!name) {
|
|
69158
69130
|
usageError(usage, example);
|
|
69159
69131
|
}
|
|
69160
69132
|
rejectRemovedCronFlags(flags);
|
|
69161
69133
|
const kind = parseKind(flags.kind, usage, example);
|
|
69162
69134
|
const eventType = parseEventType(flags.event, usage, example);
|
|
69163
|
-
const webhookUrl =
|
|
69135
|
+
const webhookUrl = flags["webhook-url"];
|
|
69164
69136
|
if (!webhookUrl) {
|
|
69165
69137
|
usageError(usage, example);
|
|
69166
69138
|
}
|
|
69167
|
-
const fallbackWebhookUrl =
|
|
69139
|
+
const fallbackWebhookUrl = flags["fallback-webhook-url"];
|
|
69168
69140
|
const allowTraceReentry = flags["allow-trace-reentry"] === true;
|
|
69169
69141
|
const metadataExtras = {
|
|
69170
69142
|
...fallbackWebhookUrl ? { fallbackWebhookUrl } : {},
|
|
@@ -69172,7 +69144,7 @@ var handleCreate8 = async (ctx, { flags, args }) => {
|
|
|
69172
69144
|
};
|
|
69173
69145
|
rejectConflictingSubScope(ctx, flags, example);
|
|
69174
69146
|
if (isOrgScopedEventType(eventType)) {
|
|
69175
|
-
const orgName =
|
|
69147
|
+
const orgName = flags.org;
|
|
69176
69148
|
if (!orgName) {
|
|
69177
69149
|
usageError(`${eventType} subscriptions are org-scoped — pass --org <org> (not --repo)`, `wh sub create org-hook --org myorg --event ${eventType} --webhook-url https://example.com/hook`);
|
|
69178
69150
|
}
|
|
@@ -69212,19 +69184,18 @@ var handleCreate8 = async (ctx, { flags, args }) => {
|
|
|
69212
69184
|
});
|
|
69213
69185
|
return;
|
|
69214
69186
|
}
|
|
69215
|
-
const
|
|
69216
|
-
const sourceRepoRef = typeof flags.source === "string" ? flags.source : undefined;
|
|
69187
|
+
const { filterJson, shapeName } = buildSubscriptionMatcherArgs(flags, usage, example);
|
|
69217
69188
|
const result = await ctx.client.subscription.create({
|
|
69218
69189
|
orgName: org,
|
|
69219
69190
|
repoName: repo2,
|
|
69220
69191
|
name,
|
|
69221
69192
|
webhookUrl,
|
|
69222
|
-
fallbackWebhookUrl
|
|
69223
|
-
...
|
|
69193
|
+
fallbackWebhookUrl,
|
|
69194
|
+
...allowTraceReentry ? { allowTraceReentry: true } : {},
|
|
69224
69195
|
kind,
|
|
69225
|
-
shapeName
|
|
69226
|
-
filterJson
|
|
69227
|
-
sourceRepoRef
|
|
69196
|
+
shapeName,
|
|
69197
|
+
filterJson,
|
|
69198
|
+
sourceRepoRef: flags.source
|
|
69228
69199
|
});
|
|
69229
69200
|
writeOutput(ctx, result, () => {
|
|
69230
69201
|
const c = ctx.colors;
|
|
@@ -69234,7 +69205,7 @@ var handleCreate8 = async (ctx, { flags, args }) => {
|
|
|
69234
69205
|
var handleUpdate4 = async (ctx, { flags, args }) => {
|
|
69235
69206
|
const name = args[0] ?? flags.name;
|
|
69236
69207
|
const usage = "Usage: wh sub update <name> (--repo org/repo | --org org) [options]";
|
|
69237
|
-
const example = "wh sub update
|
|
69208
|
+
const example = "wh sub update sensor-hook --repo myorg/myrepo";
|
|
69238
69209
|
if (!name) {
|
|
69239
69210
|
usageError(usage, example);
|
|
69240
69211
|
}
|
|
@@ -69252,11 +69223,7 @@ var handleUpdate4 = async (ctx, { flags, args }) => {
|
|
|
69252
69223
|
const result = await ctx.client.subscription.update({
|
|
69253
69224
|
...scope,
|
|
69254
69225
|
name,
|
|
69255
|
-
...patchArgs
|
|
69256
|
-
...patchArgs.filterJson != null ? { filterJson: patchArgs.filterJson } : {},
|
|
69257
|
-
...patchArgs.webhookUrl != null ? { webhookUrl: patchArgs.webhookUrl } : {},
|
|
69258
|
-
...patchArgs.fallbackWebhookUrl !== undefined ? { fallbackWebhookUrl: patchArgs.fallbackWebhookUrl } : {},
|
|
69259
|
-
...patchArgs.allowTraceReentry === true ? { allowTraceReentry: true } : {}
|
|
69226
|
+
...patchArgs
|
|
69260
69227
|
});
|
|
69261
69228
|
writeOutput(ctx, result, () => {
|
|
69262
69229
|
const c = ctx.colors;
|
|
@@ -69266,9 +69233,9 @@ var handleUpdate4 = async (ctx, { flags, args }) => {
|
|
|
69266
69233
|
var handleView8 = async (ctx, { args, flags }) => {
|
|
69267
69234
|
const name = args[0];
|
|
69268
69235
|
if (!name) {
|
|
69269
|
-
usageError("Usage: wh sub view <name> [--show-secrets] (--repo org/repo | --org org)", "wh sub view
|
|
69236
|
+
usageError("Usage: wh sub view <name> [--show-secrets] (--repo org/repo | --org org)", "wh sub view sensor-hook --repo myorg/myrepo");
|
|
69270
69237
|
}
|
|
69271
|
-
const scope = resolveSubScope(ctx, flags, "wh sub view
|
|
69238
|
+
const scope = resolveSubScope(ctx, flags, "wh sub view sensor-hook --repo myorg/myrepo");
|
|
69272
69239
|
const sub = await ctx.client.subscription.get({ ...scope, name });
|
|
69273
69240
|
const revealed = flags["show-secrets"] ? await ctx.client.subscription.reveal({ ...scope, name }) : undefined;
|
|
69274
69241
|
writeOutput(ctx, revealed ? { ...sub, ...revealed } : sub, () => {
|
|
@@ -69420,9 +69387,9 @@ var handleList8 = async (ctx, { flags }) => {
|
|
|
69420
69387
|
var handlePause = async (ctx, { args, flags }) => {
|
|
69421
69388
|
const name = args[0];
|
|
69422
69389
|
if (!name) {
|
|
69423
|
-
usageError("Usage: wh sub pause <name> (--repo org/repo | --org org)", "wh sub pause
|
|
69390
|
+
usageError("Usage: wh sub pause <name> (--repo org/repo | --org org)", "wh sub pause sensor-hook --repo myorg/myrepo");
|
|
69424
69391
|
}
|
|
69425
|
-
const scope = resolveSubScope(ctx, flags, "wh sub pause
|
|
69392
|
+
const scope = resolveSubScope(ctx, flags, "wh sub pause sensor-hook --repo myorg/myrepo");
|
|
69426
69393
|
const result = await ctx.client.subscription.pause({ ...scope, name });
|
|
69427
69394
|
writeOutput(ctx, result, () => {
|
|
69428
69395
|
const c = ctx.colors;
|
|
@@ -69432,9 +69399,9 @@ var handlePause = async (ctx, { args, flags }) => {
|
|
|
69432
69399
|
var handleResume = async (ctx, { args, flags }) => {
|
|
69433
69400
|
const name = args[0];
|
|
69434
69401
|
if (!name) {
|
|
69435
|
-
usageError("Usage: wh sub resume <name> (--repo org/repo | --org org)", "wh sub resume
|
|
69402
|
+
usageError("Usage: wh sub resume <name> (--repo org/repo | --org org)", "wh sub resume sensor-hook --repo myorg/myrepo");
|
|
69436
69403
|
}
|
|
69437
|
-
const scope = resolveSubScope(ctx, flags, "wh sub resume
|
|
69404
|
+
const scope = resolveSubScope(ctx, flags, "wh sub resume sensor-hook --repo myorg/myrepo");
|
|
69438
69405
|
const result = await ctx.client.subscription.resume({ ...scope, name });
|
|
69439
69406
|
writeOutput(ctx, result, () => {
|
|
69440
69407
|
const c = ctx.colors;
|
|
@@ -69444,9 +69411,9 @@ var handleResume = async (ctx, { args, flags }) => {
|
|
|
69444
69411
|
var handleDelete3 = async (ctx, { args, flags }) => {
|
|
69445
69412
|
const name = args[0];
|
|
69446
69413
|
if (!name) {
|
|
69447
|
-
usageError("Usage: wh sub delete <name> (--repo org/repo | --org org)", "wh sub delete
|
|
69414
|
+
usageError("Usage: wh sub delete <name> (--repo org/repo | --org org)", "wh sub delete sensor-hook --repo myorg/myrepo");
|
|
69448
69415
|
}
|
|
69449
|
-
const scope = resolveSubScope(ctx, flags, "wh sub delete
|
|
69416
|
+
const scope = resolveSubScope(ctx, flags, "wh sub delete sensor-hook --repo myorg/myrepo");
|
|
69450
69417
|
const result = await ctx.client.subscription.remove({ ...scope, name });
|
|
69451
69418
|
writeOutput(ctx, result, () => {
|
|
69452
69419
|
const c = ctx.colors;
|
|
@@ -69457,9 +69424,9 @@ var handleBind = async (ctx, { flags, args }) => {
|
|
|
69457
69424
|
const name = args[0];
|
|
69458
69425
|
const setName = flags.credentials;
|
|
69459
69426
|
if (!name || !setName) {
|
|
69460
|
-
usageError("Usage: wh sub bind <name> --credentials <setName> (--repo org/repo | --org org)", "wh sub bind
|
|
69427
|
+
usageError("Usage: wh sub bind <name> --credentials <setName> (--repo org/repo | --org org)", "wh sub bind sensor-hook --credentials webhook-keys --repo myorg/myrepo");
|
|
69461
69428
|
}
|
|
69462
|
-
const scope = resolveSubScope(ctx, flags, "wh sub bind
|
|
69429
|
+
const scope = resolveSubScope(ctx, flags, "wh sub bind sensor-hook --credentials webhook-keys --repo myorg/myrepo");
|
|
69463
69430
|
const result = await ctx.client.subscription.bindCredentials({
|
|
69464
69431
|
...scope,
|
|
69465
69432
|
subscriptionName: name,
|
|
@@ -69473,9 +69440,9 @@ var handleBind = async (ctx, { flags, args }) => {
|
|
|
69473
69440
|
var handleUnbind = async (ctx, { args, flags }) => {
|
|
69474
69441
|
const name = args[0];
|
|
69475
69442
|
if (!name) {
|
|
69476
|
-
usageError("Usage: wh sub unbind <name> (--repo org/repo | --org org)", "wh sub unbind
|
|
69443
|
+
usageError("Usage: wh sub unbind <name> (--repo org/repo | --org org)", "wh sub unbind sensor-hook --repo myorg/myrepo");
|
|
69477
69444
|
}
|
|
69478
|
-
const scope = resolveSubScope(ctx, flags, "wh sub unbind
|
|
69445
|
+
const scope = resolveSubScope(ctx, flags, "wh sub unbind sensor-hook --repo myorg/myrepo");
|
|
69479
69446
|
const result = await ctx.client.subscription.unbindCredentials({
|
|
69480
69447
|
...scope,
|
|
69481
69448
|
subscriptionName: name
|
|
@@ -69490,12 +69457,7 @@ var handleLog = async (ctx, { flags, args }) => {
|
|
|
69490
69457
|
if (!name) {
|
|
69491
69458
|
usageError("Usage: wh sub log <name> [--repo org/repo]", "wh sub log my-sub");
|
|
69492
69459
|
}
|
|
69493
|
-
const
|
|
69494
|
-
if (!scope.repoName) {
|
|
69495
|
-
usageError("Usage: wh sub log <name> [--repo org/repo]", "wh sub log my-sub --repo myorg/myrepo");
|
|
69496
|
-
}
|
|
69497
|
-
const org = scope.orgName;
|
|
69498
|
-
const repo2 = scope.repoName;
|
|
69460
|
+
const { org, repo: repo2 } = resolveRepoContext(ctx);
|
|
69499
69461
|
if (ctx.liveMode) {
|
|
69500
69462
|
await runLive({
|
|
69501
69463
|
apiUrl: ctx.config.apiUrl,
|
|
@@ -69562,9 +69524,10 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69562
69524
|
summary: "Create a subscription",
|
|
69563
69525
|
args: "<name>",
|
|
69564
69526
|
flags: createFlags9,
|
|
69527
|
+
rejectedFlags: { url: "Pass the destination with --webhook-url <url>" },
|
|
69565
69528
|
examples: [
|
|
69566
69529
|
"# Create a webhook subscription for things of a shape",
|
|
69567
|
-
` $ wh sub create
|
|
69530
|
+
` $ wh sub create sensor-hook --repo myorg/myrepo --on Sensor --kind webhook --filter '{"shape":"Sensor"}' --webhook-url https://example.com/hook`,
|
|
69568
69531
|
"",
|
|
69569
69532
|
"# Subscribe to all shape lifecycle changes (add, revise, retract on any shape)",
|
|
69570
69533
|
` $ wh sub create shape-changes --repo myorg/myrepo --kind webhook --filter '{"kind":"shape"}' --webhook-url https://hooks.example.com/shapes`,
|
|
@@ -69585,7 +69548,7 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69585
69548
|
"# See `wh credential set --help` for supported key names and `wh sub bind --help`.",
|
|
69586
69549
|
" $ wh credential create webhook-keys --repo myorg/myrepo",
|
|
69587
69550
|
' $ echo "tok_secret" | wh credential set webhook-keys WEBHOOK_BEARER_TOKEN --repo myorg/myrepo',
|
|
69588
|
-
" $ wh sub bind
|
|
69551
|
+
" $ wh sub bind sensor-hook --credentials webhook-keys --repo myorg/myrepo"
|
|
69589
69552
|
],
|
|
69590
69553
|
handler: handleCreate8
|
|
69591
69554
|
},
|
|
@@ -69595,9 +69558,10 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69595
69558
|
summary: "Update a subscription",
|
|
69596
69559
|
args: "<name>",
|
|
69597
69560
|
flags: updateFlags4,
|
|
69561
|
+
rejectedFlags: { url: "Pass the destination with --webhook-url <url>" },
|
|
69598
69562
|
examples: [
|
|
69599
69563
|
"# Update only the webhook URL",
|
|
69600
|
-
" $ wh sub update
|
|
69564
|
+
" $ wh sub update sensor-hook --repo myorg/myrepo --webhook-url https://example.com/v2/hook",
|
|
69601
69565
|
"# Repoint an org-scoped metadata hook in place",
|
|
69602
69566
|
" $ wh sub update org-rename-hook --org myorg --webhook-url https://example.com/v2/hook"
|
|
69603
69567
|
],
|
|
@@ -69610,8 +69574,8 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69610
69574
|
args: "<name>",
|
|
69611
69575
|
flags: viewFlags5,
|
|
69612
69576
|
examples: [
|
|
69613
|
-
"wh sub view
|
|
69614
|
-
"wh sub view
|
|
69577
|
+
"wh sub view sensor-hook --repo myorg/myrepo",
|
|
69578
|
+
"wh sub view sensor-hook --show-secrets --repo myorg/myrepo",
|
|
69615
69579
|
"# Org-scoped metadata subscription",
|
|
69616
69580
|
" $ wh sub view org-rename-hook --org myorg"
|
|
69617
69581
|
],
|
|
@@ -69642,16 +69606,16 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69642
69606
|
},
|
|
69643
69607
|
examples: [
|
|
69644
69608
|
"# Show recent deliveries",
|
|
69645
|
-
" $ wh sub log
|
|
69609
|
+
" $ wh sub log sensor-hook --repo org/repo",
|
|
69646
69610
|
"",
|
|
69647
69611
|
"# Failed terminal runs print a response: block when captured output exists",
|
|
69648
69612
|
" $ wh sub log daily-digest --repo org/repo",
|
|
69649
69613
|
"",
|
|
69650
69614
|
"# Follow deliveries in live mode",
|
|
69651
|
-
" $ wh sub log
|
|
69615
|
+
" $ wh sub log sensor-hook --repo org/repo --live",
|
|
69652
69616
|
"",
|
|
69653
69617
|
"# Delivery logs currently require a repo-scoped subscription",
|
|
69654
|
-
" $ wh sub log
|
|
69618
|
+
" $ wh sub log sensor-hook --repo org/repo"
|
|
69655
69619
|
],
|
|
69656
69620
|
handler: handleLog
|
|
69657
69621
|
},
|
|
@@ -69676,7 +69640,7 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69676
69640
|
args: "<name>",
|
|
69677
69641
|
flags: scopeFlags,
|
|
69678
69642
|
examples: [
|
|
69679
|
-
"wh sub pause
|
|
69643
|
+
"wh sub pause sensor-hook --repo myorg/myrepo",
|
|
69680
69644
|
"# Org-scoped metadata subscription",
|
|
69681
69645
|
" $ wh sub pause org-rename-hook --org myorg"
|
|
69682
69646
|
],
|
|
@@ -69689,7 +69653,7 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69689
69653
|
args: "<name>",
|
|
69690
69654
|
flags: scopeFlags,
|
|
69691
69655
|
examples: [
|
|
69692
|
-
"wh sub resume
|
|
69656
|
+
"wh sub resume sensor-hook --repo myorg/myrepo",
|
|
69693
69657
|
" $ wh sub resume org-rename-hook --org myorg"
|
|
69694
69658
|
],
|
|
69695
69659
|
handler: handleResume
|
|
@@ -69702,7 +69666,7 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69702
69666
|
flags: bindFlags,
|
|
69703
69667
|
examples: [
|
|
69704
69668
|
"# Bind credentials to inject auth headers on webhook delivery",
|
|
69705
|
-
" $ wh sub bind
|
|
69669
|
+
" $ wh sub bind sensor-hook --credentials webhook-keys --repo myorg/myrepo",
|
|
69706
69670
|
"# Org-scoped metadata subscription + org-scoped credential set",
|
|
69707
69671
|
" $ wh sub bind org-rename-hook --credentials org-webhook-keys --org myorg"
|
|
69708
69672
|
],
|
|
@@ -69715,7 +69679,7 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69715
69679
|
args: "<name>",
|
|
69716
69680
|
flags: scopeFlags,
|
|
69717
69681
|
examples: [
|
|
69718
|
-
"wh sub unbind
|
|
69682
|
+
"wh sub unbind sensor-hook --repo myorg/myrepo",
|
|
69719
69683
|
" $ wh sub unbind org-rename-hook --org myorg"
|
|
69720
69684
|
],
|
|
69721
69685
|
handler: handleUnbind
|
|
@@ -69727,7 +69691,7 @@ var SUB_DOMAIN = defineDomain({
|
|
|
69727
69691
|
args: "<name>",
|
|
69728
69692
|
flags: scopeFlags,
|
|
69729
69693
|
examples: [
|
|
69730
|
-
"wh sub delete
|
|
69694
|
+
"wh sub delete sensor-hook --repo myorg/myrepo",
|
|
69731
69695
|
" $ wh sub delete org-rename-hook --org myorg"
|
|
69732
69696
|
],
|
|
69733
69697
|
handler: handleDelete3
|
|
@@ -69933,7 +69897,7 @@ var TOKEN_DOMAIN = defineDomain({
|
|
|
69933
69897
|
"wh token create --name ci-bot --scope myorg/myrepo=role:editor",
|
|
69934
69898
|
'wh token create -n deploy -s myorg=repo:write -d "Deploy pipeline" --expires 90d',
|
|
69935
69899
|
"wh token create --name reader --scope repo:read",
|
|
69936
|
-
`wh token create --name scoped --scopes-json '[{"resource":"myorg/myrepo","permissions":["repo:read"],"grants":[{"allowedMatches":["
|
|
69900
|
+
`wh token create --name scoped --scopes-json '[{"resource":"myorg/myrepo","permissions":["repo:read"],"grants":[{"allowedMatches":["sensors/**"],"allowedShapes":{"shapes":["Sensor"]}}]}]'`,
|
|
69937
69901
|
`wh token create --name global-reader --scopes-json '[{"permissions":["repo:read"]}]'`
|
|
69938
69902
|
],
|
|
69939
69903
|
handler: handleCreate9
|
|
@@ -72375,7 +72339,7 @@ function resolveLogLevel(flagLevel, env) {
|
|
|
72375
72339
|
// package.json
|
|
72376
72340
|
var package_default3 = {
|
|
72377
72341
|
name: "@warmhub/cli",
|
|
72378
|
-
version: "0.
|
|
72342
|
+
version: "0.150.0",
|
|
72379
72343
|
private: false,
|
|
72380
72344
|
type: "module",
|
|
72381
72345
|
description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -73005,5 +72969,5 @@ process.exitCode = interceptedExitCode === undefined ? await runPreparedCli(laun
|
|
|
73005
72969
|
version: package_default3.version
|
|
73006
72970
|
}) : interceptedExitCode;
|
|
73007
72971
|
|
|
73008
|
-
//# debugId=
|
|
73009
|
-
//# warmhub-cli-build-info {"cliVersion":"0.
|
|
72972
|
+
//# debugId=5BE71DDB2BA732AC64756E2164756E21
|
|
72973
|
+
//# warmhub-cli-build-info {"cliVersion":"0.150.0","sdkVersion":"0.148.0"}
|
package/package.json
CHANGED