@rippling/rippling-sdk 0.2.0-alpha.84 → 0.2.0-alpha.86

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 (195) hide show
  1. package/examples/manifest/custom-object-creation-workflow/custom-object-creation-workflow.ts +44 -26
  2. package/examples/manifest/dental-practice-management/dental-practice-management.ts +470 -142
  3. package/examples/manifest/dental-practice-management/functions/chair-schedule.ts +23 -13
  4. package/examples/manifest/dental-practice-management/functions/complete-visit.ts +55 -32
  5. package/examples/manifest/dental-practice-management/functions/operatory-list.ts +23 -13
  6. package/examples/manifest/dental-practice-management/functions/patient-list.ts +23 -13
  7. package/examples/manifest/dental-practice-management/functions/treatment-plan-list.ts +23 -13
  8. package/examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts +23 -68
  9. package/examples/manifest/field-service-dispatch/field-service-dispatch.ts +375 -102
  10. package/examples/manifest/grant-program-management/grant-program-management.ts +419 -125
  11. package/examples/manifest/gym-membership-management/functions/check-in-desk.ts +23 -13
  12. package/examples/manifest/gym-membership-management/functions/member-list.ts +23 -13
  13. package/examples/manifest/gym-membership-management/functions/today-schedule.ts +23 -13
  14. package/examples/manifest/gym-membership-management/functions/trainer-list.ts +23 -13
  15. package/examples/manifest/gym-membership-management/gym-membership-management.ts +442 -92
  16. package/examples/manifest/procurement-approval-hub/procurement-approval-hub.ts +408 -122
  17. package/examples/manifest/simple-todo-app/functions/mark-done.ts +12 -16
  18. package/examples/manifest/simple-todo-app/functions/todo-list.ts +23 -13
  19. package/examples/manifest/simple-todo-app/simple-todo-app.ts +109 -40
  20. package/examples/manifest/todo-app-without-object-list-view/functions/todo-page.ts +193 -166
  21. package/examples/manifest/todo-app-without-object-list-view/todo-app-without-object-list-view.ts +47 -24
  22. package/package.json +13 -7
  23. package/resources/custom-objects/fields.d.mts +1 -40
  24. package/resources/custom-objects/fields.d.mts.map +1 -1
  25. package/resources/custom-objects/fields.d.ts +1 -40
  26. package/resources/custom-objects/fields.d.ts.map +1 -1
  27. package/resources/levels.d.mts +25 -4
  28. package/resources/levels.d.mts.map +1 -1
  29. package/resources/levels.d.ts +25 -4
  30. package/resources/levels.d.ts.map +1 -1
  31. package/src/resources/custom-objects/fields.ts +1 -46
  32. package/src/resources/levels.ts +28 -4
  33. package/src/tsconfig.json +1 -1
  34. package/src/version.ts +1 -1
  35. package/version.d.mts +1 -1
  36. package/version.d.ts +1 -1
  37. package/version.js +1 -1
  38. package/version.mjs +1 -1
  39. package/core/platform/manifest/custom-objects/action.d.mts +0 -58
  40. package/core/platform/manifest/custom-objects/action.d.mts.map +0 -1
  41. package/core/platform/manifest/custom-objects/action.d.ts +0 -58
  42. package/core/platform/manifest/custom-objects/action.d.ts.map +0 -1
  43. package/core/platform/manifest/custom-objects/action.js +0 -44
  44. package/core/platform/manifest/custom-objects/action.js.map +0 -1
  45. package/core/platform/manifest/custom-objects/action.mjs +0 -40
  46. package/core/platform/manifest/custom-objects/action.mjs.map +0 -1
  47. package/core/platform/manifest/custom-objects/conditions.d.mts +0 -240
  48. package/core/platform/manifest/custom-objects/conditions.d.mts.map +0 -1
  49. package/core/platform/manifest/custom-objects/conditions.d.ts +0 -240
  50. package/core/platform/manifest/custom-objects/conditions.d.ts.map +0 -1
  51. package/core/platform/manifest/custom-objects/conditions.js +0 -326
  52. package/core/platform/manifest/custom-objects/conditions.js.map +0 -1
  53. package/core/platform/manifest/custom-objects/conditions.mjs +0 -321
  54. package/core/platform/manifest/custom-objects/conditions.mjs.map +0 -1
  55. package/core/platform/manifest/custom-objects/existing.d.mts +0 -87
  56. package/core/platform/manifest/custom-objects/existing.d.mts.map +0 -1
  57. package/core/platform/manifest/custom-objects/existing.d.ts +0 -87
  58. package/core/platform/manifest/custom-objects/existing.d.ts.map +0 -1
  59. package/core/platform/manifest/custom-objects/existing.js +0 -113
  60. package/core/platform/manifest/custom-objects/existing.js.map +0 -1
  61. package/core/platform/manifest/custom-objects/existing.mjs +0 -109
  62. package/core/platform/manifest/custom-objects/existing.mjs.map +0 -1
  63. package/core/platform/manifest/custom-objects/field-resolution.d.mts +0 -48
  64. package/core/platform/manifest/custom-objects/field-resolution.d.mts.map +0 -1
  65. package/core/platform/manifest/custom-objects/field-resolution.d.ts +0 -48
  66. package/core/platform/manifest/custom-objects/field-resolution.d.ts.map +0 -1
  67. package/core/platform/manifest/custom-objects/field-resolution.js +0 -61
  68. package/core/platform/manifest/custom-objects/field-resolution.js.map +0 -1
  69. package/core/platform/manifest/custom-objects/field-resolution.mjs +0 -58
  70. package/core/platform/manifest/custom-objects/field-resolution.mjs.map +0 -1
  71. package/core/platform/manifest/custom-objects/function-file.d.mts +0 -87
  72. package/core/platform/manifest/custom-objects/function-file.d.mts.map +0 -1
  73. package/core/platform/manifest/custom-objects/function-file.d.ts +0 -87
  74. package/core/platform/manifest/custom-objects/function-file.d.ts.map +0 -1
  75. package/core/platform/manifest/custom-objects/function-file.js +0 -76
  76. package/core/platform/manifest/custom-objects/function-file.js.map +0 -1
  77. package/core/platform/manifest/custom-objects/function-file.mjs +0 -69
  78. package/core/platform/manifest/custom-objects/function-file.mjs.map +0 -1
  79. package/core/platform/manifest/custom-objects/list-view.d.mts +0 -65
  80. package/core/platform/manifest/custom-objects/list-view.d.mts.map +0 -1
  81. package/core/platform/manifest/custom-objects/list-view.d.ts +0 -65
  82. package/core/platform/manifest/custom-objects/list-view.d.ts.map +0 -1
  83. package/core/platform/manifest/custom-objects/list-view.js +0 -33
  84. package/core/platform/manifest/custom-objects/list-view.js.map +0 -1
  85. package/core/platform/manifest/custom-objects/list-view.mjs +0 -30
  86. package/core/platform/manifest/custom-objects/list-view.mjs.map +0 -1
  87. package/core/platform/manifest/custom-objects/object-list-page.d.mts +0 -43
  88. package/core/platform/manifest/custom-objects/object-list-page.d.mts.map +0 -1
  89. package/core/platform/manifest/custom-objects/object-list-page.d.ts +0 -43
  90. package/core/platform/manifest/custom-objects/object-list-page.d.ts.map +0 -1
  91. package/core/platform/manifest/custom-objects/object-list-page.js +0 -54
  92. package/core/platform/manifest/custom-objects/object-list-page.js.map +0 -1
  93. package/core/platform/manifest/custom-objects/object-list-page.mjs +0 -50
  94. package/core/platform/manifest/custom-objects/object-list-page.mjs.map +0 -1
  95. package/core/platform/manifest/custom-objects/page-layout.d.mts +0 -142
  96. package/core/platform/manifest/custom-objects/page-layout.d.mts.map +0 -1
  97. package/core/platform/manifest/custom-objects/page-layout.d.ts +0 -142
  98. package/core/platform/manifest/custom-objects/page-layout.d.ts.map +0 -1
  99. package/core/platform/manifest/custom-objects/page-layout.js +0 -184
  100. package/core/platform/manifest/custom-objects/page-layout.js.map +0 -1
  101. package/core/platform/manifest/custom-objects/page-layout.mjs +0 -180
  102. package/core/platform/manifest/custom-objects/page-layout.mjs.map +0 -1
  103. package/core/platform/manifest/custom-objects/register.d.mts +0 -87
  104. package/core/platform/manifest/custom-objects/register.d.mts.map +0 -1
  105. package/core/platform/manifest/custom-objects/register.d.ts +0 -87
  106. package/core/platform/manifest/custom-objects/register.d.ts.map +0 -1
  107. package/core/platform/manifest/custom-objects/register.js +0 -395
  108. package/core/platform/manifest/custom-objects/register.js.map +0 -1
  109. package/core/platform/manifest/custom-objects/register.mjs +0 -391
  110. package/core/platform/manifest/custom-objects/register.mjs.map +0 -1
  111. package/core/platform/manifest/custom-objects/rule.d.mts +0 -113
  112. package/core/platform/manifest/custom-objects/rule.d.mts.map +0 -1
  113. package/core/platform/manifest/custom-objects/rule.d.ts +0 -113
  114. package/core/platform/manifest/custom-objects/rule.d.ts.map +0 -1
  115. package/core/platform/manifest/custom-objects/rule.js +0 -49
  116. package/core/platform/manifest/custom-objects/rule.js.map +0 -1
  117. package/core/platform/manifest/custom-objects/rule.mjs +0 -45
  118. package/core/platform/manifest/custom-objects/rule.mjs.map +0 -1
  119. package/core/platform/manifest/custom-objects/sdui-page.d.mts +0 -214
  120. package/core/platform/manifest/custom-objects/sdui-page.d.mts.map +0 -1
  121. package/core/platform/manifest/custom-objects/sdui-page.d.ts +0 -214
  122. package/core/platform/manifest/custom-objects/sdui-page.d.ts.map +0 -1
  123. package/core/platform/manifest/custom-objects/sdui-page.js +0 -194
  124. package/core/platform/manifest/custom-objects/sdui-page.js.map +0 -1
  125. package/core/platform/manifest/custom-objects/sdui-page.mjs +0 -182
  126. package/core/platform/manifest/custom-objects/sdui-page.mjs.map +0 -1
  127. package/core/platform/manifest/custom-objects/typed-condition.d.mts +0 -28
  128. package/core/platform/manifest/custom-objects/typed-condition.d.mts.map +0 -1
  129. package/core/platform/manifest/custom-objects/typed-condition.d.ts +0 -28
  130. package/core/platform/manifest/custom-objects/typed-condition.d.ts.map +0 -1
  131. package/core/platform/manifest/custom-objects/typed-condition.js +0 -434
  132. package/core/platform/manifest/custom-objects/typed-condition.js.map +0 -1
  133. package/core/platform/manifest/custom-objects/typed-condition.mjs +0 -431
  134. package/core/platform/manifest/custom-objects/typed-condition.mjs.map +0 -1
  135. package/core/platform/manifest/custom-objects/types.d.mts +0 -29
  136. package/core/platform/manifest/custom-objects/types.d.mts.map +0 -1
  137. package/core/platform/manifest/custom-objects/types.d.ts +0 -29
  138. package/core/platform/manifest/custom-objects/types.d.ts.map +0 -1
  139. package/core/platform/manifest/custom-objects/types.js +0 -3
  140. package/core/platform/manifest/custom-objects/types.js.map +0 -1
  141. package/core/platform/manifest/custom-objects/types.mjs +0 -2
  142. package/core/platform/manifest/custom-objects/types.mjs.map +0 -1
  143. package/core/platform/manifest/custom-objects/validation.d.mts +0 -44
  144. package/core/platform/manifest/custom-objects/validation.d.mts.map +0 -1
  145. package/core/platform/manifest/custom-objects/validation.d.ts +0 -44
  146. package/core/platform/manifest/custom-objects/validation.d.ts.map +0 -1
  147. package/core/platform/manifest/custom-objects/validation.js +0 -30
  148. package/core/platform/manifest/custom-objects/validation.js.map +0 -1
  149. package/core/platform/manifest/custom-objects/validation.mjs +0 -27
  150. package/core/platform/manifest/custom-objects/validation.mjs.map +0 -1
  151. package/core/platform/manifest/custom-objects/workflow.d.mts +0 -47
  152. package/core/platform/manifest/custom-objects/workflow.d.mts.map +0 -1
  153. package/core/platform/manifest/custom-objects/workflow.d.ts +0 -47
  154. package/core/platform/manifest/custom-objects/workflow.d.ts.map +0 -1
  155. package/core/platform/manifest/custom-objects/workflow.js +0 -38
  156. package/core/platform/manifest/custom-objects/workflow.js.map +0 -1
  157. package/core/platform/manifest/custom-objects/workflow.mjs +0 -34
  158. package/core/platform/manifest/custom-objects/workflow.mjs.map +0 -1
  159. package/core/platform/manifest/custom-objects.d.mts +0 -85
  160. package/core/platform/manifest/custom-objects.d.mts.map +0 -1
  161. package/core/platform/manifest/custom-objects.d.ts +0 -85
  162. package/core/platform/manifest/custom-objects.d.ts.map +0 -1
  163. package/core/platform/manifest/custom-objects.js +0 -84
  164. package/core/platform/manifest/custom-objects.js.map +0 -1
  165. package/core/platform/manifest/custom-objects.mjs +0 -55
  166. package/core/platform/manifest/custom-objects.mjs.map +0 -1
  167. package/examples/manifest/custom-object-creation-workflow/functions/intake-request-created.ts +0 -20
  168. package/examples/manifest/custom-object-creation-workflow/schema.ts +0 -29
  169. package/examples/manifest/dental-practice-management/schema.ts +0 -298
  170. package/examples/manifest/field-service-dispatch/schema.ts +0 -248
  171. package/examples/manifest/grant-program-management/schema.ts +0 -269
  172. package/examples/manifest/gym-membership-management/schema.ts +0 -266
  173. package/examples/manifest/procurement-approval-hub/functions/route-purchase-request.ts +0 -20
  174. package/examples/manifest/procurement-approval-hub/schema.ts +0 -256
  175. package/examples/manifest/simple-todo-app/schema.ts +0 -60
  176. package/examples/manifest/todo-app-without-object-list-view/schema.ts +0 -28
  177. package/src/core/platform/README.md +0 -20
  178. package/src/core/platform/manifest/README.md +0 -26
  179. package/src/core/platform/manifest/custom-objects/action.ts +0 -87
  180. package/src/core/platform/manifest/custom-objects/conditions.ts +0 -762
  181. package/src/core/platform/manifest/custom-objects/existing.ts +0 -221
  182. package/src/core/platform/manifest/custom-objects/field-resolution.ts +0 -116
  183. package/src/core/platform/manifest/custom-objects/function-file.ts +0 -149
  184. package/src/core/platform/manifest/custom-objects/list-view.ts +0 -95
  185. package/src/core/platform/manifest/custom-objects/object-list-page.ts +0 -87
  186. package/src/core/platform/manifest/custom-objects/page-layout.ts +0 -380
  187. package/src/core/platform/manifest/custom-objects/register.ts +0 -555
  188. package/src/core/platform/manifest/custom-objects/rule.ts +0 -192
  189. package/src/core/platform/manifest/custom-objects/sdui-page.ts +0 -515
  190. package/src/core/platform/manifest/custom-objects/typed-condition.ts +0 -617
  191. package/src/core/platform/manifest/custom-objects/types.ts +0 -92
  192. package/src/core/platform/manifest/custom-objects/validation.ts +0 -70
  193. package/src/core/platform/manifest/custom-objects/workflow.ts +0 -71
  194. package/src/core/platform/manifest/custom-objects.ts +0 -203
  195. package/src/pebble-sdui-web-custom-apps-shim.d.ts +0 -3
@@ -1,142 +0,0 @@
1
- import { CustomObjectPageLayout, type CustomObjectFieldSection, type CustomObjectPageLayoutProps, type CustomTab, type FieldsSection, type PageLayoutSection, type SectionField, type SystemSectionEdit, type SystemTabEdit, type TabEdits, type TabWithSections } from "../../../../lib/manifest.mjs";
2
- import type { AnyCustomObjectDefinition } from "../../custom-objects/types.mjs";
3
- import type { ManifestRegistration } from "./types.mjs";
4
- import type { TypedManifestFieldInput } from "./field-resolution.mjs";
5
- /**
6
- * Field object accepted inside typed page-layout field arrays.
7
- *
8
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
9
- */
10
- export interface TypedSectionField<TDefinition extends AnyCustomObjectDefinition> extends Omit<SectionField, 'field'> {
11
- /** Field to display, expressed as a typed field-name string or manifest field reference. */
12
- readonly field: TypedManifestFieldInput<TDefinition>;
13
- }
14
- /**
15
- * Field-array entry accepted by typed page-layout helpers.
16
- *
17
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
18
- */
19
- export type TypedSectionFieldInput<TDefinition extends AnyCustomObjectDefinition> = TypedManifestFieldInput<TDefinition> | TypedSectionField<TDefinition>;
20
- /**
21
- * `fields_section` shape accepted by the typed page-layout helper.
22
- *
23
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
24
- */
25
- export interface TypedFieldsSection<TDefinition extends AnyCustomObjectDefinition> extends Omit<FieldsSection, 'fields'> {
26
- /** Fields to display in this section, expressed using typed field-name strings or manifest field refs. */
27
- readonly fields: readonly TypedSectionFieldInput<TDefinition>[];
28
- }
29
- /**
30
- * Page-layout section shape accepted by the typed page-layout helper.
31
- *
32
- * Only `fields_section.fields` is specialized in this first pass; other section
33
- * variants continue to use the low-level manifest shapes unchanged.
34
- *
35
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
36
- */
37
- export type TypedPageLayoutSection<TDefinition extends AnyCustomObjectDefinition> = TypedFieldsSection<TDefinition> | Exclude<PageLayoutSection, FieldsSection>;
38
- /**
39
- * Tab-with-sections shape accepted by the typed page-layout helper.
40
- *
41
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
42
- */
43
- export interface TypedTabWithSections<TDefinition extends AnyCustomObjectDefinition> extends Omit<TabWithSections, 'sections'> {
44
- /** Sections inside this tab. */
45
- readonly sections: readonly TypedPageLayoutSection<TDefinition>[];
46
- }
47
- /**
48
- * Tab shape accepted by the typed page-layout helper.
49
- *
50
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
51
- */
52
- export type TypedPageLayoutTab<TDefinition extends AnyCustomObjectDefinition> = TypedTabWithSections<TDefinition> | CustomTab;
53
- /**
54
- * System-section edit shape accepted by the typed page-layout helper.
55
- *
56
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
57
- */
58
- export interface TypedSystemSectionEdit<TDefinition extends AnyCustomObjectDefinition> extends Omit<SystemSectionEdit, 'newFields'> {
59
- /** Fields to append to the target system section. */
60
- readonly newFields?: readonly TypedSectionFieldInput<TDefinition>[];
61
- }
62
- /**
63
- * System-tab edit shape accepted by the typed page-layout helper.
64
- *
65
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
66
- */
67
- export interface TypedSystemTabEdit<TDefinition extends AnyCustomObjectDefinition> extends Omit<SystemTabEdit, 'newSections' | 'systemSectionEdits'> {
68
- /** New sections to add to the target system tab. */
69
- readonly newSections?: readonly TypedPageLayoutSection<TDefinition>[];
70
- /** Edits to built-in sections inside the target system tab. */
71
- readonly systemSectionEdits?: Readonly<Record<string, TypedSystemSectionEdit<TDefinition>>>;
72
- }
73
- /**
74
- * `tabEdits` shape accepted by the typed page-layout helper.
75
- *
76
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
77
- */
78
- export interface TypedTabEdits<TDefinition extends AnyCustomObjectDefinition> extends Omit<TabEdits, 'newTabs' | 'systemTabEdits'> {
79
- /** New tabs to add to the layout. */
80
- readonly newTabs?: readonly TypedPageLayoutTab<TDefinition>[];
81
- /** Edits to existing system tabs. */
82
- readonly systemTabEdits?: Readonly<Record<string, TypedSystemTabEdit<TDefinition>>>;
83
- }
84
- /**
85
- * Initialization properties for {@link defineTypedPageLayout}.
86
- *
87
- * This first pass focuses on the common field-array surfaces:
88
- * - `tabEdits.newTabs[].sections[].fields`
89
- * - `tabEdits.systemTabEdits.*.newSections[].fields`
90
- * - `tabEdits.systemTabEdits.*.systemSectionEdits.*.newFields`
91
- *
92
- * Other page-layout configuration remains identical to the low-level manifest API.
93
- *
94
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
95
- */
96
- export interface TypedCustomObjectPageLayoutProps<TDefinition extends AnyCustomObjectDefinition> extends Omit<CustomObjectPageLayoutProps, 'tabEdits'> {
97
- /** Typed page-layout tab edits. */
98
- readonly tabEdits?: TypedTabEdits<TDefinition>;
99
- }
100
- /**
101
- * Initialization properties for {@link defineBasicTypedPageLayout}.
102
- *
103
- * This is the typed equivalent of {@link CustomObjectPageLayout.basic}: a
104
- * single-tab, single-section layout for the common case where callers do not
105
- * need to customize tab structure.
106
- *
107
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
108
- */
109
- export interface TypedBasicPageLayoutProps<TDefinition extends AnyCustomObjectDefinition> {
110
- /** Optional existing manifest section that should own every listed field. */
111
- readonly section?: CustomObjectFieldSection;
112
- /** Optional fields to place in the generated General section. */
113
- readonly fields?: readonly TypedManifestFieldInput<TDefinition>[];
114
- }
115
- /**
116
- * Registers a typed page layout for a manifest custom object.
117
- *
118
- * This helper sits on top of the low-level {@link CustomObjectPageLayout}
119
- * manifest class. It preserves the runtime behavior of that class while adding
120
- * object-specific string-literal IntelliSense for the most common field-array
121
- * authoring surfaces.
122
- *
123
- * @param registration - Manifest registration produced from the typed object definition.
124
- * @param props - Typed page-layout properties to materialize into the manifest class.
125
- * @returns Low-level manifest page-layout instance with typed field arrays resolved.
126
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
127
- */
128
- export declare function defineTypedPageLayout<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, props: TypedCustomObjectPageLayoutProps<TDefinition>): CustomObjectPageLayout;
129
- /**
130
- * Registers the common single-tab "basic" layout using typed field-name strings.
131
- *
132
- * Use this helper when the low-level {@link CustomObjectPageLayout.basic}
133
- * behavior is sufficient and you want the shortest typed path from schema to a
134
- * working page layout.
135
- *
136
- * @param registration - Manifest registration produced from the typed object definition.
137
- * @param props - Optional basic-layout properties.
138
- * @returns Low-level manifest page-layout instance created through `CustomObjectPageLayout.basic(...)`.
139
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
140
- */
141
- export declare function defineBasicTypedPageLayout<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, props?: TypedBasicPageLayoutProps<TDefinition>): CustomObjectPageLayout;
142
- //# sourceMappingURL=page-layout.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-layout.d.mts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/page-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAA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WAAW,CAAC,CAAC;CAChD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB,CAAC,WAAW,SAAS,yBAAyB;IACtF,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAC;IAC5C,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,uBAAuB,CAAC,WAAW,CAAC,EAAE,CAAC;CACnE;AAgLD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,SAAS,yBAAyB,EACjF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,EAAE,gCAAgC,CAAC,WAAW,CAAC,GACnD,sBAAsB,CAWxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,SAAS,yBAAyB,EACtF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,GAAE,yBAAyB,CAAC,WAAW,CAAM,GACjD,sBAAsB,CAOxB"}
@@ -1,142 +0,0 @@
1
- import { CustomObjectPageLayout, type CustomObjectFieldSection, type CustomObjectPageLayoutProps, type CustomTab, type FieldsSection, type PageLayoutSection, type SectionField, type SystemSectionEdit, type SystemTabEdit, type TabEdits, type TabWithSections } from "../../../../lib/manifest.js";
2
- import type { AnyCustomObjectDefinition } from "../../custom-objects/types.js";
3
- import type { ManifestRegistration } from "./types.js";
4
- import type { TypedManifestFieldInput } from "./field-resolution.js";
5
- /**
6
- * Field object accepted inside typed page-layout field arrays.
7
- *
8
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
9
- */
10
- export interface TypedSectionField<TDefinition extends AnyCustomObjectDefinition> extends Omit<SectionField, 'field'> {
11
- /** Field to display, expressed as a typed field-name string or manifest field reference. */
12
- readonly field: TypedManifestFieldInput<TDefinition>;
13
- }
14
- /**
15
- * Field-array entry accepted by typed page-layout helpers.
16
- *
17
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
18
- */
19
- export type TypedSectionFieldInput<TDefinition extends AnyCustomObjectDefinition> = TypedManifestFieldInput<TDefinition> | TypedSectionField<TDefinition>;
20
- /**
21
- * `fields_section` shape accepted by the typed page-layout helper.
22
- *
23
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
24
- */
25
- export interface TypedFieldsSection<TDefinition extends AnyCustomObjectDefinition> extends Omit<FieldsSection, 'fields'> {
26
- /** Fields to display in this section, expressed using typed field-name strings or manifest field refs. */
27
- readonly fields: readonly TypedSectionFieldInput<TDefinition>[];
28
- }
29
- /**
30
- * Page-layout section shape accepted by the typed page-layout helper.
31
- *
32
- * Only `fields_section.fields` is specialized in this first pass; other section
33
- * variants continue to use the low-level manifest shapes unchanged.
34
- *
35
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
36
- */
37
- export type TypedPageLayoutSection<TDefinition extends AnyCustomObjectDefinition> = TypedFieldsSection<TDefinition> | Exclude<PageLayoutSection, FieldsSection>;
38
- /**
39
- * Tab-with-sections shape accepted by the typed page-layout helper.
40
- *
41
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
42
- */
43
- export interface TypedTabWithSections<TDefinition extends AnyCustomObjectDefinition> extends Omit<TabWithSections, 'sections'> {
44
- /** Sections inside this tab. */
45
- readonly sections: readonly TypedPageLayoutSection<TDefinition>[];
46
- }
47
- /**
48
- * Tab shape accepted by the typed page-layout helper.
49
- *
50
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
51
- */
52
- export type TypedPageLayoutTab<TDefinition extends AnyCustomObjectDefinition> = TypedTabWithSections<TDefinition> | CustomTab;
53
- /**
54
- * System-section edit shape accepted by the typed page-layout helper.
55
- *
56
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
57
- */
58
- export interface TypedSystemSectionEdit<TDefinition extends AnyCustomObjectDefinition> extends Omit<SystemSectionEdit, 'newFields'> {
59
- /** Fields to append to the target system section. */
60
- readonly newFields?: readonly TypedSectionFieldInput<TDefinition>[];
61
- }
62
- /**
63
- * System-tab edit shape accepted by the typed page-layout helper.
64
- *
65
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
66
- */
67
- export interface TypedSystemTabEdit<TDefinition extends AnyCustomObjectDefinition> extends Omit<SystemTabEdit, 'newSections' | 'systemSectionEdits'> {
68
- /** New sections to add to the target system tab. */
69
- readonly newSections?: readonly TypedPageLayoutSection<TDefinition>[];
70
- /** Edits to built-in sections inside the target system tab. */
71
- readonly systemSectionEdits?: Readonly<Record<string, TypedSystemSectionEdit<TDefinition>>>;
72
- }
73
- /**
74
- * `tabEdits` shape accepted by the typed page-layout helper.
75
- *
76
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
77
- */
78
- export interface TypedTabEdits<TDefinition extends AnyCustomObjectDefinition> extends Omit<TabEdits, 'newTabs' | 'systemTabEdits'> {
79
- /** New tabs to add to the layout. */
80
- readonly newTabs?: readonly TypedPageLayoutTab<TDefinition>[];
81
- /** Edits to existing system tabs. */
82
- readonly systemTabEdits?: Readonly<Record<string, TypedSystemTabEdit<TDefinition>>>;
83
- }
84
- /**
85
- * Initialization properties for {@link defineTypedPageLayout}.
86
- *
87
- * This first pass focuses on the common field-array surfaces:
88
- * - `tabEdits.newTabs[].sections[].fields`
89
- * - `tabEdits.systemTabEdits.*.newSections[].fields`
90
- * - `tabEdits.systemTabEdits.*.systemSectionEdits.*.newFields`
91
- *
92
- * Other page-layout configuration remains identical to the low-level manifest API.
93
- *
94
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
95
- */
96
- export interface TypedCustomObjectPageLayoutProps<TDefinition extends AnyCustomObjectDefinition> extends Omit<CustomObjectPageLayoutProps, 'tabEdits'> {
97
- /** Typed page-layout tab edits. */
98
- readonly tabEdits?: TypedTabEdits<TDefinition>;
99
- }
100
- /**
101
- * Initialization properties for {@link defineBasicTypedPageLayout}.
102
- *
103
- * This is the typed equivalent of {@link CustomObjectPageLayout.basic}: a
104
- * single-tab, single-section layout for the common case where callers do not
105
- * need to customize tab structure.
106
- *
107
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
108
- */
109
- export interface TypedBasicPageLayoutProps<TDefinition extends AnyCustomObjectDefinition> {
110
- /** Optional existing manifest section that should own every listed field. */
111
- readonly section?: CustomObjectFieldSection;
112
- /** Optional fields to place in the generated General section. */
113
- readonly fields?: readonly TypedManifestFieldInput<TDefinition>[];
114
- }
115
- /**
116
- * Registers a typed page layout for a manifest custom object.
117
- *
118
- * This helper sits on top of the low-level {@link CustomObjectPageLayout}
119
- * manifest class. It preserves the runtime behavior of that class while adding
120
- * object-specific string-literal IntelliSense for the most common field-array
121
- * authoring surfaces.
122
- *
123
- * @param registration - Manifest registration produced from the typed object definition.
124
- * @param props - Typed page-layout properties to materialize into the manifest class.
125
- * @returns Low-level manifest page-layout instance with typed field arrays resolved.
126
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
127
- */
128
- export declare function defineTypedPageLayout<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, props: TypedCustomObjectPageLayoutProps<TDefinition>): CustomObjectPageLayout;
129
- /**
130
- * Registers the common single-tab "basic" layout using typed field-name strings.
131
- *
132
- * Use this helper when the low-level {@link CustomObjectPageLayout.basic}
133
- * behavior is sufficient and you want the shortest typed path from schema to a
134
- * working page layout.
135
- *
136
- * @param registration - Manifest registration produced from the typed object definition.
137
- * @param props - Optional basic-layout properties.
138
- * @returns Low-level manifest page-layout instance created through `CustomObjectPageLayout.basic(...)`.
139
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
140
- */
141
- export declare function defineBasicTypedPageLayout<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, props?: TypedBasicPageLayoutProps<TDefinition>): CustomObjectPageLayout;
142
- //# sourceMappingURL=page-layout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-layout.d.ts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/page-layout.ts"],"names":[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B,CAC7F,SAAQ,IAAI,CAAC,2BAA2B,EAAE,UAAU,CAAC;IACrD,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CAChD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB,CAAC,WAAW,SAAS,yBAAyB;IACtF,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAC;IAC5C,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,uBAAuB,CAAC,WAAW,CAAC,EAAE,CAAC;CACnE;AAgLD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,SAAS,yBAAyB,EACjF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,EAAE,gCAAgC,CAAC,WAAW,CAAC,GACnD,sBAAsB,CAWxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,SAAS,yBAAyB,EACtF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,GAAE,yBAAyB,CAAC,WAAW,CAAM,GACjD,sBAAsB,CAOxB"}
@@ -1,184 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineTypedPageLayout = defineTypedPageLayout;
4
- exports.defineBasicTypedPageLayout = defineBasicTypedPageLayout;
5
- const manifest_1 = require("../../../../lib/manifest.js");
6
- const field_resolution_1 = require("./field-resolution.js");
7
- /**
8
- * Returns whether one typed page-layout field entry uses the object form with additional section metadata.
9
- *
10
- * @param value - Typed section-field input to inspect.
11
- * @returns Whether the entry is the object-shaped variant.
12
- * @typeParam TDefinition - Object definition whose field inputs are being inspected.
13
- */
14
- function isTypedSectionField(value) {
15
- return typeof value === 'object' && value != null && 'field' in value;
16
- }
17
- /**
18
- * Resolves one typed page-layout field input into the low-level manifest field representation.
19
- *
20
- * @param registration - Manifest registration produced from the typed object definition.
21
- * @param entry - Typed page-layout field input to resolve.
22
- * @returns Low-level manifest section-field input.
23
- * @typeParam TDefinition - Object definition whose field inputs are being resolved.
24
- */
25
- function resolveTypedSectionFieldInput(registration, entry) {
26
- if (isTypedSectionField(entry)) {
27
- return {
28
- ...entry,
29
- field: (0, field_resolution_1.resolveTypedManifestField)(registration, entry.field),
30
- };
31
- }
32
- return (0, field_resolution_1.resolveTypedManifestField)(registration, entry);
33
- }
34
- /**
35
- * Returns whether one page-layout section is the `fields_section` variant handled by the typed helper.
36
- *
37
- * @param section - Typed page-layout section to inspect.
38
- * @returns Whether the section carries a typed `fields` array.
39
- * @typeParam TDefinition - Object definition whose section is being inspected.
40
- */
41
- function isFieldsSection(section) {
42
- return section.type === 'fields_section';
43
- }
44
- /**
45
- * Resolves one typed page-layout section into the low-level manifest section shape.
46
- *
47
- * @param registration - Manifest registration produced from the typed object definition.
48
- * @param section - Typed page-layout section to resolve.
49
- * @returns Low-level manifest page-layout section.
50
- * @typeParam TDefinition - Object definition whose section is being resolved.
51
- */
52
- function resolveTypedPageLayoutSection(registration, section) {
53
- if (!isFieldsSection(section)) {
54
- return section;
55
- }
56
- const { fields, ...rest } = section;
57
- return {
58
- ...rest,
59
- fields: fields.map((entry) => resolveTypedSectionFieldInput(registration, entry)),
60
- };
61
- }
62
- /**
63
- * Resolves one typed page-layout tab into the low-level manifest tab shape.
64
- *
65
- * @param registration - Manifest registration produced from the typed object definition.
66
- * @param tab - Typed page-layout tab to resolve.
67
- * @returns Low-level manifest page-layout tab.
68
- * @typeParam TDefinition - Object definition whose tab is being resolved.
69
- */
70
- function resolveTypedPageLayoutTab(registration, tab) {
71
- if (tab.type !== 'tab_with_sections')
72
- return tab;
73
- return {
74
- ...tab,
75
- sections: tab.sections.map((section) => resolveTypedPageLayoutSection(registration, section)),
76
- };
77
- }
78
- /**
79
- * Resolves one typed system-section edit into the low-level manifest edit shape.
80
- *
81
- * @param registration - Manifest registration produced from the typed object definition.
82
- * @param edit - Typed system-section edit to resolve.
83
- * @returns Low-level manifest system-section edit.
84
- * @typeParam TDefinition - Object definition whose edit is being resolved.
85
- */
86
- function resolveTypedSystemSectionEdit(registration, edit) {
87
- const { newFields, ...rest } = edit;
88
- return {
89
- ...rest,
90
- ...(newFields != null ?
91
- { newFields: newFields.map((entry) => resolveTypedSectionFieldInput(registration, entry)) }
92
- : {}),
93
- };
94
- }
95
- /**
96
- * Resolves one typed system-tab edit into the low-level manifest edit shape.
97
- *
98
- * @param registration - Manifest registration produced from the typed object definition.
99
- * @param edit - Typed system-tab edit to resolve.
100
- * @returns Low-level manifest system-tab edit.
101
- * @typeParam TDefinition - Object definition whose edit is being resolved.
102
- */
103
- function resolveTypedSystemTabEdit(registration, edit) {
104
- const { newSections, systemSectionEdits: rawSystemSectionEdits, ...rest } = edit;
105
- const systemSectionEdits = rawSystemSectionEdits == null ? undefined : (Object.fromEntries(Object.entries(rawSystemSectionEdits).map(([sectionKey, sectionEdit]) => [
106
- sectionKey,
107
- resolveTypedSystemSectionEdit(registration, sectionEdit),
108
- ])));
109
- return {
110
- ...rest,
111
- ...(newSections != null ?
112
- { newSections: newSections.map((section) => resolveTypedPageLayoutSection(registration, section)) }
113
- : {}),
114
- ...(systemSectionEdits != null ? { systemSectionEdits } : {}),
115
- };
116
- }
117
- /**
118
- * Resolves the typed `tabEdits` surface into the low-level manifest representation.
119
- *
120
- * @param registration - Manifest registration produced from the typed object definition.
121
- * @param tabEdits - Typed tab edits to resolve.
122
- * @returns Low-level manifest tab-edits object.
123
- * @typeParam TDefinition - Object definition whose tab edits are being resolved.
124
- */
125
- function resolveTypedTabEdits(registration, tabEdits) {
126
- const { newTabs, systemTabEdits: rawSystemTabEdits, ...rest } = tabEdits;
127
- const systemTabEdits = rawSystemTabEdits == null ? undefined : (Object.fromEntries(Object.entries(rawSystemTabEdits).map(([tabKey, edit]) => [
128
- tabKey,
129
- resolveTypedSystemTabEdit(registration, edit),
130
- ])));
131
- return {
132
- ...rest,
133
- ...(newTabs != null ?
134
- { newTabs: newTabs.map((tab) => resolveTypedPageLayoutTab(registration, tab)) }
135
- : {}),
136
- ...(systemTabEdits != null ? { systemTabEdits } : {}),
137
- };
138
- }
139
- /**
140
- * Registers a typed page layout for a manifest custom object.
141
- *
142
- * This helper sits on top of the low-level {@link CustomObjectPageLayout}
143
- * manifest class. It preserves the runtime behavior of that class while adding
144
- * object-specific string-literal IntelliSense for the most common field-array
145
- * authoring surfaces.
146
- *
147
- * @param registration - Manifest registration produced from the typed object definition.
148
- * @param props - Typed page-layout properties to materialize into the manifest class.
149
- * @returns Low-level manifest page-layout instance with typed field arrays resolved.
150
- * @typeParam TDefinition - Object definition whose valid field arrays should be enforced.
151
- */
152
- function defineTypedPageLayout(registration, props) {
153
- const layoutProps = {
154
- apiName: props.apiName,
155
- name: props.name,
156
- ...(props.tabEdits != null ? { tabEdits: resolveTypedTabEdits(registration, props.tabEdits) } : {}),
157
- ...(props.headerEdits != null ? { headerEdits: props.headerEdits } : {}),
158
- ...(props.visibilityConditions != null ? { visibilityConditions: props.visibilityConditions } : {}),
159
- ...(props.layoutId != null ? { layoutId: props.layoutId } : {}),
160
- ...(props.blueprintKey != null ? { blueprintKey: props.blueprintKey } : {}),
161
- };
162
- return new manifest_1.CustomObjectPageLayout(registration.object, layoutProps);
163
- }
164
- /**
165
- * Registers the common single-tab "basic" layout using typed field-name strings.
166
- *
167
- * Use this helper when the low-level {@link CustomObjectPageLayout.basic}
168
- * behavior is sufficient and you want the shortest typed path from schema to a
169
- * working page layout.
170
- *
171
- * @param registration - Manifest registration produced from the typed object definition.
172
- * @param props - Optional basic-layout properties.
173
- * @returns Low-level manifest page-layout instance created through `CustomObjectPageLayout.basic(...)`.
174
- * @typeParam TDefinition - Object definition whose valid field inputs should be enforced.
175
- */
176
- function defineBasicTypedPageLayout(registration, props = {}) {
177
- return manifest_1.CustomObjectPageLayout.basic(registration.object, {
178
- ...(props.section != null ? { section: props.section } : {}),
179
- ...(props.fields != null ?
180
- { fields: props.fields.map((field) => (0, field_resolution_1.resolveTypedManifestField)(registration, field)) }
181
- : {}),
182
- });
183
- }
184
- //# sourceMappingURL=page-layout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-layout.js","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/page-layout.ts"],"names":[],"mappings":";;AAqVA,sDAcC;AAcD,gEAUC;AA3XD,0DAckC;AAIlC,4DAA+D;AAwI/D;;;;;;GAMG;AACH,SAAS,mBAAmB,CAC1B,KAA0C;IAE1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC;AACxE,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,6BAA6B,CACpC,YAA+C,EAC/C,KAA0C;IAE1C,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO;YACL,GAAG,KAAK;YACR,KAAK,EAAE,IAAA,4CAAyB,EAAC,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC;SAC5D,CAAC;IACJ,CAAC;IACD,OAAO,IAAA,4CAAyB,EAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CACtB,OAA4C;IAE5C,OAAO,OAAO,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAC3C,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,6BAA6B,CACpC,YAA+C,EAC/C,OAA4C;IAE5C,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,OAAO,OAA4B,CAAC;IACtC,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACpC,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,6BAA6B,CAAC,YAAY,EAAE,KAAK,CAAC,CA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