@device-management-toolkit/wsman-messages 5.9.4

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 (90) hide show
  1. package/README.md +29 -0
  2. package/WSMan.d.ts +217 -0
  3. package/WSMan.js +395 -0
  4. package/WSMan.js.map +1 -0
  5. package/amt/actions.d.ts +112 -0
  6. package/amt/actions.js +118 -0
  7. package/amt/actions.js.map +1 -0
  8. package/amt/classes.d.ts +33 -0
  9. package/amt/classes.js +38 -0
  10. package/amt/classes.js.map +1 -0
  11. package/amt/index.d.ts +12 -0
  12. package/amt/index.js +17 -0
  13. package/amt/index.js.map +1 -0
  14. package/amt/messages.d.ts +466 -0
  15. package/amt/messages.js +819 -0
  16. package/amt/messages.js.map +1 -0
  17. package/amt/messages.test.d.ts +5 -0
  18. package/amt/messages.test.js +1091 -0
  19. package/amt/messages.test.js.map +1 -0
  20. package/amt/methods.d.ts +42 -0
  21. package/amt/methods.js +47 -0
  22. package/amt/methods.js.map +1 -0
  23. package/amt/models.d.ts +329 -0
  24. package/amt/models.js +7 -0
  25. package/amt/models.js.map +1 -0
  26. package/amt/types.d.ts +206 -0
  27. package/amt/types.js +7 -0
  28. package/amt/types.js.map +1 -0
  29. package/cim/actions.d.ts +9 -0
  30. package/cim/actions.js +14 -0
  31. package/cim/actions.js.map +1 -0
  32. package/cim/classes.d.ts +27 -0
  33. package/cim/classes.js +32 -0
  34. package/cim/classes.js.map +1 -0
  35. package/cim/index.d.ts +12 -0
  36. package/cim/index.js +16 -0
  37. package/cim/index.js.map +1 -0
  38. package/cim/messages.d.ts +136 -0
  39. package/cim/messages.js +215 -0
  40. package/cim/messages.js.map +1 -0
  41. package/cim/messages.test.d.ts +5 -0
  42. package/cim/messages.test.js +408 -0
  43. package/cim/messages.test.js.map +1 -0
  44. package/cim/methods.d.ts +15 -0
  45. package/cim/methods.js +20 -0
  46. package/cim/methods.js.map +1 -0
  47. package/cim/models.d.ts +376 -0
  48. package/cim/models.js +7 -0
  49. package/cim/models.js.map +1 -0
  50. package/cim/types.d.ts +296 -0
  51. package/cim/types.js +7 -0
  52. package/cim/types.js.map +1 -0
  53. package/dist +42 -0
  54. package/index.d.ts +9 -0
  55. package/index.js +49 -0
  56. package/index.js.map +1 -0
  57. package/ips/actions.d.ts +15 -0
  58. package/ips/actions.js +20 -0
  59. package/ips/actions.js.map +1 -0
  60. package/ips/classes.d.ts +12 -0
  61. package/ips/classes.js +17 -0
  62. package/ips/classes.js.map +1 -0
  63. package/ips/index.d.ts +12 -0
  64. package/ips/index.js +16 -0
  65. package/ips/index.js.map +1 -0
  66. package/ips/messages.d.ts +117 -0
  67. package/ips/messages.js +210 -0
  68. package/ips/messages.js.map +1 -0
  69. package/ips/messages.test.d.ts +5 -0
  70. package/ips/messages.test.js +206 -0
  71. package/ips/messages.test.js.map +1 -0
  72. package/ips/methods.d.ts +21 -0
  73. package/ips/methods.js +26 -0
  74. package/ips/methods.js.map +1 -0
  75. package/ips/models.d.ts +59 -0
  76. package/ips/models.js +7 -0
  77. package/ips/models.js.map +1 -0
  78. package/ips/types.d.ts +58 -0
  79. package/ips/types.js +7 -0
  80. package/ips/types.js.map +1 -0
  81. package/models/common.d.ts +104 -0
  82. package/models/common.js +7 -0
  83. package/models/common.js.map +1 -0
  84. package/models/index.d.ts +6 -0
  85. package/models/index.js +43 -0
  86. package/models/index.js.map +1 -0
  87. package/package.json +41 -0
  88. package/wsman.test.d.ts +5 -0
  89. package/wsman.test.js +479 -0
  90. package/wsman.test.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # WSMAN-MESSAGES
2
+
3
+ ![CodeQL](https://img.shields.io/github/actions/workflow/status/device-management-toolkit/wsman-messages/codeql-analysis.yml?style=for-the-badge&label=CodeQL&logo=github)
4
+ ![Build](https://img.shields.io/github/actions/workflow/status/device-management-toolkit/wsman-messages/node.js.yml?style=for-the-badge&logo=github)
5
+ ![Codecov](https://img.shields.io/codecov/c/github/device-management-toolkit/wsman-messages?style=for-the-badge&logo=codecov)
6
+ [![OSSF-Scorecard Score](https://img.shields.io/ossf-scorecard/github.com/device-management-toolkit/wsman-messages?style=for-the-badge&label=OSSF%20Score)](https://api.securityscorecards.dev/projects/github.com/device-management-toolkit/wsman-messages)
7
+ [![Discord](https://img.shields.io/discord/1063200098680582154?style=for-the-badge&label=Discord&logo=discord&logoColor=white&labelColor=%235865F2&link=https%3A%2F%2Fdiscord.gg%2FDKHeUNEWVH)](https://discord.gg/DKHeUNEWVH)
8
+
9
+ Creates properly formatted wsman messages to send to Intel® Active Management Technology (AMT) capable platforms. These libraries provide an easy to use API that when called return an XML string that is ready to be sent to an Intel® AMT device. Supports calls into AMT, IPS, and CIM classes supported by Intel® AMT devices. Full AMT SDK documentation can be found [here](https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm).
10
+
11
+ <br>
12
+
13
+ ## Installation
14
+
15
+ via NPM
16
+
17
+ ```bash
18
+ npm i @open-amt-cloud-toolkit/wsman-messages
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```typescript
24
+ import { AMT } from '@open-amt-cloud-toolkit/wsman-messages'
25
+
26
+ const amtClass = new AMT.Message()
27
+ const message = this.amtClass.GeneralSettings.Get()
28
+ console.log(message)
29
+ ```
package/WSMan.d.ts ADDED
@@ -0,0 +1,217 @@
1
+ /*********************************************************************
2
+ * Copyright (c) Intel Corporation 2021
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ ***********************************************************************/
5
+ import type { AMT, CIM, IPS } from '.';
6
+ export interface Selector {
7
+ name: string | undefined;
8
+ value: string | undefined;
9
+ }
10
+ export declare enum WSManErrors {
11
+ HEADER = "missing header",
12
+ BODY = "missing body",
13
+ ACTION = "missing action",
14
+ MESSAGE_ID = "missing messageId",
15
+ RESOURCE_URI = "missing resourceUri",
16
+ ENUMERATION_CONTEXT = "missing enumerationContext",
17
+ UNSUPPORTED_METHOD = "unsupported method",
18
+ INPUT = "missing input",
19
+ REQUESTED_STATE = "missing requestedState",
20
+ SELECTOR = "missing selector",
21
+ ROLE = "missing role",
22
+ REQUESTED_POWER_STATE_CHANGE = "missing powerState",
23
+ ADMIN_PASS_ENCRYPTION_TYPE = "missing adminPassEncryptionType",
24
+ ADMIN_PASSWORD = "missing adminPassword",
25
+ ETHERNET_PORT_OBJECT = "missing ethernetPortObject",
26
+ ENVIRONMENT_DETECTION_SETTING_DATA = "missing environmentDetectionSettingData",
27
+ CERTIFICATE_BLOB = "missing certificateBlob",
28
+ MP_SERVER = "missing mpServer",
29
+ REMOTE_ACCESS_POLICY_RULE = "missing remoteAccessPolicyRule",
30
+ BOOT_SETTING_DATA = "missing bootSettingData",
31
+ ADD_ALARM_DATA = "missing alarmClockOccurrence",
32
+ IEEE8021X_SETTINGS = "missing ieee8021xSettings",
33
+ OPT_IN_SERVICE_RESPONSE = "missing OptInServiceResponse",
34
+ OPT_IN_CODE = "missing OptInCode",
35
+ KEY_PAIR = "missing KeyAlgorithm and/or KeyLength",
36
+ DATA = "missing data",
37
+ NONCE = "missing nonce",
38
+ SIGNING_ALGORITHM = "missing signingAlgorithm",
39
+ DIGITAL_SIGNATURE = "missing digitalSignature",
40
+ IS_LEAF = "missing isLeaf",
41
+ IS_ROOT = "missing isRoot",
42
+ TLS_CREDENTIAL_CONTEXT = "missing tlsCredentialContext",
43
+ GENERAL_SETTINGS = "missing generalSettings",
44
+ PASSWORD = "missing password",
45
+ PKCS10_REQUEST = "missing PKCS10Request",
46
+ USERNAME = "missing username",
47
+ DIGEST_PASSWORD = "missing digestPassword",
48
+ INSTANCE_ID = "missing InstanceID",
49
+ MISSING_USER_ACL_ENTRY_INFORMATION = "Digest username and password or Kerberos SID is required",
50
+ USERNAME_TOO_LONG = "Username is too long"
51
+ }
52
+ export declare enum BaseActions {
53
+ ENUMERATE = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate",
54
+ PULL = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull",
55
+ GET = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get",
56
+ PUT = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Put",
57
+ CREATE = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Create",
58
+ DELETE = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"
59
+ }
60
+ export declare class WSManMessageCreator {
61
+ messageId: number;
62
+ xmlCommonPrefix: string;
63
+ xmlCommonEnd: string;
64
+ anonymousAddress: string;
65
+ defaultTimeout: string;
66
+ resourceUriBase: string;
67
+ constructor(resourceUriBase: string);
68
+ /**
69
+ * Assembles the xml from the xmlCommonPrefix, header, body, and xmlCommonEnd
70
+ * @param header Partial XML created by createHeader function
71
+ * @param body Partial XML created by createBody or createCommonBody functions
72
+ * @returns string
73
+ */
74
+ createXml: (header: string, body: string) => string;
75
+ /**
76
+ * Creates a partial XML header
77
+ * @param action WSMAN Action value based on DMTF schema
78
+ * @param resourceUri WSMAN ResourceURI value based on DMTF schema
79
+ * @param address WSMAN Address value based on DMTF schema
80
+ * @param timeout WSMAN OperationTimeout value for commands to be executed - PT60S default
81
+ * @param selector WSMAN Selector values for headers that require it
82
+ * @returns string
83
+ */
84
+ createHeader: (action: string, wsmanClass: CIM.Classes | AMT.Classes | IPS.Classes, selector?: Selector | null, address?: string, timeout?: string) => string;
85
+ /**
86
+ * Creates a WSMAN string based on Selector Set information provided. Can be used in header or body
87
+ * @param selectorSet Selector data being passed in. Could take many forms depending on the WSMAN call
88
+ * @returns string
89
+ */
90
+ createSelector: (selectorSet: any) => string;
91
+ createSelectorObjectForBody: (selector: Selector) => object;
92
+ /**
93
+ * Creates a WSMAN Body for methods listed. For other methods use createBody()
94
+ * @method Pull Methods.PULL
95
+ * @method Enumerate Methods.ENUMERATE
96
+ * @method Get Methods.GET
97
+ * @method Delete Methods.DELETE
98
+ * @method RequestStateChange Methods.REQUEST_STATE_CHANGE
99
+ * @returns string
100
+ */
101
+ createCommonBody: {
102
+ /**
103
+ * Body used for Delete actions
104
+ * @returns string
105
+ */
106
+ Delete: () => string;
107
+ /**
108
+ * Body used for Enumerate actions
109
+ * @returns string
110
+ */
111
+ Enumerate: () => string;
112
+ /**
113
+ * Body used for Get actions
114
+ * @returns string
115
+ */
116
+ Get: () => string;
117
+ /**
118
+ * Body used for Pull actions
119
+ * @param enumerationContext string returned from an Enumerate call.
120
+ * @returns string
121
+ */
122
+ Pull: (enumerationContext: string, maxElements?: number, maxCharacters?: number) => string;
123
+ /**
124
+ * Body used for Create or Put actions
125
+ * @param wsmanClass AMT.Classes, IPS.Classes, or CIM.Classes
126
+ * @param data Object being applied to AMT
127
+ * @returns string
128
+ */
129
+ CreateOrPut: (wsmanClass: AMT.Classes | IPS.Classes | CIM.Classes, data: any) => string;
130
+ /**
131
+ * Body used for RequestStateChange actions
132
+ * @param input namespace of the class being modified
133
+ * @param requestedState state being set
134
+ * @returns string
135
+ */
136
+ RequestStateChange: (input: string, requestedState: number) => string;
137
+ };
138
+ /**
139
+ * Creates a WSMAN Body for custom methods
140
+ * @param method string - methods not covered by createCommonBody()
141
+ * @param resourceUriBase string - URI address of the resource
142
+ * @param wsmanClass string - name of WSMAN class being used
143
+ * @param data Array or Object being converted into XML format
144
+ * @returns string
145
+ */
146
+ createBody: (method: string, wsmanClass: string, data?: any) => string;
147
+ /**
148
+ * Converts JavaScript object to XML
149
+ * @param data JavaScript object
150
+ * @returns string
151
+ */
152
+ OBJtoXML: (data: any) => string;
153
+ /**
154
+ * Helper function for createBody() to ensure WSMAN namespaces are formatted correctly
155
+ * @param data JavaScript object
156
+ * @returns any
157
+ */
158
+ processBody: (data: any, tag?: string) => any;
159
+ /**
160
+ * Helper function for processBody() to assist with formatting
161
+ * @param data JavaScript object
162
+ * @param key string
163
+ * @param prefix string
164
+ * @returns void
165
+ */
166
+ prependObjectKey: (data: any, key: string, prefix: string) => void;
167
+ }
168
+ export declare class Base {
169
+ wsmanMessageCreator: WSManMessageCreator;
170
+ className: CIM.Classes | AMT.Classes | IPS.Classes;
171
+ constructor(wsmanMessageCreator: WSManMessageCreator);
172
+ /**
173
+ * Enumerates the instances of the class.
174
+ * @returns string
175
+ */
176
+ Enumerate: () => string;
177
+ /**
178
+ * Gets the representation of the class.
179
+ * @param selector optional selector object for picking which item to get from an array of items
180
+ * @returns string
181
+ */
182
+ Get: (selector?: Selector) => string;
183
+ /**
184
+ * Pulls an instances of the class, following an Enumerate operation.
185
+ * @param enumerationContext string returned from an Enumerate call.
186
+ * @returns string
187
+ */
188
+ Pull: (enumerationContext: string) => string;
189
+ /**
190
+ * Deletes and instance of the class
191
+ * @param selector Selector object
192
+ * @returns string
193
+ */
194
+ protected protectedDelete: (selector: Selector) => string;
195
+ /**
196
+ * Modifies the properties of the class
197
+ * @param data data that will be used to update the class
198
+ * @param useHeaderSelector indicates if the call needs to use a selector in the header
199
+ * @param customSelector allows input of a custom selector
200
+ * @returns string
201
+ */
202
+ protected protectedPut: (data: any, useHeaderSelector: boolean, customSelector?: Selector) => string;
203
+ /**
204
+ * Creates a new instance of the class
205
+ * @param data data that will be used to create the class
206
+ * @param selector Selector object
207
+ * @returns string
208
+ */
209
+ protected protectedCreate: (data: any, selector?: Selector) => string;
210
+ /**
211
+ * Requests a change of state in AMT
212
+ * @param actionName resource that will have the state change
213
+ * @param requestedState the new state
214
+ * @returns string
215
+ */
216
+ protected protectedRequestStateChange: (actionName: string, requestedState: number) => string;
217
+ }
package/WSMan.js ADDED
@@ -0,0 +1,395 @@
1
+ "use strict";
2
+ /*********************************************************************
3
+ * Copyright (c) Intel Corporation 2021
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ ***********************************************************************/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Base = exports.WSManMessageCreator = exports.BaseActions = exports.WSManErrors = void 0;
8
+ var WSManErrors;
9
+ (function (WSManErrors) {
10
+ WSManErrors["HEADER"] = "missing header";
11
+ WSManErrors["BODY"] = "missing body";
12
+ WSManErrors["ACTION"] = "missing action";
13
+ WSManErrors["MESSAGE_ID"] = "missing messageId";
14
+ WSManErrors["RESOURCE_URI"] = "missing resourceUri";
15
+ WSManErrors["ENUMERATION_CONTEXT"] = "missing enumerationContext";
16
+ WSManErrors["UNSUPPORTED_METHOD"] = "unsupported method";
17
+ WSManErrors["INPUT"] = "missing input";
18
+ WSManErrors["REQUESTED_STATE"] = "missing requestedState";
19
+ WSManErrors["SELECTOR"] = "missing selector";
20
+ WSManErrors["ROLE"] = "missing role";
21
+ WSManErrors["REQUESTED_POWER_STATE_CHANGE"] = "missing powerState";
22
+ WSManErrors["ADMIN_PASS_ENCRYPTION_TYPE"] = "missing adminPassEncryptionType";
23
+ WSManErrors["ADMIN_PASSWORD"] = "missing adminPassword";
24
+ WSManErrors["ETHERNET_PORT_OBJECT"] = "missing ethernetPortObject";
25
+ WSManErrors["ENVIRONMENT_DETECTION_SETTING_DATA"] = "missing environmentDetectionSettingData";
26
+ WSManErrors["CERTIFICATE_BLOB"] = "missing certificateBlob";
27
+ WSManErrors["MP_SERVER"] = "missing mpServer";
28
+ WSManErrors["REMOTE_ACCESS_POLICY_RULE"] = "missing remoteAccessPolicyRule";
29
+ WSManErrors["BOOT_SETTING_DATA"] = "missing bootSettingData";
30
+ WSManErrors["ADD_ALARM_DATA"] = "missing alarmClockOccurrence";
31
+ WSManErrors["IEEE8021X_SETTINGS"] = "missing ieee8021xSettings";
32
+ WSManErrors["OPT_IN_SERVICE_RESPONSE"] = "missing OptInServiceResponse";
33
+ WSManErrors["OPT_IN_CODE"] = "missing OptInCode";
34
+ WSManErrors["KEY_PAIR"] = "missing KeyAlgorithm and/or KeyLength";
35
+ WSManErrors["DATA"] = "missing data";
36
+ WSManErrors["NONCE"] = "missing nonce";
37
+ WSManErrors["SIGNING_ALGORITHM"] = "missing signingAlgorithm";
38
+ WSManErrors["DIGITAL_SIGNATURE"] = "missing digitalSignature";
39
+ WSManErrors["IS_LEAF"] = "missing isLeaf";
40
+ WSManErrors["IS_ROOT"] = "missing isRoot";
41
+ WSManErrors["TLS_CREDENTIAL_CONTEXT"] = "missing tlsCredentialContext";
42
+ WSManErrors["GENERAL_SETTINGS"] = "missing generalSettings";
43
+ WSManErrors["PASSWORD"] = "missing password";
44
+ WSManErrors["PKCS10_REQUEST"] = "missing PKCS10Request";
45
+ WSManErrors["USERNAME"] = "missing username";
46
+ WSManErrors["DIGEST_PASSWORD"] = "missing digestPassword";
47
+ WSManErrors["INSTANCE_ID"] = "missing InstanceID";
48
+ WSManErrors["MISSING_USER_ACL_ENTRY_INFORMATION"] = "Digest username and password or Kerberos SID is required";
49
+ WSManErrors["USERNAME_TOO_LONG"] = "Username is too long";
50
+ })(WSManErrors || (exports.WSManErrors = WSManErrors = {}));
51
+ var BaseActions;
52
+ (function (BaseActions) {
53
+ BaseActions["ENUMERATE"] = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate";
54
+ BaseActions["PULL"] = "http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull";
55
+ BaseActions["GET"] = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get";
56
+ BaseActions["PUT"] = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Put";
57
+ BaseActions["CREATE"] = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Create";
58
+ BaseActions["DELETE"] = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete";
59
+ })(BaseActions || (exports.BaseActions = BaseActions = {}));
60
+ class WSManMessageCreator {
61
+ constructor(resourceUriBase) {
62
+ this.messageId = 0;
63
+ this.xmlCommonPrefix = '<?xml version="1.0" encoding="utf-8"?><Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns="http://www.w3.org/2003/05/soap-envelope">';
64
+ this.xmlCommonEnd = '</Envelope>';
65
+ this.anonymousAddress = 'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous';
66
+ this.defaultTimeout = 'PT60S';
67
+ /**
68
+ * Assembles the xml from the xmlCommonPrefix, header, body, and xmlCommonEnd
69
+ * @param header Partial XML created by createHeader function
70
+ * @param body Partial XML created by createBody or createCommonBody functions
71
+ * @returns string
72
+ */
73
+ this.createXml = (header, body) => this.xmlCommonPrefix + header + body + this.xmlCommonEnd;
74
+ /**
75
+ * Creates a partial XML header
76
+ * @param action WSMAN Action value based on DMTF schema
77
+ * @param resourceUri WSMAN ResourceURI value based on DMTF schema
78
+ * @param address WSMAN Address value based on DMTF schema
79
+ * @param timeout WSMAN OperationTimeout value for commands to be executed - PT60S default
80
+ * @param selector WSMAN Selector values for headers that require it
81
+ * @returns string
82
+ */
83
+ this.createHeader = (action, wsmanClass, selector = null, address = this.anonymousAddress, timeout = this.defaultTimeout) => {
84
+ let header = '<Header>';
85
+ header += `<a:Action>${action}</a:Action><a:To>/wsman</a:To><w:ResourceURI>${this.resourceUriBase}${wsmanClass}</w:ResourceURI><a:MessageID>${(this.messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>${address}</a:Address></a:ReplyTo><w:OperationTimeout>${timeout}</w:OperationTimeout>`;
86
+ if (selector != null) {
87
+ header += this.createSelector(selector);
88
+ }
89
+ header += '</Header>';
90
+ return header;
91
+ };
92
+ /**
93
+ * Creates a WSMAN string based on Selector Set information provided. Can be used in header or body
94
+ * @param selectorSet Selector data being passed in. Could take many forms depending on the WSMAN call
95
+ * @returns string
96
+ */
97
+ this.createSelector = (selectorSet) => {
98
+ if (selectorSet.name)
99
+ return `<w:SelectorSet><w:Selector Name="${selectorSet.name}">${selectorSet.value}</w:Selector></w:SelectorSet>`;
100
+ let result = '<w:SelectorSet>';
101
+ for (const propName in selectorSet) {
102
+ result += '<w:Selector Name="' + propName + '">';
103
+ if (selectorSet[propName].ReferenceParameters) {
104
+ result += '<a:EndpointReference>';
105
+ result +=
106
+ '<a:Address>' +
107
+ selectorSet[propName].Address +
108
+ '</a:Address><a:ReferenceParameters><w:ResourceURI>' +
109
+ selectorSet[propName].ReferenceParameters.ResourceURI +
110
+ '</w:ResourceURI><w:SelectorSet>';
111
+ const selectorArray = selectorSet[propName].ReferenceParameters.SelectorSet.Selector;
112
+ if (Array.isArray(selectorArray)) {
113
+ // TODO: Enable when selector is an array. No need for now.
114
+ // for (let i = 0; i < selectorArray.length; i++) {
115
+ // result += '<w:Selector Name="${selectorArray[i].$.Name}">${selectorArray[i]._}</w:Selector>'
116
+ // }
117
+ }
118
+ else {
119
+ result += `<w:Selector Name="${selectorArray.$.Name}">${selectorArray._}</w:Selector>`;
120
+ }
121
+ result += '</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>';
122
+ }
123
+ result += '</w:Selector>';
124
+ }
125
+ result += '</w:SelectorSet>';
126
+ return result;
127
+ };
128
+ this.createSelectorObjectForBody = (selector) => {
129
+ const obj = { Selector: [{ _: selector.value, $: { Name: selector.name } }] };
130
+ return obj;
131
+ };
132
+ /**
133
+ * Creates a WSMAN Body for methods listed. For other methods use createBody()
134
+ * @method Pull Methods.PULL
135
+ * @method Enumerate Methods.ENUMERATE
136
+ * @method Get Methods.GET
137
+ * @method Delete Methods.DELETE
138
+ * @method RequestStateChange Methods.REQUEST_STATE_CHANGE
139
+ * @returns string
140
+ */
141
+ this.createCommonBody = {
142
+ /**
143
+ * Body used for Delete actions
144
+ * @returns string
145
+ */
146
+ Delete: () => '<Body></Body>',
147
+ /**
148
+ * Body used for Enumerate actions
149
+ * @returns string
150
+ */
151
+ Enumerate: () => '<Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body>',
152
+ /**
153
+ * Body used for Get actions
154
+ * @returns string
155
+ */
156
+ Get: () => '<Body></Body>',
157
+ /**
158
+ * Body used for Pull actions
159
+ * @param enumerationContext string returned from an Enumerate call.
160
+ * @returns string
161
+ */
162
+ Pull: (enumerationContext, maxElements, maxCharacters) => {
163
+ if (!maxElements)
164
+ maxElements = 999;
165
+ if (!maxCharacters)
166
+ maxCharacters = 99999;
167
+ return `<Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>${maxElements}</MaxElements><MaxCharacters>${maxCharacters}</MaxCharacters></Pull></Body>`;
168
+ },
169
+ /**
170
+ * Body used for Create or Put actions
171
+ * @param wsmanClass AMT.Classes, IPS.Classes, or CIM.Classes
172
+ * @param data Object being applied to AMT
173
+ * @returns string
174
+ */
175
+ CreateOrPut: (wsmanClass, data) => this.createBody(wsmanClass, wsmanClass, [data]),
176
+ /**
177
+ * Body used for RequestStateChange actions
178
+ * @param input namespace of the class being modified
179
+ * @param requestedState state being set
180
+ * @returns string
181
+ */
182
+ RequestStateChange: (input, requestedState) => `<Body><h:RequestStateChange_INPUT xmlns:h="${input}"><h:RequestedState>${requestedState.toString()}</h:RequestedState></h:RequestStateChange_INPUT></Body>`
183
+ };
184
+ /**
185
+ * Creates a WSMAN Body for custom methods
186
+ * @param method string - methods not covered by createCommonBody()
187
+ * @param resourceUriBase string - URI address of the resource
188
+ * @param wsmanClass string - name of WSMAN class being used
189
+ * @param data Array or Object being converted into XML format
190
+ * @returns string
191
+ */
192
+ this.createBody = (method, wsmanClass, data) => {
193
+ if (!Array.isArray(data)) {
194
+ data = [data];
195
+ }
196
+ data === null || data === void 0 ? void 0 : data.forEach((element) => {
197
+ this.processBody(element);
198
+ });
199
+ let str = '<Body>';
200
+ str += `<h:${method} xmlns:h="${this.resourceUriBase}${wsmanClass}">`;
201
+ if (data) {
202
+ data.forEach((element) => {
203
+ str += this.OBJtoXML(element);
204
+ });
205
+ }
206
+ str += `</h:${method}>`;
207
+ str += '</Body>';
208
+ return str;
209
+ };
210
+ /**
211
+ * Converts JavaScript object to XML
212
+ * @param data JavaScript object
213
+ * @returns string
214
+ */
215
+ this.OBJtoXML = (data) => {
216
+ let xml = '';
217
+ for (const prop in data) {
218
+ if (prop === 'namespace')
219
+ continue;
220
+ if (Array.isArray(data[prop])) {
221
+ xml += '';
222
+ }
223
+ else {
224
+ if (data[prop] != null) {
225
+ if (data.namespace != null) {
226
+ xml += `<${prop} xmlns:q="${data.namespace}">`;
227
+ }
228
+ else {
229
+ xml += `<${prop}>`;
230
+ }
231
+ }
232
+ }
233
+ if (Array.isArray(data[prop])) {
234
+ for (const arrayIdx in data[prop]) {
235
+ xml += `<${prop}`;
236
+ for (const attr in data[prop][arrayIdx].$) {
237
+ xml += ` ${attr}="${data[prop][arrayIdx].$[attr]}"`;
238
+ }
239
+ xml += '>';
240
+ xml += data[prop][arrayIdx]._ ? data[prop][arrayIdx]._ : data[prop][arrayIdx];
241
+ xml += `</${prop}>`;
242
+ }
243
+ }
244
+ else if (typeof data[prop] === 'object') {
245
+ xml += this.OBJtoXML(data[prop]);
246
+ }
247
+ else {
248
+ if (data[prop] != null)
249
+ xml += data[prop];
250
+ }
251
+ if (Array.isArray(data[prop])) {
252
+ xml += '';
253
+ }
254
+ else {
255
+ if (data[prop] != null)
256
+ xml += `</${prop}>`;
257
+ }
258
+ }
259
+ return xml;
260
+ };
261
+ /**
262
+ * Helper function for createBody() to ensure WSMAN namespaces are formatted correctly
263
+ * @param data JavaScript object
264
+ * @returns any
265
+ */
266
+ this.processBody = (data, tag = 'h:') => {
267
+ if (Array.isArray(data)) {
268
+ return;
269
+ }
270
+ for (const val in data) {
271
+ switch (val) {
272
+ case 'Address':
273
+ case 'ReferenceParameters':
274
+ this.prependObjectKey(data, val, 'a:');
275
+ break;
276
+ case 'SelectorSet':
277
+ case 'Selector':
278
+ case 'ResourceURI':
279
+ this.prependObjectKey(data, val, 'w:');
280
+ break;
281
+ case 'namespace':
282
+ break;
283
+ default:
284
+ this.prependObjectKey(data, val, tag);
285
+ break;
286
+ }
287
+ }
288
+ };
289
+ /**
290
+ * Helper function for processBody() to assist with formatting
291
+ * @param data JavaScript object
292
+ * @param key string
293
+ * @param prefix string
294
+ * @returns void
295
+ */
296
+ this.prependObjectKey = (data, key, prefix) => {
297
+ data[prefix + key] = data[key];
298
+ if (typeof data[key] === 'object') {
299
+ // eslint-disable-next-line @typescript-eslint/dot-notation
300
+ if (data['namespace'] != null) {
301
+ this.processBody(data[key], 'q:');
302
+ }
303
+ else {
304
+ this.processBody(data[key]);
305
+ }
306
+ }
307
+ delete data[key];
308
+ };
309
+ this.resourceUriBase = resourceUriBase;
310
+ }
311
+ }
312
+ exports.WSManMessageCreator = WSManMessageCreator;
313
+ class Base {
314
+ constructor(wsmanMessageCreator) {
315
+ /**
316
+ * Enumerates the instances of the class.
317
+ * @returns string
318
+ */
319
+ this.Enumerate = () => {
320
+ const header = this.wsmanMessageCreator.createHeader(BaseActions.ENUMERATE, this.className);
321
+ const body = this.wsmanMessageCreator.createCommonBody.Enumerate();
322
+ return this.wsmanMessageCreator.createXml(header, body);
323
+ };
324
+ /**
325
+ * Gets the representation of the class.
326
+ * @param selector optional selector object for picking which item to get from an array of items
327
+ * @returns string
328
+ */
329
+ this.Get = (selector) => {
330
+ const header = this.wsmanMessageCreator.createHeader(BaseActions.GET, this.className, selector);
331
+ const body = this.wsmanMessageCreator.createCommonBody.Get();
332
+ return this.wsmanMessageCreator.createXml(header, body);
333
+ };
334
+ /**
335
+ * Pulls an instances of the class, following an Enumerate operation.
336
+ * @param enumerationContext string returned from an Enumerate call.
337
+ * @returns string
338
+ */
339
+ this.Pull = (enumerationContext) => {
340
+ const header = this.wsmanMessageCreator.createHeader(BaseActions.PULL, this.className);
341
+ const body = this.wsmanMessageCreator.createCommonBody.Pull(enumerationContext);
342
+ return this.wsmanMessageCreator.createXml(header, body);
343
+ };
344
+ /**
345
+ * Deletes and instance of the class
346
+ * @param selector Selector object
347
+ * @returns string
348
+ */
349
+ this.protectedDelete = (selector) => {
350
+ const header = this.wsmanMessageCreator.createHeader(BaseActions.DELETE, this.className, selector);
351
+ const body = this.wsmanMessageCreator.createCommonBody.Delete();
352
+ return this.wsmanMessageCreator.createXml(header, body);
353
+ };
354
+ /**
355
+ * Modifies the properties of the class
356
+ * @param data data that will be used to update the class
357
+ * @param useHeaderSelector indicates if the call needs to use a selector in the header
358
+ * @param customSelector allows input of a custom selector
359
+ * @returns string
360
+ */
361
+ this.protectedPut = (data, useHeaderSelector, customSelector) => {
362
+ if (!customSelector && (data === null || data === void 0 ? void 0 : data.InstanceID)) {
363
+ customSelector = { name: 'InstanceID', value: data.InstanceID };
364
+ }
365
+ const header = this.wsmanMessageCreator.createHeader(BaseActions.PUT, this.className, useHeaderSelector ? customSelector : null);
366
+ const body = this.wsmanMessageCreator.createCommonBody.CreateOrPut(this.className, data);
367
+ return this.wsmanMessageCreator.createXml(header, body);
368
+ };
369
+ /**
370
+ * Creates a new instance of the class
371
+ * @param data data that will be used to create the class
372
+ * @param selector Selector object
373
+ * @returns string
374
+ */
375
+ this.protectedCreate = (data, selector) => {
376
+ const header = this.wsmanMessageCreator.createHeader(BaseActions.CREATE, this.className, selector);
377
+ const body = this.wsmanMessageCreator.createCommonBody.CreateOrPut(this.className, data);
378
+ return this.wsmanMessageCreator.createXml(header, body);
379
+ };
380
+ /**
381
+ * Requests a change of state in AMT
382
+ * @param actionName resource that will have the state change
383
+ * @param requestedState the new state
384
+ * @returns string
385
+ */
386
+ this.protectedRequestStateChange = (actionName, requestedState) => {
387
+ const header = this.wsmanMessageCreator.createHeader(actionName, this.className);
388
+ const body = this.wsmanMessageCreator.createCommonBody.RequestStateChange(`${this.wsmanMessageCreator.resourceUriBase}${this.className}`, requestedState);
389
+ return this.wsmanMessageCreator.createXml(header, body);
390
+ };
391
+ this.wsmanMessageCreator = wsmanMessageCreator;
392
+ }
393
+ }
394
+ exports.Base = Base;
395
+ //# sourceMappingURL=WSMan.js.map
package/WSMan.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WSMan.js","sourceRoot":"","sources":["../src/WSMan.ts"],"names":[],"mappings":";AAAA;;;yEAGyE;;;AASzE,IAAY,WAyCX;AAzCD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,oCA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