@rippling/rippling-sdk 0.2.0-alpha.32 → 0.2.0-alpha.34
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/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +17 -0
- package/client.js.map +1 -1
- package/client.mjs +17 -0
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/lib/manifest/_helpers.d.mts +91 -0
- package/lib/manifest/_helpers.d.mts.map +1 -0
- package/lib/manifest/_helpers.d.ts +91 -0
- package/lib/manifest/_helpers.d.ts.map +1 -0
- package/lib/manifest/_helpers.js +65 -0
- package/lib/manifest/_helpers.js.map +1 -0
- package/lib/manifest/_helpers.mjs +61 -0
- package/lib/manifest/_helpers.mjs.map +1 -0
- package/lib/manifest/app.d.mts +45 -0
- package/lib/manifest/app.d.mts.map +1 -0
- package/lib/manifest/app.d.ts +45 -0
- package/lib/manifest/app.d.ts.map +1 -0
- package/lib/manifest/app.js +74 -0
- package/lib/manifest/app.js.map +1 -0
- package/lib/manifest/app.mjs +70 -0
- package/lib/manifest/app.mjs.map +1 -0
- package/lib/manifest/category.d.mts +23 -0
- package/lib/manifest/category.d.mts.map +1 -0
- package/lib/manifest/category.d.ts +23 -0
- package/lib/manifest/category.d.ts.map +1 -0
- package/lib/manifest/category.js +37 -0
- package/lib/manifest/category.js.map +1 -0
- package/lib/manifest/category.mjs +33 -0
- package/lib/manifest/category.mjs.map +1 -0
- package/lib/manifest/custom-object-field-section.d.mts +21 -0
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -0
- package/lib/manifest/custom-object-field-section.d.ts +21 -0
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -0
- package/lib/manifest/custom-object-field-section.js +42 -0
- package/lib/manifest/custom-object-field-section.js.map +1 -0
- package/lib/manifest/custom-object-field-section.mjs +38 -0
- package/lib/manifest/custom-object-field-section.mjs.map +1 -0
- package/lib/manifest/custom-object-page-layout.d.mts +158 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -0
- package/lib/manifest/custom-object-page-layout.d.ts +158 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -0
- package/lib/manifest/custom-object-page-layout.js +112 -0
- package/lib/manifest/custom-object-page-layout.js.map +1 -0
- package/lib/manifest/custom-object-page-layout.mjs +108 -0
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -0
- package/lib/manifest/custom-object.d.mts +52 -0
- package/lib/manifest/custom-object.d.mts.map +1 -0
- package/lib/manifest/custom-object.d.ts +52 -0
- package/lib/manifest/custom-object.d.ts.map +1 -0
- package/lib/manifest/custom-object.js +219 -0
- package/lib/manifest/custom-object.js.map +1 -0
- package/lib/manifest/custom-object.mjs +215 -0
- package/lib/manifest/custom-object.mjs.map +1 -0
- package/lib/manifest/field.d.mts +276 -0
- package/lib/manifest/field.d.mts.map +1 -0
- package/lib/manifest/field.d.ts +276 -0
- package/lib/manifest/field.d.ts.map +1 -0
- package/lib/manifest/field.js +418 -0
- package/lib/manifest/field.js.map +1 -0
- package/lib/manifest/field.mjs +395 -0
- package/lib/manifest/field.mjs.map +1 -0
- package/lib/manifest/index.d.mts +15 -0
- package/lib/manifest/index.d.mts.map +1 -0
- package/lib/manifest/index.d.ts +15 -0
- package/lib/manifest/index.d.ts.map +1 -0
- package/lib/manifest/index.js +53 -0
- package/lib/manifest/index.js.map +1 -0
- package/lib/manifest/index.mjs +18 -0
- package/lib/manifest/index.mjs.map +1 -0
- package/lib/manifest/list-view.d.mts +47 -0
- package/lib/manifest/list-view.d.mts.map +1 -0
- package/lib/manifest/list-view.d.ts +47 -0
- package/lib/manifest/list-view.d.ts.map +1 -0
- package/lib/manifest/list-view.js +73 -0
- package/lib/manifest/list-view.js.map +1 -0
- package/lib/manifest/list-view.mjs +69 -0
- package/lib/manifest/list-view.mjs.map +1 -0
- package/lib/manifest/manifest-builder.d.mts +44 -0
- package/lib/manifest/manifest-builder.d.mts.map +1 -0
- package/lib/manifest/manifest-builder.d.ts +44 -0
- package/lib/manifest/manifest-builder.d.ts.map +1 -0
- package/lib/manifest/manifest-builder.js +69 -0
- package/lib/manifest/manifest-builder.js.map +1 -0
- package/lib/manifest/manifest-builder.mjs +65 -0
- package/lib/manifest/manifest-builder.mjs.map +1 -0
- package/lib/manifest/manifest-function.d.mts +39 -0
- package/lib/manifest/manifest-function.d.mts.map +1 -0
- package/lib/manifest/manifest-function.d.ts +39 -0
- package/lib/manifest/manifest-function.d.ts.map +1 -0
- package/lib/manifest/manifest-function.js +56 -0
- package/lib/manifest/manifest-function.js.map +1 -0
- package/lib/manifest/manifest-function.mjs +52 -0
- package/lib/manifest/manifest-function.mjs.map +1 -0
- package/lib/manifest/rule.d.mts +50 -0
- package/lib/manifest/rule.d.mts.map +1 -0
- package/lib/manifest/rule.d.ts +50 -0
- package/lib/manifest/rule.d.ts.map +1 -0
- package/lib/manifest/rule.js +84 -0
- package/lib/manifest/rule.js.map +1 -0
- package/lib/manifest/rule.mjs +80 -0
- package/lib/manifest/rule.mjs.map +1 -0
- package/lib/manifest/sdui-page.d.mts +33 -0
- package/lib/manifest/sdui-page.d.mts.map +1 -0
- package/lib/manifest/sdui-page.d.ts +33 -0
- package/lib/manifest/sdui-page.d.ts.map +1 -0
- package/lib/manifest/sdui-page.js +52 -0
- package/lib/manifest/sdui-page.js.map +1 -0
- package/lib/manifest/sdui-page.mjs +48 -0
- package/lib/manifest/sdui-page.mjs.map +1 -0
- package/lib/manifest/validation.d.mts +41 -0
- package/lib/manifest/validation.d.mts.map +1 -0
- package/lib/manifest/validation.d.ts +41 -0
- package/lib/manifest/validation.d.ts.map +1 -0
- package/lib/manifest/validation.js +57 -0
- package/lib/manifest/validation.js.map +1 -0
- package/lib/manifest/validation.mjs +53 -0
- package/lib/manifest/validation.mjs.map +1 -0
- package/package.json +11 -1
- package/resources/draft-hires.d.mts +22 -0
- package/resources/draft-hires.d.mts.map +1 -1
- package/resources/draft-hires.d.ts +22 -0
- package/resources/draft-hires.d.ts.map +1 -1
- package/resources/earnings-inputs.d.mts +104 -1
- package/resources/earnings-inputs.d.mts.map +1 -1
- package/resources/earnings-inputs.d.ts +104 -1
- package/resources/earnings-inputs.d.ts.map +1 -1
- package/resources/earnings-inputs.js +17 -0
- package/resources/earnings-inputs.js.map +1 -1
- package/resources/earnings-inputs.mjs +17 -0
- package/resources/earnings-inputs.mjs.map +1 -1
- package/resources/files.d.mts +149 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +149 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +25 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +21 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/object-categories.d.mts +1 -1
- package/resources/object-categories.d.ts +1 -1
- package/resources/object-categories.js +1 -1
- package/resources/object-categories.mjs +1 -1
- package/resources/report-runs.d.mts +11 -11
- package/resources/report-runs.d.ts +11 -11
- package/resources/workflow-action-executions.d.mts +17 -2
- package/resources/workflow-action-executions.d.mts.map +1 -1
- package/resources/workflow-action-executions.d.ts +17 -2
- package/resources/workflow-action-executions.d.ts.map +1 -1
- package/src/client.ts +29 -0
- package/src/internal/types.ts +6 -8
- package/src/lib/manifest/_helpers.ts +164 -0
- package/src/lib/manifest/app.ts +108 -0
- package/src/lib/manifest/category.ts +51 -0
- package/src/lib/manifest/custom-object-field-section.ts +54 -0
- package/src/lib/manifest/custom-object-page-layout.ts +292 -0
- package/src/lib/manifest/custom-object.ts +269 -0
- package/src/lib/manifest/field.ts +632 -0
- package/src/lib/manifest/index.ts +114 -0
- package/src/lib/manifest/list-view.ts +103 -0
- package/src/lib/manifest/manifest-builder.ts +97 -0
- package/src/lib/manifest/manifest-function.ts +81 -0
- package/src/lib/manifest/rule.ts +125 -0
- package/src/lib/manifest/sdui-page.ts +72 -0
- package/src/lib/manifest/validation.ts +87 -0
- package/src/resources/draft-hires.ts +26 -0
- package/src/resources/earnings-inputs.ts +140 -0
- package/src/resources/files.ts +186 -0
- package/src/resources/index.ts +3 -0
- package/src/resources/object-categories.ts +1 -1
- package/src/resources/report-runs.ts +32 -32
- package/src/resources/workflow-action-executions.ts +22 -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,114 @@
|
|
|
1
|
+
/** Manifest builder public API (hand-written, not Stainless-generated). */
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
generateId,
|
|
5
|
+
type EdgeType,
|
|
6
|
+
type FieldType,
|
|
7
|
+
type FormulaFieldType,
|
|
8
|
+
type FunctionRuntime,
|
|
9
|
+
type ObjectScope,
|
|
10
|
+
type PageType,
|
|
11
|
+
type SortOrder,
|
|
12
|
+
type SummaryAggregation,
|
|
13
|
+
type SummaryFilterOperator,
|
|
14
|
+
type TriggerType,
|
|
15
|
+
type UpdateTriggerType,
|
|
16
|
+
type ValidationLevel,
|
|
17
|
+
type ValidationState,
|
|
18
|
+
} from './_helpers';
|
|
19
|
+
|
|
20
|
+
export { App, type AppIcon, type AppPage, type AppProps } from './app';
|
|
21
|
+
|
|
22
|
+
export { Category, type CategoryProps } from './category';
|
|
23
|
+
|
|
24
|
+
export { CustomObject, type CustomObjectProps, type IconConfig } from './custom-object';
|
|
25
|
+
|
|
26
|
+
export { CustomObjectFieldSection, type CustomObjectFieldSectionProps } from './custom-object-field-section';
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
CustomObjectPageLayout,
|
|
30
|
+
type CustomObjectPageLayoutProps,
|
|
31
|
+
type CustomTab,
|
|
32
|
+
type FieldsSection,
|
|
33
|
+
type HeaderEdits,
|
|
34
|
+
type NewHeaderField,
|
|
35
|
+
type PageLayoutSection,
|
|
36
|
+
type PageLayoutTab,
|
|
37
|
+
type SectionField,
|
|
38
|
+
type SectionFieldsLayout,
|
|
39
|
+
type SystemHeaderFieldEdit,
|
|
40
|
+
type SystemSectionEdit,
|
|
41
|
+
type SystemTabEdit,
|
|
42
|
+
type TabEdits,
|
|
43
|
+
type TabWithSections,
|
|
44
|
+
type VisibilityCondition,
|
|
45
|
+
type VisibilityConditions,
|
|
46
|
+
} from './custom-object-page-layout';
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
Field,
|
|
50
|
+
type FieldProps,
|
|
51
|
+
type SummaryFilter,
|
|
52
|
+
|
|
53
|
+
// Concrete field variants (one class per wire-level field type, mirroring
|
|
54
|
+
// AWS CDK's per-action-class pattern in `aws-codepipeline-actions`).
|
|
55
|
+
TextField,
|
|
56
|
+
type TextFieldProps,
|
|
57
|
+
LongTextField,
|
|
58
|
+
type LongTextFieldProps,
|
|
59
|
+
EmailField,
|
|
60
|
+
type EmailFieldProps,
|
|
61
|
+
UrlField,
|
|
62
|
+
type UrlFieldProps,
|
|
63
|
+
PhoneField,
|
|
64
|
+
type PhoneFieldProps,
|
|
65
|
+
NumberField,
|
|
66
|
+
type NumberFieldProps,
|
|
67
|
+
CurrencyField,
|
|
68
|
+
type CurrencyFieldProps,
|
|
69
|
+
PercentageField,
|
|
70
|
+
type PercentageFieldProps,
|
|
71
|
+
DateField,
|
|
72
|
+
type DateFieldProps,
|
|
73
|
+
DatetimeField,
|
|
74
|
+
type DatetimeFieldProps,
|
|
75
|
+
TimeField,
|
|
76
|
+
type TimeFieldProps,
|
|
77
|
+
SelectField,
|
|
78
|
+
type SelectFieldProps,
|
|
79
|
+
RadioField,
|
|
80
|
+
type RadioFieldProps,
|
|
81
|
+
BooleanField,
|
|
82
|
+
type BooleanFieldProps,
|
|
83
|
+
FileField,
|
|
84
|
+
type FileFieldProps,
|
|
85
|
+
LookupField,
|
|
86
|
+
type LookupFieldProps,
|
|
87
|
+
ParentChildField,
|
|
88
|
+
type ParentChildFieldProps,
|
|
89
|
+
FormulaField,
|
|
90
|
+
type FormulaFieldProps,
|
|
91
|
+
SummaryField,
|
|
92
|
+
type SummaryFieldProps,
|
|
93
|
+
} from './field';
|
|
94
|
+
|
|
95
|
+
export { ListViewDef, type ListViewDefProps } from './list-view';
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
ManifestBuilder,
|
|
99
|
+
type ManifestBuilderProps,
|
|
100
|
+
type ManifestComponent,
|
|
101
|
+
type ManifestScope,
|
|
102
|
+
} from './manifest-builder';
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
ManifestFunction,
|
|
106
|
+
ManifestFunction as Function,
|
|
107
|
+
type ManifestFunctionProps,
|
|
108
|
+
} from './manifest-function';
|
|
109
|
+
|
|
110
|
+
export { Rule, type RuleAction, type RuleProps } from './rule';
|
|
111
|
+
|
|
112
|
+
export { SduiPage, type SduiPageProps } from './sdui-page';
|
|
113
|
+
|
|
114
|
+
export { Validation, type ValidationProps } from './validation';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
3
|
+
*
|
|
4
|
+
* List view definitions for custom objects (column layout + sorting).
|
|
5
|
+
* Backend schema: CUSTOM_OBJECT_LIST_VIEW (v2)
|
|
6
|
+
*
|
|
7
|
+
* Construction is CDK-style: `new ListViewDef(customObject, props)` — the
|
|
8
|
+
* CO is the first positional arg, and the view auto-registers with the
|
|
9
|
+
* manifest via the CO's scope chain.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { generateId, type ObjectScope, type SortOrder } from './_helpers';
|
|
13
|
+
import type { CustomObject } from './custom-object';
|
|
14
|
+
import type { Field } from './field';
|
|
15
|
+
|
|
16
|
+
export interface ListViewDefProps {
|
|
17
|
+
/** Required. Display name of the view. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Required. Column definitions (live `Field` refs; at least one). */
|
|
20
|
+
fields: Field[];
|
|
21
|
+
/** Required. Whether the view is visible to all users. */
|
|
22
|
+
isPublic: boolean;
|
|
23
|
+
/** Identity override. Override the view identifier. @default generateId('view') */
|
|
24
|
+
viewId?: string;
|
|
25
|
+
/** Optional. Sort column (live `Field` ref). Required if `sortOrder` is set. */
|
|
26
|
+
orderBy?: Field;
|
|
27
|
+
/** Conditional. Sort direction — requires `orderBy`. */
|
|
28
|
+
sortOrder?: SortOrder;
|
|
29
|
+
/** Optional. Object scope. @default 'all' */
|
|
30
|
+
objectScope?: ObjectScope;
|
|
31
|
+
/** Optional. Free-form description. @default null */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Optional. Per-column configuration overrides. @default {} */
|
|
34
|
+
columnConfig?: Record<string, any>;
|
|
35
|
+
/** Optional. RQL filter expression. @default null */
|
|
36
|
+
rqlFilter?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class ListViewDef {
|
|
40
|
+
private readonly _viewId: string;
|
|
41
|
+
private readonly _customObjectApiName: string;
|
|
42
|
+
private readonly _name: string;
|
|
43
|
+
private readonly _fields: Field[];
|
|
44
|
+
private readonly _isPublic: boolean;
|
|
45
|
+
private readonly _orderBy: Field | undefined;
|
|
46
|
+
private readonly _sortOrder: SortOrder | undefined;
|
|
47
|
+
private readonly _objectScope: ObjectScope | undefined;
|
|
48
|
+
private readonly _description: string | undefined;
|
|
49
|
+
private readonly _columnConfig: Record<string, any> | undefined;
|
|
50
|
+
private readonly _rqlFilter: string | undefined;
|
|
51
|
+
|
|
52
|
+
/** Build a new view def and auto-register with the CO's scope. */
|
|
53
|
+
constructor(customObject: CustomObject, props: ListViewDefProps) {
|
|
54
|
+
if (!props.name) throw new Error('ListViewDef: name cannot be empty');
|
|
55
|
+
if (!props.fields || props.fields.length === 0) {
|
|
56
|
+
throw new Error('ListViewDef: must have at least one field');
|
|
57
|
+
}
|
|
58
|
+
if (props.sortOrder && !props.orderBy) {
|
|
59
|
+
throw new Error('ListViewDef: sortOrder requires orderBy to be set');
|
|
60
|
+
}
|
|
61
|
+
this._viewId = props.viewId ?? generateId('view');
|
|
62
|
+
this._customObjectApiName = customObject.getApiName();
|
|
63
|
+
this._name = props.name;
|
|
64
|
+
this._fields = [...props.fields];
|
|
65
|
+
this._isPublic = props.isPublic;
|
|
66
|
+
this._orderBy = props.orderBy;
|
|
67
|
+
this._sortOrder = props.sortOrder;
|
|
68
|
+
this._objectScope = props.objectScope ?? 'all';
|
|
69
|
+
this._description = props.description;
|
|
70
|
+
this._columnConfig = props.columnConfig;
|
|
71
|
+
this._rqlFilter = props.rqlFilter;
|
|
72
|
+
customObject._register(this);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Backend view_id used as this view's identifier. */
|
|
76
|
+
getViewId(): string {
|
|
77
|
+
return this._viewId;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** api_name of the CustomObject this view lives on. */
|
|
81
|
+
getCustomObjectApiName(): string {
|
|
82
|
+
return this._customObjectApiName;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Serialize to the backend `CUSTOM_OBJECT_LIST_VIEW` wire shape. */
|
|
86
|
+
toDict(): Record<string, any> {
|
|
87
|
+
const d: Record<string, any> = {
|
|
88
|
+
type: 'CUSTOM_OBJECT_LIST_VIEW',
|
|
89
|
+
object_rql_name: this._customObjectApiName,
|
|
90
|
+
view_id: this._viewId,
|
|
91
|
+
name: this._name,
|
|
92
|
+
public: this._isPublic,
|
|
93
|
+
fields: this._fields.map((f) => f.getApiName()),
|
|
94
|
+
};
|
|
95
|
+
if (this._description != null) d['description'] = this._description;
|
|
96
|
+
if (this._objectScope != null) d['object_scope'] = this._objectScope;
|
|
97
|
+
if (this._sortOrder != null) d['sort_order'] = this._sortOrder;
|
|
98
|
+
if (this._orderBy != null) d['order_by'] = this._orderBy.getApiName();
|
|
99
|
+
if (this._columnConfig != null) d['column_config'] = this._columnConfig;
|
|
100
|
+
if (this._rqlFilter != null) d['rql_filter'] = this._rqlFilter;
|
|
101
|
+
return d;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
3
|
+
*
|
|
4
|
+
* ManifestBuilder collects manifest components and serializes to JSON.
|
|
5
|
+
*
|
|
6
|
+
* Wiring model (CDK-style scope-first):
|
|
7
|
+
* - Every component takes its parent scope as the first positional
|
|
8
|
+
* constructor arg. The scope is either a `ManifestBuilder` (root) or a
|
|
9
|
+
* `CustomObject` / `CustomObjectFieldSection` for nested children.
|
|
10
|
+
* - Constructing a component auto-registers it with the builder via the
|
|
11
|
+
* scope's `_register` hook. There is no public `addComponent` — the
|
|
12
|
+
* only way a component enters the manifest is by being constructed
|
|
13
|
+
* with a scope that forwards up to this builder.
|
|
14
|
+
* - The builder does not walk into components; each component emits the
|
|
15
|
+
* foreign-key fields (`custom_object_api_name`, `model_rql_name`, ...)
|
|
16
|
+
* itself in `toDict()`.
|
|
17
|
+
*
|
|
18
|
+
* Local operations only (no HTTP):
|
|
19
|
+
* - preview() — render manifest as a JSON string
|
|
20
|
+
* - buildManifest() — return the manifest as a plain object
|
|
21
|
+
* - componentsList() — return the flat list of component dicts
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** Any object with a toDict() method can be a manifest component. */
|
|
25
|
+
export interface ManifestComponent {
|
|
26
|
+
toDict(): Record<string, any>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A scope — anything that can accept a child component for registration.
|
|
31
|
+
* Implemented by `ManifestBuilder` (root) and by nestable parents like
|
|
32
|
+
* `CustomObject` and `CustomObjectFieldSection` that forward to the builder.
|
|
33
|
+
*/
|
|
34
|
+
export interface ManifestScope {
|
|
35
|
+
/** @internal Register a child component; builder-bound scopes forward up. */
|
|
36
|
+
_register(component: ManifestComponent): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ManifestBuilderProps {
|
|
40
|
+
/** Unique project key for this manifest. */
|
|
41
|
+
key: string;
|
|
42
|
+
/** Display name (defaults to key if not provided). */
|
|
43
|
+
name?: string;
|
|
44
|
+
/** Optional description. */
|
|
45
|
+
description?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class ManifestBuilder implements ManifestScope {
|
|
49
|
+
readonly key: string;
|
|
50
|
+
readonly name: string;
|
|
51
|
+
readonly description: string;
|
|
52
|
+
private readonly _components: ManifestComponent[] = [];
|
|
53
|
+
|
|
54
|
+
/** Build a new manifest; `name` defaults to `key` when unset. */
|
|
55
|
+
constructor(props: ManifestBuilderProps) {
|
|
56
|
+
if (!props.key) {
|
|
57
|
+
throw new Error('key is required');
|
|
58
|
+
}
|
|
59
|
+
this.key = props.key;
|
|
60
|
+
this.name = props.name || props.key;
|
|
61
|
+
this.description = props.description ?? '';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @internal Scope hook invoked by child constructors. Components enter the
|
|
66
|
+
* manifest here — there is no other path.
|
|
67
|
+
*/
|
|
68
|
+
_register(component: ManifestComponent): void {
|
|
69
|
+
if (typeof component.toDict !== 'function') {
|
|
70
|
+
throw new TypeError('Component must have a toDict() method');
|
|
71
|
+
}
|
|
72
|
+
this._components.push(component);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Build the manifest object: metadata + flat component list. */
|
|
76
|
+
buildManifest(): { metadata: Record<string, any>; components: Record<string, any>[] } {
|
|
77
|
+
const metadata: Record<string, any> = {
|
|
78
|
+
key: this.key,
|
|
79
|
+
name: this.name,
|
|
80
|
+
};
|
|
81
|
+
if (this.description) {
|
|
82
|
+
metadata['description'] = this.description;
|
|
83
|
+
}
|
|
84
|
+
const components = this._components.map((c) => c.toDict());
|
|
85
|
+
return { metadata, components };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Flat list of all component dicts. */
|
|
89
|
+
componentsList(): Record<string, any>[] {
|
|
90
|
+
return this._components.map((c) => c.toDict());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Pretty-printed JSON string. */
|
|
94
|
+
preview(): string {
|
|
95
|
+
return JSON.stringify(this.buildManifest(), null, 2);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
3
|
+
*
|
|
4
|
+
* Custom function definitions (TypeScript handler code).
|
|
5
|
+
* Backend schema: FUNCTION (v2)
|
|
6
|
+
*
|
|
7
|
+
* Named ManifestFunction to avoid collision with the JavaScript built-in Function.
|
|
8
|
+
* Re-exported as both ManifestFunction and Function from the barrel.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { FunctionRuntime } from './_helpers';
|
|
12
|
+
import type { ManifestScope } from './manifest-builder';
|
|
13
|
+
|
|
14
|
+
export interface ManifestFunctionProps {
|
|
15
|
+
/** Required. Function api_name (snake_case identifier). */
|
|
16
|
+
apiName: string;
|
|
17
|
+
/** Required. Display name shown in the UI. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Optional. TypeScript handler source; must export `onRipplingEvent`. @default '' */
|
|
20
|
+
code?: string;
|
|
21
|
+
/** Optional. Function description. @default '' */
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Optional. NPM package dependencies. @default null */
|
|
24
|
+
dependencies?: Record<string, string>;
|
|
25
|
+
/** Optional. Raw deployment options. Prefer `runtime`. @default null */
|
|
26
|
+
deploymentOptions?: Record<string, any>;
|
|
27
|
+
/** Optional. Shorthand: sets `deploymentOptions.runtime`. */
|
|
28
|
+
runtime?: FunctionRuntime;
|
|
29
|
+
/** Optional. Outbound domain allowlist. @default null */
|
|
30
|
+
allowedDomains?: string[];
|
|
31
|
+
/** Optional. Whether the function runs asynchronously. @default false */
|
|
32
|
+
isAsync?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class ManifestFunction {
|
|
36
|
+
private readonly _apiName: string;
|
|
37
|
+
private readonly _name: string;
|
|
38
|
+
private readonly _code: string;
|
|
39
|
+
private readonly _description: string;
|
|
40
|
+
private readonly _dependencies: Record<string, string> | undefined;
|
|
41
|
+
private readonly _deploymentOptions: Record<string, any> | undefined;
|
|
42
|
+
private readonly _allowedDomains: string[] | undefined;
|
|
43
|
+
private readonly _isAsync: boolean;
|
|
44
|
+
|
|
45
|
+
/** Build a new function and auto-register with `scope`; `runtime` is merged into `deploymentOptions` if set. */
|
|
46
|
+
constructor(scope: ManifestScope, props: ManifestFunctionProps) {
|
|
47
|
+
this._apiName = props.apiName;
|
|
48
|
+
this._name = props.name;
|
|
49
|
+
this._code = props.code ?? '';
|
|
50
|
+
this._description = props.description ?? '';
|
|
51
|
+
this._dependencies = props.dependencies;
|
|
52
|
+
this._deploymentOptions = props.deploymentOptions;
|
|
53
|
+
if (props.runtime) {
|
|
54
|
+
this._deploymentOptions = { ...(this._deploymentOptions ?? {}), runtime: props.runtime };
|
|
55
|
+
}
|
|
56
|
+
this._allowedDomains = props.allowedDomains;
|
|
57
|
+
this._isAsync = props.isAsync ?? false;
|
|
58
|
+
scope._register(this);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Backend api_name for this function. */
|
|
62
|
+
getApiName(): string {
|
|
63
|
+
return this._apiName;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Serialize to the backend `FUNCTION` wire shape; empty fields are omitted. */
|
|
67
|
+
toDict(): Record<string, any> {
|
|
68
|
+
const component: Record<string, any> = {
|
|
69
|
+
type: 'FUNCTION',
|
|
70
|
+
name: this._name,
|
|
71
|
+
api_name: this._apiName,
|
|
72
|
+
};
|
|
73
|
+
if (this._description) component['description'] = this._description;
|
|
74
|
+
if (this._code) component['code_draft'] = this._code;
|
|
75
|
+
if (this._dependencies != null) component['dependencies'] = this._dependencies;
|
|
76
|
+
if (this._deploymentOptions != null) component['deployment_options'] = this._deploymentOptions;
|
|
77
|
+
if (this._allowedDomains != null) component['allowed_domains'] = this._allowedDomains;
|
|
78
|
+
if (this._isAsync) component['is_async'] = true;
|
|
79
|
+
return component;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
3
|
+
*
|
|
4
|
+
* Record-triggered flows (automation rules) for custom objects.
|
|
5
|
+
* Backend schema: CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW (v2)
|
|
6
|
+
*
|
|
7
|
+
* Construction is CDK-style: `new Rule(customObject, props)` — the CO is
|
|
8
|
+
* the first positional arg, and the rule auto-registers with the manifest
|
|
9
|
+
* via the CO's scope chain.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { generateId, type TriggerType, type UpdateTriggerType } from './_helpers';
|
|
13
|
+
import type { CustomObject } from './custom-object';
|
|
14
|
+
import type { Field } from './field';
|
|
15
|
+
|
|
16
|
+
const VALID_TRIGGERS: TriggerType[] = ['CREATE', 'UPDATE', 'CREATE_OR_UPDATE'];
|
|
17
|
+
|
|
18
|
+
export interface RuleAction {
|
|
19
|
+
/** Target field — live `Field` ref. */
|
|
20
|
+
targetField: Field;
|
|
21
|
+
/**
|
|
22
|
+
* Set the target to a fixed value. Mutually exclusive with `rqlFormula`.
|
|
23
|
+
* For `SELECT` / `RADIO` targets, the wire payload uses a list (multichoice
|
|
24
|
+
* shape); pass a string/one value or an array — both are normalized to an array.
|
|
25
|
+
*/
|
|
26
|
+
fixedValue?: any;
|
|
27
|
+
/** Set the target to the result of an RQL formula. */
|
|
28
|
+
rqlFormula?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface RuleProps {
|
|
32
|
+
/** Required. Display name of the flow. */
|
|
33
|
+
flowName: string;
|
|
34
|
+
/** Required. When the flow fires. */
|
|
35
|
+
triggerType: TriggerType;
|
|
36
|
+
/** Identity override. Override the flow identifier. @default generateId('flow') */
|
|
37
|
+
flowId?: string;
|
|
38
|
+
/** Optional. RQL formula guard — fires only when truthy. @default null */
|
|
39
|
+
rqlCondition?: string;
|
|
40
|
+
/** Conditional. Update-trigger condition type. @default 'MEETS_CONDITION_AFTER_ONLY' */
|
|
41
|
+
updateTriggerType?: UpdateTriggerType;
|
|
42
|
+
/** Optional. Internal description. @default null */
|
|
43
|
+
description?: string;
|
|
44
|
+
/** Optional. Actions to run when the flow fires. @default [] */
|
|
45
|
+
actions?: RuleAction[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** SELECT / RADIO rule actions use list `fixed_value` (Rippling rule builder). */
|
|
49
|
+
function fixedValueToWire(targetField: Field, value: any): any {
|
|
50
|
+
const ft = targetField.getFieldType();
|
|
51
|
+
if (ft !== 'SELECT' && ft !== 'RADIO') {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
if (Array.isArray(value)) {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
return [value];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function actionToDict(action: RuleAction): Record<string, any> {
|
|
61
|
+
const out: Record<string, any> = {
|
|
62
|
+
target_field: action.targetField.getApiName(),
|
|
63
|
+
};
|
|
64
|
+
if (action.fixedValue != null) {
|
|
65
|
+
out['fixed_value'] = fixedValueToWire(action.targetField, action.fixedValue);
|
|
66
|
+
} else if (action.rqlFormula != null) {
|
|
67
|
+
out['rql_formula'] = action.rqlFormula;
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class Rule {
|
|
73
|
+
private readonly _flowId: string;
|
|
74
|
+
private readonly _customObjectApiName: string;
|
|
75
|
+
private readonly _flowName: string;
|
|
76
|
+
private readonly _triggerType: TriggerType;
|
|
77
|
+
private readonly _rqlCondition: string | undefined;
|
|
78
|
+
private readonly _updateTriggerType: UpdateTriggerType | undefined;
|
|
79
|
+
private readonly _description: string | undefined;
|
|
80
|
+
private readonly _actions: RuleAction[];
|
|
81
|
+
|
|
82
|
+
/** Build a new rule and auto-register with the CO's scope; validates `triggerType`. */
|
|
83
|
+
constructor(customObject: CustomObject, props: RuleProps) {
|
|
84
|
+
if (!VALID_TRIGGERS.includes(props.triggerType)) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
`Invalid trigger_type: ${props.triggerType}. Must be one of: ${VALID_TRIGGERS.join(', ')}`,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
this._flowId = props.flowId ?? generateId('flow');
|
|
90
|
+
this._customObjectApiName = customObject.getApiName();
|
|
91
|
+
this._flowName = props.flowName;
|
|
92
|
+
this._triggerType = props.triggerType;
|
|
93
|
+
this._rqlCondition = props.rqlCondition;
|
|
94
|
+
this._updateTriggerType = props.updateTriggerType;
|
|
95
|
+
this._description = props.description;
|
|
96
|
+
this._actions = [...(props.actions ?? [])];
|
|
97
|
+
customObject._register(this);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Backend flow_id used as this rule's identifier. */
|
|
101
|
+
getFlowId(): string {
|
|
102
|
+
return this._flowId;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** api_name of the CustomObject this rule lives on. */
|
|
106
|
+
getCustomObjectApiName(): string {
|
|
107
|
+
return this._customObjectApiName;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Serialize to the backend `CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW` wire shape. */
|
|
111
|
+
toDict(): Record<string, any> {
|
|
112
|
+
const component: Record<string, any> = {
|
|
113
|
+
type: 'CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW',
|
|
114
|
+
model_rql_name: this._customObjectApiName,
|
|
115
|
+
flow_id: this._flowId,
|
|
116
|
+
flow_name: this._flowName,
|
|
117
|
+
trigger_type: this._triggerType,
|
|
118
|
+
};
|
|
119
|
+
if (this._description != null) component['description'] = this._description;
|
|
120
|
+
if (this._updateTriggerType != null) component['update_trigger_type'] = this._updateTriggerType;
|
|
121
|
+
if (this._rqlCondition != null) component['rql_condition'] = this._rqlCondition;
|
|
122
|
+
if (this._actions.length > 0) component['actions'] = this._actions.map(actionToDict);
|
|
123
|
+
return component;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
3
|
+
*
|
|
4
|
+
* SDUI page definitions for Unity packages.
|
|
5
|
+
* Backend schema: SDUI_PAGE (v2) — `SDUIPageConfig` in
|
|
6
|
+
* `app/hub_platform/sdui/unity_package/sdui_page_interface.py`.
|
|
7
|
+
*
|
|
8
|
+
* Dependency order: FUNCTION → SDUI_PAGE → CUSTOM_APP.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ManifestFunction } from './manifest-function';
|
|
12
|
+
import type { ManifestScope } from './manifest-builder';
|
|
13
|
+
|
|
14
|
+
export interface SduiPageProps {
|
|
15
|
+
/** Required. Unique ID for this page within the package. */
|
|
16
|
+
sduiPageId: string;
|
|
17
|
+
/** Required. Display name shown as the tab label. */
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* Required. Backing function. Pass a live `ManifestFunction` ref (the SDK
|
|
21
|
+
* reads its api_name) or a raw api_name string for functions authored
|
|
22
|
+
* outside this manifest.
|
|
23
|
+
*/
|
|
24
|
+
function: ManifestFunction | string;
|
|
25
|
+
/** Optional. Human-readable description. */
|
|
26
|
+
description?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class SduiPage {
|
|
30
|
+
private readonly _sduiPageId: string;
|
|
31
|
+
private readonly _name: string;
|
|
32
|
+
private readonly _functionApiName: string;
|
|
33
|
+
private readonly _description: string;
|
|
34
|
+
|
|
35
|
+
/** Build a new SDUI page and auto-register with `scope`; resolves the function api_name eagerly. */
|
|
36
|
+
constructor(scope: ManifestScope, props: SduiPageProps) {
|
|
37
|
+
if (!props.sduiPageId) throw new Error('sduiPageId is required');
|
|
38
|
+
if (!props.name) throw new Error('name is required');
|
|
39
|
+
if (!props.function) throw new Error('function is required');
|
|
40
|
+
this._sduiPageId = props.sduiPageId;
|
|
41
|
+
this._name = props.name;
|
|
42
|
+
this._functionApiName = typeof props.function === 'string' ? props.function : props.function.getApiName();
|
|
43
|
+
this._description = props.description ?? '';
|
|
44
|
+
scope._register(this);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Identifier slug for this page within the package. */
|
|
48
|
+
getSduiPageId(): string {
|
|
49
|
+
return this._sduiPageId;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Display name (tab label). */
|
|
53
|
+
getName(): string {
|
|
54
|
+
return this._name;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** api_name of the function backing this page. */
|
|
58
|
+
getFunctionApiName(): string {
|
|
59
|
+
return this._functionApiName;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Serialize to the backend `SDUI_PAGE` wire shape. */
|
|
63
|
+
toDict(): Record<string, any> {
|
|
64
|
+
return {
|
|
65
|
+
type: 'SDUI_PAGE',
|
|
66
|
+
name: this._name,
|
|
67
|
+
sdui_page_id: this._sduiPageId,
|
|
68
|
+
function_api_name: this._functionApiName,
|
|
69
|
+
description: this._description,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
3
|
+
*
|
|
4
|
+
* Validation rules for custom objects (RQL formulas with violation semantics).
|
|
5
|
+
* Backend schema: CUSTOM_OBJECT_VALIDATION_RULE (v2)
|
|
6
|
+
*
|
|
7
|
+
* VIOLATION SEMANTICS: `rqlFormula` returns true when the record is INVALID.
|
|
8
|
+
* Construction is CDK-style: `new Validation(customObject, props)` — the CO
|
|
9
|
+
* is the first positional arg, and the validation auto-registers with the
|
|
10
|
+
* manifest via the CO's scope chain.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { generateId, type ValidationLevel, type ValidationState } from './_helpers';
|
|
14
|
+
import type { CustomObject } from './custom-object';
|
|
15
|
+
import type { Field } from './field';
|
|
16
|
+
|
|
17
|
+
export interface ValidationProps {
|
|
18
|
+
/** Required. Display name of the validation rule. */
|
|
19
|
+
displayName: string;
|
|
20
|
+
/** Required. RQL formula — returns true when the record is INVALID. */
|
|
21
|
+
rqlFormula: string;
|
|
22
|
+
/** Required. User-facing error message (empty string for no message). */
|
|
23
|
+
errorMessage: string;
|
|
24
|
+
/** Required. Rule state. */
|
|
25
|
+
state: ValidationState;
|
|
26
|
+
/** Required. Rule level. */
|
|
27
|
+
level: ValidationLevel;
|
|
28
|
+
/** Required. Internal description (empty string if unused). */
|
|
29
|
+
ruleDescription: string;
|
|
30
|
+
/** Identity override. Override the rule identifier. @default generateId('rule') */
|
|
31
|
+
ruleId?: string;
|
|
32
|
+
/** Optional. Field reference (typically paired with `level: 'FIELD'`). */
|
|
33
|
+
fieldRef?: Field;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class Validation {
|
|
37
|
+
private readonly _ruleId: string;
|
|
38
|
+
private readonly _customObjectApiName: string;
|
|
39
|
+
private readonly _displayName: string;
|
|
40
|
+
private readonly _rqlFormula: string;
|
|
41
|
+
private readonly _errorMessage: string;
|
|
42
|
+
private readonly _state: ValidationState;
|
|
43
|
+
private readonly _level: ValidationLevel;
|
|
44
|
+
private readonly _ruleDescription: string;
|
|
45
|
+
private readonly _fieldRef: Field | undefined;
|
|
46
|
+
|
|
47
|
+
/** Build a new validation rule and auto-register with the CO's scope. */
|
|
48
|
+
constructor(customObject: CustomObject, props: ValidationProps) {
|
|
49
|
+
this._ruleId = props.ruleId ?? generateId('rule');
|
|
50
|
+
this._customObjectApiName = customObject.getApiName();
|
|
51
|
+
this._displayName = props.displayName;
|
|
52
|
+
this._rqlFormula = props.rqlFormula;
|
|
53
|
+
this._errorMessage = props.errorMessage;
|
|
54
|
+
this._state = props.state;
|
|
55
|
+
this._level = props.level;
|
|
56
|
+
this._ruleDescription = props.ruleDescription;
|
|
57
|
+
this._fieldRef = props.fieldRef;
|
|
58
|
+
customObject._register(this);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Backend rule_id used as this validation's identifier. */
|
|
62
|
+
getRuleId(): string {
|
|
63
|
+
return this._ruleId;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** api_name of the CustomObject this validation lives on. */
|
|
67
|
+
getCustomObjectApiName(): string {
|
|
68
|
+
return this._customObjectApiName;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Serialize to the backend `CUSTOM_OBJECT_VALIDATION_RULE` wire shape. */
|
|
72
|
+
toDict(): Record<string, any> {
|
|
73
|
+
const component: Record<string, any> = {
|
|
74
|
+
type: 'CUSTOM_OBJECT_VALIDATION_RULE',
|
|
75
|
+
model_rql_name: this._customObjectApiName,
|
|
76
|
+
rule_id: this._ruleId,
|
|
77
|
+
state: this._state,
|
|
78
|
+
level: this._level,
|
|
79
|
+
display_name: this._displayName,
|
|
80
|
+
rule_description: this._ruleDescription,
|
|
81
|
+
custom_error_message: this._errorMessage,
|
|
82
|
+
rql_formula: this._rqlFormula,
|
|
83
|
+
};
|
|
84
|
+
if (this._fieldRef != null) component['field_rql_name'] = this._fieldRef.getApiName();
|
|
85
|
+
return component;
|
|
86
|
+
}
|
|
87
|
+
}
|