@jinshuju/cli 0.27.0 → 0.29.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/README.md +32 -5
- package/dist/commands/checkin.js +15 -2
- package/dist/commands/field.js +1 -1
- package/dist/commands/fill.js +10 -7
- package/dist/commands/form.js +319 -11
- package/dist/commands/index.js +7 -0
- package/dist/commands/pseudo-form.d.ts +2 -0
- package/dist/commands/pseudo-form.js +110 -0
- package/dist/commands/upload.d.ts +3 -3
- package/dist/commands/upload.js +4 -3
- package/dist/generated/operations.d.ts +1 -1
- package/dist/generated/operations.js +90 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,8 +100,8 @@ jinshuju form create --json '{
|
|
|
100
100
|
block that belongs to it. That settings block has an endpoint of its own, so a
|
|
101
101
|
payload carrying it becomes two requests — and the general form update does not
|
|
102
102
|
recognise the key at all (it reads only `name`, `description`, `setting`,
|
|
103
|
-
`fields` and `
|
|
104
|
-
dropped in silence.
|
|
103
|
+
`fields`, `field_rules`, `redirect_rules` and `layout`), so without the dispatch
|
|
104
|
+
`exam_setting` would be dropped in silence.
|
|
105
105
|
|
|
106
106
|
The settings block is always sent first. It is the half that can be rejected —
|
|
107
107
|
"this is not an exam form" — and sending it first is what guarantees a rejection
|
|
@@ -232,6 +232,10 @@ jinshuju form copy Kp7mQ2 --name Copy
|
|
|
232
232
|
jinshuju form copy Kp7mQ2 --name 第二期 --with-notification-rules
|
|
233
233
|
jinshuju form move Kp7mQ2 --folder Fd2xK8 # without --folder, moves it out of its folder
|
|
234
234
|
jinshuju form theme set Kp7mQ2 --primary-color "#1F6FEB"
|
|
235
|
+
jinshuju form setting edit Kp7mQ2 --json '{"weixin_share":{"title":"2026 年会报名"}}' # the card a link shows in WeChat
|
|
236
|
+
jinshuju form redirect-rule edit Kp7mQ2 --json @redirect-rules.json # where a submission meeting conditions goes instead
|
|
237
|
+
jinshuju form cooperator add Kp7mQ2 --user 6512a1c2d3e4f5a6b7c8d9d3 --role data_viewer # account members; no invitation is sent
|
|
238
|
+
jinshuju form result-share create Kp7mQ2 --fields field_2,field_3 --stats field_3 # a link to the results, answered in url
|
|
235
239
|
jinshuju table create --json @table.json --folder Nf7mDC
|
|
236
240
|
jinshuju table edit Vn4xR8 --json '{"name":"2026 ledger"}'
|
|
237
241
|
```
|
|
@@ -280,6 +284,7 @@ jinshuju comment create --form Kp7mQ2 --entry 12 "Contacted, awaiting reply"
|
|
|
280
284
|
jinshuju opensearch edit Qy7nR3 --disable
|
|
281
285
|
jinshuju checkin create --form Kp7mQ2 # needs the check-in plugin enabled for the account
|
|
282
286
|
jinshuju checkin edit 42 --disable
|
|
287
|
+
jinshuju checkin edit 42 --success-message '签到成功,$(field_1)' # what registrants see once checked in
|
|
283
288
|
jinshuju notification create --form Kp7mQ2 --approach SMS --recipients field_2 --template-id 6650a1 --placeholder field_1
|
|
284
289
|
jinshuju notification list --form Kp7mQ2 # each rule says whether it can send, and why not
|
|
285
290
|
jinshuju notification log 6650b2 --form Kp7mQ2 --from 2026-10-01 # what the rule sent: how many succeeded, failed, and why
|
|
@@ -326,8 +331,9 @@ rejected when combined with `--mine`.
|
|
|
326
331
|
|
|
327
332
|
## Filling in someone else's form
|
|
328
333
|
|
|
329
|
-
A fill link — `…/f/<token>` for a form, `…/v/<token>` for a table's form view
|
|
330
|
-
can be filled from the CLI the way anyone with
|
|
334
|
+
A fill link — `…/f/<token>` for a form, `…/v/<token>` for a table's form view,
|
|
335
|
+
`…/pf/<token>` for a pseudo form — can be filled from the CLI the way anyone with
|
|
336
|
+
the link fills it in a browser:
|
|
331
337
|
|
|
332
338
|
```bash
|
|
333
339
|
jinshuju fill get https://acme.jinshuju.net/v/aB3dE9 # what it asks for, and whether you can submit
|
|
@@ -340,6 +346,26 @@ person at it can do — a captcha, an SMS code, WeChat, a payment — lists it u
|
|
|
340
346
|
`blockers`, and is refused until it is filled in a browser. An OAuth session
|
|
341
347
|
needs the `submit_entries` scope for these.
|
|
342
348
|
|
|
349
|
+
## Prefilled links (pseudo forms)
|
|
350
|
+
|
|
351
|
+
A pseudo form (预填写) is a fill link that opens the form with some fields
|
|
352
|
+
already filled in, such as one link per person to be reviewed. An entry
|
|
353
|
+
submitted through it keeps the preset values whatever the filler types.
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
jinshuju pseudo-form create --form Kp7mQ2 --name 张三-上司 --json '{"field_1":"张三","field_2":"上司"}'
|
|
357
|
+
jinshuju pseudo-form create --form Kp7mQ2 --batch @links.json # [{"name": "...", "values": {...}}], up to 200
|
|
358
|
+
jinshuju pseudo-form list --form Kp7mQ2 --all
|
|
359
|
+
jinshuju pseudo-form edit aB3dE9 --form Kp7mQ2 --json '{"field_2":null}' # null clears a preset; the rest keep theirs
|
|
360
|
+
jinshuju pseudo-form delete aB3dE9 Xy7Kp2 --form Kp7mQ2 --yes
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Each answer carries `fill_url`, the link to hand out. A batch makes the items it
|
|
364
|
+
can and lists the others in `errors` by index. Values are written as
|
|
365
|
+
`entry create` writes them, a choice by its code or its text. A field of a type
|
|
366
|
+
that cannot be preset, such as an attachment, is refused by name. Only a manager
|
|
367
|
+
of the form can, and the form's account needs 数据预填写 in its plan.
|
|
368
|
+
|
|
343
369
|
## Routines (自动任务)
|
|
344
370
|
|
|
345
371
|
A routine is an instruction Jiri carries out on a schedule, or when the data of
|
|
@@ -383,7 +409,7 @@ version has no such scope, and the routine commands answer it with 403 (exit
|
|
|
383
409
|
|
|
384
410
|
## Working with files
|
|
385
411
|
|
|
386
|
-
|
|
412
|
+
Ten commands take a file. The CLI uploads with its own credential; there is no
|
|
387
413
|
ticket to fetch first.
|
|
388
414
|
|
|
389
415
|
```bash
|
|
@@ -395,6 +421,7 @@ jinshuju form theme set Kp7mQ2 --wallpaper ./bg.png
|
|
|
395
421
|
jinshuju opensearch edit Qy7nR3 --header ./banner.png
|
|
396
422
|
jinshuju form wheel-fortune edit Kp7mQ2 --json @wheel.json --prize-image 一等奖=./earbuds.png
|
|
397
423
|
jinshuju form quickpay edit Kp7mQ2 --json @quickpay.json --deliverable-file 电子书=./book.pdf
|
|
424
|
+
jinshuju form setting edit Kp7mQ2 --share-icon ./logo.png # the icon of the card a link shows in WeChat
|
|
398
425
|
jinshuju form image upload ./venue-map.png # answers with a url for an <img> in a form or field description
|
|
399
426
|
jinshuju sms signature create 小金培训 --license ./license.jpg --company-name 小金培训有限公司 --company-id 91110000MA00000000 \
|
|
400
427
|
--id-card-front ./front.jpg --id-card-back ./back.jpg --id-card-name 张三 --id-card-number 110101199001011234 --mobile 13800000000
|
package/dist/commands/checkin.js
CHANGED
|
@@ -9,6 +9,14 @@ const DISPLAY_FIELD_OPTION = {
|
|
|
9
9
|
placeholder: '<api-code>',
|
|
10
10
|
description: 'Field shown to staff when they verify a check-in, usually the name'
|
|
11
11
|
};
|
|
12
|
+
const SUCCESS_MESSAGE_OPTION = {
|
|
13
|
+
name: '--success-message',
|
|
14
|
+
type: 'string',
|
|
15
|
+
placeholder: '<html>',
|
|
16
|
+
description: 'What registrants see once checked in, HTML allowed: $(field_1) puts in their answer to that field, ' +
|
|
17
|
+
'$(checkin_time) the time and, while the check-in code is on, $(gen_code) the code; any other $(...) ' +
|
|
18
|
+
'is refused. Takes the admin role on the form'
|
|
19
|
+
};
|
|
12
20
|
const TIMES_EXAMPLE = 'jinshuju checkin edit 42 --json \'{"date_settings":[{"start_date":"2026-10-20","end_date":"2026-10-21",' +
|
|
13
21
|
'"periods":["Tuesday"],"durations":[{"start":"09:00","end":"12:00"}]}]}\'';
|
|
14
22
|
function rest(input) {
|
|
@@ -55,6 +63,7 @@ export const CHECKIN = [
|
|
|
55
63
|
type: 'boolean',
|
|
56
64
|
description: 'Also make the check-in field required and unique, so every registrant can be found'
|
|
57
65
|
},
|
|
66
|
+
SUCCESS_MESSAGE_OPTION,
|
|
58
67
|
JSON_OPTION
|
|
59
68
|
],
|
|
60
69
|
request: (input) => call('createCheckinCampaign', {
|
|
@@ -64,7 +73,8 @@ export const CHECKIN = [
|
|
|
64
73
|
checkin_field_api_code: input.options.check_in_field,
|
|
65
74
|
display_field_api_code: input.options.display_field,
|
|
66
75
|
enable_checkin_code: input.options.no_check_in_code ? false : undefined,
|
|
67
|
-
checkin_field_required_unique: input.options.unique_check_in_field || undefined
|
|
76
|
+
checkin_field_required_unique: input.options.unique_check_in_field || undefined,
|
|
77
|
+
success_message: input.options.success_message
|
|
68
78
|
})
|
|
69
79
|
}),
|
|
70
80
|
examples: [
|
|
@@ -82,6 +92,7 @@ export const CHECKIN = [
|
|
|
82
92
|
DISPLAY_FIELD_OPTION,
|
|
83
93
|
{ name: '--enable', type: 'boolean', description: 'Resume check-in' },
|
|
84
94
|
{ name: '--disable', type: 'boolean', description: 'Pause check-in; records are kept' },
|
|
95
|
+
SUCCESS_MESSAGE_OPTION,
|
|
85
96
|
JSON_OPTION
|
|
86
97
|
],
|
|
87
98
|
request: (input) => {
|
|
@@ -93,12 +104,14 @@ export const CHECKIN = [
|
|
|
93
104
|
body: overriding(rest(input), {
|
|
94
105
|
name: input.options.name,
|
|
95
106
|
display_field_api_code: input.options.display_field,
|
|
96
|
-
enabled: input.options.enable ? true : input.options.disable ? false : undefined
|
|
107
|
+
enabled: input.options.enable ? true : input.options.disable ? false : undefined,
|
|
108
|
+
success_message: input.options.success_message
|
|
97
109
|
})
|
|
98
110
|
});
|
|
99
111
|
},
|
|
100
112
|
examples: [
|
|
101
113
|
'jinshuju checkin edit 42 --disable',
|
|
114
|
+
"jinshuju checkin edit 42 --success-message '签到成功,$(field_1),请到 $(field_3) 入座'",
|
|
102
115
|
TIMES_EXAMPLE,
|
|
103
116
|
'jinshuju checkin edit 42 --json \'{"geo_location":null}\''
|
|
104
117
|
]
|
package/dist/commands/field.js
CHANGED
|
@@ -16,7 +16,7 @@ const FIELD_PAYLOAD = [
|
|
|
16
16
|
' choices are changed with `field update-choices`; `field update` takes them as read,',
|
|
17
17
|
' which changes nothing, and replaces them only on a CascadeDropDown or with a `type`',
|
|
18
18
|
' that turns a text field into a choice field',
|
|
19
|
-
" a key no write can change, like
|
|
19
|
+
" a key no write can change, like api_code_alias or a choice's hidden, goes back only as",
|
|
20
20
|
' it was read; the API answers which key when one differs',
|
|
21
21
|
'',
|
|
22
22
|
'Field types: jinshuju field types'
|
package/dist/commands/fill.js
CHANGED
|
@@ -2,20 +2,22 @@ import { UsageError } from '../errors.js';
|
|
|
2
2
|
import { JSON_OPTION } from '../options.js';
|
|
3
3
|
import { call } from '../spec.js';
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
* all it takes to
|
|
5
|
+
* The kinds of fill page: `/f/<token>` for a form, `/v/<token>` for a table's
|
|
6
|
+
* form view, `/pf/<token>` for a pseudo form, a form with some fields preset.
|
|
7
|
+
* The API mirrors them as two operations each, so a link is all it takes to
|
|
8
|
+
* know which.
|
|
8
9
|
*/
|
|
9
10
|
const ROUTES = {
|
|
10
11
|
f: { token: 'form_token', page: 'getFillFormPage', submit: 'createFillFormEntry' },
|
|
11
|
-
v: { token: 'view_token', page: 'getFillViewPage', submit: 'createFillViewEntry' }
|
|
12
|
+
v: { token: 'view_token', page: 'getFillViewPage', submit: 'createFillViewEntry' },
|
|
13
|
+
pf: { token: 'pseudo_form_token', page: 'getFillPseudoFormPage', submit: 'createFillPseudoFormEntry' }
|
|
12
14
|
};
|
|
13
15
|
const PAGE_ARG = {
|
|
14
16
|
name: 'page',
|
|
15
17
|
required: true,
|
|
16
18
|
description: 'The fill link as shared, e.g. https://example.jinshuju.net/v/aB3dE9, or just its path: v/aB3dE9'
|
|
17
19
|
};
|
|
18
|
-
/** The page's or the submit's request for a fill link, or for the `f/…` / `v/…` path of one. */
|
|
20
|
+
/** The page's or the submit's request for a fill link, or for the `f/…` / `v/…` / `pf/…` path of one. */
|
|
19
21
|
function fillPage(input, what, parts = {}) {
|
|
20
22
|
const page = input.args.page.trim();
|
|
21
23
|
let path = page;
|
|
@@ -30,7 +32,7 @@ function fillPage(input, what, parts = {}) {
|
|
|
30
32
|
const [route, token] = path.split('/').filter(Boolean);
|
|
31
33
|
const kind = route !== undefined && Object.hasOwn(ROUTES, route) ? ROUTES[route] : undefined;
|
|
32
34
|
if (!kind || !token) {
|
|
33
|
-
throw new UsageError(`Not a fill link: ${page}. A fill link ends in /f/<token> or /
|
|
35
|
+
throw new UsageError(`Not a fill link: ${page}. A fill link ends in /f/<token>, /v/<token> or /pf/<token>.`);
|
|
34
36
|
}
|
|
35
37
|
return call(kind[what], { ...parts, path: { [kind.token]: token } });
|
|
36
38
|
}
|
|
@@ -42,7 +44,8 @@ export const FILL = [
|
|
|
42
44
|
'the page shows its fillers comes back. `status.key` is `open` when you can submit. `blockers` lists ' +
|
|
43
45
|
'what only the person at the page can do — a captcha, an SMS code, WeChat, a payment — and while it is ' +
|
|
44
46
|
'not empty the page has to be filled in a browser. `manageable` appears only when you could already ' +
|
|
45
|
-
'read the form or table behind the page.'
|
|
47
|
+
'read the form or table behind the page. A `/pf/` link answers `predefined_values`: the fields already ' +
|
|
48
|
+
'filled in, which a submission keeps whatever it says.',
|
|
46
49
|
args: [PAGE_ARG],
|
|
47
50
|
request: (input) => fillPage(input, 'page'),
|
|
48
51
|
examples: ['jinshuju fill get https://example.jinshuju.net/v/aB3dE9', 'jinshuju fill get f/Kp7mQ2']
|
package/dist/commands/form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FILTER_OPTION, FILTERS_OPTION, JSON_OPTION, MINE_OPTION, PAGINATION_OPTIONS, SORT_OPTION, UsageError } from '../options.js';
|
|
2
|
-
import { FOLDER_OPTION, LISTING, PREVIEW_OPTION, YES_OPTION, filters, given, keywords, overriding, paging, payload, refuseWithMine, requiredOption, sort, trash } from './shared.js';
|
|
2
|
+
import { FOLDER_OPTION, LISTING, PREVIEW_OPTION, YES_OPTION, confirmed, filters, given, keywords, overriding, paging, payload, refuseWithMine, requiredOption, sort, trash } from './shared.js';
|
|
3
3
|
import { validateContainerPayload } from '../payload.js';
|
|
4
4
|
import { bodyChoices, call } from '../spec.js';
|
|
5
5
|
import { readableSize, upload, uploadedId, uploadFormImage } from './upload.js';
|
|
@@ -66,6 +66,7 @@ const FORM_INCLUDES = {
|
|
|
66
66
|
setting: '',
|
|
67
67
|
theme: 'include_theme',
|
|
68
68
|
rules: 'include_field_rules',
|
|
69
|
+
redirect_rules: 'include_redirect_rules',
|
|
69
70
|
extended: 'include_extended_attributes',
|
|
70
71
|
transactions: 'include_transactions',
|
|
71
72
|
analytics: 'include_analytics',
|
|
@@ -244,12 +245,121 @@ const DELIVERABLE_FILE_OPTION = {
|
|
|
244
245
|
placeholder: '<name>=<file>',
|
|
245
246
|
description: 'Upload a file for the deliverable of this name in the payload, repeatable'
|
|
246
247
|
};
|
|
248
|
+
/**
|
|
249
|
+
* What `form redirect-rule edit --json` takes, shown rather than described: the
|
|
250
|
+
* three operations side by side, as `form rule edit` takes them for display rules.
|
|
251
|
+
*/
|
|
252
|
+
const REDIRECT_RULE_PAYLOAD = [
|
|
253
|
+
'{',
|
|
254
|
+
' "add": [',
|
|
255
|
+
' { "redirect_url": "https://example.com/paper-b", "operator": "or",',
|
|
256
|
+
' "conditions": [ { "trigger": "field_3", "value": "B 卷" } ] }',
|
|
257
|
+
' ],',
|
|
258
|
+
' "update": [ { "index": 0, "redirect_url": "https://example.com/next" } ],',
|
|
259
|
+
' "remove": [ 1 ]',
|
|
260
|
+
'}',
|
|
261
|
+
'',
|
|
262
|
+
"A submission that meets a rule's conditions goes to its redirect_url instead",
|
|
263
|
+
'of the success page; "operator" combines the conditions with or (the default)',
|
|
264
|
+
'or and. A condition names its trigger field by api_code, and the choice it',
|
|
265
|
+
'compares with by its value or its api_code, which is how it reads back.',
|
|
266
|
+
'"comparator" defaults to the first the field takes, and one it does not take',
|
|
267
|
+
'is answered with those it does. update and remove name a rule by the index',
|
|
268
|
+
'`form redirect-rule get` shows, and one index cannot be both. Adding or',
|
|
269
|
+
'changing a rule needs a plan with field_redirect_rules; removing one does',
|
|
270
|
+
'not. A table has no redirect rules.',
|
|
271
|
+
'',
|
|
272
|
+
'Trigger fields and their choices: jinshuju field list --form <token>'
|
|
273
|
+
];
|
|
274
|
+
/**
|
|
275
|
+
* The flags of a result share, beside `--json` for the rest. The three lists are
|
|
276
|
+
* what a share is for, and a list left out on create shows nothing of its kind,
|
|
277
|
+
* so they are the ones worth a flag each.
|
|
278
|
+
*/
|
|
279
|
+
const RESULT_SHARE_OPTIONS = [
|
|
280
|
+
{ name: '--title', type: 'string', placeholder: '<title>', description: "Page title; the form's name when empty" },
|
|
281
|
+
{
|
|
282
|
+
name: '--fields',
|
|
283
|
+
type: 'list',
|
|
284
|
+
placeholder: '<api-code,...>',
|
|
285
|
+
description: 'Fields whose values visitors see entry by entry'
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: '--stats',
|
|
289
|
+
type: 'list',
|
|
290
|
+
placeholder: '<api-code,...>',
|
|
291
|
+
description: "Fields whose statistics visitors see; only fields the form's report has statistics for"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: '--masked',
|
|
295
|
+
type: 'list',
|
|
296
|
+
placeholder: '<api-code,...>',
|
|
297
|
+
description: "Fields shown partly hidden, such as names and mobile numbers; --masked '' hides none"
|
|
298
|
+
},
|
|
299
|
+
{ name: '--password', type: 'string', placeholder: '<password>', description: 'Ask visitors for this password' },
|
|
300
|
+
JSON_OPTION
|
|
301
|
+
];
|
|
302
|
+
const RESULT_SHARE_ARG = {
|
|
303
|
+
name: 'share',
|
|
304
|
+
required: true,
|
|
305
|
+
description: 'Result share token, from `form result-share list`'
|
|
306
|
+
};
|
|
307
|
+
/** A result share's body: `--json`, with the flags that were given laid over it. */
|
|
308
|
+
function resultShareBody(input) {
|
|
309
|
+
const json = input.options.json;
|
|
310
|
+
if (json !== undefined && !isRecord(json))
|
|
311
|
+
throw new UsageError('--json must be a JSON object');
|
|
312
|
+
if (input.options.enable && input.options.disable) {
|
|
313
|
+
throw new UsageError('--enable and --disable are opposites, pass one');
|
|
314
|
+
}
|
|
315
|
+
const password = input.options.password;
|
|
316
|
+
if (password !== undefined && input.options.no_password) {
|
|
317
|
+
throw new UsageError('--password and --no-password are opposites, pass one');
|
|
318
|
+
}
|
|
319
|
+
return overriding(json ?? {}, {
|
|
320
|
+
title: input.options.title,
|
|
321
|
+
enabled: input.options.enable ? true : input.options.disable ? false : undefined,
|
|
322
|
+
readable_field_api_codes: input.options.fields,
|
|
323
|
+
report_field_api_codes: input.options.stats,
|
|
324
|
+
privacy_protected_field_api_codes: input.options.masked,
|
|
325
|
+
// The API takes a password only beside the switch that asks for it, and
|
|
326
|
+
// turning the switch off is what clears one.
|
|
327
|
+
password_required: password !== undefined ? true : input.options.no_password ? false : undefined,
|
|
328
|
+
access_password: password
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* What `form setting edit --json` takes, shown rather than described: the
|
|
333
|
+
* WeChat share card, which is the reason the command exists, and one setting
|
|
334
|
+
* `form edit` writes as well, to say the two overlap.
|
|
335
|
+
*/
|
|
336
|
+
const SETTING_PAYLOAD = [
|
|
337
|
+
'{',
|
|
338
|
+
' "weixin_share": {',
|
|
339
|
+
' "title": "2026 年会报名",',
|
|
340
|
+
' "description": "点开填写,三分钟搞定",',
|
|
341
|
+
' "predefined_icon": 3',
|
|
342
|
+
' },',
|
|
343
|
+
' "show_progress": true',
|
|
344
|
+
'}',
|
|
345
|
+
'',
|
|
346
|
+
'Only the keys present are written. weixin_share is the card a link to the form',
|
|
347
|
+
'shows when shared in WeChat: a null or empty title or description shows the',
|
|
348
|
+
"form's own, and the icon is one of predefined_icon (1 to 35, the settings",
|
|
349
|
+
"page's), icon_image_url or icon_attachment_id, at most one of them; a custom",
|
|
350
|
+
'icon needs customized_weixin_thumbnail in the plan. --share-icon uploads an',
|
|
351
|
+
'image and sets icon_attachment_id.',
|
|
352
|
+
'',
|
|
353
|
+
'Most keys here go in the setting of a `form edit` payload too. weixin_share,',
|
|
354
|
+
'enable_qrcode, show_progress and the data push (entry_post_url, post_new_entry,',
|
|
355
|
+
'post_updated_entry) go only here; the payment accounts, payment expiry and',
|
|
356
|
+
'submission regions only there.',
|
|
357
|
+
'',
|
|
358
|
+
'The fields success_redirect_fields names by api_code: jinshuju field list --form <token>'
|
|
359
|
+
];
|
|
247
360
|
function themeBody(input) {
|
|
248
361
|
const rest = input.options.json ?? {};
|
|
249
|
-
return overriding(rest, {
|
|
250
|
-
primary_color: input.options.primary_color,
|
|
251
|
-
secondary_color: input.options.secondary_color
|
|
252
|
-
});
|
|
362
|
+
return overriding(rest, { primary_color: input.options.primary_color });
|
|
253
363
|
}
|
|
254
364
|
/** The scenes a form can be created for, as the API names them. */
|
|
255
365
|
const FORM_SCENES = bodyChoices('createForm', 'scene');
|
|
@@ -258,7 +368,7 @@ const FORM_SCENES = bodyChoices('createForm', 'scene');
|
|
|
258
368
|
* that belongs to it. Those settings live behind their own endpoint, so a
|
|
259
369
|
* payload carrying one is two requests, not one — and a generic edit would
|
|
260
370
|
* drop the block on the floor, since the form update only reads name,
|
|
261
|
-
* description, setting, fields and
|
|
371
|
+
* description, setting, fields, field_rules, redirect_rules and layout.
|
|
262
372
|
*/
|
|
263
373
|
const FORM_TYPES = {
|
|
264
374
|
normal: {},
|
|
@@ -426,7 +536,9 @@ export const FORM = [
|
|
|
426
536
|
description: 'The payload carries the operations to apply: name, description, setting, layout, and fields as ' +
|
|
427
537
|
'{add, update, update_choices, remove}. Only what is named changes. Switching layout keeps every ' +
|
|
428
538
|
'field; the card layout hides the ones it cannot show and the classic layout shows them again. `form create --help` ' +
|
|
429
|
-
'shows what setting takes, the close rules among it
|
|
539
|
+
'shows what setting takes, the close rules among it; `form setting edit` writes the few settings this ' +
|
|
540
|
+
'payload cannot, the WeChat share card among them. Display and redirect rules have commands of their ' +
|
|
541
|
+
'own: `form rule edit` and `form redirect-rule edit`.',
|
|
430
542
|
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
431
543
|
options: [JSON_OPTION],
|
|
432
544
|
run: async (input, client) => {
|
|
@@ -513,13 +625,12 @@ export const FORM = [
|
|
|
513
625
|
{
|
|
514
626
|
path: ['form', 'theme', 'set'],
|
|
515
627
|
summary: "Set a form's theme",
|
|
516
|
-
description: 'The
|
|
628
|
+
description: 'The primary colour has a flag of its own, and --wallpaper and --header each upload an image and ' +
|
|
517
629
|
'bind it to the theme in one command. Everything else the theme takes — typography, ' +
|
|
518
630
|
'form_container, submit_button — goes through --json.',
|
|
519
631
|
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
520
632
|
options: [
|
|
521
633
|
{ name: '--primary-color', type: 'string', placeholder: '<hex>', description: 'Primary colour, e.g. #1F6FEB' },
|
|
522
|
-
{ name: '--secondary-color', type: 'string', placeholder: '<hex>', description: 'Secondary colour' },
|
|
523
634
|
{
|
|
524
635
|
name: '--wallpaper',
|
|
525
636
|
type: 'string',
|
|
@@ -551,6 +662,68 @@ export const FORM = [
|
|
|
551
662
|
'jinshuju form theme set Kp7mQ2 --wallpaper ./bg.png'
|
|
552
663
|
]
|
|
553
664
|
},
|
|
665
|
+
{
|
|
666
|
+
path: ['form', 'setting', 'get'],
|
|
667
|
+
summary: "Show a form's settings, the WeChat share card among them",
|
|
668
|
+
description: 'What happens after submitting, when the form takes entries, its access policy and WeChat limits, the ' +
|
|
669
|
+
'card a link to it shows when shared in WeChat (weixin_share) and its data push. `form get` carries ' +
|
|
670
|
+
'most of them under setting as well.',
|
|
671
|
+
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
672
|
+
request: (input) => call('getFormSetting', { path: { form_token: input.args.form } }),
|
|
673
|
+
examples: ['jinshuju form setting get Kp7mQ2']
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
path: ['form', 'setting', 'edit'],
|
|
677
|
+
summary: "Edit a form's settings, the WeChat share card among them",
|
|
678
|
+
description: 'Writes the settings through their own endpoint, which takes the few that a `form edit` payload ' +
|
|
679
|
+
'cannot: the WeChat share card above all. --share-icon uploads an image and makes it the icon of ' +
|
|
680
|
+
'that card in one command.',
|
|
681
|
+
payload: SETTING_PAYLOAD,
|
|
682
|
+
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
683
|
+
options: [
|
|
684
|
+
JSON_OPTION,
|
|
685
|
+
{
|
|
686
|
+
name: '--share-icon',
|
|
687
|
+
type: 'string',
|
|
688
|
+
placeholder: '<file>',
|
|
689
|
+
description: 'Image file to use as the icon of the card a link to the form shows in WeChat'
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
run: async (input, client) => {
|
|
693
|
+
const json = input.options.json;
|
|
694
|
+
const icon = input.options.share_icon;
|
|
695
|
+
if (json === undefined && icon === undefined)
|
|
696
|
+
throw new UsageError('pass --json, --share-icon or both');
|
|
697
|
+
if (json !== undefined && !isRecord(json))
|
|
698
|
+
throw new UsageError('--json must be a JSON object');
|
|
699
|
+
const path = { form_token: input.args.form };
|
|
700
|
+
const body = { ...json };
|
|
701
|
+
if (icon === undefined)
|
|
702
|
+
return client.request(call('updateFormSetting', { path, body }));
|
|
703
|
+
const share = isRecord(body.weixin_share) ? body.weixin_share : {};
|
|
704
|
+
// The other two icon keys would be refused beside the uploaded one, so
|
|
705
|
+
// they are said to clash before an image goes up for nothing.
|
|
706
|
+
for (const key of ['predefined_icon', 'icon_image_url', 'icon_attachment_id']) {
|
|
707
|
+
if (share[key] !== undefined)
|
|
708
|
+
throw new UsageError(`--share-icon sets the icon, so weixin_share.${key} cannot`);
|
|
709
|
+
}
|
|
710
|
+
client.check?.(call('updateFormSetting', { path, body: { ...body, weixin_share: { ...share } } }));
|
|
711
|
+
const attachment = await uploadFormImage(client, icon, 'weixin_share_icon');
|
|
712
|
+
const saved = { ...body, weixin_share: { ...share, icon_attachment_id: attachment } };
|
|
713
|
+
try {
|
|
714
|
+
return await client.request(call('updateFormSetting', { path, body: saved }));
|
|
715
|
+
}
|
|
716
|
+
catch (error) {
|
|
717
|
+
throw new Error(`uploaded ${icon} as icon_attachment_id ${attachment}, but saving the settings failed: ` +
|
|
718
|
+
`${error.message}. Put the id in weixin_share to run again without uploading it again.`, { cause: error });
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
examples: [
|
|
722
|
+
'jinshuju form setting edit Kp7mQ2 --json \'{"weixin_share":{"title":"2026 年会报名","description":"点开填写,三分钟搞定"}}\'',
|
|
723
|
+
'jinshuju form setting edit Kp7mQ2 --json \'{"weixin_share":{"predefined_icon":3}}\'',
|
|
724
|
+
'jinshuju form setting edit Kp7mQ2 --share-icon ./logo.png'
|
|
725
|
+
]
|
|
726
|
+
},
|
|
554
727
|
{
|
|
555
728
|
path: ['form', 'image', 'upload'],
|
|
556
729
|
summary: 'Upload an image for a form or field description',
|
|
@@ -565,7 +738,8 @@ export const FORM = [
|
|
|
565
738
|
path: ['form', 'rule', 'get'],
|
|
566
739
|
summary: 'Show the field display rules of a form',
|
|
567
740
|
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
568
|
-
request: (input) => call('listFieldRules', { path: { form_token: input.args.form } })
|
|
741
|
+
request: (input) => call('listFieldRules', { path: { form_token: input.args.form } }),
|
|
742
|
+
text: { essentialLists: ['conditions'] }
|
|
569
743
|
},
|
|
570
744
|
{
|
|
571
745
|
path: ['form', 'rule', 'edit'],
|
|
@@ -575,6 +749,98 @@ export const FORM = [
|
|
|
575
749
|
options: [JSON_OPTION],
|
|
576
750
|
request: (input) => call('updateForm', { path: { form_token: input.args.form }, body: { field_rules: payload(input) } })
|
|
577
751
|
},
|
|
752
|
+
{
|
|
753
|
+
path: ['form', 'redirect-rule', 'get'],
|
|
754
|
+
summary: 'Show where a form sends a submission that meets conditions, instead of its success page',
|
|
755
|
+
description: 'Each rule with the index `form redirect-rule edit` names it by. They take effect on a plan with ' +
|
|
756
|
+
'field_redirect_rules; `form get --include redirect_rules` reads them along with the form.',
|
|
757
|
+
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
758
|
+
request: (input) => call('listRedirectRules', { path: { form_token: input.args.form } }),
|
|
759
|
+
// A rule without its conditions says where a submission goes but not when,
|
|
760
|
+
// and a table of rules has no room for them.
|
|
761
|
+
text: { essentialLists: ['conditions'] },
|
|
762
|
+
examples: ['jinshuju form redirect-rule get Kp7mQ2']
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
path: ['form', 'redirect-rule', 'edit'],
|
|
766
|
+
summary: 'Edit where a form sends a submission that meets conditions, instead of its success page',
|
|
767
|
+
description: 'The payload is {add, update, remove}; a rule is targeted by the index `form redirect-rule get` shows. ' +
|
|
768
|
+
'One redirect for every submission is the setting instead: entry_submit_mode and success_redirect_url ' +
|
|
769
|
+
'in a `form edit` payload.',
|
|
770
|
+
payload: REDIRECT_RULE_PAYLOAD,
|
|
771
|
+
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
772
|
+
options: [JSON_OPTION],
|
|
773
|
+
request: (input) => call('updateForm', { path: { form_token: input.args.form }, body: { redirect_rules: payload(input) } }),
|
|
774
|
+
examples: [
|
|
775
|
+
'jinshuju form redirect-rule edit Kp7mQ2 --json \'{"add":[{"redirect_url":"https://example.com/paper-b","conditions":[{"trigger":"field_3","value":"B 卷"}]}]}\'',
|
|
776
|
+
'jinshuju form redirect-rule edit Kp7mQ2 --json \'{"remove":[0]}\''
|
|
777
|
+
]
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
path: ['form', 'result-share', 'list'],
|
|
781
|
+
summary: "List a form's result shares (结果分享), newest first",
|
|
782
|
+
description: "Links that show the form's entries and statistics to whoever opens them, each with its url.",
|
|
783
|
+
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
784
|
+
request: (input) => call('listOpenResults', { path: { form_token: input.args.form } }),
|
|
785
|
+
examples: ['jinshuju form result-share list Kp7mQ2']
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
path: ['form', 'result-share', 'get'],
|
|
789
|
+
summary: 'Show a result share and its link',
|
|
790
|
+
args: [{ name: 'form', required: true, description: 'Form token' }, RESULT_SHARE_ARG],
|
|
791
|
+
request: (input) => call('getOpenResult', { path: { form_token: input.args.form, token: input.args.share } }),
|
|
792
|
+
examples: ['jinshuju form result-share get Kp7mQ2 Rs8kT2']
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
path: ['form', 'result-share', 'create'],
|
|
796
|
+
summary: "Share a form's results through a link, answered in url",
|
|
797
|
+
description: 'Visitors see the values of --fields entry by entry and the statistics of --stats; a list left out ' +
|
|
798
|
+
"shows nothing of its kind. The rest takes the settings page's defaults: anyone with the link gets in, " +
|
|
799
|
+
'without a password, and every field that can be partly hidden is, which --masked replaces. ' +
|
|
800
|
+
'Forms only, not quick payment forms; the plan must include 结果分享, and caps how many a form has.',
|
|
801
|
+
args: [{ name: 'form', required: true, description: 'Form token' }],
|
|
802
|
+
options: RESULT_SHARE_OPTIONS,
|
|
803
|
+
request: (input) => call('createOpenResult', { path: { form_token: input.args.form }, body: resultShareBody(input) }),
|
|
804
|
+
examples: [
|
|
805
|
+
'jinshuju form result-share create Kp7mQ2 --title 积分公示 --fields field_2,field_3 --stats field_3',
|
|
806
|
+
'jinshuju form result-share create Kp7mQ2 --stats field_4 --password 2026'
|
|
807
|
+
]
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
path: ['form', 'result-share', 'edit'],
|
|
811
|
+
summary: 'Edit a result share, or turn it off and on',
|
|
812
|
+
description: 'Only what is named changes, and a list given replaces the one stored; the link stays the same. ' +
|
|
813
|
+
'A share open only to submitters or behind SMS verification keeps that audience, and is changed ' +
|
|
814
|
+
'on the settings page.',
|
|
815
|
+
args: [{ name: 'form', required: true, description: 'Form token' }, RESULT_SHARE_ARG],
|
|
816
|
+
options: [
|
|
817
|
+
...RESULT_SHARE_OPTIONS,
|
|
818
|
+
{ name: '--no-password', type: 'boolean', description: 'Let visitors in without a password again' },
|
|
819
|
+
{ name: '--enable', type: 'boolean', description: 'Turn the link back on' },
|
|
820
|
+
{ name: '--disable', type: 'boolean', description: 'Keep the link, showing visitors that nothing is shared' }
|
|
821
|
+
],
|
|
822
|
+
request: (input) => {
|
|
823
|
+
const body = resultShareBody(input);
|
|
824
|
+
if (Object.keys(body).length === 0)
|
|
825
|
+
throw new UsageError('name something to change, with a flag or --json');
|
|
826
|
+
return call('updateOpenResult', { path: { form_token: input.args.form, token: input.args.share }, body });
|
|
827
|
+
},
|
|
828
|
+
examples: [
|
|
829
|
+
'jinshuju form result-share edit Kp7mQ2 Rs8kT2 --fields field_2,field_3,field_5',
|
|
830
|
+
'jinshuju form result-share edit Kp7mQ2 Rs8kT2 --disable'
|
|
831
|
+
]
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
path: ['form', 'result-share', 'delete'],
|
|
835
|
+
summary: 'Delete a result share; its link stops working',
|
|
836
|
+
args: [{ name: 'form', required: true, description: 'Form token' }, RESULT_SHARE_ARG],
|
|
837
|
+
options: [YES_OPTION],
|
|
838
|
+
request: (input) => {
|
|
839
|
+
confirmed(input, `Deleting result share ${input.args.share}`, 'stops its link for good');
|
|
840
|
+
return call('deleteOpenResult', { path: { form_token: input.args.form, token: input.args.share } });
|
|
841
|
+
},
|
|
842
|
+
examples: ['jinshuju form result-share delete Kp7mQ2 Rs8kT2 --yes']
|
|
843
|
+
},
|
|
578
844
|
{
|
|
579
845
|
path: ['form', 'wheel-fortune', 'get'],
|
|
580
846
|
summary: "Show a form's lucky wheel: prizes, draws, how winners redeem",
|
|
@@ -707,7 +973,49 @@ export const FORM = [
|
|
|
707
973
|
{
|
|
708
974
|
path: ['form', 'cooperator', 'list'],
|
|
709
975
|
summary: 'List the cooperators of a form',
|
|
710
|
-
|
|
976
|
+
description: "A table's token reads a table's cooperators the same way.",
|
|
977
|
+
args: [{ name: 'form', required: true, description: 'Form token, or a table token' }],
|
|
711
978
|
request: (input) => call('listFormCooperators', { path: { form_token: input.args.form } })
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
path: ['form', 'cooperator', 'add'],
|
|
982
|
+
summary: 'Add account members to a form as cooperators, all with one role',
|
|
983
|
+
description: "As adding team members on the form's cooperation page does; no invitation is sent. Only active " +
|
|
984
|
+
'members of the account can be added, by the id `account member list` shows. One deactivated, ' +
|
|
985
|
+
'outside the account or a cooperator already (through a folder too) adds nobody, and so does ' +
|
|
986
|
+
'needing more seats than the form has left outside the Enterprise plans. A table token adds ' +
|
|
987
|
+
'cooperators to the table, which has only the manager and data_viewer roles.',
|
|
988
|
+
args: [{ name: 'form', required: true, description: 'Form token, or a table token' }],
|
|
989
|
+
options: [
|
|
990
|
+
{
|
|
991
|
+
name: '--user',
|
|
992
|
+
type: 'string',
|
|
993
|
+
repeatable: true,
|
|
994
|
+
placeholder: '<id>',
|
|
995
|
+
description: 'Account member id, from `jinshuju account member list`; repeatable, up to 100'
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
name: '--role',
|
|
999
|
+
type: 'string',
|
|
1000
|
+
choices: bodyChoices('createFormCooperators', 'role'),
|
|
1001
|
+
placeholder: '<role>',
|
|
1002
|
+
description: 'manager administers the form, data_maintainer adds, edits, deletes and exports entries, ' +
|
|
1003
|
+
'data_viewer reads and exports them'
|
|
1004
|
+
}
|
|
1005
|
+
],
|
|
1006
|
+
request: (input) => {
|
|
1007
|
+
const users = input.options.user ?? [];
|
|
1008
|
+
if (users.length === 0) {
|
|
1009
|
+
throw new UsageError('--user is required: an account member id, from `jinshuju account member list`');
|
|
1010
|
+
}
|
|
1011
|
+
return call('createFormCooperators', {
|
|
1012
|
+
path: { form_token: input.args.form },
|
|
1013
|
+
body: { user_ids: users, role: requiredOption(input, 'role') }
|
|
1014
|
+
});
|
|
1015
|
+
},
|
|
1016
|
+
examples: [
|
|
1017
|
+
'jinshuju form cooperator add Kp7mQ2 --user 6512a1c2d3e4f5a6b7c8d9d3 --role data_viewer',
|
|
1018
|
+
'jinshuju form cooperator add Kp7mQ2 --user 6512a1c2d3e4f5a6b7c8d9d3 --user 6512a1c2d3e4f5a6b7c8d9d4 --role manager'
|
|
1019
|
+
]
|
|
712
1020
|
}
|
|
713
1021
|
];
|
package/dist/commands/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { LOCAL } from './local.js';
|
|
|
21
21
|
import { MESSAGE } from './message.js';
|
|
22
22
|
import { NOTIFICATION } from './notification.js';
|
|
23
23
|
import { OPENSEARCH } from './opensearch.js';
|
|
24
|
+
import { PSEUDO_FORM } from './pseudo-form.js';
|
|
24
25
|
import { ROUTINE } from './routine.js';
|
|
25
26
|
import { SMS } from './sms.js';
|
|
26
27
|
import { TABLE } from './table.js';
|
|
@@ -43,6 +44,11 @@ export const RESOURCES = [
|
|
|
43
44
|
{ name: 'entry', summary: 'Manage entries' },
|
|
44
45
|
{ name: 'comment', summary: 'Manage entry comments' },
|
|
45
46
|
{ name: 'opensearch', summary: 'Manage public queries' },
|
|
47
|
+
{
|
|
48
|
+
name: 'pseudo-form',
|
|
49
|
+
summary: 'Pseudo forms (预填写): fill links with some fields already filled in, one per person or row',
|
|
50
|
+
note: 'Only a manager of the form can create, edit or delete them, and the form’s account needs 数据预填写 in its plan.'
|
|
51
|
+
},
|
|
46
52
|
{
|
|
47
53
|
name: 'notification',
|
|
48
54
|
summary: 'Notification rules: SMS, email and WeChat to submitters, bots and webhooks to your team',
|
|
@@ -108,6 +114,7 @@ export const COMMANDS = [
|
|
|
108
114
|
...ENTRY,
|
|
109
115
|
...COMMENT,
|
|
110
116
|
...OPENSEARCH,
|
|
117
|
+
...PSEUDO_FORM,
|
|
111
118
|
...NOTIFICATION,
|
|
112
119
|
...ROUTINE,
|
|
113
120
|
...CHECKIN,
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { UsageError } from '../errors.js';
|
|
2
|
+
import { JSON_OPTION, PAGINATION_OPTIONS } from '../options.js';
|
|
3
|
+
import { call } from '../spec.js';
|
|
4
|
+
import { FORM_OPTION, LISTING, YES_OPTION, confirmed, given, paging, requiredOption } from './shared.js';
|
|
5
|
+
const NAME_OPTION = {
|
|
6
|
+
name: '--name',
|
|
7
|
+
type: 'string',
|
|
8
|
+
placeholder: '<name>',
|
|
9
|
+
description: 'Name shown in the form’s pseudo form list, e.g. who the link is for'
|
|
10
|
+
};
|
|
11
|
+
const VALUES_PAYLOAD = [
|
|
12
|
+
'{ "field_1": "张三", "field_3": "研发部" }',
|
|
13
|
+
'',
|
|
14
|
+
'Keyed by field api_code, as `jinshuju field list --form <token>` lists them, each value written as',
|
|
15
|
+
'`entry create` writes it: a choice by its code or its text. Not every type can be preset; one that',
|
|
16
|
+
'cannot, such as an attachment, is refused by name.'
|
|
17
|
+
];
|
|
18
|
+
function formPath(input) {
|
|
19
|
+
return { form_token: requiredOption(input, 'form') };
|
|
20
|
+
}
|
|
21
|
+
function batchItems(input) {
|
|
22
|
+
const items = input.options.batch;
|
|
23
|
+
if (input.options.json !== undefined || input.options.name !== undefined) {
|
|
24
|
+
throw new UsageError('--batch carries each item’s name and values; it does not go with --json or --name');
|
|
25
|
+
}
|
|
26
|
+
if (!Array.isArray(items))
|
|
27
|
+
throw new UsageError('--batch must be a list of {"name", "values"}');
|
|
28
|
+
return items;
|
|
29
|
+
}
|
|
30
|
+
export const PSEUDO_FORM = [
|
|
31
|
+
{
|
|
32
|
+
path: ['pseudo-form', 'list'],
|
|
33
|
+
summary: 'List the pseudo forms (prefilled links) of a form, newest first',
|
|
34
|
+
description: 'The ones made in the web app are listed too. fill_url is the link to hand out.',
|
|
35
|
+
options: [FORM_OPTION, ...PAGINATION_OPTIONS],
|
|
36
|
+
request: (input) => call('listPseudoForms', { path: formPath(input), query: paging(input) }),
|
|
37
|
+
paginate: LISTING,
|
|
38
|
+
examples: ['jinshuju pseudo-form list --form Kp7mQ2']
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
path: ['pseudo-form', 'create'],
|
|
42
|
+
summary: 'Create a pseudo form: a fill link with some fields already filled in',
|
|
43
|
+
description: 'The answer’s fill_url is the link to hand out; an entry submitted through it keeps the preset values ' +
|
|
44
|
+
'whatever the filler types. --batch makes one link per item, up to 200 in a request: the items it ' +
|
|
45
|
+
'could not make come back in errors by index, and the rest are made. Only a manager of the form can.',
|
|
46
|
+
options: [
|
|
47
|
+
FORM_OPTION,
|
|
48
|
+
NAME_OPTION,
|
|
49
|
+
JSON_OPTION,
|
|
50
|
+
{
|
|
51
|
+
name: '--batch',
|
|
52
|
+
type: 'json',
|
|
53
|
+
placeholder: '<json|@file|->',
|
|
54
|
+
description: 'One pseudo form per item, up to 200: [{"name": "...", "values": {...}}]'
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
payload: VALUES_PAYLOAD,
|
|
58
|
+
request: (input) => {
|
|
59
|
+
if (input.options.batch !== undefined) {
|
|
60
|
+
return call('createPseudoFormsBatch', { path: formPath(input), body: { pseudo_forms: batchItems(input) } });
|
|
61
|
+
}
|
|
62
|
+
const values = input.options.json;
|
|
63
|
+
if (values === undefined)
|
|
64
|
+
throw new UsageError('--json is required: the preset values, keyed by api_code');
|
|
65
|
+
return call('createPseudoForm', { path: formPath(input), body: given({ name: input.options.name, values }) });
|
|
66
|
+
},
|
|
67
|
+
examples: [
|
|
68
|
+
'jinshuju pseudo-form create --form Kp7mQ2 --name 张三-上司 --json \'{"field_1":"张三","field_2":"上司"}\'',
|
|
69
|
+
'jinshuju pseudo-form create --form Kp7mQ2 --batch @links.json'
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
path: ['pseudo-form', 'edit'],
|
|
74
|
+
summary: 'Rename a pseudo form or change its preset values',
|
|
75
|
+
description: 'Only what is named changes: the fields in --json take the new values, a field set to null loses its ' +
|
|
76
|
+
'preset, and the fields left out keep theirs. The fill link stays the same.',
|
|
77
|
+
args: [
|
|
78
|
+
{ name: 'pseudo-form', required: true, description: 'Pseudo form token, the end of its fill_url (/pf/<token>)' }
|
|
79
|
+
],
|
|
80
|
+
options: [FORM_OPTION, NAME_OPTION, JSON_OPTION],
|
|
81
|
+
payload: VALUES_PAYLOAD,
|
|
82
|
+
request: (input) => {
|
|
83
|
+
const body = given({ name: input.options.name, values: input.options.json });
|
|
84
|
+
if (Object.keys(body).length === 0)
|
|
85
|
+
throw new UsageError('Nothing to change: pass --name, --json or both');
|
|
86
|
+
return call('updatePseudoForm', {
|
|
87
|
+
path: { ...formPath(input), pseudo_form_token: input.args['pseudo-form'] },
|
|
88
|
+
body
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
examples: ['jinshuju pseudo-form edit aB3dE9 --form Kp7mQ2 --json \'{"field_2":null}\'']
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
path: ['pseudo-form', 'delete'],
|
|
95
|
+
summary: 'Delete pseudo forms; their fill links stop working',
|
|
96
|
+
description: 'Several tokens go in one request, up to 200; the ones that name none of the form’s pseudo forms ' +
|
|
97
|
+
'come back in not_found_tokens.',
|
|
98
|
+
args: [{ name: 'pseudo-form', required: true, variadic: true, description: 'Pseudo form token(s)' }],
|
|
99
|
+
options: [FORM_OPTION, YES_OPTION],
|
|
100
|
+
request: (input) => {
|
|
101
|
+
const tokens = input.rest;
|
|
102
|
+
confirmed(input, `Deleting ${tokens.length === 1 ? `pseudo form ${tokens[0]}` : `${tokens.length} pseudo forms`}`);
|
|
103
|
+
if (tokens.length === 1) {
|
|
104
|
+
return call('deletePseudoForm', { path: { ...formPath(input), pseudo_form_token: tokens[0] } });
|
|
105
|
+
}
|
|
106
|
+
return call('deletePseudoFormsBatch', { path: formPath(input), body: { tokens } });
|
|
107
|
+
},
|
|
108
|
+
examples: ['jinshuju pseudo-form delete aB3dE9 Xy7Kp2 --form Kp7mQ2 --yes']
|
|
109
|
+
}
|
|
110
|
+
];
|
|
@@ -4,7 +4,7 @@ import { type OperationId } from '../spec.js';
|
|
|
4
4
|
* What the CLI uploads a form image as. A test holds the list to the spec's
|
|
5
5
|
* `image_type`, which is where it would otherwise drift.
|
|
6
6
|
*/
|
|
7
|
-
export declare const FORM_IMAGE_TYPES: readonly ["description", "header", "wallpaper", "opensearch_header", "wheel_fortune_prize"];
|
|
7
|
+
export declare const FORM_IMAGE_TYPES: readonly ["description", "header", "wallpaper", "opensearch_header", "wheel_fortune_prize", "weixin_share_icon"];
|
|
8
8
|
export type FormImageType = (typeof FORM_IMAGE_TYPES)[number];
|
|
9
9
|
/**
|
|
10
10
|
* A file on disk, as multipart. The three endpoints that take one authenticate
|
|
@@ -29,8 +29,8 @@ interface Upload {
|
|
|
29
29
|
/** A file uploaded with a progress line while it goes, answered by its id. */
|
|
30
30
|
export declare function uploadedId(client: HttpClient, { id, path, file, extra, key }: Upload): Promise<string>;
|
|
31
31
|
/**
|
|
32
|
-
* An image that a form's theme, one of its public queries
|
|
33
|
-
* refers to by id, uploaded with `imageType` saying which.
|
|
32
|
+
* An image that a form's theme, one of its public queries, a prize of its lucky wheel
|
|
33
|
+
* or its WeChat share card refers to by id, uploaded with `imageType` saying which.
|
|
34
34
|
*/
|
|
35
35
|
export declare function uploadFormImage(client: HttpClient, file: string, imageType: FormImageType): Promise<string>;
|
|
36
36
|
export {};
|
package/dist/commands/upload.js
CHANGED
|
@@ -30,7 +30,8 @@ export const FORM_IMAGE_TYPES = [
|
|
|
30
30
|
'header',
|
|
31
31
|
'wallpaper',
|
|
32
32
|
'opensearch_header',
|
|
33
|
-
'wheel_fortune_prize'
|
|
33
|
+
'wheel_fortune_prize',
|
|
34
|
+
'weixin_share_icon'
|
|
34
35
|
];
|
|
35
36
|
/**
|
|
36
37
|
* A file on disk, as multipart. The three endpoints that take one authenticate
|
|
@@ -82,8 +83,8 @@ export async function uploadedId(client, { id, path = {}, file, extra, key }) {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
|
-
* An image that a form's theme, one of its public queries
|
|
86
|
-
* refers to by id, uploaded with `imageType` saying which.
|
|
86
|
+
* An image that a form's theme, one of its public queries, a prize of its lucky wheel
|
|
87
|
+
* or its WeChat share card refers to by id, uploaded with `imageType` saying which.
|
|
87
88
|
*/
|
|
88
89
|
export function uploadFormImage(client, file, imageType) {
|
|
89
90
|
return uploadedId(client, { id: 'uploadFormImage', file, extra: { image_type: imageType }, key: 'attachment_id' });
|
|
@@ -3,7 +3,7 @@ import type { Operation, Schema } from '../spec.js';
|
|
|
3
3
|
export declare const BASE_PATH = "/api/v1";
|
|
4
4
|
/** The day spec/openapi.yaml was fetched from the API, when scripts/fetch-spec.mjs recorded it. */
|
|
5
5
|
export declare const SPEC_DATE: string | undefined;
|
|
6
|
-
export type OperationId = 'aggregateEntries' | 'aggregateFormViewEntries' | 'aggregateTableEntries' | 'aggregateTableViewEntries' | 'aggregateTradeTransactions' | 'checkFormFieldData' | 'checkTableFieldData' | 'copyForm' | 'countEntries' | 'countEntriesAcrossForms' | 'countFormViewEntries' | 'countTableEntries' | 'countTableViewEntries' | 'createCheckinCampaign' | 'createEmailTask' | 'createEntriesBatch' | 'createEntry' | 'createEntryComment' | 'createEntryImport' | 'createEntryLegacy' | 'createFillFormEntry' | 'createFillViewEntry' | 'createFolder' | 'createForm' | 'createFormCooperators' | 'createFormView' | 'createFormWebhook' | 'createMemoryNote' | 'createMessageChannel' | 'createNotificationRule' | 'createOpenResult' | 'createOpensearchQuery' | 'createRoutine' | 'createSmsSignature' | 'createSmsTask' | 'createSmsTemplate' | 'createTable' | 'createTableEntry' | 'createTableEntryComment' | 'createTableView' | 'createTemplateUsage' | 'createWeixinOauthSession' | 'deleteCheckinCampaign' | 'deleteEntry' | 'deleteEntryComment' | 'deleteForm' | 'deleteFormView' | 'deleteFormWebhook' | 'deleteMemoryNotes' | 'deleteMessageChannel' | 'deleteNotificationRule' | 'deleteOpenResult' | 'deleteRoutine' | 'deleteSmsSignature' | 'deleteSmsTemplate' | 'deleteTable' | 'deleteTableEntry' | 'deleteTableEntryComment' | 'deleteTableView' | 'estimateEmailTask' | 'estimateEmailTaskResend' | 'estimateMessage' | 'estimateSmsTask' | 'estimateSmsTaskChange' | 'estimateSmsTaskResend' | 'exportRemainingVouchers' | 'getBillingAccount' | 'getCheckinCampaign' | 'getCurrentUser' | 'getEmailTask' | 'getEntry' | 'getEntryImport' | 'getEntryStateFlow' | 'getEntryStats' | 'getEvaluationSetting' | 'getExamSetting' | 'getFieldType' | 'getFillFormPage' | 'getFillViewPage' | 'getFolder' | 'getForm' | 'getFormSetting' | 'getFormView' | 'getManuallyCloseRule' | 'getMemory' | 'getMessage' | 'getMessageChannel' | 'getNotificationRule' | 'getOpenResult' | 'getOpensearchQuery' | 'getPublishedArtifact' | 'getQuickpaySetting' | 'getRoutine' | 'getSmsTask' | 'getTable' | 'getTableEntry' | 'getTableView' | 'getTradeMerchant' | 'getUserFormSetting' | 'getWheelFortune' | 'listArtifactDataSources' | 'listArtifacts' | 'listBillingAccountInvoices' | 'listBillingAccountPaidFeatures' | 'listBillingAccountPaymentHistories' | 'listBillingAccountUsers' | 'listCheckinCampaigns' | 'listContacts' | 'listEmailTaskActivities' | 'listEmailTasks' | 'listEntries' | 'listEntryComments' | 'listExtendedAttributes' | 'listFieldRules' | 'listFieldTypes' | 'listFolders' | 'listFormConditionTriggerableFields' | 'listFormCooperators' | 'listFormPublishedArtifacts' | 'listFormViewEntries' | 'listFormViews' | 'listForms' | 'listMessageChannels' | 'listMessages' | 'listMyFilledForms' | 'listMySubmittedEntries' | 'listNotificationRuleNotifications' | 'listNotificationRules' | 'listOpenResults' | 'listOpensearchQueries' | 'listOpensearchQuerySuggestions' | 'listRedirectRules' | 'listRoutineRuns' | 'listRoutines' | 'listSmsAuditStatuses' | 'listSmsSignatures' | 'listSmsTaskActivities' | 'listSmsTasks' | 'listSmsTemplates' | 'listSmtpAccounts' | 'listTableConditionTriggerableFields' | 'listTableEntries' | 'listTableEntryComments' | 'listTablePublishedArtifacts' | 'listTableViewEntries' | 'listTableViews' | 'listTables' | 'listTradePayouts' | 'listTradeRefunds' | 'listTradeTransactions' | 'moveFormToFolder' | 'moveTableToFolder' | 'patchEntriesBatch' | 'pauseRoutine' | 'prepareEntryAttachmentUpload' | 'prepareFormImageUpload' | 'prepareGoodsDeliverableAttachmentUpload' | 'prepareImportFileUpload' | 'previewFormDeletion' | 'previewFormFieldTypeChange' | 'previewTableDeletion' | 'previewTableFieldTypeChange' | 'replaceEntry' | 'replaceTableEntry' | 'resendEmailTask' | 'resendSmsTask' | 'restoreFormPublishedArtifactDataGrant' | 'restoreTablePublishedArtifactDataGrant' | 'resumeRoutine' | 'revokeFormPublishedArtifactDataGrant' | 'revokeTablePublishedArtifactDataGrant' | 'runRoutine' | 'searchEntriesAcrossForms' | 'searchMySubmittedEntries' | 'sendMessage' | 'sendSmsTask' | 'summarizeEntries' | 'summarizeFormViewEntries' | 'summarizeTableEntries' | 'summarizeTableViewEntries' | 'updateAccessPolicy' | 'updateCheckinCampaign' | 'updateEntry' | 'updateEntryComment' | 'updateEntryStateFlow' | 'updateEntryViaPost' | 'updateEvaluationSetting' | 'updateExamSetting' | 'updateForm' | 'updateFormSetting' | 'updateFormTheme' | 'updateFormView' | 'updateManuallyCloseRule' | 'updateMemoryNote' | 'updateNotificationRule' | 'updateOpenResult' | 'updateOpensearchQuery' | 'updatePublishedArtifact' | 'updateQuickpaySetting' | 'updateRoutine' | 'updateSmsSignature' | 'updateSmsTask' | 'updateSmsTemplate' | 'updateTable' | 'updateTableEntry' | 'updateTableEntryComment' | 'updateTableEntryViaPost' | 'updateTableView' | 'updateUserFormSetting' | 'updateWheelFortune' | 'uploadEntryAttachment' | 'uploadFormImage' | 'uploadGoodsDeliverableAttachment' | 'uploadImportFile' | 'uploadUserLicenseAttachment' | 'verifyRedirectParams';
|
|
6
|
+
export type OperationId = 'aggregateEntries' | 'aggregateFormViewEntries' | 'aggregateTableEntries' | 'aggregateTableViewEntries' | 'aggregateTradeTransactions' | 'checkFormFieldData' | 'checkTableFieldData' | 'copyForm' | 'countEntries' | 'countEntriesAcrossForms' | 'countFormViewEntries' | 'countTableEntries' | 'countTableViewEntries' | 'createCheckinCampaign' | 'createEmailTask' | 'createEntriesBatch' | 'createEntry' | 'createEntryComment' | 'createEntryImport' | 'createEntryLegacy' | 'createFillFormEntry' | 'createFillPseudoFormEntry' | 'createFillViewEntry' | 'createFolder' | 'createForm' | 'createFormCooperators' | 'createFormView' | 'createFormWebhook' | 'createMemoryNote' | 'createMessageChannel' | 'createNotificationRule' | 'createOpenResult' | 'createOpensearchQuery' | 'createPseudoForm' | 'createPseudoFormsBatch' | 'createRoutine' | 'createSmsSignature' | 'createSmsTask' | 'createSmsTemplate' | 'createTable' | 'createTableEntry' | 'createTableEntryComment' | 'createTableView' | 'createTemplateUsage' | 'createWeixinOauthSession' | 'deleteCheckinCampaign' | 'deleteEntry' | 'deleteEntryComment' | 'deleteForm' | 'deleteFormView' | 'deleteFormWebhook' | 'deleteMemoryNotes' | 'deleteMessageChannel' | 'deleteNotificationRule' | 'deleteOpenResult' | 'deletePseudoForm' | 'deletePseudoFormsBatch' | 'deleteRoutine' | 'deleteSmsSignature' | 'deleteSmsTemplate' | 'deleteTable' | 'deleteTableEntry' | 'deleteTableEntryComment' | 'deleteTableView' | 'estimateEmailTask' | 'estimateEmailTaskResend' | 'estimateMessage' | 'estimateSmsTask' | 'estimateSmsTaskChange' | 'estimateSmsTaskResend' | 'exportRemainingVouchers' | 'getBillingAccount' | 'getCheckinCampaign' | 'getCurrentUser' | 'getEmailTask' | 'getEntry' | 'getEntryImport' | 'getEntryStateFlow' | 'getEntryStats' | 'getEvaluationSetting' | 'getExamSetting' | 'getFieldType' | 'getFillFormPage' | 'getFillPseudoFormPage' | 'getFillViewPage' | 'getFolder' | 'getForm' | 'getFormSetting' | 'getFormView' | 'getManuallyCloseRule' | 'getMemory' | 'getMessage' | 'getMessageChannel' | 'getNotificationRule' | 'getOpenResult' | 'getOpensearchQuery' | 'getPublishedArtifact' | 'getQuickpaySetting' | 'getRoutine' | 'getSmsTask' | 'getTable' | 'getTableEntry' | 'getTableView' | 'getTradeMerchant' | 'getUserFormSetting' | 'getWheelFortune' | 'listArtifactDataSources' | 'listArtifacts' | 'listBillingAccountInvoices' | 'listBillingAccountPaidFeatures' | 'listBillingAccountPaymentHistories' | 'listBillingAccountUsers' | 'listCheckinCampaigns' | 'listContacts' | 'listEmailTaskActivities' | 'listEmailTasks' | 'listEntries' | 'listEntryComments' | 'listExtendedAttributes' | 'listFieldRules' | 'listFieldTypes' | 'listFolders' | 'listFormConditionTriggerableFields' | 'listFormCooperators' | 'listFormPublishedArtifacts' | 'listFormViewEntries' | 'listFormViews' | 'listForms' | 'listMessageChannels' | 'listMessages' | 'listMyFilledForms' | 'listMySubmittedEntries' | 'listNotificationRuleNotifications' | 'listNotificationRules' | 'listOpenResults' | 'listOpensearchQueries' | 'listOpensearchQuerySuggestions' | 'listPseudoForms' | 'listRedirectRules' | 'listRoutineRuns' | 'listRoutines' | 'listSmsAuditStatuses' | 'listSmsSignatures' | 'listSmsTaskActivities' | 'listSmsTasks' | 'listSmsTemplates' | 'listSmtpAccounts' | 'listTableConditionTriggerableFields' | 'listTableEntries' | 'listTableEntryComments' | 'listTablePublishedArtifacts' | 'listTableViewEntries' | 'listTableViews' | 'listTables' | 'listTradePayouts' | 'listTradeRefunds' | 'listTradeTransactions' | 'moveFormToFolder' | 'moveTableToFolder' | 'patchEntriesBatch' | 'pauseRoutine' | 'prepareEntryAttachmentUpload' | 'prepareFormImageUpload' | 'prepareGoodsDeliverableAttachmentUpload' | 'prepareImportFileUpload' | 'previewFormDeletion' | 'previewFormFieldTypeChange' | 'previewTableDeletion' | 'previewTableFieldTypeChange' | 'replaceEntry' | 'replaceTableEntry' | 'resendEmailTask' | 'resendSmsTask' | 'restoreFormPublishedArtifactDataGrant' | 'restoreTablePublishedArtifactDataGrant' | 'resumeRoutine' | 'revokeFormPublishedArtifactDataGrant' | 'revokeTablePublishedArtifactDataGrant' | 'runRoutine' | 'searchEntriesAcrossForms' | 'searchMySubmittedEntries' | 'sendMessage' | 'sendSmsTask' | 'summarizeEntries' | 'summarizeFormViewEntries' | 'summarizeTableEntries' | 'summarizeTableViewEntries' | 'updateAccessPolicy' | 'updateCheckinCampaign' | 'updateEntry' | 'updateEntryComment' | 'updateEntryStateFlow' | 'updateEntryViaPost' | 'updateEvaluationSetting' | 'updateExamSetting' | 'updateForm' | 'updateFormSetting' | 'updateFormTheme' | 'updateFormView' | 'updateManuallyCloseRule' | 'updateMemoryNote' | 'updateNotificationRule' | 'updateOpenResult' | 'updateOpensearchQuery' | 'updatePseudoForm' | 'updatePublishedArtifact' | 'updateQuickpaySetting' | 'updateRoutine' | 'updateSmsSignature' | 'updateSmsTask' | 'updateSmsTemplate' | 'updateTable' | 'updateTableEntry' | 'updateTableEntryComment' | 'updateTableEntryViaPost' | 'updateTableView' | 'updateUserFormSetting' | 'updateWheelFortune' | 'uploadEntryAttachment' | 'uploadFormImage' | 'uploadGoodsDeliverableAttachment' | 'uploadImportFile' | 'uploadUserLicenseAttachment' | 'verifyRedirectParams';
|
|
7
7
|
export declare const OPERATIONS: {
|
|
8
8
|
readonly [id in OperationId]: Operation;
|
|
9
9
|
};
|
|
@@ -306,6 +306,12 @@ export const OPERATIONS = {
|
|
|
306
306
|
parameters: [{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } }],
|
|
307
307
|
body: { required: true, content: { 'application/json': { $ref: 'FillEntryRequest' } } }
|
|
308
308
|
},
|
|
309
|
+
createFillPseudoFormEntry: {
|
|
310
|
+
method: 'POST',
|
|
311
|
+
path: '/fill/pf/{pseudo_form_token}/entries',
|
|
312
|
+
parameters: [{ name: 'pseudo_form_token', in: 'path', required: true, schema: { type: 'string' } }],
|
|
313
|
+
body: { required: true, content: { 'application/json': { $ref: 'FillEntryRequest' } } }
|
|
314
|
+
},
|
|
309
315
|
createFillViewEntry: {
|
|
310
316
|
method: 'POST',
|
|
311
317
|
path: '/fill/v/{view_token}/entries',
|
|
@@ -424,6 +430,28 @@ export const OPERATIONS = {
|
|
|
424
430
|
}
|
|
425
431
|
}
|
|
426
432
|
},
|
|
433
|
+
createPseudoForm: {
|
|
434
|
+
method: 'POST',
|
|
435
|
+
path: '/forms/{form_token}/pseudo_forms',
|
|
436
|
+
parameters: [{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } }],
|
|
437
|
+
body: { required: true, content: { 'application/json': { $ref: 'PseudoFormCreateInput' } } }
|
|
438
|
+
},
|
|
439
|
+
createPseudoFormsBatch: {
|
|
440
|
+
method: 'POST',
|
|
441
|
+
path: '/forms/{form_token}/pseudo_forms/batch',
|
|
442
|
+
parameters: [{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } }],
|
|
443
|
+
body: {
|
|
444
|
+
required: true,
|
|
445
|
+
content: {
|
|
446
|
+
'application/json': {
|
|
447
|
+
type: 'object',
|
|
448
|
+
required: ['pseudo_forms'],
|
|
449
|
+
properties: { pseudo_forms: { type: 'array', minItems: 1, maxItems: 200, items: {} } },
|
|
450
|
+
additionalProperties: false
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
427
455
|
createRoutine: {
|
|
428
456
|
method: 'POST',
|
|
429
457
|
path: '/routines',
|
|
@@ -569,6 +597,30 @@ export const OPERATIONS = {
|
|
|
569
597
|
{ name: 'token', in: 'path', required: true, schema: { type: 'string' } }
|
|
570
598
|
]
|
|
571
599
|
},
|
|
600
|
+
deletePseudoForm: {
|
|
601
|
+
method: 'DELETE',
|
|
602
|
+
path: '/forms/{form_token}/pseudo_forms/{pseudo_form_token}',
|
|
603
|
+
parameters: [
|
|
604
|
+
{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } },
|
|
605
|
+
{ name: 'pseudo_form_token', in: 'path', required: true, schema: { type: 'string' } }
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
deletePseudoFormsBatch: {
|
|
609
|
+
method: 'DELETE',
|
|
610
|
+
path: '/forms/{form_token}/pseudo_forms/batch',
|
|
611
|
+
parameters: [{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } }],
|
|
612
|
+
body: {
|
|
613
|
+
required: true,
|
|
614
|
+
content: {
|
|
615
|
+
'application/json': {
|
|
616
|
+
type: 'object',
|
|
617
|
+
required: ['tokens'],
|
|
618
|
+
properties: { tokens: { type: 'array', minItems: 1, maxItems: 200, items: { type: 'string' } } },
|
|
619
|
+
additionalProperties: false
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
},
|
|
572
624
|
deleteRoutine: {
|
|
573
625
|
method: 'DELETE',
|
|
574
626
|
path: '/routines/{id}',
|
|
@@ -786,6 +838,11 @@ export const OPERATIONS = {
|
|
|
786
838
|
path: '/fill/f/{form_token}',
|
|
787
839
|
parameters: [{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } }]
|
|
788
840
|
},
|
|
841
|
+
getFillPseudoFormPage: {
|
|
842
|
+
method: 'GET',
|
|
843
|
+
path: '/fill/pf/{pseudo_form_token}',
|
|
844
|
+
parameters: [{ name: 'pseudo_form_token', in: 'path', required: true, schema: { type: 'string' } }]
|
|
845
|
+
},
|
|
789
846
|
getFillViewPage: {
|
|
790
847
|
method: 'GET',
|
|
791
848
|
path: '/fill/v/{view_token}',
|
|
@@ -1233,6 +1290,17 @@ export const OPERATIONS = {
|
|
|
1233
1290
|
path: '/opensearch/query_suggestions',
|
|
1234
1291
|
parameters: [{ name: 'form_token', in: 'query', required: true, schema: { type: 'string' } }]
|
|
1235
1292
|
},
|
|
1293
|
+
listPseudoForms: {
|
|
1294
|
+
method: 'GET',
|
|
1295
|
+
path: '/forms/{form_token}/pseudo_forms',
|
|
1296
|
+
parameters: [
|
|
1297
|
+
{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } },
|
|
1298
|
+
{ name: 'limit', in: 'query', schema: { type: 'integer' } },
|
|
1299
|
+
{ name: 'next', in: 'query', schema: { type: 'integer', minimum: 0 } },
|
|
1300
|
+
{ name: 'page', in: 'query', schema: { type: 'integer', minimum: 1 } },
|
|
1301
|
+
{ name: 'skip', in: 'query', schema: { type: 'integer', minimum: 0, maximum: 10000 } }
|
|
1302
|
+
]
|
|
1303
|
+
},
|
|
1236
1304
|
listRedirectRules: {
|
|
1237
1305
|
method: 'GET',
|
|
1238
1306
|
path: '/forms/{form_token}/redirect_rules',
|
|
@@ -1967,6 +2035,15 @@ export const OPERATIONS = {
|
|
|
1967
2035
|
parameters: [{ name: 'query_token', in: 'path', required: true, schema: { type: 'string' } }],
|
|
1968
2036
|
body: { required: true, content: { 'application/json': { $ref: 'OpensearchQueryInput' } } }
|
|
1969
2037
|
},
|
|
2038
|
+
updatePseudoForm: {
|
|
2039
|
+
method: 'PATCH',
|
|
2040
|
+
path: '/forms/{form_token}/pseudo_forms/{pseudo_form_token}',
|
|
2041
|
+
parameters: [
|
|
2042
|
+
{ name: 'form_token', in: 'path', required: true, schema: { type: 'string' } },
|
|
2043
|
+
{ name: 'pseudo_form_token', in: 'path', required: true, schema: { type: 'string' } }
|
|
2044
|
+
],
|
|
2045
|
+
body: { required: true, content: { 'application/json': { $ref: 'PseudoFormUpdateInput' } } }
|
|
2046
|
+
},
|
|
1970
2047
|
updatePublishedArtifact: {
|
|
1971
2048
|
method: 'PATCH',
|
|
1972
2049
|
path: '/artifacts/{artifact_id}/published_artifact',
|
|
@@ -3830,6 +3907,7 @@ export const SCHEMAS = {
|
|
|
3830
3907
|
buttons: { type: 'array', minItems: 1, items: { $ref: 'WidgetButtonItemInput' } },
|
|
3831
3908
|
segments: { type: 'array', minItems: 1, items: { $ref: 'SequenceSegmentInput' } },
|
|
3832
3909
|
display_field_api_codes: { type: 'array', maxItems: 20, items: { type: 'string' } },
|
|
3910
|
+
masked_display_field_api_codes: { type: 'array', maxItems: 20, items: { type: 'string' } },
|
|
3833
3911
|
init_row_length: { type: 'integer', minimum: 1 },
|
|
3834
3912
|
widget_images: { type: 'array', items: { $ref: 'WidgetImageInput' } },
|
|
3835
3913
|
answers: { type: 'array', items: { $ref: 'AnswerInput' } },
|
|
@@ -4139,6 +4217,7 @@ export const SCHEMAS = {
|
|
|
4139
4217
|
position: { type: 'integer', minimum: 0 },
|
|
4140
4218
|
unique: { type: 'boolean' },
|
|
4141
4219
|
display_field_api_codes: { type: 'array', maxItems: 20, items: { type: 'string' } },
|
|
4220
|
+
masked_display_field_api_codes: { type: 'array', maxItems: 20, items: { type: 'string' } },
|
|
4142
4221
|
associated_form_token: { type: 'string' },
|
|
4143
4222
|
associated_field_api_codes: { type: 'array', minItems: 1, maxItems: 4, items: { type: 'string' } },
|
|
4144
4223
|
privacy_safe: { type: 'boolean' },
|
|
@@ -5761,6 +5840,17 @@ export const SCHEMAS = {
|
|
|
5761
5840
|
count_down: { type: ['integer', 'null'], minimum: 0 }
|
|
5762
5841
|
}
|
|
5763
5842
|
},
|
|
5843
|
+
PseudoFormCreateInput: {
|
|
5844
|
+
type: 'object',
|
|
5845
|
+
properties: { name: { type: 'string' }, values: { $ref: 'PseudoFormValues' } },
|
|
5846
|
+
additionalProperties: false
|
|
5847
|
+
},
|
|
5848
|
+
PseudoFormUpdateInput: {
|
|
5849
|
+
type: 'object',
|
|
5850
|
+
properties: { name: { type: 'string' }, values: { $ref: 'PseudoFormValues' } },
|
|
5851
|
+
additionalProperties: false
|
|
5852
|
+
},
|
|
5853
|
+
PseudoFormValues: { type: 'object', additionalProperties: true },
|
|
5764
5854
|
PublishedArtifactInput: {
|
|
5765
5855
|
type: 'object',
|
|
5766
5856
|
additionalProperties: false,
|