@jinshuju/cli 0.20.0 → 0.22.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 CHANGED
@@ -85,6 +85,7 @@ field — the server assigns it.
85
85
  jinshuju form create --json @form.json --scene registry --layout card --folder Fd2xK8
86
86
  jinshuju form create --json @exam.json --type exam # the payload may carry exam_setting
87
87
  jinshuju form edit Kp7mQ2 --json '{"exam_setting":{"limited_time":45}}'
88
+ jinshuju form get Kp7mQ2 --include exam_setting # reads it back with the form
88
89
 
89
90
  jinshuju form create --json '{
90
91
  "name": "Event signup",
@@ -163,9 +164,13 @@ maximum (50 in most cases), and anything larger is capped.
163
164
  `--all` reads at most 200 pages. Past that it stops with an error naming the
164
165
  cursor; pass it to `--next` (with `--all` again) to read on.
165
166
 
166
- `--filter` is repeatable and the conditions are AND-combined. For conditions it
167
- cannot express, use `--filters <json|@file>`. Cursors are opaque strings — pass
168
- the `next` value from the previous response back verbatim.
167
+ `--filter` is repeatable, one condition per flag, and the conditions are
168
+ AND-combined. An operator written otherwise (`=`, `in`, `not_empty`) is refused
169
+ with the one meant, one the CLI's copy of the spec does not list goes through
170
+ for the API to judge, two conditions in one flag are refused with the way to
171
+ write them, and a value in quotes is taken whole, without them. For conditions
172
+ it cannot express, use `--filters <json|@file>`. Cursors are opaque strings —
173
+ pass the `next` value from the previous response back verbatim.
169
174
 
170
175
  ## Analysis
171
176
 
@@ -240,6 +245,14 @@ jinshuju field update-choices --form Kp7mQ2 field_7 --json '{"add":[{"label":"Th
240
245
  jinshuju field remove --form Kp7mQ2 field_9 --yes
241
246
  ```
242
247
 
248
+ A payload is looked at once before it is sent, against the openapi.yaml the
249
+ CLI shipped with, and refused only for what a newer API could not have made
250
+ right: a required key missing, a value of the wrong type, `null` for a key
251
+ that cannot be null, a field's `validation` written back as `form get` returned
252
+ it. A key or a value that copy does not list is sent for the API to judge, since
253
+ the API may have learned it since. A refusal names the day the copy was
254
+ fetched, and `--as-is` sends the payload anyway.
255
+
243
256
  Data and views:
244
257
 
245
258
  ```bash
@@ -430,6 +443,11 @@ parsing anything:
430
443
  | 7 | transport: the connection failed or timed out |
431
444
  | 8 | rate limited: wait and retry; the message and `retry_after` say how long |
432
445
 
446
+ A refusal with several reasons lists every one of them, one line each, even
447
+ when the server's own description repeats only the first three: a request body
448
+ that is wrong in five places is corrected in one go rather than in five. A list
449
+ longer than twenty is cut, and says how many it kept back.
450
+
433
451
  With `--output json`, stderr carries the same as JSON, plus the status and body
434
452
  the server answered with:
435
453
 
@@ -545,6 +563,30 @@ jinshuju email smtp-account list
545
563
  jinshuju email send --form Kp7mQ2 --field field_3 --select-all --subject 上课提醒 --content '<p>明天上午 9 点开课</p>' --yes
546
564
  ```
547
565
 
566
+ ## Sending one message
567
+
568
+ `message send` sends one message through a channel registered with the API: a
569
+ DingTalk or WeCom group robot, or a webhook, is the recipient itself; email and
570
+ SMS go to each `--to`, at most 50. `--mention` @s group members by mobile number,
571
+ or everyone with `@all`; WeCom sends a message that mentions anyone as plain
572
+ text, so leave Markdown out of it. SMS sends the channel's template: it takes
573
+ no `--title` or `--content`, and each of the template's variables comes as
574
+ `--variable <name>=<value>`. A sent message cannot be recalled, so it
575
+ takes `--yes`. After a timeout, send again with the same `--idempotency-key`:
576
+ the API answers the first records instead of sending twice.
577
+
578
+ `message channel list` gives the ids `--channel` takes, `--type` narrowing
579
+ them, and `message channel get <id>` shows one. Email needs no channel: without
580
+ one it goes from Jinshuju's address and uses email quota; with one, through its
581
+ SMTP account.
582
+
583
+ ```bash
584
+ jinshuju message channel list --type wxwork
585
+ jinshuju message send --type wxwork --channel 6729f1c2a1b2c3d4e5f60718 --content '今天是星期三,该吃午饭啦!' --mention 13800000000 --yes
586
+ jinshuju message send --type email --to someone@example.com --title 上课提醒 --content '明天上午 9 点开课' --yes
587
+ jinshuju message send --type sms --channel 6729f1c2a1b2c3d4e5f60719 --to 13800000000 --variable var_1=张三 --variable var_2=9:00 --yes
588
+ ```
589
+
548
590
  ## Artifacts
549
591
 
550
592
  An artifact is a file Jiri made for you; any of your conversations can revise
package/dist/cli.js CHANGED
@@ -5,6 +5,7 @@ import { helpFor, rootHelp } from './help.js';
5
5
  import { HttpError, JinshujuHttpClient } from './http.js';
6
6
  import { runLocal } from './local.js';
7
7
  import { GLOBAL_OPTIONS, LOCAL_OPTIONS, UsageError } from './options.js';
8
+ import { checked } from './preflight.js';
8
9
  import { progress } from './progress.js';
9
10
  import { format, terminalWidth } from './render.js';
10
11
  import { fail, ok, outputOf, unknown } from './result.js';
@@ -43,12 +44,14 @@ async function runRemote(command, words, flags, runtime, stdin) {
43
44
  const input = { ...bindArgs(command, words), options };
44
45
  const output = options.output ?? 'text';
45
46
  const width = runtime.width ?? terminalWidth();
46
- const client = runtime.client ??
47
+ // Every request leaves through the preflight, a test's mock client's too:
48
+ // a body is looked at once, on its way to the wire, whichever command built it.
49
+ const client = checked(runtime.client ??
47
50
  new JinshujuHttpClient(loadConfig({
48
51
  configPath: options.config ?? defaultConfigPath,
49
52
  env: runtime.env,
50
53
  cli: { host: options.host }
51
- }));
54
+ })), options.as_is === true);
52
55
  // A command that needs more than one round trip, or has to decide how many,
53
56
  // runs itself and answers with what should be printed.
54
57
  const hints = { list: command.text?.list ?? command.paginate?.items, essentialLists: command.text?.essentialLists };
@@ -1,10 +1,20 @@
1
1
  import { CONTAINER_OPTIONS, JSON_OPTION, UsageError } from '../options.js';
2
2
  import { call, choices } from '../spec.js';
3
3
  import { YES_OPTION, confirmed, onContainer, one, payload, requiredOption } from './shared.js';
4
- /** One field, or a list of them — the same objects `fields` holds above. */
4
+ /**
5
+ * One field, or a list of them — the same objects `fields` holds above. And
6
+ * what a field read back is not: what the CLI's callers were most often
7
+ * refused for was a field written back as `form get` returned it.
8
+ */
5
9
  const FIELD_PAYLOAD = [
6
10
  '{ "type": "TextField", "label": "Notes", "required": false }',
7
11
  '',
12
+ 'A field as `form get` or `field list` returns it is not a field to write back:',
13
+ ' validation: {required, unique, minimum_length, …} is written flat on the field',
14
+ ' choices are changed with `field update-choices`; `field update` takes them only on a',
15
+ ' CascadeDropDown, or with a `type` that turns a text field into a choice field',
16
+ ' a key read as null is left out, not written as null',
17
+ '',
8
18
  'Field types: jinshuju field types'
9
19
  ];
10
20
  /**
@@ -227,9 +237,11 @@ export const FIELD = [
227
237
  {
228
238
  path: ['field', 'update'],
229
239
  summary: 'Update one field',
230
- description: 'The patch is merged onto the field; the api_code comes from the argument, not the payload.',
240
+ description: 'The patch is merged onto the field; the api_code comes from the argument, not the payload. ' +
241
+ 'Write only the keys to change, flat on the field, as the payload below says.',
231
242
  args: [{ name: 'api-code', required: true, description: 'Field api_code, e.g. field_3' }],
232
243
  options: [...CONTAINER_OPTIONS, JSON_OPTION],
244
+ payload: FIELD_PAYLOAD,
233
245
  request: (input) => onContainer(input, 'updateForm', 'updateTable', {
234
246
  body: {
235
247
  fields: { update: [{ ...payload(input), api_code: input.args['api-code'] }] }
@@ -61,7 +61,13 @@ const FORM_INCLUDES = {
61
61
  rules: 'include_field_rules',
62
62
  extended: 'include_extended_attributes',
63
63
  transactions: 'include_transactions',
64
- analytics: 'include_analytics'
64
+ analytics: 'include_analytics',
65
+ // An exam form's exam settings, under the key `form edit` writes them by;
66
+ // any other form carries nothing for it. The one name here that is the key
67
+ // itself: `exam` alone reads as the scene, and this list already has
68
+ // `setting`, which it sits beside. An OAuth token needs the form_setting
69
+ // scope, which the CLI's own login asks for.
70
+ exam_setting: 'include_exam_setting'
65
71
  };
66
72
  const INCLUDE_OPTION = {
67
73
  name: '--include',
@@ -188,13 +194,18 @@ export const FORM = [
188
194
  summary: 'Show a form: fields, types, choices',
189
195
  description: 'The form carries its setting already. --include adds the blocks that are separate reads ' +
190
196
  'otherwise, so asking for a form and its rules is one round trip. analytics says which ' +
191
- 'statistics each field takes, which is what the analysis reads validate against. `fields` ' +
197
+ 'statistics each field takes, which is what the analysis reads validate against. ' +
198
+ "exam_setting is an exam form's, read back in the shape `form edit` writes it. `fields` " +
192
199
  'comes back as a list of one-key objects keyed by api_code, not a flat list — `field list` ' +
193
200
  'answers the same fields flattened, with api_code on each.',
194
201
  args: [{ name: 'form', required: true, description: 'Form token, six letters and digits, e.g. Kp7mQ2' }],
195
202
  options: [INCLUDE_OPTION],
196
203
  request: (input) => call('getForm', { path: { form_token: input.args.form }, query: includes(input) }),
197
- examples: ['jinshuju form get Kp7mQ2', 'jinshuju form get Kp7mQ2 --include theme,rules,analytics']
204
+ examples: [
205
+ 'jinshuju form get Kp7mQ2',
206
+ 'jinshuju form get Kp7mQ2 --include theme,rules,analytics',
207
+ 'jinshuju form get Kp7mQ2 --include exam_setting'
208
+ ]
198
209
  },
199
210
  {
200
211
  path: ['form', 'create'],
@@ -233,6 +244,9 @@ export const FORM = [
233
244
  const { body, settings } = createFormBody(input);
234
245
  if (!settings)
235
246
  return client.request(call('createForm', { body }));
247
+ // The settings can only be sent to a form that exists, but what they
248
+ // would be refused for here can be said before one is made.
249
+ client.check?.(saveSettings('new', settings));
236
250
  const form = await client.request(call('createForm', { body }));
237
251
  try {
238
252
  await client.request(saveSettings(form.token, settings));
@@ -268,7 +282,10 @@ export const FORM = [
268
282
  delete body[settings.key];
269
283
  // The settings go first: they are the half that can be refused for what
270
284
  // the form is, so leading with them is what keeps a refusal from landing
271
- // after the rest was already written.
285
+ // after the rest was already written. What the rest would be refused for
286
+ // here is said before either goes.
287
+ if (Object.keys(body).length > 0)
288
+ client.check?.(call('updateForm', { path: { form_token: form }, body }));
272
289
  await client.request(saveSettings(form, settings));
273
290
  if (Object.keys(body).length === 0)
274
291
  return client.request(call('getForm', { path: { form_token: form } }));
@@ -18,6 +18,7 @@ import { FILL } from './fill.js';
18
18
  import { FOLDER } from './folder.js';
19
19
  import { FORM } from './form.js';
20
20
  import { LOCAL } from './local.js';
21
+ import { MESSAGE } from './message.js';
21
22
  import { NOTIFICATION } from './notification.js';
22
23
  import { OPENSEARCH } from './opensearch.js';
23
24
  import { ROUTINE } from './routine.js';
@@ -89,6 +90,10 @@ export const RESOURCES = [
89
90
  { name: 'payout', summary: 'Payouts to the settlement account' },
90
91
  { name: 'sms', summary: 'Manage SMS signatures and templates, and send SMS to entries' },
91
92
  { name: 'email', summary: 'Send email to entries' },
93
+ {
94
+ name: 'message',
95
+ summary: 'Send one message through a registered channel: group robots, webhooks, email and SMS; list the channels'
96
+ },
92
97
  {
93
98
  name: 'artifact',
94
99
  summary: 'Artifacts Jiri made in a conversation: find and download them, and who can open an HTML one by its link',
@@ -115,6 +120,7 @@ export const COMMANDS = [
115
120
  ...TRADE,
116
121
  ...SMS,
117
122
  ...EMAIL,
123
+ ...MESSAGE,
118
124
  ...ARTIFACT
119
125
  ];
120
126
  /** The command whose path the words begin with, longest match first. */
@@ -0,0 +1,2 @@
1
+ import type { Command } from './types.js';
2
+ export declare const MESSAGE: readonly Command[];
@@ -0,0 +1,134 @@
1
+ import { UsageError } from '../errors.js';
2
+ import { PAGINATION_OPTIONS } from '../options.js';
3
+ import { call, choices } from '../spec.js';
4
+ import { given, LISTING, paging, requiredOption, SEND_OPTION } from './shared.js';
5
+ /** `var_1=张三`: one variable of an SMS channel's template. */
6
+ function parseVariable(input) {
7
+ const at = input.indexOf('=');
8
+ if (at <= 0)
9
+ throw new UsageError(`--variable must be '<name>=<value>', got ${JSON.stringify(input)}`);
10
+ return [input.slice(0, at), input.slice(at + 1)];
11
+ }
12
+ export const MESSAGE = [
13
+ {
14
+ path: ['message', 'send'],
15
+ summary: 'Send one message through a registered channel: a group robot or webhook, or email and SMS to --to',
16
+ description: 'Queues the message and answers at once with one record per recipient; a group robot or webhook is the ' +
17
+ 'recipient itself. --mention is for DingTalk and WeCom robots only, at most 50; WeCom sends a message that ' +
18
+ "mentions anyone as plain text, so leave Markdown out of it. SMS sends the channel's template, so it takes no " +
19
+ '--title or --content: give each of its variables with --variable. Sent messages cannot be recalled: after a timeout ' +
20
+ 'or a dropped connection, send again with the same --idempotency-key, which answers the first records instead ' +
21
+ 'of sending twice. --yes sends.',
22
+ options: [
23
+ {
24
+ name: '--type',
25
+ type: 'string',
26
+ choices: ['wxwork', 'ding_talk', 'webhook', 'email', 'sms'],
27
+ placeholder: '<type>',
28
+ description: 'wxwork, ding_talk, webhook, email or sms'
29
+ },
30
+ {
31
+ name: '--channel',
32
+ type: 'string',
33
+ placeholder: '<id>',
34
+ description: 'Channel id, from `message channel list`. Required for a group robot, a webhook and SMS (an SMS channel sends ' +
35
+ "one template, once approved). Email may leave it out: it then goes from Jinshuju's address and uses the " +
36
+ "email quota; with one it goes through that channel's SMTP account"
37
+ },
38
+ {
39
+ name: '--to',
40
+ type: 'string',
41
+ repeatable: true,
42
+ placeholder: '<recipient>',
43
+ description: 'Email address or mobile number for email and SMS, repeatable, at most 50'
44
+ },
45
+ {
46
+ name: '--title',
47
+ type: 'string',
48
+ placeholder: '<text>',
49
+ description: 'Heading above the content, or the subject of an email'
50
+ },
51
+ {
52
+ name: '--content',
53
+ type: 'string',
54
+ placeholder: '<text>',
55
+ description: "The message, in Markdown unless it mentions anyone on WeCom; an email's becomes HTML and takes up to " +
56
+ '20,000 characters'
57
+ },
58
+ {
59
+ name: '--variable',
60
+ type: 'string',
61
+ repeatable: true,
62
+ placeholder: '<name>=<value>',
63
+ description: "Every variable the SMS channel's template declares, as it is named there (var_1...), each 1 to 100 " +
64
+ 'characters; repeatable'
65
+ },
66
+ {
67
+ name: '--mention',
68
+ type: 'string',
69
+ repeatable: true,
70
+ placeholder: '<mobile|@all>',
71
+ description: 'Group member to @ by mobile number, or @all for everyone; repeatable'
72
+ },
73
+ {
74
+ name: '--idempotency-key',
75
+ type: 'string',
76
+ placeholder: '<key>',
77
+ description: 'Sends once for the same key within 24 hours; retry with the same key'
78
+ },
79
+ SEND_OPTION
80
+ ],
81
+ request: (input) => {
82
+ const type = requiredOption(input, 'type');
83
+ if (!input.options.yes)
84
+ throw new UsageError('A sent message cannot be recalled; pass --yes to send');
85
+ const variables = input.options.variable;
86
+ return call('sendMessage', {
87
+ body: given({
88
+ type,
89
+ channel_id: input.options.channel,
90
+ to: input.options.to,
91
+ title: input.options.title,
92
+ content: input.options.content,
93
+ variables: variables && Object.fromEntries(variables.map(parseVariable)),
94
+ mentioned_mobile_list: input.options.mention,
95
+ idempotency_key: input.options.idempotency_key
96
+ })
97
+ });
98
+ },
99
+ examples: [
100
+ "jinshuju message send --type wxwork --channel 6729f1c2a1b2c3d4e5f60718 --content '今天是星期三,该吃午饭啦!' " +
101
+ '--mention 13800000000 --yes',
102
+ "jinshuju message send --type email --to someone@example.com --title 上课提醒 --content '明天上午 9 点开课' --yes",
103
+ 'jinshuju message send --type sms --channel 6729f1c2a1b2c3d4e5f60719 --to 13800000000 --variable var_1=张三 ' +
104
+ '--variable var_2=9:00 --yes'
105
+ ]
106
+ },
107
+ {
108
+ path: ['message', 'channel', 'list'],
109
+ summary: 'List the channels `message send` can send through, newest first',
110
+ description: 'The channels you registered, or every channel of the account for an account access token. The id goes to ' +
111
+ '`message send --channel`. address is the robot or webhook address with its key hidden, empty for email and ' +
112
+ 'SMS; an email channel carries its smtp_account_id and an SMS one its sms_template_id.',
113
+ options: [
114
+ {
115
+ name: '--type',
116
+ type: 'string',
117
+ choices: choices('listMessageChannels', 'type'),
118
+ placeholder: '<type>',
119
+ description: 'Only the channels of this type: wxwork, ding_talk, webhook, email or sms'
120
+ },
121
+ ...PAGINATION_OPTIONS
122
+ ],
123
+ request: (input) => call('listMessageChannels', { query: { type: input.options.type, ...paging(input) } }),
124
+ paginate: LISTING,
125
+ examples: ['jinshuju message channel list', 'jinshuju message channel list --type sms']
126
+ },
127
+ {
128
+ path: ['message', 'channel', 'get'],
129
+ summary: 'Show a channel `message send` can send through',
130
+ args: [{ name: 'id', required: true, description: 'Channel id, from `message channel list`' }],
131
+ request: (input) => call('getMessageChannel', { path: { id: input.args.id } }),
132
+ examples: ['jinshuju message channel get 6729f1c2a1b2c3d4e5f60718']
133
+ }
134
+ ];
package/dist/errors.d.ts CHANGED
@@ -2,6 +2,21 @@
2
2
  export declare class UsageError extends Error {
3
3
  name: string;
4
4
  }
5
+ /** One thing a body was refused for before it was sent, at the value a JSON Pointer names. */
6
+ export interface Refusal {
7
+ readonly pointer: string;
8
+ readonly message: string;
9
+ }
10
+ /**
11
+ * A body refused here, before it was sent, by the openapi.yaml this CLI
12
+ * shipped with (src/preflight.ts). Usage, like any input the CLI could not
13
+ * take, and the reasons are kept apart from the words so `--output json`
14
+ * can carry them the way a server's 400 carries its errors[].
15
+ */
16
+ export declare class PreflightError extends UsageError {
17
+ readonly errors: readonly Refusal[];
18
+ constructor(message: string, errors: readonly Refusal[]);
19
+ }
5
20
  /** No credential, or one the server would not take. */
6
21
  export declare class AuthError extends Error {
7
22
  name: string;
@@ -46,6 +61,8 @@ export type ClassifiedError = {
46
61
  body?: unknown;
47
62
  /** Seconds the server asked for before trying again, when it said. */
48
63
  retry_after?: number;
64
+ /** What a body was refused for before it was sent, each at its pointer. */
65
+ errors?: readonly Refusal[];
49
66
  };
50
67
  /**
51
68
  * Sorts a failure into its kind. An error that wraps another — "the form was
package/dist/errors.js CHANGED
@@ -2,6 +2,20 @@
2
2
  export class UsageError extends Error {
3
3
  name = 'UsageError';
4
4
  }
5
+ /**
6
+ * A body refused here, before it was sent, by the openapi.yaml this CLI
7
+ * shipped with (src/preflight.ts). Usage, like any input the CLI could not
8
+ * take, and the reasons are kept apart from the words so `--output json`
9
+ * can carry them the way a server's 400 carries its errors[].
10
+ */
11
+ export class PreflightError extends UsageError {
12
+ errors;
13
+ constructor(message, errors) {
14
+ super(message);
15
+ this.errors = errors;
16
+ this.name = 'PreflightError';
17
+ }
18
+ }
5
19
  /** No credential, or one the server would not take. */
6
20
  export class AuthError extends Error {
7
21
  name = 'AuthError';
@@ -79,6 +93,9 @@ function retryAfterIn(body) {
79
93
  */
80
94
  export function classify(error) {
81
95
  const message = error instanceof Error ? error.message : String(error);
96
+ if (error instanceof PreflightError) {
97
+ return { kind: 'usage', exitCode: EXIT_CODES.usage, message, errors: error.errors };
98
+ }
82
99
  if (error instanceof UsageError)
83
100
  return { kind: 'usage', exitCode: EXIT_CODES.usage, message };
84
101
  if (error instanceof AuthError)
@@ -1,7 +1,9 @@
1
1
  import type { Operation, Schema } from '../spec.js';
2
2
  /** The path every operation's path is relative to, from `servers`. */
3
3
  export declare const BASE_PATH = "/api/v1";
4
- 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' | 'createFormView' | 'createFormWebhook' | 'createNotificationRule' | 'createOpensearchQuery' | 'createRoutine' | 'createSmsSignature' | 'createSmsTask' | 'createSmsTemplate' | 'createTable' | 'createTableEntry' | 'createTableEntryComment' | 'createTableView' | 'createTemplateUsage' | 'createWeixinOauthSession' | 'deleteCheckinCampaign' | 'deleteEntry' | 'deleteEntryComment' | 'deleteForm' | 'deleteFormView' | 'deleteFormWebhook' | 'deleteNotificationRule' | 'deleteRoutine' | 'deleteSmsSignature' | 'deleteSmsTemplate' | 'deleteTable' | 'deleteTableEntry' | 'deleteTableEntryComment' | 'deleteTableView' | 'estimateEmailTask' | 'estimateEmailTaskResend' | 'estimateSmsTask' | 'estimateSmsTaskChange' | 'estimateSmsTaskResend' | 'getBillingAccount' | 'getCheckinCampaign' | 'getCurrentUser' | 'getEmailTask' | 'getEntry' | 'getEntryImport' | 'getEntryStats' | 'getEvaluationSetting' | 'getExamSetting' | 'getFieldType' | 'getFillFormPage' | 'getFillViewPage' | 'getFolder' | 'getForm' | 'getFormSetting' | 'getFormView' | 'getManuallyCloseRule' | 'getNotificationRule' | 'getOpensearchQuery' | 'getPublishedArtifact' | 'getRoutine' | 'getSmsTask' | 'getTable' | 'getTableEntry' | 'getTableView' | 'getTradeMerchant' | 'listArtifacts' | 'listBillingAccountInvoices' | 'listBillingAccountPaidFeatures' | 'listBillingAccountPaymentHistories' | 'listBillingAccountUsers' | 'listCheckinCampaigns' | 'listContacts' | 'listEmailTaskActivities' | 'listEmailTasks' | 'listEntries' | 'listEntryComments' | 'listExtendedAttributes' | 'listFieldRules' | 'listFieldTypes' | 'listFolders' | 'listFormConditionTriggerableFields' | 'listFormCooperators' | 'listFormViewEntries' | 'listFormViews' | 'listForms' | 'listMyFilledForms' | 'listMySubmittedEntries' | 'listNotificationRuleNotifications' | 'listNotificationRules' | 'listOpensearchQueries' | 'listOpensearchQuerySuggestions' | 'listRoutineRuns' | 'listRoutines' | 'listSmsAuditStatuses' | 'listSmsSignatures' | 'listSmsTaskActivities' | 'listSmsTasks' | 'listSmsTemplates' | 'listSmtpAccounts' | 'listTableConditionTriggerableFields' | 'listTableEntries' | 'listTableEntryComments' | 'listTableViewEntries' | 'listTableViews' | 'listTables' | 'listTradePayouts' | 'listTradeRefunds' | 'listTradeTransactions' | 'moveFormToFolder' | 'moveTableToFolder' | 'patchEntriesBatch' | 'pauseRoutine' | 'prepareEntryAttachmentUpload' | 'prepareFormImageUpload' | 'prepareImportFileUpload' | 'previewFormFieldTypeChange' | 'previewTableFieldTypeChange' | 'replaceEntry' | 'replaceTableEntry' | 'resendEmailTask' | 'resendSmsTask' | 'resumeRoutine' | 'runRoutine' | 'searchEntriesAcrossForms' | 'searchMySubmittedEntries' | 'sendSmsTask' | 'summarizeEntries' | 'summarizeFormViewEntries' | 'summarizeTableEntries' | 'summarizeTableViewEntries' | 'updateAccessPolicy' | 'updateCheckinCampaign' | 'updateEntry' | 'updateEntryComment' | 'updateEntryViaPost' | 'updateEvaluationSetting' | 'updateExamSetting' | 'updateForm' | 'updateFormSetting' | 'updateFormTheme' | 'updateFormView' | 'updateManuallyCloseRule' | 'updateNotificationRule' | 'updateOpensearchQuery' | 'updatePublishedArtifact' | 'updateRoutine' | 'updateSmsSignature' | 'updateSmsTask' | 'updateSmsTemplate' | 'updateTable' | 'updateTableEntry' | 'updateTableEntryComment' | 'updateTableEntryViaPost' | 'updateTableView' | 'uploadEntryAttachment' | 'uploadFormImage' | 'uploadImportFile' | 'uploadUserLicenseAttachment' | 'verifyRedirectParams';
4
+ /** The day spec/openapi.yaml was fetched from the API, when scripts/fetch-spec.mjs recorded it. */
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' | 'createFormView' | 'createFormWebhook' | 'createMemoryNote' | 'createMessageChannel' | 'createNotificationRule' | 'createOpensearchQuery' | 'createRoutine' | 'createSmsSignature' | 'createSmsTask' | 'createSmsTemplate' | 'createTable' | 'createTableEntry' | 'createTableEntryComment' | 'createTableView' | 'createTemplateUsage' | 'createWeixinOauthSession' | 'deleteCheckinCampaign' | 'deleteEntry' | 'deleteEntryComment' | 'deleteForm' | 'deleteFormView' | 'deleteFormWebhook' | 'deleteMemoryNotes' | 'deleteMessageChannel' | 'deleteNotificationRule' | 'deleteRoutine' | 'deleteSmsSignature' | 'deleteSmsTemplate' | 'deleteTable' | 'deleteTableEntry' | 'deleteTableEntryComment' | 'deleteTableView' | 'estimateEmailTask' | 'estimateEmailTaskResend' | 'estimateMessage' | 'estimateSmsTask' | 'estimateSmsTaskChange' | 'estimateSmsTaskResend' | 'getBillingAccount' | 'getCheckinCampaign' | 'getCurrentUser' | 'getEmailTask' | 'getEntry' | 'getEntryImport' | 'getEntryStats' | 'getEvaluationSetting' | 'getExamSetting' | 'getFieldType' | 'getFillFormPage' | 'getFillViewPage' | 'getFolder' | 'getForm' | 'getFormSetting' | 'getFormView' | 'getManuallyCloseRule' | 'getMemory' | 'getMessage' | 'getMessageChannel' | 'getNotificationRule' | 'getOpensearchQuery' | 'getPublishedArtifact' | 'getRoutine' | 'getSmsTask' | 'getTable' | 'getTableEntry' | 'getTableView' | 'getTradeMerchant' | 'listArtifacts' | 'listBillingAccountInvoices' | 'listBillingAccountPaidFeatures' | 'listBillingAccountPaymentHistories' | 'listBillingAccountUsers' | 'listCheckinCampaigns' | 'listContacts' | 'listEmailTaskActivities' | 'listEmailTasks' | 'listEntries' | 'listEntryComments' | 'listExtendedAttributes' | 'listFieldRules' | 'listFieldTypes' | 'listFolders' | 'listFormConditionTriggerableFields' | 'listFormCooperators' | 'listFormViewEntries' | 'listFormViews' | 'listForms' | 'listMessageChannels' | 'listMessages' | 'listMyFilledForms' | 'listMySubmittedEntries' | 'listNotificationRuleNotifications' | 'listNotificationRules' | 'listOpensearchQueries' | 'listOpensearchQuerySuggestions' | 'listRoutineRuns' | 'listRoutines' | 'listSmsAuditStatuses' | 'listSmsSignatures' | 'listSmsTaskActivities' | 'listSmsTasks' | 'listSmsTemplates' | 'listSmtpAccounts' | 'listTableConditionTriggerableFields' | 'listTableEntries' | 'listTableEntryComments' | 'listTableViewEntries' | 'listTableViews' | 'listTables' | 'listTradePayouts' | 'listTradeRefunds' | 'listTradeTransactions' | 'moveFormToFolder' | 'moveTableToFolder' | 'patchEntriesBatch' | 'pauseRoutine' | 'prepareEntryAttachmentUpload' | 'prepareFormImageUpload' | 'prepareImportFileUpload' | 'previewFormFieldTypeChange' | 'previewTableFieldTypeChange' | 'replaceEntry' | 'replaceTableEntry' | 'resendEmailTask' | 'resendSmsTask' | 'resumeRoutine' | 'runRoutine' | 'searchEntriesAcrossForms' | 'searchMySubmittedEntries' | 'sendMessage' | 'sendSmsTask' | 'summarizeEntries' | 'summarizeFormViewEntries' | 'summarizeTableEntries' | 'summarizeTableViewEntries' | 'updateAccessPolicy' | 'updateCheckinCampaign' | 'updateEntry' | 'updateEntryComment' | 'updateEntryViaPost' | 'updateEvaluationSetting' | 'updateExamSetting' | 'updateForm' | 'updateFormSetting' | 'updateFormTheme' | 'updateFormView' | 'updateManuallyCloseRule' | 'updateMemoryNote' | 'updateNotificationRule' | 'updateOpensearchQuery' | 'updatePublishedArtifact' | 'updateRoutine' | 'updateSmsSignature' | 'updateSmsTask' | 'updateSmsTemplate' | 'updateTable' | 'updateTableEntry' | 'updateTableEntryComment' | 'updateTableEntryViaPost' | 'updateTableView' | 'uploadEntryAttachment' | 'uploadFormImage' | 'uploadImportFile' | 'uploadUserLicenseAttachment' | 'verifyRedirectParams';
5
7
  export declare const OPERATIONS: {
6
8
  readonly [id in OperationId]: Operation;
7
9
  };