@stndrds/schema 1.0.0-alpha.256 → 1.0.0-alpha.258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{attributes-Jji7TfFG.d.mts → attributes-Cmkc7UgJ.d.mts} +14 -367
- package/dist/{attributes-C-iyjLqJ.d.ts → attributes-_6tvjbyl.d.ts} +14 -367
- package/dist/{chunk-RHNSWKMJ.js → chunk-44EVNHSR.js} +5 -8
- package/dist/{chunk-VKJVBXHS.mjs → chunk-7VSOCVN7.mjs} +5 -8
- package/dist/{chunk-NSM2JPC3.js → chunk-L4U5QEQL.js} +4 -17
- package/dist/{chunk-AAXJJNY6.mjs → chunk-UXCJ3NI4.mjs} +4 -17
- package/dist/helpers-BO10yqih.d.mts +316 -0
- package/dist/helpers-BTC6TsKH.d.ts +316 -0
- package/dist/index.d.mts +137 -57
- package/dist/index.d.ts +137 -57
- package/dist/index.js +104 -180
- package/dist/index.mjs +20 -91
- package/dist/{types-D7VH7GrO.d.ts → types-B_UZK_6m.d.ts} +1 -1
- package/dist/{types-DgpsvFnh.d.mts → types-CVswgCx9.d.mts} +1 -1
- package/dist/validation/all.d.mts +3 -3
- package/dist/validation/all.d.ts +3 -3
- package/dist/validation/all.js +11 -12
- package/dist/validation/all.mjs +4 -5
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +1 -1
- package/dist/validation/config/index.d.ts +1 -1
- package/dist/validation/config/index.js +4 -4
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +3 -3
- package/dist/validation/core/index.d.ts +3 -3
- package/dist/validation/object/index.d.mts +4 -3
- package/dist/validation/object/index.d.ts +4 -3
- package/dist/validation/object/index.js +15 -16
- package/dist/validation/object/index.mjs +3 -4
- package/dist/validation/primitives/checkbox.d.mts +2 -2
- package/dist/validation/primitives/checkbox.d.ts +2 -2
- package/dist/validation/primitives/date.d.mts +2 -2
- package/dist/validation/primitives/date.d.ts +2 -2
- package/dist/validation/primitives/number.d.mts +2 -2
- package/dist/validation/primitives/number.d.ts +2 -2
- package/dist/validation/primitives/text.d.mts +2 -2
- package/dist/validation/primitives/text.d.ts +2 -2
- package/package.json +2 -7
- package/dist/chunk-CI6EGLL6.mjs +0 -18
- package/dist/chunk-Q5DIOYUE.js +0 -20
- package/dist/helpers-CMryP45K.d.mts +0 -75
- package/dist/helpers-Chppkv0E.d.ts +0 -75
- package/dist/validation/complex/file.d.mts +0 -13
- package/dist/validation/complex/file.d.ts +0 -13
- package/dist/validation/complex/file.js +0 -11
- package/dist/validation/complex/file.mjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconName, CountryIso3, CurrencyCode, ColorId
|
|
1
|
+
import { IconName, CountryIso3, CurrencyCode, ColorId } from '@stndrds/constants';
|
|
2
2
|
import { Uuid } from './utils.mjs';
|
|
3
3
|
|
|
4
4
|
type ComputedFormulaAstNode = ComputedFormulaLiteralNode | ComputedFormulaPathNode | ComputedFormulaCallNode | ComputedFormulaBinaryNode;
|
|
@@ -100,350 +100,6 @@ interface AutofillConfig {
|
|
|
100
100
|
declare const AUTOFILL_ELIGIBLE_TYPES: readonly ["text", "number", "checkbox", "date", "phone", "currency", "status", "select", "multiselect"];
|
|
101
101
|
type AutofillEligibleType = (typeof AUTOFILL_ELIGIBLE_TYPES)[number];
|
|
102
102
|
|
|
103
|
-
interface DocumentLayout {
|
|
104
|
-
/** Named sub-folders auto-created at the top of the record's drive when first used via attach --variant. */
|
|
105
|
-
variants?: Record<string, DocumentLayoutVariant>;
|
|
106
|
-
/** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
|
|
107
|
-
presets?: FolderPreset[];
|
|
108
|
-
}
|
|
109
|
-
interface DocumentLayoutVariant {
|
|
110
|
-
/** Display title for the auto-created sub-folder. */
|
|
111
|
-
title: string;
|
|
112
|
-
description?: string;
|
|
113
|
-
}
|
|
114
|
-
interface FolderPreset {
|
|
115
|
-
id: string;
|
|
116
|
-
label: string;
|
|
117
|
-
icon?: IconName;
|
|
118
|
-
description?: string;
|
|
119
|
-
structure: PresetNode[];
|
|
120
|
-
/** When true, this preset is auto-instantiated on every new record's drive for the owning object. */
|
|
121
|
-
autoInstantiate?: boolean;
|
|
122
|
-
}
|
|
123
|
-
interface PresetNode {
|
|
124
|
-
title: string;
|
|
125
|
-
description?: string;
|
|
126
|
-
children?: PresetNode[];
|
|
127
|
-
}
|
|
128
|
-
/** Max depth allowed for preset.structure to keep instantiation predictable. */
|
|
129
|
-
declare const MAX_PRESET_DEPTH = 5;
|
|
130
|
-
|
|
131
|
-
type BuiltInTransform = "toString" | "toNumber" | "toDate" | "toBoolean" | "toISOString";
|
|
132
|
-
type SchemaOperation = {
|
|
133
|
-
type: "add_attribute";
|
|
134
|
-
attribute: Attribute;
|
|
135
|
-
} | {
|
|
136
|
-
type: "remove_attribute";
|
|
137
|
-
name: string;
|
|
138
|
-
backup_config: Attribute;
|
|
139
|
-
} | {
|
|
140
|
-
type: "rename_attribute";
|
|
141
|
-
from: string;
|
|
142
|
-
to: string;
|
|
143
|
-
} | {
|
|
144
|
-
type: "change_type";
|
|
145
|
-
name: string;
|
|
146
|
-
from: AttributeType;
|
|
147
|
-
to: AttributeType;
|
|
148
|
-
transform?: BuiltInTransform;
|
|
149
|
-
} | {
|
|
150
|
-
type: "update_config";
|
|
151
|
-
name: string;
|
|
152
|
-
from: Partial<Record<string, unknown>>;
|
|
153
|
-
to: Partial<Record<string, unknown>>;
|
|
154
|
-
} | {
|
|
155
|
-
type: "remove_object";
|
|
156
|
-
backup: Record<string, unknown>;
|
|
157
|
-
} | {
|
|
158
|
-
type: "rename_object";
|
|
159
|
-
from: string;
|
|
160
|
-
to: string;
|
|
161
|
-
};
|
|
162
|
-
interface MigrationDefinition {
|
|
163
|
-
version: number;
|
|
164
|
-
operations: SchemaOperation[];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Timestamps for tracking creation and updates
|
|
169
|
-
*/
|
|
170
|
-
interface Timestamps {
|
|
171
|
-
createdAt: Date;
|
|
172
|
-
updatedAt: Date;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Object definition - Represents a database table/entity
|
|
176
|
-
*/
|
|
177
|
-
interface ObjectDefinition {
|
|
178
|
-
id?: Uuid;
|
|
179
|
-
name: string;
|
|
180
|
-
label: string;
|
|
181
|
-
pluralLabel?: string;
|
|
182
|
-
description?: string;
|
|
183
|
-
icon?: IconName;
|
|
184
|
-
/**
|
|
185
|
-
* Template expression used to compute the object's display label.
|
|
186
|
-
* Supports variable interpolation and pipes for formatting.
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* ```typescript
|
|
190
|
-
* // Simple attribute reference
|
|
191
|
-
* labelExpression: "{{ name }}"
|
|
192
|
-
*
|
|
193
|
-
* // Multiple attributes
|
|
194
|
-
* labelExpression: "{{ firstName }} {{ lastName }}"
|
|
195
|
-
*
|
|
196
|
-
* // With pipes for formatting
|
|
197
|
-
* labelExpression: "{{ code | UPPER }} - {{ name | capitalize }}"
|
|
198
|
-
* ```
|
|
199
|
-
*
|
|
200
|
-
* Available pipes: UPPER, LOWER, capitalize, trim
|
|
201
|
-
*/
|
|
202
|
-
labelExpression: string;
|
|
203
|
-
/**
|
|
204
|
-
* Optional template expression used to compute the semantic text sent to
|
|
205
|
-
* Meilisearch for vector generation. When absent, records opt out of semantic
|
|
206
|
-
* embedding generation.
|
|
207
|
-
*/
|
|
208
|
-
embeddingExpression?: string;
|
|
209
|
-
attributes: Attribute[];
|
|
210
|
-
system?: boolean;
|
|
211
|
-
/**
|
|
212
|
-
* If true, no custom (user-created) attributes are allowed on this object.
|
|
213
|
-
* `standards diff` will report an error if any custom attribute is found.
|
|
214
|
-
* Use .sealed() on the ObjectBuilder to set this.
|
|
215
|
-
*/
|
|
216
|
-
sealed?: boolean;
|
|
217
|
-
/**
|
|
218
|
-
* List of custom attribute names explicitly acknowledged by the developer.
|
|
219
|
-
* On a sealed object, these names will NOT trigger a CI failure.
|
|
220
|
-
* On an extensible object, this is purely documentary.
|
|
221
|
-
* Use .tolerate(["name"]) on the ObjectBuilder to set this.
|
|
222
|
-
*/
|
|
223
|
-
toleratedAttributes?: string[];
|
|
224
|
-
metadata?: Record<string, unknown>;
|
|
225
|
-
/** Current schema version (incremented with each migration) */
|
|
226
|
-
schema_version: number;
|
|
227
|
-
/** Ordered list of migrations applied to this object's schema */
|
|
228
|
-
migrations: MigrationDefinition[];
|
|
229
|
-
/** Smart-folder layout convention for documents attached to records of this object. */
|
|
230
|
-
documentLayout?: DocumentLayout;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Links an attribute to an object
|
|
234
|
-
*/
|
|
235
|
-
interface ObjectAttribute {
|
|
236
|
-
objectId: Uuid;
|
|
237
|
-
attributeId: Uuid;
|
|
238
|
-
order?: number;
|
|
239
|
-
required?: boolean;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Record - Instance of an Object (a row in the database)
|
|
243
|
-
*/
|
|
244
|
-
interface ObjectRecord<TValues extends Record<string, unknown> = Record<string, unknown>> extends Timestamps {
|
|
245
|
-
id: Uuid;
|
|
246
|
-
objectId: Uuid;
|
|
247
|
-
/**
|
|
248
|
-
* Display label computed from the object's labelExpression.
|
|
249
|
-
* Computed dynamically based on record values.
|
|
250
|
-
*
|
|
251
|
-
* @example "John Doe" (from "{{ firstName }} {{ lastName }}")
|
|
252
|
-
*/
|
|
253
|
-
label: string;
|
|
254
|
-
/**
|
|
255
|
-
* Semantic text computed from the object's embeddingExpression and persisted
|
|
256
|
-
* for Meilisearch documentTemplate-based vector generation.
|
|
257
|
-
*/
|
|
258
|
-
embeddingText?: string;
|
|
259
|
-
values: TValues;
|
|
260
|
-
/** Per-computed-attribute state keyed by attribute name. */
|
|
261
|
-
computedStates?: Record<string, ComputedAttributeState>;
|
|
262
|
-
/**
|
|
263
|
-
* Custom metadata for the record.
|
|
264
|
-
* Use this for UI/UX state, feature flags, or any application-specific data.
|
|
265
|
-
* Unlike system fields (id, createdAt, updatedAt), metadata can be updated.
|
|
266
|
-
*/
|
|
267
|
-
metadata?: Record<string, unknown>;
|
|
268
|
-
/**
|
|
269
|
-
* Soft delete timestamp.
|
|
270
|
-
* If set, the record is considered deleted but can be restored.
|
|
271
|
-
* Queries exclude soft-deleted records by default.
|
|
272
|
-
*/
|
|
273
|
-
deletedAt?: Date | null;
|
|
274
|
-
/**
|
|
275
|
-
* Actor ID who soft-deleted this record.
|
|
276
|
-
* Set alongside deletedAt when a record is soft-deleted.
|
|
277
|
-
*/
|
|
278
|
-
deletedBy?: string | null;
|
|
279
|
-
/**
|
|
280
|
-
* Actor ID who created this record.
|
|
281
|
-
* Automatically set by RecordService when actorId is configured.
|
|
282
|
-
* Optional for backward compatibility with existing records.
|
|
283
|
-
*/
|
|
284
|
-
createdBy?: string;
|
|
285
|
-
/**
|
|
286
|
-
* Actor ID who last updated this record.
|
|
287
|
-
* Automatically set by RecordService when actorId is configured.
|
|
288
|
-
* Optional for backward compatibility with existing records.
|
|
289
|
-
*/
|
|
290
|
-
lastUpdatedBy?: string;
|
|
291
|
-
/** Schema version at the time this record was last migrated */
|
|
292
|
-
schemaVersion: number;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* System-managed field names on ObjectRecord.
|
|
296
|
-
* These are stored as SQL columns (not in JSONB `values`).
|
|
297
|
-
*
|
|
298
|
-
* Use this in adapters to determine if a filter/sort attribute is a table column
|
|
299
|
-
* vs. a JSONB value field.
|
|
300
|
-
*
|
|
301
|
-
* @example
|
|
302
|
-
* ```typescript
|
|
303
|
-
* if (SYSTEM_FIELD_NAMES.includes(filter.attribute)) {
|
|
304
|
-
* // Filter on SQL column (e.g., WHERE created_at > ...)
|
|
305
|
-
* } else {
|
|
306
|
-
* // Filter on JSONB field (e.g., WHERE values->>'name' = ...)
|
|
307
|
-
* }
|
|
308
|
-
* ```
|
|
309
|
-
*/
|
|
310
|
-
declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy"];
|
|
311
|
-
/**
|
|
312
|
-
* Type for system field names
|
|
313
|
-
*/
|
|
314
|
-
type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
|
|
315
|
-
/**
|
|
316
|
-
* Reserved attribute names that cannot be used for custom attributes.
|
|
317
|
-
* These names conflict with ObjectRecord properties.
|
|
318
|
-
*
|
|
319
|
-
* Includes:
|
|
320
|
-
* - System fields (id, createdAt, updatedAt, createdBy, lastUpdatedBy)
|
|
321
|
-
* - Other ObjectRecord properties (objectId, label, values, metadata, deletedAt)
|
|
322
|
-
*
|
|
323
|
-
* @example
|
|
324
|
-
* ```typescript
|
|
325
|
-
* if (RESERVED_ATTRIBUTE_NAMES.includes(attributeName)) {
|
|
326
|
-
* throw new Error(`"${attributeName}" is a reserved name`);
|
|
327
|
-
* }
|
|
328
|
-
* ```
|
|
329
|
-
*/
|
|
330
|
-
declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "objectId", "label", "embeddingText", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion"];
|
|
331
|
-
/**
|
|
332
|
-
* Type for reserved attribute names
|
|
333
|
-
*/
|
|
334
|
-
type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
|
|
335
|
-
/**
|
|
336
|
-
* Reserved object names that cannot be used for user-created (runtime) objects.
|
|
337
|
-
* These are owned by the framework as sealed system objects.
|
|
338
|
-
*/
|
|
339
|
-
declare const RESERVED_OBJECT_NAMES: readonly ["skill"];
|
|
340
|
-
type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
|
|
341
|
-
|
|
342
|
-
type DocumentKind = "file" | "folder";
|
|
343
|
-
interface Document extends Timestamps {
|
|
344
|
-
id: Uuid;
|
|
345
|
-
tenantId: Uuid;
|
|
346
|
-
title: string;
|
|
347
|
-
kind: DocumentKind;
|
|
348
|
-
parentId?: Uuid | null;
|
|
349
|
-
description?: string;
|
|
350
|
-
contentHash?: string;
|
|
351
|
-
createdBy?: Uuid;
|
|
352
|
-
updatedBy?: Uuid;
|
|
353
|
-
deletedAt?: Date | null;
|
|
354
|
-
/**
|
|
355
|
-
* Fractional ordering position within `(tenantId, parentId)`. Lower values
|
|
356
|
-
* sort first. New rows default to `max(siblings) + 1024` so reorderings can
|
|
357
|
-
* insert between neighbours without renumbering. The server may rebalance
|
|
358
|
-
* positions in the background to keep the spacing bounded.
|
|
359
|
-
*/
|
|
360
|
-
position: number;
|
|
361
|
-
}
|
|
362
|
-
interface DocumentWithSubCount extends Document {
|
|
363
|
-
subCount: number | null;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Configuration for a single named slot on a DocumentAttribute.
|
|
367
|
-
* Slots are placeholders for files within a Document; declared at design-time
|
|
368
|
-
* on the attribute and validated at attach time.
|
|
369
|
-
*/
|
|
370
|
-
interface DocumentSlotConfig {
|
|
371
|
-
/** Stable identifier referenced in DB. */
|
|
372
|
-
name: string;
|
|
373
|
-
/** Display label in UI. Falls back to `name` if absent. */
|
|
374
|
-
label?: string;
|
|
375
|
-
/** Description shown to users and to the AI in tool context. */
|
|
376
|
-
description?: string;
|
|
377
|
-
/** Surfaced to UI/AI but not enforced by the system. */
|
|
378
|
-
required?: boolean;
|
|
379
|
-
/** MIME prefixes or globs (e.g. "image/*", "application/pdf"). */
|
|
380
|
-
acceptedMimeTypes?: string[];
|
|
381
|
-
/** Hard ceiling enforced by the service before upload. */
|
|
382
|
-
maxSizeBytes?: number;
|
|
383
|
-
}
|
|
384
|
-
/** Default applied by the document() builder when no slots are configured. */
|
|
385
|
-
declare const DEFAULT_DOCUMENT_SLOT: DocumentSlotConfig;
|
|
386
|
-
interface DocumentSlot extends Timestamps {
|
|
387
|
-
id: Uuid;
|
|
388
|
-
tenantId: Uuid;
|
|
389
|
-
documentId: Uuid;
|
|
390
|
-
slotName: string;
|
|
391
|
-
isAdditional: boolean;
|
|
392
|
-
fileId: Uuid;
|
|
393
|
-
status: SlotStatus;
|
|
394
|
-
ocrText?: string;
|
|
395
|
-
ocrConfidence?: number;
|
|
396
|
-
processedAt?: Date;
|
|
397
|
-
}
|
|
398
|
-
type SlotStatus = "uploaded" | "processing" | "completed" | "failed";
|
|
399
|
-
interface CreateDocument {
|
|
400
|
-
title: string;
|
|
401
|
-
kind?: DocumentKind;
|
|
402
|
-
parentId?: Uuid | null;
|
|
403
|
-
description?: string;
|
|
404
|
-
position?: number;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Reference to a record attribute that should atomically attach a freshly
|
|
408
|
-
* created Document. Passed alongside `CreateDocument` to make creation
|
|
409
|
-
* link-aware end-to-end (client → REST → service → repo).
|
|
410
|
-
*
|
|
411
|
-
* The server requires this — orphan Documents are not creatable through the
|
|
412
|
-
* REST API.
|
|
413
|
-
*/
|
|
414
|
-
interface CreateDocumentLink {
|
|
415
|
-
objectName: string;
|
|
416
|
-
sourceRecordId: string;
|
|
417
|
-
attributeName: string;
|
|
418
|
-
}
|
|
419
|
-
interface UpdateDocument {
|
|
420
|
-
title?: string;
|
|
421
|
-
parentId?: Uuid | null;
|
|
422
|
-
position?: number;
|
|
423
|
-
}
|
|
424
|
-
interface CreateDocumentSlot {
|
|
425
|
-
documentId: Uuid;
|
|
426
|
-
slotName: string;
|
|
427
|
-
fileId: Uuid;
|
|
428
|
-
isAdditional?: boolean;
|
|
429
|
-
}
|
|
430
|
-
interface UpdateDocumentSlot {
|
|
431
|
-
status?: SlotStatus;
|
|
432
|
-
ocrText?: string;
|
|
433
|
-
ocrConfidence?: number;
|
|
434
|
-
}
|
|
435
|
-
interface DocumentListOptions {
|
|
436
|
-
limit?: number;
|
|
437
|
-
offset?: number;
|
|
438
|
-
}
|
|
439
|
-
interface DocumentWithSlots extends Document {
|
|
440
|
-
slots: DocumentSlot[];
|
|
441
|
-
}
|
|
442
|
-
interface RecordDocuments {
|
|
443
|
-
/** Documents grouped by attribute name (includes system 'attachments' attribute) */
|
|
444
|
-
byAttribute: Record<string, DocumentWithSlots[]>;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
103
|
/**
|
|
448
104
|
* Allowed attribute types in .qualifyWith()
|
|
449
105
|
*
|
|
@@ -507,7 +163,7 @@ type OptionPropertyAttribute = SelectAttribute | StatusAttribute | MultiselectAt
|
|
|
507
163
|
*/
|
|
508
164
|
declare function hasOptions(attr: PropertyAttribute): attr is OptionPropertyAttribute;
|
|
509
165
|
|
|
510
|
-
type AttributeType = "text" | "richtext" | "number" | "checkbox" | "date" | "phone" | "currency" | "status" | "location" | "select" | "multiselect" | "
|
|
166
|
+
type AttributeType = "text" | "richtext" | "number" | "checkbox" | "date" | "phone" | "currency" | "status" | "location" | "select" | "multiselect" | "user" | "relation" | "formula" | "rollup" | "document";
|
|
511
167
|
/**
|
|
512
168
|
* Status group categorization
|
|
513
169
|
*/
|
|
@@ -658,13 +314,6 @@ interface MultiselectAttribute extends BaseAttribute<string[]> {
|
|
|
658
314
|
options: Option[];
|
|
659
315
|
renderAs?: "badges";
|
|
660
316
|
}
|
|
661
|
-
interface FileAttribute extends BaseAttribute<string> {
|
|
662
|
-
type: "file";
|
|
663
|
-
maxFiles?: number;
|
|
664
|
-
maxSize?: number;
|
|
665
|
-
allowedTypes?: MimeType[] | readonly MimeType[];
|
|
666
|
-
multiple?: boolean;
|
|
667
|
-
}
|
|
668
317
|
type UserReferenceType = "user" | "agent";
|
|
669
318
|
interface UserAttribute extends BaseAttribute<string | string[]> {
|
|
670
319
|
type: "user";
|
|
@@ -914,17 +563,16 @@ interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "r
|
|
|
914
563
|
/**
|
|
915
564
|
* DocumentAttribute - References structured documents.
|
|
916
565
|
*
|
|
917
|
-
*
|
|
918
|
-
*
|
|
566
|
+
* A DocumentAttribute references packs of anonymous files with typed edge
|
|
567
|
+
* properties.
|
|
919
568
|
*
|
|
920
|
-
* Every document attribute is multi by construction — the underlying
|
|
921
|
-
*
|
|
922
|
-
* files uniformly. Single-value file fields use `file()` instead.
|
|
569
|
+
* Every document attribute is multi by construction — the underlying storage
|
|
570
|
+
* (documents + files) supports 1 Doc → N files uniformly.
|
|
923
571
|
*
|
|
924
572
|
* @example
|
|
925
573
|
* ```typescript
|
|
926
574
|
* document({ name: "contracts", label: "Contrats" })
|
|
927
|
-
* .
|
|
575
|
+
* .accepts(["application/pdf"])
|
|
928
576
|
* ```
|
|
929
577
|
*/
|
|
930
578
|
interface DocumentAttribute extends BaseAttribute<string[]> {
|
|
@@ -935,19 +583,18 @@ interface DocumentAttribute extends BaseAttribute<string[]> {
|
|
|
935
583
|
* Stored on `record_reference_edges.properties`, not on the document itself.
|
|
936
584
|
*/
|
|
937
585
|
properties?: PropertySchema;
|
|
938
|
-
/**
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
slots?: DocumentSlotConfig[];
|
|
586
|
+
/** MIME prefixes/globs (e.g. "image/*", "application/pdf") applied to every file of the pack. */
|
|
587
|
+
accepts?: string[];
|
|
588
|
+
/** Hard ceiling in bytes applied to every file of the pack. */
|
|
589
|
+
maxFileSize?: number;
|
|
943
590
|
}
|
|
944
591
|
/**
|
|
945
592
|
* Union of every attribute definition supported by Standards objects.
|
|
946
593
|
*
|
|
947
594
|
* Use this type when code needs to inspect or render attributes generically
|
|
948
|
-
* across primitive, relation, computed,
|
|
595
|
+
* across primitive, relation, computed, user, and document fields.
|
|
949
596
|
*/
|
|
950
|
-
type Attribute = TextAttribute | RichtextAttribute | NumberAttribute | CheckboxAttribute | DateAttribute | PhoneAttribute | CurrencyAttribute | StatusAttribute | LocationAttribute | SelectAttribute | MultiselectAttribute |
|
|
597
|
+
type Attribute = TextAttribute | RichtextAttribute | NumberAttribute | CheckboxAttribute | DateAttribute | PhoneAttribute | CurrencyAttribute | StatusAttribute | LocationAttribute | SelectAttribute | MultiselectAttribute | UserAttribute | RelationAttribute | FormulaAttribute | RollupAttribute | DocumentAttribute;
|
|
951
598
|
/**
|
|
952
599
|
* Check if an attribute supports sorting based on its type.
|
|
953
600
|
*/
|
|
@@ -955,4 +602,4 @@ declare function isAttributeSortable(attr: {
|
|
|
955
602
|
type: AttributeType;
|
|
956
603
|
}): boolean;
|
|
957
604
|
|
|
958
|
-
export { type
|
|
605
|
+
export { type DateFormat as $, type Attribute as A, type BilateralConfig as B, type CurrencyAttribute as C, type DateAttribute as D, type UserReferenceType as E, type FormulaAttribute as F, AUTOFILL_ELIGIBLE_TYPES as G, type AttributeGroup as H, type AutofillEligibleType as I, type BaseAttribute as J, type ComputedFieldKind as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, type ComputedFormulaBinaryNode as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type ComputedFormulaBinaryOperator as V, type ComputedFormulaCallNode as W, type ComputedFormulaLiteralNode as X, ComputedFormulaParseError as Y, type ComputedFormulaPathNode as Z, type ComputedStateStatus as _, type RichtextAttribute as a, type DateValue as a0, type NumberUnit as a1, type OptionPropertyAttribute as a2, type PropertyAttribute as a3, type PropertyType as a4, RELATION_TARGET_ANY as a5, type RichTextAttribute as a6, type StatusGroup as a7, hasOptions as a8, inferInverseCardinality as a9, isAttributeSortable as aa, isBilateralRelation as ab, isUniversalRelation as ac, parseComputedFormula as ad, resolvePropertyDefinitions as ae, type MultiselectAttribute as b, type SelectAttribute as c, type StatusAttribute as d, type RollupAttribute as e, type CheckboxAttribute as f, type AttributeType as g, type ComputedAttributeState as h, type ComputedValueType as i, type ComputedReturnType as j, type ComputedOptionsSource as k, type ComputedDependency as l, type ComputedPlan as m, type ComputedFormulaAstNode as n, type LocationGranularity as o, type Location as p, type DateRangeValue as q, type DocumentAttribute as r, type Phone as s, type Currency as t, type PropertySchema as u, type AutofillConfig as v, type TimeFormat as w, type FormulaReturnType as x, type RelationTarget as y, type RollupFunction as z };
|