@lowdefy/docs 4.0.0-alpha.7 → 4.0.0-alpha.8
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/dist/operators/client/filter_default_value.js +55 -0
- package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +1 -19
- package/{templates/blocks/schemaTransformer.js → dist/types.js} +5 -10
- package/package.json +19 -3
- package/404.yaml +0 -26
- package/CHANGELOG.md +0 -697
- package/actions/CallMethod.yaml +0 -57
- package/actions/JsAction.yaml +0 -281
- package/actions/Link.yaml +0 -120
- package/actions/Login.yaml +0 -123
- package/actions/Logout.yaml +0 -44
- package/actions/Message.yaml +0 -68
- package/actions/Notification.yaml +0 -84
- package/actions/Request.yaml +0 -70
- package/actions/Reset.yaml +0 -42
- package/actions/ResetValidation.yaml +0 -102
- package/actions/ScrollTo.yaml +0 -100
- package/actions/SetGlobal.yaml +0 -78
- package/actions/SetState.yaml +0 -85
- package/actions/Throw.yaml +0 -89
- package/actions/Validate.yaml +0 -104
- package/actions/Wait.yaml +0 -40
- package/blocks/all_icons.yaml +0 -803
- package/blocks/container/Affix.yaml +0 -26
- package/blocks/container/Alert.yaml +0 -27
- package/blocks/container/Badge.yaml +0 -27
- package/blocks/container/Box.yaml +0 -27
- package/blocks/container/Card.yaml +0 -29
- package/blocks/container/Collapse.yaml +0 -38
- package/blocks/container/Comment.yaml +0 -43
- package/blocks/container/ConfirmModal.yaml +0 -36
- package/blocks/container/Descriptions.yaml +0 -51
- package/blocks/container/Drawer.yaml +0 -46
- package/blocks/container/Label.yaml +0 -28
- package/blocks/container/Modal.yaml +0 -46
- package/blocks/container/PageHCF.yaml +0 -28
- package/blocks/container/PageHCSF.yaml +0 -29
- package/blocks/container/PageHSCF.yaml +0 -29
- package/blocks/container/PageHeaderMenu.yaml +0 -52
- package/blocks/container/PageSHCF.yaml +0 -29
- package/blocks/container/PageSiderMenu.yaml +0 -53
- package/blocks/container/Result.yaml +0 -34
- package/blocks/container/Span.yaml +0 -27
- package/blocks/container/Spin.yaml +0 -27
- package/blocks/container/Tabs.yaml +0 -41
- package/blocks/container/Tooltip.yaml +0 -38
- package/blocks/display/Anchor.yaml +0 -25
- package/blocks/display/Avatar.yaml +0 -23
- package/blocks/display/Breadcrumb.yaml +0 -28
- package/blocks/display/Button.yaml +0 -43
- package/blocks/display/DangerousHtml.yaml +0 -62
- package/blocks/display/DangerousMarkdown.yaml +0 -46
- package/blocks/display/Divider.yaml +0 -23
- package/blocks/display/EChart.yaml +0 -53
- package/blocks/display/Html.yaml +0 -50
- package/blocks/display/Icon.yaml +0 -23
- package/blocks/display/Img.yaml +0 -40
- package/blocks/display/Markdown.yaml +0 -31
- package/blocks/display/MarkdownWithCode.yaml +0 -46
- package/blocks/display/Menu.yaml +0 -48
- package/blocks/display/Message.yaml +0 -34
- package/blocks/display/MobileMenu.yaml +0 -47
- package/blocks/display/Notification.yaml +0 -34
- package/blocks/display/Paragraph.yaml +0 -30
- package/blocks/display/Progress.yaml +0 -52
- package/blocks/display/Skeleton.yaml +0 -27
- package/blocks/display/Statistic.yaml +0 -35
- package/blocks/display/Title.yaml +0 -32
- package/blocks/input/AutoComplete.yaml +0 -30
- package/blocks/input/ButtonSelector.yaml +0 -36
- package/blocks/input/CheckboxSelector.yaml +0 -36
- package/blocks/input/CheckboxSwitch.yaml +0 -56
- package/blocks/input/ChromeColorSelector.yaml +0 -24
- package/blocks/input/CircleColorSelector.yaml +0 -24
- package/blocks/input/ColorSelector.yaml +0 -24
- package/blocks/input/CompactColorSelector.yaml +0 -24
- package/blocks/input/DateRangeSelector.yaml +0 -26
- package/blocks/input/DateSelector.yaml +0 -26
- package/blocks/input/DateTimeSelector.yaml +0 -28
- package/blocks/input/GithubColorSelector.yaml +0 -24
- package/blocks/input/MonthSelector.yaml +0 -26
- package/blocks/input/MultipleSelector.yaml +0 -117
- package/blocks/input/NumberInput.yaml +0 -24
- package/blocks/input/Pagination.yaml +0 -33
- package/blocks/input/ParagraphInput.yaml +0 -32
- package/blocks/input/PasswordInput.yaml +0 -48
- package/blocks/input/RadioSelector.yaml +0 -36
- package/blocks/input/RatingSlider.yaml +0 -24
- package/blocks/input/S3UploadButton.yaml +0 -28
- package/blocks/input/Selector.yaml +0 -98
- package/blocks/input/SliderColorSelector.yaml +0 -24
- package/blocks/input/SwatchesColorSelector.yaml +0 -24
- package/blocks/input/Switch.yaml +0 -24
- package/blocks/input/TextArea.yaml +0 -27
- package/blocks/input/TextInput.yaml +0 -59
- package/blocks/input/TitleInput.yaml +0 -32
- package/blocks/input/TwitterColorSelector.yaml +0 -24
- package/blocks/input/WeekSelector.yaml +0 -26
- package/blocks/list/ControlledList.yaml +0 -191
- package/blocks/list/List.yaml +0 -157
- package/blocks/list/TimelineList.yaml +0 -136
- package/body.html +0 -1
- package/concepts/blocks.yaml +0 -249
- package/concepts/cli.yaml +0 -173
- package/concepts/connections-and-requests.yaml +0 -114
- package/concepts/context-and-state.yaml +0 -82
- package/concepts/custom-blocks.yaml +0 -190
- package/concepts/custom-code.yaml +0 -197
- package/concepts/events-and-actions.yaml +0 -224
- package/concepts/hosting-files.yaml +0 -50
- package/concepts/layout.yaml +0 -1464
- package/concepts/lists.yaml +0 -162
- package/concepts/lowdefy-schema.yaml +0 -245
- package/concepts/operators.yaml +0 -66
- package/concepts/overview.yaml +0 -48
- package/concepts/secrets.yaml +0 -56
- package/connections/AWSS3.yaml +0 -228
- package/connections/AmazonRedshift.yaml +0 -75
- package/connections/AxiosHttp.yaml +0 -194
- package/connections/Elasticsearch.yaml +0 -378
- package/connections/GoogleSheet.yaml +0 -332
- package/connections/Knex.yaml +0 -181
- package/connections/KnexRequests.md +0 -121
- package/connections/MSSQL.yaml +0 -90
- package/connections/MariaDB.yaml +0 -77
- package/connections/MongoDB.yaml +0 -581
- package/connections/MySQL.yaml +0 -92
- package/connections/OracleDB.yaml +0 -73
- package/connections/PostgreSQL.yaml +0 -99
- package/connections/Redis.yaml +0 -147
- package/connections/SQLite.yaml +0 -94
- package/connections/SendGridMail.yaml +0 -113
- package/connections/Stripe.yaml +0 -139
- package/deployment/aws-lambda.yaml +0 -128
- package/deployment/docker.yaml +0 -118
- package/deployment/netlify.yaml +0 -69
- package/deployment/node-server.yaml +0 -111
- package/head.html +0 -7
- package/howto/generate-csv.yaml.njk +0 -252
- package/howto/generate-pdf.yaml.njk +0 -651
- package/howto/generateCsv/lowdefy.yaml +0 -64
- package/howto/generateCsv/public/csvMake.js +0 -27
- package/howto/generatePdf/inv_template.yaml +0 -200
- package/howto/generatePdf/lowdefy.yaml +0 -117
- package/howto/generatePdf/my_header.html +0 -1
- package/howto/generatePdf/public/logo_example.png +0 -0
- package/howto/generatePdf/public/modules/importUmd.js +0 -7
- package/howto/generatePdf/public/modules/pdfMake.js +0 -7
- package/howto/generatePdf/public/modules/vfs_fonts.js +0 -12
- package/howto/use-refrences.md +0 -5
- package/introduction.yaml +0 -100
- package/lowdefy.yaml +0 -66
- package/menus.yaml +0 -832
- package/operators/_actions.yaml +0 -123
- package/operators/_and.yaml +0 -90
- package/operators/_args.yaml +0 -79
- package/operators/_array.yaml +0 -326
- package/operators/_base64.yaml +0 -56
- package/operators/_change_case.yaml +0 -347
- package/operators/_date.yaml +0 -71
- package/operators/_diff.yaml +0 -75
- package/operators/_divide.yaml +0 -46
- package/operators/_eq.yaml +0 -67
- package/operators/_event.yaml +0 -103
- package/operators/_format.yaml +0 -209
- package/operators/_function.yaml +0 -66
- package/operators/_get.yaml +0 -108
- package/operators/_global.yaml +0 -107
- package/operators/_gt.yaml +0 -65
- package/operators/_gte.yaml +0 -65
- package/operators/_hash.yaml +0 -109
- package/operators/_if.yaml +0 -44
- package/operators/_if_none.yaml +0 -61
- package/operators/_index.yaml +0 -65
- package/operators/_input.yaml +0 -114
- package/operators/_js.yaml +0 -189
- package/operators/_json.yaml +0 -128
- package/operators/_list_contexts.yaml +0 -37
- package/operators/_location.yaml +0 -59
- package/operators/_log.yaml +0 -36
- package/operators/_lt.yaml +0 -65
- package/operators/_lte.yaml +0 -65
- package/operators/_math.yaml +0 -374
- package/operators/_media.yaml +0 -86
- package/operators/_menu.yaml +0 -81
- package/operators/_mql.yaml +0 -101
- package/operators/_ne.yaml +0 -77
- package/operators/_not.yaml +0 -47
- package/operators/_number.yaml +0 -157
- package/operators/_nunjucks.yaml +0 -73
- package/operators/_object.yaml +0 -193
- package/operators/_operator.yaml +0 -47
- package/operators/_or.yaml +0 -81
- package/operators/_product.yaml +0 -59
- package/operators/_random.yaml +0 -104
- package/operators/_ref.yaml +0 -266
- package/operators/_regex.yaml +0 -83
- package/operators/_request.yaml +0 -50
- package/operators/_secret.yaml +0 -74
- package/operators/_state.yaml +0 -114
- package/operators/_string.yaml +0 -283
- package/operators/_subtract.yaml +0 -38
- package/operators/_sum.yaml +0 -59
- package/operators/_switch.yaml +0 -51
- package/operators/_type.yaml +0 -92
- package/operators/_uri.yaml +0 -56
- package/operators/_url_query.yaml +0 -120
- package/operators/_user.yaml +0 -107
- package/operators/_uuid.yaml +0 -114
- package/operators/_var.yaml +0 -105
- package/operators/_yaml.yaml +0 -107
- package/pages.yaml +0 -227
- package/public/images/authors/gervwyk.jpeg +0 -0
- package/public/images/authors/sandile.jpeg +0 -0
- package/public/images/howto/header_generate_csv.jpg +0 -0
- package/public/images/howto/header_generate_pdf.jpg +0 -0
- package/public/logo_example.png +0 -0
- package/public/lowdefy_app_schema.png +0 -0
- package/public/modules/csvMake.js +0 -27
- package/public/modules/filterDefaultValue.js +0 -48
- package/public/modules/importUmd.js +0 -7
- package/public/modules/index.js +0 -5
- package/public/modules/pdfMake.js +0 -7
- package/public/modules/test/filterDefaultValue.test.js +0 -91
- package/public/modules/vfs_fonts.js +0 -12
- package/public/sitemap.xml +0 -1024
- package/templates/actions.yaml.njk +0 -68
- package/templates/blocks/defaultValueTransformer.js +0 -53
- package/templates/blocks/exampleTransformer.js +0 -81
- package/templates/blocks/layout.yaml +0 -114
- package/templates/blocks/propertiesFormTransformer.js +0 -419
- package/templates/blocks/propertiesGetterTransformer.js +0 -132
- package/templates/blocks/schema.yaml.njk +0 -42
- package/templates/blocks/style.yaml +0 -26
- package/templates/blocks/template.yaml.njk +0 -495
- package/templates/blog.yaml.njk +0 -221
- package/templates/cli_command.yaml.njk +0 -37
- package/templates/footer.yaml.njk +0 -604
- package/templates/general.yaml.njk +0 -124
- package/templates/generateSitemap.js +0 -41
- package/templates/header.yaml +0 -138
- package/templates/navigation_buttons.yaml +0 -68
- package/templates/operators.yaml.njk +0 -82
- package/templates/operatorsMethodTransformer.js +0 -119
- package/templates/test/array.test.js +0 -1335
- package/templates/test/boolean.test.js +0 -98
- package/templates/test/button.test.js +0 -166
- package/templates/test/color.test.js +0 -126
- package/templates/test/enum.test.js +0 -105
- package/templates/test/icon.test.js +0 -109
- package/templates/test/integer.test.js +0 -99
- package/templates/test/manual.test.js +0 -238
- package/templates/test/number.test.js +0 -99
- package/templates/test/object.test.js +0 -434
- package/templates/test/oneOf.test.js +0 -794
- package/templates/test/string.test.js +0 -98
- package/templates/test/yaml.test.js +0 -605
- package/tutorial/next-steps.yaml +0 -83
- package/tutorial/tutorial-actions-operators-config.yaml +0 -142
- package/tutorial/tutorial-actions-operators.yaml +0 -436
- package/tutorial/tutorial-add-blocks-config.yaml +0 -109
- package/tutorial/tutorial-add-blocks.yaml +0 -195
- package/tutorial/tutorial-create-page-config.yaml +0 -77
- package/tutorial/tutorial-create-page.yaml +0 -196
- package/tutorial/tutorial-deploy.yaml +0 -146
- package/tutorial/tutorial-requests-config.yaml +0 -186
- package/tutorial/tutorial-requests.yaml +0 -338
- package/tutorial/tutorial-start.yaml +0 -282
- package/users/login-and-logout.yaml +0 -164
- package/users/openid-connect.yaml +0 -84
- package/users/protected-pages.yaml +0 -67
- package/users/roles.yaml +0 -70
- package/users/user-object.yaml +0 -73
- package/users/users-introduction.yaml +0 -80
- package/version.yaml +0 -1
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
str: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'String description.',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
test('string propertiesFormTransformer', () => {
|
|
35
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
36
|
-
Array [
|
|
37
|
-
Object {
|
|
38
|
-
"id": "block.properties.str",
|
|
39
|
-
"layout": Object {
|
|
40
|
-
"_global": "settings_input_layout",
|
|
41
|
-
},
|
|
42
|
-
"properties": Object {
|
|
43
|
-
"label": Object {
|
|
44
|
-
"align": "right",
|
|
45
|
-
"extra": "String description.",
|
|
46
|
-
"span": 8,
|
|
47
|
-
},
|
|
48
|
-
"size": "small",
|
|
49
|
-
"title": "str",
|
|
50
|
-
},
|
|
51
|
-
"required": false,
|
|
52
|
-
"type": "TextInput",
|
|
53
|
-
},
|
|
54
|
-
]
|
|
55
|
-
`);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test('string propertiesGetterTransformer', () => {
|
|
59
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
60
|
-
Object {
|
|
61
|
-
"_object.assign": Array [
|
|
62
|
-
Object {
|
|
63
|
-
"_state": Object {
|
|
64
|
-
"contextId": "Block:Block:{}",
|
|
65
|
-
"default": Object {},
|
|
66
|
-
"key": "block.properties",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
}
|
|
71
|
-
`);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
test('string defaultValueTransformer', () => {
|
|
75
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`
|
|
76
|
-
Object {
|
|
77
|
-
"str": null,
|
|
78
|
-
}
|
|
79
|
-
`);
|
|
80
|
-
const schemaDV = {
|
|
81
|
-
properties: {
|
|
82
|
-
type: 'object',
|
|
83
|
-
additionalProperties: false,
|
|
84
|
-
properties: {
|
|
85
|
-
str: {
|
|
86
|
-
type: 'string',
|
|
87
|
-
default: 'str_default',
|
|
88
|
-
description: 'String description.',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
94
|
-
Object {
|
|
95
|
-
"str": "str_default",
|
|
96
|
-
}
|
|
97
|
-
`);
|
|
98
|
-
});
|
|
@@ -1,605 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
field: {
|
|
27
|
-
type: 'object',
|
|
28
|
-
description: 'description',
|
|
29
|
-
docs: {
|
|
30
|
-
displayType: 'yaml',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
test('yaml propertiesFormTransformer', () => {
|
|
38
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
39
|
-
Array [
|
|
40
|
-
Object {
|
|
41
|
-
"id": "block.properties.field",
|
|
42
|
-
"layout": Object {
|
|
43
|
-
"_global": "settings_input_layout",
|
|
44
|
-
},
|
|
45
|
-
"properties": Object {
|
|
46
|
-
"autoSize": Object {
|
|
47
|
-
"minRows": 2,
|
|
48
|
-
},
|
|
49
|
-
"label": Object {
|
|
50
|
-
"align": "right",
|
|
51
|
-
"extra": "description",
|
|
52
|
-
"span": 8,
|
|
53
|
-
},
|
|
54
|
-
"placeholder": "Type YAML here",
|
|
55
|
-
"size": "small",
|
|
56
|
-
"title": "field",
|
|
57
|
-
},
|
|
58
|
-
"required": false,
|
|
59
|
-
"type": "TextArea",
|
|
60
|
-
},
|
|
61
|
-
]
|
|
62
|
-
`);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test('yaml propertiesGetterTransformer', () => {
|
|
66
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
67
|
-
Object {
|
|
68
|
-
"_object.assign": Array [
|
|
69
|
-
Object {
|
|
70
|
-
"_state": Object {
|
|
71
|
-
"contextId": "Block:Block:{}",
|
|
72
|
-
"default": Object {},
|
|
73
|
-
"key": "block.properties",
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
Object {
|
|
77
|
-
"field": Object {
|
|
78
|
-
"_yaml.parse": Object {
|
|
79
|
-
"_if_none": Array [
|
|
80
|
-
Object {
|
|
81
|
-
"_state": Object {
|
|
82
|
-
"contextId": "Block:Block:{}",
|
|
83
|
-
"key": "block.properties.field",
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
"",
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
}
|
|
93
|
-
`);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
test('yaml defaultValueTransformer', () => {
|
|
97
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`Object {}`);
|
|
98
|
-
const schemaDV = {
|
|
99
|
-
properties: {
|
|
100
|
-
type: 'object',
|
|
101
|
-
additionalProperties: false,
|
|
102
|
-
properties: {
|
|
103
|
-
field: {
|
|
104
|
-
type: 'object',
|
|
105
|
-
default: 'value',
|
|
106
|
-
description: 'description',
|
|
107
|
-
docs: {
|
|
108
|
-
displayType: 'yaml',
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
115
|
-
Object {
|
|
116
|
-
"field": "value",
|
|
117
|
-
}
|
|
118
|
-
`);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const schemaNested = {
|
|
122
|
-
properties: {
|
|
123
|
-
type: 'object',
|
|
124
|
-
additionalProperties: false,
|
|
125
|
-
properties: {
|
|
126
|
-
obj: {
|
|
127
|
-
type: 'object',
|
|
128
|
-
description: 'obj description',
|
|
129
|
-
properties: {
|
|
130
|
-
field: {
|
|
131
|
-
type: 'object',
|
|
132
|
-
description: 'field description',
|
|
133
|
-
docs: {
|
|
134
|
-
displayType: 'yaml',
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
test('yaml schemaNested propertiesFormTransformer', () => {
|
|
144
|
-
expect(propertiesFormTransformer(schemaNested)).toMatchInlineSnapshot(`
|
|
145
|
-
Array [
|
|
146
|
-
Object {
|
|
147
|
-
"blocks": Array [
|
|
148
|
-
Object {
|
|
149
|
-
"id": "block.properties.obj.field",
|
|
150
|
-
"layout": Object {
|
|
151
|
-
"_global": "settings_input_layout",
|
|
152
|
-
},
|
|
153
|
-
"properties": Object {
|
|
154
|
-
"autoSize": Object {
|
|
155
|
-
"minRows": 2,
|
|
156
|
-
},
|
|
157
|
-
"label": Object {
|
|
158
|
-
"align": "right",
|
|
159
|
-
"extra": "field description",
|
|
160
|
-
"span": 8,
|
|
161
|
-
},
|
|
162
|
-
"placeholder": "Type YAML here",
|
|
163
|
-
"size": "small",
|
|
164
|
-
"title": "field",
|
|
165
|
-
},
|
|
166
|
-
"required": false,
|
|
167
|
-
"type": "TextArea",
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
"id": "block.properties.obj",
|
|
171
|
-
"layout": Object {
|
|
172
|
-
"contentGutter": 0,
|
|
173
|
-
},
|
|
174
|
-
"properties": Object {
|
|
175
|
-
"bodyStyle": Object {
|
|
176
|
-
"padding": 0,
|
|
177
|
-
},
|
|
178
|
-
"size": "small",
|
|
179
|
-
"title": "obj:",
|
|
180
|
-
},
|
|
181
|
-
"type": "Card",
|
|
182
|
-
},
|
|
183
|
-
]
|
|
184
|
-
`);
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
test('yaml schemaNested propertiesGetterTransformer', () => {
|
|
188
|
-
expect(propertiesGetterTransformer(schemaNested, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
189
|
-
Object {
|
|
190
|
-
"_object.assign": Array [
|
|
191
|
-
Object {
|
|
192
|
-
"_state": Object {
|
|
193
|
-
"contextId": "Block:Block:{}",
|
|
194
|
-
"default": Object {},
|
|
195
|
-
"key": "block.properties",
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
Object {
|
|
199
|
-
"obj": Object {
|
|
200
|
-
"_object.assign": Array [
|
|
201
|
-
Object {
|
|
202
|
-
"_state": Object {
|
|
203
|
-
"contextId": "Block:Block:{}",
|
|
204
|
-
"default": Object {},
|
|
205
|
-
"key": "block.properties.obj",
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
Object {
|
|
209
|
-
"field": Object {
|
|
210
|
-
"_yaml.parse": Object {
|
|
211
|
-
"_if_none": Array [
|
|
212
|
-
Object {
|
|
213
|
-
"_state": Object {
|
|
214
|
-
"contextId": "Block:Block:{}",
|
|
215
|
-
"key": "block.properties.obj.field",
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
"",
|
|
219
|
-
],
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
],
|
|
227
|
-
}
|
|
228
|
-
`);
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
test('yaml schemaNested defaultValueTransformer', () => {
|
|
232
|
-
expect(defaultValueTransformer(schemaNested)).toMatchInlineSnapshot(`Object {}`);
|
|
233
|
-
const schemaDV = {
|
|
234
|
-
properties: {
|
|
235
|
-
type: 'object',
|
|
236
|
-
additionalProperties: false,
|
|
237
|
-
properties: {
|
|
238
|
-
obj: {
|
|
239
|
-
type: 'object',
|
|
240
|
-
description: 'obj description',
|
|
241
|
-
properties: {
|
|
242
|
-
field: {
|
|
243
|
-
type: 'object',
|
|
244
|
-
default: { a: 1 },
|
|
245
|
-
description: 'field description',
|
|
246
|
-
docs: {
|
|
247
|
-
displayType: 'yaml',
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
};
|
|
255
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
256
|
-
Object {
|
|
257
|
-
"obj": Object {
|
|
258
|
-
"field": Object {
|
|
259
|
-
"a": 1,
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
}
|
|
263
|
-
`);
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
const schemaYamlInArray = {
|
|
267
|
-
properties: {
|
|
268
|
-
type: 'object',
|
|
269
|
-
additionalProperties: false,
|
|
270
|
-
properties: {
|
|
271
|
-
arr: {
|
|
272
|
-
type: 'array',
|
|
273
|
-
description: 'arr description',
|
|
274
|
-
items: {
|
|
275
|
-
type: 'object',
|
|
276
|
-
description: 'yaml description',
|
|
277
|
-
docs: {
|
|
278
|
-
displayType: 'yaml',
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
test('yaml schemaYamlInArray propertiesFormTransformer', () => {
|
|
287
|
-
expect(propertiesFormTransformer(schemaYamlInArray)).toMatchInlineSnapshot(`
|
|
288
|
-
Array [
|
|
289
|
-
Object {
|
|
290
|
-
"blocks": Array [
|
|
291
|
-
Object {
|
|
292
|
-
"id": "block.properties.arr.$",
|
|
293
|
-
"layout": Object {
|
|
294
|
-
"_global": "settings_input_layout",
|
|
295
|
-
},
|
|
296
|
-
"properties": Object {
|
|
297
|
-
"autoSize": Object {
|
|
298
|
-
"minRows": 2,
|
|
299
|
-
},
|
|
300
|
-
"label": Object {
|
|
301
|
-
"disabled": true,
|
|
302
|
-
},
|
|
303
|
-
"placeholder": "Type YAML here",
|
|
304
|
-
"size": "small",
|
|
305
|
-
"title": "$",
|
|
306
|
-
},
|
|
307
|
-
"required": false,
|
|
308
|
-
"type": "TextArea",
|
|
309
|
-
},
|
|
310
|
-
],
|
|
311
|
-
"id": "block.properties.arr",
|
|
312
|
-
"layout": Object {
|
|
313
|
-
"contentGutter": 0,
|
|
314
|
-
},
|
|
315
|
-
"properties": Object {
|
|
316
|
-
"itemStyle": Object {
|
|
317
|
-
"padding": 0,
|
|
318
|
-
},
|
|
319
|
-
"size": "small",
|
|
320
|
-
"title": "arr:",
|
|
321
|
-
},
|
|
322
|
-
"type": "ControlledList",
|
|
323
|
-
},
|
|
324
|
-
]
|
|
325
|
-
`);
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
test('yaml schemaYamlInArray propertiesGetterTransformer', () => {
|
|
329
|
-
expect(propertiesGetterTransformer(schemaYamlInArray, { block_type: 'Block' }))
|
|
330
|
-
.toMatchInlineSnapshot(`
|
|
331
|
-
Object {
|
|
332
|
-
"_object.assign": Array [
|
|
333
|
-
Object {
|
|
334
|
-
"_state": Object {
|
|
335
|
-
"contextId": "Block:Block:{}",
|
|
336
|
-
"default": Object {},
|
|
337
|
-
"key": "block.properties",
|
|
338
|
-
},
|
|
339
|
-
},
|
|
340
|
-
Object {
|
|
341
|
-
"arr": Object {
|
|
342
|
-
"_array.map": Object {
|
|
343
|
-
"callback": Object {
|
|
344
|
-
"_function": Object {
|
|
345
|
-
"__yaml.parse": Object {
|
|
346
|
-
"__if_none": Array [
|
|
347
|
-
Object {
|
|
348
|
-
"__args": Object {
|
|
349
|
-
"contextId": undefined,
|
|
350
|
-
"key": "0",
|
|
351
|
-
},
|
|
352
|
-
},
|
|
353
|
-
"",
|
|
354
|
-
],
|
|
355
|
-
},
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
"on": Object {
|
|
359
|
-
"_if_none": Array [
|
|
360
|
-
Object {
|
|
361
|
-
"_state": Object {
|
|
362
|
-
"contextId": "Block:Block:{}",
|
|
363
|
-
"key": "block.properties.arr",
|
|
364
|
-
},
|
|
365
|
-
},
|
|
366
|
-
Array [],
|
|
367
|
-
],
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
],
|
|
373
|
-
}
|
|
374
|
-
`);
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
test('yaml schemaYamlInArray defaultValueTransformer', () => {
|
|
378
|
-
expect(defaultValueTransformer(schemaYamlInArray)).toMatchInlineSnapshot(`
|
|
379
|
-
Object {
|
|
380
|
-
"arr": Array [],
|
|
381
|
-
}
|
|
382
|
-
`);
|
|
383
|
-
const schemaYamlInArrayDV = {
|
|
384
|
-
properties: {
|
|
385
|
-
type: 'object',
|
|
386
|
-
additionalProperties: false,
|
|
387
|
-
properties: {
|
|
388
|
-
arr: {
|
|
389
|
-
type: 'array',
|
|
390
|
-
default: [{ a: 1 }],
|
|
391
|
-
description: 'arr description',
|
|
392
|
-
items: {
|
|
393
|
-
type: 'object',
|
|
394
|
-
description: 'yaml description',
|
|
395
|
-
docs: {
|
|
396
|
-
displayType: 'yaml',
|
|
397
|
-
},
|
|
398
|
-
},
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
};
|
|
403
|
-
expect(defaultValueTransformer(schemaYamlInArrayDV)).toMatchInlineSnapshot(`
|
|
404
|
-
Object {
|
|
405
|
-
"arr": Array [
|
|
406
|
-
Object {
|
|
407
|
-
"a": 1,
|
|
408
|
-
},
|
|
409
|
-
],
|
|
410
|
-
}
|
|
411
|
-
`);
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
const schemaYamlInObjectInArray = {
|
|
415
|
-
properties: {
|
|
416
|
-
type: 'object',
|
|
417
|
-
additionalProperties: false,
|
|
418
|
-
properties: {
|
|
419
|
-
arr: {
|
|
420
|
-
type: 'array',
|
|
421
|
-
description: 'arr description',
|
|
422
|
-
items: {
|
|
423
|
-
type: 'object',
|
|
424
|
-
description: 'obj description',
|
|
425
|
-
properties: {
|
|
426
|
-
yaml: {
|
|
427
|
-
type: 'object',
|
|
428
|
-
description: 'yaml description',
|
|
429
|
-
docs: {
|
|
430
|
-
displayType: 'yaml',
|
|
431
|
-
},
|
|
432
|
-
},
|
|
433
|
-
},
|
|
434
|
-
},
|
|
435
|
-
},
|
|
436
|
-
},
|
|
437
|
-
},
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
test('yaml schemaYamlInObjectInArray propertiesFormTransformer', () => {
|
|
441
|
-
expect(propertiesFormTransformer(schemaYamlInObjectInArray)).toMatchInlineSnapshot(`
|
|
442
|
-
Array [
|
|
443
|
-
Object {
|
|
444
|
-
"blocks": Array [
|
|
445
|
-
Object {
|
|
446
|
-
"blocks": Array [
|
|
447
|
-
Object {
|
|
448
|
-
"id": "block.properties.arr.$.yaml",
|
|
449
|
-
"layout": Object {
|
|
450
|
-
"_global": "settings_input_layout",
|
|
451
|
-
},
|
|
452
|
-
"properties": Object {
|
|
453
|
-
"autoSize": Object {
|
|
454
|
-
"minRows": 2,
|
|
455
|
-
},
|
|
456
|
-
"label": Object {
|
|
457
|
-
"align": "right",
|
|
458
|
-
"extra": "yaml description",
|
|
459
|
-
"span": 8,
|
|
460
|
-
},
|
|
461
|
-
"placeholder": "Type YAML here",
|
|
462
|
-
"size": "small",
|
|
463
|
-
"title": "yaml",
|
|
464
|
-
},
|
|
465
|
-
"required": false,
|
|
466
|
-
"type": "TextArea",
|
|
467
|
-
},
|
|
468
|
-
],
|
|
469
|
-
"id": "block.properties.arr.$",
|
|
470
|
-
"layout": Object {
|
|
471
|
-
"contentGutter": 0,
|
|
472
|
-
},
|
|
473
|
-
"properties": Object {
|
|
474
|
-
"bodyStyle": Object {
|
|
475
|
-
"padding": 0,
|
|
476
|
-
},
|
|
477
|
-
"size": "small",
|
|
478
|
-
"title": false,
|
|
479
|
-
},
|
|
480
|
-
"type": "Card",
|
|
481
|
-
},
|
|
482
|
-
],
|
|
483
|
-
"id": "block.properties.arr",
|
|
484
|
-
"layout": Object {
|
|
485
|
-
"contentGutter": 0,
|
|
486
|
-
},
|
|
487
|
-
"properties": Object {
|
|
488
|
-
"itemStyle": Object {
|
|
489
|
-
"padding": 0,
|
|
490
|
-
},
|
|
491
|
-
"size": "small",
|
|
492
|
-
"title": "arr:",
|
|
493
|
-
},
|
|
494
|
-
"type": "ControlledList",
|
|
495
|
-
},
|
|
496
|
-
]
|
|
497
|
-
`);
|
|
498
|
-
});
|
|
499
|
-
|
|
500
|
-
test('yaml schemaYamlInObjectInArray propertiesGetterTransformer', () => {
|
|
501
|
-
expect(propertiesGetterTransformer(schemaYamlInObjectInArray, { block_type: 'Block' }))
|
|
502
|
-
.toMatchInlineSnapshot(`
|
|
503
|
-
Object {
|
|
504
|
-
"_object.assign": Array [
|
|
505
|
-
Object {
|
|
506
|
-
"_state": Object {
|
|
507
|
-
"contextId": "Block:Block:{}",
|
|
508
|
-
"default": Object {},
|
|
509
|
-
"key": "block.properties",
|
|
510
|
-
},
|
|
511
|
-
},
|
|
512
|
-
Object {
|
|
513
|
-
"arr": Object {
|
|
514
|
-
"_array.map": Object {
|
|
515
|
-
"callback": Object {
|
|
516
|
-
"_function": Object {
|
|
517
|
-
"__object.assign": Array [
|
|
518
|
-
Object {
|
|
519
|
-
"__args": Object {
|
|
520
|
-
"contextId": undefined,
|
|
521
|
-
"default": Object {},
|
|
522
|
-
"key": "0",
|
|
523
|
-
},
|
|
524
|
-
},
|
|
525
|
-
Object {
|
|
526
|
-
"yaml": Object {
|
|
527
|
-
"__yaml.parse": Object {
|
|
528
|
-
"__if_none": Array [
|
|
529
|
-
Object {
|
|
530
|
-
"__args": Object {
|
|
531
|
-
"contextId": undefined,
|
|
532
|
-
"key": "0.yaml",
|
|
533
|
-
},
|
|
534
|
-
},
|
|
535
|
-
"",
|
|
536
|
-
],
|
|
537
|
-
},
|
|
538
|
-
},
|
|
539
|
-
},
|
|
540
|
-
],
|
|
541
|
-
},
|
|
542
|
-
},
|
|
543
|
-
"on": Object {
|
|
544
|
-
"_if_none": Array [
|
|
545
|
-
Object {
|
|
546
|
-
"_state": Object {
|
|
547
|
-
"contextId": "Block:Block:{}",
|
|
548
|
-
"key": "block.properties.arr",
|
|
549
|
-
},
|
|
550
|
-
},
|
|
551
|
-
Array [],
|
|
552
|
-
],
|
|
553
|
-
},
|
|
554
|
-
},
|
|
555
|
-
},
|
|
556
|
-
},
|
|
557
|
-
],
|
|
558
|
-
}
|
|
559
|
-
`);
|
|
560
|
-
});
|
|
561
|
-
|
|
562
|
-
test('yaml schemaYamlInObjectInArray defaultValueTransformer', () => {
|
|
563
|
-
expect(defaultValueTransformer(schemaYamlInObjectInArray)).toMatchInlineSnapshot(`
|
|
564
|
-
Object {
|
|
565
|
-
"arr": Array [],
|
|
566
|
-
}
|
|
567
|
-
`);
|
|
568
|
-
const schemaYamlInObjectInArrayDV = {
|
|
569
|
-
properties: {
|
|
570
|
-
type: 'object',
|
|
571
|
-
additionalProperties: false,
|
|
572
|
-
properties: {
|
|
573
|
-
arr: {
|
|
574
|
-
type: 'array',
|
|
575
|
-
description: 'arr description',
|
|
576
|
-
default: [{ yaml: { b: 1 } }],
|
|
577
|
-
items: {
|
|
578
|
-
type: 'object',
|
|
579
|
-
description: 'obj description',
|
|
580
|
-
properties: {
|
|
581
|
-
yaml: {
|
|
582
|
-
type: 'object',
|
|
583
|
-
description: 'yaml description',
|
|
584
|
-
docs: {
|
|
585
|
-
displayType: 'yaml',
|
|
586
|
-
},
|
|
587
|
-
},
|
|
588
|
-
},
|
|
589
|
-
},
|
|
590
|
-
},
|
|
591
|
-
},
|
|
592
|
-
},
|
|
593
|
-
};
|
|
594
|
-
expect(defaultValueTransformer(schemaYamlInObjectInArrayDV)).toMatchInlineSnapshot(`
|
|
595
|
-
Object {
|
|
596
|
-
"arr": Array [
|
|
597
|
-
Object {
|
|
598
|
-
"yaml": Object {
|
|
599
|
-
"b": 1,
|
|
600
|
-
},
|
|
601
|
-
},
|
|
602
|
-
],
|
|
603
|
-
}
|
|
604
|
-
`);
|
|
605
|
-
});
|