cdk8s-operator 0.1.407 → 0.1.409

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 (29) hide show
  1. package/.jsii +4 -4
  2. package/lib/operator.js +3 -3
  3. package/lib/server.js +1 -1
  4. package/node_modules/yaml/browser/dist/PlainValue-183afbad.js +751 -0
  5. package/node_modules/yaml/browser/dist/Schema-9530c078.js +467 -0
  6. package/node_modules/yaml/browser/dist/index.js +436 -746
  7. package/node_modules/yaml/browser/dist/legacy-exports.js +3 -3
  8. package/node_modules/yaml/browser/dist/parse-cst.js +1290 -1689
  9. package/node_modules/yaml/browser/dist/resolveSeq-67caf78a.js +1835 -0
  10. package/node_modules/yaml/browser/dist/types.js +4 -4
  11. package/node_modules/yaml/browser/dist/util.js +2 -2
  12. package/node_modules/yaml/browser/dist/warnings-5e4358fe.js +348 -0
  13. package/node_modules/yaml/dist/{Document-9b4560a1.js → Document-a8d0fbf9.js} +11 -131
  14. package/node_modules/yaml/dist/{PlainValue-ec8e588e.js → PlainValue-516d5bc2.js} +35 -146
  15. package/node_modules/yaml/dist/{Schema-88e323a7.js → Schema-bcc6c2d7.js} +10 -66
  16. package/node_modules/yaml/dist/index.js +5 -17
  17. package/node_modules/yaml/dist/legacy-exports.js +3 -3
  18. package/node_modules/yaml/dist/parse-cst.js +45 -291
  19. package/node_modules/yaml/dist/{resolveSeq-d03cb037.js → resolveSeq-95613e94.js} +44 -346
  20. package/node_modules/yaml/dist/test-events.js +28 -44
  21. package/node_modules/yaml/dist/types.js +4 -4
  22. package/node_modules/yaml/dist/util.js +2 -2
  23. package/node_modules/yaml/dist/{warnings-1000a372.js → warnings-793925ce.js} +16 -73
  24. package/node_modules/yaml/package.json +2 -3
  25. package/package.json +6 -6
  26. package/node_modules/yaml/browser/dist/PlainValue-b8036b75.js +0 -1275
  27. package/node_modules/yaml/browser/dist/Schema-e94716c8.js +0 -682
  28. package/node_modules/yaml/browser/dist/resolveSeq-492ab440.js +0 -2419
  29. package/node_modules/yaml/browser/dist/warnings-df54cb69.js +0 -499
@@ -1,25 +1,21 @@
1
1
  'use strict';
2
2
 
3
- var PlainValue = require('./PlainValue-ec8e588e.js');
4
- var resolveSeq = require('./resolveSeq-d03cb037.js');
5
- var warnings = require('./warnings-1000a372.js');
3
+ var PlainValue = require('./PlainValue-516d5bc2.js');
4
+ var resolveSeq = require('./resolveSeq-95613e94.js');
5
+ var warnings = require('./warnings-793925ce.js');
6
6
 
7
7
  function createMap(schema, obj, ctx) {
8
8
  const map = new resolveSeq.YAMLMap(schema);
9
-
10
9
  if (obj instanceof Map) {
11
10
  for (const [key, value] of obj) map.items.push(schema.createPair(key, value, ctx));
12
11
  } else if (obj && typeof obj === 'object') {
13
12
  for (const key of Object.keys(obj)) map.items.push(schema.createPair(key, obj[key], ctx));
14
13
  }
15
-
16
14
  if (typeof schema.sortMapEntries === 'function') {
17
15
  map.items.sort(schema.sortMapEntries);
18
16
  }
19
-
20
17
  return map;
21
18
  }
22
-
23
19
  const map = {
24
20
  createNode: createMap,
25
21
  default: true,
@@ -30,17 +26,14 @@ const map = {
30
26
 
31
27
  function createSeq(schema, obj, ctx) {
32
28
  const seq = new resolveSeq.YAMLSeq(schema);
33
-
34
29
  if (obj && obj[Symbol.iterator]) {
35
30
  for (const it of obj) {
36
31
  const v = schema.createNode(it, ctx.wrapScalars, null, ctx);
37
32
  seq.items.push(v);
38
33
  }
39
34
  }
40
-
41
35
  return seq;
42
36
  }
43
-
44
37
  const seq = {
45
38
  createNode: createSeq,
46
39
  default: true,
@@ -54,25 +47,20 @@ const string = {
54
47
  default: true,
55
48
  tag: 'tag:yaml.org,2002:str',
56
49
  resolve: resolveSeq.resolveString,
57
-
58
50
  stringify(item, ctx, onComment, onChompKeep) {
59
51
  ctx = Object.assign({
60
52
  actualString: true
61
53
  }, ctx);
62
54
  return resolveSeq.stringifyString(item, ctx, onComment, onChompKeep);
63
55
  },
64
-
65
56
  options: resolveSeq.strOptions
66
57
  };
67
58
 
68
59
  const failsafe = [map, seq, string];
69
60
 
70
61
  /* global BigInt */
71
-
72
62
  const intIdentify$2 = value => typeof value === 'bigint' || Number.isInteger(value);
73
-
74
63
  const intResolve$1 = (src, part, radix) => resolveSeq.intOptions.asBigInt ? BigInt(src) : parseInt(part, radix);
75
-
76
64
  function intStringify$1(node, radix, prefix) {
77
65
  const {
78
66
  value
@@ -80,7 +68,6 @@ function intStringify$1(node, radix, prefix) {
80
68
  if (intIdentify$2(value) && value >= 0) return prefix + value.toString(radix);
81
69
  return resolveSeq.stringifyNumber(node);
82
70
  }
83
-
84
71
  const nullObj = {
85
72
  identify: value => value == null,
86
73
  createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeq.Scalar(null) : null,
@@ -155,26 +142,21 @@ const floatObj = {
155
142
  default: true,
156
143
  tag: 'tag:yaml.org,2002:float',
157
144
  test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,
158
-
159
145
  resolve(str, frac1, frac2) {
160
146
  const frac = frac1 || frac2;
161
147
  const node = new resolveSeq.Scalar(parseFloat(str));
162
148
  if (frac && frac[frac.length - 1] === '0') node.minFractionDigits = frac.length;
163
149
  return node;
164
150
  },
165
-
166
151
  stringify: resolveSeq.stringifyNumber
167
152
  };
168
153
  const core = failsafe.concat([nullObj, boolObj, octObj, intObj, hexObj, nanObj, expObj, floatObj]);
169
154
 
170
155
  /* global BigInt */
171
-
172
156
  const intIdentify$1 = value => typeof value === 'bigint' || Number.isInteger(value);
173
-
174
157
  const stringifyJSON = ({
175
158
  value
176
159
  }) => JSON.stringify(value);
177
-
178
160
  const json = [map, seq, {
179
161
  identify: value => typeof value === 'string',
180
162
  default: true,
@@ -213,58 +195,45 @@ const json = [map, seq, {
213
195
  resolve: str => parseFloat(str),
214
196
  stringify: stringifyJSON
215
197
  }];
216
-
217
198
  json.scalarFallback = str => {
218
199
  throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(str)}`);
219
200
  };
220
201
 
221
202
  /* global BigInt */
222
-
223
203
  const boolStringify = ({
224
204
  value
225
205
  }) => value ? resolveSeq.boolOptions.trueStr : resolveSeq.boolOptions.falseStr;
226
-
227
206
  const intIdentify = value => typeof value === 'bigint' || Number.isInteger(value);
228
-
229
207
  function intResolve(sign, src, radix) {
230
208
  let str = src.replace(/_/g, '');
231
-
232
209
  if (resolveSeq.intOptions.asBigInt) {
233
210
  switch (radix) {
234
211
  case 2:
235
212
  str = `0b${str}`;
236
213
  break;
237
-
238
214
  case 8:
239
215
  str = `0o${str}`;
240
216
  break;
241
-
242
217
  case 16:
243
218
  str = `0x${str}`;
244
219
  break;
245
220
  }
246
-
247
221
  const n = BigInt(str);
248
222
  return sign === '-' ? BigInt(-1) * n : n;
249
223
  }
250
-
251
224
  const n = parseInt(str, radix);
252
225
  return sign === '-' ? -1 * n : n;
253
226
  }
254
-
255
227
  function intStringify(node, radix, prefix) {
256
228
  const {
257
229
  value
258
230
  } = node;
259
-
260
231
  if (intIdentify(value)) {
261
232
  const str = value.toString(radix);
262
233
  return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;
263
234
  }
264
-
265
235
  return resolveSeq.stringifyNumber(node);
266
236
  }
267
-
268
237
  const yaml11 = failsafe.concat([{
269
238
  identify: value => value == null,
270
239
  createNode: (schema, value, ctx) => ctx.wrapScalars ? new resolveSeq.Scalar(null) : null,
@@ -343,18 +312,14 @@ const yaml11 = failsafe.concat([{
343
312
  default: true,
344
313
  tag: 'tag:yaml.org,2002:float',
345
314
  test: /^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,
346
-
347
315
  resolve(str, frac) {
348
316
  const node = new resolveSeq.Scalar(parseFloat(str.replace(/_/g, '')));
349
-
350
317
  if (frac) {
351
318
  const f = frac.replace(/_/g, '');
352
319
  if (f[f.length - 1] === '0') node.minFractionDigits = f.length;
353
320
  }
354
-
355
321
  return node;
356
322
  },
357
-
358
323
  stringify: resolveSeq.stringifyNumber
359
324
  }], warnings.binary, warnings.omap, warnings.pairs, warnings.set, warnings.intTime, warnings.floatTime, warnings.timestamp);
360
325
 
@@ -390,12 +355,11 @@ function findTagObject(value, tagName, tags) {
390
355
  const tagObj = match.find(t => !t.format) || match[0];
391
356
  if (!tagObj) throw new Error(`Tag ${tagName} not found`);
392
357
  return tagObj;
393
- } // TODO: deprecate/remove class check
394
-
358
+ }
395
359
 
360
+ // TODO: deprecate/remove class check
396
361
  return tags.find(t => (t.identify && t.identify(value) || t.class && value instanceof t.class) && !t.format);
397
362
  }
398
-
399
363
  function createNode(value, tagName, ctx) {
400
364
  if (value instanceof resolveSeq.Node) return value;
401
365
  const {
@@ -407,40 +371,32 @@ function createNode(value, tagName, ctx) {
407
371
  } = ctx;
408
372
  if (tagName && tagName.startsWith('!!')) tagName = defaultPrefix + tagName.slice(2);
409
373
  let tagObj = findTagObject(value, tagName, schema.tags);
410
-
411
374
  if (!tagObj) {
412
375
  if (typeof value.toJSON === 'function') value = value.toJSON();
413
376
  if (!value || typeof value !== 'object') return wrapScalars ? new resolveSeq.Scalar(value) : value;
414
377
  tagObj = value instanceof Map ? map : value[Symbol.iterator] ? seq : map;
415
378
  }
416
-
417
379
  if (onTagObj) {
418
380
  onTagObj(tagObj);
419
381
  delete ctx.onTagObj;
420
- } // Detect duplicate references to the same object & use Alias nodes for all
421
- // after first. The `obj` wrapper allows for circular references to resolve.
422
-
382
+ }
423
383
 
384
+ // Detect duplicate references to the same object & use Alias nodes for all
385
+ // after first. The `obj` wrapper allows for circular references to resolve.
424
386
  const obj = {
425
387
  value: undefined,
426
388
  node: undefined
427
389
  };
428
-
429
390
  if (value && typeof value === 'object' && prevObjects) {
430
391
  const prev = prevObjects.get(value);
431
-
432
392
  if (prev) {
433
393
  const alias = new resolveSeq.Alias(prev); // leaves source dirty; must be cleaned by caller
434
-
435
394
  ctx.aliasNodes.push(alias); // defined along with prevObjects
436
-
437
395
  return alias;
438
396
  }
439
-
440
397
  obj.value = value;
441
398
  prevObjects.set(value, obj);
442
399
  }
443
-
444
400
  obj.node = tagObj.createNode ? tagObj.createNode(ctx.schema, value, ctx) : wrapScalars ? new resolveSeq.Scalar(value) : value;
445
401
  if (tagName && obj.node instanceof resolveSeq.Node) obj.node.tag = tagName;
446
402
  return obj.node;
@@ -448,41 +404,33 @@ function createNode(value, tagName, ctx) {
448
404
 
449
405
  function getSchemaTags(schemas, knownTags, customTags, schemaId) {
450
406
  let tags = schemas[schemaId.replace(/\W/g, '')]; // 'yaml-1.1' -> 'yaml11'
451
-
452
407
  if (!tags) {
453
408
  const keys = Object.keys(schemas).map(key => JSON.stringify(key)).join(', ');
454
409
  throw new Error(`Unknown schema "${schemaId}"; use one of ${keys}`);
455
410
  }
456
-
457
411
  if (Array.isArray(customTags)) {
458
412
  for (const tag of customTags) tags = tags.concat(tag);
459
413
  } else if (typeof customTags === 'function') {
460
414
  tags = customTags(tags.slice());
461
415
  }
462
-
463
416
  for (let i = 0; i < tags.length; ++i) {
464
417
  const tag = tags[i];
465
-
466
418
  if (typeof tag === 'string') {
467
419
  const tagObj = knownTags[tag];
468
-
469
420
  if (!tagObj) {
470
421
  const keys = Object.keys(knownTags).map(key => JSON.stringify(key)).join(', ');
471
422
  throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
472
423
  }
473
-
474
424
  tags[i] = tagObj;
475
425
  }
476
426
  }
477
-
478
427
  return tags;
479
428
  }
480
429
 
481
430
  const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
482
-
483
431
  class Schema {
484
432
  // TODO: remove in v2
485
- // TODO: remove in v2
433
+
486
434
  constructor({
487
435
  customTags,
488
436
  merge,
@@ -496,7 +444,6 @@ class Schema {
496
444
  if (!customTags && deprecatedCustomTags) warnings.warnOptionDeprecation('tags', 'customTags');
497
445
  this.tags = getSchemaTags(schemas, tags, customTags || deprecatedCustomTags, schema);
498
446
  }
499
-
500
447
  createNode(value, wrapScalars, tagName, ctx) {
501
448
  const baseCtx = {
502
449
  defaultPrefix: Schema.defaultPrefix,
@@ -506,7 +453,6 @@ class Schema {
506
453
  const createCtx = ctx ? Object.assign(ctx, baseCtx) : baseCtx;
507
454
  return createNode(value, tagName, createCtx);
508
455
  }
509
-
510
456
  createPair(key, value, ctx) {
511
457
  if (!ctx) ctx = {
512
458
  wrapScalars: true
@@ -515,11 +461,9 @@ class Schema {
515
461
  const v = this.createNode(value, ctx.wrapScalars, null, ctx);
516
462
  return new resolveSeq.Pair(k, v);
517
463
  }
518
-
519
464
  }
520
-
521
465
  PlainValue._defineProperty(Schema, "defaultPrefix", PlainValue.defaultTagPrefix);
522
-
466
+ // TODO: remove in v2
523
467
  PlainValue._defineProperty(Schema, "defaultTags", PlainValue.defaultTags);
524
468
 
525
469
  exports.Schema = Schema;
@@ -1,69 +1,57 @@
1
1
  'use strict';
2
2
 
3
3
  var parseCst = require('./parse-cst.js');
4
- var Document$1 = require('./Document-9b4560a1.js');
5
- var Schema = require('./Schema-88e323a7.js');
6
- var PlainValue = require('./PlainValue-ec8e588e.js');
7
- var warnings = require('./warnings-1000a372.js');
8
- require('./resolveSeq-d03cb037.js');
4
+ var Document$1 = require('./Document-a8d0fbf9.js');
5
+ var Schema = require('./Schema-bcc6c2d7.js');
6
+ var PlainValue = require('./PlainValue-516d5bc2.js');
7
+ var warnings = require('./warnings-793925ce.js');
8
+ require('./resolveSeq-95613e94.js');
9
9
 
10
10
  function createNode(value, wrapScalars = true, tag) {
11
11
  if (tag === undefined && typeof wrapScalars === 'string') {
12
12
  tag = wrapScalars;
13
13
  wrapScalars = true;
14
14
  }
15
-
16
15
  const options = Object.assign({}, Document$1.Document.defaults[Document$1.defaultOptions.version], Document$1.defaultOptions);
17
16
  const schema = new Schema.Schema(options);
18
17
  return schema.createNode(value, wrapScalars, tag);
19
18
  }
20
-
21
19
  class Document extends Document$1.Document {
22
20
  constructor(options) {
23
21
  super(Object.assign({}, Document$1.defaultOptions, options));
24
22
  }
25
-
26
23
  }
27
-
28
24
  function parseAllDocuments(src, options) {
29
25
  const stream = [];
30
26
  let prev;
31
-
32
27
  for (const cstDoc of parseCst.parse(src)) {
33
28
  const doc = new Document(options);
34
29
  doc.parse(cstDoc, prev);
35
30
  stream.push(doc);
36
31
  prev = doc;
37
32
  }
38
-
39
33
  return stream;
40
34
  }
41
-
42
35
  function parseDocument(src, options) {
43
36
  const cst = parseCst.parse(src);
44
37
  const doc = new Document(options).parse(cst[0]);
45
-
46
38
  if (cst.length > 1) {
47
39
  const errMsg = 'Source contains multiple documents; please use YAML.parseAllDocuments()';
48
40
  doc.errors.unshift(new PlainValue.YAMLSemanticError(cst[1], errMsg));
49
41
  }
50
-
51
42
  return doc;
52
43
  }
53
-
54
44
  function parse(src, options) {
55
45
  const doc = parseDocument(src, options);
56
46
  doc.warnings.forEach(warning => warnings.warn(warning));
57
47
  if (doc.errors.length > 0) throw doc.errors[0];
58
48
  return doc.toJSON();
59
49
  }
60
-
61
50
  function stringify(value, options) {
62
51
  const doc = new Document(options);
63
52
  doc.contents = value;
64
53
  return String(doc);
65
54
  }
66
-
67
55
  const YAML = {
68
56
  createNode,
69
57
  defaultOptions: Document$1.defaultOptions,
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var warnings = require('./warnings-1000a372.js');
4
- require('./PlainValue-ec8e588e.js');
5
- require('./resolveSeq-d03cb037.js');
3
+ var warnings = require('./warnings-793925ce.js');
4
+ require('./PlainValue-516d5bc2.js');
5
+ require('./resolveSeq-95613e94.js');
6
6
 
7
7
 
8
8