@primitivedotdev/sdk 0.11.0 → 0.12.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/oclif/api-command.js +55 -17
- package/dist/oclif/commands/whoami.js +68 -0
- package/dist/oclif/index.js +6 -0
- package/oclif.manifest.json +76 -40
- package/package.json +1 -1
|
@@ -95,15 +95,15 @@ function extractBodyFields(schema) {
|
|
|
95
95
|
* Most scalar fields are exposed as individual `--flag` flags,
|
|
96
96
|
* which oclif auto-renders in the FLAGS section above. To avoid
|
|
97
97
|
* duplicating that, the summary here only documents fields that
|
|
98
|
-
* MUST go through `--body` (complex types: arrays, objects,
|
|
98
|
+
* MUST go through `--raw-body` (complex types: arrays, objects,
|
|
99
99
|
* mixed-non-nullable). When an operation has only scalars, the
|
|
100
100
|
* summary is omitted entirely and oclif's FLAGS section is the
|
|
101
101
|
* full story.
|
|
102
102
|
*
|
|
103
103
|
* For operations with mixed scalar and complex fields, we also
|
|
104
104
|
* include a short header pointing the agent at the flag form so
|
|
105
|
-
* the natural reading is "use the flags above; --body for
|
|
106
|
-
* leftovers below."
|
|
105
|
+
* the natural reading is "use the flags above; --raw-body for
|
|
106
|
+
* the leftovers below."
|
|
107
107
|
*/
|
|
108
108
|
function renderRequestSchemaSummary(schema) {
|
|
109
109
|
const fields = extractBodyFields(schema);
|
|
@@ -115,7 +115,7 @@ function renderRequestSchemaSummary(schema) {
|
|
|
115
115
|
const nameWidth = Math.min(24, Math.max(...complex.map((f) => f.name.length)));
|
|
116
116
|
const descMax = 78;
|
|
117
117
|
const lines = [
|
|
118
|
-
"Body fields requiring --body JSON (these are not exposed as flags):",
|
|
118
|
+
"Body fields requiring --raw-body JSON (these are not exposed as flags):",
|
|
119
119
|
];
|
|
120
120
|
for (const f of complex) {
|
|
121
121
|
const marker = f.required ? " *" : " ";
|
|
@@ -180,9 +180,9 @@ function parseJson(source, flagLabel) {
|
|
|
180
180
|
}
|
|
181
181
|
export function readJsonBody(flags) {
|
|
182
182
|
const bodyFile = flags["body-file"];
|
|
183
|
-
const
|
|
184
|
-
if (bodyFile &&
|
|
185
|
-
throw cliError("Use either --body or --body-file, not both");
|
|
183
|
+
const rawBody = flags["raw-body"];
|
|
184
|
+
if (bodyFile && rawBody) {
|
|
185
|
+
throw cliError("Use either --raw-body or --body-file, not both");
|
|
186
186
|
}
|
|
187
187
|
if (typeof bodyFile === "string") {
|
|
188
188
|
let contents;
|
|
@@ -195,8 +195,8 @@ export function readJsonBody(flags) {
|
|
|
195
195
|
}
|
|
196
196
|
return parseJson(contents, `--body-file ${bodyFile}`);
|
|
197
197
|
}
|
|
198
|
-
if (typeof
|
|
199
|
-
return parseJson(
|
|
198
|
+
if (typeof rawBody === "string") {
|
|
199
|
+
return parseJson(rawBody, "--raw-body");
|
|
200
200
|
}
|
|
201
201
|
return undefined;
|
|
202
202
|
}
|
|
@@ -243,13 +243,25 @@ export function formatErrorPayload(payload) {
|
|
|
243
243
|
return JSON.stringify(payload, null, 2);
|
|
244
244
|
}
|
|
245
245
|
// Reserved flag names the body-field expander must never overwrite.
|
|
246
|
-
// `--body` and `--body-file` are the JSON escape hatches.
|
|
246
|
+
// `--raw-body` and `--body-file` are the JSON escape hatches.
|
|
247
247
|
// `--api-key`, `--base-url`, `--output` are infra. Path and query
|
|
248
248
|
// params get added before body fields and take precedence.
|
|
249
|
+
//
|
|
250
|
+
// Note: `--body` is intentionally NOT reserved here. The naive
|
|
251
|
+
// agent expectation (per AGX walkthrough) is that --body means
|
|
252
|
+
// "the message body content," which collides with the JSON
|
|
253
|
+
// escape-hatch meaning we used pre-0.12. The escape hatch is now
|
|
254
|
+
// `--raw-body`; --body is free to be claimed by per-field flag
|
|
255
|
+
// expansion as the kebab-cased version of a `body` schema field
|
|
256
|
+
// (e.g. on a future `body: { ... }` schema). For send-mail today,
|
|
257
|
+
// the body-text field is `body_text` -> `--body-text`, and there
|
|
258
|
+
// is no top-level `body` field, so --body remains unclaimed at
|
|
259
|
+
// the generated-command level. The agent shortcut `primitive
|
|
260
|
+
// send` defines its own --body for the message text.
|
|
249
261
|
const RESERVED_FLAG_NAMES = new Set([
|
|
250
262
|
"api-key",
|
|
251
263
|
"base-url",
|
|
252
|
-
"body",
|
|
264
|
+
"raw-body",
|
|
253
265
|
"body-file",
|
|
254
266
|
"output",
|
|
255
267
|
]);
|
|
@@ -296,11 +308,11 @@ function buildFlags(operation) {
|
|
|
296
308
|
}
|
|
297
309
|
const bodyFieldFlagToProperty = new Map();
|
|
298
310
|
if (operation.hasJsonBody) {
|
|
299
|
-
flags
|
|
300
|
-
description: "Full request body as JSON.
|
|
311
|
+
flags["raw-body"] = Flags.string({
|
|
312
|
+
description: "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
301
313
|
});
|
|
302
314
|
flags["body-file"] = Flags.string({
|
|
303
|
-
description: "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
315
|
+
description: "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
304
316
|
});
|
|
305
317
|
// Expand top-level scalar body fields into individual flags so
|
|
306
318
|
// `primitive sending:send-email --to alice@x --from support@x
|
|
@@ -414,7 +426,7 @@ export function createOperationCommand(operation) {
|
|
|
414
426
|
body = { ...explicit, ...overrides };
|
|
415
427
|
}
|
|
416
428
|
else {
|
|
417
|
-
// Caller passed --body as null, an array, or a
|
|
429
|
+
// Caller passed --raw-body as null, an array, or a
|
|
418
430
|
// primitive AND also passed per-field flags. We can't
|
|
419
431
|
// merge per-field overrides into a non-object body
|
|
420
432
|
// shape, and silently dropping either source would
|
|
@@ -428,7 +440,7 @@ export function createOperationCommand(operation) {
|
|
|
428
440
|
const overrideFlags = Object.keys(overrides)
|
|
429
441
|
.map((p) => `--${flagName(p)}`)
|
|
430
442
|
.join(", ");
|
|
431
|
-
throw new Errors.CLIError(`--body must be a JSON object when also passing per-field flags (got ${explicitKind}); supplied per-field flags: ${overrideFlags}. Either drop --body and rely on the per-field flags, or move every field into the JSON --body and drop the flags.`);
|
|
443
|
+
throw new Errors.CLIError(`--raw-body must be a JSON object when also passing per-field flags (got ${explicitKind}); supplied per-field flags: ${overrideFlags}. Either drop --raw-body and rely on the per-field flags, or move every field into the JSON --raw-body and drop the flags.`);
|
|
432
444
|
}
|
|
433
445
|
}
|
|
434
446
|
else {
|
|
@@ -436,7 +448,7 @@ export function createOperationCommand(operation) {
|
|
|
436
448
|
}
|
|
437
449
|
}
|
|
438
450
|
if (operation.bodyRequired && body === undefined) {
|
|
439
|
-
throw new Errors.CLIError(`Operation ${operation.operationId} requires a body. Pass each field as a --flag (see --help) or supply JSON via --body / --body-file.`);
|
|
451
|
+
throw new Errors.CLIError(`Operation ${operation.operationId} requires a body. Pass each field as a --flag (see --help) or supply JSON via --raw-body / --body-file.`);
|
|
440
452
|
}
|
|
441
453
|
const operationFn = operations[operation.sdkName];
|
|
442
454
|
const result = await operationFn({
|
|
@@ -469,8 +481,34 @@ export function createOperationCommand(operation) {
|
|
|
469
481
|
if (cursor) {
|
|
470
482
|
process.stderr.write(`next cursor: ${cursor}\n`);
|
|
471
483
|
}
|
|
484
|
+
// Empty-result hint. When a list-style operation returns
|
|
485
|
+
// an empty array, emit an operation-specific note to
|
|
486
|
+
// stderr so a naive caller can distinguish "nothing here"
|
|
487
|
+
// from "something isn't set up." Stdout still gets the
|
|
488
|
+
// raw `[]` so machine-readable output is unchanged. The
|
|
489
|
+
// AGX walkthrough flagged this: `list-deliveries` returning
|
|
490
|
+
// `[]` left the agent unsure whether they had an empty
|
|
491
|
+
// delivery log or no endpoints configured at all.
|
|
492
|
+
if (Array.isArray(envelope?.data) && envelope.data.length === 0) {
|
|
493
|
+
const hint = EMPTY_RESULT_HINTS[operation.sdkName];
|
|
494
|
+
if (hint)
|
|
495
|
+
process.stderr.write(`${hint}\n`);
|
|
496
|
+
}
|
|
472
497
|
this.log(JSON.stringify(envelope?.data ?? null, null, 2));
|
|
473
498
|
}
|
|
474
499
|
}
|
|
475
500
|
return OperationCommand;
|
|
476
501
|
}
|
|
502
|
+
// Empty-state hints for list-style operations whose empty result
|
|
503
|
+
// would otherwise leave the caller wondering "is this empty
|
|
504
|
+
// because there's nothing to list, or because something earlier
|
|
505
|
+
// in the setup chain isn't done?" Keys are the manifest's
|
|
506
|
+
// `sdkName` for the operation. Operations without an entry fall
|
|
507
|
+
// back to no hint (silent empty array, same as before).
|
|
508
|
+
const EMPTY_RESULT_HINTS = {
|
|
509
|
+
listDeliveries: "(no results) Often means no webhook endpoints are configured to receive deliveries. Run `primitive endpoints:list-endpoints` to check.",
|
|
510
|
+
listEndpoints: "(no results) No webhook endpoints configured. Add one with `primitive endpoints:create-endpoint --url <your-url>`.",
|
|
511
|
+
listEmails: "(no results) No inbound emails received yet on this account.",
|
|
512
|
+
listDomains: "(no results) No domains on this account. Add one with `primitive domains:add-domain --domain <yourdomain.example>`.",
|
|
513
|
+
listFilters: "(no results) No filter rules configured.",
|
|
514
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Command, Errors, Flags } from "@oclif/core";
|
|
2
|
+
import { getAccount } from "../../api/generated/sdk.gen.js";
|
|
3
|
+
import { PrimitiveApiClient } from "../../api/index.js";
|
|
4
|
+
import { extractErrorPayload, formatErrorPayload } from "../api-command.js";
|
|
5
|
+
// `primitive whoami` is the credentials smoke-test the AGX
|
|
6
|
+
// walkthrough kept asking for. Before this command, a user with a
|
|
7
|
+
// suspect API key had no fast way to verify "is my key live and
|
|
8
|
+
// pointed at the org I expect" short of trying any other call and
|
|
9
|
+
// reading a 401. That ambiguity bit two consecutive walkthroughs.
|
|
10
|
+
//
|
|
11
|
+
// Implementation: thin wrapper over /api/v1/account that prints
|
|
12
|
+
// the account email, plan, id, and onboarding status. Any auth
|
|
13
|
+
// problem surfaces as the standard error envelope, same as the
|
|
14
|
+
// generated commands.
|
|
15
|
+
class WhoamiCommand extends Command {
|
|
16
|
+
static description = `Print the account currently authenticated by the API key. Useful as a credentials smoke test: confirms the key is live and shows which account it belongs to.`;
|
|
17
|
+
static summary = "Print the authenticated account (credentials smoke test)";
|
|
18
|
+
static examples = [
|
|
19
|
+
"<%= config.bin %> whoami",
|
|
20
|
+
"<%= config.bin %> whoami --api-key prim_...",
|
|
21
|
+
];
|
|
22
|
+
static flags = {
|
|
23
|
+
"api-key": Flags.string({
|
|
24
|
+
description: "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
25
|
+
env: "PRIMITIVE_API_KEY",
|
|
26
|
+
}),
|
|
27
|
+
"base-url": Flags.string({
|
|
28
|
+
description: "API base URL (defaults to PRIMITIVE_API_URL or production)",
|
|
29
|
+
env: "PRIMITIVE_API_URL",
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const { flags } = await this.parse(WhoamiCommand);
|
|
34
|
+
const apiClient = new PrimitiveApiClient({
|
|
35
|
+
apiKey: flags["api-key"],
|
|
36
|
+
baseUrl: flags["base-url"],
|
|
37
|
+
});
|
|
38
|
+
const result = await getAccount({
|
|
39
|
+
client: apiClient.client,
|
|
40
|
+
responseStyle: "fields",
|
|
41
|
+
});
|
|
42
|
+
if (result.error) {
|
|
43
|
+
const errorPayload = extractErrorPayload(result.error);
|
|
44
|
+
process.stderr.write(`${formatErrorPayload(errorPayload)}\n`);
|
|
45
|
+
process.exitCode = 1;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const envelope = result.data;
|
|
49
|
+
const account = envelope?.data;
|
|
50
|
+
if (!account) {
|
|
51
|
+
process.stderr.write("Server returned an empty account body; this should not happen for a valid key.\n");
|
|
52
|
+
throw new Errors.CLIError("unexpected empty response");
|
|
53
|
+
}
|
|
54
|
+
// Concise human-readable summary on stderr; the full account
|
|
55
|
+
// JSON goes to stdout so a script can pipe it.
|
|
56
|
+
const onboarding = account.onboarding_completed === true
|
|
57
|
+
? "complete"
|
|
58
|
+
: account.onboarding_step
|
|
59
|
+
? `in progress (step: ${account.onboarding_step})`
|
|
60
|
+
: "incomplete";
|
|
61
|
+
process.stderr.write(`Authenticated as ${account.email}\n`);
|
|
62
|
+
process.stderr.write(` Account id: ${account.id}\n`);
|
|
63
|
+
process.stderr.write(` Plan: ${account.plan}\n`);
|
|
64
|
+
process.stderr.write(` Onboarding: ${onboarding}\n`);
|
|
65
|
+
this.log(JSON.stringify(account, null, 2));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export default WhoamiCommand;
|
package/dist/oclif/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Args, Command } from "@oclif/core";
|
|
|
2
2
|
import { operationManifest, } from "../openapi/index.js";
|
|
3
3
|
import { createOperationCommand } from "./api-command.js";
|
|
4
4
|
import SendCommand from "./commands/send.js";
|
|
5
|
+
import WhoamiCommand from "./commands/whoami.js";
|
|
5
6
|
import { renderFishCompletion } from "./fish-completion.js";
|
|
6
7
|
class ListOperationsCommand extends Command {
|
|
7
8
|
static description = "List all generated API operations";
|
|
@@ -44,5 +45,10 @@ export const COMMANDS = {
|
|
|
44
45
|
// operation stays available under sending:send-email for callers
|
|
45
46
|
// who want every flag.
|
|
46
47
|
send: SendCommand,
|
|
48
|
+
// `whoami` is the credentials smoke test. Prints the account the
|
|
49
|
+
// current API key authenticates as. AGX walkthroughs kept
|
|
50
|
+
// wanting this before risking a real call against a possibly-
|
|
51
|
+
// bad key.
|
|
52
|
+
whoami: WhoamiCommand,
|
|
47
53
|
...generatedCommands,
|
|
48
54
|
};
|
package/oclif.manifest.json
CHANGED
|
@@ -136,6 +136,42 @@
|
|
|
136
136
|
"summary": "Send an email (simplified, agent-friendly)",
|
|
137
137
|
"enableJsonFlag": false
|
|
138
138
|
},
|
|
139
|
+
"whoami": {
|
|
140
|
+
"aliases": [],
|
|
141
|
+
"args": {},
|
|
142
|
+
"description": "Print the account currently authenticated by the API key. Useful as a credentials smoke test: confirms the key is live and shows which account it belongs to.",
|
|
143
|
+
"examples": [
|
|
144
|
+
"<%= config.bin %> whoami",
|
|
145
|
+
"<%= config.bin %> whoami --api-key prim_..."
|
|
146
|
+
],
|
|
147
|
+
"flags": {
|
|
148
|
+
"api-key": {
|
|
149
|
+
"description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
150
|
+
"env": "PRIMITIVE_API_KEY",
|
|
151
|
+
"name": "api-key",
|
|
152
|
+
"hasDynamicHelp": false,
|
|
153
|
+
"multiple": false,
|
|
154
|
+
"type": "option"
|
|
155
|
+
},
|
|
156
|
+
"base-url": {
|
|
157
|
+
"description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
|
|
158
|
+
"env": "PRIMITIVE_API_URL",
|
|
159
|
+
"name": "base-url",
|
|
160
|
+
"hasDynamicHelp": false,
|
|
161
|
+
"multiple": false,
|
|
162
|
+
"type": "option"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"hasDynamicHelp": false,
|
|
166
|
+
"hiddenAliases": [],
|
|
167
|
+
"id": "whoami",
|
|
168
|
+
"pluginAlias": "@primitivedotdev/sdk",
|
|
169
|
+
"pluginName": "@primitivedotdev/sdk",
|
|
170
|
+
"pluginType": "core",
|
|
171
|
+
"strict": true,
|
|
172
|
+
"summary": "Print the authenticated account (credentials smoke test)",
|
|
173
|
+
"enableJsonFlag": false
|
|
174
|
+
},
|
|
139
175
|
"account:get-account": {
|
|
140
176
|
"aliases": [],
|
|
141
177
|
"args": {},
|
|
@@ -285,15 +321,15 @@
|
|
|
285
321
|
"multiple": false,
|
|
286
322
|
"type": "option"
|
|
287
323
|
},
|
|
288
|
-
"body": {
|
|
289
|
-
"description": "Full request body as JSON.
|
|
290
|
-
"name": "body",
|
|
324
|
+
"raw-body": {
|
|
325
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
326
|
+
"name": "raw-body",
|
|
291
327
|
"hasDynamicHelp": false,
|
|
292
328
|
"multiple": false,
|
|
293
329
|
"type": "option"
|
|
294
330
|
},
|
|
295
331
|
"body-file": {
|
|
296
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
332
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
297
333
|
"name": "body-file",
|
|
298
334
|
"hasDynamicHelp": false,
|
|
299
335
|
"multiple": false,
|
|
@@ -344,15 +380,15 @@
|
|
|
344
380
|
"multiple": false,
|
|
345
381
|
"type": "option"
|
|
346
382
|
},
|
|
347
|
-
"body": {
|
|
348
|
-
"description": "Full request body as JSON.
|
|
349
|
-
"name": "body",
|
|
383
|
+
"raw-body": {
|
|
384
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
385
|
+
"name": "raw-body",
|
|
350
386
|
"hasDynamicHelp": false,
|
|
351
387
|
"multiple": false,
|
|
352
388
|
"type": "option"
|
|
353
389
|
},
|
|
354
390
|
"body-file": {
|
|
355
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
391
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
356
392
|
"name": "body-file",
|
|
357
393
|
"hasDynamicHelp": false,
|
|
358
394
|
"multiple": false,
|
|
@@ -477,15 +513,15 @@
|
|
|
477
513
|
"multiple": false,
|
|
478
514
|
"type": "option"
|
|
479
515
|
},
|
|
480
|
-
"body": {
|
|
481
|
-
"description": "Full request body as JSON.
|
|
482
|
-
"name": "body",
|
|
516
|
+
"raw-body": {
|
|
517
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
518
|
+
"name": "raw-body",
|
|
483
519
|
"hasDynamicHelp": false,
|
|
484
520
|
"multiple": false,
|
|
485
521
|
"type": "option"
|
|
486
522
|
},
|
|
487
523
|
"body-file": {
|
|
488
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
524
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
489
525
|
"name": "body-file",
|
|
490
526
|
"hasDynamicHelp": false,
|
|
491
527
|
"multiple": false,
|
|
@@ -882,7 +918,7 @@
|
|
|
882
918
|
"endpoints:create-endpoint": {
|
|
883
919
|
"aliases": [],
|
|
884
920
|
"args": {},
|
|
885
|
-
"description": "Creates a new webhook endpoint. If a deactivated endpoint with the\nsame URL and domain exists, it is reactivated instead.\nSubject to plan limits on the number of active endpoints.\n\n\nBody fields requiring --body JSON (these are not exposed as flags):\n rules object Endpoint-specific filtering rules\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
|
|
921
|
+
"description": "Creates a new webhook endpoint. If a deactivated endpoint with the\nsame URL and domain exists, it is reactivated instead.\nSubject to plan limits on the number of active endpoints.\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n rules object Endpoint-specific filtering rules\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
|
|
886
922
|
"flags": {
|
|
887
923
|
"api-key": {
|
|
888
924
|
"description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
@@ -900,15 +936,15 @@
|
|
|
900
936
|
"multiple": false,
|
|
901
937
|
"type": "option"
|
|
902
938
|
},
|
|
903
|
-
"body": {
|
|
904
|
-
"description": "Full request body as JSON.
|
|
905
|
-
"name": "body",
|
|
939
|
+
"raw-body": {
|
|
940
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
941
|
+
"name": "raw-body",
|
|
906
942
|
"hasDynamicHelp": false,
|
|
907
943
|
"multiple": false,
|
|
908
944
|
"type": "option"
|
|
909
945
|
},
|
|
910
946
|
"body-file": {
|
|
911
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
947
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
912
948
|
"name": "body-file",
|
|
913
949
|
"hasDynamicHelp": false,
|
|
914
950
|
"multiple": false,
|
|
@@ -1060,7 +1096,7 @@
|
|
|
1060
1096
|
"endpoints:update-endpoint": {
|
|
1061
1097
|
"aliases": [],
|
|
1062
1098
|
"args": {},
|
|
1063
|
-
"description": "Updates an active webhook endpoint. If the URL is changed, the old\nendpoint is deactivated and a new one is created (or an existing\ndeactivated endpoint with the new URL is reactivated).\n\n\nBody fields requiring --body JSON (these are not exposed as flags):\n rules object\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
|
|
1099
|
+
"description": "Updates an active webhook endpoint. If the URL is changed, the old\nendpoint is deactivated and a new one is created (or an existing\ndeactivated endpoint with the new URL is reactivated).\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n rules object\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
|
|
1064
1100
|
"flags": {
|
|
1065
1101
|
"api-key": {
|
|
1066
1102
|
"description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
@@ -1086,15 +1122,15 @@
|
|
|
1086
1122
|
"multiple": false,
|
|
1087
1123
|
"type": "option"
|
|
1088
1124
|
},
|
|
1089
|
-
"body": {
|
|
1090
|
-
"description": "Full request body as JSON.
|
|
1091
|
-
"name": "body",
|
|
1125
|
+
"raw-body": {
|
|
1126
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1127
|
+
"name": "raw-body",
|
|
1092
1128
|
"hasDynamicHelp": false,
|
|
1093
1129
|
"multiple": false,
|
|
1094
1130
|
"type": "option"
|
|
1095
1131
|
},
|
|
1096
1132
|
"body-file": {
|
|
1097
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
1133
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
1098
1134
|
"name": "body-file",
|
|
1099
1135
|
"hasDynamicHelp": false,
|
|
1100
1136
|
"multiple": false,
|
|
@@ -1152,15 +1188,15 @@
|
|
|
1152
1188
|
"multiple": false,
|
|
1153
1189
|
"type": "option"
|
|
1154
1190
|
},
|
|
1155
|
-
"body": {
|
|
1156
|
-
"description": "Full request body as JSON.
|
|
1157
|
-
"name": "body",
|
|
1191
|
+
"raw-body": {
|
|
1192
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1193
|
+
"name": "raw-body",
|
|
1158
1194
|
"hasDynamicHelp": false,
|
|
1159
1195
|
"multiple": false,
|
|
1160
1196
|
"type": "option"
|
|
1161
1197
|
},
|
|
1162
1198
|
"body-file": {
|
|
1163
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
1199
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
1164
1200
|
"name": "body-file",
|
|
1165
1201
|
"hasDynamicHelp": false,
|
|
1166
1202
|
"multiple": false,
|
|
@@ -1303,15 +1339,15 @@
|
|
|
1303
1339
|
"multiple": false,
|
|
1304
1340
|
"type": "option"
|
|
1305
1341
|
},
|
|
1306
|
-
"body": {
|
|
1307
|
-
"description": "Full request body as JSON.
|
|
1308
|
-
"name": "body",
|
|
1342
|
+
"raw-body": {
|
|
1343
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1344
|
+
"name": "raw-body",
|
|
1309
1345
|
"hasDynamicHelp": false,
|
|
1310
1346
|
"multiple": false,
|
|
1311
1347
|
"type": "option"
|
|
1312
1348
|
},
|
|
1313
1349
|
"body-file": {
|
|
1314
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
1350
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
1315
1351
|
"name": "body-file",
|
|
1316
1352
|
"hasDynamicHelp": false,
|
|
1317
1353
|
"multiple": false,
|
|
@@ -1363,15 +1399,15 @@
|
|
|
1363
1399
|
"multiple": false,
|
|
1364
1400
|
"type": "option"
|
|
1365
1401
|
},
|
|
1366
|
-
"body": {
|
|
1367
|
-
"description": "Full request body as JSON.
|
|
1368
|
-
"name": "body",
|
|
1402
|
+
"raw-body": {
|
|
1403
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1404
|
+
"name": "raw-body",
|
|
1369
1405
|
"hasDynamicHelp": false,
|
|
1370
1406
|
"multiple": false,
|
|
1371
1407
|
"type": "option"
|
|
1372
1408
|
},
|
|
1373
1409
|
"body-file": {
|
|
1374
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
1410
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
1375
1411
|
"name": "body-file",
|
|
1376
1412
|
"hasDynamicHelp": false,
|
|
1377
1413
|
"multiple": false,
|
|
@@ -1418,7 +1454,7 @@
|
|
|
1418
1454
|
"sending:send-email": {
|
|
1419
1455
|
"aliases": [],
|
|
1420
1456
|
"args": {},
|
|
1421
|
-
"description": "Sends an outbound email through Primitive's outbound relay. By default\nthe request returns once the relay accepts the message for delivery.\nSet `wait: true` to wait for the first downstream SMTP delivery outcome.\n\n\nBody fields requiring --body JSON (these are not exposed as flags):\n references array<string> Full ordered message-id chain for the thread.\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
|
|
1457
|
+
"description": "Sends an outbound email through Primitive's outbound relay. By default\nthe request returns once the relay accepts the message for delivery.\nSet `wait: true` to wait for the first downstream SMTP delivery outcome.\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n references array<string> Full ordered message-id chain for the thread.\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
|
|
1422
1458
|
"flags": {
|
|
1423
1459
|
"api-key": {
|
|
1424
1460
|
"description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
@@ -1436,15 +1472,15 @@
|
|
|
1436
1472
|
"multiple": false,
|
|
1437
1473
|
"type": "option"
|
|
1438
1474
|
},
|
|
1439
|
-
"body": {
|
|
1440
|
-
"description": "Full request body as JSON.
|
|
1441
|
-
"name": "body",
|
|
1475
|
+
"raw-body": {
|
|
1476
|
+
"description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
|
|
1477
|
+
"name": "raw-body",
|
|
1442
1478
|
"hasDynamicHelp": false,
|
|
1443
1479
|
"multiple": false,
|
|
1444
1480
|
"type": "option"
|
|
1445
1481
|
},
|
|
1446
1482
|
"body-file": {
|
|
1447
|
-
"description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
|
|
1483
|
+
"description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
|
|
1448
1484
|
"name": "body-file",
|
|
1449
1485
|
"hasDynamicHelp": false,
|
|
1450
1486
|
"multiple": false,
|
|
@@ -1643,5 +1679,5 @@
|
|
|
1643
1679
|
"enableJsonFlag": false
|
|
1644
1680
|
}
|
|
1645
1681
|
},
|
|
1646
|
-
"version": "0.
|
|
1682
|
+
"version": "0.12.0"
|
|
1647
1683
|
}
|