@stndrds/schema 1.0.0-alpha.351 → 1.0.0-alpha.353

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 (89) hide show
  1. package/dist/{all-CxrR3FfQ.d.mts → all-0XBkyLI_.d.mts} +39 -50
  2. package/dist/{all-DgCMEIjc.d.ts → all-PHJaq-9U.d.ts} +39 -50
  3. package/dist/{attributes-BrWmES5w.d.mts → attributes-0MFN3D1T.d.mts} +1 -1
  4. package/dist/{attributes-DF899HOt.d.ts → attributes-D3wn8qoZ.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-Clb_FZ4C.d.mts → checkbox-DO1Komkk.d.mts} +2 -2
  10. package/dist/{checkbox-DdyYfy8E.d.ts → checkbox-DbL9Kc0_.d.ts} +2 -2
  11. package/dist/{config-CiAtjzem.mjs → config-BkMUw1Ho.mjs} +4 -4
  12. package/dist/{config-CYuFravl.js → config-CQj1KDVm.js} +1 -1
  13. package/dist/{date-CXp1zJM4.d.mts → date-BYjdx-FS.d.mts} +2 -2
  14. package/dist/{date-DhwNqFU4.d.ts → date-D1M2lsRo.d.ts} +2 -2
  15. package/dist/{exceptions-DrrzAhuA.d.mts → exceptions-BG2LUDOt.d.mts} +55 -25
  16. package/dist/{exceptions-DrrzAhuA.d.ts → exceptions-BG2LUDOt.d.ts} +55 -25
  17. package/dist/exceptions.d.mts +2 -2
  18. package/dist/exceptions.d.ts +2 -2
  19. package/dist/exceptions.js +1 -1
  20. package/dist/exceptions.mjs +1 -1
  21. package/dist/{index-BOibflWy.d.ts → index-BQ7N0iEr.d.ts} +14 -2
  22. package/dist/{index-Bfvc4AZB.d.mts → index-BRGf8Pj9.d.mts} +14 -2
  23. package/dist/{index-OvRk1isl.d.ts → index-BxM_oMmi.d.ts} +1 -1
  24. package/dist/{index-Lp5dhlhc.d.mts → index-C9eOBRL6.d.mts} +50 -11
  25. package/dist/{index-DggAjGTr.d.mts → index-D9Zkc3Zp.d.mts} +1 -1
  26. package/dist/{index-DCw-X_sc.d.ts → index-DcLDUWZd.d.ts} +50 -11
  27. package/dist/index.d.mts +1248 -1230
  28. package/dist/index.d.ts +1248 -1230
  29. package/dist/index.js +9 -9
  30. package/dist/index.mjs +9 -9
  31. package/dist/{number-CoTBX03I.d.ts → number-B6nCPYSp.d.ts} +2 -2
  32. package/dist/{number-C_ZN3qJO.d.mts → number-Bz2mxDQV.d.mts} +2 -2
  33. package/dist/{object-AqI3n2CP.mjs → object-sbH7KtsH.mjs} +1 -1
  34. package/dist/{object-BEwZx-Fu.js → object-xwmmQZ8z.js} +1 -1
  35. package/dist/{phone-MN6Li5Wx.js → phone-BXTenBvF.js} +1 -1
  36. package/dist/{phone-CsV9QNwF.mjs → phone-CRbCvH20.mjs} +1 -1
  37. package/dist/{text-D_rs4VYZ.d.mts → text-BWe-JTsH.d.mts} +2 -2
  38. package/dist/{text-Z8QjbxUx.d.ts → text-CbUS9lxj.d.ts} +2 -2
  39. package/dist/{utils-Cuz_wSKI.d.ts → utils-ByfbrMxt.d.mts} +3 -3
  40. package/dist/{utils-Cl3b_6d8.d.mts → utils-DiHsvBLK.d.ts} +3 -3
  41. package/dist/utils.d.mts +1 -1
  42. package/dist/utils.d.ts +1 -1
  43. package/dist/validation/all.d.mts +5 -5
  44. package/dist/validation/all.d.ts +5 -5
  45. package/dist/validation/all.js +1 -1
  46. package/dist/validation/all.mjs +1 -1
  47. package/dist/validation/complex/currency.d.mts +2 -2
  48. package/dist/validation/complex/currency.d.ts +2 -2
  49. package/dist/validation/complex/location.d.mts +2 -2
  50. package/dist/validation/complex/location.d.ts +2 -2
  51. package/dist/validation/complex/phone.d.mts +2 -2
  52. package/dist/validation/complex/phone.d.ts +2 -2
  53. package/dist/validation/complex/phone.js +1 -1
  54. package/dist/validation/complex/phone.mjs +1 -1
  55. package/dist/validation/complex/relation.d.mts +2 -2
  56. package/dist/validation/complex/relation.d.ts +2 -2
  57. package/dist/validation/complex/richtext.d.mts +2 -2
  58. package/dist/validation/complex/richtext.d.ts +2 -2
  59. package/dist/validation/complex/select.d.mts +2 -2
  60. package/dist/validation/complex/select.d.ts +2 -2
  61. package/dist/validation/complex/user.d.mts +2 -2
  62. package/dist/validation/complex/user.d.ts +2 -2
  63. package/dist/validation/computed/formula.d.mts +2 -2
  64. package/dist/validation/computed/formula.d.ts +2 -2
  65. package/dist/validation/computed/rollup.d.mts +2 -2
  66. package/dist/validation/computed/rollup.d.ts +2 -2
  67. package/dist/validation/config/index.d.mts +2 -2
  68. package/dist/validation/config/index.d.ts +2 -2
  69. package/dist/validation/config/index.js +1 -1
  70. package/dist/validation/config/index.mjs +1 -1
  71. package/dist/validation/core/index.d.mts +1 -1
  72. package/dist/validation/core/index.d.ts +1 -1
  73. package/dist/validation/object/index.d.mts +1 -1
  74. package/dist/validation/object/index.d.ts +1 -1
  75. package/dist/validation/object/index.js +1 -1
  76. package/dist/validation/object/index.mjs +1 -1
  77. package/dist/validation/primitives/checkbox.d.mts +1 -1
  78. package/dist/validation/primitives/checkbox.d.ts +1 -1
  79. package/dist/validation/primitives/date.d.mts +1 -1
  80. package/dist/validation/primitives/date.d.ts +1 -1
  81. package/dist/validation/primitives/number.d.mts +1 -1
  82. package/dist/validation/primitives/number.d.ts +1 -1
  83. package/dist/validation/primitives/text.d.mts +1 -1
  84. package/dist/validation/primitives/text.d.ts +1 -1
  85. package/dist/view-config.schema-Cn3vLXu0.js +2 -0
  86. package/dist/view-config.schema-CvT5GfbA.mjs +2 -0
  87. package/package.json +2 -2
  88. package/dist/view-config.schema-CCrM5b-O.mjs +0 -2
  89. package/dist/view-config.schema-CgU86fLj.js +0 -2
@@ -1,21 +1,14 @@
1
1
 
2
- import { n as Attribute } from "./attributes-BrWmES5w.mjs";
3
- import { r as Uuid } from "./utils-Cl3b_6d8.mjs";
4
- import { i as ValidationResult, r as ValidationMessages } from "./index-DggAjGTr.mjs";
2
+ import { n as Attribute } from "./attributes-0MFN3D1T.mjs";
3
+ import { r as Uuid } from "./utils-ByfbrMxt.mjs";
4
+ import { i as ValidationResult, r as ValidationMessages } from "./index-D9Zkc3Zp.mjs";
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 { n as Attribute } from "./attributes-BrWmES5w.mjs";
2
+ import { n as Attribute } from "./attributes-0MFN3D1T.mjs";
3
3
  import { z as z$1 } from "zod";
4
4
  //#region src/validation/core/types.d.ts
5
5
  /**
@@ -1,21 +1,14 @@
1
1
 
2
- import { n as Attribute } from "./attributes-DF899HOt.js";
3
- import { r as Uuid } from "./utils-Cuz_wSKI.js";
4
- import { i as ValidationResult, r as ValidationMessages } from "./index-OvRk1isl.js";
2
+ import { n as Attribute } from "./attributes-D3wn8qoZ.js";
3
+ import { r as Uuid } from "./utils-DiHsvBLK.js";
4
+ import { i as ValidationResult, r as ValidationMessages } from "./index-BxM_oMmi.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 };