@stndrds/schema 1.0.0-alpha.350 → 1.0.0-alpha.352

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.
Files changed (93) hide show
  1. package/dist/{all-Dk8PLu1y.d.mts → all-BmVuO_vv.d.mts} +38 -38
  2. package/dist/{all-CPMOHYla.d.ts → all-Bv-5hu8j.d.ts} +38 -38
  3. package/dist/{attributes-mMmH-WOx.d.mts → attributes-Cft68n4u.d.mts} +1 -1
  4. package/dist/{attributes-C2gm0hUJ.d.ts → attributes-gEcJp-WP.d.ts} +1 -1
  5. package/dist/capabilities.d.mts +5 -13
  6. package/dist/capabilities.d.ts +5 -13
  7. package/dist/capabilities.js +1 -1
  8. package/dist/capabilities.mjs +1 -1
  9. package/dist/{checkbox-DO6Mkloc.d.mts → checkbox-C-kdNm3A.d.mts} +2 -2
  10. package/dist/{checkbox-Ce8gAyQf.d.ts → checkbox-C7ctkYoQ.d.ts} +2 -2
  11. package/dist/config-CYuFravl.js +13 -0
  12. package/dist/config-CiAtjzem.mjs +13 -0
  13. package/dist/{date-DikDGfre.d.ts → date-CY4L11B_.d.ts} +2 -2
  14. package/dist/{date-CMS-GYRM.d.mts → date-mQ8gxU85.d.mts} +2 -2
  15. package/dist/empty-BgAwlO54.mjs +2 -0
  16. package/dist/empty-CRCKZcwK.js +2 -0
  17. package/dist/{exceptions-DxzT8POW.d.ts → exceptions-704MxF-j.d.mts} +98 -34
  18. package/dist/{exceptions-DxzT8POW.d.mts → exceptions-704MxF-j.d.ts} +98 -34
  19. package/dist/exceptions.d.mts +2 -2
  20. package/dist/exceptions.d.ts +2 -2
  21. package/dist/exceptions.js +1 -1
  22. package/dist/exceptions.mjs +1 -1
  23. package/dist/{index-D26ob_vF.d.mts → index-BV_w2VTh.d.mts} +15 -2
  24. package/dist/{index-BL7EA39F.d.ts → index-Bbc3qfJ3.d.ts} +1 -1
  25. package/dist/{index-BV4yNsr7.d.mts → index-Cga9i2js.d.mts} +1 -1
  26. package/dist/{index-D9OhYX-t.d.ts → index-DQ4cGca2.d.mts} +50 -11
  27. package/dist/{index-B-mUjnh9.d.mts → index-DmS-DtU4.d.ts} +50 -11
  28. package/dist/{index-CRtiKFTH.d.ts → index-UYQmTrEG.d.ts} +15 -2
  29. package/dist/index.d.mts +1313 -1245
  30. package/dist/index.d.ts +1313 -1245
  31. package/dist/index.js +9 -9
  32. package/dist/index.mjs +9 -9
  33. package/dist/{number-Ck0PPSkK.d.ts → number-CAAAb8Wz.d.ts} +2 -2
  34. package/dist/{number-r6bOZ9jd.d.mts → number-eNEdOtC3.d.mts} +2 -2
  35. package/dist/object-sbH7KtsH.mjs +4 -0
  36. package/dist/object-xwmmQZ8z.js +4 -0
  37. package/dist/{phone-MN6Li5Wx.js → phone-BXTenBvF.js} +1 -1
  38. package/dist/{phone-CsV9QNwF.mjs → phone-CRbCvH20.mjs} +1 -1
  39. package/dist/{text-B1Vwj7fS.d.mts → text-BKyAPMGX.d.mts} +2 -2
  40. package/dist/{text-DHg2cmFd.d.ts → text-CP1eHBEv.d.ts} +2 -2
  41. package/dist/{utils-Du-He6Ct.d.ts → utils-C6VEXia7.d.ts} +3 -3
  42. package/dist/{utils-r53z9KnF.d.mts → utils-CnhbUWev.d.mts} +3 -3
  43. package/dist/utils.d.mts +1 -1
  44. package/dist/utils.d.ts +1 -1
  45. package/dist/validation/all.d.mts +5 -5
  46. package/dist/validation/all.d.ts +5 -5
  47. package/dist/validation/all.js +1 -1
  48. package/dist/validation/all.mjs +1 -1
  49. package/dist/validation/complex/currency.d.mts +2 -2
  50. package/dist/validation/complex/currency.d.ts +2 -2
  51. package/dist/validation/complex/location.d.mts +2 -2
  52. package/dist/validation/complex/location.d.ts +2 -2
  53. package/dist/validation/complex/phone.d.mts +2 -2
  54. package/dist/validation/complex/phone.d.ts +2 -2
  55. package/dist/validation/complex/phone.js +1 -1
  56. package/dist/validation/complex/phone.mjs +1 -1
  57. package/dist/validation/complex/relation.d.mts +2 -2
  58. package/dist/validation/complex/relation.d.ts +2 -2
  59. package/dist/validation/complex/richtext.d.mts +2 -2
  60. package/dist/validation/complex/richtext.d.ts +2 -2
  61. package/dist/validation/complex/select.d.mts +2 -2
  62. package/dist/validation/complex/select.d.ts +2 -2
  63. package/dist/validation/complex/user.d.mts +2 -2
  64. package/dist/validation/complex/user.d.ts +2 -2
  65. package/dist/validation/computed/formula.d.mts +2 -2
  66. package/dist/validation/computed/formula.d.ts +2 -2
  67. package/dist/validation/computed/rollup.d.mts +2 -2
  68. package/dist/validation/computed/rollup.d.ts +2 -2
  69. package/dist/validation/config/index.d.mts +2 -2
  70. package/dist/validation/config/index.d.ts +2 -2
  71. package/dist/validation/config/index.js +1 -1
  72. package/dist/validation/config/index.mjs +1 -1
  73. package/dist/validation/core/index.d.mts +1 -1
  74. package/dist/validation/core/index.d.ts +1 -1
  75. package/dist/validation/object/index.d.mts +1 -1
  76. package/dist/validation/object/index.d.ts +1 -1
  77. package/dist/validation/object/index.js +1 -1
  78. package/dist/validation/object/index.mjs +1 -1
  79. package/dist/validation/primitives/checkbox.d.mts +1 -1
  80. package/dist/validation/primitives/checkbox.d.ts +1 -1
  81. package/dist/validation/primitives/date.d.mts +1 -1
  82. package/dist/validation/primitives/date.d.ts +1 -1
  83. package/dist/validation/primitives/number.d.mts +1 -1
  84. package/dist/validation/primitives/number.d.ts +1 -1
  85. package/dist/validation/primitives/text.d.mts +1 -1
  86. package/dist/validation/primitives/text.d.ts +1 -1
  87. package/dist/{view-config.schema-c8LvH8WE.mjs → view-config.schema-CCrM5b-O.mjs} +1 -1
  88. package/dist/{view-config.schema-QmnihdGp.js → view-config.schema-CgU86fLj.js} +1 -1
  89. package/package.json +2 -2
  90. package/dist/config-BiQGgy7f.mjs +0 -13
  91. package/dist/config-WUWITOeW.js +0 -13
  92. package/dist/object-BA3vKFl0.js +0 -4
  93. package/dist/object-C92B0Oei.mjs +0 -4
@@ -1,21 +1,14 @@
1
1
 
2
- import { n as Attribute } from "./attributes-mMmH-WOx.mjs";
3
- import { r as Uuid } from "./utils-r53z9KnF.mjs";
4
- import { i as ValidationResult, r as ValidationMessages } from "./index-BV4yNsr7.mjs";
2
+ import { n as Attribute } from "./attributes-gEcJp-WP.js";
3
+ import { r as Uuid } from "./utils-C6VEXia7.js";
4
+ import { i as ValidationResult, r as ValidationMessages } from "./index-Bbc3qfJ3.js";
5
5
  import { z as z$1 } from "zod";
6
6
  import { IconName } from "@stndrds/constants";
7
7
  //#region src/types/document-layout.d.ts
8
8
  interface DocumentLayout {
9
- /** Named sub-folders auto-created at the top of the record's drive when first used via attach --variant. */
10
- variants?: Record<string, DocumentLayoutVariant>;
11
9
  /** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
12
10
  presets?: FolderPreset[];
13
11
  }
14
- interface DocumentLayoutVariant {
15
- /** Display title for the auto-created sub-folder. */
16
- title: string;
17
- description?: string;
18
- }
19
12
  interface FolderPreset {
20
13
  id: string;
21
14
  label: string;
@@ -33,6 +26,45 @@ interface PresetNode {
33
26
  /** Max depth allowed for preset.structure to keep instantiation predictable. */
34
27
  declare const MAX_PRESET_DEPTH = 5;
35
28
  //#endregion
29
+ //#region src/types/record-access.d.ts
30
+ /** Roles a record access grant can carry (spec §5.1). */
31
+ declare const RECORD_ACCESS_ROLES: readonly ["reader", "editor"];
32
+ type RecordAccessRole = (typeof RECORD_ACCESS_ROLES)[number];
33
+ /**
34
+ * Why a grant exists — the equivalent of Salesforce's `RowCause` (spec §3):
35
+ * automatic grants are recomputed without ever touching manual shares.
36
+ */
37
+ declare const RECORD_ACCESS_SOURCES: readonly ["manual", "meeting_attendee"];
38
+ type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
39
+ /** What the reading actor may do with a record (spec §6.6). */
40
+ type ViewerAccess = "owner" | "editor" | "reader" | "workspace";
41
+ /** One beneficiary of a private record: its effective role and every source that grants it. */
42
+ interface RecordAudienceGrant {
43
+ actorId: Uuid;
44
+ role: RecordAccessRole;
45
+ sources: RecordAccessSource[];
46
+ }
47
+ /** Who can reach a record beyond its owner (`GET /records/:object/:id/access`). */
48
+ interface RecordAudience {
49
+ recordId: Uuid;
50
+ visibility: ResourceVisibility;
51
+ ownedBy: Uuid | null;
52
+ grants: RecordAudienceGrant[];
53
+ }
54
+ /** Narrow an untrusted value (HTTP body, CLI flag) to a grant role. */
55
+ declare function parseRecordAccessRole(value: unknown): RecordAccessRole;
56
+ /**
57
+ * The single derivation of `viewerAccess`, from the row's owner and the
58
+ * `viewer_grant` storage computed FOR this viewer. A private record that is
59
+ * neither owned nor granted can only have been read by the system reader,
60
+ * which reads and never writes: `reader`.
61
+ */
62
+ declare function deriveViewerAccess(record: {
63
+ visibility: ResourceVisibility;
64
+ ownedBy: string | null;
65
+ viewerGrant?: RecordAccessRole | null;
66
+ }, actorIds: readonly string[]): ViewerAccess;
67
+ //#endregion
36
68
  //#region src/types/objects.d.ts
37
69
  /** Visibility scopes shared by resources that can be workspace-wide or actor-private. */
38
70
  declare const RESOURCE_VISIBILITIES: readonly ["workspace", "private"];
@@ -151,6 +183,13 @@ interface ObjectRecord<TValues extends Record<string, unknown> = Record<string,
151
183
  visibility: ResourceVisibility;
152
184
  /** Owning actor for private records; always null for workspace records. */
153
185
  ownedBy: Uuid | null;
186
+ /**
187
+ * What the reading actor may do with this record (spec §6.6): its owner,
188
+ * an editor or reader by grant, or any member of a workspace record.
189
+ * Computed for the viewer that read the row; absent on records built in
190
+ * memory and on rows read without a viewer. Never broadcast nor indexed.
191
+ */
192
+ viewerAccess?: ViewerAccess;
154
193
  /**
155
194
  * Display label computed from the object's labelExpression.
156
195
  * Computed dynamically based on record values.
@@ -342,4 +381,4 @@ declare function getMissingRequiredAttributes(objectDef: ObjectDefinition, data:
342
381
  */
343
382
  declare function isRecordComplete(objectDef: ObjectDefinition, data: Record<string, unknown>): boolean;
344
383
  //#endregion
345
- export { FolderPreset as A, ResourceVisibility as C, parseResourceVisibility as D, Timestamps as E, PresetNode as M, DocumentLayout as O, ReservedObjectName as S, SystemFieldName as T, ObjectRecord as _, validateDraft as a, RESOURCE_VISIBILITIES as b, validateObjectOrThrow as c, createAttributeValidator as d, createFormAttributeValidator as f, ObjectDefinition as g, ObjectAttribute as h, validateAttribute as i, MAX_PRESET_DEPTH as j, DocumentLayoutVariant as k, createDraftValidator as l, ListViewTabVisibility as m, isRecordComplete as n, validateDraftOrThrow as o, LIST_VIEW_TAB_VISIBILITIES as p, rejectUnknownAttributesOrThrow as r, validateObject as s, getMissingRequiredAttributes as t, createObjectValidator as u, RESERVED_ATTRIBUTE_NAMES as v, SYSTEM_FIELD_NAMES as w, ReservedAttributeName as x, RESERVED_OBJECT_NAMES as y };
384
+ export { RecordAccessRole as A, PresetNode as B, ResourceVisibility as C, parseResourceVisibility as D, Timestamps as E, deriveViewerAccess as F, parseRecordAccessRole as I, DocumentLayout as L, RecordAudience as M, RecordAudienceGrant as N, RECORD_ACCESS_ROLES as O, ViewerAccess as P, FolderPreset as R, ReservedObjectName as S, SystemFieldName as T, ObjectRecord as _, validateDraft as a, RESOURCE_VISIBILITIES as b, validateObjectOrThrow as c, createAttributeValidator as d, createFormAttributeValidator as f, ObjectDefinition as g, ObjectAttribute as h, validateAttribute as i, RecordAccessSource as j, RECORD_ACCESS_SOURCES as k, createDraftValidator as l, ListViewTabVisibility as m, isRecordComplete as n, validateDraftOrThrow as o, LIST_VIEW_TAB_VISIBILITIES as p, rejectUnknownAttributesOrThrow as r, validateObject as s, getMissingRequiredAttributes as t, createObjectValidator as u, RESERVED_ATTRIBUTE_NAMES as v, SYSTEM_FIELD_NAMES as w, ReservedAttributeName as x, RESERVED_OBJECT_NAMES as y, MAX_PRESET_DEPTH as z };
@@ -1,5 +1,5 @@
1
1
 
2
- import { i as AttributeType, n as Attribute } from "./attributes-C2gm0hUJ.js";
2
+ import { i as AttributeType, n as Attribute } from "./attributes-gEcJp-WP.js";
3
3
  import { z as z$1 } from "zod";
4
4
  import { IconName } from "@stndrds/constants";
5
5
  //#region src/types/mutations.d.ts
@@ -172,6 +172,19 @@ declare const statusOptionWriteSchema: z$1.ZodObject<{
172
172
  finished: "finished";
173
173
  }>;
174
174
  }, z$1.core.$strict>;
175
+ /**
176
+ * Drops, from every option of an attribute config or body, the keys
177
+ * `optionSchema` does not know — typically an `id` the code builder accepted
178
+ * without complaint (#4356). Sync stores options through it, and the schema
179
+ * state reads them through it, so one stale key no longer 400s the whole state.
180
+ * The options of a `relation()`/`document()`'s `.qualifyWith()` properties are
181
+ * validated by the same schema, so each property definition goes through it too.
182
+ *
183
+ * Order is kept, and a config with nothing to drop is returned as is. A list
184
+ * or option that is not the expected shape is left for strict validation to
185
+ * refuse.
186
+ */
187
+ declare function withoutUnknownOptionKeys<T extends object>(config: T): T;
175
188
  /**
176
189
  * Property types whose config differs from `baseConfigSchema` only by
177
190
  * independent optional scalars — no options array, no relation targets. Same
@@ -251,4 +264,4 @@ declare function parseAttributeConfigForCreate(type: AttributeType, input: unkno
251
264
  */
252
265
  declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
253
266
  //#endregion
254
- export { UpdateObjectInput as S, statusOptionWriteSchema as _, getAttributeConfigWriteSchema as a, RelationOption as b, parseAttributeConfigForCreate as c, propertyAttributeWireSchema as d, propertySchemaSchema as f, statusGroupSchema as g, selectOptionWriteSchema as h, getAttributeConfigSchema as i, parseAttributeConfigForUpdate as l, refuseForeignKeys as m, WIRE_OMITTED_CONFIG_KEYS as n, multiselectOptionWriteSchema as o, propertySchemaWireSchema as p, attributeConfigSchemas as r, parseAttributeConfig as s, SIMPLE_PROPERTY_TYPES as t, propertyAttributeSchema as u, AddAttributeInput as v, RelationOptionsResponse as x, CreateCustomObjectInput as y };
267
+ export { UpdateObjectInput as C, RelationOptionsResponse as S, statusOptionWriteSchema as _, getAttributeConfigWriteSchema as a, CreateCustomObjectInput as b, parseAttributeConfigForCreate as c, propertyAttributeWireSchema as d, propertySchemaSchema as f, statusGroupSchema as g, selectOptionWriteSchema as h, getAttributeConfigSchema as i, parseAttributeConfigForUpdate as l, refuseForeignKeys as m, WIRE_OMITTED_CONFIG_KEYS as n, multiselectOptionWriteSchema as o, propertySchemaWireSchema as p, attributeConfigSchemas as r, parseAttributeConfig as s, SIMPLE_PROPERTY_TYPES as t, propertyAttributeSchema as u, withoutUnknownOptionKeys as v, RelationOption as x, AddAttributeInput as y };