@rippling/rippling-sdk 0.2.0-alpha.38 → 0.2.0-alpha.40
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/existing-manifest-mutations/existing-manifest-mutations.ts +240 -0
- package/lib/manifest/app.d.mts +11 -1
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +11 -1
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +42 -1
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +42 -1
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/category.d.mts +10 -1
- package/lib/manifest/category.d.mts.map +1 -1
- package/lib/manifest/category.d.ts +10 -1
- package/lib/manifest/category.d.ts.map +1 -1
- package/lib/manifest/category.js +23 -1
- package/lib/manifest/category.js.map +1 -1
- package/lib/manifest/category.mjs +23 -1
- package/lib/manifest/category.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts +13 -0
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
- package/lib/manifest/custom-object-field-section.d.ts +13 -0
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
- package/lib/manifest/custom-object-field-section.js +22 -1
- package/lib/manifest/custom-object-field-section.js.map +1 -1
- package/lib/manifest/custom-object-field-section.mjs +22 -1
- package/lib/manifest/custom-object-field-section.mjs.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.mts +206 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +206 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +603 -1
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +603 -1
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +11 -1
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +11 -1
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +55 -2
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +55 -2
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/existing-manifest-context.d.mts +87 -0
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -0
- package/lib/manifest/existing-manifest-context.d.ts +87 -0
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -0
- package/lib/manifest/existing-manifest-context.js +511 -0
- package/lib/manifest/existing-manifest-context.js.map +1 -0
- package/lib/manifest/existing-manifest-context.mjs +506 -0
- package/lib/manifest/existing-manifest-context.mjs.map +1 -0
- package/lib/manifest/field.d.mts +24 -0
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +24 -0
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +114 -1
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +114 -1
- package/lib/manifest/field.mjs.map +1 -1
- package/lib/manifest/index.d.mts +8 -7
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +8 -7
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js +3 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs +5 -4
- package/lib/manifest/index.mjs.map +1 -1
- package/lib/manifest/list-view.d.mts +17 -0
- package/lib/manifest/list-view.d.mts.map +1 -1
- package/lib/manifest/list-view.d.ts +17 -0
- package/lib/manifest/list-view.d.ts.map +1 -1
- package/lib/manifest/list-view.js +38 -1
- package/lib/manifest/list-view.js.map +1 -1
- package/lib/manifest/list-view.mjs +38 -1
- package/lib/manifest/list-view.mjs.map +1 -1
- package/lib/manifest/manifest-builder.d.mts +59 -6
- package/lib/manifest/manifest-builder.d.mts.map +1 -1
- package/lib/manifest/manifest-builder.d.ts +59 -6
- package/lib/manifest/manifest-builder.d.ts.map +1 -1
- package/lib/manifest/manifest-builder.js +61 -3
- package/lib/manifest/manifest-builder.js.map +1 -1
- package/lib/manifest/manifest-builder.mjs +61 -3
- package/lib/manifest/manifest-builder.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +10 -1
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +10 -1
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +36 -1
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +36 -1
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/rule.d.mts +17 -0
- package/lib/manifest/rule.d.mts.map +1 -1
- package/lib/manifest/rule.d.ts +17 -0
- package/lib/manifest/rule.d.ts.map +1 -1
- package/lib/manifest/rule.js +45 -1
- package/lib/manifest/rule.js.map +1 -1
- package/lib/manifest/rule.mjs +45 -1
- package/lib/manifest/rule.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +10 -1
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +10 -1
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +28 -1
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +28 -1
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/lib/manifest/validation.d.mts +17 -0
- package/lib/manifest/validation.d.mts.map +1 -1
- package/lib/manifest/validation.d.ts +17 -0
- package/lib/manifest/validation.d.ts.map +1 -1
- package/lib/manifest/validation.js +31 -1
- package/lib/manifest/validation.js.map +1 -1
- package/lib/manifest/validation.mjs +31 -1
- package/lib/manifest/validation.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/app.ts +46 -2
- package/src/lib/manifest/category.ts +28 -2
- package/src/lib/manifest/custom-object-field-section.ts +37 -1
- package/src/lib/manifest/custom-object-page-layout.ts +878 -1
- package/src/lib/manifest/custom-object.ts +58 -3
- package/src/lib/manifest/existing-manifest-context.ts +673 -0
- package/src/lib/manifest/field.ts +140 -1
- package/src/lib/manifest/index.ts +49 -4
- package/src/lib/manifest/list-view.ts +50 -1
- package/src/lib/manifest/manifest-builder.ts +114 -4
- package/src/lib/manifest/manifest-function.ts +36 -2
- package/src/lib/manifest/rule.ts +60 -1
- package/src/lib/manifest/sdui-page.ts +37 -2
- package/src/lib/manifest/validation.ts +48 -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
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Existing manifest mutations.
|
|
3
|
+
*
|
|
4
|
+
* This example keeps the existing manifest JSON inline, hydrates it back into
|
|
5
|
+
* SDK objects, removes layout content, adds different layout content, and
|
|
6
|
+
* prints the updated manifest JSON.
|
|
7
|
+
*
|
|
8
|
+
* Run:
|
|
9
|
+
* yarn -s tsn examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts \
|
|
10
|
+
* > examples/manifest/existing-manifest-mutations/manifest.updated.json
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
CustomObject,
|
|
15
|
+
CustomObjectFieldSection,
|
|
16
|
+
CustomObjectPageLayout,
|
|
17
|
+
type ExistingManifest,
|
|
18
|
+
ManifestBuilder,
|
|
19
|
+
SelectField,
|
|
20
|
+
TextField,
|
|
21
|
+
} from '@rippling/rippling-sdk/lib/manifest';
|
|
22
|
+
|
|
23
|
+
const existingManifestJson: ExistingManifest = {
|
|
24
|
+
metadata: {
|
|
25
|
+
key: 'gym_membership_management',
|
|
26
|
+
name: 'Gym Membership Management',
|
|
27
|
+
description: 'Small inline manifest used by the existing-manifest mutation example',
|
|
28
|
+
},
|
|
29
|
+
components: [
|
|
30
|
+
{
|
|
31
|
+
type: 'CUSTOM_CATEGORY',
|
|
32
|
+
api_name: 'gym__c',
|
|
33
|
+
name: 'Gym',
|
|
34
|
+
description: 'Memberships, staff, schedules, and attendance',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'CUSTOM_OBJECT',
|
|
38
|
+
api_name: 'gym_member__c',
|
|
39
|
+
name: 'Member',
|
|
40
|
+
plural_label: 'Members',
|
|
41
|
+
category_api_name: 'gym__c',
|
|
42
|
+
description: 'Gym member profile, contact, and membership status',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'CUSTOM_OBJECT_FIELD_SECTION',
|
|
46
|
+
section_id: 'sec_gm_profile',
|
|
47
|
+
model_name: 'gym_member__c',
|
|
48
|
+
name: 'Profile',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'CUSTOM_OBJECT_FIELD_SECTION',
|
|
52
|
+
section_id: 'sec_gm_membership',
|
|
53
|
+
model_name: 'gym_member__c',
|
|
54
|
+
name: 'Membership',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: 'CUSTOM_OBJECT_FIELD',
|
|
58
|
+
custom_object_api_name: 'gym_member__c',
|
|
59
|
+
field_api_name: 'first_name__c',
|
|
60
|
+
field_display_name: 'First name',
|
|
61
|
+
data_type: { field_type: 'TEXT', max_length: 80 },
|
|
62
|
+
is_required: true,
|
|
63
|
+
is_unique: false,
|
|
64
|
+
is_indexed: false,
|
|
65
|
+
is_standard: false,
|
|
66
|
+
section: 'sec_gm_profile',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'CUSTOM_OBJECT_FIELD',
|
|
70
|
+
custom_object_api_name: 'gym_member__c',
|
|
71
|
+
field_api_name: 'last_name__c',
|
|
72
|
+
field_display_name: 'Last name',
|
|
73
|
+
data_type: { field_type: 'TEXT', max_length: 80 },
|
|
74
|
+
is_required: true,
|
|
75
|
+
is_unique: false,
|
|
76
|
+
is_indexed: false,
|
|
77
|
+
is_standard: false,
|
|
78
|
+
section: 'sec_gm_profile',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'CUSTOM_OBJECT_FIELD',
|
|
82
|
+
custom_object_api_name: 'gym_member__c',
|
|
83
|
+
field_api_name: 'phone__c',
|
|
84
|
+
field_display_name: 'Phone',
|
|
85
|
+
data_type: { field_type: 'PHONE_NUMBER' },
|
|
86
|
+
is_required: false,
|
|
87
|
+
is_unique: false,
|
|
88
|
+
is_indexed: false,
|
|
89
|
+
is_standard: false,
|
|
90
|
+
section: 'sec_gm_profile',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: 'CUSTOM_OBJECT_FIELD',
|
|
94
|
+
custom_object_api_name: 'gym_member__c',
|
|
95
|
+
field_api_name: 'membership_status__c',
|
|
96
|
+
field_display_name: 'Membership status',
|
|
97
|
+
data_type: { field_type: 'SELECT', options_list: ['Active', 'Frozen', 'Cancelled', 'Trial'] },
|
|
98
|
+
is_required: true,
|
|
99
|
+
is_unique: false,
|
|
100
|
+
is_indexed: false,
|
|
101
|
+
is_standard: false,
|
|
102
|
+
section: 'sec_gm_membership',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'CUSTOM_OBJECT_FIELD',
|
|
106
|
+
custom_object_api_name: 'gym_member__c',
|
|
107
|
+
field_api_name: 'join_date__c',
|
|
108
|
+
field_display_name: 'Join date',
|
|
109
|
+
data_type: { field_type: 'DATE' },
|
|
110
|
+
is_required: false,
|
|
111
|
+
is_unique: false,
|
|
112
|
+
is_indexed: false,
|
|
113
|
+
is_standard: false,
|
|
114
|
+
section: 'sec_gm_membership',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
type: 'CUSTOM_OBJECT_PAGE_LAYOUT',
|
|
118
|
+
layout_id: 'layout_gym_member',
|
|
119
|
+
api_name: 'default',
|
|
120
|
+
object_rql_name: 'gym_member__c',
|
|
121
|
+
name: 'Member',
|
|
122
|
+
system_created: false,
|
|
123
|
+
tab_edits: {
|
|
124
|
+
newTabs: [
|
|
125
|
+
{
|
|
126
|
+
key: 'member',
|
|
127
|
+
name: 'Member',
|
|
128
|
+
type: 'tab_with_sections',
|
|
129
|
+
sections: [
|
|
130
|
+
{
|
|
131
|
+
key: 'profile',
|
|
132
|
+
name: 'Profile',
|
|
133
|
+
type: 'fields_section',
|
|
134
|
+
fields: [
|
|
135
|
+
{ fieldRqlName: 'first_name__c' },
|
|
136
|
+
{ fieldRqlName: 'last_name__c' },
|
|
137
|
+
{ fieldRqlName: 'phone__c' },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: 'membership',
|
|
142
|
+
name: 'Membership',
|
|
143
|
+
type: 'fields_section',
|
|
144
|
+
fields: [{ fieldRqlName: 'membership_status__c' }, { fieldRqlName: 'join_date__c' }],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
systemTabEdits: {},
|
|
150
|
+
tabsOrder: ['member'],
|
|
151
|
+
},
|
|
152
|
+
header_edits: {
|
|
153
|
+
newTitleField: 'first_name__c',
|
|
154
|
+
newDescriptionField: 'membership_status__c',
|
|
155
|
+
},
|
|
156
|
+
visibility_conditions: {},
|
|
157
|
+
blueprint_key: 'gym_member__c',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const manifest = ManifestBuilder.loadFromExistingJson(existingManifestJson);
|
|
163
|
+
const memberObj = CustomObject.loadFromExisting('gym_member__c');
|
|
164
|
+
const profileSection = CustomObjectFieldSection.loadFromExisting('sec_gm_profile', {
|
|
165
|
+
customObjectApiName: memberObj.getApiName(),
|
|
166
|
+
});
|
|
167
|
+
const memberLayout = CustomObjectPageLayout.loadFromExisting('layout_gym_member', {
|
|
168
|
+
customObjectApiName: memberObj.getApiName(),
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
const preferredName = new TextField(memberObj, {
|
|
172
|
+
apiName: 'preferred_name__c',
|
|
173
|
+
displayName: 'Preferred name',
|
|
174
|
+
maxLength: 80,
|
|
175
|
+
section: profileSection,
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// Remove an existing field from one section, then add a different field there.
|
|
179
|
+
// The removed field component remains in the manifest; only this layout stops
|
|
180
|
+
// rendering it.
|
|
181
|
+
memberLayout
|
|
182
|
+
.removeField('phone__c', {
|
|
183
|
+
tabKey: 'member',
|
|
184
|
+
sectionKey: 'profile',
|
|
185
|
+
removeAll: false,
|
|
186
|
+
})
|
|
187
|
+
.addField(preferredName, {
|
|
188
|
+
tabKey: 'member',
|
|
189
|
+
sectionKey: 'profile',
|
|
190
|
+
fieldSection: profileSection,
|
|
191
|
+
position: 2,
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const marketingSection = new CustomObjectFieldSection(memberObj, {
|
|
195
|
+
sectionId: 'sec_gm_marketing',
|
|
196
|
+
name: 'Marketing',
|
|
197
|
+
});
|
|
198
|
+
const marketingOptIn = new SelectField(memberObj, {
|
|
199
|
+
apiName: 'marketing_opt_in__c',
|
|
200
|
+
displayName: 'Marketing opt-in',
|
|
201
|
+
options: ['Yes', 'No', 'Unknown'],
|
|
202
|
+
section: marketingSection,
|
|
203
|
+
});
|
|
204
|
+
const referralSource = new TextField(memberObj, {
|
|
205
|
+
apiName: 'referral_source__c',
|
|
206
|
+
displayName: 'Referral source',
|
|
207
|
+
maxLength: 120,
|
|
208
|
+
section: marketingSection,
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// Remove one existing section from the layout, then add a different one.
|
|
212
|
+
// The removed section component and its fields remain in the manifest.
|
|
213
|
+
memberLayout
|
|
214
|
+
.removeSection('membership', {
|
|
215
|
+
tabKey: 'member',
|
|
216
|
+
removeAll: false,
|
|
217
|
+
})
|
|
218
|
+
.addSection(
|
|
219
|
+
{
|
|
220
|
+
key: 'marketing',
|
|
221
|
+
name: 'Marketing',
|
|
222
|
+
type: 'fields_section',
|
|
223
|
+
section: marketingSection,
|
|
224
|
+
fields: [marketingOptIn, referralSource],
|
|
225
|
+
layout: 'two_column',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
tabKey: 'member',
|
|
229
|
+
position: 'end',
|
|
230
|
+
},
|
|
231
|
+
)
|
|
232
|
+
.addHeaderField(preferredName, {
|
|
233
|
+
key: 'preferred_name_header',
|
|
234
|
+
canBeDeleted: true,
|
|
235
|
+
canBeMoved: true,
|
|
236
|
+
})
|
|
237
|
+
.setTitleField(preferredName)
|
|
238
|
+
.removeDescriptionField();
|
|
239
|
+
|
|
240
|
+
console.log(manifest.preview());
|
package/lib/manifest/app.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CustomObject } from "./custom-object.mjs";
|
|
2
|
-
import type
|
|
2
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.mjs";
|
|
3
|
+
import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.mjs";
|
|
3
4
|
import { SduiPage } from "./sdui-page.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* A single page entry in an {@link App}.
|
|
@@ -83,6 +84,8 @@ export interface AppProps {
|
|
|
83
84
|
* @see {@link SduiPage} — SDUI surface tab source.
|
|
84
85
|
*/
|
|
85
86
|
export declare class App {
|
|
87
|
+
static readonly componentType: "CUSTOM_APP";
|
|
88
|
+
static toDeletionIdentifier(apiName: string): ManifestComponentDeletion;
|
|
86
89
|
private readonly _apiName;
|
|
87
90
|
private readonly _name;
|
|
88
91
|
private readonly _description;
|
|
@@ -95,6 +98,13 @@ export declare class App {
|
|
|
95
98
|
* @param props - Initialization properties.
|
|
96
99
|
*/
|
|
97
100
|
constructor(scope: ManifestScope, props: AppProps);
|
|
101
|
+
/**
|
|
102
|
+
* Loads this app from the active existing-manifest JSON context.
|
|
103
|
+
*/
|
|
104
|
+
static loadFromExisting(apiName: string, options?: ExistingManifestContextOptions): App;
|
|
105
|
+
/** @internal Hydrates an app from existing manifest wire JSON. */
|
|
106
|
+
static _fromExistingComponent(scope: ManifestScope, component: Record<string, any>): App;
|
|
107
|
+
private static appIconFromExistingComponent;
|
|
98
108
|
/**
|
|
99
109
|
* Returns the api_name of this app (e.g. `'gym_membership_management_app'`).
|
|
100
110
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":"OAAO,EAAE,YAAY,EAAE;OAChB,KAAK,EAAE,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"app.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":"OAAO,EAAE,YAAY,EAAE;OAChB,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE;OACjD,EAAE,QAAQ,EAAE;AAEnB;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;CACnB;AAyBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,GAAG;IACd,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAG,YAAY,CAAU;IAEtD,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB;IAOvE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqB;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;IAC5C,2DAA2D;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAE/C;;;OAGG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ;IAUjD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,8BAAmC,GAAG,GAAG;IAI3F,kEAAkE;IAClE,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG;IAcxF,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAO3C;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAc9B"}
|
package/lib/manifest/app.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CustomObject } from "./custom-object.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.js";
|
|
3
|
+
import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.js";
|
|
3
4
|
import { SduiPage } from "./sdui-page.js";
|
|
4
5
|
/**
|
|
5
6
|
* A single page entry in an {@link App}.
|
|
@@ -83,6 +84,8 @@ export interface AppProps {
|
|
|
83
84
|
* @see {@link SduiPage} — SDUI surface tab source.
|
|
84
85
|
*/
|
|
85
86
|
export declare class App {
|
|
87
|
+
static readonly componentType: "CUSTOM_APP";
|
|
88
|
+
static toDeletionIdentifier(apiName: string): ManifestComponentDeletion;
|
|
86
89
|
private readonly _apiName;
|
|
87
90
|
private readonly _name;
|
|
88
91
|
private readonly _description;
|
|
@@ -95,6 +98,13 @@ export declare class App {
|
|
|
95
98
|
* @param props - Initialization properties.
|
|
96
99
|
*/
|
|
97
100
|
constructor(scope: ManifestScope, props: AppProps);
|
|
101
|
+
/**
|
|
102
|
+
* Loads this app from the active existing-manifest JSON context.
|
|
103
|
+
*/
|
|
104
|
+
static loadFromExisting(apiName: string, options?: ExistingManifestContextOptions): App;
|
|
105
|
+
/** @internal Hydrates an app from existing manifest wire JSON. */
|
|
106
|
+
static _fromExistingComponent(scope: ManifestScope, component: Record<string, any>): App;
|
|
107
|
+
private static appIconFromExistingComponent;
|
|
98
108
|
/**
|
|
99
109
|
* Returns the api_name of this app (e.g. `'gym_membership_management_app'`).
|
|
100
110
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":"OAAO,EAAE,YAAY,EAAE;OAChB,KAAK,EAAE,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":"OAAO,EAAE,YAAY,EAAE;OAChB,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE;OACjD,EAAE,QAAQ,EAAE;AAEnB;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,WAAW,CA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});
|
|
3
3
|
exports.App = void 0;
|
|
4
4
|
const custom_object_1 = require("./custom-object.js");
|
|
5
|
+
const existing_manifest_context_1 = require("./existing-manifest-context.js");
|
|
5
6
|
function resolvePage(entry) {
|
|
6
7
|
if (entry instanceof custom_object_1.CustomObject) {
|
|
7
8
|
const apiName = entry.getApiName();
|
|
@@ -20,6 +21,11 @@ function resolvePage(entry) {
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
function cloneJson(value) {
|
|
25
|
+
if (value == null)
|
|
26
|
+
return value;
|
|
27
|
+
return JSON.parse(JSON.stringify(value));
|
|
28
|
+
}
|
|
23
29
|
/**
|
|
24
30
|
* Defines a Rippling app and registers it with the manifest.
|
|
25
31
|
*
|
|
@@ -43,6 +49,12 @@ function resolvePage(entry) {
|
|
|
43
49
|
* @see {@link SduiPage} — SDUI surface tab source.
|
|
44
50
|
*/
|
|
45
51
|
class App {
|
|
52
|
+
static toDeletionIdentifier(apiName) {
|
|
53
|
+
return {
|
|
54
|
+
type: App.componentType,
|
|
55
|
+
api_name: apiName,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
46
58
|
/**
|
|
47
59
|
* @param scope - The manifest to register this app with.
|
|
48
60
|
* @param props - Initialization properties.
|
|
@@ -56,6 +68,34 @@ class App {
|
|
|
56
68
|
this._pages = (props.pages ?? []).map(resolvePage);
|
|
57
69
|
scope._register(this);
|
|
58
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Loads this app from the active existing-manifest JSON context.
|
|
73
|
+
*/
|
|
74
|
+
static loadFromExisting(apiName, options = {}) {
|
|
75
|
+
return (0, existing_manifest_context_1.getExistingManifestContext)(options).loadApp(apiName);
|
|
76
|
+
}
|
|
77
|
+
/** @internal Hydrates an app from existing manifest wire JSON. */
|
|
78
|
+
static _fromExistingComponent(scope, component) {
|
|
79
|
+
const app = Object.create(App.prototype);
|
|
80
|
+
Object.assign(app, {
|
|
81
|
+
_apiName: component['api_name'],
|
|
82
|
+
_name: component['name'] ?? component['api_name'],
|
|
83
|
+
_description: component['description'],
|
|
84
|
+
_appType: component['app_type'],
|
|
85
|
+
_icon: App.appIconFromExistingComponent(component['icon']),
|
|
86
|
+
_pages: cloneJson(component['pages'] ?? []),
|
|
87
|
+
});
|
|
88
|
+
scope._register(app);
|
|
89
|
+
return app;
|
|
90
|
+
}
|
|
91
|
+
static appIconFromExistingComponent(value) {
|
|
92
|
+
if (value == null || typeof value !== 'object')
|
|
93
|
+
return undefined;
|
|
94
|
+
const wire = value;
|
|
95
|
+
if (typeof wire['s3_bucket'] !== 'string' || typeof wire['s3_key'] !== 'string')
|
|
96
|
+
return undefined;
|
|
97
|
+
return { s3Bucket: wire['s3_bucket'], s3Key: wire['s3_key'] };
|
|
98
|
+
}
|
|
59
99
|
/**
|
|
60
100
|
* Returns the api_name of this app (e.g. `'gym_membership_management_app'`).
|
|
61
101
|
*/
|
|
@@ -75,7 +115,7 @@ class App {
|
|
|
75
115
|
*/
|
|
76
116
|
toDict() {
|
|
77
117
|
const component = {
|
|
78
|
-
type:
|
|
118
|
+
type: App.componentType,
|
|
79
119
|
api_name: this._apiName,
|
|
80
120
|
name: this._name,
|
|
81
121
|
};
|
|
@@ -92,4 +132,5 @@ class App {
|
|
|
92
132
|
}
|
|
93
133
|
}
|
|
94
134
|
exports.App = App;
|
|
135
|
+
App.componentType = 'CUSTOM_APP';
|
|
95
136
|
//# sourceMappingURL=app.js.map
|
package/lib/manifest/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":";;;AAAA,sDAA+C;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":";;;AAAA,sDAA+C;AAC/C,8EAA8G;AAkE9G,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,KAAK,YAAY,4BAAY,EAAE,CAAC;QAClC,MA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AQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,MAAM,SAAS,GAAwB;YACrC,IAAI,EAAE,GAAG,CAAC,aAAa;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,KAAK;SACjB,CAAC;QACF,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI;YAAE,SAAS,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAC5E,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnF,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI;YAAE,SAAS,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QACjE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YAAE,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACpF,OAAO,SAAS,CAAC;IACnB,CAAC;;AA7FH,kBA8FC;AA7FiB,iBAAa,GAAG,YAAqB,CAAC"}
|
package/lib/manifest/app.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CustomObject } from "./custom-object.mjs";
|
|
2
|
+
import { getExistingManifestContext } from "./existing-manifest-context.mjs";
|
|
2
3
|
function resolvePage(entry) {
|
|
3
4
|
if (entry instanceof CustomObject) {
|
|
4
5
|
const apiName = entry.getApiName();
|
|
@@ -17,6 +18,11 @@ function resolvePage(entry) {
|
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
function cloneJson(value) {
|
|
22
|
+
if (value == null)
|
|
23
|
+
return value;
|
|
24
|
+
return JSON.parse(JSON.stringify(value));
|
|
25
|
+
}
|
|
20
26
|
/**
|
|
21
27
|
* Defines a Rippling app and registers it with the manifest.
|
|
22
28
|
*
|
|
@@ -40,6 +46,12 @@ function resolvePage(entry) {
|
|
|
40
46
|
* @see {@link SduiPage} — SDUI surface tab source.
|
|
41
47
|
*/
|
|
42
48
|
export class App {
|
|
49
|
+
static toDeletionIdentifier(apiName) {
|
|
50
|
+
return {
|
|
51
|
+
type: App.componentType,
|
|
52
|
+
api_name: apiName,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
43
55
|
/**
|
|
44
56
|
* @param scope - The manifest to register this app with.
|
|
45
57
|
* @param props - Initialization properties.
|
|
@@ -53,6 +65,34 @@ export class App {
|
|
|
53
65
|
this._pages = (props.pages ?? []).map(resolvePage);
|
|
54
66
|
scope._register(this);
|
|
55
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Loads this app from the active existing-manifest JSON context.
|
|
70
|
+
*/
|
|
71
|
+
static loadFromExisting(apiName, options = {}) {
|
|
72
|
+
return getExistingManifestContext(options).loadApp(apiName);
|
|
73
|
+
}
|
|
74
|
+
/** @internal Hydrates an app from existing manifest wire JSON. */
|
|
75
|
+
static _fromExistingComponent(scope, component) {
|
|
76
|
+
const app = Object.create(App.prototype);
|
|
77
|
+
Object.assign(app, {
|
|
78
|
+
_apiName: component['api_name'],
|
|
79
|
+
_name: component['name'] ?? component['api_name'],
|
|
80
|
+
_description: component['description'],
|
|
81
|
+
_appType: component['app_type'],
|
|
82
|
+
_icon: App.appIconFromExistingComponent(component['icon']),
|
|
83
|
+
_pages: cloneJson(component['pages'] ?? []),
|
|
84
|
+
});
|
|
85
|
+
scope._register(app);
|
|
86
|
+
return app;
|
|
87
|
+
}
|
|
88
|
+
static appIconFromExistingComponent(value) {
|
|
89
|
+
if (value == null || typeof value !== 'object')
|
|
90
|
+
return undefined;
|
|
91
|
+
const wire = value;
|
|
92
|
+
if (typeof wire['s3_bucket'] !== 'string' || typeof wire['s3_key'] !== 'string')
|
|
93
|
+
return undefined;
|
|
94
|
+
return { s3Bucket: wire['s3_bucket'], s3Key: wire['s3_key'] };
|
|
95
|
+
}
|
|
56
96
|
/**
|
|
57
97
|
* Returns the api_name of this app (e.g. `'gym_membership_management_app'`).
|
|
58
98
|
*/
|
|
@@ -72,7 +112,7 @@ export class App {
|
|
|
72
112
|
*/
|
|
73
113
|
toDict() {
|
|
74
114
|
const component = {
|
|
75
|
-
type:
|
|
115
|
+
type: App.componentType,
|
|
76
116
|
api_name: this._apiName,
|
|
77
117
|
name: this._name,
|
|
78
118
|
};
|
|
@@ -88,4 +128,5 @@ export class App {
|
|
|
88
128
|
return component;
|
|
89
129
|
}
|
|
90
130
|
}
|
|
131
|
+
App.componentType = 'CUSTOM_APP';
|
|
91
132
|
//# sourceMappingURL=app.mjs.map
|
package/lib/manifest/app.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.mjs","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":"OAAO,EAAE,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"app.mjs","sourceRoot":"","sources":["../../src/lib/manifest/app.ts"],"names":[],"mappings":"OAAO,EAAE,YAAY,EAAE;OAChB,EAAE,0BAA0B,EAAuC;AAkE1E,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;QACnC,OAAO;YACL,QAAQ,EAAE,OAAO;YACjB,SAAS,EAAE,aAAa;YACxB,eAAe,EAAE,OAAO;SACzB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC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YACvB,IAAI,EAAE,IAAI,CAAC,KAAK;SACjB,CAAC;QACF,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI;YAAE,SAAS,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAC5E,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnF,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI;YAAE,SAAS,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QACjE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YAAE,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACpF,OAAO,SAAS,CAAC;IACnB,CAAC;;AA5Fe,iBAAa,GAAG,YAAqB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.mjs";
|
|
2
|
+
import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.mjs";
|
|
2
3
|
/**
|
|
3
4
|
* Initialization properties for {@link Category}.
|
|
4
5
|
*/
|
|
@@ -55,6 +56,8 @@ export interface CategoryProps {
|
|
|
55
56
|
* @see {@link CustomObject} — references this category via instance or api_name string.
|
|
56
57
|
*/
|
|
57
58
|
export declare class Category {
|
|
59
|
+
static readonly componentType: "CUSTOM_CATEGORY";
|
|
60
|
+
static toDeletionIdentifier(apiName: string): ManifestComponentDeletion;
|
|
58
61
|
private readonly _apiName;
|
|
59
62
|
private readonly _name;
|
|
60
63
|
private readonly _description;
|
|
@@ -63,6 +66,12 @@ export declare class Category {
|
|
|
63
66
|
* @param props - Initialization properties.
|
|
64
67
|
*/
|
|
65
68
|
constructor(scope: ManifestScope, props: CategoryProps);
|
|
69
|
+
/**
|
|
70
|
+
* Loads this category from the active existing-manifest JSON context.
|
|
71
|
+
*/
|
|
72
|
+
static loadFromExisting(apiName: string, options?: ExistingManifestContextOptions): Category;
|
|
73
|
+
/** @internal Hydrates a category from existing manifest wire JSON. */
|
|
74
|
+
static _fromExistingComponent(scope: ManifestScope, component: Record<string, any>): Category;
|
|
66
75
|
/**
|
|
67
76
|
* Returns the api_name of this category (e.g. `'gym__c'`).
|
|
68
77
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/category.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"category.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/category.ts"],"names":[],"mappings":"OAAO,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAG,iBAAiB,CAAU;IAE3D,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB;IAOvE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC;;;OAGG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa;IAOtD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,8BAAmC,GAAG,QAAQ;IAIhG,sEAAsE;IACtE,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,QAAQ;IAQ7F;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAQ9B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.js";
|
|
2
|
+
import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.js";
|
|
2
3
|
/**
|
|
3
4
|
* Initialization properties for {@link Category}.
|
|
4
5
|
*/
|
|
@@ -55,6 +56,8 @@ export interface CategoryProps {
|
|
|
55
56
|
* @see {@link CustomObject} — references this category via instance or api_name string.
|
|
56
57
|
*/
|
|
57
58
|
export declare class Category {
|
|
59
|
+
static readonly componentType: "CUSTOM_CATEGORY";
|
|
60
|
+
static toDeletionIdentifier(apiName: string): ManifestComponentDeletion;
|
|
58
61
|
private readonly _apiName;
|
|
59
62
|
private readonly _name;
|
|
60
63
|
private readonly _description;
|
|
@@ -63,6 +66,12 @@ export declare class Category {
|
|
|
63
66
|
* @param props - Initialization properties.
|
|
64
67
|
*/
|
|
65
68
|
constructor(scope: ManifestScope, props: CategoryProps);
|
|
69
|
+
/**
|
|
70
|
+
* Loads this category from the active existing-manifest JSON context.
|
|
71
|
+
*/
|
|
72
|
+
static loadFromExisting(apiName: string, options?: ExistingManifestContextOptions): Category;
|
|
73
|
+
/** @internal Hydrates a category from existing manifest wire JSON. */
|
|
74
|
+
static _fromExistingComponent(scope: ManifestScope, component: Record<string, any>): Category;
|
|
66
75
|
/**
|
|
67
76
|
* Returns the api_name of this category (e.g. `'gym__c'`).
|
|
68
77
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/category.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/category.ts"],"names":[],"mappings":"OAAO,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAG,iBAAiB,CAAU;IAE3D,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB;IAOvE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC;;;OAGG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa;IAOtD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,8BAAmC,GAAG,QAAQ;IAIhG,sEAAsE;IACtE,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,QAAQ;IAQ7F;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAQ9B"}
|
package/lib/manifest/category.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Category = void 0;
|
|
4
|
+
const existing_manifest_context_1 = require("./existing-manifest-context.js");
|
|
4
5
|
/**
|
|
5
6
|
* Defines a category and registers it with the manifest.
|
|
6
7
|
*
|
|
@@ -32,6 +33,12 @@ exports.Category = void 0;
|
|
|
32
33
|
* @see {@link CustomObject} — references this category via instance or api_name string.
|
|
33
34
|
*/
|
|
34
35
|
class Category {
|
|
36
|
+
static toDeletionIdentifier(apiName) {
|
|
37
|
+
return {
|
|
38
|
+
type: Category.componentType,
|
|
39
|
+
api_name: apiName,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
35
42
|
/**
|
|
36
43
|
* @param scope - The manifest to register this category with.
|
|
37
44
|
* @param props - Initialization properties.
|
|
@@ -42,6 +49,20 @@ class Category {
|
|
|
42
49
|
this._description = props.description;
|
|
43
50
|
scope._register(this);
|
|
44
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Loads this category from the active existing-manifest JSON context.
|
|
54
|
+
*/
|
|
55
|
+
static loadFromExisting(apiName, options = {}) {
|
|
56
|
+
return (0, existing_manifest_context_1.getExistingManifestContext)(options).loadCategory(apiName);
|
|
57
|
+
}
|
|
58
|
+
/** @internal Hydrates a category from existing manifest wire JSON. */
|
|
59
|
+
static _fromExistingComponent(scope, component) {
|
|
60
|
+
return new Category(scope, {
|
|
61
|
+
apiName: component['api_name'],
|
|
62
|
+
name: component['name'] ?? component['api_name'],
|
|
63
|
+
description: component['description'] ?? '',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
45
66
|
/**
|
|
46
67
|
* Returns the api_name of this category (e.g. `'gym__c'`).
|
|
47
68
|
*/
|
|
@@ -61,7 +82,7 @@ class Category {
|
|
|
61
82
|
*/
|
|
62
83
|
toDict() {
|
|
63
84
|
return {
|
|
64
|
-
type:
|
|
85
|
+
type: Category.componentType,
|
|
65
86
|
api_name: this._apiName,
|
|
66
87
|
name: this._name,
|
|
67
88
|
description: this._description,
|
|
@@ -69,4 +90,5 @@ class Category {
|
|
|
69
90
|
}
|
|
70
91
|
}
|
|
71
92
|
exports.Category = Category;
|
|
93
|
+
Category.componentType = 'CUSTOM_CATEGORY';
|
|
72
94
|
//# sourceMappingURL=category.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../src/lib/manifest/category.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../src/lib/manifest/category.ts"],"names":[],"mappings":";;;AAAA,8EAA8G;AA6B9G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,QAAQ;IAGnB,MAAM,CAAC,oBAAoB,CAAC,OAAe;QACzC,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,aAAa;YAC5B,QAAQ,EAAE,OAAO;SAClB,CAAC;IACJ,CAAC;IAMD;;;OAGG;IACH,YAAY,KAAoB,EAAE,KAAoB;QACpD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;QACtC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAe,EAAE,UAA0C,EAAE;QACnF,OAAO,IAAA,sDAA0B,EAAC,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,sEAAsE;IACtE,MAAM,CAA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