monday-cli 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +277 -0
- package/README.md +96 -35
- package/dist/api/column-types.d.ts +48 -19
- package/dist/api/column-types.d.ts.map +1 -1
- package/dist/api/column-types.js +25 -11
- package/dist/api/column-types.js.map +1 -1
- package/dist/api/column-values.d.ts +17 -10
- package/dist/api/column-values.d.ts.map +1 -1
- package/dist/api/column-values.js +33 -19
- package/dist/api/column-values.js.map +1 -1
- package/dist/api/file-column-set.d.ts +507 -0
- package/dist/api/file-column-set.d.ts.map +1 -0
- package/dist/api/file-column-set.js +510 -0
- package/dist/api/file-column-set.js.map +1 -0
- package/dist/api/raw-write.d.ts +27 -17
- package/dist/api/raw-write.d.ts.map +1 -1
- package/dist/api/raw-write.js +40 -25
- package/dist/api/raw-write.js.map +1 -1
- package/dist/api/resolver-error-fold.d.ts +25 -0
- package/dist/api/resolver-error-fold.d.ts.map +1 -1
- package/dist/api/resolver-error-fold.js +56 -0
- package/dist/api/resolver-error-fold.js.map +1 -1
- package/dist/commands/board/column-create.d.ts +8 -3
- package/dist/commands/board/column-create.d.ts.map +1 -1
- package/dist/commands/board/column-create.js +16 -8
- package/dist/commands/board/column-create.js.map +1 -1
- package/dist/commands/item/create.d.ts.map +1 -1
- package/dist/commands/item/create.js +131 -33
- package/dist/commands/item/create.js.map +1 -1
- package/dist/commands/item/set.d.ts +33 -3
- package/dist/commands/item/set.d.ts.map +1 -1
- package/dist/commands/item/set.js +193 -15
- package/dist/commands/item/set.js.map +1 -1
- package/dist/commands/item/update.d.ts +34 -3
- package/dist/commands/item/update.d.ts.map +1 -1
- package/dist/commands/item/update.js +346 -67
- package/dist/commands/item/update.js.map +1 -1
- package/dist/commands/item/upload.d.ts.map +1 -1
- package/dist/commands/item/upload.js +16 -69
- package/dist/commands/item/upload.js.map +1 -1
- package/dist/commands/update/upload.d.ts.map +1 -1
- package/dist/commands/update/upload.js +9 -59
- package/dist/commands/update/upload.js.map +1 -1
- package/dist/utils/file-source.d.ts +93 -0
- package/dist/utils/file-source.d.ts.map +1 -0
- package/dist/utils/file-source.js +140 -0
- package/dist/utils/file-source.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Files-shaped friendly `--set` dispatch (`cli-design.md` §5.3
|
|
3
|
+
* writer-expansion roadmap "files" row + §13 v0.6 entry,
|
|
4
|
+
* `v0.6-plan.md` §3 M38).
|
|
5
|
+
*
|
|
6
|
+
* **Status: runtime bodies shipped at v0.6-M38 IMPL.** The dispatch
|
|
7
|
+
* type signatures + the per-mutex-rejection error shape + the
|
|
8
|
+
* fetcher wrapping M31's `addFileToColumn` all landed at pre-flight;
|
|
9
|
+
* IMPL swaps the c8-ignored stub bodies for runtime logic. No new
|
|
10
|
+
* wire fetcher (M38 reuses the v0.4-M31 multipart wire verbatim);
|
|
11
|
+
* no new transport seam.
|
|
12
|
+
*
|
|
13
|
+
* **Wire surface.** Zero net change. When `monday item set <iid>
|
|
14
|
+
* <file-col>=<path>` OR `monday item update <iid> --set
|
|
15
|
+
* <file-col>=<path>` resolves to a `file`-typed column, the
|
|
16
|
+
* command action body branches OFF the standard JSON-translator
|
|
17
|
+
* path INTO M31's multipart `addFileToColumn` fetcher via
|
|
18
|
+
* `executeFileColumnSet` below. The translator
|
|
19
|
+
* (`translateColumnValueAsync` in `column-values.ts`) stays
|
|
20
|
+
* JSON-output-shaped for the 13 existing writable types — the
|
|
21
|
+
* file-column dispatch is a SIBLING leg routed at the command
|
|
22
|
+
* action body level, NOT a new payload format inside the
|
|
23
|
+
* translator union.
|
|
24
|
+
*
|
|
25
|
+
* **Why a sibling leg, not a translator widening.** Three reasons
|
|
26
|
+
* pin the design (cli-design §5.3 step 4 + step 5 prose):
|
|
27
|
+
*
|
|
28
|
+
* 1. The wire surface is fundamentally different — multipart
|
|
29
|
+
* `add_file_to_column` vs JSON `change_column_value` /
|
|
30
|
+
* `change_multiple_column_values`. Folding the file payload
|
|
31
|
+
* into `ColumnValuePayload` would require a `format: 'file'`
|
|
32
|
+
* union variant that `selectMutation` can't bundle into the
|
|
33
|
+
* multi-mutation (each `add_file_to_column` is a single
|
|
34
|
+
* per-column multipart round-trip; bundling N file uploads
|
|
35
|
+
* into one mutation isn't a Monday wire shape).
|
|
36
|
+
* 2. The atomicity contract differs — the 13 existing types
|
|
37
|
+
* bundle atomically via `change_multiple_column_values` when
|
|
38
|
+
* ≥2 columns target the same item. File-column writes are
|
|
39
|
+
* single-column-per-call only on Monday's wire; mixing a
|
|
40
|
+
* file-column `--set` with any value `--set` / `--set-raw` /
|
|
41
|
+
* `--name` in the same call would force a multi-leg dispatch
|
|
42
|
+
* that breaks the existing atomicity guarantee. M38 enforces
|
|
43
|
+
* single-file-only via the mutex rules below (D2 closure) —
|
|
44
|
+
* the existing atomicity contract stays intact.
|
|
45
|
+
* 3. The translator's input contract is "value-string-to-JSON-
|
|
46
|
+
* payload" — file columns take a file path, not a value
|
|
47
|
+
* string. Path validation + `fs.stat` + `fs.access(R_OK)` +
|
|
48
|
+
* Blob construction don't fit the translator's pure-function
|
|
49
|
+
* shape; routing the path through the sibling leg keeps each
|
|
50
|
+
* helper focused.
|
|
51
|
+
*
|
|
52
|
+
* **Reuse from v0.4-M31.** The wire dispatch reuses
|
|
53
|
+
* `addFileToColumn` from `src/api/assets.ts` verbatim — same
|
|
54
|
+
* `MultipartTransport.request(...)` round-trip, same `withRetry`
|
|
55
|
+
* shape, same `file_too_large` rewrap-inside-retry-thunk pattern
|
|
56
|
+
* (R-v0.4-W2 axis 7 "non-retryable rewrap placement" carries
|
|
57
|
+
* through safely-by-construction since the dispatch goes through
|
|
58
|
+
* the existing fetcher rather than a re-implementation).
|
|
59
|
+
*
|
|
60
|
+
* **Consumer counts post v0.6-M38 IMPL close** (runtime bodies
|
|
61
|
+
* shipped at `e749931` + the R-v0.6-NEW-1 lift at `3c2a9b0`;
|
|
62
|
+
* pre-flight stubs collapsed):
|
|
63
|
+
*
|
|
64
|
+
* - `addFileToColumn` (M31): 2 consumers (M31's `item upload`
|
|
65
|
+
* action body + M38's `executeFileColumnSet` runtime body).
|
|
66
|
+
* - `MultipartTransport` via `ResolvedClient.multipart`: 2
|
|
67
|
+
* consumers (the same test seam pattern; M31's two upload
|
|
68
|
+
* verbs + M38's dispatch share the slot).
|
|
69
|
+
* - `sniffContentType` from `src/utils/mime.ts`: 2 consumers
|
|
70
|
+
* post-lift (M31's `item upload` + M31's `update upload` —
|
|
71
|
+
* both via {@link buildBlobFromPath}; M38 routes through
|
|
72
|
+
* `buildBlobFromPath` rather than calling `sniffContentType`
|
|
73
|
+
* directly).
|
|
74
|
+
* - **R-v0.6-NEW-1 SHIPPED at IMPL kickoff**: the file-pre-check
|
|
75
|
+
* + Blob-construction pattern lifted to `src/utils/file-source
|
|
76
|
+
* .ts` (`precheckLocalFile` + `buildBlobFromPath` — 3 consumers
|
|
77
|
+
* post-lift: M31's `item upload`, M31's `update upload`, M38's
|
|
78
|
+
* `executeFileColumnSet`).
|
|
79
|
+
*
|
|
80
|
+
* **Mutex rules (D2 closure).** Enforced at the column-resolution
|
|
81
|
+
* boundary (parse-time can't know — column types only resolve
|
|
82
|
+
* after metadata loads). When any resolved column has `type ===
|
|
83
|
+
* 'file'`:
|
|
84
|
+
*
|
|
85
|
+
* - Exactly ONE file `--set` entry allowed per call (M38 single-
|
|
86
|
+
* file scope; multi-file dispatch defers to v0.6.x).
|
|
87
|
+
* - NO other value `--set` / `--set-raw` / `--name` flags
|
|
88
|
+
* allowed (mixing would force non-atomic multi-leg dispatch).
|
|
89
|
+
* - Bulk `item update --where ... --set <file-col>=<path>`
|
|
90
|
+
* REJECTED at resolution-time per D5 closure (defers to
|
|
91
|
+
* v0.6.x — per-item file dispatch + partial-success envelope +
|
|
92
|
+
* `--concurrency` interaction each carry additional design
|
|
93
|
+
* dimensions).
|
|
94
|
+
* - `item create --set <file-col>=<path>` REJECTED at resolution-
|
|
95
|
+
* time per D6 closure (defers to v0.6.x — non-atomic post-
|
|
96
|
+
* create wire shape would break §5.8 state safety).
|
|
97
|
+
*
|
|
98
|
+
* Rejection surfaces share the `usage_error.details.reason`
|
|
99
|
+
* discriminator pattern from M14 / M27 / M31:
|
|
100
|
+
*
|
|
101
|
+
* - `'mixed_file_and_value_sets'` — file `--set` + any value
|
|
102
|
+
* `--set` / `--set-raw` / `--name` in same call.
|
|
103
|
+
* - `'multi_file_set_unsupported'` — 2+ file `--set` entries
|
|
104
|
+
* in same call.
|
|
105
|
+
* - `'file_set_on_create_unsupported'` — `item create --set
|
|
106
|
+
* <file-col>=<path>`.
|
|
107
|
+
* - `'file_set_on_bulk_unsupported'` — bulk `item update
|
|
108
|
+
* --where ... --set <file-col>=<path>`.
|
|
109
|
+
*
|
|
110
|
+
* **D3 closure — `--set-raw <file-col>=<json>` STAYS REJECTED.**
|
|
111
|
+
* Files have no JSON wire shape Monday's `change_column_value`
|
|
112
|
+
* accepts; the escape-hatch contract "user supplies the JSON
|
|
113
|
+
* `change_column_value` accepts" doesn't compose with the
|
|
114
|
+
* multipart wire. The existing rejection at
|
|
115
|
+
* `raw-write.ts:translateRawColumnValue` stays unchanged; the
|
|
116
|
+
* prose flips slightly to note "M38 ships the friendly `--set
|
|
117
|
+
* <file-col>=<path>` form but `--set-raw` for files stays
|
|
118
|
+
* rejected".
|
|
119
|
+
*
|
|
120
|
+
* **D7 closure — `<path>='-'` stdin support OUT OF SCOPE.**
|
|
121
|
+
* Mirrors M31 `monday item upload`'s rejection rationale — no
|
|
122
|
+
* clean `--filename` companion shape pinned for `--set
|
|
123
|
+
* <file-col>=-` syntax (stdin reads byte-anonymously; the
|
|
124
|
+
* filename is the load-bearing handle for Monday's wire
|
|
125
|
+
* `Asset.name` slot). Defers to v0.6.x extension shape.
|
|
126
|
+
*
|
|
127
|
+
* **No new ERROR_CODE (D8 closure; registry stays at 29).** All
|
|
128
|
+
* M38-specific rejections route through existing `usage_error`
|
|
129
|
+
* with `details.reason` discrimination.
|
|
130
|
+
*
|
|
131
|
+
* **R-NEW-41 4th supporting site filed at M38 pre-flight.** The
|
|
132
|
+
* `--set` syntax is type-uniform from the agent's view
|
|
133
|
+
* (`<col>=<value>`), but for file columns the value is a path
|
|
134
|
+
* and the dispatch transitions silently from JSON to multipart at
|
|
135
|
+
* the translator boundary. The asymmetry is at the AGENT-INPUT
|
|
136
|
+
* boundary, NOT at the wire boundary (M31's multipart-vs-JSON
|
|
137
|
+
* asymmetry #3 is wire-boundary-only). See `docs/architecture.md`
|
|
138
|
+
* "Wire-vs-CLI semantics documentation conventions" for the
|
|
139
|
+
* canonical cross-link.
|
|
140
|
+
*/
|
|
141
|
+
import { z } from 'zod';
|
|
142
|
+
import { ApiError } from '../utils/errors.js';
|
|
143
|
+
import { buildBlobFromPath } from '../utils/file-source.js';
|
|
144
|
+
import { addFileToColumn, assetSchema } from './assets.js';
|
|
145
|
+
import { resolveColumnWithRefresh } from './columns.js';
|
|
146
|
+
import { foldResolverWarningsIntoError } from './resolver-error-fold.js';
|
|
147
|
+
import { buildColumnArchivedError } from './resolution-pass.js';
|
|
148
|
+
import { mergeSource, mergeCacheAge } from './source-aggregator.js';
|
|
149
|
+
/**
|
|
150
|
+
* Output envelope shape for the file-column `--set` dispatch leg.
|
|
151
|
+
* Mirrors `itemUploadOutputSchema` from `src/api/assets.ts` so the
|
|
152
|
+
* envelope shape is byte-equivalent to M31 `monday item upload` for
|
|
153
|
+
* an agent reading the result — the dispatch source differs
|
|
154
|
+
* (`monday item set` / `monday item update` vs `monday item upload`)
|
|
155
|
+
* but the envelope payload structure is identical.
|
|
156
|
+
*
|
|
157
|
+
* The `operation` slot pins `'add_file_to_column'` literally
|
|
158
|
+
* (mirroring M31's envelope discriminator); agents reading
|
|
159
|
+
* `data.operation` can branch uniformly on the wire mutation
|
|
160
|
+
* regardless of which CLI verb routed there.
|
|
161
|
+
*/
|
|
162
|
+
export const fileColumnSetOutputSchema = z
|
|
163
|
+
.object({
|
|
164
|
+
operation: z.literal('add_file_to_column'),
|
|
165
|
+
item_id: z.string().min(1),
|
|
166
|
+
column_id: z.string().min(1),
|
|
167
|
+
filename: z.string().min(1),
|
|
168
|
+
file_size_bytes: z.number().int().nonnegative(),
|
|
169
|
+
asset: assetSchema,
|
|
170
|
+
})
|
|
171
|
+
.strict();
|
|
172
|
+
/**
|
|
173
|
+
* Reads the local file at `inputs.entry.filePath`, constructs a Blob
|
|
174
|
+
* via {@link buildBlobFromPath} (with `Content-Type` sniffed from the
|
|
175
|
+
* filename), and dispatches the multipart upload through M31's
|
|
176
|
+
* {@link addFileToColumn} fetcher (cli-design §5.3 step 5 + the
|
|
177
|
+
* module docstring above pin the load-bearing design).
|
|
178
|
+
*
|
|
179
|
+
* **Status: runtime body shipped at v0.6-M38 IMPL.** Wraps M31's
|
|
180
|
+
* fetcher verbatim — same `operationName: 'AddFileToColumn'`, same
|
|
181
|
+
* `withRetry(...)` retry semantics, same rewrap-inside-retry-thunk
|
|
182
|
+
* pattern for `file_too_large` (R-v0.4-W2 axis 7 carries through
|
|
183
|
+
* safely-by-construction since the dispatch goes through the
|
|
184
|
+
* existing fetcher rather than a re-implementation).
|
|
185
|
+
*
|
|
186
|
+
* The action-body caller (in `item set` / `item update`) is
|
|
187
|
+
* responsible for:
|
|
188
|
+
*
|
|
189
|
+
* 1. Parsing argv + collecting `--set` / `--set-raw` / `--name`
|
|
190
|
+
* entries.
|
|
191
|
+
* 2. Resolving columns via `resolveColumnWithRefresh`.
|
|
192
|
+
* 3. Calling {@link enforceSingleFileColumnSet} to detect the
|
|
193
|
+
* file-column dispatch leg + enforce the mutex rules.
|
|
194
|
+
* 4. Running {@link precheckLocalFile} from
|
|
195
|
+
* `src/utils/file-source.ts` on the agent-supplied path to
|
|
196
|
+
* build a {@link FileColumnSetEntry} (the precheck surfaces
|
|
197
|
+
* `usage_error.details.reason: 'file_not_readable'` /
|
|
198
|
+
* `'file_empty'` before any wire activity per the M31
|
|
199
|
+
* ordering invariant).
|
|
200
|
+
* 5. Calling this fetcher for the wire dispatch.
|
|
201
|
+
* 6. Emitting the envelope per `fileColumnSetOutputSchema`
|
|
202
|
+
* (mirrors M31 `item upload` envelope verbatim).
|
|
203
|
+
*/
|
|
204
|
+
export const executeFileColumnSet = async (inputs) => {
|
|
205
|
+
const blob = await buildBlobFromPath({
|
|
206
|
+
filePath: inputs.entry.filePath,
|
|
207
|
+
filename: inputs.entry.filename,
|
|
208
|
+
fileSizeBytes: inputs.entry.fileSizeBytes,
|
|
209
|
+
});
|
|
210
|
+
const result = await addFileToColumn({
|
|
211
|
+
client: inputs.client,
|
|
212
|
+
multipart: inputs.multipart,
|
|
213
|
+
itemId: inputs.itemId,
|
|
214
|
+
columnId: inputs.entry.columnId,
|
|
215
|
+
file: blob,
|
|
216
|
+
filename: inputs.entry.filename,
|
|
217
|
+
signal: inputs.signal,
|
|
218
|
+
retries: inputs.retries,
|
|
219
|
+
});
|
|
220
|
+
return {
|
|
221
|
+
asset: result.asset,
|
|
222
|
+
source: 'live',
|
|
223
|
+
cacheAgeSeconds: null,
|
|
224
|
+
complexity: result.complexity,
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Iterates `inputs.setEntries`, identifies entries with
|
|
229
|
+
* `columnType === 'file'`, applies the mutex rules per D2 / D5 / D6
|
|
230
|
+
* closures, and returns either `{ kind: 'json' }` (no file entries),
|
|
231
|
+
* `{ kind: 'file', columnId, rawValue }` (clean dispatch path), or
|
|
232
|
+
* throws `ApiError('usage_error', ...)` on a mutex violation.
|
|
233
|
+
*
|
|
234
|
+
* Mutex priority (ratified at M38 pre-flight, applied here in IMPL):
|
|
235
|
+
*
|
|
236
|
+
* 1. **callShape gates first** — `'item_update_bulk'` rejects ALL
|
|
237
|
+
* file `--set` entries with `'file_set_on_bulk_unsupported'`
|
|
238
|
+
* (D5; defers per-item file dispatch + concurrency interaction
|
|
239
|
+
* to v0.6.x). `'item_create'` rejects with
|
|
240
|
+
* `'file_set_on_create_unsupported'` (D6; defers create-time
|
|
241
|
+
* file upload to v0.6.x — non-atomic post-create wire shape
|
|
242
|
+
* breaks §5.8 state safety).
|
|
243
|
+
* 2. **multi-file leg** — 2+ file `--set` entries on a non-rejected
|
|
244
|
+
* callShape surface `'multi_file_set_unsupported'` (M38 defers
|
|
245
|
+
* multi-file dispatch to v0.6.x).
|
|
246
|
+
* 3. **mixed leg** — 1 file `--set` + any value `--set` /
|
|
247
|
+
* `--set-raw` / `--name` surface `'mixed_file_and_value_sets'`
|
|
248
|
+
* (mixing forces non-atomic multi-leg dispatch that breaks the
|
|
249
|
+
* existing atomicity contract).
|
|
250
|
+
* 4. **clean leg** — 1 file `--set`, no other value flags, single-
|
|
251
|
+
* item non-create call → return `{ kind: 'file', columnId,
|
|
252
|
+
* rawValue }` for downstream {@link precheckLocalFile} +
|
|
253
|
+
* {@link executeFileColumnSet}.
|
|
254
|
+
*
|
|
255
|
+
* The function is sync + pure. No I/O. Path validation lives at a
|
|
256
|
+
* SEPARATE step (`precheckLocalFile` from `src/utils/file-source.ts`)
|
|
257
|
+
* that the caller runs AFTER this function returns a `kind: 'file'`
|
|
258
|
+
* result.
|
|
259
|
+
*/
|
|
260
|
+
export const enforceSingleFileColumnSet = (inputs) => {
|
|
261
|
+
const fileSetEntries = inputs.setEntries.filter((e) => e.columnType === 'file');
|
|
262
|
+
if (fileSetEntries.length === 0) {
|
|
263
|
+
return { kind: 'json' };
|
|
264
|
+
}
|
|
265
|
+
// callShape gates first (D5 / D6 closures). The hint names the
|
|
266
|
+
// verb-shaped M31 fallback (`monday item upload`) which IS allowed
|
|
267
|
+
// on bulk + create-time flows via separate scripting.
|
|
268
|
+
if (inputs.callShape === 'item_update_bulk') {
|
|
269
|
+
const fe = fileSetEntries[0];
|
|
270
|
+
/* c8 ignore next 3 */
|
|
271
|
+
if (fe === undefined) {
|
|
272
|
+
throw new ApiError('internal_error', 'enforceSingleFileColumnSet: file entry narrowing failed (bulk)');
|
|
273
|
+
}
|
|
274
|
+
throw new ApiError('usage_error', `--set <file-col>=<path> is not supported on bulk \`item update ` +
|
|
275
|
+
`--where\` / \`--filter-json\` at v0.6-M38 (deferred to v0.6.x ` +
|
|
276
|
+
`per cli-design §13 v0.6 entry + v0.6-plan §3 M38 D5 closure). ` +
|
|
277
|
+
`Per-item file dispatch + \`--continue-on-error\` partial-success ` +
|
|
278
|
+
`envelope + \`--concurrency\` multipart-over-shared-transport ` +
|
|
279
|
+
`semantics each carry design dimensions worth their own milestone ` +
|
|
280
|
+
`cluster. Run the file write per matched item via single-item ` +
|
|
281
|
+
`\`monday item set <iid> <file-col>=<path>\` or \`monday item ` +
|
|
282
|
+
`upload <iid> --column <col> <file>\` (v0.4-M31; verb-shaped).`, {
|
|
283
|
+
details: {
|
|
284
|
+
reason: 'file_set_on_bulk_unsupported',
|
|
285
|
+
column_id: fe.columnId,
|
|
286
|
+
deferred_to: 'v0.6.x',
|
|
287
|
+
hint: 'bulk file dispatch is not supported at v0.6-M38; iterate ' +
|
|
288
|
+
'matched items in your script and call `monday item set ' +
|
|
289
|
+
'<iid> <file-col>=<path>` per item, or use `monday item ' +
|
|
290
|
+
'upload <iid> --column <col> <file>` (v0.4-M31).',
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
if (inputs.callShape === 'item_create') {
|
|
295
|
+
const fe = fileSetEntries[0];
|
|
296
|
+
/* c8 ignore next 3 */
|
|
297
|
+
if (fe === undefined) {
|
|
298
|
+
throw new ApiError('internal_error', 'enforceSingleFileColumnSet: file entry narrowing failed (create)');
|
|
299
|
+
}
|
|
300
|
+
throw new ApiError('usage_error', `--set <file-col>=<path> is not supported on \`monday item create\` ` +
|
|
301
|
+
`at v0.6-M38 (deferred to v0.6.x per cli-design §13 v0.6 entry + ` +
|
|
302
|
+
`v0.6-plan §3 M38 D6 closure). Monday's wire has no atomic ` +
|
|
303
|
+
`create-with-file mutation at API \`2026-01\`; file upload at ` +
|
|
304
|
+
`create time would require a non-atomic post-create ` +
|
|
305
|
+
`\`add_file_to_column\` that breaks §5.8 state safety. Create ` +
|
|
306
|
+
`the item first, then attach the file with \`monday item set ` +
|
|
307
|
+
`<iid> <file-col>=<path>\` or \`monday item upload <iid> ` +
|
|
308
|
+
`--column <col> <file>\` (v0.4-M31; verb-shaped).`, {
|
|
309
|
+
details: {
|
|
310
|
+
reason: 'file_set_on_create_unsupported',
|
|
311
|
+
column_id: fe.columnId,
|
|
312
|
+
deferred_to: 'v0.6.x',
|
|
313
|
+
hint: 'create the item with non-file `--set` values, then attach ' +
|
|
314
|
+
'the file with `monday item set <iid> <file-col>=<path>` ' +
|
|
315
|
+
'(v0.6-M38) or `monday item upload <iid> --column <col> ' +
|
|
316
|
+
'<file>` (v0.4-M31).',
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
// Multi-file leg (D2). 2+ file `--set` entries on a non-bulk /
|
|
321
|
+
// non-create call shape — defers to v0.6.x.
|
|
322
|
+
if (fileSetEntries.length > 1) {
|
|
323
|
+
throw new ApiError('usage_error', `Multi-file \`--set <file-col>=<path>\` is not supported at ` +
|
|
324
|
+
`v0.6-M38 (${String(fileSetEntries.length)} file \`--set\` ` +
|
|
325
|
+
`entries detected; deferred to v0.6.x per cli-design §5.3 + ` +
|
|
326
|
+
`v0.6-plan §3 M38 D2 closure). Monday's ` +
|
|
327
|
+
`\`add_file_to_column\` mutation is single-column per call on ` +
|
|
328
|
+
`the wire; multi-file dispatch + concurrent multipart over the ` +
|
|
329
|
+
`shared transport carry design dimensions worth their own ` +
|
|
330
|
+
`milestone. Pass exactly one \`--set <file-col>=<path>\` per ` +
|
|
331
|
+
`call; for multiple uploads, run separate calls.`, {
|
|
332
|
+
details: {
|
|
333
|
+
reason: 'multi_file_set_unsupported',
|
|
334
|
+
file_count: fileSetEntries.length,
|
|
335
|
+
file_column_ids: fileSetEntries.map((e) => e.columnId),
|
|
336
|
+
deferred_to: 'v0.6.x',
|
|
337
|
+
hint: 'pass exactly one `--set <file-col>=<path>` per call; ' +
|
|
338
|
+
'run separate calls for multiple file uploads.',
|
|
339
|
+
},
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
// Mixed leg (D2). 1 file `--set` + any value `--set` / `--set-raw`
|
|
343
|
+
// / `--name` — surfaces because Monday's wire has no atomic combo
|
|
344
|
+
// of multipart `add_file_to_column` + JSON `change_column_value` /
|
|
345
|
+
// `change_multiple_column_values` (mixing forces non-atomic
|
|
346
|
+
// multi-leg dispatch that breaks the §5.3 atomicity contract).
|
|
347
|
+
const nonFileSetCount = inputs.setEntries.length - fileSetEntries.length;
|
|
348
|
+
const setRawCount = inputs.setRawEntries.length;
|
|
349
|
+
if (nonFileSetCount > 0 || setRawCount > 0 || inputs.hasName) {
|
|
350
|
+
const fe = fileSetEntries[0];
|
|
351
|
+
/* c8 ignore next 3 */
|
|
352
|
+
if (fe === undefined) {
|
|
353
|
+
throw new ApiError('internal_error', 'enforceSingleFileColumnSet: file entry narrowing failed (mixed)');
|
|
354
|
+
}
|
|
355
|
+
throw new ApiError('usage_error', `Mixing a file \`--set <file-col>=<path>\` with value \`--set\` / ` +
|
|
356
|
+
`\`--set-raw\` / \`--name\` in the same call is not supported at ` +
|
|
357
|
+
`v0.6-M38 (per cli-design §5.3 + v0.6-plan §3 M38 D2 closure). ` +
|
|
358
|
+
`Monday's wire has no atomic combo of multipart ` +
|
|
359
|
+
`\`add_file_to_column\` + JSON \`change_column_value\` / ` +
|
|
360
|
+
`\`change_multiple_column_values\`; mixing would force a non-` +
|
|
361
|
+
`atomic multi-leg dispatch that breaks the existing atomicity ` +
|
|
362
|
+
`contract. Run the file dispatch in its own call.`, {
|
|
363
|
+
details: {
|
|
364
|
+
reason: 'mixed_file_and_value_sets',
|
|
365
|
+
column_id: fe.columnId,
|
|
366
|
+
non_file_set_count: nonFileSetCount,
|
|
367
|
+
set_raw_count: setRawCount,
|
|
368
|
+
has_name: inputs.hasName,
|
|
369
|
+
hint: 'run the file `--set` alone (e.g., `monday item set <iid> ' +
|
|
370
|
+
'<file-col>=<path>`); apply value writes / rename in a ' +
|
|
371
|
+
'separate call (e.g., `monday item update <iid> --set ' +
|
|
372
|
+
'status=Done --name "..."`).',
|
|
373
|
+
},
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
// Clean dispatch leg. Single file `--set`, no other value flags
|
|
377
|
+
// on a single-item non-create call shape.
|
|
378
|
+
const fe = fileSetEntries[0];
|
|
379
|
+
/* c8 ignore next 3 */
|
|
380
|
+
if (fe === undefined) {
|
|
381
|
+
throw new ApiError('internal_error', 'enforceSingleFileColumnSet: file entry narrowing failed (clean)');
|
|
382
|
+
}
|
|
383
|
+
return { kind: 'file', columnId: fe.columnId, rawValue: fe.rawValue };
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Resolves `setEntries` column types and runs the v0.6-M38 mutex
|
|
387
|
+
* check (per cli-design §5.3 step 5 "File-column dispatch leg —
|
|
388
|
+
* mutex rules"). The discipline: **enforce mutex at the column-
|
|
389
|
+
* resolution boundary**, not at the translator-rejection boundary.
|
|
390
|
+
* Pre-flight P2-1 + IMPL round-1 P2-2 both surfaced the
|
|
391
|
+
* translator-order-dependent priority drift that this resolution-
|
|
392
|
+
* boundary check fixes.
|
|
393
|
+
*
|
|
394
|
+
* **Why the pre-check fires at the action-body level rather than
|
|
395
|
+
* inside `resolveAndTranslate`.** The shared resolver helper is
|
|
396
|
+
* used by 5 sites (item set, item update single + bulk, item
|
|
397
|
+
* create); the M38 dispatch only applies to 3 (item update single
|
|
398
|
+
* + bulk + item create — item set has its own column resolution at
|
|
399
|
+
* the action body level for the single-positional shape). Folding
|
|
400
|
+
* M38 dispatch into `resolveAndTranslate` would couple the
|
|
401
|
+
* resolver helper to the file-dispatch leg; the action-body level
|
|
402
|
+
* pre-check keeps `resolveAndTranslate` translator-only.
|
|
403
|
+
*
|
|
404
|
+
* **Discriminating friendly `--set` vs `--set-raw`** — the
|
|
405
|
+
* pre-check operates on setEntries only. `--set-raw <file-col>=<json>`
|
|
406
|
+
* rejections come from `translateRawColumnValue` (D3 permanent
|
|
407
|
+
* rejection); the pre-check returns `kind: 'json'` for `--set-raw`
|
|
408
|
+
* file paths and the standard path's `resolveAndTranslate` /
|
|
409
|
+
* `planChanges` then surfaces the D3 `unsupported_column_type`
|
|
410
|
+
* rejection. The pre-check NEVER hijacks `--set-raw` paths into
|
|
411
|
+
* M38 dispatch.
|
|
412
|
+
*
|
|
413
|
+
* **Source aggregation contract.** Each resolveColumnWithRefresh
|
|
414
|
+
* call returns its own `source` / `cacheAgeSeconds`; the pre-check
|
|
415
|
+
* aggregates across `setEntries`. On the `'json'` branch the
|
|
416
|
+
* downstream `resolveAndTranslate` will re-resolve setEntries
|
|
417
|
+
* (cache hit) and produce another aggregation leg — the action
|
|
418
|
+
* body merges both aggregations so the final envelope reflects
|
|
419
|
+
* every wire / cache leg that fired. The `meta.source` of a
|
|
420
|
+
* non-file path with a single `--set` may surface as `'mixed'`
|
|
421
|
+
* (live pre-check + cache downstream) rather than `'live'`; this
|
|
422
|
+
* is correct per §6.1 source-aggregation rules — the second leg
|
|
423
|
+
* IS a cache hit.
|
|
424
|
+
*/
|
|
425
|
+
export const preCheckM38FileDispatch = async (inputs) => {
|
|
426
|
+
const resolved = [];
|
|
427
|
+
let aggregateSource;
|
|
428
|
+
let aggregateCacheAge = null;
|
|
429
|
+
const warnings = [];
|
|
430
|
+
for (const entry of inputs.setEntries) {
|
|
431
|
+
const r = await resolveColumnWithRefresh({
|
|
432
|
+
client: inputs.client,
|
|
433
|
+
boardId: inputs.boardId,
|
|
434
|
+
token: entry.token,
|
|
435
|
+
includeArchived: true,
|
|
436
|
+
...(inputs.env === undefined ? {} : { env: inputs.env }),
|
|
437
|
+
...(inputs.noCache === undefined ? {} : { noCache: inputs.noCache }),
|
|
438
|
+
});
|
|
439
|
+
aggregateSource = mergeSource(aggregateSource, r.source);
|
|
440
|
+
aggregateCacheAge = mergeCacheAge(aggregateCacheAge, r.cacheAgeSeconds);
|
|
441
|
+
warnings.push(...r.warnings);
|
|
442
|
+
// Archived-column guard (mirrors `resolveAndTranslate`'s
|
|
443
|
+
// pass-(a) check). `includeArchived: true` above surfaces
|
|
444
|
+
// archived columns via the resolver rather than dropping them;
|
|
445
|
+
// the M38 dispatch must reject archived file columns with the
|
|
446
|
+
// stable `column_archived` error so agents key on the canonical
|
|
447
|
+
// shape regardless of write path. Round-2 P2-1 surfacing event:
|
|
448
|
+
// without this guard, `--set <archived_file_col>=<path>` on
|
|
449
|
+
// item update / create reached the M38 dispatch (emitting a
|
|
450
|
+
// successful file `planned_change` on dry-run, or local
|
|
451
|
+
// precheck + multipart dispatch on live) instead of the
|
|
452
|
+
// `column_archived` rejection.
|
|
453
|
+
if (r.match.column.archived === true) {
|
|
454
|
+
throw foldResolverWarningsIntoError(buildColumnArchivedError({
|
|
455
|
+
columnId: r.match.column.id,
|
|
456
|
+
columnTitle: r.match.column.title,
|
|
457
|
+
columnType: r.match.column.type,
|
|
458
|
+
boardId: inputs.boardId,
|
|
459
|
+
}), warnings);
|
|
460
|
+
}
|
|
461
|
+
resolved.push({
|
|
462
|
+
columnId: r.match.column.id,
|
|
463
|
+
columnType: r.match.column.type,
|
|
464
|
+
rawValue: entry.value,
|
|
465
|
+
token: entry.token,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
// Synthesize setRawEntries inputs from the count — only length
|
|
469
|
+
// matters for the mutex check; columnId / columnType slots are
|
|
470
|
+
// unused on the mixed-set discriminator path.
|
|
471
|
+
const setRawEntries = Array.from({ length: inputs.setRawCount }, () => ({ columnId: '', columnType: '' }));
|
|
472
|
+
const enforcement = enforceSingleFileColumnSet({
|
|
473
|
+
callShape: inputs.callShape,
|
|
474
|
+
setEntries: resolved.map((r) => ({
|
|
475
|
+
columnId: r.columnId,
|
|
476
|
+
columnType: r.columnType,
|
|
477
|
+
rawValue: r.rawValue,
|
|
478
|
+
})),
|
|
479
|
+
setRawEntries,
|
|
480
|
+
hasName: inputs.hasName,
|
|
481
|
+
});
|
|
482
|
+
if (enforcement.kind === 'json') {
|
|
483
|
+
return {
|
|
484
|
+
kind: 'json',
|
|
485
|
+
warnings,
|
|
486
|
+
source: aggregateSource,
|
|
487
|
+
cacheAgeSeconds: aggregateCacheAge,
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
// enforcement.kind === 'file'. Find the matching resolved entry
|
|
491
|
+
// for the file-column token (echo into resolved_ids downstream).
|
|
492
|
+
const fileResolved = resolved.find((r) => r.columnType === 'file' &&
|
|
493
|
+
r.columnId === enforcement.columnId &&
|
|
494
|
+
r.rawValue === enforcement.rawValue);
|
|
495
|
+
/* c8 ignore next 5 — defensive: enforcement returned the same
|
|
496
|
+
entry the pre-check passed in; the find must succeed. */
|
|
497
|
+
if (fileResolved === undefined) {
|
|
498
|
+
throw new ApiError('internal_error', 'preCheckM38FileDispatch: file entry not found in resolved set after enforcement');
|
|
499
|
+
}
|
|
500
|
+
return {
|
|
501
|
+
kind: 'file',
|
|
502
|
+
columnId: enforcement.columnId,
|
|
503
|
+
rawValue: enforcement.rawValue,
|
|
504
|
+
token: fileResolved.token,
|
|
505
|
+
warnings,
|
|
506
|
+
source: aggregateSource,
|
|
507
|
+
cacheAgeSeconds: aggregateCacheAge,
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
//# sourceMappingURL=file-column-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-column-set.js","sourceRoot":"","sources":["../../src/api/file-column-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2IG;AAEH,OAAO,EAAE,CAAC,EAA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-22,12 +22,19 @@
|
|
|
22
22
|
* from CLI-time to Monday-time with no new information.
|
|
23
23
|
* * **`files`-shaped** (`file`, anything else where Monday
|
|
24
24
|
* uses `add_file_to_column` rather than `change_column_value`)
|
|
25
|
-
* → `unsupported_column_type`
|
|
26
|
-
* The `--set-raw` payload reaches
|
|
27
|
-
* `
|
|
28
|
-
* can't be written through that
|
|
29
|
-
*
|
|
30
|
-
*
|
|
25
|
+
* → `unsupported_column_type` rejection STAYS at v0.6-M38
|
|
26
|
+
* per D3 closure. The `--set-raw` payload reaches
|
|
27
|
+
* `change_column_value` / `change_multiple_column_values`
|
|
28
|
+
* only; files-shaped types can't be written through that
|
|
29
|
+
* wire surface (Monday's wire has no JSON-shape for
|
|
30
|
+
* `change_column_value` on file columns). v0.6-M38 ships
|
|
31
|
+
* the friendly `--set <file-col>=<path>` form (dispatching
|
|
32
|
+
* into the multipart wire at the command action body) but
|
|
33
|
+
* keeps `--set-raw` rejected — the escape-hatch contract
|
|
34
|
+
* "user supplies JSON `change_column_value` accepts"
|
|
35
|
+
* doesn't compose with multipart. Hint points at the
|
|
36
|
+
* v0.6-M38 friendly `--set` form OR `monday item upload`
|
|
37
|
+
* (v0.4-M31; verb-shaped multipart).
|
|
31
38
|
* Otherwise builds a `TranslatedColumnValue` with `payload:
|
|
32
39
|
* { format: 'rich', value: <parsed> }` so the existing
|
|
33
40
|
* `selectMutation` dispatcher handles it uniformly.
|
|
@@ -101,17 +108,20 @@ export declare const parseSetRawExpression: (raw: string) => ParsedSetRawExpress
|
|
|
101
108
|
* - **Read-only-forever** → `unsupported_column_type` with
|
|
102
109
|
* `read_only: true`. Monday computes these server-side; no
|
|
103
110
|
* payload (raw or friendly) is ever accepted.
|
|
104
|
-
* - **`files`-shaped** → `unsupported_column_type`
|
|
105
|
-
*
|
|
106
|
-
* (multipart upload), not
|
|
107
|
-
* payload can't reach the
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
111
|
+
* - **`files`-shaped** → `unsupported_column_type` rejection
|
|
112
|
+
* STAYS at v0.6-M38 per D3 closure. Monday writes via
|
|
113
|
+
* `add_file_to_column` (multipart upload), not
|
|
114
|
+
* `change_column_value`; the raw payload can't reach the
|
|
115
|
+
* right wire surface (Monday's wire has no JSON-shape for
|
|
116
|
+
* `change_column_value` on file columns). v0.6-M38 ships the
|
|
117
|
+
* friendly `--set <file-col>=<path>` form (dispatching into
|
|
118
|
+
* the multipart wire at the command action body — see
|
|
119
|
+
* `src/api/file-column-set.ts`); the escape-hatch contract
|
|
120
|
+
* "user supplies JSON `change_column_value` accepts" doesn't
|
|
121
|
+
* compose with multipart, so `--set-raw <file-col>=<json>`
|
|
122
|
+
* stays rejected. Hint points at the M38 friendly `--set`
|
|
123
|
+
* form OR `monday item upload` (v0.4-M31; verb-shaped
|
|
124
|
+
* multipart).
|
|
115
125
|
*
|
|
116
126
|
* Anything else (writable + tentative-slipped + future where the API
|
|
117
127
|
* accepts `change_column_value`) is accepted — the user took the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raw-write.d.ts","sourceRoot":"","sources":["../../src/api/raw-write.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"raw-write.d.ts","sourceRoot":"","sources":["../../src/api/raw-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,KAAG,sBA+DnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACtD,OAAO,UAAU,EACjB,SAAS,MAAM,KACd,qBA6EF,CAAC;AAsBF,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|