soap 0.44.0 → 1.0.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 (48) hide show
  1. package/History.md +12 -0
  2. package/Readme.md +12 -0
  3. package/lib/client.d.ts +1 -0
  4. package/lib/client.js +168 -187
  5. package/lib/client.js.map +1 -1
  6. package/lib/http.d.ts +1 -0
  7. package/lib/http.js +91 -101
  8. package/lib/http.js.map +1 -1
  9. package/lib/nscontext.js +38 -40
  10. package/lib/nscontext.js.map +1 -1
  11. package/lib/security/BasicAuthSecurity.js +11 -12
  12. package/lib/security/BasicAuthSecurity.js.map +1 -1
  13. package/lib/security/BearerSecurity.js +11 -12
  14. package/lib/security/BearerSecurity.js.map +1 -1
  15. package/lib/security/ClientSSLSecurity.js +12 -13
  16. package/lib/security/ClientSSLSecurity.js.map +1 -1
  17. package/lib/security/ClientSSLSecurityPFX.js +11 -12
  18. package/lib/security/ClientSSLSecurityPFX.js.map +1 -1
  19. package/lib/security/NTLMSecurity.js +12 -13
  20. package/lib/security/NTLMSecurity.js.map +1 -1
  21. package/lib/security/WSSecurity.js +21 -22
  22. package/lib/security/WSSecurity.js.map +1 -1
  23. package/lib/security/WSSecurityCert.d.ts +1 -0
  24. package/lib/security/WSSecurityCert.js +74 -56
  25. package/lib/security/WSSecurityCert.js.map +1 -1
  26. package/lib/security/WSSecurityPlusCert.d.ts +9 -0
  27. package/lib/security/WSSecurityPlusCert.js +17 -0
  28. package/lib/security/WSSecurityPlusCert.js.map +1 -0
  29. package/lib/security/index.d.ts +1 -0
  30. package/lib/security/index.js +8 -3
  31. package/lib/security/index.js.map +1 -1
  32. package/lib/server.d.ts +1 -0
  33. package/lib/server.js +189 -209
  34. package/lib/server.js.map +1 -1
  35. package/lib/soap.d.ts +1 -1
  36. package/lib/soap.js +45 -40
  37. package/lib/soap.js.map +1 -1
  38. package/lib/types.d.ts +1 -0
  39. package/lib/types.js +1 -1
  40. package/lib/utils.d.ts +1 -1
  41. package/lib/utils.js +54 -49
  42. package/lib/utils.js.map +1 -1
  43. package/lib/wsdl/elements.js +393 -515
  44. package/lib/wsdl/elements.js.map +1 -1
  45. package/lib/wsdl/index.js +322 -322
  46. package/lib/wsdl/index.js.map +1 -1
  47. package/package.json +9 -7
  48. package/tsconfig.json +2 -1
@@ -1,25 +1,12 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
16
3
  exports.ImportElement = exports.IncludeElement = exports.BodyElement = exports.DefinitionsElement = exports.ServiceElement = exports.PortElement = exports.BindingElement = exports.PortTypeElement = exports.OperationElement = exports.TypesElement = exports.SchemaElement = exports.DocumentationElement = exports.MessageElement = exports.AllElement = exports.SequenceElement = exports.SimpleContentElement = exports.ComplexContentElement = exports.ComplexTypeElement = exports.EnumerationElement = exports.ChoiceElement = exports.ExtensionElement = exports.RestrictionElement = exports.SimpleTypeElement = exports.OutputElement = exports.InputElement = exports.AnyElement = exports.ElementElement = exports.Element = void 0;
17
- var assert_1 = require("assert");
18
- var debugBuilder = require("debug");
19
- var _ = require("lodash");
20
- var utils_1 = require("../utils");
21
- var debug = debugBuilder('node-soap');
22
- var Primitives = {
4
+ const assert_1 = require("assert");
5
+ const debugBuilder = require("debug");
6
+ const _ = require("lodash");
7
+ const utils_1 = require("../utils");
8
+ const debug = debugBuilder('node-soap');
9
+ const Primitives = {
23
10
  string: 1,
24
11
  boolean: 1,
25
12
  decimal: 1,
@@ -51,13 +38,13 @@ var Primitives = {
51
38
  base64Binary: 0,
52
39
  anyURI: 0,
53
40
  QName: 0,
54
- NOTATION: 0
41
+ NOTATION: 0,
55
42
  };
56
- var Element = /** @class */ (function () {
57
- function Element(nsName, attrs, options, schemaAttrs) {
43
+ class Element {
44
+ constructor(nsName, attrs, options, schemaAttrs) {
58
45
  this.allowedChildren = {};
59
46
  this.children = [];
60
- var parts = utils_1.splitQName(nsName);
47
+ const parts = (0, utils_1.splitQName)(nsName);
61
48
  this.nsName = nsName;
62
49
  this.prefix = parts.prefix;
63
50
  this.name = parts.name;
@@ -65,8 +52,8 @@ var Element = /** @class */ (function () {
65
52
  this.xmlns = {};
66
53
  this.schemaXmlns = {};
67
54
  this._initializeOptions(options);
68
- for (var key in attrs) {
69
- var match = /^xmlns:?(.*)$/.exec(key);
55
+ for (const key in attrs) {
56
+ const match = /^xmlns:?(.*)$/.exec(key);
70
57
  if (match) {
71
58
  this.xmlns[match[1] ? match[1] : utils_1.TNS_PREFIX] = attrs[key];
72
59
  }
@@ -79,8 +66,8 @@ var Element = /** @class */ (function () {
79
66
  }
80
67
  }
81
68
  }
82
- for (var schemaKey in schemaAttrs) {
83
- var schemaMatch = /^xmlns:?(.*)$/.exec(schemaKey);
69
+ for (const schemaKey in schemaAttrs) {
70
+ const schemaMatch = /^xmlns:?(.*)$/.exec(schemaKey);
84
71
  if (schemaMatch && schemaMatch[1]) {
85
72
  this.schemaXmlns[schemaMatch[1]] = schemaAttrs[schemaKey];
86
73
  }
@@ -91,54 +78,54 @@ var Element = /** @class */ (function () {
91
78
  }
92
79
  this.init();
93
80
  }
94
- Element.prototype.deleteFixedAttrs = function () {
81
+ deleteFixedAttrs() {
95
82
  this.children && this.children.length === 0 && delete this.children;
96
83
  this.xmlns && Object.keys(this.xmlns).length === 0 && delete this.xmlns;
97
84
  delete this.nsName;
98
85
  delete this.prefix;
99
86
  delete this.name;
100
- };
101
- Element.prototype.startElement = function (stack, nsName, attrs, options, schemaXmlns) {
87
+ }
88
+ startElement(stack, nsName, attrs, options, schemaXmlns) {
102
89
  if (!this.allowedChildren) {
103
90
  return;
104
91
  }
105
- var ChildClass = this.allowedChildren[utils_1.splitQName(nsName).name];
92
+ const ChildClass = this.allowedChildren[(0, utils_1.splitQName)(nsName).name];
106
93
  if (ChildClass) {
107
- var child = new ChildClass(nsName, attrs, options, schemaXmlns);
94
+ const child = new ChildClass(nsName, attrs, options, schemaXmlns);
108
95
  child.init();
109
96
  stack.push(child);
110
97
  }
111
98
  else {
112
99
  this.unexpected(nsName);
113
100
  }
114
- };
115
- Element.prototype.endElement = function (stack, nsName) {
101
+ }
102
+ endElement(stack, nsName) {
116
103
  if (this.nsName === nsName) {
117
104
  if (stack.length < 2) {
118
105
  return;
119
106
  }
120
- var parent_1 = stack[stack.length - 2];
107
+ const parent = stack[stack.length - 2];
121
108
  if (this !== stack[0]) {
122
109
  _.defaultsDeep(stack[0].xmlns, this.xmlns);
123
110
  // delete this.xmlns;
124
- parent_1.children.push(this);
125
- parent_1.addChild(this);
111
+ parent.children.push(this);
112
+ parent.addChild(this);
126
113
  }
127
114
  stack.pop();
128
115
  }
129
- };
130
- Element.prototype.addChild = function (child) {
116
+ }
117
+ addChild(child) {
131
118
  return;
132
- };
133
- Element.prototype.unexpected = function (name) {
119
+ }
120
+ unexpected(name) {
134
121
  throw new Error('Found unexpected element (' + name + ') inside ' + this.nsName);
135
- };
136
- Element.prototype.description = function (definitions, xmlns) {
122
+ }
123
+ description(definitions, xmlns) {
137
124
  return this.$name || this.name;
138
- };
139
- Element.prototype.init = function () {
140
- };
141
- Element.prototype._initializeOptions = function (options) {
125
+ }
126
+ init() {
127
+ }
128
+ _initializeOptions(options) {
142
129
  if (options) {
143
130
  this.valueKey = options.valueKey || '$value';
144
131
  this.xmlKey = options.xmlKey || '$xml';
@@ -149,28 +136,25 @@ var Element = /** @class */ (function () {
149
136
  this.xmlKey = '$xml';
150
137
  this.ignoredNamespaces = [];
151
138
  }
152
- };
153
- return Element;
154
- }());
139
+ }
140
+ }
155
141
  exports.Element = Element;
156
- var ElementElement = /** @class */ (function (_super) {
157
- __extends(ElementElement, _super);
158
- function ElementElement() {
159
- var _this = _super !== null && _super.apply(this, arguments) || this;
160
- _this.allowedChildren = buildAllowedChildren([
142
+ class ElementElement extends Element {
143
+ constructor() {
144
+ super(...arguments);
145
+ this.allowedChildren = buildAllowedChildren([
161
146
  'annotation',
162
147
  'complexType',
163
148
  'simpleType',
164
149
  ]);
165
- return _this;
166
150
  }
167
- ElementElement.prototype.description = function (definitions, xmlns) {
168
- var element = {};
169
- var name = this.$name;
151
+ description(definitions, xmlns) {
152
+ let element = {};
153
+ let name = this.$name;
170
154
  // Check minOccurs / maxOccurs attributes to see if this element is a list
171
155
  // These are default values for an element
172
- var minOccurs = 1;
173
- var maxOccurs = 1;
156
+ let minOccurs = 1;
157
+ let maxOccurs = 1;
174
158
  if (this.$maxOccurs === 'unbounded') {
175
159
  maxOccurs = Infinity;
176
160
  }
@@ -180,50 +164,50 @@ var ElementElement = /** @class */ (function (_super) {
180
164
  if (Boolean(this.$minOccurs)) {
181
165
  minOccurs = parseInt(this.$minOccurs, 10);
182
166
  }
183
- var isMany = maxOccurs > 1;
167
+ const isMany = maxOccurs > 1;
184
168
  if (isMany) {
185
169
  name += '[]';
186
170
  }
187
171
  if (xmlns && xmlns[utils_1.TNS_PREFIX]) {
188
172
  this.$targetNamespace = xmlns[utils_1.TNS_PREFIX];
189
173
  }
190
- var type = this.$type || this.$ref;
174
+ let type = this.$type || this.$ref;
191
175
  if (type) {
192
- type = utils_1.splitQName(type);
193
- var typeName = type.name;
194
- var ns = xmlns && xmlns[type.prefix] ||
176
+ type = (0, utils_1.splitQName)(type);
177
+ const typeName = type.name;
178
+ const ns = xmlns && xmlns[type.prefix] ||
195
179
  ((definitions.xmlns[type.prefix] !== undefined || definitions.xmlns[this.targetNSAlias] !== undefined) && this.schemaXmlns[type.prefix]) ||
196
180
  definitions.xmlns[type.prefix];
197
- var schema = definitions.schemas[ns];
198
- var typeElement = schema && (this.$type ? schema.complexTypes[typeName] || schema.types[typeName] : schema.elements[typeName]);
199
- var typeStorage = this.$type ? definitions.descriptions.types : definitions.descriptions.elements;
181
+ const schema = definitions.schemas[ns];
182
+ const typeElement = schema && (this.$type ? schema.complexTypes[typeName] || schema.types[typeName] : schema.elements[typeName]);
183
+ const typeStorage = this.$type ? definitions.descriptions.types : definitions.descriptions.elements;
200
184
  if (ns && definitions.schemas[ns]) {
201
185
  xmlns = definitions.schemas[ns].xmlns;
202
186
  }
203
187
  if (typeElement && !(typeName in Primitives)) {
204
188
  if (!(typeName in typeStorage)) {
205
- var elem_1 = {};
206
- typeStorage[typeName] = elem_1;
207
- var description_1 = typeElement.description(definitions, xmlns);
208
- if (typeof description_1 === 'string') {
209
- elem_1 = description_1;
189
+ let elem = {};
190
+ typeStorage[typeName] = elem;
191
+ const description = typeElement.description(definitions, xmlns);
192
+ if (typeof description === 'string') {
193
+ elem = description;
210
194
  }
211
195
  else {
212
- Object.keys(description_1).forEach(function (key) {
213
- elem_1[key] = description_1[key];
196
+ Object.keys(description).forEach((key) => {
197
+ elem[key] = description[key];
214
198
  });
215
199
  }
216
200
  if (this.$ref) {
217
- element = elem_1;
201
+ element = elem;
218
202
  }
219
203
  else {
220
- element[name] = elem_1;
204
+ element[name] = elem;
221
205
  }
222
- if (typeof elem_1 === 'object') {
223
- elem_1.targetNSAlias = type.prefix;
224
- elem_1.targetNamespace = ns;
206
+ if (typeof elem === 'object') {
207
+ elem.targetNSAlias = type.prefix;
208
+ elem.targetNamespace = ns;
225
209
  }
226
- typeStorage[typeName] = elem_1;
210
+ typeStorage[typeName] = elem;
227
211
  }
228
212
  else {
229
213
  if (this.$ref) {
@@ -239,41 +223,32 @@ var ElementElement = /** @class */ (function (_super) {
239
223
  }
240
224
  }
241
225
  else {
242
- var children = this.children;
226
+ const children = this.children;
243
227
  element[name] = {};
244
- for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
245
- var child = children_1[_i];
228
+ for (const child of children) {
246
229
  if (child instanceof ComplexTypeElement || child instanceof SimpleTypeElement) {
247
230
  element[name] = child.description(definitions, xmlns);
248
231
  }
249
232
  }
250
233
  }
251
234
  return element;
252
- };
253
- return ElementElement;
254
- }(Element));
255
- exports.ElementElement = ElementElement;
256
- var AnyElement = /** @class */ (function (_super) {
257
- __extends(AnyElement, _super);
258
- function AnyElement() {
259
- return _super !== null && _super.apply(this, arguments) || this;
260
235
  }
261
- return AnyElement;
262
- }(Element));
236
+ }
237
+ exports.ElementElement = ElementElement;
238
+ class AnyElement extends Element {
239
+ }
263
240
  exports.AnyElement = AnyElement;
264
- var InputElement = /** @class */ (function (_super) {
265
- __extends(InputElement, _super);
266
- function InputElement() {
267
- var _this = _super !== null && _super.apply(this, arguments) || this;
268
- _this.allowedChildren = buildAllowedChildren([
241
+ class InputElement extends Element {
242
+ constructor() {
243
+ super(...arguments);
244
+ this.allowedChildren = buildAllowedChildren([
269
245
  'body',
270
246
  'documentation',
271
247
  'header',
272
248
  'SecuritySpecRef',
273
249
  ]);
274
- return _this;
275
250
  }
276
- InputElement.prototype.addChild = function (child) {
251
+ addChild(child) {
277
252
  if (child instanceof BodyElement) {
278
253
  this.use = child.$use;
279
254
  if (this.use === 'encoded') {
@@ -281,23 +256,20 @@ var InputElement = /** @class */ (function (_super) {
281
256
  }
282
257
  this.children.pop();
283
258
  }
284
- };
285
- return InputElement;
286
- }(Element));
259
+ }
260
+ }
287
261
  exports.InputElement = InputElement;
288
- var OutputElement = /** @class */ (function (_super) {
289
- __extends(OutputElement, _super);
290
- function OutputElement() {
291
- var _this = _super !== null && _super.apply(this, arguments) || this;
292
- _this.allowedChildren = buildAllowedChildren([
262
+ class OutputElement extends Element {
263
+ constructor() {
264
+ super(...arguments);
265
+ this.allowedChildren = buildAllowedChildren([
293
266
  'body',
294
267
  'documentation',
295
268
  'header',
296
269
  'SecuritySpecRef',
297
270
  ]);
298
- return _this;
299
271
  }
300
- OutputElement.prototype.addChild = function (child) {
272
+ addChild(child) {
301
273
  if (child instanceof BodyElement) {
302
274
  this.use = child.$use;
303
275
  if (this.use === 'encoded') {
@@ -305,158 +277,136 @@ var OutputElement = /** @class */ (function (_super) {
305
277
  }
306
278
  this.children.pop();
307
279
  }
308
- };
309
- return OutputElement;
310
- }(Element));
280
+ }
281
+ }
311
282
  exports.OutputElement = OutputElement;
312
- var SimpleTypeElement = /** @class */ (function (_super) {
313
- __extends(SimpleTypeElement, _super);
314
- function SimpleTypeElement() {
315
- var _this = _super !== null && _super.apply(this, arguments) || this;
316
- _this.allowedChildren = buildAllowedChildren([
283
+ class SimpleTypeElement extends Element {
284
+ constructor() {
285
+ super(...arguments);
286
+ this.allowedChildren = buildAllowedChildren([
317
287
  'restriction',
318
288
  ]);
319
- return _this;
320
289
  }
321
- SimpleTypeElement.prototype.description = function (definitions) {
322
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
323
- var child = _a[_i];
290
+ description(definitions) {
291
+ for (const child of this.children) {
324
292
  if (child instanceof RestrictionElement) {
325
293
  return [this.$name, child.description()].filter(Boolean).join('|');
326
294
  }
327
295
  }
328
296
  return {};
329
- };
330
- return SimpleTypeElement;
331
- }(Element));
297
+ }
298
+ }
332
299
  exports.SimpleTypeElement = SimpleTypeElement;
333
- var RestrictionElement = /** @class */ (function (_super) {
334
- __extends(RestrictionElement, _super);
335
- function RestrictionElement() {
336
- var _this = _super !== null && _super.apply(this, arguments) || this;
337
- _this.allowedChildren = buildAllowedChildren([
300
+ class RestrictionElement extends Element {
301
+ constructor() {
302
+ super(...arguments);
303
+ this.allowedChildren = buildAllowedChildren([
338
304
  'all',
339
305
  'choice',
340
306
  'enumeration',
341
307
  'sequence',
342
308
  ]);
343
- return _this;
344
309
  }
345
- RestrictionElement.prototype.description = function (definitions, xmlns) {
346
- var children = this.children;
347
- var desc;
348
- for (var i = 0, child = void 0; child = children[i]; i++) {
310
+ description(definitions, xmlns) {
311
+ const children = this.children;
312
+ let desc;
313
+ for (let i = 0, child; child = children[i]; i++) {
349
314
  if (child instanceof SequenceElement || child instanceof ChoiceElement) {
350
315
  desc = child.description(definitions, xmlns);
351
316
  break;
352
317
  }
353
318
  }
354
319
  if (desc && this.$base) {
355
- var type = utils_1.splitQName(this.$base);
356
- var typeName = type.name;
357
- var ns = xmlns && xmlns[type.prefix] || definitions.xmlns[type.prefix];
358
- var schema_1 = definitions.schemas[ns];
359
- var typeElement_1 = schema_1 && (schema_1.complexTypes[typeName] || schema_1.types[typeName] || schema_1.elements[typeName]);
360
- desc.getBase = function () {
361
- return typeElement_1.description(definitions, schema_1.xmlns);
320
+ const type = (0, utils_1.splitQName)(this.$base);
321
+ const typeName = type.name;
322
+ const ns = xmlns && xmlns[type.prefix] || definitions.xmlns[type.prefix];
323
+ const schema = definitions.schemas[ns];
324
+ const typeElement = schema && (schema.complexTypes[typeName] || schema.types[typeName] || schema.elements[typeName]);
325
+ desc.getBase = () => {
326
+ return typeElement.description(definitions, schema.xmlns);
362
327
  };
363
328
  return desc;
364
329
  }
365
330
  // then simple element
366
- var base = this.$base ? this.$base + '|' : '';
367
- var restrictions = this.children.map(function (child) {
331
+ const base = this.$base ? this.$base + '|' : '';
332
+ const restrictions = this.children.map((child) => {
368
333
  return child.description();
369
334
  }).join(',');
370
335
  return [this.$base, restrictions].filter(Boolean).join('|');
371
- };
372
- return RestrictionElement;
373
- }(Element));
336
+ }
337
+ }
374
338
  exports.RestrictionElement = RestrictionElement;
375
- var ExtensionElement = /** @class */ (function (_super) {
376
- __extends(ExtensionElement, _super);
377
- function ExtensionElement() {
378
- var _this = _super !== null && _super.apply(this, arguments) || this;
379
- _this.allowedChildren = buildAllowedChildren([
339
+ class ExtensionElement extends Element {
340
+ constructor() {
341
+ super(...arguments);
342
+ this.allowedChildren = buildAllowedChildren([
380
343
  'all',
381
344
  'choice',
382
345
  'sequence',
383
346
  ]);
384
- return _this;
385
347
  }
386
- ExtensionElement.prototype.description = function (definitions, xmlns) {
387
- var desc = {};
388
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
389
- var child = _a[_i];
348
+ description(definitions, xmlns) {
349
+ let desc = {};
350
+ for (const child of this.children) {
390
351
  if (child instanceof SequenceElement || child instanceof ChoiceElement) {
391
352
  desc = child.description(definitions, xmlns);
392
353
  }
393
354
  }
394
355
  if (this.$base) {
395
- var type = utils_1.splitQName(this.$base);
396
- var typeName = type.name;
397
- var ns = xmlns && xmlns[type.prefix] || definitions.xmlns[type.prefix];
398
- var schema = definitions.schemas[ns];
356
+ const type = (0, utils_1.splitQName)(this.$base);
357
+ const typeName = type.name;
358
+ const ns = xmlns && xmlns[type.prefix] || definitions.xmlns[type.prefix];
359
+ const schema = definitions.schemas[ns];
399
360
  if (typeName in Primitives) {
400
361
  return this.$base;
401
362
  }
402
363
  else {
403
- var typeElement = schema && (schema.complexTypes[typeName] ||
364
+ const typeElement = schema && (schema.complexTypes[typeName] ||
404
365
  schema.types[typeName] ||
405
366
  schema.elements[typeName]);
406
367
  if (typeElement) {
407
- var base = typeElement.description(definitions, schema.xmlns);
368
+ const base = typeElement.description(definitions, schema.xmlns);
408
369
  desc = typeof base === 'string' ? base : _.defaults(base, desc);
409
370
  }
410
371
  }
411
372
  }
412
373
  return desc;
413
- };
414
- return ExtensionElement;
415
- }(Element));
374
+ }
375
+ }
416
376
  exports.ExtensionElement = ExtensionElement;
417
- var ChoiceElement = /** @class */ (function (_super) {
418
- __extends(ChoiceElement, _super);
419
- function ChoiceElement() {
420
- var _this = _super !== null && _super.apply(this, arguments) || this;
421
- _this.allowedChildren = buildAllowedChildren([
377
+ class ChoiceElement extends Element {
378
+ constructor() {
379
+ super(...arguments);
380
+ this.allowedChildren = buildAllowedChildren([
422
381
  'any',
423
382
  'choice',
424
383
  'element',
425
384
  'sequence',
426
385
  ]);
427
- return _this;
428
- }
429
- ChoiceElement.prototype.description = function (definitions, xmlns) {
430
- var choice = {};
431
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
432
- var child = _a[_i];
433
- var description = child.description(definitions, xmlns);
434
- for (var key in description) {
386
+ }
387
+ description(definitions, xmlns) {
388
+ const choice = {};
389
+ for (const child of this.children) {
390
+ const description = child.description(definitions, xmlns);
391
+ for (const key in description) {
435
392
  choice[key] = description[key];
436
393
  }
437
394
  }
438
395
  return choice;
439
- };
440
- return ChoiceElement;
441
- }(Element));
442
- exports.ChoiceElement = ChoiceElement;
443
- var EnumerationElement = /** @class */ (function (_super) {
444
- __extends(EnumerationElement, _super);
445
- function EnumerationElement() {
446
- return _super !== null && _super.apply(this, arguments) || this;
447
396
  }
397
+ }
398
+ exports.ChoiceElement = ChoiceElement;
399
+ class EnumerationElement extends Element {
448
400
  // no children
449
- EnumerationElement.prototype.description = function () {
401
+ description() {
450
402
  return this[this.valueKey];
451
- };
452
- return EnumerationElement;
453
- }(Element));
403
+ }
404
+ }
454
405
  exports.EnumerationElement = EnumerationElement;
455
- var ComplexTypeElement = /** @class */ (function (_super) {
456
- __extends(ComplexTypeElement, _super);
457
- function ComplexTypeElement() {
458
- var _this = _super !== null && _super.apply(this, arguments) || this;
459
- _this.allowedChildren = buildAllowedChildren([
406
+ class ComplexTypeElement extends Element {
407
+ constructor() {
408
+ super(...arguments);
409
+ this.allowedChildren = buildAllowedChildren([
460
410
  'all',
461
411
  'annotation',
462
412
  'choice',
@@ -464,12 +414,10 @@ var ComplexTypeElement = /** @class */ (function (_super) {
464
414
  'sequence',
465
415
  'simpleContent',
466
416
  ]);
467
- return _this;
468
417
  }
469
- ComplexTypeElement.prototype.description = function (definitions, xmlns) {
470
- var children = this.children || [];
471
- for (var _i = 0, children_2 = children; _i < children_2.length; _i++) {
472
- var child = children_2[_i];
418
+ description(definitions, xmlns) {
419
+ const children = this.children || [];
420
+ for (const child of children) {
473
421
  if (child instanceof ChoiceElement ||
474
422
  child instanceof SequenceElement ||
475
423
  child instanceof AllElement ||
@@ -479,125 +427,105 @@ var ComplexTypeElement = /** @class */ (function (_super) {
479
427
  }
480
428
  }
481
429
  return {};
482
- };
483
- return ComplexTypeElement;
484
- }(Element));
430
+ }
431
+ }
485
432
  exports.ComplexTypeElement = ComplexTypeElement;
486
- var ComplexContentElement = /** @class */ (function (_super) {
487
- __extends(ComplexContentElement, _super);
488
- function ComplexContentElement() {
489
- var _this = _super !== null && _super.apply(this, arguments) || this;
490
- _this.allowedChildren = buildAllowedChildren([
433
+ class ComplexContentElement extends Element {
434
+ constructor() {
435
+ super(...arguments);
436
+ this.allowedChildren = buildAllowedChildren([
491
437
  'extension',
492
438
  ]);
493
- return _this;
494
439
  }
495
- ComplexContentElement.prototype.description = function (definitions, xmlns) {
496
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
497
- var child = _a[_i];
440
+ description(definitions, xmlns) {
441
+ for (const child of this.children) {
498
442
  if (child instanceof ExtensionElement) {
499
443
  return child.description(definitions, xmlns);
500
444
  }
501
445
  }
502
446
  return {};
503
- };
504
- return ComplexContentElement;
505
- }(Element));
447
+ }
448
+ }
506
449
  exports.ComplexContentElement = ComplexContentElement;
507
- var SimpleContentElement = /** @class */ (function (_super) {
508
- __extends(SimpleContentElement, _super);
509
- function SimpleContentElement() {
510
- var _this = _super !== null && _super.apply(this, arguments) || this;
511
- _this.allowedChildren = buildAllowedChildren([
450
+ class SimpleContentElement extends Element {
451
+ constructor() {
452
+ super(...arguments);
453
+ this.allowedChildren = buildAllowedChildren([
512
454
  'extension',
513
455
  ]);
514
- return _this;
515
456
  }
516
- SimpleContentElement.prototype.description = function (definitions, xmlns) {
517
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
518
- var child = _a[_i];
457
+ description(definitions, xmlns) {
458
+ for (const child of this.children) {
519
459
  if (child instanceof ExtensionElement) {
520
460
  return child.description(definitions, xmlns);
521
461
  }
522
462
  }
523
463
  return {};
524
- };
525
- return SimpleContentElement;
526
- }(Element));
464
+ }
465
+ }
527
466
  exports.SimpleContentElement = SimpleContentElement;
528
- var SequenceElement = /** @class */ (function (_super) {
529
- __extends(SequenceElement, _super);
530
- function SequenceElement() {
531
- var _this = _super !== null && _super.apply(this, arguments) || this;
532
- _this.allowedChildren = buildAllowedChildren([
467
+ class SequenceElement extends Element {
468
+ constructor() {
469
+ super(...arguments);
470
+ this.allowedChildren = buildAllowedChildren([
533
471
  'any',
534
472
  'choice',
535
473
  'element',
536
474
  'sequence',
537
475
  ]);
538
- return _this;
539
476
  }
540
- SequenceElement.prototype.description = function (definitions, xmlns) {
541
- var sequence = {};
542
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
543
- var child = _a[_i];
477
+ description(definitions, xmlns) {
478
+ const sequence = {};
479
+ for (const child of this.children) {
544
480
  if (child instanceof AnyElement) {
545
481
  continue;
546
482
  }
547
- var description = child.description(definitions, xmlns);
548
- for (var key in description) {
483
+ const description = child.description(definitions, xmlns);
484
+ for (const key in description) {
549
485
  sequence[key] = description[key];
550
486
  }
551
487
  }
552
488
  return sequence;
553
- };
554
- return SequenceElement;
555
- }(Element));
489
+ }
490
+ }
556
491
  exports.SequenceElement = SequenceElement;
557
- var AllElement = /** @class */ (function (_super) {
558
- __extends(AllElement, _super);
559
- function AllElement() {
560
- var _this = _super !== null && _super.apply(this, arguments) || this;
561
- _this.allowedChildren = buildAllowedChildren([
492
+ class AllElement extends Element {
493
+ constructor() {
494
+ super(...arguments);
495
+ this.allowedChildren = buildAllowedChildren([
562
496
  'choice',
563
497
  'element',
564
498
  ]);
565
- return _this;
566
499
  }
567
- AllElement.prototype.description = function (definitions, xmlns) {
568
- var sequence = {};
569
- for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
570
- var child = _a[_i];
500
+ description(definitions, xmlns) {
501
+ const sequence = {};
502
+ for (const child of this.children) {
571
503
  if (child instanceof AnyElement) {
572
504
  continue;
573
505
  }
574
- var description = child.description(definitions, xmlns);
575
- for (var key in description) {
506
+ const description = child.description(definitions, xmlns);
507
+ for (const key in description) {
576
508
  sequence[key] = description[key];
577
509
  }
578
510
  }
579
511
  return sequence;
580
- };
581
- return AllElement;
582
- }(Element));
512
+ }
513
+ }
583
514
  exports.AllElement = AllElement;
584
- var MessageElement = /** @class */ (function (_super) {
585
- __extends(MessageElement, _super);
586
- function MessageElement() {
587
- var _this = _super !== null && _super.apply(this, arguments) || this;
588
- _this.allowedChildren = buildAllowedChildren([
515
+ class MessageElement extends Element {
516
+ constructor() {
517
+ super(...arguments);
518
+ this.allowedChildren = buildAllowedChildren([
589
519
  'part',
590
520
  'documentation',
591
521
  ]);
592
- _this.element = null;
593
- _this.parts = null;
594
- return _this;
595
- }
596
- MessageElement.prototype.postProcess = function (definitions) {
597
- var part = null;
598
- var children = this.children || [];
599
- for (var _i = 0, children_3 = children; _i < children_3.length; _i++) {
600
- var child = children_3[_i];
522
+ this.element = null;
523
+ this.parts = null;
524
+ }
525
+ postProcess(definitions) {
526
+ let part = null;
527
+ const children = this.children || [];
528
+ for (const child of children) {
601
529
  if (child.name === 'part') {
602
530
  part = child;
603
531
  break;
@@ -607,11 +535,11 @@ var MessageElement = /** @class */ (function (_super) {
607
535
  return;
608
536
  }
609
537
  if (part.$element) {
610
- var lookupTypes = [];
538
+ let lookupTypes = [];
611
539
  delete this.parts;
612
- var nsName = utils_1.splitQName(part.$element);
613
- var ns = nsName.prefix;
614
- var schema = definitions.schemas[definitions.xmlns[ns]];
540
+ const nsName = (0, utils_1.splitQName)(part.$element);
541
+ const ns = nsName.prefix;
542
+ let schema = definitions.schemas[definitions.xmlns[ns]];
615
543
  this.element = schema.elements[nsName.name];
616
544
  if (!this.element) {
617
545
  debug(nsName.name + ' is not present in wsdl and cannot be processed correctly.');
@@ -622,11 +550,10 @@ var MessageElement = /** @class */ (function (_super) {
622
550
  // set the optional $lookupType to be used within `client#_invoke()` when
623
551
  // calling `wsdl#objectToDocumentXML()
624
552
  this.element.$lookupType = part.$element;
625
- var elementChildren = this.element.children;
553
+ const elementChildren = this.element.children;
626
554
  // get all nested lookup types (only complex types are followed)
627
555
  if (elementChildren.length > 0) {
628
- for (var _a = 0, elementChildren_1 = elementChildren; _a < elementChildren_1.length; _a++) {
629
- var child = elementChildren_1[_a];
556
+ for (const child of elementChildren) {
630
557
  lookupTypes.push(this._getNestedLookupTypeString(child));
631
558
  }
632
559
  }
@@ -638,15 +565,15 @@ var MessageElement = /** @class */ (function (_super) {
638
565
  filter(function removeEmptyLookupTypes(type) {
639
566
  return type !== '^';
640
567
  });
641
- var schemaXmlns = definitions.schemas[this.element.targetNamespace].xmlns;
642
- for (var i = 0; i < lookupTypes.length; i++) {
568
+ const schemaXmlns = definitions.schemas[this.element.targetNamespace].xmlns;
569
+ for (let i = 0; i < lookupTypes.length; i++) {
643
570
  lookupTypes[i] = this._createLookupTypeObject(lookupTypes[i], schemaXmlns);
644
571
  }
645
572
  }
646
573
  this.element.$lookupTypes = lookupTypes;
647
574
  if (this.element.$type) {
648
- var type = utils_1.splitQName(this.element.$type);
649
- var typeNs = schema.xmlns && schema.xmlns[type.prefix] || definitions.xmlns[type.prefix];
575
+ const type = (0, utils_1.splitQName)(this.element.$type);
576
+ const typeNs = schema.xmlns && schema.xmlns[type.prefix] || definitions.xmlns[type.prefix];
650
577
  if (typeNs) {
651
578
  if (type.name in Primitives) {
652
579
  // this.element = this.element.$type;
@@ -654,7 +581,7 @@ var MessageElement = /** @class */ (function (_super) {
654
581
  else {
655
582
  // first check local mapping of ns alias to namespace
656
583
  schema = definitions.schemas[typeNs];
657
- var ctype = schema.complexTypes[type.name] || schema.types[type.name] || schema.elements[type.name];
584
+ const ctype = schema.complexTypes[type.name] || schema.types[type.name] || schema.elements[type.name];
658
585
  if (ctype) {
659
586
  this.parts = ctype.description(definitions, schema.xmlns);
660
587
  }
@@ -662,7 +589,7 @@ var MessageElement = /** @class */ (function (_super) {
662
589
  }
663
590
  }
664
591
  else {
665
- var method = this.element.description(definitions, schema.xmlns);
592
+ const method = this.element.description(definitions, schema.xmlns);
666
593
  this.parts = method[nsName.name];
667
594
  }
668
595
  this.children.splice(0, 1);
@@ -671,16 +598,16 @@ var MessageElement = /** @class */ (function (_super) {
671
598
  // rpc encoding
672
599
  this.parts = {};
673
600
  delete this.element;
674
- for (var i = 0; part = this.children[i]; i++) {
601
+ for (let i = 0; part = this.children[i]; i++) {
675
602
  if (part.name === 'documentation') {
676
603
  // <wsdl:documentation can be present under <wsdl:message>
677
604
  continue;
678
605
  }
679
- assert_1.ok(part.name === 'part', 'Expected part element');
680
- var nsName = utils_1.splitQName(part.$type);
681
- var ns = definitions.xmlns[nsName.prefix];
682
- var type = nsName.name;
683
- var schemaDefinition = definitions.schemas[ns];
606
+ (0, assert_1.ok)(part.name === 'part', 'Expected part element');
607
+ const nsName = (0, utils_1.splitQName)(part.$type);
608
+ const ns = definitions.xmlns[nsName.prefix];
609
+ const type = nsName.name;
610
+ const schemaDefinition = definitions.schemas[ns];
684
611
  if (typeof schemaDefinition !== 'undefined') {
685
612
  this.parts[part.$name] = definitions.schemas[ns].types[type] || definitions.schemas[ns].complexTypes[type];
686
613
  }
@@ -695,15 +622,15 @@ var MessageElement = /** @class */ (function (_super) {
695
622
  }
696
623
  }
697
624
  this.deleteFixedAttrs();
698
- };
699
- MessageElement.prototype.description = function (definitions) {
625
+ }
626
+ description(definitions) {
700
627
  if (this.element) {
701
628
  return this.element && this.element.description(definitions);
702
629
  }
703
- var desc = {};
630
+ const desc = {};
704
631
  desc[this.$name] = this.parts;
705
632
  return desc;
706
- };
633
+ }
707
634
  /**
708
635
  * Takes a given namespaced String(for example: 'alias:property') and creates a lookupType
709
636
  * object for further use in as first (lookup) `parameterTypeObj` within the `objectToXML`
@@ -715,18 +642,18 @@ var MessageElement = /** @class */ (function (_super) {
715
642
  * @returns {Object}
716
643
  * @private
717
644
  */
718
- MessageElement.prototype._createLookupTypeObject = function (nsString, xmlns) {
719
- var splittedNSString = utils_1.splitQName(nsString);
720
- var nsAlias = splittedNSString.prefix;
721
- var splittedName = splittedNSString.name.split('#');
722
- var type = splittedName[0];
723
- var name = splittedName[1];
645
+ _createLookupTypeObject(nsString, xmlns) {
646
+ const splittedNSString = (0, utils_1.splitQName)(nsString);
647
+ const nsAlias = splittedNSString.prefix;
648
+ const splittedName = splittedNSString.name.split('#');
649
+ const type = splittedName[0];
650
+ const name = splittedName[1];
724
651
  return {
725
652
  $namespace: xmlns[nsAlias],
726
653
  $type: nsAlias + ':' + type,
727
- $name: name
654
+ $name: name,
728
655
  };
729
- };
656
+ }
730
657
  /**
731
658
  * Iterates through the element and every nested child to find any defined `$type`
732
659
  * property and returns it in a underscore ('_') separated String (using '^' as default
@@ -737,76 +664,66 @@ var MessageElement = /** @class */ (function (_super) {
737
664
  * @returns {String}
738
665
  * @private
739
666
  */
740
- MessageElement.prototype._getNestedLookupTypeString = function (element) {
741
- var _this = this;
742
- var resolvedType = '^';
743
- var excluded = this.ignoredNamespaces.concat('xs'); // do not process $type values wich start with
667
+ _getNestedLookupTypeString(element) {
668
+ let resolvedType = '^';
669
+ const excluded = this.ignoredNamespaces.concat('xs'); // do not process $type values wich start with
744
670
  if (element.hasOwnProperty('$type') && typeof element.$type === 'string') {
745
671
  if (excluded.indexOf(element.$type.split(':')[0]) === -1) {
746
672
  resolvedType += ('_' + element.$type + '#' + element.$name);
747
673
  }
748
674
  }
749
675
  if (element.children.length > 0) {
750
- element.children.forEach(function (child) {
751
- var resolvedChildType = _this._getNestedLookupTypeString(child).replace(/\^_/, '');
676
+ element.children.forEach((child) => {
677
+ const resolvedChildType = this._getNestedLookupTypeString(child).replace(/\^_/, '');
752
678
  if (resolvedChildType && typeof resolvedChildType === 'string') {
753
679
  resolvedType += ('_' + resolvedChildType);
754
680
  }
755
681
  });
756
682
  }
757
683
  return resolvedType;
758
- };
759
- return MessageElement;
760
- }(Element));
761
- exports.MessageElement = MessageElement;
762
- var DocumentationElement = /** @class */ (function (_super) {
763
- __extends(DocumentationElement, _super);
764
- function DocumentationElement() {
765
- return _super !== null && _super.apply(this, arguments) || this;
766
684
  }
767
- return DocumentationElement;
768
- }(Element));
685
+ }
686
+ exports.MessageElement = MessageElement;
687
+ class DocumentationElement extends Element {
688
+ }
769
689
  exports.DocumentationElement = DocumentationElement;
770
- var SchemaElement = /** @class */ (function (_super) {
771
- __extends(SchemaElement, _super);
772
- function SchemaElement() {
773
- var _this = _super !== null && _super.apply(this, arguments) || this;
774
- _this.allowedChildren = buildAllowedChildren([
690
+ class SchemaElement extends Element {
691
+ constructor() {
692
+ super(...arguments);
693
+ this.allowedChildren = buildAllowedChildren([
775
694
  'complexType',
776
695
  'element',
777
696
  'import',
778
697
  'include',
779
698
  'simpleType',
780
699
  ]);
781
- _this.complexTypes = {};
782
- _this.types = {};
783
- _this.elements = {};
784
- _this.includes = [];
785
- return _this;
786
- }
787
- SchemaElement.prototype.merge = function (source) {
788
- var _this = this;
789
- assert_1.ok(source instanceof SchemaElement);
700
+ this.complexTypes = {};
701
+ this.types = {};
702
+ this.elements = {};
703
+ this.includes = [];
704
+ }
705
+ merge(source) {
706
+ (0, assert_1.ok)(source instanceof SchemaElement);
790
707
  _.merge(this.complexTypes, source.complexTypes);
791
708
  _.merge(this.types, source.types);
792
709
  _.merge(this.elements, source.elements);
793
710
  _.merge(this.xmlns, source.xmlns);
794
711
  // Merge attributes from source without overwriting our's
795
- _.merge(this, _.pickBy(source, function (value, key) {
796
- return key.startsWith('$') && !_this.hasOwnProperty(key);
712
+ _.merge(this, _.pickBy(source, (value, key) => {
713
+ return key.startsWith('$') && !this.hasOwnProperty(key);
797
714
  }));
798
715
  return this;
799
- };
800
- SchemaElement.prototype.addChild = function (child) {
716
+ }
717
+ addChild(child) {
801
718
  if (child.$name in Primitives) {
802
719
  return;
803
720
  }
804
721
  if (child instanceof IncludeElement || child instanceof ImportElement) {
805
- var location_1 = child.$schemaLocation || child.$location;
806
- if (location_1) {
722
+ const location = child.$schemaLocation || child.$location;
723
+ if (location) {
807
724
  this.includes.push({
808
725
  namespace: child.$namespace || child.$targetNamespace || this.$targetNamespace,
809
- location: location_1
726
+ location: location,
810
727
  });
811
728
  }
812
729
  }
@@ -821,65 +738,58 @@ var SchemaElement = /** @class */ (function (_super) {
821
738
  }
822
739
  this.children.pop();
823
740
  // child.deleteFixedAttrs();
824
- };
825
- return SchemaElement;
826
- }(Element));
741
+ }
742
+ }
827
743
  exports.SchemaElement = SchemaElement;
828
- var TypesElement = /** @class */ (function (_super) {
829
- __extends(TypesElement, _super);
830
- function TypesElement() {
831
- var _this = _super !== null && _super.apply(this, arguments) || this;
832
- _this.allowedChildren = buildAllowedChildren([
744
+ class TypesElement extends Element {
745
+ constructor() {
746
+ super(...arguments);
747
+ this.allowedChildren = buildAllowedChildren([
833
748
  'documentation',
834
749
  'schema',
835
750
  ]);
836
- _this.schemas = {};
837
- return _this;
751
+ this.schemas = {};
838
752
  }
839
753
  // fix#325
840
- TypesElement.prototype.addChild = function (child) {
841
- var _a;
842
- assert_1.ok(child instanceof SchemaElement);
843
- var targetNamespace = child.$targetNamespace || ((_a = child.includes[0]) === null || _a === void 0 ? void 0 : _a.namespace);
754
+ addChild(child) {
755
+ (0, assert_1.ok)(child instanceof SchemaElement);
756
+ const targetNamespace = child.$targetNamespace || child.includes[0]?.namespace;
844
757
  if (!this.schemas.hasOwnProperty(targetNamespace)) {
845
758
  this.schemas[targetNamespace] = child;
846
759
  }
847
760
  else {
848
761
  console.error('Target-Namespace "' + targetNamespace + '" already in use by another Schema!');
849
762
  }
850
- };
851
- return TypesElement;
852
- }(Element));
763
+ }
764
+ }
853
765
  exports.TypesElement = TypesElement;
854
- var OperationElement = /** @class */ (function (_super) {
855
- __extends(OperationElement, _super);
856
- function OperationElement() {
857
- var _this = _super !== null && _super.apply(this, arguments) || this;
858
- _this.allowedChildren = buildAllowedChildren([
766
+ class OperationElement extends Element {
767
+ constructor() {
768
+ super(...arguments);
769
+ this.allowedChildren = buildAllowedChildren([
859
770
  'documentation',
860
771
  'fault',
861
772
  'input',
862
773
  'operation',
863
774
  'output',
864
775
  ]);
865
- _this.input = null;
866
- _this.output = null;
867
- _this.inputSoap = null;
868
- _this.outputSoap = null;
869
- _this.style = '';
870
- _this.soapAction = '';
871
- return _this;
872
- }
873
- OperationElement.prototype.addChild = function (child) {
776
+ this.input = null;
777
+ this.output = null;
778
+ this.inputSoap = null;
779
+ this.outputSoap = null;
780
+ this.style = '';
781
+ this.soapAction = '';
782
+ }
783
+ addChild(child) {
874
784
  if (child instanceof OperationElement) {
875
785
  this.soapAction = child.$soapAction || '';
876
786
  this.style = child.$style || '';
877
787
  this.children.pop();
878
788
  }
879
- };
880
- OperationElement.prototype.postProcess = function (definitions, tag) {
881
- var children = this.children;
882
- for (var i = 0, child = void 0; child = children[i]; i++) {
789
+ }
790
+ postProcess(definitions, tag) {
791
+ const children = this.children;
792
+ for (let i = 0, child; child = children[i]; i++) {
883
793
  if (child.name !== 'input' && child.name !== 'output') {
884
794
  continue;
885
795
  }
@@ -888,8 +798,8 @@ var OperationElement = /** @class */ (function (_super) {
888
798
  children.splice(i--, 1);
889
799
  continue;
890
800
  }
891
- var messageName = utils_1.splitQName(child.$message).name;
892
- var message = definitions.messages[messageName];
801
+ const messageName = (0, utils_1.splitQName)(child.$message).name;
802
+ const message = definitions.messages[messageName];
893
803
  message.postProcess(definitions);
894
804
  if (message.element) {
895
805
  definitions.messages[message.element.$name] = message;
@@ -901,35 +811,32 @@ var OperationElement = /** @class */ (function (_super) {
901
811
  children.splice(i--, 1);
902
812
  }
903
813
  this.deleteFixedAttrs();
904
- };
905
- OperationElement.prototype.description = function (definitions) {
906
- var inputDesc = this.input ? this.input.description(definitions) : null;
907
- var outputDesc = this.output ? this.output.description(definitions) : null;
814
+ }
815
+ description(definitions) {
816
+ const inputDesc = this.input ? this.input.description(definitions) : null;
817
+ const outputDesc = this.output ? this.output.description(definitions) : null;
908
818
  return {
909
819
  input: inputDesc && inputDesc[Object.keys(inputDesc)[0]],
910
- output: outputDesc && outputDesc[Object.keys(outputDesc)[0]]
820
+ output: outputDesc && outputDesc[Object.keys(outputDesc)[0]],
911
821
  };
912
- };
913
- return OperationElement;
914
- }(Element));
822
+ }
823
+ }
915
824
  exports.OperationElement = OperationElement;
916
- var PortTypeElement = /** @class */ (function (_super) {
917
- __extends(PortTypeElement, _super);
918
- function PortTypeElement() {
919
- var _this = _super !== null && _super.apply(this, arguments) || this;
920
- _this.allowedChildren = buildAllowedChildren([
825
+ class PortTypeElement extends Element {
826
+ constructor() {
827
+ super(...arguments);
828
+ this.allowedChildren = buildAllowedChildren([
921
829
  'documentation',
922
830
  'operation',
923
831
  ]);
924
- _this.methods = {};
925
- return _this;
832
+ this.methods = {};
926
833
  }
927
- PortTypeElement.prototype.postProcess = function (definitions) {
928
- var children = this.children;
834
+ postProcess(definitions) {
835
+ const children = this.children;
929
836
  if (typeof children === 'undefined') {
930
837
  return;
931
838
  }
932
- for (var i = 0, child = void 0; child = children[i]; i++) {
839
+ for (let i = 0, child; child = children[i]; i++) {
933
840
  if (child.name !== 'operation') {
934
841
  continue;
935
842
  }
@@ -939,56 +846,53 @@ var PortTypeElement = /** @class */ (function (_super) {
939
846
  }
940
847
  delete this.$name;
941
848
  this.deleteFixedAttrs();
942
- };
943
- PortTypeElement.prototype.description = function (definitions) {
944
- var methods = {};
945
- for (var name_1 in this.methods) {
946
- var method = this.methods[name_1];
947
- methods[name_1] = method.description(definitions);
849
+ }
850
+ description(definitions) {
851
+ const methods = {};
852
+ for (const name in this.methods) {
853
+ const method = this.methods[name];
854
+ methods[name] = method.description(definitions);
948
855
  }
949
856
  return methods;
950
- };
951
- return PortTypeElement;
952
- }(Element));
857
+ }
858
+ }
953
859
  exports.PortTypeElement = PortTypeElement;
954
- var BindingElement = /** @class */ (function (_super) {
955
- __extends(BindingElement, _super);
956
- function BindingElement() {
957
- var _this = _super !== null && _super.apply(this, arguments) || this;
958
- _this.allowedChildren = buildAllowedChildren([
860
+ class BindingElement extends Element {
861
+ constructor() {
862
+ super(...arguments);
863
+ this.allowedChildren = buildAllowedChildren([
959
864
  'binding',
960
865
  'documentation',
961
866
  'operation',
962
867
  'SecuritySpec',
963
868
  ]);
964
- _this.transport = '';
965
- _this.style = '';
966
- _this.methods = {};
967
- return _this;
869
+ this.transport = '';
870
+ this.style = '';
871
+ this.methods = {};
968
872
  }
969
- BindingElement.prototype.addChild = function (child) {
873
+ addChild(child) {
970
874
  if (child.name === 'binding') {
971
875
  this.transport = child.$transport;
972
876
  this.style = child.$style;
973
877
  this.children.pop();
974
878
  }
975
- };
976
- BindingElement.prototype.postProcess = function (definitions) {
977
- var type = utils_1.splitQName(this.$type).name;
978
- var portType = definitions.portTypes[type];
979
- var style = this.style;
980
- var children = this.children;
879
+ }
880
+ postProcess(definitions) {
881
+ const type = (0, utils_1.splitQName)(this.$type).name;
882
+ const portType = definitions.portTypes[type];
883
+ const style = this.style;
884
+ const children = this.children;
981
885
  if (portType) {
982
886
  portType.postProcess(definitions);
983
887
  this.methods = portType.methods;
984
- for (var i = 0, child = void 0; child = children[i]; i++) {
888
+ for (let i = 0, child; child = children[i]; i++) {
985
889
  if (child.name !== 'operation') {
986
890
  continue;
987
891
  }
988
892
  child.postProcess(definitions, 'binding');
989
893
  children.splice(i--, 1);
990
894
  child.style || (child.style = style);
991
- var method = this.methods[child.$name];
895
+ const method = this.methods[child.$name];
992
896
  if (method) {
993
897
  method.style = child.style;
994
898
  method.soapAction = child.soapAction;
@@ -1002,63 +906,57 @@ var BindingElement = /** @class */ (function (_super) {
1002
906
  delete this.$name;
1003
907
  delete this.$type;
1004
908
  this.deleteFixedAttrs();
1005
- };
1006
- BindingElement.prototype.description = function (definitions) {
1007
- var methods = {};
1008
- for (var name_2 in this.methods) {
1009
- var method = this.methods[name_2];
1010
- methods[name_2] = method.description(definitions);
909
+ }
910
+ description(definitions) {
911
+ const methods = {};
912
+ for (const name in this.methods) {
913
+ const method = this.methods[name];
914
+ methods[name] = method.description(definitions);
1011
915
  }
1012
916
  return methods;
1013
- };
1014
- return BindingElement;
1015
- }(Element));
917
+ }
918
+ }
1016
919
  exports.BindingElement = BindingElement;
1017
- var PortElement = /** @class */ (function (_super) {
1018
- __extends(PortElement, _super);
1019
- function PortElement() {
1020
- var _this = _super !== null && _super.apply(this, arguments) || this;
1021
- _this.allowedChildren = buildAllowedChildren([
920
+ class PortElement extends Element {
921
+ constructor() {
922
+ super(...arguments);
923
+ this.allowedChildren = buildAllowedChildren([
1022
924
  'address',
1023
925
  'documentation',
1024
926
  ]);
1025
- _this.location = null;
1026
- return _this;
927
+ this.location = null;
1027
928
  }
1028
- PortElement.prototype.addChild = function (child) {
929
+ addChild(child) {
1029
930
  if (child.name === 'address' && typeof (child.$location) !== 'undefined') {
1030
931
  this.location = child.$location;
1031
932
  }
1032
- };
1033
- return PortElement;
1034
- }(Element));
933
+ }
934
+ }
1035
935
  exports.PortElement = PortElement;
1036
- var ServiceElement = /** @class */ (function (_super) {
1037
- __extends(ServiceElement, _super);
1038
- function ServiceElement() {
1039
- var _this = _super !== null && _super.apply(this, arguments) || this;
1040
- _this.allowedChildren = buildAllowedChildren([
936
+ class ServiceElement extends Element {
937
+ constructor() {
938
+ super(...arguments);
939
+ this.allowedChildren = buildAllowedChildren([
1041
940
  'documentation',
1042
941
  'port',
1043
942
  ]);
1044
- _this.ports = {};
1045
- return _this;
943
+ this.ports = {};
1046
944
  }
1047
- ServiceElement.prototype.postProcess = function (definitions) {
1048
- var children = this.children;
1049
- var bindings = definitions.bindings;
945
+ postProcess(definitions) {
946
+ const children = this.children;
947
+ const bindings = definitions.bindings;
1050
948
  if (children && children.length > 0) {
1051
- for (var i = 0, child = void 0; child = children[i]; i++) {
949
+ for (let i = 0, child; child = children[i]; i++) {
1052
950
  if (child.name !== 'port') {
1053
951
  continue;
1054
952
  }
1055
- var bindingName = utils_1.splitQName(child.$binding).name;
1056
- var binding = bindings[bindingName];
953
+ const bindingName = (0, utils_1.splitQName)(child.$binding).name;
954
+ const binding = bindings[bindingName];
1057
955
  if (binding) {
1058
956
  binding.postProcess(definitions);
1059
957
  this.ports[child.$name] = {
1060
958
  location: child.location,
1061
- binding: binding
959
+ binding: binding,
1062
960
  };
1063
961
  children.splice(i--, 1);
1064
962
  }
@@ -1066,23 +964,21 @@ var ServiceElement = /** @class */ (function (_super) {
1066
964
  }
1067
965
  delete this.$name;
1068
966
  this.deleteFixedAttrs();
1069
- };
1070
- ServiceElement.prototype.description = function (definitions) {
1071
- var ports = {};
1072
- for (var name_3 in this.ports) {
1073
- var port = this.ports[name_3];
1074
- ports[name_3] = port.binding.description(definitions);
967
+ }
968
+ description(definitions) {
969
+ const ports = {};
970
+ for (const name in this.ports) {
971
+ const port = this.ports[name];
972
+ ports[name] = port.binding.description(definitions);
1075
973
  }
1076
974
  return ports;
1077
- };
1078
- return ServiceElement;
1079
- }(Element));
975
+ }
976
+ }
1080
977
  exports.ServiceElement = ServiceElement;
1081
- var DefinitionsElement = /** @class */ (function (_super) {
1082
- __extends(DefinitionsElement, _super);
1083
- function DefinitionsElement() {
1084
- var _this = _super !== null && _super.apply(this, arguments) || this;
1085
- _this.allowedChildren = buildAllowedChildren([
978
+ class DefinitionsElement extends Element {
979
+ constructor() {
980
+ super(...arguments);
981
+ this.allowedChildren = buildAllowedChildren([
1086
982
  'binding',
1087
983
  'documentation',
1088
984
  'import',
@@ -1091,23 +987,22 @@ var DefinitionsElement = /** @class */ (function (_super) {
1091
987
  'service',
1092
988
  'types',
1093
989
  ]);
1094
- _this.messages = {};
1095
- _this.portTypes = {};
1096
- _this.bindings = {};
1097
- _this.services = {};
1098
- _this.schemas = {};
1099
- _this.descriptions = {
990
+ this.messages = {};
991
+ this.portTypes = {};
992
+ this.bindings = {};
993
+ this.services = {};
994
+ this.schemas = {};
995
+ this.descriptions = {
1100
996
  types: {},
1101
- elements: {}
997
+ elements: {},
1102
998
  };
1103
- return _this;
1104
999
  }
1105
- DefinitionsElement.prototype.init = function () {
1000
+ init() {
1106
1001
  if (this.name !== 'definitions') {
1107
1002
  this.unexpected(this.nsName);
1108
1003
  }
1109
- };
1110
- DefinitionsElement.prototype.addChild = function (child) {
1004
+ }
1005
+ addChild(child) {
1111
1006
  if (child instanceof TypesElement) {
1112
1007
  // Merge types.schemas into definitions.schemas
1113
1008
  _.merge(this.schemas, child.schemas);
@@ -1116,7 +1011,7 @@ var DefinitionsElement = /** @class */ (function (_super) {
1116
1011
  this.messages[child.$name] = child;
1117
1012
  }
1118
1013
  else if (child.name === 'import') {
1119
- var schemaElement = new SchemaElement(child.$namespace, {});
1014
+ const schemaElement = new SchemaElement(child.$namespace, {});
1120
1015
  schemaElement.init();
1121
1016
  this.schemas[child.$namespace] = schemaElement;
1122
1017
  this.schemas[child.$namespace].addChild(child);
@@ -1136,35 +1031,19 @@ var DefinitionsElement = /** @class */ (function (_super) {
1136
1031
  else if (child instanceof DocumentationElement) {
1137
1032
  }
1138
1033
  this.children.pop();
1139
- };
1140
- return DefinitionsElement;
1141
- }(Element));
1142
- exports.DefinitionsElement = DefinitionsElement;
1143
- var BodyElement = /** @class */ (function (_super) {
1144
- __extends(BodyElement, _super);
1145
- function BodyElement() {
1146
- return _super !== null && _super.apply(this, arguments) || this;
1147
1034
  }
1148
- return BodyElement;
1149
- }(Element));
1035
+ }
1036
+ exports.DefinitionsElement = DefinitionsElement;
1037
+ class BodyElement extends Element {
1038
+ }
1150
1039
  exports.BodyElement = BodyElement;
1151
- var IncludeElement = /** @class */ (function (_super) {
1152
- __extends(IncludeElement, _super);
1153
- function IncludeElement() {
1154
- return _super !== null && _super.apply(this, arguments) || this;
1155
- }
1156
- return IncludeElement;
1157
- }(Element));
1040
+ class IncludeElement extends Element {
1041
+ }
1158
1042
  exports.IncludeElement = IncludeElement;
1159
- var ImportElement = /** @class */ (function (_super) {
1160
- __extends(ImportElement, _super);
1161
- function ImportElement() {
1162
- return _super !== null && _super.apply(this, arguments) || this;
1163
- }
1164
- return ImportElement;
1165
- }(Element));
1043
+ class ImportElement extends Element {
1044
+ }
1166
1045
  exports.ImportElement = ImportElement;
1167
- var ElementTypeMap = {
1046
+ const ElementTypeMap = {
1168
1047
  // group: [GroupElement, 'element group'],
1169
1048
  all: AllElement,
1170
1049
  any: AnyElement,
@@ -1179,7 +1058,7 @@ var ElementTypeMap = {
1179
1058
  enumeration: EnumerationElement,
1180
1059
  extension: ExtensionElement,
1181
1060
  fault: Element,
1182
- "import": ImportElement,
1061
+ import: ImportElement,
1183
1062
  include: IncludeElement,
1184
1063
  input: InputElement,
1185
1064
  message: MessageElement,
@@ -1193,12 +1072,11 @@ var ElementTypeMap = {
1193
1072
  service: ServiceElement,
1194
1073
  simpleContent: SimpleContentElement,
1195
1074
  simpleType: SimpleTypeElement,
1196
- types: TypesElement
1075
+ types: TypesElement,
1197
1076
  };
1198
1077
  function buildAllowedChildren(elementList) {
1199
- var rtn = {};
1200
- for (var _i = 0, elementList_1 = elementList; _i < elementList_1.length; _i++) {
1201
- var element = elementList_1[_i];
1078
+ const rtn = {};
1079
+ for (const element of elementList) {
1202
1080
  rtn[element.replace(/^_/, '')] = ElementTypeMap[element] || Element;
1203
1081
  }
1204
1082
  return rtn;