@curviate/cli 0.40.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 +67 -0
- package/dist/{account-LTXAUBBP.js → account-PFK5YROZ.js} +81 -26
- package/dist/{chunk-OTBJATDE.js → chunk-B5NIX4G6.js} +6 -1
- package/dist/{chunk-LD5KJSCT.js → chunk-BLJGV6ST.js} +2 -2
- package/dist/{chunk-6W7364S3.js → chunk-KJ24DIAJ.js} +1 -1
- package/dist/{chunk-T6G5AASF.js → chunk-OUMMWC7G.js} +79 -26
- package/dist/{chunk-BGVK73VI.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-2CSBSBOH.js → comment-G4EXIIAQ.js} +83 -29
- package/dist/{company-ZUIUR5UN.js → company-WX5QOASS.js} +104 -50
- package/dist/{config-RUBXWFQ3.js → config-K4G3VSBA.js} +44 -9
- package/dist/{connect-LSXKNEL2.js → connect-IYTFL7NT.js} +44 -21
- package/dist/{doctor-FHOHIQPX.js → doctor-ICAEETCL.js} +8 -4
- package/dist/examples-IJL3A6SZ.js +18 -0
- package/dist/{feed-UUHB2FXI.js → feed-XC5235UF.js} +16 -14
- package/dist/{group-NUCO3P2W.js → group-JDP2HVSV.js} +31 -20
- package/dist/{inbox-DEZTGTPO.js → inbox-W3KR65VD.js} +51 -24
- package/dist/{inboxes-F3NIQQRK.js → inboxes-XYS3IRT6.js} +23 -17
- package/dist/{job-YMGO3WJH.js → job-XW3WM57J.js} +112 -34
- package/dist/{login-YTVPIN27.js → login-OHAHNBRW.js} +7 -3
- package/dist/{message-RSBUXI64.js → message-5XC7U4JC.js} +5 -5
- package/dist/{notification-EJ35OD3Q.js → notification-RIUSYJV6.js} +26 -16
- package/dist/{post-VHVQ56A7.js → post-LSEBRQYK.js} +96 -32
- package/dist/{profile-3CBNI42H.js → profile-NHTYGX7K.js} +130 -43
- package/dist/{recruiter-M7XUFYNR.js → recruiter-4SDAROK4.js} +219 -67
- package/dist/{sales-nav-S47OCEUC.js → sales-nav-77NP3UXV.js} +102 -42
- package/dist/{search-UWI37MKG.js → search-XDOQZAVG.js} +80 -39
- package/dist/{setup-3EQRACT6.js → setup-BPNLAHPC.js} +9 -4
- package/dist/{webhook-I4U4C4XE.js → webhook-XOPRW63N.js} +62 -23
- package/package.json +3 -2
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
pageDelayFromFlags,
|
|
7
7
|
readCursorFlag,
|
|
8
8
|
readMaxPagesFlag,
|
|
9
|
+
readableObject,
|
|
9
10
|
readablePage,
|
|
10
11
|
rejectPaginationModifiersWithoutAll,
|
|
11
12
|
renderError,
|
|
@@ -14,26 +15,21 @@ import {
|
|
|
14
15
|
resolveEffectiveConfig,
|
|
15
16
|
streamAll,
|
|
16
17
|
writeNdjsonItem
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B5NIX4G6.js";
|
|
18
19
|
import {
|
|
19
20
|
createClient
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-UJOTQPL6.js";
|
|
21
22
|
import {
|
|
22
23
|
GLOBAL_FLAGS,
|
|
23
24
|
NON_STREAM_FLAGS,
|
|
24
25
|
defaultReadStdin,
|
|
25
|
-
isStdinToken
|
|
26
|
-
|
|
26
|
+
isStdinToken,
|
|
27
|
+
readOnly
|
|
28
|
+
} from "./chunk-TC4ZPUWI.js";
|
|
27
29
|
|
|
28
30
|
// src/commands/webhook.ts
|
|
29
31
|
import { defineCommand } from "citty";
|
|
30
32
|
import { readFileSync } from "fs";
|
|
31
|
-
function rejectPreviewOnRead(preview, out) {
|
|
32
|
-
if (preview) {
|
|
33
|
-
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
34
|
-
process.exit(2);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
33
|
function rejectAllOnNonPaginated(all, out) {
|
|
38
34
|
if (all) {
|
|
39
35
|
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
@@ -104,7 +100,6 @@ async function runWebhookCreate(client, flags, out) {
|
|
|
104
100
|
}
|
|
105
101
|
}
|
|
106
102
|
async function runWebhookList(client, flags, out) {
|
|
107
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
108
103
|
rejectPaginationModifiersWithoutAll(flags, out);
|
|
109
104
|
const outOpts = resolveOutputOpts(flags);
|
|
110
105
|
const all = flags.all ?? false;
|
|
@@ -134,22 +129,22 @@ async function runWebhookList(client, flags, out) {
|
|
|
134
129
|
}
|
|
135
130
|
}
|
|
136
131
|
async function runWebhookEvents(client, flags, out) {
|
|
137
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
138
132
|
rejectAllOnNonPaginated(flags.all, out);
|
|
139
133
|
const outOpts = resolveOutputOpts(flags);
|
|
140
134
|
try {
|
|
141
135
|
const result = await client.webhooks.listEvents();
|
|
136
|
+
readableObject(result);
|
|
142
137
|
renderSuccess(result, outOpts, out);
|
|
143
138
|
} catch (err) {
|
|
144
139
|
await handleError(err, outOpts, out);
|
|
145
140
|
}
|
|
146
141
|
}
|
|
147
142
|
async function runWebhookGet(client, flags, out) {
|
|
148
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
149
143
|
const id = flags.id ?? "";
|
|
150
144
|
const outOpts = resolveOutputOpts(flags);
|
|
151
145
|
try {
|
|
152
146
|
const result = await client.webhooks.get(id);
|
|
147
|
+
readableObject(result);
|
|
153
148
|
renderSuccess(result, outOpts, out);
|
|
154
149
|
} catch (err) {
|
|
155
150
|
await handleError(err, outOpts, out);
|
|
@@ -271,7 +266,14 @@ async function runWebhookVerify(input, out) {
|
|
|
271
266
|
}
|
|
272
267
|
}
|
|
273
268
|
var webhookCreateCommand = defineCommand({
|
|
274
|
-
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
|
+
},
|
|
275
277
|
args: {
|
|
276
278
|
...NON_STREAM_FLAGS,
|
|
277
279
|
source: { type: "string", description: "Event source: messaging | user | account_status.", required: true },
|
|
@@ -300,8 +302,14 @@ var webhookCreateCommand = defineCommand({
|
|
|
300
302
|
}
|
|
301
303
|
});
|
|
302
304
|
var webhookListCommand = defineCommand({
|
|
303
|
-
meta: {
|
|
304
|
-
|
|
305
|
+
meta: {
|
|
306
|
+
name: "list",
|
|
307
|
+
description: "List registered webhooks.",
|
|
308
|
+
examples: [
|
|
309
|
+
"curviate webhook list"
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
args: { ...readOnly(GLOBAL_FLAGS) },
|
|
305
313
|
async run({ args }) {
|
|
306
314
|
const flags = args;
|
|
307
315
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -320,8 +328,14 @@ var webhookListCommand = defineCommand({
|
|
|
320
328
|
}
|
|
321
329
|
});
|
|
322
330
|
var webhookEventsCommand = defineCommand({
|
|
323
|
-
meta: {
|
|
324
|
-
|
|
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) },
|
|
325
339
|
async run({ args }) {
|
|
326
340
|
const flags = args;
|
|
327
341
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -340,9 +354,15 @@ var webhookEventsCommand = defineCommand({
|
|
|
340
354
|
}
|
|
341
355
|
});
|
|
342
356
|
var webhookGetCommand = defineCommand({
|
|
343
|
-
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
|
+
},
|
|
344
364
|
args: {
|
|
345
|
-
...NON_STREAM_FLAGS,
|
|
365
|
+
...readOnly(NON_STREAM_FLAGS),
|
|
346
366
|
id: { type: "positional", description: "Webhook id (wh_...)." }
|
|
347
367
|
},
|
|
348
368
|
async run({ args }) {
|
|
@@ -363,7 +383,14 @@ var webhookGetCommand = defineCommand({
|
|
|
363
383
|
}
|
|
364
384
|
});
|
|
365
385
|
var webhookUpdateCommand = defineCommand({
|
|
366
|
-
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
|
+
},
|
|
367
394
|
args: {
|
|
368
395
|
...NON_STREAM_FLAGS,
|
|
369
396
|
id: { type: "positional", description: "Webhook id (wh_...)." },
|
|
@@ -392,7 +419,13 @@ var webhookUpdateCommand = defineCommand({
|
|
|
392
419
|
}
|
|
393
420
|
});
|
|
394
421
|
var webhookDeleteCommand = defineCommand({
|
|
395
|
-
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
|
+
},
|
|
396
429
|
args: {
|
|
397
430
|
...NON_STREAM_FLAGS,
|
|
398
431
|
id: { type: "positional", description: "Webhook id (wh_...)." }
|
|
@@ -415,7 +448,13 @@ var webhookDeleteCommand = defineCommand({
|
|
|
415
448
|
}
|
|
416
449
|
});
|
|
417
450
|
var webhookVerifyCommand = defineCommand({
|
|
418
|
-
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
|
+
},
|
|
419
458
|
// Offline: no profile, credential, transport or pagination flag applies.
|
|
420
459
|
args: {
|
|
421
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",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@curviate/sdk": "0.37.
|
|
50
|
+
"@curviate/sdk": "0.37.1",
|
|
50
51
|
"citty": "^0.1.6",
|
|
51
52
|
"open": "^10.1.0"
|
|
52
53
|
},
|