@jinshuju/mcp 0.2.0 → 0.3.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 -98
- package/dist/analytics.d.ts +23 -3
- package/dist/analytics.js +55 -2
- package/dist/api.js +2 -1
- package/dist/generated/meta.json +3 -2
- package/dist/generated/operations.json +192 -36
- package/dist/generated/schemas.json +1858 -90
- package/dist/generated/tools.json +793 -105
- package/dist/result.d.ts +2 -0
- package/dist/result.js +3 -1
- package/dist/types.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -15,12 +15,14 @@
|
|
|
15
15
|
{
|
|
16
16
|
"name": "filters",
|
|
17
17
|
"in": "query",
|
|
18
|
-
"required": false
|
|
18
|
+
"required": false,
|
|
19
|
+
"json": true
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
22
|
"name": "sort",
|
|
22
23
|
"in": "query",
|
|
23
|
-
"required": false
|
|
24
|
+
"required": false,
|
|
25
|
+
"json": true
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
"name": "next",
|
|
@@ -67,12 +69,103 @@
|
|
|
67
69
|
"description": "Fuzzy match on name (case-insensitive; matches both the public name and the in-product name). Accepts several values (`q[]=A&q[]=B`), matching forms whose name contains any of them. Equivalent to `filters=[{\"field\":\"form_name\",\"operator\":\"like\",\"value\":...}]`."
|
|
68
70
|
},
|
|
69
71
|
"filters": {
|
|
70
|
-
"type":
|
|
71
|
-
|
|
72
|
+
"type": [
|
|
73
|
+
"array",
|
|
74
|
+
"string"
|
|
75
|
+
],
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
79
|
+
"required": [
|
|
80
|
+
"field",
|
|
81
|
+
"operator"
|
|
82
|
+
],
|
|
83
|
+
"properties": {
|
|
84
|
+
"field": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
87
|
+
},
|
|
88
|
+
"operator": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"enum": [
|
|
91
|
+
"eq",
|
|
92
|
+
"ne",
|
|
93
|
+
"any_in",
|
|
94
|
+
"none_in",
|
|
95
|
+
"between",
|
|
96
|
+
"not_between",
|
|
97
|
+
"null",
|
|
98
|
+
"not_null",
|
|
99
|
+
"gte",
|
|
100
|
+
"gt",
|
|
101
|
+
"lte",
|
|
102
|
+
"lt",
|
|
103
|
+
"like",
|
|
104
|
+
"not_like",
|
|
105
|
+
"within_last",
|
|
106
|
+
"equal",
|
|
107
|
+
"not_equal",
|
|
108
|
+
"start",
|
|
109
|
+
"end"
|
|
110
|
+
],
|
|
111
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
112
|
+
},
|
|
113
|
+
"value": {
|
|
114
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"examples": [
|
|
119
|
+
[
|
|
120
|
+
{
|
|
121
|
+
"field": "entries_count",
|
|
122
|
+
"operator": "gte",
|
|
123
|
+
"value": 1
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
],
|
|
127
|
+
"description": "Filters, an array of ScopeCondition objects; conditions are combined with AND. Filterable fields and operators:\n| field | type | operators |\n|---|---|---|\n| `form_name` | text | `eq` `ne` `any_in` `none_in` `like` `not_like` |\n| `created_at` | time | `eq` `ne` `gte` `gt` `lte` `lt` `within_last` |\n| `last_entry_created_at` | time | same as above (forms that have never received an entry have no value) |\n| `entries_count` | integer | `eq` `ne` `gte` `gt` `lte` `lt` |\n\nThe value of `within_last` looks like `{\"unit\":\"day\",\"n\":30}` (unit can be minute / day / week / month), meaning the window going back from now.\nExample: `[{\"field\":\"last_entry_created_at\",\"operator\":\"within_last\",\"value\":{\"unit\":\"day\",\"n\":7}}]`\n"
|
|
72
128
|
},
|
|
73
129
|
"sort": {
|
|
74
|
-
"type":
|
|
75
|
-
|
|
130
|
+
"type": [
|
|
131
|
+
"array",
|
|
132
|
+
"string"
|
|
133
|
+
],
|
|
134
|
+
"items": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"required": [
|
|
137
|
+
"field"
|
|
138
|
+
],
|
|
139
|
+
"properties": {
|
|
140
|
+
"field": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"enum": [
|
|
143
|
+
"created_at",
|
|
144
|
+
"last_entry_created_at",
|
|
145
|
+
"entries_count"
|
|
146
|
+
],
|
|
147
|
+
"description": "Form attribute to sort by"
|
|
148
|
+
},
|
|
149
|
+
"order": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"enum": [
|
|
152
|
+
"asc",
|
|
153
|
+
"desc"
|
|
154
|
+
],
|
|
155
|
+
"default": "asc",
|
|
156
|
+
"description": "Sort direction"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"examples": [
|
|
161
|
+
[
|
|
162
|
+
{
|
|
163
|
+
"field": "last_entry_created_at",
|
|
164
|
+
"order": "desc"
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
],
|
|
168
|
+
"description": "Sort rules, an array of FormSortRule objects, applied in order.\nSortable fields: `created_at`, `last_entry_created_at`, `entries_count`; any other field, an invalid order or unparseable JSON returns 400.\nWith `sort`, `next` becomes a cursor of the form `row:<offset>`, usable only in requests with the same `sort`; rows with equal values may change order between pages.\n"
|
|
76
169
|
},
|
|
77
170
|
"next": {
|
|
78
171
|
"type": "string",
|
|
@@ -107,7 +200,7 @@
|
|
|
107
200
|
{
|
|
108
201
|
"operationId": "getForm",
|
|
109
202
|
"summary": "Show a form's structure",
|
|
110
|
-
"description": "Show a form's structure\nReturns the form's name, public
|
|
203
|
+
"description": "Show a form's structure\nReturns the form's name, `kind`, `scene`, public URL (`url`), description, field definitions and settings. Each element of `fields` is a single-key object `{ \"<api_code>\": {...} }`, in field order.\nAlso answers for a table or a quick payment form token; `kind` says which it is.\nThe following are included when the matching parameter is `true`:\n- `include_analytics`: each analysable field's definition carries `analytics`;\n- `include_theme`: carries `theme` (the form theme);\n- `include_field_rules`: carries `field_rules` (field display rules);\n- `include_extended_attributes`: carries `extended_attributes` (source-tracking links);\n- `include_transactions`: carries `transactions` (payment statistics) when the form is bound to a payment account.\nReturns schema \"FormDetail\" (see get_schema).\nThe api_code of each field in the returned fields is its key when reading and writing entries.",
|
|
111
204
|
"tag": "Forms",
|
|
112
205
|
"method": "get",
|
|
113
206
|
"path": "/forms/{form_token}",
|
|
@@ -934,7 +1027,8 @@
|
|
|
934
1027
|
{
|
|
935
1028
|
"name": "checks",
|
|
936
1029
|
"in": "query",
|
|
937
|
-
"required": true
|
|
1030
|
+
"required": true,
|
|
1031
|
+
"json": true
|
|
938
1032
|
}
|
|
939
1033
|
],
|
|
940
1034
|
"paramNames": [
|
|
@@ -956,8 +1050,63 @@
|
|
|
956
1050
|
"description": "Form token (`token` from `GET /forms`); a 24-character hexadecimal form id is also accepted."
|
|
957
1051
|
},
|
|
958
1052
|
"checks": {
|
|
959
|
-
"type":
|
|
960
|
-
|
|
1053
|
+
"type": [
|
|
1054
|
+
"array",
|
|
1055
|
+
"string"
|
|
1056
|
+
],
|
|
1057
|
+
"items": {
|
|
1058
|
+
"type": "object",
|
|
1059
|
+
"required": [
|
|
1060
|
+
"field_api_code"
|
|
1061
|
+
],
|
|
1062
|
+
"properties": {
|
|
1063
|
+
"field_api_code": {
|
|
1064
|
+
"type": "string",
|
|
1065
|
+
"description": "api_code of the field to check; to check one column of a table / matrix field, that column's api_code, with `parent_field` set"
|
|
1066
|
+
},
|
|
1067
|
+
"choice_value": {
|
|
1068
|
+
"type": "string",
|
|
1069
|
+
"description": "api_code of one choice to check; omitted, checks whether the whole field has any data"
|
|
1070
|
+
},
|
|
1071
|
+
"choice_type": {
|
|
1072
|
+
"type": "string",
|
|
1073
|
+
"enum": [
|
|
1074
|
+
"choice",
|
|
1075
|
+
"statement",
|
|
1076
|
+
"dimension",
|
|
1077
|
+
"level_1",
|
|
1078
|
+
"level_2",
|
|
1079
|
+
"level_3",
|
|
1080
|
+
"level_4"
|
|
1081
|
+
],
|
|
1082
|
+
"description": "What `choice_value` names, `choice` by default; `statement` / `dimension` for matrix fields, `level_1` to `level_4` for cascading drop-downs"
|
|
1083
|
+
},
|
|
1084
|
+
"parent_field": {
|
|
1085
|
+
"type": "string",
|
|
1086
|
+
"description": "api_code of the parent field when checking one column of a matrix / table field"
|
|
1087
|
+
},
|
|
1088
|
+
"check_extended_text": {
|
|
1089
|
+
"type": "boolean",
|
|
1090
|
+
"description": "When true, checks whether the choice's \"Other\" extra text has any data"
|
|
1091
|
+
},
|
|
1092
|
+
"goods_item_dimension_options": {
|
|
1093
|
+
"type": "object",
|
|
1094
|
+
"description": "When checking one spec of a goods field, the mapping of spec dimensions to options"
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
"examples": [
|
|
1099
|
+
[
|
|
1100
|
+
{
|
|
1101
|
+
"field_api_code": "field_1"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"field_api_code": "field_3",
|
|
1105
|
+
"choice_value": "Yb2d"
|
|
1106
|
+
}
|
|
1107
|
+
]
|
|
1108
|
+
],
|
|
1109
|
+
"description": "Targets to check, an array of 1 to 100 FieldDataCheck objects, each naming one field or one choice."
|
|
961
1110
|
}
|
|
962
1111
|
},
|
|
963
1112
|
"additionalProperties": false,
|
|
@@ -989,7 +1138,8 @@
|
|
|
989
1138
|
{
|
|
990
1139
|
"name": "checks",
|
|
991
1140
|
"in": "query",
|
|
992
|
-
"required": true
|
|
1141
|
+
"required": true,
|
|
1142
|
+
"json": true
|
|
993
1143
|
}
|
|
994
1144
|
],
|
|
995
1145
|
"paramNames": [
|
|
@@ -1011,8 +1161,46 @@
|
|
|
1011
1161
|
"description": "Form token (`token` from `GET /forms`); a 24-character hexadecimal form id is also accepted."
|
|
1012
1162
|
},
|
|
1013
1163
|
"checks": {
|
|
1014
|
-
"type":
|
|
1015
|
-
|
|
1164
|
+
"type": [
|
|
1165
|
+
"array",
|
|
1166
|
+
"string"
|
|
1167
|
+
],
|
|
1168
|
+
"items": {
|
|
1169
|
+
"type": "object",
|
|
1170
|
+
"required": [
|
|
1171
|
+
"field_api_code",
|
|
1172
|
+
"target_type"
|
|
1173
|
+
],
|
|
1174
|
+
"properties": {
|
|
1175
|
+
"field_api_code": {
|
|
1176
|
+
"type": "string",
|
|
1177
|
+
"description": "api_code of the field to convert"
|
|
1178
|
+
},
|
|
1179
|
+
"target_type": {
|
|
1180
|
+
"type": "string",
|
|
1181
|
+
"description": "Target field type; see `GET /field_types` for the values (`GET /field_types?kind=table` for tables)"
|
|
1182
|
+
},
|
|
1183
|
+
"target_precision": {
|
|
1184
|
+
"type": "string",
|
|
1185
|
+
"enum": [
|
|
1186
|
+
"month",
|
|
1187
|
+
"day",
|
|
1188
|
+
"minute",
|
|
1189
|
+
"second"
|
|
1190
|
+
],
|
|
1191
|
+
"description": "When the target is `DateTimeField`, the date precision the edit will use, so the preview matches the actual conversion; ignored otherwise"
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
},
|
|
1195
|
+
"examples": [
|
|
1196
|
+
[
|
|
1197
|
+
{
|
|
1198
|
+
"field_api_code": "field_1",
|
|
1199
|
+
"target_type": "RadioButton"
|
|
1200
|
+
}
|
|
1201
|
+
]
|
|
1202
|
+
],
|
|
1203
|
+
"description": "Type conversions to preview, an array of 1 to 20 FieldTypeChangeCheck objects, one field per item."
|
|
1016
1204
|
}
|
|
1017
1205
|
},
|
|
1018
1206
|
"additionalProperties": false,
|
|
@@ -1108,7 +1296,8 @@
|
|
|
1108
1296
|
{
|
|
1109
1297
|
"name": "filters",
|
|
1110
1298
|
"in": "query",
|
|
1111
|
-
"required": false
|
|
1299
|
+
"required": false,
|
|
1300
|
+
"json": true
|
|
1112
1301
|
},
|
|
1113
1302
|
{
|
|
1114
1303
|
"name": "keyword",
|
|
@@ -1118,7 +1307,8 @@
|
|
|
1118
1307
|
{
|
|
1119
1308
|
"name": "sort",
|
|
1120
1309
|
"in": "query",
|
|
1121
|
-
"required": false
|
|
1310
|
+
"required": false,
|
|
1311
|
+
"json": true
|
|
1122
1312
|
},
|
|
1123
1313
|
{
|
|
1124
1314
|
"name": "created_at",
|
|
@@ -1177,8 +1367,65 @@
|
|
|
1177
1367
|
"description": "Return only these fields. A JSON array, a comma-separated string or a repeated parameter, of field api_codes; the serial number is always returned. Returns 400 listing the available fields when an api_code is unknown."
|
|
1178
1368
|
},
|
|
1179
1369
|
"filters": {
|
|
1180
|
-
"type":
|
|
1181
|
-
|
|
1370
|
+
"type": [
|
|
1371
|
+
"array",
|
|
1372
|
+
"string"
|
|
1373
|
+
],
|
|
1374
|
+
"items": {
|
|
1375
|
+
"type": "object",
|
|
1376
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
1377
|
+
"required": [
|
|
1378
|
+
"field",
|
|
1379
|
+
"operator"
|
|
1380
|
+
],
|
|
1381
|
+
"properties": {
|
|
1382
|
+
"field": {
|
|
1383
|
+
"type": "string",
|
|
1384
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
1385
|
+
},
|
|
1386
|
+
"operator": {
|
|
1387
|
+
"type": "string",
|
|
1388
|
+
"enum": [
|
|
1389
|
+
"eq",
|
|
1390
|
+
"ne",
|
|
1391
|
+
"any_in",
|
|
1392
|
+
"none_in",
|
|
1393
|
+
"between",
|
|
1394
|
+
"not_between",
|
|
1395
|
+
"null",
|
|
1396
|
+
"not_null",
|
|
1397
|
+
"gte",
|
|
1398
|
+
"gt",
|
|
1399
|
+
"lte",
|
|
1400
|
+
"lt",
|
|
1401
|
+
"like",
|
|
1402
|
+
"not_like",
|
|
1403
|
+
"within_last",
|
|
1404
|
+
"equal",
|
|
1405
|
+
"not_equal",
|
|
1406
|
+
"start",
|
|
1407
|
+
"end"
|
|
1408
|
+
],
|
|
1409
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
1410
|
+
},
|
|
1411
|
+
"value": {
|
|
1412
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
},
|
|
1416
|
+
"examples": [
|
|
1417
|
+
[
|
|
1418
|
+
{
|
|
1419
|
+
"field": "field_3",
|
|
1420
|
+
"operator": "any_in",
|
|
1421
|
+
"value": [
|
|
1422
|
+
"选项 A",
|
|
1423
|
+
"选项 B"
|
|
1424
|
+
]
|
|
1425
|
+
}
|
|
1426
|
+
]
|
|
1427
|
+
],
|
|
1428
|
+
"description": "Filters, an array of ScopeCondition objects; conditions are combined with AND.\n- Each field type accepts only some of the operators; an unsupported one returns 400 listing the available operators.\n- For choice fields (single choice / multiple choice / drop-down / cascading drop-down), `value` can be a choice api_code or a choice label; a cascading drop-down also accepts a `level1-level2` path.\n- For `between` / `not_between`, `value` is a two-element array `[min, max]`; matrix / table fields need `{\"<column api_code>\": [min, max]}`.\n- `within_last` works only on date fields; `value` looks like `{\"unit\":\"day\",\"n\":30}` (unit can be minute / day / week / month).\n- `creator_id` is a special field that filters by submitter with `eq` (the value is a user id), and can appear only once.\n- `serial_number` is a special field that filters by serial number with `eq` / `any_in`; several conditions are intersected.\n- For a relation field (RelationField), the `value` of `any_in` / `none_in` is serial numbers of entries in the related table; returns 400 when a serial number does not exist.\n- With a `created_at` condition, results are sorted by creation time instead.\n- To find entries whose multiple-choice field contains a choice, use `any_in` (`none_in` to exclude); `eq` is not \"contains\": it matches only entries with exactly the same set of choices."
|
|
1182
1429
|
},
|
|
1183
1430
|
"keyword": {
|
|
1184
1431
|
"type": "string",
|
|
@@ -1186,8 +1433,40 @@
|
|
|
1186
1433
|
"description": "Full-text keyword (at most 200 characters), fuzzy-matched across all searchable fields. Forms with more than 99999 entries and no analytics engine enabled do not support full-text search (returns 400), unless `creator_id` also restricts the submitter."
|
|
1187
1434
|
},
|
|
1188
1435
|
"sort": {
|
|
1189
|
-
"type":
|
|
1190
|
-
|
|
1436
|
+
"type": [
|
|
1437
|
+
"array",
|
|
1438
|
+
"string"
|
|
1439
|
+
],
|
|
1440
|
+
"items": {
|
|
1441
|
+
"type": "object",
|
|
1442
|
+
"required": [
|
|
1443
|
+
"api_code"
|
|
1444
|
+
],
|
|
1445
|
+
"properties": {
|
|
1446
|
+
"api_code": {
|
|
1447
|
+
"type": "string",
|
|
1448
|
+
"description": "api_code of the field to sort by; only sortable fields are allowed"
|
|
1449
|
+
},
|
|
1450
|
+
"order": {
|
|
1451
|
+
"type": "string",
|
|
1452
|
+
"enum": [
|
|
1453
|
+
"asc",
|
|
1454
|
+
"desc"
|
|
1455
|
+
],
|
|
1456
|
+
"default": "asc",
|
|
1457
|
+
"description": "Sort direction"
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
"examples": [
|
|
1462
|
+
[
|
|
1463
|
+
{
|
|
1464
|
+
"api_code": "created_at",
|
|
1465
|
+
"order": "desc"
|
|
1466
|
+
}
|
|
1467
|
+
]
|
|
1468
|
+
],
|
|
1469
|
+
"description": "Sort rules, an array of SortRule objects, applied in order, with ascending serial number appended automatically at the end.\nOnly sortable fields are allowed; otherwise returns 400 listing the sortable fields. With `sort`, `next` becomes a row offset.\n"
|
|
1191
1470
|
},
|
|
1192
1471
|
"created_at": {
|
|
1193
1472
|
"type": "string",
|
|
@@ -1819,12 +2098,14 @@
|
|
|
1819
2098
|
{
|
|
1820
2099
|
"name": "metrics",
|
|
1821
2100
|
"in": "query",
|
|
1822
|
-
"required": false
|
|
2101
|
+
"required": false,
|
|
2102
|
+
"json": true
|
|
1823
2103
|
},
|
|
1824
2104
|
{
|
|
1825
2105
|
"name": "dimensions",
|
|
1826
2106
|
"in": "query",
|
|
1827
|
-
"required": false
|
|
2107
|
+
"required": false,
|
|
2108
|
+
"json": true
|
|
1828
2109
|
},
|
|
1829
2110
|
{
|
|
1830
2111
|
"name": "limit",
|
|
@@ -1834,7 +2115,8 @@
|
|
|
1834
2115
|
{
|
|
1835
2116
|
"name": "filters",
|
|
1836
2117
|
"in": "query",
|
|
1837
|
-
"required": false
|
|
2118
|
+
"required": false,
|
|
2119
|
+
"json": true
|
|
1838
2120
|
},
|
|
1839
2121
|
{
|
|
1840
2122
|
"name": "keyword",
|
|
@@ -1865,12 +2147,94 @@
|
|
|
1865
2147
|
"description": "Form token (`token` from `GET /forms`); a 24-character hexadecimal form id is also accepted."
|
|
1866
2148
|
},
|
|
1867
2149
|
"metrics": {
|
|
1868
|
-
"type":
|
|
1869
|
-
|
|
2150
|
+
"type": [
|
|
2151
|
+
"array",
|
|
2152
|
+
"string"
|
|
2153
|
+
],
|
|
2154
|
+
"items": {
|
|
2155
|
+
"type": "object",
|
|
2156
|
+
"required": [
|
|
2157
|
+
"func",
|
|
2158
|
+
"field"
|
|
2159
|
+
],
|
|
2160
|
+
"properties": {
|
|
2161
|
+
"func": {
|
|
2162
|
+
"type": "string",
|
|
2163
|
+
"enum": [
|
|
2164
|
+
"count",
|
|
2165
|
+
"count_non_empty",
|
|
2166
|
+
"count_empty",
|
|
2167
|
+
"count_unique",
|
|
2168
|
+
"sum",
|
|
2169
|
+
"avg",
|
|
2170
|
+
"min",
|
|
2171
|
+
"max",
|
|
2172
|
+
"stddev",
|
|
2173
|
+
"median",
|
|
2174
|
+
"p25",
|
|
2175
|
+
"p75",
|
|
2176
|
+
"p90"
|
|
2177
|
+
],
|
|
2178
|
+
"description": "Aggregate function; the field's `analytics.agg_funcs` says which ones it supports"
|
|
2179
|
+
},
|
|
2180
|
+
"field": {
|
|
2181
|
+
"type": "string",
|
|
2182
|
+
"description": "api_code of the field to aggregate"
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
"examples": [
|
|
2187
|
+
[
|
|
2188
|
+
{
|
|
2189
|
+
"func": "sum",
|
|
2190
|
+
"field": "field_5"
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
"func": "count",
|
|
2194
|
+
"field": "field_1"
|
|
2195
|
+
}
|
|
2196
|
+
]
|
|
2197
|
+
],
|
|
2198
|
+
"description": "Required. Metrics to compute, an array of 1 to 20 AggregateMetric objects; returns 400 when missing or empty.\nThe available functions depend on the field (the field's `analytics.agg_funcs` is authoritative):\n| Field | Functions |\n|---|---|\n| All fields | `count` `count_non_empty` `count_empty` |\n| Text | adds `count_unique` |\n| Number | adds `count_unique` `sum` `avg` `min` `max` `stddev` `median` `p25` `p75` `p90` |\n| Date | adds `count_unique` `min` `max` |\n"
|
|
1870
2199
|
},
|
|
1871
2200
|
"dimensions": {
|
|
1872
|
-
"type":
|
|
1873
|
-
|
|
2201
|
+
"type": [
|
|
2202
|
+
"array",
|
|
2203
|
+
"string"
|
|
2204
|
+
],
|
|
2205
|
+
"items": {
|
|
2206
|
+
"type": "object",
|
|
2207
|
+
"required": [
|
|
2208
|
+
"field"
|
|
2209
|
+
],
|
|
2210
|
+
"properties": {
|
|
2211
|
+
"field": {
|
|
2212
|
+
"type": "string",
|
|
2213
|
+
"description": "api_code of the field to group by; only fields whose `analytics.groupable` is true"
|
|
2214
|
+
},
|
|
2215
|
+
"bucket": {
|
|
2216
|
+
"type": "string",
|
|
2217
|
+
"enum": [
|
|
2218
|
+
"day",
|
|
2219
|
+
"week",
|
|
2220
|
+
"month"
|
|
2221
|
+
],
|
|
2222
|
+
"description": "Time granularity, required for a date field and not allowed on any other"
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
},
|
|
2226
|
+
"examples": [
|
|
2227
|
+
[
|
|
2228
|
+
{
|
|
2229
|
+
"field": "field_3"
|
|
2230
|
+
},
|
|
2231
|
+
{
|
|
2232
|
+
"field": "created_at",
|
|
2233
|
+
"bucket": "month"
|
|
2234
|
+
}
|
|
2235
|
+
]
|
|
2236
|
+
],
|
|
2237
|
+
"description": "Fields to group by, an array of at most 2 AggregateDimension objects.\nOnly fields whose `analytics.groupable` is true can be grouped by; a date field must have a `bucket` (`day` / `week` / `month`, in Beijing time, UTC+8), and a non-date field must not have a `bucket`.\n"
|
|
1874
2238
|
},
|
|
1875
2239
|
"limit": {
|
|
1876
2240
|
"type": "integer",
|
|
@@ -1878,8 +2242,65 @@
|
|
|
1878
2242
|
"description": "Maximum number of groups returned when grouping. Defaults to 20, max 200 (larger values are treated as 200; values below 1 use the default). Ignored without grouping."
|
|
1879
2243
|
},
|
|
1880
2244
|
"filters": {
|
|
1881
|
-
"type":
|
|
1882
|
-
|
|
2245
|
+
"type": [
|
|
2246
|
+
"array",
|
|
2247
|
+
"string"
|
|
2248
|
+
],
|
|
2249
|
+
"items": {
|
|
2250
|
+
"type": "object",
|
|
2251
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
2252
|
+
"required": [
|
|
2253
|
+
"field",
|
|
2254
|
+
"operator"
|
|
2255
|
+
],
|
|
2256
|
+
"properties": {
|
|
2257
|
+
"field": {
|
|
2258
|
+
"type": "string",
|
|
2259
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
2260
|
+
},
|
|
2261
|
+
"operator": {
|
|
2262
|
+
"type": "string",
|
|
2263
|
+
"enum": [
|
|
2264
|
+
"eq",
|
|
2265
|
+
"ne",
|
|
2266
|
+
"any_in",
|
|
2267
|
+
"none_in",
|
|
2268
|
+
"between",
|
|
2269
|
+
"not_between",
|
|
2270
|
+
"null",
|
|
2271
|
+
"not_null",
|
|
2272
|
+
"gte",
|
|
2273
|
+
"gt",
|
|
2274
|
+
"lte",
|
|
2275
|
+
"lt",
|
|
2276
|
+
"like",
|
|
2277
|
+
"not_like",
|
|
2278
|
+
"within_last",
|
|
2279
|
+
"equal",
|
|
2280
|
+
"not_equal",
|
|
2281
|
+
"start",
|
|
2282
|
+
"end"
|
|
2283
|
+
],
|
|
2284
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
2285
|
+
},
|
|
2286
|
+
"value": {
|
|
2287
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
},
|
|
2291
|
+
"examples": [
|
|
2292
|
+
[
|
|
2293
|
+
{
|
|
2294
|
+
"field": "field_3",
|
|
2295
|
+
"operator": "any_in",
|
|
2296
|
+
"value": [
|
|
2297
|
+
"选项 A",
|
|
2298
|
+
"选项 B"
|
|
2299
|
+
]
|
|
2300
|
+
}
|
|
2301
|
+
]
|
|
2302
|
+
],
|
|
2303
|
+
"description": "Filters, an array of ScopeCondition objects; conditions are combined with AND.\n- Each field type accepts only some of the operators; an unsupported one returns 400 listing the available operators.\n- For choice fields (single choice / multiple choice / drop-down / cascading drop-down), `value` can be a choice api_code or a choice label; a cascading drop-down also accepts a `level1-level2` path.\n- For `between` / `not_between`, `value` is a two-element array `[min, max]`; matrix / table fields need `{\"<column api_code>\": [min, max]}`.\n- `within_last` works only on date fields; `value` looks like `{\"unit\":\"day\",\"n\":30}` (unit can be minute / day / week / month).\n- `creator_id` is a special field that filters by submitter with `eq` (the value is a user id), and can appear only once.\n- `serial_number` is a special field that filters by serial number with `eq` / `any_in`; several conditions are intersected.\n- For a relation field (RelationField), the `value` of `any_in` / `none_in` is serial numbers of entries in the related table; returns 400 when a serial number does not exist.\n- With a `created_at` condition, results are sorted by creation time instead.\n- To find entries whose multiple-choice field contains a choice, use `any_in` (`none_in` to exclude); `eq` is not \"contains\": it matches only entries with exactly the same set of choices."
|
|
1883
2304
|
},
|
|
1884
2305
|
"keyword": {
|
|
1885
2306
|
"type": "string",
|
|
@@ -1925,7 +2346,8 @@
|
|
|
1925
2346
|
{
|
|
1926
2347
|
"name": "filters",
|
|
1927
2348
|
"in": "query",
|
|
1928
|
-
"required": false
|
|
2349
|
+
"required": false,
|
|
2350
|
+
"json": true
|
|
1929
2351
|
},
|
|
1930
2352
|
{
|
|
1931
2353
|
"name": "keyword",
|
|
@@ -1964,8 +2386,65 @@
|
|
|
1964
2386
|
"description": "Whether to return `overview` (matching count and entries added today). Defaults to true."
|
|
1965
2387
|
},
|
|
1966
2388
|
"filters": {
|
|
1967
|
-
"type":
|
|
1968
|
-
|
|
2389
|
+
"type": [
|
|
2390
|
+
"array",
|
|
2391
|
+
"string"
|
|
2392
|
+
],
|
|
2393
|
+
"items": {
|
|
2394
|
+
"type": "object",
|
|
2395
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
2396
|
+
"required": [
|
|
2397
|
+
"field",
|
|
2398
|
+
"operator"
|
|
2399
|
+
],
|
|
2400
|
+
"properties": {
|
|
2401
|
+
"field": {
|
|
2402
|
+
"type": "string",
|
|
2403
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
2404
|
+
},
|
|
2405
|
+
"operator": {
|
|
2406
|
+
"type": "string",
|
|
2407
|
+
"enum": [
|
|
2408
|
+
"eq",
|
|
2409
|
+
"ne",
|
|
2410
|
+
"any_in",
|
|
2411
|
+
"none_in",
|
|
2412
|
+
"between",
|
|
2413
|
+
"not_between",
|
|
2414
|
+
"null",
|
|
2415
|
+
"not_null",
|
|
2416
|
+
"gte",
|
|
2417
|
+
"gt",
|
|
2418
|
+
"lte",
|
|
2419
|
+
"lt",
|
|
2420
|
+
"like",
|
|
2421
|
+
"not_like",
|
|
2422
|
+
"within_last",
|
|
2423
|
+
"equal",
|
|
2424
|
+
"not_equal",
|
|
2425
|
+
"start",
|
|
2426
|
+
"end"
|
|
2427
|
+
],
|
|
2428
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
2429
|
+
},
|
|
2430
|
+
"value": {
|
|
2431
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
},
|
|
2435
|
+
"examples": [
|
|
2436
|
+
[
|
|
2437
|
+
{
|
|
2438
|
+
"field": "field_3",
|
|
2439
|
+
"operator": "any_in",
|
|
2440
|
+
"value": [
|
|
2441
|
+
"选项 A",
|
|
2442
|
+
"选项 B"
|
|
2443
|
+
]
|
|
2444
|
+
}
|
|
2445
|
+
]
|
|
2446
|
+
],
|
|
2447
|
+
"description": "Filters, an array of ScopeCondition objects; conditions are combined with AND.\n- Each field type accepts only some of the operators; an unsupported one returns 400 listing the available operators.\n- For choice fields (single choice / multiple choice / drop-down / cascading drop-down), `value` can be a choice api_code or a choice label; a cascading drop-down also accepts a `level1-level2` path.\n- For `between` / `not_between`, `value` is a two-element array `[min, max]`; matrix / table fields need `{\"<column api_code>\": [min, max]}`.\n- `within_last` works only on date fields; `value` looks like `{\"unit\":\"day\",\"n\":30}` (unit can be minute / day / week / month).\n- `creator_id` is a special field that filters by submitter with `eq` (the value is a user id), and can appear only once.\n- `serial_number` is a special field that filters by serial number with `eq` / `any_in`; several conditions are intersected.\n- For a relation field (RelationField), the `value` of `any_in` / `none_in` is serial numbers of entries in the related table; returns 400 when a serial number does not exist.\n- With a `created_at` condition, results are sorted by creation time instead.\n- To find entries whose multiple-choice field contains a choice, use `any_in` (`none_in` to exclude); `eq` is not \"contains\": it matches only entries with exactly the same set of choices."
|
|
1969
2448
|
},
|
|
1970
2449
|
"keyword": {
|
|
1971
2450
|
"type": "string",
|
|
@@ -2006,7 +2485,8 @@
|
|
|
2006
2485
|
{
|
|
2007
2486
|
"name": "filters",
|
|
2008
2487
|
"in": "query",
|
|
2009
|
-
"required": false
|
|
2488
|
+
"required": false,
|
|
2489
|
+
"json": true
|
|
2010
2490
|
}
|
|
2011
2491
|
],
|
|
2012
2492
|
"paramNames": [
|
|
@@ -2034,8 +2514,65 @@
|
|
|
2034
2514
|
"description": "Tokens (ids also accepted) of the forms or tables to search, comma-separated (or repeat `form_tokens[]=`), at most 10 after deduplication. When omitted, every accessible form is searched."
|
|
2035
2515
|
},
|
|
2036
2516
|
"filters": {
|
|
2037
|
-
"type":
|
|
2038
|
-
|
|
2517
|
+
"type": [
|
|
2518
|
+
"array",
|
|
2519
|
+
"string"
|
|
2520
|
+
],
|
|
2521
|
+
"items": {
|
|
2522
|
+
"type": "object",
|
|
2523
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
2524
|
+
"required": [
|
|
2525
|
+
"field",
|
|
2526
|
+
"operator"
|
|
2527
|
+
],
|
|
2528
|
+
"properties": {
|
|
2529
|
+
"field": {
|
|
2530
|
+
"type": "string",
|
|
2531
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
2532
|
+
},
|
|
2533
|
+
"operator": {
|
|
2534
|
+
"type": "string",
|
|
2535
|
+
"enum": [
|
|
2536
|
+
"eq",
|
|
2537
|
+
"ne",
|
|
2538
|
+
"any_in",
|
|
2539
|
+
"none_in",
|
|
2540
|
+
"between",
|
|
2541
|
+
"not_between",
|
|
2542
|
+
"null",
|
|
2543
|
+
"not_null",
|
|
2544
|
+
"gte",
|
|
2545
|
+
"gt",
|
|
2546
|
+
"lte",
|
|
2547
|
+
"lt",
|
|
2548
|
+
"like",
|
|
2549
|
+
"not_like",
|
|
2550
|
+
"within_last",
|
|
2551
|
+
"equal",
|
|
2552
|
+
"not_equal",
|
|
2553
|
+
"start",
|
|
2554
|
+
"end"
|
|
2555
|
+
],
|
|
2556
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
2557
|
+
},
|
|
2558
|
+
"value": {
|
|
2559
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
},
|
|
2563
|
+
"examples": [
|
|
2564
|
+
[
|
|
2565
|
+
{
|
|
2566
|
+
"field": "last_entry_created_at",
|
|
2567
|
+
"operator": "within_last",
|
|
2568
|
+
"value": {
|
|
2569
|
+
"unit": "day",
|
|
2570
|
+
"n": 30
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
]
|
|
2574
|
+
],
|
|
2575
|
+
"description": "Filters on form attributes that narrow the search scope, an array of ScopeCondition objects, with the same fields as `filters` of `GET /forms` (`form_name` / `created_at` / `last_entry_created_at` / `entries_count`); conditions are combined with AND.\nWithout an `entries_count` condition, `entries_count > 0` is appended automatically.\n"
|
|
2039
2576
|
}
|
|
2040
2577
|
},
|
|
2041
2578
|
"additionalProperties": false,
|
|
@@ -2229,7 +2766,8 @@
|
|
|
2229
2766
|
{
|
|
2230
2767
|
"name": "filters",
|
|
2231
2768
|
"in": "query",
|
|
2232
|
-
"required": false
|
|
2769
|
+
"required": false,
|
|
2770
|
+
"json": true
|
|
2233
2771
|
},
|
|
2234
2772
|
{
|
|
2235
2773
|
"name": "keyword",
|
|
@@ -2286,8 +2824,65 @@
|
|
|
2286
2824
|
"description": "Return only these fields. A comma-separated string or an array parameter (`fields[]=`) of field api_codes; unknown or non-public fields are skipped. The serial number is always returned."
|
|
2287
2825
|
},
|
|
2288
2826
|
"filters": {
|
|
2289
|
-
"type":
|
|
2290
|
-
|
|
2827
|
+
"type": [
|
|
2828
|
+
"array",
|
|
2829
|
+
"string"
|
|
2830
|
+
],
|
|
2831
|
+
"items": {
|
|
2832
|
+
"type": "object",
|
|
2833
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
2834
|
+
"required": [
|
|
2835
|
+
"field",
|
|
2836
|
+
"operator"
|
|
2837
|
+
],
|
|
2838
|
+
"properties": {
|
|
2839
|
+
"field": {
|
|
2840
|
+
"type": "string",
|
|
2841
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
2842
|
+
},
|
|
2843
|
+
"operator": {
|
|
2844
|
+
"type": "string",
|
|
2845
|
+
"enum": [
|
|
2846
|
+
"eq",
|
|
2847
|
+
"ne",
|
|
2848
|
+
"any_in",
|
|
2849
|
+
"none_in",
|
|
2850
|
+
"between",
|
|
2851
|
+
"not_between",
|
|
2852
|
+
"null",
|
|
2853
|
+
"not_null",
|
|
2854
|
+
"gte",
|
|
2855
|
+
"gt",
|
|
2856
|
+
"lte",
|
|
2857
|
+
"lt",
|
|
2858
|
+
"like",
|
|
2859
|
+
"not_like",
|
|
2860
|
+
"within_last",
|
|
2861
|
+
"equal",
|
|
2862
|
+
"not_equal",
|
|
2863
|
+
"start",
|
|
2864
|
+
"end"
|
|
2865
|
+
],
|
|
2866
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
2867
|
+
},
|
|
2868
|
+
"value": {
|
|
2869
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
},
|
|
2873
|
+
"examples": [
|
|
2874
|
+
[
|
|
2875
|
+
{
|
|
2876
|
+
"field": "field_3",
|
|
2877
|
+
"operator": "any_in",
|
|
2878
|
+
"value": [
|
|
2879
|
+
"选项 A",
|
|
2880
|
+
"选项 B"
|
|
2881
|
+
]
|
|
2882
|
+
}
|
|
2883
|
+
]
|
|
2884
|
+
],
|
|
2885
|
+
"description": "Filters, an array of ScopeCondition objects; conditions are combined with AND.\n- Each field type accepts only some of the operators; an unsupported one returns 400 listing the available operators.\n- For choice fields (single choice / multiple choice / drop-down / cascading drop-down), `value` can be a choice api_code or a choice label; a cascading drop-down also accepts a `level1-level2` path.\n- For `between` / `not_between`, `value` is a two-element array `[min, max]`; matrix / table fields need `{\"<column api_code>\": [min, max]}`.\n- `within_last` works only on date fields; `value` looks like `{\"unit\":\"day\",\"n\":30}` (unit can be minute / day / week / month).\n- `creator_id` is a special field that filters by submitter with `eq` (the value is a user id), and can appear only once.\n- `serial_number` is a special field that filters by serial number with `eq` / `any_in`; several conditions are intersected.\n- For a relation field (RelationField), the `value` of `any_in` / `none_in` is serial numbers of entries in the related table; returns 400 when a serial number does not exist.\n- With a `created_at` condition, results are sorted by creation time instead.\n- To find entries whose multiple-choice field contains a choice, use `any_in` (`none_in` to exclude); `eq` is not \"contains\": it matches only entries with exactly the same set of choices."
|
|
2291
2886
|
},
|
|
2292
2887
|
"keyword": {
|
|
2293
2888
|
"type": "string",
|
|
@@ -3286,12 +3881,14 @@
|
|
|
3286
3881
|
{
|
|
3287
3882
|
"name": "filters",
|
|
3288
3883
|
"in": "query",
|
|
3289
|
-
"required": false
|
|
3884
|
+
"required": false,
|
|
3885
|
+
"json": true
|
|
3290
3886
|
},
|
|
3291
3887
|
{
|
|
3292
3888
|
"name": "sort",
|
|
3293
3889
|
"in": "query",
|
|
3294
|
-
"required": false
|
|
3890
|
+
"required": false,
|
|
3891
|
+
"json": true
|
|
3295
3892
|
},
|
|
3296
3893
|
{
|
|
3297
3894
|
"name": "next",
|
|
@@ -3332,12 +3929,103 @@
|
|
|
3332
3929
|
"description": "Fuzzy match on name (case-insensitive; matches both the public name and the in-product name). Accepts several values (`q[]=A&q[]=B`), matching forms whose name contains any of them. Equivalent to `filters=[{\"field\":\"form_name\",\"operator\":\"like\",\"value\":...}]`."
|
|
3333
3930
|
},
|
|
3334
3931
|
"filters": {
|
|
3335
|
-
"type":
|
|
3336
|
-
|
|
3932
|
+
"type": [
|
|
3933
|
+
"array",
|
|
3934
|
+
"string"
|
|
3935
|
+
],
|
|
3936
|
+
"items": {
|
|
3937
|
+
"type": "object",
|
|
3938
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
3939
|
+
"required": [
|
|
3940
|
+
"field",
|
|
3941
|
+
"operator"
|
|
3942
|
+
],
|
|
3943
|
+
"properties": {
|
|
3944
|
+
"field": {
|
|
3945
|
+
"type": "string",
|
|
3946
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
3947
|
+
},
|
|
3948
|
+
"operator": {
|
|
3949
|
+
"type": "string",
|
|
3950
|
+
"enum": [
|
|
3951
|
+
"eq",
|
|
3952
|
+
"ne",
|
|
3953
|
+
"any_in",
|
|
3954
|
+
"none_in",
|
|
3955
|
+
"between",
|
|
3956
|
+
"not_between",
|
|
3957
|
+
"null",
|
|
3958
|
+
"not_null",
|
|
3959
|
+
"gte",
|
|
3960
|
+
"gt",
|
|
3961
|
+
"lte",
|
|
3962
|
+
"lt",
|
|
3963
|
+
"like",
|
|
3964
|
+
"not_like",
|
|
3965
|
+
"within_last",
|
|
3966
|
+
"equal",
|
|
3967
|
+
"not_equal",
|
|
3968
|
+
"start",
|
|
3969
|
+
"end"
|
|
3970
|
+
],
|
|
3971
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
3972
|
+
},
|
|
3973
|
+
"value": {
|
|
3974
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
},
|
|
3978
|
+
"examples": [
|
|
3979
|
+
[
|
|
3980
|
+
{
|
|
3981
|
+
"field": "entries_count",
|
|
3982
|
+
"operator": "gte",
|
|
3983
|
+
"value": 1
|
|
3984
|
+
}
|
|
3985
|
+
]
|
|
3986
|
+
],
|
|
3987
|
+
"description": "Filters, an array of ScopeCondition objects; conditions are combined with AND. Filterable fields and operators:\n| field | type | operators |\n|---|---|---|\n| `form_name` | text | `eq` `ne` `any_in` `none_in` `like` `not_like` |\n| `created_at` | time | `eq` `ne` `gte` `gt` `lte` `lt` `within_last` |\n| `last_entry_created_at` | time | same as above (forms that have never received an entry have no value) |\n| `entries_count` | integer | `eq` `ne` `gte` `gt` `lte` `lt` |\n\nThe value of `within_last` looks like `{\"unit\":\"day\",\"n\":30}` (unit can be minute / day / week / month), meaning the window going back from now.\nExample: `[{\"field\":\"last_entry_created_at\",\"operator\":\"within_last\",\"value\":{\"unit\":\"day\",\"n\":7}}]`\n"
|
|
3337
3988
|
},
|
|
3338
3989
|
"sort": {
|
|
3339
|
-
"type":
|
|
3340
|
-
|
|
3990
|
+
"type": [
|
|
3991
|
+
"array",
|
|
3992
|
+
"string"
|
|
3993
|
+
],
|
|
3994
|
+
"items": {
|
|
3995
|
+
"type": "object",
|
|
3996
|
+
"required": [
|
|
3997
|
+
"field"
|
|
3998
|
+
],
|
|
3999
|
+
"properties": {
|
|
4000
|
+
"field": {
|
|
4001
|
+
"type": "string",
|
|
4002
|
+
"enum": [
|
|
4003
|
+
"created_at",
|
|
4004
|
+
"last_entry_created_at",
|
|
4005
|
+
"entries_count"
|
|
4006
|
+
],
|
|
4007
|
+
"description": "Form attribute to sort by"
|
|
4008
|
+
},
|
|
4009
|
+
"order": {
|
|
4010
|
+
"type": "string",
|
|
4011
|
+
"enum": [
|
|
4012
|
+
"asc",
|
|
4013
|
+
"desc"
|
|
4014
|
+
],
|
|
4015
|
+
"default": "asc",
|
|
4016
|
+
"description": "Sort direction"
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
},
|
|
4020
|
+
"examples": [
|
|
4021
|
+
[
|
|
4022
|
+
{
|
|
4023
|
+
"field": "last_entry_created_at",
|
|
4024
|
+
"order": "desc"
|
|
4025
|
+
}
|
|
4026
|
+
]
|
|
4027
|
+
],
|
|
4028
|
+
"description": "Sort rules, an array of FormSortRule objects, applied in order.\nSortable fields: `created_at`, `last_entry_created_at`, `entries_count`; any other field, an invalid order or unparseable JSON returns 400.\nWith `sort`, `next` becomes a cursor of the form `row:<offset>`, usable only in requests with the same `sort`; rows with equal values may change order between pages.\n"
|
|
3341
4029
|
},
|
|
3342
4030
|
"next": {
|
|
3343
4031
|
"type": "string",
|
|
@@ -4368,7 +5056,7 @@
|
|
|
4368
5056
|
{
|
|
4369
5057
|
"operationId": "getCurrentUser",
|
|
4370
5058
|
"summary": "Show the current user",
|
|
4371
|
-
"description": "Show the current user\nReturns the user behind the current credential. With an account-level credential (no specific user), returns the account owner.",
|
|
5059
|
+
"description": "Show the current user\nReturns the user behind the current credential. With an account-level credential (no specific user), returns the account owner.\nReturns schema \"CurrentUser\" (see get_schema).",
|
|
4372
5060
|
"tag": "Account",
|
|
4373
5061
|
"method": "get",
|
|
4374
5062
|
"path": "/me",
|
|
@@ -4386,64 +5074,6 @@
|
|
|
4386
5074
|
"properties": {},
|
|
4387
5075
|
"additionalProperties": false
|
|
4388
5076
|
},
|
|
4389
|
-
"outputSchema": {
|
|
4390
|
-
"type": "object",
|
|
4391
|
-
"required": [
|
|
4392
|
-
"id",
|
|
4393
|
-
"name",
|
|
4394
|
-
"email",
|
|
4395
|
-
"mobile",
|
|
4396
|
-
"role",
|
|
4397
|
-
"billing_account_id",
|
|
4398
|
-
"created_at"
|
|
4399
|
-
],
|
|
4400
|
-
"properties": {
|
|
4401
|
-
"id": {
|
|
4402
|
-
"type": "string",
|
|
4403
|
-
"description": "User ID"
|
|
4404
|
-
},
|
|
4405
|
-
"name": {
|
|
4406
|
-
"type": [
|
|
4407
|
-
"string",
|
|
4408
|
-
"null"
|
|
4409
|
-
],
|
|
4410
|
-
"description": "Display name"
|
|
4411
|
-
},
|
|
4412
|
-
"email": {
|
|
4413
|
-
"type": [
|
|
4414
|
-
"string",
|
|
4415
|
-
"null"
|
|
4416
|
-
],
|
|
4417
|
-
"description": "Email"
|
|
4418
|
-
},
|
|
4419
|
-
"mobile": {
|
|
4420
|
-
"type": [
|
|
4421
|
-
"string",
|
|
4422
|
-
"null"
|
|
4423
|
-
],
|
|
4424
|
-
"description": "Mobile number"
|
|
4425
|
-
},
|
|
4426
|
-
"role": {
|
|
4427
|
-
"type": "string",
|
|
4428
|
-
"enum": [
|
|
4429
|
-
"owner",
|
|
4430
|
-
"admin",
|
|
4431
|
-
"worker",
|
|
4432
|
-
"outworker"
|
|
4433
|
-
],
|
|
4434
|
-
"description": "Role in the account"
|
|
4435
|
-
},
|
|
4436
|
-
"billing_account_id": {
|
|
4437
|
-
"type": "string",
|
|
4438
|
-
"description": "ID of the account the user belongs to"
|
|
4439
|
-
},
|
|
4440
|
-
"created_at": {
|
|
4441
|
-
"type": "string",
|
|
4442
|
-
"format": "date-time",
|
|
4443
|
-
"description": "Signed up at (UTC)"
|
|
4444
|
-
}
|
|
4445
|
-
}
|
|
4446
|
-
},
|
|
4447
5077
|
"annotations": {
|
|
4448
5078
|
"readOnlyHint": true,
|
|
4449
5079
|
"destructiveHint": false,
|
|
@@ -6051,7 +6681,8 @@
|
|
|
6051
6681
|
{
|
|
6052
6682
|
"name": "filters",
|
|
6053
6683
|
"in": "query",
|
|
6054
|
-
"required": false
|
|
6684
|
+
"required": false,
|
|
6685
|
+
"json": true
|
|
6055
6686
|
},
|
|
6056
6687
|
{
|
|
6057
6688
|
"name": "keyword",
|
|
@@ -6086,8 +6717,65 @@
|
|
|
6086
6717
|
"description": "A form token, or an array of up to 10 tokens to count several forms in one call"
|
|
6087
6718
|
},
|
|
6088
6719
|
"filters": {
|
|
6089
|
-
"type":
|
|
6090
|
-
|
|
6720
|
+
"type": [
|
|
6721
|
+
"array",
|
|
6722
|
+
"string"
|
|
6723
|
+
],
|
|
6724
|
+
"items": {
|
|
6725
|
+
"type": "object",
|
|
6726
|
+
"description": "One filter condition. A `filters` parameter is the JSON text of an array of these, combined with AND; each endpoint says which fields and operators it takes.",
|
|
6727
|
+
"required": [
|
|
6728
|
+
"field",
|
|
6729
|
+
"operator"
|
|
6730
|
+
],
|
|
6731
|
+
"properties": {
|
|
6732
|
+
"field": {
|
|
6733
|
+
"type": "string",
|
|
6734
|
+
"description": "What to filter on; a field api_code for entries, or a form attribute such as `created_at` for form lists"
|
|
6735
|
+
},
|
|
6736
|
+
"operator": {
|
|
6737
|
+
"type": "string",
|
|
6738
|
+
"enum": [
|
|
6739
|
+
"eq",
|
|
6740
|
+
"ne",
|
|
6741
|
+
"any_in",
|
|
6742
|
+
"none_in",
|
|
6743
|
+
"between",
|
|
6744
|
+
"not_between",
|
|
6745
|
+
"null",
|
|
6746
|
+
"not_null",
|
|
6747
|
+
"gte",
|
|
6748
|
+
"gt",
|
|
6749
|
+
"lte",
|
|
6750
|
+
"lt",
|
|
6751
|
+
"like",
|
|
6752
|
+
"not_like",
|
|
6753
|
+
"within_last",
|
|
6754
|
+
"equal",
|
|
6755
|
+
"not_equal",
|
|
6756
|
+
"start",
|
|
6757
|
+
"end"
|
|
6758
|
+
],
|
|
6759
|
+
"description": "Comparison; `equal` / `not_equal` / `start` / `end` are aliases of `eq` / `ne` / `gte` / `lte`. Each field type accepts only some operators, and an unsupported one returns 400 listing the available ones."
|
|
6760
|
+
},
|
|
6761
|
+
"value": {
|
|
6762
|
+
"description": "Condition value; its type depends on the field and the operator: a two-element array `[min, max]` for `between` / `not_between`, `{\"unit\": \"day\", \"n\": 30}` for `within_last`, and no value for `null` / `not_null`."
|
|
6763
|
+
}
|
|
6764
|
+
}
|
|
6765
|
+
},
|
|
6766
|
+
"examples": [
|
|
6767
|
+
[
|
|
6768
|
+
{
|
|
6769
|
+
"field": "field_3",
|
|
6770
|
+
"operator": "any_in",
|
|
6771
|
+
"value": [
|
|
6772
|
+
"选项 A",
|
|
6773
|
+
"选项 B"
|
|
6774
|
+
]
|
|
6775
|
+
}
|
|
6776
|
+
]
|
|
6777
|
+
],
|
|
6778
|
+
"description": "Filters, an array of ScopeCondition objects; conditions are combined with AND.\n- Each field type accepts only some of the operators; an unsupported one returns 400 listing the available operators.\n- For choice fields (single choice / multiple choice / drop-down / cascading drop-down), `value` can be a choice api_code or a choice label; a cascading drop-down also accepts a `level1-level2` path.\n- For `between` / `not_between`, `value` is a two-element array `[min, max]`; matrix / table fields need `{\"<column api_code>\": [min, max]}`.\n- `within_last` works only on date fields; `value` looks like `{\"unit\":\"day\",\"n\":30}` (unit can be minute / day / week / month).\n- `creator_id` is a special field that filters by submitter with `eq` (the value is a user id), and can appear only once.\n- `serial_number` is a special field that filters by serial number with `eq` / `any_in`; several conditions are intersected.\n- For a relation field (RelationField), the `value` of `any_in` / `none_in` is serial numbers of entries in the related table; returns 400 when a serial number does not exist.\n- With a `created_at` condition, results are sorted by creation time instead.\n- To find entries whose multiple-choice field contains a choice, use `any_in` (`none_in` to exclude); `eq` is not \"contains\": it matches only entries with exactly the same set of choices."
|
|
6091
6779
|
},
|
|
6092
6780
|
"keyword": {
|
|
6093
6781
|
"type": "string",
|