@curviate/cli 0.41.0 → 0.43.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 +70 -0
- package/dist/{account-QZ5RYKIT.js → account-FDPUPVFB.js} +118 -29
- package/dist/{chunk-CBHL3QQJ.js → chunk-B5NIX4G6.js} +1 -1
- package/dist/{chunk-BLFGJIJJ.js → chunk-BLJGV6ST.js} +2 -2
- package/dist/{chunk-XP2LN6F6.js → chunk-EGDDVF3Q.js} +3 -1
- 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-2WKYM34T.js} +101 -51
- package/dist/{config-RUBXWFQ3.js → config-K4G3VSBA.js} +44 -9
- package/dist/{connect-TTA2X3KO.js → connect-GHABKXB2.js} +45 -22
- 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-OJB4VSI2.js} +109 -35
- 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-BHZPRUFU.js} +125 -44
- package/dist/{recruiter-OBKS4ZVL.js → recruiter-JUA4BZIC.js} +211 -68
- package/dist/{sales-nav-WPTMS6QF.js → sales-nav-77NP3UXV.js} +100 -42
- package/dist/{search-YAKZKK74.js → search-3MRQE6VC.js} +81 -40
- package/dist/{setup-NZQUWJYC.js → setup-BPNLAHPC.js} +9 -4
- package/dist/{webhook-PXSLDB2F.js → webhook-TOQUQPT4.js} +79 -31
- package/package.json +3 -2
|
@@ -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");
|
|
@@ -73,16 +68,25 @@ async function runWebhookCreate(client, flags, out) {
|
|
|
73
68
|
out.stderr.write("error: --request-url is required (HTTPS URL for webhook deliveries).\n");
|
|
74
69
|
process.exit(2);
|
|
75
70
|
}
|
|
76
|
-
if (!flags["account-ids"]) {
|
|
77
|
-
out.stderr.write("error: --account-ids is required (comma-separated list of acc_... ids).\n");
|
|
78
|
-
process.exit(2);
|
|
79
|
-
}
|
|
80
|
-
const accountIds = flags["account-ids"].split(",").map((s) => s.trim()).filter(Boolean);
|
|
81
71
|
const body = {
|
|
82
72
|
source: flags.source,
|
|
83
|
-
request_url: flags["request-url"]
|
|
84
|
-
account_ids: accountIds
|
|
73
|
+
request_url: flags["request-url"]
|
|
85
74
|
};
|
|
75
|
+
if (flags["account-ids"] !== void 0) {
|
|
76
|
+
const accountIds = flags["account-ids"].split(",").map((s) => s.trim()).filter(Boolean);
|
|
77
|
+
if (accountIds.length === 0) {
|
|
78
|
+
out.stderr.write(
|
|
79
|
+
"error: --account-ids was given an empty value. Pass acc_... ids, or omit the flag on an account_status webhook to cover every account.\n"
|
|
80
|
+
);
|
|
81
|
+
process.exit(2);
|
|
82
|
+
}
|
|
83
|
+
body["account_ids"] = accountIds;
|
|
84
|
+
} else if (flags.source !== "account_status") {
|
|
85
|
+
out.stderr.write(
|
|
86
|
+
"error: --account-ids is required when --source is messaging or user (comma-separated acc_... ids). Only an account_status webhook may omit it.\n"
|
|
87
|
+
);
|
|
88
|
+
process.exit(2);
|
|
89
|
+
}
|
|
86
90
|
if (flags.name) body["name"] = flags.name;
|
|
87
91
|
if (flags.enabled !== void 0) body["enabled"] = flags.enabled;
|
|
88
92
|
if (flags.events) {
|
|
@@ -105,7 +109,6 @@ async function runWebhookCreate(client, flags, out) {
|
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
async function runWebhookList(client, flags, out) {
|
|
108
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
109
112
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
110
113
|
const outOpts = resolveOutputOpts(flags);
|
|
111
114
|
const all = flags.all ?? false;
|
|
@@ -135,7 +138,6 @@ async function runWebhookList(client, flags, out) {
|
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
async function runWebhookEvents(client, flags, out) {
|
|
138
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
139
141
|
rejectAllOnNonPaginated(flags.all, out);
|
|
140
142
|
const outOpts = resolveOutputOpts(flags);
|
|
141
143
|
try {
|
|
@@ -147,7 +149,6 @@ async function runWebhookEvents(client, flags, out) {
|
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
async function runWebhookGet(client, flags, out) {
|
|
150
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
151
152
|
const id = flags.id ?? "";
|
|
152
153
|
const outOpts = resolveOutputOpts(flags);
|
|
153
154
|
try {
|
|
@@ -274,12 +275,22 @@ async function runWebhookVerify(input, out) {
|
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
277
|
var webhookCreateCommand = defineCommand({
|
|
277
|
-
meta: {
|
|
278
|
+
meta: {
|
|
279
|
+
name: "create",
|
|
280
|
+
description: "Register a new webhook endpoint.",
|
|
281
|
+
examples: [
|
|
282
|
+
"curviate webhook create --source messaging --request-url https://example.com/hooks/curviate --account-ids acc_YOUR_ACCOUNT_ID",
|
|
283
|
+
"curviate webhook create --source account_status --request-url https://example.com/hooks/curviate --name status"
|
|
284
|
+
],
|
|
285
|
+
requires: [
|
|
286
|
+
"--account-ids for --source messaging and user; omit it with --source account_status to cover every current and future account."
|
|
287
|
+
]
|
|
288
|
+
},
|
|
278
289
|
args: {
|
|
279
290
|
...NON_STREAM_FLAGS,
|
|
280
291
|
source: { type: "string", description: "Event source: messaging | user | account_status.", required: true },
|
|
281
292
|
"request-url": { type: "string", description: "HTTPS URL to receive webhook deliveries.", required: true },
|
|
282
|
-
"account-ids": { type: "string", description: "Comma-separated account ids to target
|
|
293
|
+
"account-ids": { type: "string", description: "Comma-separated account ids to target. Required for messaging and user; omit on account_status to cover every current and future account." },
|
|
283
294
|
name: { type: "string", description: "Human-readable name (1-100 chars)." },
|
|
284
295
|
enabled: { type: "boolean", description: "Create as enabled (default: true).", default: true },
|
|
285
296
|
events: { type: "string", description: "Comma-separated event names to subscribe to." },
|
|
@@ -303,8 +314,14 @@ var webhookCreateCommand = defineCommand({
|
|
|
303
314
|
}
|
|
304
315
|
});
|
|
305
316
|
var webhookListCommand = defineCommand({
|
|
306
|
-
meta: {
|
|
307
|
-
|
|
317
|
+
meta: {
|
|
318
|
+
name: "list",
|
|
319
|
+
description: "List registered webhooks.",
|
|
320
|
+
examples: [
|
|
321
|
+
"curviate webhook list"
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
args: { ...readOnly(GLOBAL_FLAGS) },
|
|
308
325
|
async run({ args }) {
|
|
309
326
|
const flags = args;
|
|
310
327
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -323,8 +340,14 @@ var webhookListCommand = defineCommand({
|
|
|
323
340
|
}
|
|
324
341
|
});
|
|
325
342
|
var webhookEventsCommand = defineCommand({
|
|
326
|
-
meta: {
|
|
327
|
-
|
|
343
|
+
meta: {
|
|
344
|
+
name: "events",
|
|
345
|
+
description: "List the canonical webhook event catalogue.",
|
|
346
|
+
examples: [
|
|
347
|
+
"curviate webhook events"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
args: { ...readOnly(NON_STREAM_FLAGS) },
|
|
328
351
|
async run({ args }) {
|
|
329
352
|
const flags = args;
|
|
330
353
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -343,9 +366,15 @@ var webhookEventsCommand = defineCommand({
|
|
|
343
366
|
}
|
|
344
367
|
});
|
|
345
368
|
var webhookGetCommand = defineCommand({
|
|
346
|
-
meta: {
|
|
369
|
+
meta: {
|
|
370
|
+
name: "get",
|
|
371
|
+
description: "Get a single webhook owned by the calling tenant.",
|
|
372
|
+
examples: [
|
|
373
|
+
"curviate webhook get wh_YOUR_WEBHOOK_ID"
|
|
374
|
+
]
|
|
375
|
+
},
|
|
347
376
|
args: {
|
|
348
|
-
...NON_STREAM_FLAGS,
|
|
377
|
+
...readOnly(NON_STREAM_FLAGS),
|
|
349
378
|
id: { type: "positional", description: "Webhook id (wh_...)." }
|
|
350
379
|
},
|
|
351
380
|
async run({ args }) {
|
|
@@ -366,7 +395,14 @@ var webhookGetCommand = defineCommand({
|
|
|
366
395
|
}
|
|
367
396
|
});
|
|
368
397
|
var webhookUpdateCommand = defineCommand({
|
|
369
|
-
meta: {
|
|
398
|
+
meta: {
|
|
399
|
+
name: "update",
|
|
400
|
+
description: "Update a webhook in place (source is immutable).",
|
|
401
|
+
examples: [
|
|
402
|
+
"curviate webhook update wh_YOUR_WEBHOOK_ID --no-enabled",
|
|
403
|
+
"curviate webhook update wh_YOUR_WEBHOOK_ID --request-url https://example.com/hooks/v2"
|
|
404
|
+
]
|
|
405
|
+
},
|
|
370
406
|
args: {
|
|
371
407
|
...NON_STREAM_FLAGS,
|
|
372
408
|
id: { type: "positional", description: "Webhook id (wh_...)." },
|
|
@@ -395,7 +431,13 @@ var webhookUpdateCommand = defineCommand({
|
|
|
395
431
|
}
|
|
396
432
|
});
|
|
397
433
|
var webhookDeleteCommand = defineCommand({
|
|
398
|
-
meta: {
|
|
434
|
+
meta: {
|
|
435
|
+
name: "delete",
|
|
436
|
+
description: "Permanently remove a webhook subscription.",
|
|
437
|
+
examples: [
|
|
438
|
+
"curviate webhook delete wh_YOUR_WEBHOOK_ID"
|
|
439
|
+
]
|
|
440
|
+
},
|
|
399
441
|
args: {
|
|
400
442
|
...NON_STREAM_FLAGS,
|
|
401
443
|
id: { type: "positional", description: "Webhook id (wh_...)." }
|
|
@@ -418,7 +460,13 @@ var webhookDeleteCommand = defineCommand({
|
|
|
418
460
|
}
|
|
419
461
|
});
|
|
420
462
|
var webhookVerifyCommand = defineCommand({
|
|
421
|
-
meta: {
|
|
463
|
+
meta: {
|
|
464
|
+
name: "verify",
|
|
465
|
+
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.",
|
|
466
|
+
examples: [
|
|
467
|
+
'curviate webhook verify --secret "$CURVIATE_WEBHOOK_SECRET" --header "$SIGNATURE_HEADER" --body payload.json'
|
|
468
|
+
]
|
|
469
|
+
},
|
|
422
470
|
// Offline: no profile, credential, transport or pagination flag applies.
|
|
423
471
|
args: {
|
|
424
472
|
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.43.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",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@curviate/sdk": "0.
|
|
50
|
+
"@curviate/sdk": "0.38.0",
|
|
50
51
|
"citty": "^0.1.6",
|
|
51
52
|
"open": "^10.1.0"
|
|
52
53
|
},
|