@servicenow/sdk-build-plugins 4.8.0 → 4.8.1
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/flow/flow-logic/flow-logic-diagnostics.js +2 -1
- package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -1
- package/dist/flow/flow-logic/flow-logic-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-action-definition-plugin.js +81 -16
- package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-definition-plugin.js +70 -7
- package/dist/flow/plugins/flow-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-instance-plugin.d.ts +35 -1
- package/dist/flow/plugins/flow-instance-plugin.js +240 -6
- package/dist/flow/plugins/flow-instance-plugin.js.map +1 -1
- package/dist/flow/plugins/step-instance-plugin.js +60 -0
- package/dist/flow/plugins/step-instance-plugin.js.map +1 -1
- package/dist/flow/post-install.d.ts +2 -1
- package/dist/flow/post-install.js +31 -4
- package/dist/flow/post-install.js.map +1 -1
- package/dist/flow/utils/complex-object-resolver.js +4 -2
- package/dist/flow/utils/complex-object-resolver.js.map +1 -1
- package/dist/flow/utils/datapill-transformer.d.ts +5 -72
- package/dist/flow/utils/datapill-transformer.js +199 -28
- package/dist/flow/utils/datapill-transformer.js.map +1 -1
- package/dist/flow/utils/flow-io-to-record.js +24 -15
- package/dist/flow/utils/flow-io-to-record.js.map +1 -1
- package/dist/flow/utils/flow-shapes.d.ts +7 -1
- package/dist/flow/utils/flow-shapes.js +19 -0
- package/dist/flow/utils/flow-shapes.js.map +1 -1
- package/dist/flow/utils/flow-variable-processor.d.ts +6 -6
- package/dist/flow/utils/flow-variable-processor.js +8 -8
- package/dist/flow/utils/flow-variable-processor.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/flow/flow-logic/flow-logic-diagnostics.ts +2 -1
- package/src/flow/flow-logic/flow-logic-plugin.ts +0 -1
- package/src/flow/plugins/flow-action-definition-plugin.ts +92 -25
- package/src/flow/plugins/flow-definition-plugin.ts +114 -8
- package/src/flow/plugins/flow-instance-plugin.ts +262 -6
- package/src/flow/plugins/step-instance-plugin.ts +73 -1
- package/src/flow/post-install.ts +36 -5
- package/src/flow/utils/complex-object-resolver.ts +4 -2
- package/src/flow/utils/datapill-transformer.ts +248 -36
- package/src/flow/utils/flow-io-to-record.ts +28 -14
- package/src/flow/utils/flow-shapes.ts +19 -0
- package/src/flow/utils/flow-variable-processor.ts +21 -10
- package/src/index.ts +1 -1
|
@@ -12,6 +12,25 @@ import type { ApprovalRulesType, ApprovalDueDateType } from '@servicenow/sdk-cor
|
|
|
12
12
|
import { approvalRulesJsonToString, approvalRulesStringToJson } from './approval-rules-processor'
|
|
13
13
|
import { APPROVAL_RULES_API_NAME, APPROVAL_DUE_DATE_API_NAME } from './flow-constants'
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Safely extracts a sysId string from a shape that may be either a plain StringShape
|
|
17
|
+
* or a FK-resolved Record. After build+install the SDK resolves FK fields to Record
|
|
18
|
+
* objects, so calling .asString() directly would throw.
|
|
19
|
+
*/
|
|
20
|
+
export function getRefSysId(shape: Shape | undefined): string | undefined {
|
|
21
|
+
if (!shape) {
|
|
22
|
+
return undefined
|
|
23
|
+
}
|
|
24
|
+
const str = shape.ifString()?.getValue()
|
|
25
|
+
if (str !== undefined) {
|
|
26
|
+
return str
|
|
27
|
+
}
|
|
28
|
+
if (shape instanceof Record) {
|
|
29
|
+
return shape.getId().getValue()
|
|
30
|
+
}
|
|
31
|
+
return undefined
|
|
32
|
+
}
|
|
33
|
+
|
|
15
34
|
/**
|
|
16
35
|
* Abstract base class for all flow definition instances.
|
|
17
36
|
* Extends CallExpressionShape to provide common functionality for flow constructs.
|
|
@@ -7,9 +7,9 @@ import { buildVariableRecords } from './flow-io-to-record'
|
|
|
7
7
|
export type VariableTableType = 'sys_hub_flow_input' | 'sys_hub_flow_output' | 'sys_hub_flow_variable'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Parent table type
|
|
10
|
+
* Parent table type for flow variable/IO records
|
|
11
11
|
*/
|
|
12
|
-
export type ParentTableType = 'sys_hub_flow'
|
|
12
|
+
export type ParentTableType = 'sys_hub_flow' | 'sys_hub_flow_snapshot'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Process a flow variable configuration (inputs, outputs, or flow variables)
|
|
@@ -27,7 +27,8 @@ export async function processVariableConfig(
|
|
|
27
27
|
varTable: VariableTableType,
|
|
28
28
|
parentRecord: Record,
|
|
29
29
|
factory: Factory,
|
|
30
|
-
diagnostics: Diagnostics
|
|
30
|
+
diagnostics: Diagnostics,
|
|
31
|
+
parentTable: ParentTableType = 'sys_hub_flow'
|
|
31
32
|
): Promise<Record[]> {
|
|
32
33
|
if (!config) {
|
|
33
34
|
return []
|
|
@@ -38,7 +39,7 @@ export async function processVariableConfig(
|
|
|
38
39
|
parentRecord,
|
|
39
40
|
factory,
|
|
40
41
|
diagnostics,
|
|
41
|
-
parentTable
|
|
42
|
+
parentTable,
|
|
42
43
|
varTable,
|
|
43
44
|
})
|
|
44
45
|
|
|
@@ -58,9 +59,10 @@ export async function processFlowInputs(
|
|
|
58
59
|
inputsConfig: ObjectShape | undefined,
|
|
59
60
|
parentRecord: Record,
|
|
60
61
|
factory: Factory,
|
|
61
|
-
diagnostics: Diagnostics
|
|
62
|
+
diagnostics: Diagnostics,
|
|
63
|
+
parentTable: ParentTableType = 'sys_hub_flow'
|
|
62
64
|
): Promise<Record[]> {
|
|
63
|
-
return processVariableConfig(inputsConfig, 'sys_hub_flow_input', parentRecord, factory, diagnostics)
|
|
65
|
+
return processVariableConfig(inputsConfig, 'sys_hub_flow_input', parentRecord, factory, diagnostics, parentTable)
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
/**
|
|
@@ -76,9 +78,10 @@ export async function processFlowOutputs(
|
|
|
76
78
|
outputsConfig: ObjectShape | undefined,
|
|
77
79
|
parentRecord: Record,
|
|
78
80
|
factory: Factory,
|
|
79
|
-
diagnostics: Diagnostics
|
|
81
|
+
diagnostics: Diagnostics,
|
|
82
|
+
parentTable: ParentTableType = 'sys_hub_flow'
|
|
80
83
|
): Promise<Record[]> {
|
|
81
|
-
return processVariableConfig(outputsConfig, 'sys_hub_flow_output', parentRecord, factory, diagnostics)
|
|
84
|
+
return processVariableConfig(outputsConfig, 'sys_hub_flow_output', parentRecord, factory, diagnostics, parentTable)
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
/**
|
|
@@ -94,7 +97,15 @@ export async function processFlowVariables(
|
|
|
94
97
|
flowVariablesConfig: ObjectShape | undefined,
|
|
95
98
|
parentRecord: Record,
|
|
96
99
|
factory: Factory,
|
|
97
|
-
diagnostics: Diagnostics
|
|
100
|
+
diagnostics: Diagnostics,
|
|
101
|
+
parentTable: ParentTableType = 'sys_hub_flow'
|
|
98
102
|
): Promise<Record[]> {
|
|
99
|
-
return processVariableConfig(
|
|
103
|
+
return processVariableConfig(
|
|
104
|
+
flowVariablesConfig,
|
|
105
|
+
'sys_hub_flow_variable',
|
|
106
|
+
parentRecord,
|
|
107
|
+
factory,
|
|
108
|
+
diagnostics,
|
|
109
|
+
parentTable
|
|
110
|
+
)
|
|
100
111
|
}
|
package/src/index.ts
CHANGED