@servicenow/sdk-build-plugins 4.5.0 → 4.6.0
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/column-plugin.js +3 -7
- package/dist/column-plugin.js.map +1 -1
- package/dist/flow/flow-logic/flow-logic-diagnostics.js +5 -5
- package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -1
- package/dist/flow/plugins/flow-action-definition-plugin.js +1229 -54
- package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-data-pill-plugin.js +5 -2
- package/dist/flow/plugins/flow-data-pill-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-definition-plugin.js +16 -42
- package/dist/flow/plugins/flow-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-diagnostics-plugin.d.ts +2 -2
- package/dist/flow/plugins/flow-diagnostics-plugin.js +2 -2
- package/dist/flow/plugins/flow-instance-plugin.js +68 -22
- package/dist/flow/plugins/flow-instance-plugin.js.map +1 -1
- package/dist/flow/plugins/step-definition-plugin.js +2 -1
- package/dist/flow/plugins/step-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/step-instance-plugin.d.ts +9 -1
- package/dist/flow/plugins/step-instance-plugin.js +649 -136
- package/dist/flow/plugins/step-instance-plugin.js.map +1 -1
- package/dist/flow/plugins/wfa-datapill-plugin.js +20 -5
- package/dist/flow/plugins/wfa-datapill-plugin.js.map +1 -1
- package/dist/flow/post-install.js +1 -0
- package/dist/flow/post-install.js.map +1 -1
- package/dist/flow/utils/complex-object-resolver.js +4 -1
- package/dist/flow/utils/complex-object-resolver.js.map +1 -1
- package/dist/flow/utils/complex-objects.js +1 -1
- package/dist/flow/utils/complex-objects.js.map +1 -1
- package/dist/flow/utils/flow-constants.d.ts +66 -2
- package/dist/flow/utils/flow-constants.js +402 -6
- package/dist/flow/utils/flow-constants.js.map +1 -1
- package/dist/flow/utils/flow-io-to-record.d.ts +1 -1
- package/dist/flow/utils/flow-io-to-record.js +37 -16
- package/dist/flow/utils/flow-io-to-record.js.map +1 -1
- package/dist/flow/utils/flow-shapes.js +4 -0
- package/dist/flow/utils/flow-shapes.js.map +1 -1
- package/dist/flow/utils/label-cache-parser.d.ts +9 -2
- package/dist/flow/utils/label-cache-parser.js +32 -4
- package/dist/flow/utils/label-cache-parser.js.map +1 -1
- package/dist/flow/utils/pill-shape-helpers.d.ts +15 -0
- package/dist/flow/utils/pill-shape-helpers.js +35 -0
- package/dist/flow/utils/pill-shape-helpers.js.map +1 -0
- package/dist/flow/utils/pill-string-parser.js +1 -0
- package/dist/flow/utils/pill-string-parser.js.map +1 -1
- package/dist/flow/utils/schema-to-flow-object.d.ts +6 -1
- package/dist/flow/utils/schema-to-flow-object.js +131 -15
- package/dist/flow/utils/schema-to-flow-object.js.map +1 -1
- package/dist/flow/utils/utils.d.ts +1 -0
- package/dist/flow/utils/utils.js +6 -1
- package/dist/flow/utils/utils.js.map +1 -1
- package/dist/form-plugin.js +7 -9
- package/dist/form-plugin.js.map +1 -1
- package/dist/inbound-email-action-plugin.d.ts +10 -0
- package/dist/inbound-email-action-plugin.js +128 -0
- package/dist/inbound-email-action-plugin.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/instance-scan-plugin.js +0 -5
- package/dist/instance-scan-plugin.js.map +1 -1
- package/dist/property-plugin.js +1 -1
- package/dist/property-plugin.js.map +1 -1
- package/dist/record-plugin.d.ts +7 -0
- package/dist/record-plugin.js +10 -2
- package/dist/record-plugin.js.map +1 -1
- package/dist/rest-api-plugin.js +8 -1
- package/dist/rest-api-plugin.js.map +1 -1
- package/dist/schedule-script/scheduled-script-plugin.js +8 -3
- package/dist/schedule-script/scheduled-script-plugin.js.map +1 -1
- package/dist/service-catalog/service-catalog-base.d.ts +18 -18
- package/dist/service-catalog/service-catalog-base.js +22 -22
- package/dist/service-catalog/service-catalog-base.js.map +1 -1
- package/dist/service-portal/header-footer-plugin.d.ts +2 -0
- package/dist/service-portal/header-footer-plugin.js +50 -0
- package/dist/service-portal/header-footer-plugin.js.map +1 -0
- package/dist/service-portal/menu-plugin.js +3 -22
- package/dist/service-portal/menu-plugin.js.map +1 -1
- package/dist/service-portal/page-plugin.js +3 -24
- package/dist/service-portal/page-plugin.js.map +1 -1
- package/dist/service-portal/page-route-map-plugin.d.ts +2 -0
- package/dist/service-portal/page-route-map-plugin.js +114 -0
- package/dist/service-portal/page-route-map-plugin.js.map +1 -0
- package/dist/service-portal/portal-plugin.js +21 -8
- package/dist/service-portal/portal-plugin.js.map +1 -1
- package/dist/service-portal/utils.d.ts +40 -2
- package/dist/service-portal/utils.js +283 -2
- package/dist/service-portal/utils.js.map +1 -1
- package/dist/service-portal/widget-plugin.js +9 -218
- package/dist/service-portal/widget-plugin.js.map +1 -1
- package/dist/static-content-plugin.js +4 -0
- package/dist/static-content-plugin.js.map +1 -1
- package/dist/table-plugin.js +190 -26
- package/dist/table-plugin.js.map +1 -1
- package/dist/ui-action-plugin.js +1 -4
- package/dist/ui-action-plugin.js.map +1 -1
- package/dist/ui-page-plugin.js +68 -13
- package/dist/ui-page-plugin.js.map +1 -1
- package/dist/view-plugin.js +8 -3
- package/dist/view-plugin.js.map +1 -1
- package/dist/workspace-plugin.js +39 -36
- package/dist/workspace-plugin.js.map +1 -1
- package/package.json +5 -4
- package/src/column-plugin.ts +3 -8
- package/src/flow/flow-logic/flow-logic-diagnostics.ts +5 -6
- package/src/flow/plugins/flow-action-definition-plugin.ts +1581 -61
- package/src/flow/plugins/flow-data-pill-plugin.ts +5 -2
- package/src/flow/plugins/flow-definition-plugin.ts +12 -47
- package/src/flow/plugins/flow-diagnostics-plugin.ts +2 -2
- package/src/flow/plugins/flow-instance-plugin.ts +98 -22
- package/src/flow/plugins/step-definition-plugin.ts +2 -1
- package/src/flow/plugins/step-instance-plugin.ts +772 -156
- package/src/flow/plugins/wfa-datapill-plugin.ts +25 -5
- package/src/flow/post-install.ts +1 -0
- package/src/flow/utils/complex-object-resolver.ts +4 -1
- package/src/flow/utils/complex-objects.ts +1 -1
- package/src/flow/utils/flow-constants.ts +421 -5
- package/src/flow/utils/flow-io-to-record.ts +43 -17
- package/src/flow/utils/flow-shapes.ts +4 -0
- package/src/flow/utils/label-cache-parser.ts +33 -4
- package/src/flow/utils/pill-shape-helpers.ts +42 -0
- package/src/flow/utils/pill-string-parser.ts +1 -0
- package/src/flow/utils/schema-to-flow-object.ts +183 -15
- package/src/flow/utils/utils.ts +12 -1
- package/src/form-plugin.ts +1 -3
- package/src/inbound-email-action-plugin.ts +145 -0
- package/src/index.ts +4 -0
- package/src/instance-scan-plugin.ts +0 -5
- package/src/property-plugin.ts +4 -1
- package/src/record-plugin.ts +14 -4
- package/src/rest-api-plugin.ts +7 -1
- package/src/schedule-script/scheduled-script-plugin.ts +14 -3
- package/src/service-catalog/service-catalog-base.ts +22 -22
- package/src/service-portal/header-footer-plugin.ts +57 -0
- package/src/service-portal/menu-plugin.ts +1 -23
- package/src/service-portal/page-plugin.ts +3 -28
- package/src/service-portal/page-route-map-plugin.ts +124 -0
- package/src/service-portal/portal-plugin.ts +33 -10
- package/src/service-portal/utils.ts +404 -3
- package/src/service-portal/widget-plugin.ts +14 -290
- package/src/static-content-plugin.ts +3 -0
- package/src/table-plugin.ts +226 -36
- package/src/ui-action-plugin.ts +1 -8
- package/src/ui-page-plugin.ts +76 -13
- package/src/view-plugin.ts +10 -4
- package/src/workspace-plugin.ts +43 -43
package/src/workspace-plugin.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type Record,
|
|
6
6
|
type Shape,
|
|
7
7
|
type ObjectShape,
|
|
8
|
+
Database,
|
|
8
9
|
} from '@servicenow/sdk-build-core'
|
|
9
10
|
import { NowIdShape } from './now-id-plugin'
|
|
10
11
|
import { createSdkDocEntry } from './utils'
|
|
@@ -47,68 +48,36 @@ export const WorkspacePlugin = Plugin.create({
|
|
|
47
48
|
sys_ux_page_registry: {
|
|
48
49
|
relationships: {
|
|
49
50
|
sys_ux_registry_m2m_category: {
|
|
50
|
-
via:
|
|
51
|
-
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
52
|
-
parent.getId().getValue() ===
|
|
53
|
-
(child.get('page_registry').isRecord()
|
|
54
|
-
? child.get('page_registry').asRecord().getId().getValue()
|
|
55
|
-
: child.get('page_registry').asString().getValue()),
|
|
51
|
+
via: 'page_registry',
|
|
56
52
|
descendant: true,
|
|
57
53
|
},
|
|
58
54
|
sys_ux_page_property: {
|
|
59
|
-
via:
|
|
60
|
-
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
61
|
-
parent.getId().getValue() ===
|
|
62
|
-
(child.get('page').isRecord()
|
|
63
|
-
? child.get('page').asRecord().getId().getValue()
|
|
64
|
-
: child.get('page').asString().getValue()),
|
|
55
|
+
via: 'page',
|
|
65
56
|
descendant: true,
|
|
66
57
|
},
|
|
67
58
|
sys_ux_app_config: {
|
|
68
|
-
via:
|
|
69
|
-
|
|
70
|
-
child.getId().getValue() ===
|
|
71
|
-
(parent.get('admin_panel').isRecord()
|
|
72
|
-
? parent.get('admin_panel').asRecord().getId().getValue()
|
|
73
|
-
: parent.get('admin_panel').asString().getValue()),
|
|
59
|
+
via: 'admin_panel',
|
|
60
|
+
inverse: true,
|
|
74
61
|
descendant: true,
|
|
75
62
|
relationships: {
|
|
76
63
|
sys_ux_screen: {
|
|
77
|
-
via:
|
|
78
|
-
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
79
|
-
parent.getId().getValue() ===
|
|
80
|
-
(child.get('app_config').isRecord()
|
|
81
|
-
? child.get('app_config').asRecord().getId().getValue()
|
|
82
|
-
: child.get('app_config').asString().getValue()),
|
|
64
|
+
via: 'app_config',
|
|
83
65
|
descendant: true,
|
|
84
66
|
relationships: {
|
|
85
67
|
sys_ux_macroponent: {
|
|
86
|
-
via:
|
|
87
|
-
|
|
88
|
-
child.getId().getValue() ===
|
|
89
|
-
(parent.get('macroponent').isRecord()
|
|
90
|
-
? parent.get('macroponent').asRecord().getId().getValue()
|
|
91
|
-
: parent.get('macroponent').asString().getValue()),
|
|
68
|
+
via: 'macroponent',
|
|
69
|
+
inverse: true,
|
|
92
70
|
descendant: true,
|
|
93
71
|
},
|
|
94
72
|
},
|
|
95
73
|
},
|
|
96
74
|
sys_ux_app_route: {
|
|
97
|
-
via:
|
|
98
|
-
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
99
|
-
parent.getId().getValue() ===
|
|
100
|
-
(child.get('app_config').isRecord()
|
|
101
|
-
? child.get('app_config').asRecord().getId().getValue()
|
|
102
|
-
: child.get('app_config').asString().getValue()),
|
|
75
|
+
via: 'app_config',
|
|
103
76
|
descendant: true,
|
|
104
77
|
relationships: {
|
|
105
78
|
sys_ux_screen_type: {
|
|
106
|
-
via:
|
|
107
|
-
|
|
108
|
-
child.getId().getValue() ===
|
|
109
|
-
(parent.get('screen_type').isRecord()
|
|
110
|
-
? parent.get('screen_type').asRecord().getId().getValue()
|
|
111
|
-
: parent.get('screen_type').asString().getValue()),
|
|
79
|
+
via: 'screen_type',
|
|
80
|
+
inverse: true,
|
|
112
81
|
descendant: true,
|
|
113
82
|
},
|
|
114
83
|
},
|
|
@@ -116,10 +85,33 @@ export const WorkspacePlugin = Plugin.create({
|
|
|
116
85
|
},
|
|
117
86
|
},
|
|
118
87
|
},
|
|
119
|
-
async toShape(pageRegRecord, { factory, descendants }) {
|
|
88
|
+
async toShape(pageRegRecord, { factory, descendants: descendantsDB }) {
|
|
120
89
|
if (pageRegRecord.getCreator()?.getName() !== 'WorkspacePlugin') {
|
|
121
90
|
return { success: false }
|
|
122
91
|
}
|
|
92
|
+
|
|
93
|
+
const excludedRecords: Record[] = []
|
|
94
|
+
const supportedRecords: Record[] = []
|
|
95
|
+
const partiallySupportedTables = new Set<string>([
|
|
96
|
+
'sys_ux_registry_m2m_category',
|
|
97
|
+
'sys_ux_page_property',
|
|
98
|
+
'sys_ux_app_config',
|
|
99
|
+
'sys_ux_screen',
|
|
100
|
+
'sys_ux_macroponent',
|
|
101
|
+
'sys_ux_app_route',
|
|
102
|
+
'sys_ux_screen_type',
|
|
103
|
+
])
|
|
104
|
+
descendantsDB.query().forEach((descendant) => {
|
|
105
|
+
if (
|
|
106
|
+
partiallySupportedTables.has(descendant.getTable()) &&
|
|
107
|
+
descendant.getCreator()?.getName() !== 'WorkspacePlugin'
|
|
108
|
+
) {
|
|
109
|
+
excludedRecords.push(descendant)
|
|
110
|
+
} else {
|
|
111
|
+
supportedRecords.push(descendant)
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
const descendants = new Database(supportedRecords)
|
|
123
115
|
// Get 'path' and 'title'
|
|
124
116
|
// TODO 'active'
|
|
125
117
|
const path: string = pageRegRecord.get('path').asString().getValue() ?? ''
|
|
@@ -226,6 +218,14 @@ export const WorkspacePlugin = Plugin.create({
|
|
|
226
218
|
defaultRecordOverrides,
|
|
227
219
|
})
|
|
228
220
|
|
|
221
|
+
if (excludedRecords.length > 0) {
|
|
222
|
+
return {
|
|
223
|
+
success: 'partial',
|
|
224
|
+
value: callExpressionShape,
|
|
225
|
+
unhandledRecords: excludedRecords,
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
229
|
return {
|
|
230
230
|
success: true,
|
|
231
231
|
value: callExpressionShape,
|