@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,33 +1,28 @@
1
- import {
1
+ import RipplingSDK, {
2
2
  DetailViewActionFunctionEvent,
3
3
  FunctionContext,
4
4
  FunctionResponse,
5
5
  ListViewActionFunctionEvent,
6
6
  } from '@rippling/rippling-sdk';
7
- import { createCustomObjectFunctionRuntime } from '@rippling/rippling-sdk/core/platform/custom-objects';
8
- import { todoDefinition } from '../schema';
9
7
 
8
+ const TODO_OBJECT_API_NAME = 'simple_todo__c';
10
9
  const ACTION_BUTTON = 'Mark done';
11
10
 
12
11
  type DetailEvent = DetailViewActionFunctionEvent<
13
12
  {},
14
- typeof todoDefinition.apiName,
13
+ typeof TODO_OBJECT_API_NAME,
15
14
  typeof ACTION_BUTTON,
16
15
  'layout_simple_todo'
17
16
  >;
18
17
 
19
- type ListEvent = ListViewActionFunctionEvent<{}, typeof todoDefinition.apiName, typeof ACTION_BUTTON>;
18
+ type ListEvent = ListViewActionFunctionEvent<{}, typeof TODO_OBJECT_API_NAME, typeof ACTION_BUTTON>;
20
19
 
21
- export type Input = DetailEvent | ListEvent;
22
-
23
- export type Output = {
24
- updatedRecordIds: string[];
25
- };
20
+ type MarkDoneEvent = DetailEvent | ListEvent;
26
21
 
27
22
  export async function onRipplingEvent(
28
- event: Input,
23
+ event: MarkDoneEvent,
29
24
  context: FunctionContext,
30
- ): Promise<FunctionResponse<Output>> {
25
+ ): Promise<FunctionResponse<{ updatedRecordIds: string[] }>> {
31
26
  const recordIds = event.trigger_type === 'record view' ? [event.record_id] : event.record_ids;
32
27
  if (recordIds.length === 0) {
33
28
  return new FunctionResponse({
@@ -36,12 +31,13 @@ export async function onRipplingEvent(
36
31
  });
37
32
  }
38
33
 
39
- const runtime = createCustomObjectFunctionRuntime(context);
40
- const manager = runtime.for(todoDefinition);
34
+ const client = new RipplingSDK({
35
+ bearerToken: context.env.rippling_user_bearer_token,
36
+ });
41
37
 
42
38
  for (const recordId of recordIds) {
43
- await manager.update(recordId, {
44
- status: 'Done',
39
+ await client.customObjects.records.update(TODO_OBJECT_API_NAME, recordId, {
40
+ status__c: 'Done',
45
41
  });
46
42
  }
47
43
 
@@ -1,18 +1,28 @@
1
- import { FunctionContext, FunctionResponse } from '@rippling/rippling-sdk';
2
- import {
3
- handleTypedObjectListPageEvent,
4
- type TypedObjectListPageInput,
5
- type TypedObjectListPageOutput,
6
- } from '@rippling/rippling-sdk/core/platform/manifest/custom-objects';
7
- import { todoDefinition } from '../schema';
1
+ import { FunctionContext, FunctionResponse, SduiPageFunctionEvent } from '@rippling/rippling-sdk';
2
+ import { ObjectListView, render } from '@rippling/pebble-sdui-web/catalogs/custom-apps';
8
3
 
9
- export type Input = TypedObjectListPageInput;
10
-
11
- export type Output = TypedObjectListPageOutput;
4
+ const OBJECT = 'simple_todo__c';
12
5
 
13
6
  export async function onRipplingEvent(
14
- event: Input,
7
+ event: SduiPageFunctionEvent,
15
8
  context: FunctionContext,
16
- ): Promise<FunctionResponse<Output>> {
17
- return handleTypedObjectListPageEvent(event, context, todoDefinition);
9
+ ): Promise<FunctionResponse> {
10
+ const action = event.parameters.action;
11
+
12
+ if (action === 'init') {
13
+ const spec = render({
14
+ root: ObjectListView({
15
+ props: { objectApiName: OBJECT },
16
+ }),
17
+ state: {},
18
+ });
19
+ return new FunctionResponse({
20
+ body: { spec: JSON.stringify(spec) },
21
+ statusCode: 200,
22
+ headers: {},
23
+ message: '',
24
+ });
25
+ }
26
+
27
+ return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });
18
28
  }
@@ -1,10 +1,9 @@
1
1
  /*
2
2
  * Simple Todo — minimal CRUD example.
3
3
  *
4
- * One typed Custom Object (`simple_todo__c`) with name / status / priority /
5
- * due date / notes, one list view ("Open todos"), one page layout, and one
6
- * SDUI page that renders the records via ObjectListView. No SDUI beyond
7
- * ObjectListView.
4
+ * One Custom Object (`simple_todo__c`) with name / status / priority / due date / notes,
5
+ * one section, one list view ("Open todos"), one page layout, and one SDUI page that
6
+ * renders the records via ObjectListView. No SDUI beyond ObjectListView.
8
7
  *
9
8
  * simple_todo__c ← name, status, priority, due_date, notes
10
9
  *
@@ -13,48 +12,107 @@
13
12
  * > examples/manifest/simple-todo-app/manifest.json
14
13
  */
15
14
 
15
+ import * as fs from 'node:fs';
16
16
  import * as path from 'node:path';
17
- import { toCustomCategoryApiName } from '@rippling/rippling-sdk/core/platform/custom-objects';
18
17
  import {
19
- defineSduiPageFromFunctionFile,
20
- defineTypedCustomObjectActionFromFunctionFile,
21
- defineTypedListView,
22
- defineTypedPageLayout,
23
- registerManifestCustomObject,
24
- } from '@rippling/rippling-sdk/core/platform/manifest/custom-objects';
25
- import { App, Category, ManifestBuilder } from '@rippling/rippling-sdk/lib/manifest';
26
- import { SIMPLE_TODO_CATEGORY, todoDefinition } from './schema';
18
+ App,
19
+ Category,
20
+ CustomObject,
21
+ CustomObjectAction,
22
+ CustomObjectFieldSection,
23
+ CustomObjectPageLayout,
24
+ DateField,
25
+ ListViewDef,
26
+ LongTextField,
27
+ ManifestBuilder,
28
+ ManifestFunction,
29
+ RadioField,
30
+ SduiPage,
31
+ SelectField,
32
+ } from '@rippling/rippling-sdk/lib/manifest';
27
33
 
28
34
  const manifest = new ManifestBuilder({
29
35
  key: 'simple_todo_app',
30
36
  name: 'Simple Todo',
31
- description: 'A minimal CRUD todo app: one typed custom object rendered as an SDUI ObjectListView',
37
+ description: 'A minimal CRUD todo app: one Custom Object rendered as an SDUI ObjectListView',
32
38
  });
33
39
 
34
40
  const todoCategory = new Category(manifest, {
35
- apiName: toCustomCategoryApiName(SIMPLE_TODO_CATEGORY),
41
+ apiName: 'simple_todo__c',
36
42
  name: 'Tasks',
37
43
  description: 'Container for todo records',
38
44
  });
39
45
 
40
- const todo = registerManifestCustomObject(manifest, {
41
- definition: todoDefinition,
46
+ // ── Todo object ─────────────────────────────────────────────────────────────
47
+ const todoObj = new CustomObject(manifest, {
48
+ apiName: 'simple_todo__c',
49
+ name: 'Todo',
50
+ pluralLabel: 'Todos',
42
51
  category: todoCategory,
52
+ description: 'A single task with status, priority, and due date',
53
+ icon: { emoji: '✅' },
54
+ });
55
+
56
+ const detailsSection = new CustomObjectFieldSection(todoObj, {
57
+ name: 'Details',
58
+ sectionId: 'sec_todo_details',
59
+ });
60
+
61
+ const statusField = new RadioField(todoObj, {
62
+ apiName: 'status__c',
63
+ displayName: 'Status',
64
+ description: 'Status field',
65
+ options: ['To Do', 'In Progress', 'Done'],
66
+ required: true,
67
+ section: detailsSection,
43
68
  });
44
69
 
45
- defineTypedListView(todo, {
70
+ const priorityField = new RadioField(todoObj, {
71
+ apiName: 'priority__c',
72
+ displayName: 'Priority',
73
+ description: 'Priority field',
74
+ options: ['Low', 'Medium', 'High'],
75
+ section: detailsSection,
76
+ });
77
+
78
+ const labelsField = new SelectField(todoObj, {
79
+ apiName: 'labels__c',
80
+ displayName: 'Labels',
81
+ description: 'One or more labels for organizing the task',
82
+ options: ['Personal', 'Work', 'Urgent', 'Follow-up'],
83
+ section: detailsSection,
84
+ });
85
+
86
+ const dueDateField = new DateField(todoObj, {
87
+ apiName: 'due_date__c',
88
+ displayName: 'Due date',
89
+ description: 'Due date field',
90
+ section: detailsSection,
91
+ });
92
+
93
+ const notesField = new LongTextField(todoObj, {
94
+ apiName: 'notes__c',
95
+ displayName: 'Notes',
96
+ description: 'Notes field',
97
+ maxLength: 4000,
98
+ section: detailsSection,
99
+ });
100
+
101
+ // ── List view: Open todos ───────────────────────────────────────────────────
102
+ new ListViewDef(todoObj, {
46
103
  viewId: 'view_simple_todo_open',
47
104
  name: 'Open todos',
48
105
  description: 'Everything that is not Done, ordered by due date',
49
- fields: ['name', 'status', 'priority', 'labels', 'due_date'],
50
- orderBy: 'due_date',
106
+ fields: ['name', statusField, priorityField, labelsField, dueDateField],
107
+ orderBy: dueDateField,
51
108
  sortOrder: 'ASC',
52
109
  isPublic: true,
53
110
  objectScope: 'all',
54
- filter: (c) => c.ne(c.fields.status, 'Done'),
111
+ rqlFilter: "(status__c != 'Done')",
55
112
  });
56
113
 
57
- defineTypedPageLayout(todo, {
114
+ // ── Page layout ─────────────────────────────────────────────────────────────
115
+ new CustomObjectPageLayout(todoObj, {
58
116
  apiName: 'default',
59
117
  name: 'Todo',
60
118
  layoutId: 'layout_simple_todo',
@@ -68,8 +126,15 @@ defineTypedPageLayout(todo, {
68
126
  {
69
127
  name: 'Details',
70
128
  type: 'fields_section',
71
- section: todo.sections.details,
72
- fields: [{ field: 'name', editable: true }, 'status', 'priority', 'labels', 'due_date', 'notes'],
129
+ section: detailsSection,
130
+ fields: [
131
+ { field: 'name', editable: true },
132
+ statusField,
133
+ priorityField,
134
+ labelsField,
135
+ dueDateField,
136
+ notesField,
137
+ ],
73
138
  },
74
139
  ],
75
140
  },
@@ -81,37 +146,41 @@ defineTypedPageLayout(todo, {
81
146
  });
82
147
 
83
148
  // ── SDUI page (ObjectListView) ──────────────────────────────────────────────
84
- const { function: todoListFn, page: todoListPage } = defineSduiPageFromFunctionFile(manifest, {
149
+ const todoListFn = new ManifestFunction(manifest, {
85
150
  apiName: 'simple_todo_list_fn',
86
151
  name: 'renderTodos',
87
152
  description: 'SDUI ObjectListView for todo records',
88
- codeDirectory: path.join(__dirname, 'functions'),
89
- codeFilename: 'todo-list.ts',
153
+ code: fs.readFileSync(path.join(__dirname, 'functions', 'todo-list.ts'), 'utf-8'),
90
154
  dependencies: { '@rippling/rippling-sdk': '^0.2.0-alpha.65', '@rippling/pebble-sdui-web': '^0.9.2' },
91
155
  isAsync: false,
92
- pageId: 'simple_todo_page',
93
- pageName: 'Todos',
94
156
  });
95
157
 
96
- defineTypedCustomObjectActionFromFunctionFile(manifest, todo, {
158
+ const todoListPage = new SduiPage(manifest, {
159
+ sduiPageId: 'simple_todo_page',
160
+ name: 'Todos',
161
+ function: todoListFn,
162
+ });
163
+
164
+ const markDoneFn = new ManifestFunction(manifest, {
165
+ apiName: 'simple_todo_mark_done_fn',
166
+ name: 'markDone',
167
+ description: 'Marks one todo from its detail view or selected todos from the list view as done',
168
+ code: fs.readFileSync(path.join(__dirname, 'functions', 'mark-done.ts'), 'utf-8'),
169
+ dependencies: { '@rippling/rippling-sdk': '^0.2.0-alpha.76' },
170
+ isAsync: false,
171
+ });
172
+
173
+ new CustomObjectAction(todoObj, {
97
174
  actionId: 'action_simple_todo_mark_done',
98
175
  name: 'Mark done',
176
+ function: markDoneFn,
99
177
  visibilityPreferences: ['DETAIL_VIEW', 'LIST_VIEW'],
100
- function: {
101
- apiName: 'simple_todo_mark_done_fn',
102
- name: 'markDone',
103
- description: 'Marks one todo from its detail view or selected todos from the list view as done',
104
- codeDirectory: path.join(__dirname, 'functions'),
105
- codeFilename: 'mark-done.ts',
106
- dependencies: { '@rippling/rippling-sdk': '^0.2.0-alpha.76' },
107
- isAsync: false,
108
- },
109
178
  });
110
179
 
111
180
  new App(manifest, {
112
181
  apiName: 'simple_todo_app',
113
182
  name: 'Simple Todo',
114
- description: 'Minimal todo app: one typed custom object with an SDUI ObjectListView page',
183
+ description: 'Minimal todo app: one Custom Object with an SDUI ObjectListView page',
115
184
  appType: 'custom',
116
185
  pages: [todoListPage],
117
186
  });