@sonisoft/now-sdk-ext-core 6.6.3 → 6.8.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.
Files changed (79) hide show
  1. package/README.md +6 -0
  2. package/dist/comm/http/FormHtmlParser.d.ts +34 -0
  3. package/dist/comm/http/FormHtmlParser.js +227 -0
  4. package/dist/comm/http/FormHtmlParser.js.map +1 -0
  5. package/dist/comm/http/FormRecordModels.d.ts +120 -0
  6. package/dist/comm/http/FormRecordModels.js +6 -0
  7. package/dist/comm/http/FormRecordModels.js.map +1 -0
  8. package/dist/comm/http/FormRecordWriter.d.ts +99 -0
  9. package/dist/comm/http/FormRecordWriter.js +385 -0
  10. package/dist/comm/http/FormRecordWriter.js.map +1 -0
  11. package/dist/comm/http/HTTPRequest.d.ts +4 -0
  12. package/dist/comm/http/RequestHandler.d.ts +1 -0
  13. package/dist/comm/http/RequestHandler.js +34 -22
  14. package/dist/comm/http/RequestHandler.js.map +1 -1
  15. package/dist/comm/http/internal/FormTransportModels.d.ts +26 -0
  16. package/dist/comm/http/internal/FormTransportModels.js +2 -0
  17. package/dist/comm/http/internal/FormTransportModels.js.map +1 -0
  18. package/dist/exception/FormSubmitError.d.ts +13 -0
  19. package/dist/exception/FormSubmitError.js +19 -0
  20. package/dist/exception/FormSubmitError.js.map +1 -0
  21. package/dist/exception/WorkflowValidationError.d.ts +24 -0
  22. package/dist/exception/WorkflowValidationError.js +24 -0
  23. package/dist/exception/WorkflowValidationError.js.map +1 -0
  24. package/dist/index.d.ts +19 -0
  25. package/dist/index.js +19 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/sn/metadata/MetadataFormWriter.d.ts +13 -0
  28. package/dist/sn/metadata/MetadataFormWriter.js +264 -0
  29. package/dist/sn/metadata/MetadataFormWriter.js.map +1 -0
  30. package/dist/sn/metadata/MetadataModels.d.ts +44 -0
  31. package/dist/sn/metadata/MetadataModels.js +2 -0
  32. package/dist/sn/metadata/MetadataModels.js.map +1 -0
  33. package/dist/sn/metadata/MetadataScopeError.d.ts +5 -0
  34. package/dist/sn/metadata/MetadataScopeError.js +10 -0
  35. package/dist/sn/metadata/MetadataScopeError.js.map +1 -0
  36. package/dist/sn/metadata/MetadataVerificationError.d.ts +11 -0
  37. package/dist/sn/metadata/MetadataVerificationError.js +20 -0
  38. package/dist/sn/metadata/MetadataVerificationError.js.map +1 -0
  39. package/dist/sn/metadata/internal/MetadataPreferences.d.ts +12 -0
  40. package/dist/sn/metadata/internal/MetadataPreferences.js +27 -0
  41. package/dist/sn/metadata/internal/MetadataPreferences.js.map +1 -0
  42. package/dist/sn/metadata/internal/MetadataReader.d.ts +9 -0
  43. package/dist/sn/metadata/internal/MetadataReader.js +55 -0
  44. package/dist/sn/metadata/internal/MetadataReader.js.map +1 -0
  45. package/dist/sn/variables/VariableDefinitions.d.ts +23 -0
  46. package/dist/sn/variables/VariableDefinitions.js +106 -0
  47. package/dist/sn/variables/VariableDefinitions.js.map +1 -0
  48. package/dist/sn/variables/VariableModels.d.ts +49 -0
  49. package/dist/sn/variables/VariableModels.js +6 -0
  50. package/dist/sn/variables/VariableModels.js.map +1 -0
  51. package/dist/sn/workflow/WorkflowConversionModels.d.ts +209 -0
  52. package/dist/sn/workflow/WorkflowConversionModels.js +2 -0
  53. package/dist/sn/workflow/WorkflowConversionModels.js.map +1 -0
  54. package/dist/sn/workflow/WorkflowDiagramClient.d.ts +70 -0
  55. package/dist/sn/workflow/WorkflowDiagramClient.js +151 -0
  56. package/dist/sn/workflow/WorkflowDiagramClient.js.map +1 -0
  57. package/dist/sn/workflow/WorkflowFlowConversion.d.ts +19 -0
  58. package/dist/sn/workflow/WorkflowFlowConversion.js +1013 -0
  59. package/dist/sn/workflow/WorkflowFlowConversion.js.map +1 -0
  60. package/dist/sn/workflow/WorkflowFlowHints.d.ts +3 -0
  61. package/dist/sn/workflow/WorkflowFlowHints.js +36 -0
  62. package/dist/sn/workflow/WorkflowFlowHints.js.map +1 -0
  63. package/dist/sn/workflow/WorkflowFluentGenerator.d.ts +17 -0
  64. package/dist/sn/workflow/WorkflowFluentGenerator.js +348 -0
  65. package/dist/sn/workflow/WorkflowFluentGenerator.js.map +1 -0
  66. package/dist/sn/workflow/WorkflowGraphML.d.ts +39 -0
  67. package/dist/sn/workflow/WorkflowGraphML.js +162 -0
  68. package/dist/sn/workflow/WorkflowGraphML.js.map +1 -0
  69. package/dist/sn/workflow/WorkflowManager.d.ts +236 -6
  70. package/dist/sn/workflow/WorkflowManager.js +1443 -15
  71. package/dist/sn/workflow/WorkflowManager.js.map +1 -1
  72. package/dist/sn/workflow/WorkflowModels.d.ts +738 -0
  73. package/dist/sn/workflow/WorkflowStructure.d.ts +137 -0
  74. package/dist/sn/workflow/WorkflowStructure.js +368 -0
  75. package/dist/sn/workflow/WorkflowStructure.js.map +1 -0
  76. package/dist/sn/workflow/WorkflowViews.d.ts +104 -0
  77. package/dist/sn/workflow/WorkflowViews.js +408 -0
  78. package/dist/sn/workflow/WorkflowViews.js.map +1 -0
  79. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowConversionModels.js","sourceRoot":"","sources":["../../../src/sn/workflow/WorkflowConversionModels.ts"],"names":[],"mappings":""}
@@ -0,0 +1,70 @@
1
+ import { ServiceNowInstance } from "../ServiceNowInstance.js";
2
+ import { DiagramProcessorMessages, GraphNodeInput } from "./WorkflowGraphML.js";
3
+ import { WorkflowGraph, WorkflowGraphEdge } from "./WorkflowModels.js";
4
+ /**
5
+ * Client for the Workflow Editor's diagram processor — the endpoint the legacy Workflow
6
+ * Editor canvas uses for every structural change (`POST /xmlhttp.do` with
7
+ * `sysparm_processor=com.glideapp.workflow.ui.WorkflowDiagramProcessor`).
8
+ *
9
+ * Going through it, rather than writing wf_* records directly, is what gets the
10
+ * platform's own behaviour: checkout's deep copy of a version, publish's validation,
11
+ * path computation and version swap, and node deletes that clean up exits and variables.
12
+ *
13
+ * Low level: no argument resolution or permission checks. Use WorkflowManager.
14
+ */
15
+ export declare class WorkflowDiagramClient {
16
+ private _instance;
17
+ constructor(instance: ServiceNowInstance);
18
+ /** Read a version's diagram, including what the current user may do with it. */
19
+ get(versionSysId: string): Promise<WorkflowGraph>;
20
+ /** Read one activity's node and its exits. */
21
+ getNode(activitySysId: string): Promise<WorkflowGraph>;
22
+ /**
23
+ * Check out a published version: creates a new draft version (a deep copy of
24
+ * activities, exits, transitions, variables and stages) checked out to the caller.
25
+ *
26
+ * @returns The draft's diagram (`id` is the new version's sys_id)
27
+ */
28
+ checkout(versionSysId: string, name: string): Promise<WorkflowGraph>;
29
+ /** Take over a checkout held by another user. */
30
+ forceCheckout(versionSysId: string): Promise<WorkflowGraph>;
31
+ /**
32
+ * Publish a draft. With `validate`, validation findings are returned instead of
33
+ * publishing when there are any Warn or Critical results.
34
+ */
35
+ publish(versionSysId: string, validate: boolean): Promise<{
36
+ graph?: WorkflowGraph;
37
+ messages: DiagramProcessorMessages;
38
+ }>;
39
+ /**
40
+ * Delete a version. Deleting a draft discards the checkout; deleting a workflow's
41
+ * last version deletes the workflow.
42
+ */
43
+ delete(versionSysId: string): Promise<void>;
44
+ /** Set the workflow active or inactive. */
45
+ setActive(versionSysId: string, active: boolean): Promise<void>;
46
+ /** Reposition activities. */
47
+ moveNodes(versionSysId: string, nodes: GraphNodeInput[]): Promise<void>;
48
+ /** Add a transition. The edge id becomes the wf_transition sys_id. */
49
+ newEdge(versionSysId: string, edge: WorkflowGraphEdge): Promise<void>;
50
+ /** Re-point an existing transition. */
51
+ changeEdge(versionSysId: string, edge: WorkflowGraphEdge): Promise<void>;
52
+ /** Remove a transition. */
53
+ deleteEdge(versionSysId: string, edge: WorkflowGraphEdge): Promise<void>;
54
+ /**
55
+ * What the editor sends when an activity is dropped onto a line: position the node,
56
+ * re-point the existing transitions, and add the new ones.
57
+ */
58
+ newEdgeControlNode(versionSysId: string, node: GraphNodeInput, changedEdges: WorkflowGraphEdge[], newEdges: WorkflowGraphEdge[]): Promise<void>;
59
+ /**
60
+ * Delete an activity together with its exits and variables, removing, re-pointing
61
+ * and adding transitions as given.
62
+ */
63
+ deleteNode(versionSysId: string, activitySysId: string, deleteEdges: WorkflowGraphEdge[], changedEdges?: WorkflowGraphEdge[], newEdges?: WorkflowGraphEdge[]): Promise<void>;
64
+ /** Recompute stage assignments after activities change (the editor calls this after every activity save). */
65
+ updateStages(versionSysId: string): Promise<void>;
66
+ private edges;
67
+ private requireGraph;
68
+ private call;
69
+ private request;
70
+ }
@@ -0,0 +1,151 @@
1
+ import { SessionManager } from "../../comm/http/SessionManager.js";
2
+ import { READ_ONLY } from "../../policy/PolicyTypes.js";
3
+ import { redactMessage, stripSecretsFromError } from "../../util/redact.js";
4
+ import { parseDiagramResponse, serializeGraph } from "./WorkflowGraphML.js";
5
+ const PROCESSOR = "com.glideapp.workflow.ui.WorkflowDiagramProcessor";
6
+ /**
7
+ * Client for the Workflow Editor's diagram processor — the endpoint the legacy Workflow
8
+ * Editor canvas uses for every structural change (`POST /xmlhttp.do` with
9
+ * `sysparm_processor=com.glideapp.workflow.ui.WorkflowDiagramProcessor`).
10
+ *
11
+ * Going through it, rather than writing wf_* records directly, is what gets the
12
+ * platform's own behaviour: checkout's deep copy of a version, publish's validation,
13
+ * path computation and version swap, and node deletes that clean up exits and variables.
14
+ *
15
+ * Low level: no argument resolution or permission checks. Use WorkflowManager.
16
+ */
17
+ export class WorkflowDiagramClient {
18
+ _instance;
19
+ constructor(instance) {
20
+ this._instance = instance;
21
+ }
22
+ /** Read a version's diagram, including what the current user may do with it. */
23
+ async get(versionSysId) {
24
+ return this.requireGraph(await this.call("get", { id: versionSysId }, true), "get");
25
+ }
26
+ /** Read one activity's node and its exits. */
27
+ async getNode(activitySysId) {
28
+ return this.requireGraph(await this.call("getnode", { id: activitySysId }, true), "getnode");
29
+ }
30
+ /**
31
+ * Check out a published version: creates a new draft version (a deep copy of
32
+ * activities, exits, transitions, variables and stages) checked out to the caller.
33
+ *
34
+ * @returns The draft's diagram (`id` is the new version's sys_id)
35
+ */
36
+ async checkout(versionSysId, name) {
37
+ return this.requireGraph(await this.call("checkout", { sys_id: versionSysId, name }), "checkout");
38
+ }
39
+ /** Take over a checkout held by another user. */
40
+ async forceCheckout(versionSysId) {
41
+ return this.requireGraph(await this.call("forcecheckout", { sys_id: versionSysId }), "forcecheckout");
42
+ }
43
+ /**
44
+ * Publish a draft. With `validate`, validation findings are returned instead of
45
+ * publishing when there are any Warn or Critical results.
46
+ */
47
+ async publish(versionSysId, validate) {
48
+ const parsed = await this.call(validate ? "publish" : "publish_novalidate", { sys_id: versionSysId });
49
+ return { graph: parsed.graph, messages: parsed.messages };
50
+ }
51
+ /**
52
+ * Delete a version. Deleting a draft discards the checkout; deleting a workflow's
53
+ * last version deletes the workflow.
54
+ */
55
+ async delete(versionSysId) {
56
+ await this.call("delete", { sys_id: versionSysId });
57
+ }
58
+ /** Set the workflow active or inactive. */
59
+ async setActive(versionSysId, active) {
60
+ await this.call(active ? "activate" : "inactivate", { sys_id: versionSysId });
61
+ }
62
+ /** Reposition activities. */
63
+ async moveNodes(versionSysId, nodes) {
64
+ await this.call("movenodes", { id: versionSysId, xml: serializeGraph(versionSysId, { nodes }) });
65
+ }
66
+ /** Add a transition. The edge id becomes the wf_transition sys_id. */
67
+ async newEdge(versionSysId, edge) {
68
+ await this.call("newedge", { id: versionSysId, xml: serializeGraph(versionSysId, { edges: [edge] }) });
69
+ }
70
+ /** Re-point an existing transition. */
71
+ async changeEdge(versionSysId, edge) {
72
+ await this.call("changeedge", { id: versionSysId, xml: serializeGraph(versionSysId, { edges: [edge] }) });
73
+ }
74
+ /** Remove a transition. */
75
+ async deleteEdge(versionSysId, edge) {
76
+ await this.call("deleteedge", { id: versionSysId, xml: serializeGraph(versionSysId, { edges: [edge] }) });
77
+ }
78
+ /**
79
+ * What the editor sends when an activity is dropped onto a line: position the node,
80
+ * re-point the existing transitions, and add the new ones.
81
+ */
82
+ async newEdgeControlNode(versionSysId, node, changedEdges, newEdges) {
83
+ await this.call("newedgecontrolnode", {
84
+ id: versionSysId,
85
+ xml: serializeGraph(versionSysId, { nodes: [node] }),
86
+ changed_edges: this.edges(versionSysId, changedEdges),
87
+ new_edges: this.edges(versionSysId, newEdges),
88
+ });
89
+ }
90
+ /**
91
+ * Delete an activity together with its exits and variables, removing, re-pointing
92
+ * and adding transitions as given.
93
+ */
94
+ async deleteNode(versionSysId, activitySysId, deleteEdges, changedEdges = [], newEdges = []) {
95
+ await this.call("deletenode", {
96
+ id: versionSysId,
97
+ xml: serializeGraph(versionSysId, { nodes: [{ id: activitySysId }] }),
98
+ delete_edges: this.edges(versionSysId, deleteEdges),
99
+ changed_edges: this.edges(versionSysId, changedEdges),
100
+ new_edges: this.edges(versionSysId, newEdges),
101
+ });
102
+ }
103
+ /** Recompute stage assignments after activities change (the editor calls this after every activity save). */
104
+ async updateStages(versionSysId) {
105
+ await this.call("updatestages", { id: versionSysId });
106
+ }
107
+ edges(versionSysId, edges) {
108
+ return edges.length ? serializeGraph(versionSysId, { edges }) : "";
109
+ }
110
+ requireGraph(parsed, type) {
111
+ if (!parsed.graph)
112
+ throw new Error(`The workflow diagram processor returned no diagram for '${type}'`);
113
+ return parsed.graph;
114
+ }
115
+ async call(type, params, readOnly = false) {
116
+ try {
117
+ const response = await this.request().post({
118
+ method: "POST", path: "/xmlhttp.do", headers: null, query: null, body: null,
119
+ responseFormat: "text",
120
+ ...(readOnly ? { requires: READ_ONLY } : {}),
121
+ fields: {
122
+ sysparm_processor: PROCESSOR,
123
+ sysparm_scope: "global",
124
+ sysparm_want_session_messages: "true",
125
+ sysparm_type: type,
126
+ ...params,
127
+ },
128
+ });
129
+ const body = typeof response.data === "string" ? response.data : "";
130
+ if (!/<xml[\s>]/.test(body) || !body.includes(PROCESSOR)) {
131
+ throw new Error(`The workflow diagram processor did not answer '${type}' (the session may have expired)`);
132
+ }
133
+ const parsed = parseDiagramResponse(body);
134
+ if (parsed.messages.duplicateName)
135
+ throw new Error(parsed.messages.duplicateName);
136
+ if (parsed.messages.differentDomain)
137
+ throw new Error(parsed.messages.differentDomain);
138
+ return { graph: parsed.graph, messages: parsed.messages };
139
+ }
140
+ catch (error) {
141
+ if (error instanceof Error)
142
+ error.message = redactMessage(error.message);
143
+ throw stripSecretsFromError(error);
144
+ }
145
+ }
146
+ request() {
147
+ // Shares the Table API's session, so reads and processor writes see the same user state.
148
+ return SessionManager.getInstance().getRequest(this._instance);
149
+ }
150
+ }
151
+ //# sourceMappingURL=WorkflowDiagramClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowDiagramClient.js","sourceRoot":"","sources":["../../../src/sn/workflow/WorkflowDiagramClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAA4C,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnH,MAAM,SAAS,GAAG,mDAAmD,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,OAAO,qBAAqB;IACtB,SAAS,CAAqB;IAEtC,YAAmB,QAA4B;QAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED,gFAAgF;IACzE,KAAK,CAAC,GAAG,CAAC,YAAoB;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACxF,CAAC;IAED,8CAA8C;IACvC,KAAK,CAAC,OAAO,CAAC,aAAqB;QACtC,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,E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AQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC9D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,KAAK;gBAAE,KAAK,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACzE,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;IACL,CAAC;IAEO,OAAO;QACX,yFAAyF;QACzF,OAAO,cAAc,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnE,CAAC;CACJ"}
@@ -0,0 +1,19 @@
1
+ import { WorkflowExport } from "./WorkflowModels.js";
2
+ import { FlowConversionPlan, FlowPlanCondition } from "./WorkflowConversionModels.js";
3
+ /** Whether generated code cannot use this name as a binding. */
4
+ export declare function isReservedIdentifier(name: string): boolean;
5
+ /** Text placed in a template literal as is: backslashes, backticks and `${` escaped. */
6
+ export declare function templateLiteralText(text: string): string;
7
+ /** A code-safe lowercase identifier from free text. */
8
+ export declare function identifierFrom(text: string, max?: number): string;
9
+ /**
10
+ * Plan a Flow Designer flow (or subflow) for a legacy workflow export.
11
+ */
12
+ export declare function planFlowConversion(data: WorkflowExport): FlowConversionPlan;
13
+ /**
14
+ * Convert an encoded query on the workflow's record into a flow condition. Terms on catalog
15
+ * variables or with `javascript:` values cannot become data pills and leave it underived.
16
+ */
17
+ export declare function encodedQueryToCondition(query: string, recordPill: string, display?: string): FlowPlanCondition;
18
+ /** The plan as readable text: trigger, flow body, notes and the open decisions. */
19
+ export declare function renderFlowPlan(plan: FlowConversionPlan): string;