@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.
- package/examples/manifest/custom-object-creation-workflow/custom-object-creation-workflow.ts +44 -26
- package/examples/manifest/dental-practice-management/dental-practice-management.ts +470 -142
- package/examples/manifest/dental-practice-management/functions/chair-schedule.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/complete-visit.ts +55 -32
- package/examples/manifest/dental-practice-management/functions/operatory-list.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/patient-list.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/treatment-plan-list.ts +23 -13
- package/examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts +23 -68
- package/examples/manifest/field-service-dispatch/field-service-dispatch.ts +375 -102
- package/examples/manifest/grant-program-management/grant-program-management.ts +419 -125
- package/examples/manifest/gym-membership-management/functions/check-in-desk.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/member-list.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/today-schedule.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/trainer-list.ts +23 -13
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +442 -92
- package/examples/manifest/procurement-approval-hub/procurement-approval-hub.ts +408 -122
- package/examples/manifest/simple-todo-app/functions/mark-done.ts +12 -16
- package/examples/manifest/simple-todo-app/functions/todo-list.ts +23 -13
- package/examples/manifest/simple-todo-app/simple-todo-app.ts +109 -40
- package/examples/manifest/todo-app-without-object-list-view/functions/todo-page.ts +193 -166
- package/examples/manifest/todo-app-without-object-list-view/todo-app-without-object-list-view.ts +47 -24
- package/package.json +13 -7
- package/resources/custom-objects/fields.d.mts +1 -40
- package/resources/custom-objects/fields.d.mts.map +1 -1
- package/resources/custom-objects/fields.d.ts +1 -40
- package/resources/custom-objects/fields.d.ts.map +1 -1
- package/resources/levels.d.mts +25 -4
- package/resources/levels.d.mts.map +1 -1
- package/resources/levels.d.ts +25 -4
- package/resources/levels.d.ts.map +1 -1
- package/src/resources/custom-objects/fields.ts +1 -46
- package/src/resources/levels.ts +28 -4
- package/src/tsconfig.json +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/core/platform/manifest/custom-objects/action.d.mts +0 -58
- package/core/platform/manifest/custom-objects/action.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/action.d.ts +0 -58
- package/core/platform/manifest/custom-objects/action.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/action.js +0 -44
- package/core/platform/manifest/custom-objects/action.js.map +0 -1
- package/core/platform/manifest/custom-objects/action.mjs +0 -40
- package/core/platform/manifest/custom-objects/action.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.d.mts +0 -240
- package/core/platform/manifest/custom-objects/conditions.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.d.ts +0 -240
- package/core/platform/manifest/custom-objects/conditions.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.js +0 -326
- package/core/platform/manifest/custom-objects/conditions.js.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.mjs +0 -321
- package/core/platform/manifest/custom-objects/conditions.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/existing.d.mts +0 -87
- package/core/platform/manifest/custom-objects/existing.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/existing.d.ts +0 -87
- package/core/platform/manifest/custom-objects/existing.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/existing.js +0 -113
- package/core/platform/manifest/custom-objects/existing.js.map +0 -1
- package/core/platform/manifest/custom-objects/existing.mjs +0 -109
- package/core/platform/manifest/custom-objects/existing.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.d.mts +0 -48
- package/core/platform/manifest/custom-objects/field-resolution.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.d.ts +0 -48
- package/core/platform/manifest/custom-objects/field-resolution.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.js +0 -61
- package/core/platform/manifest/custom-objects/field-resolution.js.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.mjs +0 -58
- package/core/platform/manifest/custom-objects/field-resolution.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.d.mts +0 -87
- package/core/platform/manifest/custom-objects/function-file.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.d.ts +0 -87
- package/core/platform/manifest/custom-objects/function-file.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.js +0 -76
- package/core/platform/manifest/custom-objects/function-file.js.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.mjs +0 -69
- package/core/platform/manifest/custom-objects/function-file.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.d.mts +0 -65
- package/core/platform/manifest/custom-objects/list-view.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.d.ts +0 -65
- package/core/platform/manifest/custom-objects/list-view.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.js +0 -33
- package/core/platform/manifest/custom-objects/list-view.js.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.mjs +0 -30
- package/core/platform/manifest/custom-objects/list-view.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.d.mts +0 -43
- package/core/platform/manifest/custom-objects/object-list-page.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.d.ts +0 -43
- package/core/platform/manifest/custom-objects/object-list-page.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.js +0 -54
- package/core/platform/manifest/custom-objects/object-list-page.js.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.mjs +0 -50
- package/core/platform/manifest/custom-objects/object-list-page.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.d.mts +0 -142
- package/core/platform/manifest/custom-objects/page-layout.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.d.ts +0 -142
- package/core/platform/manifest/custom-objects/page-layout.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.js +0 -184
- package/core/platform/manifest/custom-objects/page-layout.js.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.mjs +0 -180
- package/core/platform/manifest/custom-objects/page-layout.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/register.d.mts +0 -87
- package/core/platform/manifest/custom-objects/register.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/register.d.ts +0 -87
- package/core/platform/manifest/custom-objects/register.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/register.js +0 -395
- package/core/platform/manifest/custom-objects/register.js.map +0 -1
- package/core/platform/manifest/custom-objects/register.mjs +0 -391
- package/core/platform/manifest/custom-objects/register.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/rule.d.mts +0 -113
- package/core/platform/manifest/custom-objects/rule.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/rule.d.ts +0 -113
- package/core/platform/manifest/custom-objects/rule.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/rule.js +0 -49
- package/core/platform/manifest/custom-objects/rule.js.map +0 -1
- package/core/platform/manifest/custom-objects/rule.mjs +0 -45
- package/core/platform/manifest/custom-objects/rule.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.d.mts +0 -214
- package/core/platform/manifest/custom-objects/sdui-page.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.d.ts +0 -214
- package/core/platform/manifest/custom-objects/sdui-page.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.js +0 -194
- package/core/platform/manifest/custom-objects/sdui-page.js.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.mjs +0 -182
- package/core/platform/manifest/custom-objects/sdui-page.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.d.mts +0 -28
- package/core/platform/manifest/custom-objects/typed-condition.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.d.ts +0 -28
- package/core/platform/manifest/custom-objects/typed-condition.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.js +0 -434
- package/core/platform/manifest/custom-objects/typed-condition.js.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.mjs +0 -431
- package/core/platform/manifest/custom-objects/typed-condition.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/types.d.mts +0 -29
- package/core/platform/manifest/custom-objects/types.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/types.d.ts +0 -29
- package/core/platform/manifest/custom-objects/types.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/types.js +0 -3
- package/core/platform/manifest/custom-objects/types.js.map +0 -1
- package/core/platform/manifest/custom-objects/types.mjs +0 -2
- package/core/platform/manifest/custom-objects/types.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/validation.d.mts +0 -44
- package/core/platform/manifest/custom-objects/validation.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/validation.d.ts +0 -44
- package/core/platform/manifest/custom-objects/validation.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/validation.js +0 -30
- package/core/platform/manifest/custom-objects/validation.js.map +0 -1
- package/core/platform/manifest/custom-objects/validation.mjs +0 -27
- package/core/platform/manifest/custom-objects/validation.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.d.mts +0 -47
- package/core/platform/manifest/custom-objects/workflow.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.d.ts +0 -47
- package/core/platform/manifest/custom-objects/workflow.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.js +0 -38
- package/core/platform/manifest/custom-objects/workflow.js.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.mjs +0 -34
- package/core/platform/manifest/custom-objects/workflow.mjs.map +0 -1
- package/core/platform/manifest/custom-objects.d.mts +0 -85
- package/core/platform/manifest/custom-objects.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects.d.ts +0 -85
- package/core/platform/manifest/custom-objects.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects.js +0 -84
- package/core/platform/manifest/custom-objects.js.map +0 -1
- package/core/platform/manifest/custom-objects.mjs +0 -55
- package/core/platform/manifest/custom-objects.mjs.map +0 -1
- package/examples/manifest/custom-object-creation-workflow/functions/intake-request-created.ts +0 -20
- package/examples/manifest/custom-object-creation-workflow/schema.ts +0 -29
- package/examples/manifest/dental-practice-management/schema.ts +0 -298
- package/examples/manifest/field-service-dispatch/schema.ts +0 -248
- package/examples/manifest/grant-program-management/schema.ts +0 -269
- package/examples/manifest/gym-membership-management/schema.ts +0 -266
- package/examples/manifest/procurement-approval-hub/functions/route-purchase-request.ts +0 -20
- package/examples/manifest/procurement-approval-hub/schema.ts +0 -256
- package/examples/manifest/simple-todo-app/schema.ts +0 -60
- package/examples/manifest/todo-app-without-object-list-view/schema.ts +0 -28
- package/src/core/platform/README.md +0 -20
- package/src/core/platform/manifest/README.md +0 -26
- package/src/core/platform/manifest/custom-objects/action.ts +0 -87
- package/src/core/platform/manifest/custom-objects/conditions.ts +0 -762
- package/src/core/platform/manifest/custom-objects/existing.ts +0 -221
- package/src/core/platform/manifest/custom-objects/field-resolution.ts +0 -116
- package/src/core/platform/manifest/custom-objects/function-file.ts +0 -149
- package/src/core/platform/manifest/custom-objects/list-view.ts +0 -95
- package/src/core/platform/manifest/custom-objects/object-list-page.ts +0 -87
- package/src/core/platform/manifest/custom-objects/page-layout.ts +0 -380
- package/src/core/platform/manifest/custom-objects/register.ts +0 -555
- package/src/core/platform/manifest/custom-objects/rule.ts +0 -192
- package/src/core/platform/manifest/custom-objects/sdui-page.ts +0 -515
- package/src/core/platform/manifest/custom-objects/typed-condition.ts +0 -617
- package/src/core/platform/manifest/custom-objects/types.ts +0 -92
- package/src/core/platform/manifest/custom-objects/validation.ts +0 -70
- package/src/core/platform/manifest/custom-objects/workflow.ts +0 -71
- package/src/core/platform/manifest/custom-objects.ts +0 -203
- package/src/pebble-sdui-web-custom-apps-shim.d.ts +0 -3
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typed custom-object schema definitions for the procurement approval hub example.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
date,
|
|
7
|
-
defineCustomObject,
|
|
8
|
-
email,
|
|
9
|
-
formula,
|
|
10
|
-
longText,
|
|
11
|
-
lookup,
|
|
12
|
-
number,
|
|
13
|
-
parentChild,
|
|
14
|
-
radio,
|
|
15
|
-
section,
|
|
16
|
-
text,
|
|
17
|
-
} from '@rippling/rippling-sdk/core/platform/custom-objects';
|
|
18
|
-
|
|
19
|
-
/** Logical category shared by the procurement approval hub example. */
|
|
20
|
-
export const PROCUREMENT_CATEGORY = 'procurement';
|
|
21
|
-
|
|
22
|
-
/** Vendor profile schema used for contract and request relationships. */
|
|
23
|
-
export const vendorDefinition = defineCustomObject({
|
|
24
|
-
name: 'pa_vendor',
|
|
25
|
-
displayName: 'Vendor',
|
|
26
|
-
pluralLabel: 'Vendors',
|
|
27
|
-
category: PROCUREMENT_CATEGORY,
|
|
28
|
-
description: 'Vendor profile, risk tier, and compliance owner',
|
|
29
|
-
sections: {
|
|
30
|
-
vendor: section('Vendor', { sectionId: 'sec_pa_vendor' }),
|
|
31
|
-
},
|
|
32
|
-
fields: {
|
|
33
|
-
legal_name: text({
|
|
34
|
-
displayName: 'Legal name',
|
|
35
|
-
description: 'Registered legal vendor name',
|
|
36
|
-
required: true,
|
|
37
|
-
maxLength: 200,
|
|
38
|
-
section: 'vendor',
|
|
39
|
-
}),
|
|
40
|
-
vendor_category: radio({
|
|
41
|
-
displayName: 'Vendor category',
|
|
42
|
-
description: 'Primary spend category',
|
|
43
|
-
options: ['Software', 'Facilities', 'Professional services', 'Marketing', 'Hardware', 'Other'],
|
|
44
|
-
required: true,
|
|
45
|
-
section: 'vendor',
|
|
46
|
-
}),
|
|
47
|
-
risk_tier: radio({
|
|
48
|
-
displayName: 'Risk tier',
|
|
49
|
-
description: 'Risk tier from diligence review',
|
|
50
|
-
options: ['Low', 'Medium', 'High', 'Critical'],
|
|
51
|
-
required: true,
|
|
52
|
-
section: 'vendor',
|
|
53
|
-
}),
|
|
54
|
-
contact_email: email({
|
|
55
|
-
displayName: 'Contact email',
|
|
56
|
-
description: 'Primary vendor contact email',
|
|
57
|
-
section: 'vendor',
|
|
58
|
-
}),
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
/** Contract schema tied to a parent vendor. */
|
|
63
|
-
export const contractDefinition = defineCustomObject({
|
|
64
|
-
name: 'pa_contract',
|
|
65
|
-
displayName: 'Contract',
|
|
66
|
-
pluralLabel: 'Contracts',
|
|
67
|
-
category: PROCUREMENT_CATEGORY,
|
|
68
|
-
description: 'Vendor contract with dates, status, and spend ceiling',
|
|
69
|
-
sections: {
|
|
70
|
-
contract: section('Contract', { sectionId: 'sec_pa_contract' }),
|
|
71
|
-
},
|
|
72
|
-
fields: {
|
|
73
|
-
vendor_ref: parentChild(vendorDefinition, {
|
|
74
|
-
displayName: 'Vendor',
|
|
75
|
-
description: 'Vendor this contract belongs to',
|
|
76
|
-
relatedDataLabel: 'Contracts',
|
|
77
|
-
parentChildType: 'PRIMARY',
|
|
78
|
-
enableParentOwnerInheritance: false,
|
|
79
|
-
section: 'contract',
|
|
80
|
-
}),
|
|
81
|
-
status: radio({
|
|
82
|
-
displayName: 'Status',
|
|
83
|
-
description: 'Contract lifecycle status',
|
|
84
|
-
options: ['Draft', 'In review', 'Active', 'Expired', 'Terminated'],
|
|
85
|
-
required: true,
|
|
86
|
-
section: 'contract',
|
|
87
|
-
}),
|
|
88
|
-
start_date: date({
|
|
89
|
-
displayName: 'Start date',
|
|
90
|
-
description: 'Contract effective date',
|
|
91
|
-
section: 'contract',
|
|
92
|
-
}),
|
|
93
|
-
end_date: date({
|
|
94
|
-
displayName: 'End date',
|
|
95
|
-
description: 'Contract expiration date',
|
|
96
|
-
section: 'contract',
|
|
97
|
-
}),
|
|
98
|
-
spend_ceiling_cents: number({
|
|
99
|
-
displayName: 'Spend ceiling (cents)',
|
|
100
|
-
description: 'Approved maximum spend in cents',
|
|
101
|
-
decimalPlaces: 0,
|
|
102
|
-
section: 'contract',
|
|
103
|
-
}),
|
|
104
|
-
key_terms: longText({
|
|
105
|
-
displayName: 'Key terms',
|
|
106
|
-
description: 'Renewal, data processing, and termination notes',
|
|
107
|
-
maxLength: 6000,
|
|
108
|
-
section: 'contract',
|
|
109
|
-
}),
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
/** Purchase-request schema tied to a vendor and optional contract. */
|
|
114
|
-
export const requestDefinition = defineCustomObject({
|
|
115
|
-
name: 'pa_purchase_request',
|
|
116
|
-
displayName: 'Purchase request',
|
|
117
|
-
pluralLabel: 'Purchase requests',
|
|
118
|
-
category: PROCUREMENT_CATEGORY,
|
|
119
|
-
description: 'Purchase request with business justification and approval state',
|
|
120
|
-
sections: {
|
|
121
|
-
request: section('Purchase request', { sectionId: 'sec_pa_request' }),
|
|
122
|
-
},
|
|
123
|
-
fields: {
|
|
124
|
-
vendor_ref: lookup(vendorDefinition, {
|
|
125
|
-
displayName: 'Vendor',
|
|
126
|
-
description: 'Preferred or selected vendor',
|
|
127
|
-
relatedDataLabel: 'Purchase requests',
|
|
128
|
-
required: true,
|
|
129
|
-
section: 'request',
|
|
130
|
-
}),
|
|
131
|
-
contract_ref: lookup(contractDefinition, {
|
|
132
|
-
displayName: 'Contract',
|
|
133
|
-
description: 'Contract used for this request, if any',
|
|
134
|
-
relatedDataLabel: 'Purchase requests',
|
|
135
|
-
section: 'request',
|
|
136
|
-
}),
|
|
137
|
-
amount_cents: number({
|
|
138
|
-
displayName: 'Amount (cents)',
|
|
139
|
-
description: 'Requested spend amount in cents',
|
|
140
|
-
decimalPlaces: 0,
|
|
141
|
-
required: true,
|
|
142
|
-
section: 'request',
|
|
143
|
-
}),
|
|
144
|
-
status: radio({
|
|
145
|
-
displayName: 'Status',
|
|
146
|
-
description: 'Approval status',
|
|
147
|
-
options: ['Draft', 'Submitted', 'In approval', 'Approved', 'Rejected', 'Ordered'],
|
|
148
|
-
required: true,
|
|
149
|
-
section: 'request',
|
|
150
|
-
}),
|
|
151
|
-
need_by: date({
|
|
152
|
-
displayName: 'Need by',
|
|
153
|
-
description: 'Requested delivery or purchase date',
|
|
154
|
-
section: 'request',
|
|
155
|
-
}),
|
|
156
|
-
business_justification: longText({
|
|
157
|
-
displayName: 'Business justification',
|
|
158
|
-
description: 'Why the purchase is needed',
|
|
159
|
-
maxLength: 6000,
|
|
160
|
-
section: 'request',
|
|
161
|
-
}),
|
|
162
|
-
approval_label: formula.text({
|
|
163
|
-
displayName: 'Approval label',
|
|
164
|
-
description: 'Status and amount for approval queues',
|
|
165
|
-
formula: "CONCATENATE(status__c, ' - ', amount_cents__c)",
|
|
166
|
-
maxLength: 240,
|
|
167
|
-
section: 'request',
|
|
168
|
-
}),
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
/** Approval-step schema tied to a parent purchase request. */
|
|
173
|
-
export const approvalDefinition = defineCustomObject({
|
|
174
|
-
name: 'pa_approval_step',
|
|
175
|
-
displayName: 'Approval step',
|
|
176
|
-
pluralLabel: 'Approval steps',
|
|
177
|
-
category: PROCUREMENT_CATEGORY,
|
|
178
|
-
description: 'Approval routing line tied to a purchase request',
|
|
179
|
-
sections: {
|
|
180
|
-
approval: section('Approval step', { sectionId: 'sec_pa_approval' }),
|
|
181
|
-
},
|
|
182
|
-
fields: {
|
|
183
|
-
purchase_request_ref: parentChild(requestDefinition, {
|
|
184
|
-
displayName: 'Purchase request',
|
|
185
|
-
description: 'Purchase request this approval belongs to',
|
|
186
|
-
relatedDataLabel: 'Approval steps',
|
|
187
|
-
parentChildType: 'PRIMARY',
|
|
188
|
-
enableParentOwnerInheritance: true,
|
|
189
|
-
section: 'approval',
|
|
190
|
-
}),
|
|
191
|
-
sequence: number({
|
|
192
|
-
displayName: 'Sequence',
|
|
193
|
-
description: 'Approval sequence number',
|
|
194
|
-
decimalPlaces: 0,
|
|
195
|
-
required: true,
|
|
196
|
-
section: 'approval',
|
|
197
|
-
}),
|
|
198
|
-
approval_role: radio({
|
|
199
|
-
displayName: 'Approval role',
|
|
200
|
-
description: 'Approval lane',
|
|
201
|
-
options: ['Budget owner', 'Finance', 'Security', 'Legal', 'Procurement'],
|
|
202
|
-
required: true,
|
|
203
|
-
section: 'approval',
|
|
204
|
-
}),
|
|
205
|
-
status: radio({
|
|
206
|
-
displayName: 'Status',
|
|
207
|
-
description: 'Approval step status',
|
|
208
|
-
options: ['Pending', 'Approved', 'Rejected', 'Skipped'],
|
|
209
|
-
required: true,
|
|
210
|
-
section: 'approval',
|
|
211
|
-
}),
|
|
212
|
-
},
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
/** Invoice schema tied to a parent contract. */
|
|
216
|
-
export const invoiceDefinition = defineCustomObject({
|
|
217
|
-
name: 'pa_invoice',
|
|
218
|
-
displayName: 'Invoice',
|
|
219
|
-
pluralLabel: 'Invoices',
|
|
220
|
-
category: PROCUREMENT_CATEGORY,
|
|
221
|
-
description: 'Invoice received against a vendor contract',
|
|
222
|
-
sections: {
|
|
223
|
-
invoice: section('Invoice', { sectionId: 'sec_pa_invoice' }),
|
|
224
|
-
},
|
|
225
|
-
fields: {
|
|
226
|
-
contract_ref: parentChild(contractDefinition, {
|
|
227
|
-
displayName: 'Contract',
|
|
228
|
-
description: 'Contract this invoice is billed against',
|
|
229
|
-
relatedDataLabel: 'Invoices',
|
|
230
|
-
parentChildType: 'PRIMARY',
|
|
231
|
-
enableParentOwnerInheritance: false,
|
|
232
|
-
section: 'invoice',
|
|
233
|
-
}),
|
|
234
|
-
invoice_number: text({
|
|
235
|
-
displayName: 'Invoice number',
|
|
236
|
-
description: 'Vendor invoice number',
|
|
237
|
-
maxLength: 120,
|
|
238
|
-
required: true,
|
|
239
|
-
section: 'invoice',
|
|
240
|
-
}),
|
|
241
|
-
amount_cents: number({
|
|
242
|
-
displayName: 'Amount (cents)',
|
|
243
|
-
description: 'Invoice amount in cents',
|
|
244
|
-
decimalPlaces: 0,
|
|
245
|
-
required: true,
|
|
246
|
-
section: 'invoice',
|
|
247
|
-
}),
|
|
248
|
-
status: radio({
|
|
249
|
-
displayName: 'Status',
|
|
250
|
-
description: 'Invoice processing status',
|
|
251
|
-
options: ['Received', 'Matched', 'Approved', 'Paid', 'Exception'],
|
|
252
|
-
required: true,
|
|
253
|
-
section: 'invoice',
|
|
254
|
-
}),
|
|
255
|
-
},
|
|
256
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typed custom-object schema for the simple todo example.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
date,
|
|
7
|
-
defineCustomObject,
|
|
8
|
-
longText,
|
|
9
|
-
radio,
|
|
10
|
-
section,
|
|
11
|
-
select,
|
|
12
|
-
} from '@rippling/rippling-sdk/core/platform/custom-objects';
|
|
13
|
-
|
|
14
|
-
/** Logical category shared by the simple todo custom-object example. */
|
|
15
|
-
export const SIMPLE_TODO_CATEGORY = 'simple_todo';
|
|
16
|
-
|
|
17
|
-
/** Typed schema used by the simple todo manifest and action functions. */
|
|
18
|
-
export const todoDefinition = defineCustomObject({
|
|
19
|
-
name: 'simple_todo',
|
|
20
|
-
displayName: 'Todo',
|
|
21
|
-
pluralLabel: 'Todos',
|
|
22
|
-
category: SIMPLE_TODO_CATEGORY,
|
|
23
|
-
description: 'A single task with status, priority, due date, and notes.',
|
|
24
|
-
icon: { emoji: '✅' },
|
|
25
|
-
sections: {
|
|
26
|
-
details: section('Details', { sectionId: 'sec_todo_details' }),
|
|
27
|
-
},
|
|
28
|
-
fields: {
|
|
29
|
-
status: radio({
|
|
30
|
-
displayName: 'Status',
|
|
31
|
-
description: 'Status field',
|
|
32
|
-
options: ['To Do', 'In Progress', 'Done'],
|
|
33
|
-
required: true,
|
|
34
|
-
section: 'details',
|
|
35
|
-
}),
|
|
36
|
-
priority: radio({
|
|
37
|
-
displayName: 'Priority',
|
|
38
|
-
description: 'Priority field',
|
|
39
|
-
options: ['Low', 'Medium', 'High'],
|
|
40
|
-
section: 'details',
|
|
41
|
-
}),
|
|
42
|
-
labels: select({
|
|
43
|
-
displayName: 'Labels',
|
|
44
|
-
description: 'One or more labels for organizing the task',
|
|
45
|
-
options: ['Personal', 'Work', 'Urgent', 'Follow-up'],
|
|
46
|
-
section: 'details',
|
|
47
|
-
}),
|
|
48
|
-
due_date: date({
|
|
49
|
-
displayName: 'Due date',
|
|
50
|
-
description: 'Due date field',
|
|
51
|
-
section: 'details',
|
|
52
|
-
}),
|
|
53
|
-
notes: longText({
|
|
54
|
-
displayName: 'Notes',
|
|
55
|
-
description: 'Notes field',
|
|
56
|
-
maxLength: 4000,
|
|
57
|
-
section: 'details',
|
|
58
|
-
}),
|
|
59
|
-
},
|
|
60
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typed custom-object schema for the custom SDUI todo example.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { boolean, defineCustomObject, section } from '@rippling/rippling-sdk/core/platform/custom-objects';
|
|
6
|
-
|
|
7
|
-
/** Logical category shared by the custom SDUI todo example. */
|
|
8
|
-
export const CUSTOM_TODO_CATEGORY = 'custom_todo_app';
|
|
9
|
-
|
|
10
|
-
/** Typed schema used by the custom SDUI todo manifest and function code. */
|
|
11
|
-
export const todoDefinition = defineCustomObject({
|
|
12
|
-
name: 'todo',
|
|
13
|
-
displayName: 'Todo',
|
|
14
|
-
pluralLabel: 'Todos',
|
|
15
|
-
category: CUSTOM_TODO_CATEGORY,
|
|
16
|
-
description: 'A todo item rendered by a custom SDUI page.',
|
|
17
|
-
icon: { emoji: '✅' },
|
|
18
|
-
sections: {
|
|
19
|
-
details: section('Details', { sectionId: 'sec_custom_todo_details' }),
|
|
20
|
-
},
|
|
21
|
-
fields: {
|
|
22
|
-
completed: boolean({
|
|
23
|
-
displayName: 'Completed',
|
|
24
|
-
description: 'Whether the todo item is complete',
|
|
25
|
-
section: 'details',
|
|
26
|
-
}),
|
|
27
|
-
},
|
|
28
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# `core/platform`
|
|
2
|
-
|
|
3
|
-
This directory holds public, higher-level platform abstractions that sit above the generated REST resources and above low-level manifest classes.
|
|
4
|
-
|
|
5
|
-
Use this layer for SDK capabilities that are:
|
|
6
|
-
|
|
7
|
-
- public and stable enough to be imported by SDK consumers
|
|
8
|
-
- opinionated or cross-cutting rather than raw transport wrappers
|
|
9
|
-
- centered on platform concepts such as custom objects, typed schemas, lifecycle helpers, record managers, or query helpers
|
|
10
|
-
|
|
11
|
-
In practice, the layering is:
|
|
12
|
-
|
|
13
|
-
- `src/resources/*` — generated REST resources and DTOs
|
|
14
|
-
- `src/lib/manifest/*` — low-level manifest authoring classes
|
|
15
|
-
- `src/core/platform/*` — higher-level typed/platform abstractions built on top of those surfaces
|
|
16
|
-
|
|
17
|
-
Current structure:
|
|
18
|
-
|
|
19
|
-
- `custom-objects/` — typed custom-object domain model, validation, provisioning, lifecycle, records, and RQL helpers
|
|
20
|
-
- `manifest/` — typed adapters that materialize platform-domain definitions into low-level manifest authoring surfaces
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# `core/platform/manifest`
|
|
2
|
-
|
|
3
|
-
This directory holds public manifest-integration adapters for higher-level platform abstractions.
|
|
4
|
-
|
|
5
|
-
Use this layer when code is primarily about translating typed platform/domain definitions into low-level `lib/manifest` classes rather than defining the domain model itself.
|
|
6
|
-
|
|
7
|
-
Rule of thumb:
|
|
8
|
-
|
|
9
|
-
- if code owns schema semantics, validation, provisioning, lifecycle, records, or query typing, it belongs in `core/platform/<domain>/`
|
|
10
|
-
- if code primarily produces `lib/manifest` components or manifest-specific typed authoring helpers, it belongs in `core/platform/manifest/<domain>/`
|
|
11
|
-
|
|
12
|
-
For example:
|
|
13
|
-
|
|
14
|
-
- `core/platform/custom-objects/*` owns typed custom-object schema and runtime helpers
|
|
15
|
-
- `core/platform/manifest/custom-objects/*` owns manifest registration, typed conditions, typed validations/rules/workflows, typed list-view helpers, typed page-layout helpers, function wiring helpers, and manifest field-resolution helpers for those custom-object definitions
|
|
16
|
-
|
|
17
|
-
Current author-facing golden paths in this manifest layer:
|
|
18
|
-
|
|
19
|
-
The custom-object review path should read top-down: registration/conditions/rules/workflows/actions/existing-manifest rebinding first, then the SDUI helper family as an additive UI-specific lane.
|
|
20
|
-
|
|
21
|
-
- use `defineTypedWorkflowFromFunctionFile(...)` when one workflow owns one colocated function file and you want the handler loaded from disk plus wired into the workflow in one step
|
|
22
|
-
- use `defineTypedCustomObjectActionFromFunctionFile(...)` when one custom-object action owns one colocated function file and you want the action plus `ManifestFunction` created together
|
|
23
|
-
- use `bindExistingManifestCustomObject(...)` when extending an existing manifest through the typed custom-object lane instead of manually loading raw object, field, section, layout, and action classes
|
|
24
|
-
- treat raw `lib/manifest` field/section construction as the explicit escape hatch when an existing-manifest mutation needs to create brand-new manifest components that do not yet have a dedicated typed helper
|
|
25
|
-
- use `defineTypedRule(..., { actions: (rules) => [...] })` as the default rule-authoring path, and keep `createTypedRuleHelpers(...)` as the more explicit escape hatch when a caller wants to reuse one helper namespace across multiple rules
|
|
26
|
-
- use `createManifestConditionHelpers(...)` callback inputs for typed conditions, prefer `c.where('field_name').eq(...)` plus `c.all(...)` / `c.any(...)` / `c.none(...)` for the higher-order condition path, use `typedCondition(...)` when a bounded parsed-string condition is clearer, and keep `c.raw(...)` as the explicit escape hatch for unsupported condition snippets
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CustomObjectAction,
|
|
3
|
-
type CustomObjectActionProps,
|
|
4
|
-
type ManifestFunction,
|
|
5
|
-
} from '../../../../lib/manifest';
|
|
6
|
-
import type { ManifestScope } from '../../../../lib/manifest/manifest-builder';
|
|
7
|
-
import type { AnyCustomObjectDefinition } from '../../custom-objects/types';
|
|
8
|
-
import { defineManifestFunctionFromFile, type ManifestFunctionFromFileProps } from './function-file';
|
|
9
|
-
import type { ManifestRegistration } from './types';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Initialization properties for {@link defineTypedCustomObjectAction}.
|
|
13
|
-
*
|
|
14
|
-
* @typeParam TDefinition - Typed custom-object definition whose object action is being authored.
|
|
15
|
-
*/
|
|
16
|
-
export interface TypedCustomObjectActionProps<TDefinition extends AnyCustomObjectDefinition>
|
|
17
|
-
extends Omit<CustomObjectActionProps, 'function'> {
|
|
18
|
-
/** Existing manifest function invoked by this action. */
|
|
19
|
-
readonly function: ManifestFunction;
|
|
20
|
-
/** Phantom type anchor that keeps the props definition-scoped in editor hover/help. */
|
|
21
|
-
readonly __typedActionDefinition__?: TDefinition;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Initialization properties for {@link defineTypedCustomObjectActionFromFunctionFile}.
|
|
26
|
-
*
|
|
27
|
-
* @typeParam TDefinition - Typed custom-object definition whose object action is being authored.
|
|
28
|
-
*/
|
|
29
|
-
export interface TypedCustomObjectActionFromFunctionFileProps<TDefinition extends AnyCustomObjectDefinition>
|
|
30
|
-
extends Omit<TypedCustomObjectActionProps<TDefinition>, 'function'> {
|
|
31
|
-
/** Function metadata and source-file location for the action handler. */
|
|
32
|
-
readonly function: ManifestFunctionFromFileProps;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** Result returned by {@link defineTypedCustomObjectActionFromFunctionFile}. */
|
|
36
|
-
export interface TypedCustomObjectActionFromFunctionFileResult {
|
|
37
|
-
/** Manifest function created from the provided source file. */
|
|
38
|
-
readonly function: ManifestFunction;
|
|
39
|
-
/** Custom-object action wired to the created manifest function. */
|
|
40
|
-
readonly action: CustomObjectAction;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Defines one custom-object action for a typed manifest registration.
|
|
45
|
-
*
|
|
46
|
-
* Prefer {@link defineTypedCustomObjectActionFromFunctionFile} for the common
|
|
47
|
-
* colocated-handler path. Use this lower-level form when the backing manifest
|
|
48
|
-
* function already exists separately and you only need to wire the action.
|
|
49
|
-
*
|
|
50
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
51
|
-
* @param props - Action metadata plus the backing manifest function.
|
|
52
|
-
* @returns Low-level custom-object action manifest instance.
|
|
53
|
-
* @typeParam TDefinition - Typed custom-object definition whose action is being authored.
|
|
54
|
-
*/
|
|
55
|
-
export function defineTypedCustomObjectAction<TDefinition extends AnyCustomObjectDefinition>(
|
|
56
|
-
registration: ManifestRegistration<TDefinition>,
|
|
57
|
-
props: TypedCustomObjectActionProps<TDefinition>,
|
|
58
|
-
): CustomObjectAction {
|
|
59
|
-
return new CustomObjectAction(registration.object, props);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Defines one custom-object action and its backing manifest function from a source file.
|
|
64
|
-
*
|
|
65
|
-
* This is the intended golden path when one custom-object action owns one
|
|
66
|
-
* colocated handler file.
|
|
67
|
-
*
|
|
68
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
69
|
-
* @param props - Action metadata plus the function source-file location.
|
|
70
|
-
* @returns Created manifest function plus the action wired to it.
|
|
71
|
-
* @typeParam TDefinition - Typed custom-object definition whose action is being authored.
|
|
72
|
-
*/
|
|
73
|
-
export function defineTypedCustomObjectActionFromFunctionFile<TDefinition extends AnyCustomObjectDefinition>(
|
|
74
|
-
scope: ManifestScope,
|
|
75
|
-
registration: ManifestRegistration<TDefinition>,
|
|
76
|
-
props: TypedCustomObjectActionFromFunctionFileProps<TDefinition>,
|
|
77
|
-
): TypedCustomObjectActionFromFunctionFileResult {
|
|
78
|
-
const { function: functionProps, ...actionProps } = props;
|
|
79
|
-
const createdFunction = defineManifestFunctionFromFile(scope, functionProps);
|
|
80
|
-
return {
|
|
81
|
-
function: createdFunction,
|
|
82
|
-
action: defineTypedCustomObjectAction(registration, {
|
|
83
|
-
...actionProps,
|
|
84
|
-
function: createdFunction,
|
|
85
|
-
}),
|
|
86
|
-
};
|
|
87
|
-
}
|