@curviate/cli 0.41.0 → 0.42.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/CHANGELOG.md +39 -0
- package/dist/{account-QZ5RYKIT.js → account-PFK5YROZ.js} +73 -26
- package/dist/{chunk-CBHL3QQJ.js → chunk-B5NIX4G6.js} +1 -1
- package/dist/{chunk-BLFGJIJJ.js → chunk-BLJGV6ST.js} +2 -2
- package/dist/{chunk-6W7364S3.js → chunk-KJ24DIAJ.js} +1 -1
- package/dist/{chunk-4AAKZPOM.js → chunk-OUMMWC7G.js} +76 -26
- package/dist/{chunk-WAE7YLO5.js → chunk-PCZH5QJA.js} +1 -1
- package/dist/{chunk-XDQHNUEU.js → chunk-TC4ZPUWI.js} +12 -6
- package/dist/{chunk-DCZR4M7G.js → chunk-UJOTQPL6.js} +1 -1
- package/dist/cli.js +64 -53
- package/dist/{comment-SYA6OKEY.js → comment-G4EXIIAQ.js} +83 -29
- package/dist/{company-IXQ4OFU3.js → company-WX5QOASS.js} +100 -50
- package/dist/{config-RUBXWFQ3.js → config-K4G3VSBA.js} +44 -9
- package/dist/{connect-TTA2X3KO.js → connect-IYTFL7NT.js} +44 -21
- package/dist/{doctor-ET7XQ22E.js → doctor-ICAEETCL.js} +8 -4
- package/dist/examples-IJL3A6SZ.js +18 -0
- package/dist/{feed-556LS3CN.js → feed-XC5235UF.js} +16 -14
- package/dist/{group-DIIG4XQT.js → group-JDP2HVSV.js} +29 -20
- package/dist/{inbox-SRVTUTE6.js → inbox-W3KR65VD.js} +49 -24
- package/dist/{inboxes-XHZTAUQ7.js → inboxes-XYS3IRT6.js} +21 -17
- package/dist/{job-QNVGEM4J.js → job-XW3WM57J.js} +108 -34
- package/dist/{login-YTVPIN27.js → login-OHAHNBRW.js} +7 -3
- package/dist/{message-2JEL6P7E.js → message-5XC7U4JC.js} +5 -5
- package/dist/{notification-T4SRAIJ3.js → notification-RIUSYJV6.js} +26 -16
- package/dist/{post-PV4UQVPO.js → post-LSEBRQYK.js} +94 -32
- package/dist/{profile-K5BZNGX5.js → profile-NHTYGX7K.js} +124 -43
- package/dist/{recruiter-OBKS4ZVL.js → recruiter-4SDAROK4.js} +210 -67
- package/dist/{sales-nav-WPTMS6QF.js → sales-nav-77NP3UXV.js} +100 -42
- package/dist/{search-YAKZKK74.js → search-XDOQZAVG.js} +80 -39
- package/dist/{setup-NZQUWJYC.js → setup-BPNLAHPC.js} +9 -4
- package/dist/{webhook-PXSLDB2F.js → webhook-XOPRW63N.js} +59 -23
- package/package.json +2 -1
|
@@ -15,26 +15,21 @@ import {
|
|
|
15
15
|
resolveEffectiveConfig,
|
|
16
16
|
streamAll,
|
|
17
17
|
writeNdjsonItem
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B5NIX4G6.js";
|
|
19
19
|
import {
|
|
20
20
|
createClient
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-UJOTQPL6.js";
|
|
22
22
|
import {
|
|
23
23
|
GLOBAL_FLAGS,
|
|
24
24
|
NON_STREAM_FLAGS,
|
|
25
25
|
defaultReadStdin,
|
|
26
|
-
isStdinToken
|
|
27
|
-
|
|
26
|
+
isStdinToken,
|
|
27
|
+
readOnly
|
|
28
|
+
} from "./chunk-TC4ZPUWI.js";
|
|
28
29
|
|
|
29
30
|
// src/commands/webhook.ts
|
|
30
31
|
import { defineCommand } from "citty";
|
|
31
32
|
import { readFileSync } from "fs";
|
|
32
|
-
function rejectPreviewOnRead(preview, out) {
|
|
33
|
-
if (preview) {
|
|
34
|
-
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
35
|
-
process.exit(2);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
33
|
function rejectAllOnNonPaginated(all, out) {
|
|
39
34
|
if (all) {
|
|
40
35
|
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
@@ -105,7 +100,6 @@ async function runWebhookCreate(client, flags, out) {
|
|
|
105
100
|
}
|
|
106
101
|
}
|
|
107
102
|
async function runWebhookList(client, flags, out) {
|
|
108
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
109
103
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
110
104
|
const outOpts = resolveOutputOpts(flags);
|
|
111
105
|
const all = flags.all ?? false;
|
|
@@ -135,7 +129,6 @@ async function runWebhookList(client, flags, out) {
|
|
|
135
129
|
}
|
|
136
130
|
}
|
|
137
131
|
async function runWebhookEvents(client, flags, out) {
|
|
138
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
139
132
|
rejectAllOnNonPaginated(flags.all, out);
|
|
140
133
|
const outOpts = resolveOutputOpts(flags);
|
|
141
134
|
try {
|
|
@@ -147,7 +140,6 @@ async function runWebhookEvents(client, flags, out) {
|
|
|
147
140
|
}
|
|
148
141
|
}
|
|
149
142
|
async function runWebhookGet(client, flags, out) {
|
|
150
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
151
143
|
const id = flags.id ?? "";
|
|
152
144
|
const outOpts = resolveOutputOpts(flags);
|
|
153
145
|
try {
|
|
@@ -274,7 +266,14 @@ async function runWebhookVerify(input, out) {
|
|
|
274
266
|
}
|
|
275
267
|
}
|
|
276
268
|
var webhookCreateCommand = defineCommand({
|
|
277
|
-
meta: {
|
|
269
|
+
meta: {
|
|
270
|
+
name: "create",
|
|
271
|
+
description: "Register a new webhook endpoint.",
|
|
272
|
+
examples: [
|
|
273
|
+
"curviate webhook create --source messaging --request-url https://example.com/hooks/curviate --account-ids acc_YOUR_ACCOUNT_ID",
|
|
274
|
+
"curviate webhook create --source account_status --request-url https://example.com/hooks/curviate --account-ids acc_YOUR_ACCOUNT_ID --name status"
|
|
275
|
+
]
|
|
276
|
+
},
|
|
278
277
|
args: {
|
|
279
278
|
...NON_STREAM_FLAGS,
|
|
280
279
|
source: { type: "string", description: "Event source: messaging | user | account_status.", required: true },
|
|
@@ -303,8 +302,14 @@ var webhookCreateCommand = defineCommand({
|
|
|
303
302
|
}
|
|
304
303
|
});
|
|
305
304
|
var webhookListCommand = defineCommand({
|
|
306
|
-
meta: {
|
|
307
|
-
|
|
305
|
+
meta: {
|
|
306
|
+
name: "list",
|
|
307
|
+
description: "List registered webhooks.",
|
|
308
|
+
examples: [
|
|
309
|
+
"curviate webhook list"
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
args: { ...readOnly(GLOBAL_FLAGS) },
|
|
308
313
|
async run({ args }) {
|
|
309
314
|
const flags = args;
|
|
310
315
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -323,8 +328,14 @@ var webhookListCommand = defineCommand({
|
|
|
323
328
|
}
|
|
324
329
|
});
|
|
325
330
|
var webhookEventsCommand = defineCommand({
|
|
326
|
-
meta: {
|
|
327
|
-
|
|
331
|
+
meta: {
|
|
332
|
+
name: "events",
|
|
333
|
+
description: "List the canonical webhook event catalogue.",
|
|
334
|
+
examples: [
|
|
335
|
+
"curviate webhook events"
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
args: { ...readOnly(NON_STREAM_FLAGS) },
|
|
328
339
|
async run({ args }) {
|
|
329
340
|
const flags = args;
|
|
330
341
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -343,9 +354,15 @@ var webhookEventsCommand = defineCommand({
|
|
|
343
354
|
}
|
|
344
355
|
});
|
|
345
356
|
var webhookGetCommand = defineCommand({
|
|
346
|
-
meta: {
|
|
357
|
+
meta: {
|
|
358
|
+
name: "get",
|
|
359
|
+
description: "Get a single webhook owned by the calling tenant.",
|
|
360
|
+
examples: [
|
|
361
|
+
"curviate webhook get wh_YOUR_WEBHOOK_ID"
|
|
362
|
+
]
|
|
363
|
+
},
|
|
347
364
|
args: {
|
|
348
|
-
...NON_STREAM_FLAGS,
|
|
365
|
+
...readOnly(NON_STREAM_FLAGS),
|
|
349
366
|
id: { type: "positional", description: "Webhook id (wh_...)." }
|
|
350
367
|
},
|
|
351
368
|
async run({ args }) {
|
|
@@ -366,7 +383,14 @@ var webhookGetCommand = defineCommand({
|
|
|
366
383
|
}
|
|
367
384
|
});
|
|
368
385
|
var webhookUpdateCommand = defineCommand({
|
|
369
|
-
meta: {
|
|
386
|
+
meta: {
|
|
387
|
+
name: "update",
|
|
388
|
+
description: "Update a webhook in place (source is immutable).",
|
|
389
|
+
examples: [
|
|
390
|
+
"curviate webhook update wh_YOUR_WEBHOOK_ID --no-enabled",
|
|
391
|
+
"curviate webhook update wh_YOUR_WEBHOOK_ID --request-url https://example.com/hooks/v2"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
370
394
|
args: {
|
|
371
395
|
...NON_STREAM_FLAGS,
|
|
372
396
|
id: { type: "positional", description: "Webhook id (wh_...)." },
|
|
@@ -395,7 +419,13 @@ var webhookUpdateCommand = defineCommand({
|
|
|
395
419
|
}
|
|
396
420
|
});
|
|
397
421
|
var webhookDeleteCommand = defineCommand({
|
|
398
|
-
meta: {
|
|
422
|
+
meta: {
|
|
423
|
+
name: "delete",
|
|
424
|
+
description: "Permanently remove a webhook subscription.",
|
|
425
|
+
examples: [
|
|
426
|
+
"curviate webhook delete wh_YOUR_WEBHOOK_ID"
|
|
427
|
+
]
|
|
428
|
+
},
|
|
399
429
|
args: {
|
|
400
430
|
...NON_STREAM_FLAGS,
|
|
401
431
|
id: { type: "positional", description: "Webhook id (wh_...)." }
|
|
@@ -418,7 +448,13 @@ var webhookDeleteCommand = defineCommand({
|
|
|
418
448
|
}
|
|
419
449
|
});
|
|
420
450
|
var webhookVerifyCommand = defineCommand({
|
|
421
|
-
meta: {
|
|
451
|
+
meta: {
|
|
452
|
+
name: "verify",
|
|
453
|
+
description: "Verify a webhook signature offline (no network call). A valid signature prints the parsed event to stdout and exits 0; a mismatch prints a structured error to stdout, a summary to stderr, and exits 2.",
|
|
454
|
+
examples: [
|
|
455
|
+
'curviate webhook verify --secret "$CURVIATE_WEBHOOK_SECRET" --header "$SIGNATURE_HEADER" --body payload.json'
|
|
456
|
+
]
|
|
457
|
+
},
|
|
422
458
|
// Offline: no profile, credential, transport or pagination flag applies.
|
|
423
459
|
args: {
|
|
424
460
|
json: GLOBAL_FLAGS.json,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curviate/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Official command-line interface for the Curviate API.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"test:watch": "vitest",
|
|
37
37
|
"typecheck": "tsc --noEmit",
|
|
38
38
|
"lint": "eslint src test",
|
|
39
|
+
"manifest": "WRITE_COMMANDS_MANIFEST=1 vitest run test/commands-manifest.test.ts",
|
|
39
40
|
"check:clean": "node scripts/check-clean.mjs",
|
|
40
41
|
"check:clean:commits": "node scripts/check-clean.mjs --commits",
|
|
41
42
|
"check:clean:dist": "node scripts/check-clean.mjs --dist",
|