@pgarbe/cdk-ecr-sync 0.5.25 → 0.5.26

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 (134) hide show
  1. package/.jsii +147 -4
  2. package/.projenrc.ts +1 -1
  3. package/CHANGELOG.md +1 -1
  4. package/lib/ecr-sync.d.ts +4 -22
  5. package/lib/ecr-sync.js +3 -10
  6. package/lib/image.d.ts +5 -8
  7. package/lib/image.js +1 -1
  8. package/node_modules/aws-sdk/CHANGELOG.md +69 -1
  9. package/node_modules/aws-sdk/README.md +1 -1
  10. package/node_modules/aws-sdk/apis/appconfig-2019-10-09.min.json +3 -1
  11. package/node_modules/aws-sdk/apis/appconfigdata-2021-11-11.min.json +11 -11
  12. package/node_modules/aws-sdk/apis/appflow-2020-08-23.min.json +677 -237
  13. package/node_modules/aws-sdk/apis/appflow-2020-08-23.paginators.json +7 -1
  14. package/node_modules/aws-sdk/apis/apprunner-2020-05-15.min.json +171 -15
  15. package/node_modules/aws-sdk/apis/apprunner-2020-05-15.paginators.json +5 -0
  16. package/node_modules/aws-sdk/apis/athena-2017-05-18.min.json +43 -30
  17. package/node_modules/aws-sdk/apis/auditmanager-2017-07-25.min.json +5 -1
  18. package/node_modules/aws-sdk/apis/cloudformation-2010-05-15.min.json +86 -25
  19. package/node_modules/aws-sdk/apis/codeguru-reviewer-2019-09-19.waiters2.json +14 -2
  20. package/node_modules/aws-sdk/apis/comprehend-2017-11-27.min.json +167 -79
  21. package/node_modules/aws-sdk/apis/connect-2017-08-08.min.json +408 -133
  22. package/node_modules/aws-sdk/apis/connect-2017-08-08.paginators.json +12 -0
  23. package/node_modules/aws-sdk/apis/ec2-2016-11-15.min.json +122 -43
  24. package/node_modules/aws-sdk/apis/ec2-2016-11-15.paginators.json +6 -0
  25. package/node_modules/aws-sdk/apis/elasticfilesystem-2015-02-01.min.json +149 -21
  26. package/node_modules/aws-sdk/apis/es-2015-01-01.min.json +125 -49
  27. package/node_modules/aws-sdk/apis/fis-2020-12-01.min.json +136 -30
  28. package/node_modules/aws-sdk/apis/fis-2020-12-01.paginators.json +5 -0
  29. package/node_modules/aws-sdk/apis/frauddetector-2019-11-15.min.json +212 -6
  30. package/node_modules/aws-sdk/apis/frauddetector-2019-11-15.paginators.json +5 -0
  31. package/node_modules/aws-sdk/apis/fsx-2018-03-01.min.json +4 -1
  32. package/node_modules/aws-sdk/apis/guardduty-2017-11-28.min.json +352 -77
  33. package/node_modules/aws-sdk/apis/kafka-2018-11-14.min.json +114 -94
  34. package/node_modules/aws-sdk/apis/kendra-2019-02-03.min.json +80 -55
  35. package/node_modules/aws-sdk/apis/lakeformation-2017-03-31.min.json +0 -1
  36. package/node_modules/aws-sdk/apis/mediaconvert-2017-08-29.min.json +148 -127
  37. package/node_modules/aws-sdk/apis/mediatailor-2018-04-23.min.json +79 -51
  38. package/node_modules/aws-sdk/apis/meteringmarketplace-2016-01-14.min.json +2 -1
  39. package/node_modules/aws-sdk/apis/opensearch-2021-01-01.min.json +125 -49
  40. package/node_modules/aws-sdk/apis/personalize-2018-05-22.min.json +3 -0
  41. package/node_modules/aws-sdk/apis/robomaker-2018-06-29.min.json +135 -45
  42. package/node_modules/aws-sdk/apis/s3control-2018-08-20.min.json +152 -52
  43. package/node_modules/aws-sdk/apis/sagemaker-2017-07-24.min.json +131 -123
  44. package/node_modules/aws-sdk/apis/secretsmanager-2017-10-17.min.json +15 -10
  45. package/node_modules/aws-sdk/apis/securityhub-2018-10-26.min.json +47 -33
  46. package/node_modules/aws-sdk/apis/synthetics-2017-10-11.min.json +11 -3
  47. package/node_modules/aws-sdk/apis/transcribe-2017-10-26.min.json +44 -40
  48. package/node_modules/aws-sdk/clients/amplify.d.ts +7 -7
  49. package/node_modules/aws-sdk/clients/appconfig.d.ts +13 -13
  50. package/node_modules/aws-sdk/clients/appconfigdata.d.ts +18 -18
  51. package/node_modules/aws-sdk/clients/appflow.d.ts +611 -3
  52. package/node_modules/aws-sdk/clients/apprunner.d.ts +179 -12
  53. package/node_modules/aws-sdk/clients/athena.d.ts +31 -8
  54. package/node_modules/aws-sdk/clients/auditmanager.d.ts +2 -2
  55. package/node_modules/aws-sdk/clients/cloudformation.d.ts +407 -264
  56. package/node_modules/aws-sdk/clients/codegurureviewer.d.ts +6 -5
  57. package/node_modules/aws-sdk/clients/cognitoidentityserviceprovider.d.ts +287 -287
  58. package/node_modules/aws-sdk/clients/comprehend.d.ts +138 -0
  59. package/node_modules/aws-sdk/clients/connect.d.ts +327 -10
  60. package/node_modules/aws-sdk/clients/costexplorer.d.ts +17 -17
  61. package/node_modules/aws-sdk/clients/dynamodb.d.ts +5 -5
  62. package/node_modules/aws-sdk/clients/ebs.d.ts +6 -6
  63. package/node_modules/aws-sdk/clients/ec2.d.ts +124 -10
  64. package/node_modules/aws-sdk/clients/efs.d.ts +131 -4
  65. package/node_modules/aws-sdk/clients/elasticache.d.ts +3 -3
  66. package/node_modules/aws-sdk/clients/emr.d.ts +14 -14
  67. package/node_modules/aws-sdk/clients/es.d.ts +97 -0
  68. package/node_modules/aws-sdk/clients/eventbridge.d.ts +8 -8
  69. package/node_modules/aws-sdk/clients/fis.d.ts +142 -22
  70. package/node_modules/aws-sdk/clients/frauddetector.d.ts +308 -0
  71. package/node_modules/aws-sdk/clients/fsx.d.ts +15 -11
  72. package/node_modules/aws-sdk/clients/glue.d.ts +7 -7
  73. package/node_modules/aws-sdk/clients/guardduty.d.ts +309 -44
  74. package/node_modules/aws-sdk/clients/iot.d.ts +1 -1
  75. package/node_modules/aws-sdk/clients/kafka.d.ts +19 -1
  76. package/node_modules/aws-sdk/clients/kendra.d.ts +95 -59
  77. package/node_modules/aws-sdk/clients/lakeformation.d.ts +1 -1
  78. package/node_modules/aws-sdk/clients/marketplacemetering.d.ts +17 -12
  79. package/node_modules/aws-sdk/clients/mediaconvert.d.ts +40 -6
  80. package/node_modules/aws-sdk/clients/mediatailor.d.ts +11 -0
  81. package/node_modules/aws-sdk/clients/opensearch.d.ts +97 -0
  82. package/node_modules/aws-sdk/clients/personalize.d.ts +7 -3
  83. package/node_modules/aws-sdk/clients/rbin.d.ts +41 -41
  84. package/node_modules/aws-sdk/clients/rds.d.ts +17 -17
  85. package/node_modules/aws-sdk/clients/robomaker.d.ts +30 -30
  86. package/node_modules/aws-sdk/clients/route53recoveryreadiness.d.ts +275 -230
  87. package/node_modules/aws-sdk/clients/s3control.d.ts +137 -10
  88. package/node_modules/aws-sdk/clients/sagemaker.d.ts +27 -7
  89. package/node_modules/aws-sdk/clients/secretsmanager.d.ts +62 -48
  90. package/node_modules/aws-sdk/clients/securityhub.d.ts +15 -0
  91. package/node_modules/aws-sdk/clients/ssmincidents.d.ts +1 -1
  92. package/node_modules/aws-sdk/clients/synthetics.d.ts +15 -5
  93. package/node_modules/aws-sdk/clients/transcribeservice.d.ts +6 -0
  94. package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +35 -28
  95. package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +73 -66
  96. package/node_modules/aws-sdk/dist/aws-sdk.js +1048 -371
  97. package/node_modules/aws-sdk/dist/aws-sdk.min.js +90 -90
  98. package/node_modules/aws-sdk/lib/core.js +1 -1
  99. package/node_modules/aws-sdk/lib/dynamodb/document_client.d.ts +1 -1
  100. package/node_modules/aws-sdk/lib/param_validator.js +2 -0
  101. package/node_modules/aws-sdk/package.json +2 -2
  102. package/node_modules/jmespath/jmespath.js +32 -27
  103. package/node_modules/jmespath/package.json +2 -7
  104. package/package.json +3 -3
  105. package/releasetag.txt +1 -1
  106. package/version.txt +1 -1
  107. package/node_modules/jmespath/.eslintrc +0 -10
  108. package/node_modules/jmespath/.npmignore +0 -1
  109. package/node_modules/jmespath/.travis.yml +0 -6
  110. package/node_modules/jmespath/BASELINE +0 -15
  111. package/node_modules/jmespath/Gruntfile.js +0 -36
  112. package/node_modules/jmespath/g.sh +0 -5
  113. package/node_modules/jmespath/index.html +0 -93
  114. package/node_modules/jmespath/james.html +0 -7
  115. package/node_modules/jmespath/l.js +0 -189
  116. package/node_modules/jmespath/perf.js +0 -33
  117. package/node_modules/jmespath/reservedWords.json +0 -4
  118. package/node_modules/jmespath/test/compliance/basic.json +0 -96
  119. package/node_modules/jmespath/test/compliance/boolean.json +0 -257
  120. package/node_modules/jmespath/test/compliance/current.json +0 -25
  121. package/node_modules/jmespath/test/compliance/escape.json +0 -46
  122. package/node_modules/jmespath/test/compliance/filters.json +0 -468
  123. package/node_modules/jmespath/test/compliance/functions.json +0 -825
  124. package/node_modules/jmespath/test/compliance/identifiers.json +0 -1377
  125. package/node_modules/jmespath/test/compliance/indices.json +0 -346
  126. package/node_modules/jmespath/test/compliance/literal.json +0 -190
  127. package/node_modules/jmespath/test/compliance/multiselect.json +0 -393
  128. package/node_modules/jmespath/test/compliance/pipe.json +0 -131
  129. package/node_modules/jmespath/test/compliance/slice.json +0 -187
  130. package/node_modules/jmespath/test/compliance/syntax.json +0 -616
  131. package/node_modules/jmespath/test/compliance/unicode.json +0 -38
  132. package/node_modules/jmespath/test/compliance/wildcard.json +0 -460
  133. package/node_modules/jmespath/test/compliance.js +0 -56
  134. package/node_modules/jmespath/test/jmespath.js +0 -217
@@ -20,7 +20,7 @@ AWS.util.update(AWS, {
20
20
  /**
21
21
  * @constant
22
22
  */
23
- VERSION: '2.1060.0',
23
+ VERSION: '2.1072.0',
24
24
 
25
25
  /**
26
26
  * @api private
@@ -1840,7 +1840,7 @@ export namespace DocumentClient {
1840
1840
  export type PartiQLStatement = string;
1841
1841
  export interface PointInTimeRecoveryDescription {
1842
1842
  /**
1843
- * The current state of point in time recovery: ENABLING - Point in time recovery is being enabled. ENABLED - Point in time recovery is enabled. DISABLED - Point in time recovery is disabled.
1843
+ * The current state of point in time recovery: ENABLED - Point in time recovery is enabled. DISABLED - Point in time recovery is disabled.
1844
1844
  */
1845
1845
  PointInTimeRecoveryStatus?: PointInTimeRecoveryStatus;
1846
1846
  /**
@@ -53,6 +53,8 @@ AWS.ParamValidator = AWS.util.inherit({
53
53
  validateStructure: function validateStructure(shape, params, context) {
54
54
  this.validateType(params, context, ['object'], 'structure');
55
55
 
56
+ if (shape.isDocument) return true;
57
+
56
58
  var paramName;
57
59
  for (var i = 0; shape.required && i < shape.required.length; i++) {
58
60
  paramName = shape.required[i];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aws-sdk",
3
3
  "description": "AWS SDK for JavaScript",
4
- "version": "2.1060.0",
4
+ "version": "2.1072.0",
5
5
  "author": {
6
6
  "name": "Amazon Web Services",
7
7
  "email": "",
@@ -44,7 +44,7 @@
44
44
  "buffer": "4.9.2",
45
45
  "events": "1.1.1",
46
46
  "ieee754": "1.1.13",
47
- "jmespath": "0.15.0",
47
+ "jmespath": "0.16.0",
48
48
  "querystring": "0.2.0",
49
49
  "sax": "1.2.1",
50
50
  "url": "0.10.3",
@@ -140,6 +140,18 @@
140
140
  var TYPE_NULL = 7;
141
141
  var TYPE_ARRAY_NUMBER = 8;
142
142
  var TYPE_ARRAY_STRING = 9;
143
+ var TYPE_NAME_TABLE = {
144
+ 0: 'number',
145
+ 1: 'any',
146
+ 2: 'string',
147
+ 3: 'array',
148
+ 4: 'object',
149
+ 5: 'boolean',
150
+ 6: 'expression',
151
+ 7: 'null',
152
+ 8: 'Array<number>',
153
+ 9: 'Array<string>'
154
+ };
143
155
 
144
156
  var TOK_EOF = "EOF";
145
157
  var TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier";
@@ -551,10 +563,8 @@
551
563
  var node = {type: "Field", name: token.value};
552
564
  if (this._lookahead(0) === TOK_LPAREN) {
553
565
  throw new Error("Quoted identifier not allowed for function names.");
554
- } else {
555
- return node;
556
566
  }
557
- break;
567
+ return node;
558
568
  case TOK_NOT:
559
569
  right = this.expression(bindingPower.Not);
560
570
  return {type: "NotExpression", children: [right]};
@@ -588,10 +598,8 @@
588
598
  right = this._parseProjectionRHS(bindingPower.Star);
589
599
  return {type: "Projection",
590
600
  children: [{type: "Identity"}, right]};
591
- } else {
592
- return this._parseMultiselectList();
593
601
  }
594
- break;
602
+ return this._parseMultiselectList();
595
603
  case TOK_CURRENT:
596
604
  return {type: TOK_CURRENT};
597
605
  case TOK_EXPREF:
@@ -623,13 +631,11 @@
623
631
  if (this._lookahead(0) !== TOK_STAR) {
624
632
  right = this._parseDotRHS(rbp);
625
633
  return {type: "Subexpression", children: [left, right]};
626
- } else {
627
- // Creating a projection.
628
- this._advance();
629
- right = this._parseProjectionRHS(rbp);
630
- return {type: "ValueProjection", children: [left, right]};
631
634
  }
632
- break;
635
+ // Creating a projection.
636
+ this._advance();
637
+ right = this._parseProjectionRHS(rbp);
638
+ return {type: "ValueProjection", children: [left, right]};
633
639
  case TOK_PIPE:
634
640
  right = this.expression(bindingPower.Pipe);
635
641
  return {type: TOK_PIPE, children: [left, right]};
@@ -683,13 +689,11 @@
683
689
  if (token.type === TOK_NUMBER || token.type === TOK_COLON) {
684
690
  right = this._parseIndexExpression();
685
691
  return this._projectIfSlice(left, right);
686
- } else {
687
- this._match(TOK_STAR);
688
- this._match(TOK_RBRACKET);
689
- right = this._parseProjectionRHS(bindingPower.Star);
690
- return {type: "Projection", children: [left, right]};
691
692
  }
692
- break;
693
+ this._match(TOK_STAR);
694
+ this._match(TOK_RBRACKET);
695
+ right = this._parseProjectionRHS(bindingPower.Star);
696
+ return {type: "Projection", children: [left, right]};
693
697
  default:
694
698
  this._errorToken(this._lookaheadToken(0));
695
699
  }
@@ -866,19 +870,15 @@
866
870
  var matched, current, result, first, second, field, left, right, collected, i;
867
871
  switch (node.type) {
868
872
  case "Field":
869
- if (value === null ) {
870
- return null;
871
- } else if (isObject(value)) {
873
+ if (value !== null && isObject(value)) {
872
874
  field = value[node.name];
873
875
  if (field === undefined) {
874
876
  return null;
875
877
  } else {
876
878
  return field;
877
879
  }
878
- } else {
879
- return null;
880
880
  }
881
- break;
881
+ return null;
882
882
  case "Subexpression":
883
883
  result = this.visit(node.children[0], value);
884
884
  for (i = 1; i < node.children.length; i++) {
@@ -1249,11 +1249,16 @@
1249
1249
  }
1250
1250
  }
1251
1251
  if (!typeMatched) {
1252
+ var expected = currentSpec
1253
+ .map(function(typeIdentifier) {
1254
+ return TYPE_NAME_TABLE[typeIdentifier];
1255
+ })
1256
+ .join(',');
1252
1257
  throw new Error("TypeError: " + name + "() " +
1253
1258
  "expected argument " + (i + 1) +
1254
- " to be type " + currentSpec +
1255
- " but received type " + actualType +
1256
- " instead.");
1259
+ " to be type " + expected +
1260
+ " but received type " +
1261
+ TYPE_NAME_TABLE[actualType] + " instead.");
1257
1262
  }
1258
1263
  }
1259
1264
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jmespath",
3
3
  "description": "JMESPath implementation in javascript",
4
- "version": "0.15.0",
4
+ "version": "0.16.0",
5
5
  "author": {
6
6
  "name": "James Saryerwinnie",
7
7
  "email": "js@jamesls.com",
@@ -32,12 +32,7 @@
32
32
  "url": "http://github.com/jmespath/jmespath.js/issues",
33
33
  "mail": ""
34
34
  },
35
- "licenses": [
36
- {
37
- "type": "Apache 2.0",
38
- "url": "http://github.com/jmespath/jmespath.js/raw/master/LICENSE"
39
- }
40
- ],
35
+ "license": "Apache-2.0",
41
36
  "keywords": [
42
37
  "jmespath",
43
38
  "jsonpath",
package/package.json CHANGED
@@ -39,7 +39,7 @@
39
39
  "@types/node": "^14",
40
40
  "@typescript-eslint/eslint-plugin": "^5",
41
41
  "@typescript-eslint/parser": "^5",
42
- "aws-cdk-lib": "2.0.0",
42
+ "aws-cdk-lib": "2.12.0",
43
43
  "constructs": "10.0.5",
44
44
  "esbuild": "^0.14.11",
45
45
  "eslint": "^8",
@@ -61,7 +61,7 @@
61
61
  "typescript": "^4.5.4"
62
62
  },
63
63
  "peerDependencies": {
64
- "aws-cdk-lib": "2.0.0",
64
+ "aws-cdk-lib": "2.12.0",
65
65
  "constructs": "^10.0.5"
66
66
  },
67
67
  "dependencies": {
@@ -81,7 +81,7 @@
81
81
  },
82
82
  "main": "lib/index.js",
83
83
  "license": "Apache-2.0",
84
- "version": "0.5.25",
84
+ "version": "0.5.26",
85
85
  "jest": {
86
86
  "testMatch": [
87
87
  "<rootDir>/src/**/__tests__/**/*.ts?(x)",
package/releasetag.txt CHANGED
@@ -1 +1 @@
1
- v0.5.25
1
+ v0.5.26
package/version.txt CHANGED
@@ -1 +1 @@
1
- 0.5.25
1
+ 0.5.26
@@ -1,10 +0,0 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "node": true
5
- },
6
- "globals": {
7
- "toString": true,
8
- "hasOwnProperty": true
9
- }
10
- }
@@ -1 +0,0 @@
1
- node_modules
@@ -1,6 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - "0.12"
4
- - "0.11"
5
- - "0.10"
6
- - "iojs"
@@ -1,15 +0,0 @@
1
- master:
2
-
3
- Mean time: 0.002530msec Parser#single_expr x 395,306 ops/sec ±1.89% (79 runs sampled)
4
- Mean time: 0.005492msec Parser#single_subexpr x 182,084 ops/sec ±1.99% (84 runs sampled)
5
- Mean time: 0.126803msec Parser#deeply_nested_50 x 7,886 ops/sec ±2.44% (80 runs sampled)
6
- Mean time: 0.166790msec Parser#deeply_nested_50_index x 5,996 ops/sec ±5.08% (75 runs sampled)
7
- Mean time: 0.008347msec Parser#basic_list_projection x 119,798 ops/sec ±2.33% (79 runs sampled)
8
-
9
-
10
-
11
- Mean time: 0.002779msec Parser#single_expr x 359,839 ops/sec ±4.15% (80 runs sampled)
12
- Mean time: 0.005235msec Parser#single_subexpr x 191,026 ops/sec ±2.62% (78 runs sampled)
13
- Mean time: 0.104357msec Parser#deeply_nested_50 x 9,582 ops/sec ±4.34% (72 runs sampled)
14
- Mean time: 0.178837msec Parser#deeply_nested_50_index x 5,592 ops/sec ±3.35% (77 runs sampled)
15
- Mean time: 0.009614msec Parser#basic_list_projection x 104,012 ops/sec ±2.97% (79 runs sampled)
@@ -1,36 +0,0 @@
1
- module.exports = function(grunt) {
2
-
3
- // Project configuration.
4
- grunt.initConfig({
5
- pkg: grunt.file.readJSON('package.json'),
6
- uglify: {
7
- options: {
8
- banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
9
- mangleProperties: {regex: /^_/}
10
- },
11
- build: {
12
- src: '<%= pkg.name %>.js',
13
- dest: 'artifacts/<%= pkg.name %>.min.js'
14
- }
15
- },
16
- jshint: {
17
- ignore_warning: {
18
- options: {
19
- '-W083': true
20
- },
21
- src: ['jmespath.js', 'test/*.js', 'Gruntfile.js']
22
- }
23
- },
24
- eslint: {
25
- target: ['jmespath.js']
26
- }
27
- });
28
-
29
- grunt.loadNpmTasks('grunt-contrib-uglify');
30
- grunt.loadNpmTasks('grunt-contrib-jshint');
31
- grunt.loadNpmTasks('grunt-eslint');
32
-
33
- // Default task(s).
34
- grunt.registerTask('default', ['uglify', 'jshint', 'eslint']);
35
-
36
- };
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
- grunt
3
- uglifyjs artifacts/jmespath.min.js -b -o /tmp/jmespath.min.js
4
- uglifyjs artifacts/jmespath.min.js -b -o ~/Source/jmespath.site/docs/_build/html/_static/js/jmespath.min.js
5
- #cp artifacts/jmespath.min.js ~/Source/jmespath.site/docs/_build/html/_static/js/
@@ -1,93 +0,0 @@
1
- <!doctype html>
2
- <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
3
- <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
4
- <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
5
- <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
6
- <head>
7
- <meta charset="utf-8">
8
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
9
- <title>JMESPath Demo</title>
10
- <meta name="description" content="JMESPath Demo">
11
- <!--
12
- <link rel="stylesheet" href="css/bootstrap.min.css">
13
- <link rel="stylesheet" href="css/style.css">
14
- -->
15
- <script src="artifacts/jmespath.min.js"></script>
16
- </head>
17
- <body>
18
- <div class="container-fluid">
19
- <div class="hero-unit">
20
- <h1>JSONPath Online Evaluator</h1>
21
- <div id="info">
22
- <p>Author: <a href="http://ashphy.com/">Kazuki Hamasaki</a> [ashphy@ashphy.com]</p>
23
- <p>This evaluator uses <a href="http://goessner.net/articles/JsonPath/">JSONPath - XPath for JSON</a></p>
24
- </div>
25
- </div>
26
- <div class="row-fluid">
27
- <div class="span6">
28
- <h2>Inputs</h2>
29
- <form>
30
- <label>JSONPath Syntax</label>
31
- <input type="text" placeholder="Put JSONPath syntax" value="$.phoneNumbers[:1].type" />
32
- <span class="help-block">Example '$.phoneNumbers[*].type' See also <a href="http://goessner.net/articles/JsonPath/index.html#e2">JSONPath expressions</a></span>
33
- <label>JSON</label>
34
- <textarea rows="30" cols="80">
35
- {
36
- "firstName": "John",
37
- "lastName" : "doe",
38
- "age" : 26,
39
- "address" :
40
- {
41
- "streetAddress": "naist street",
42
- "city" : "Nara",
43
- "postalCode" : "630-0192"
44
- },
45
- "phoneNumbers":
46
- [
47
- {
48
- "type" : "iPhone",
49
- "number": "0123-4567-8888"
50
- },
51
- {
52
- "type" : "home",
53
- "number": "0123-4567-8910"
54
- }
55
- ]
56
- }
57
- </textarea>
58
- </form>
59
- </div>
60
- <div class="span6 ">
61
- <h2>Evaluation Results</h2>
62
- <pre class="result">false</pre>
63
- </div>
64
- </div>
65
- </div>
66
-
67
- <!-- JavaScript at the bottom for fast page loading: http://developer.yahoo.com/performance/rules.html#js_bottom -->
68
-
69
- <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
70
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
71
- <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.7.2.min.js"><\/script>')</script>
72
- <script src="js/vendor/jquery.textchange.min.js"></script>
73
-
74
- <script>
75
- var evaluate = function(event, previousText){
76
- var query = $("input").val();
77
- var json = JSON.parse($("textarea").val().replace(/(\r\n|\n|\r)/gm,""));
78
- var result = jsonPath(json, query);
79
- $(".result").empty();
80
- if(result) {
81
- $(".result").append(dump(result));
82
- }
83
- }
84
-
85
- $(document).ready(function(){
86
- $('input').bind('textchange', evaluate);
87
- $('textarea').bind('textchange', evaluate);
88
- evaluate();
89
- });
90
- </script>
91
- </body>
92
- </html>
93
-
@@ -1,7 +0,0 @@
1
- <html>
2
- <head>
3
- <script src="artifacts/jmespath.min.js"></script>
4
- </head>
5
- <body>
6
- </body>
7
- </html>
@@ -1,189 +0,0 @@
1
- 'use strict';
2
-
3
- var Lexer = exports.Lexer = function() {
4
- this.pos = 0;
5
- this.buf = null;
6
- this.buflen = 0;
7
-
8
- // Operator table, mapping operator -> token name
9
- this.optable = {
10
- '+': 'PLUS',
11
- '-': 'MINUS',
12
- '*': 'MULTIPLY',
13
- '.': 'PERIOD',
14
- '\\': 'BACKSLASH',
15
- ':': 'COLON',
16
- '%': 'PERCENT',
17
- '|': 'PIPE',
18
- '!': 'EXCLAMATION',
19
- '?': 'QUESTION',
20
- '#': 'POUND',
21
- '&': 'AMPERSAND',
22
- ';': 'SEMI',
23
- ',': 'COMMA',
24
- '(': 'L_PAREN',
25
- ')': 'R_PAREN',
26
- '<': 'L_ANG',
27
- '>': 'R_ANG',
28
- '{': 'L_BRACE',
29
- '}': 'R_BRACE',
30
- '[': 'L_BRACKET',
31
- ']': 'R_BRACKET',
32
- '=': 'EQUALS'
33
- };
34
- }
35
-
36
- // Initialize the Lexer's buffer. This resets the lexer's internal
37
- // state and subsequent tokens will be returned starting with the
38
- // beginning of the new buffer.
39
- Lexer.prototype.input = function(buf) {
40
- this.pos = 0;
41
- this.buf = buf;
42
- this.buflen = buf.length;
43
- }
44
-
45
- // Get the next token from the current buffer. A token is an object with
46
- // the following properties:
47
- // - name: name of the pattern that this token matched (taken from rules).
48
- // - value: actual string value of the token.
49
- // - pos: offset in the current buffer where the token starts.
50
- //
51
- // If there are no more tokens in the buffer, returns null. In case of
52
- // an error throws Error.
53
- Lexer.prototype.token = function() {
54
- this._skipnontokens();
55
- if (this.pos >= this.buflen) {
56
- return null;
57
- }
58
-
59
- // The char at this.pos is part of a real token. Figure out which.
60
- var c = this.buf.charAt(this.pos);
61
-
62
- // '/' is treated specially, because it starts a comment if followed by
63
- // another '/'. If not followed by another '/', it's the DIVIDE
64
- // operator.
65
- if (c === '/') {
66
- var next_c = this.buf.charAt(this.pos + 1);
67
- if (next_c === '/') {
68
- return this._process_comment();
69
- } else {
70
- return {name: 'DIVIDE', value: '/', pos: this.pos++};
71
- }
72
- } else {
73
- // Look it up in the table of operators
74
- var op = this.optable[c];
75
- if (op !== undefined) {
76
- return {name: op, value: c, pos: this.pos++};
77
- } else {
78
- // Not an operator - so it's the beginning of another token.
79
- if (Lexer._isalpha(c)) {
80
- return this._process_identifier();
81
- } else if (Lexer._isdigit(c)) {
82
- return this._process_number();
83
- } else if (c === '"') {
84
- return this._process_quote();
85
- } else {
86
- throw Error('Token error at ' + this.pos);
87
- }
88
- }
89
- }
90
- }
91
-
92
- Lexer._isnewline = function(c) {
93
- return c === '\r' || c === '\n';
94
- }
95
-
96
- Lexer._isdigit = function(c) {
97
- return c >= '0' && c <= '9';
98
- }
99
-
100
- Lexer._isalpha = function(c) {
101
- return (c >= 'a' && c <= 'z') ||
102
- (c >= 'A' && c <= 'Z') ||
103
- c === '_' || c === '$';
104
- }
105
-
106
- Lexer._isalphanum = function(c) {
107
- return (c >= 'a' && c <= 'z') ||
108
- (c >= 'A' && c <= 'Z') ||
109
- (c >= '0' && c <= '9') ||
110
- c === '_' || c === '$';
111
- }
112
-
113
- Lexer.prototype._process_number = function() {
114
- var endpos = this.pos + 1;
115
- while (endpos < this.buflen &&
116
- Lexer._isdigit(this.buf.charAt(endpos))) {
117
- endpos++;
118
- }
119
-
120
- var tok = {
121
- name: 'NUMBER',
122
- value: this.buf.substring(this.pos, endpos),
123
- pos: this.pos
124
- };
125
- this.pos = endpos;
126
- return tok;
127
- }
128
-
129
- Lexer.prototype._process_comment = function() {
130
- var endpos = this.pos + 2;
131
- // Skip until the end of the line
132
- var c = this.buf.charAt(this.pos + 2);
133
- while (endpos < this.buflen &&
134
- !Lexer._isnewline(this.buf.charAt(endpos))) {
135
- endpos++;
136
- }
137
-
138
- var tok = {
139
- name: 'COMMENT',
140
- value: this.buf.substring(this.pos, endpos),
141
- pos: this.pos
142
- };
143
- this.pos = endpos + 1;
144
- return tok;
145
- }
146
-
147
- Lexer.prototype._process_identifier = function() {
148
- var endpos = this.pos + 1;
149
- while (endpos < this.buflen &&
150
- Lexer._isalphanum(this.buf.charAt(endpos))) {
151
- endpos++;
152
- }
153
-
154
- var tok = {
155
- name: 'IDENTIFIER',
156
- value: this.buf.substring(this.pos, endpos),
157
- pos: this.pos
158
- };
159
- this.pos = endpos;
160
- return tok;
161
- }
162
-
163
- Lexer.prototype._process_quote = function() {
164
- // this.pos points at the opening quote. Find the ending quote.
165
- var end_index = this.buf.indexOf('"', this.pos + 1);
166
-
167
- if (end_index === -1) {
168
- throw Error('Unterminated quote at ' + this.pos);
169
- } else {
170
- var tok = {
171
- name: 'QUOTE',
172
- value: this.buf.substring(this.pos, end_index + 1),
173
- pos: this.pos
174
- };
175
- this.pos = end_index + 1;
176
- return tok;
177
- }
178
- }
179
-
180
- Lexer.prototype._skipnontokens = function() {
181
- while (this.pos < this.buflen) {
182
- var c = this.buf.charAt(this.pos);
183
- if (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
184
- this.pos++;
185
- } else {
186
- break;
187
- }
188
- }
189
- }
@@ -1,33 +0,0 @@
1
- var jmespath = require('./jmespath')
2
- var Benchmark = require('benchmark');
3
- var suite = new Benchmark.Suite;
4
-
5
- // add tests
6
- suite.add('Parser#single_expr', function() {
7
- jmespath.compile("foo");
8
- })
9
- .add('Parser#single_subexpr', function() {
10
- jmespath.compile("foo.bar");
11
- })
12
- .add('Parser#deeply_nested_50', function() {
13
- jmespath.compile("j49.j48.j47.j46.j45.j44.j43.j42.j41.j40.j39.j38.j37.j36.j35.j34.j33.j32.j31.j30.j29.j28.j27.j26.j25.j24.j23.j22.j21.j20.j19.j18.j17.j16.j15.j14.j13.j12.j11.j10.j9.j8.j7.j6.j5.j4.j3.j2.j1.j0");
14
-
15
- })
16
- .add('Parser#deeply_nested_50_index', function() {
17
- jmespath.compile("[49][48][47][46][45][44][43][42][41][40][39][38][37][36][35][34][33][32][31][30][29][28][27][26][25][24][23][22][21][20][19][18][17][16][15][14][13][12][11][10][9][8][7][6][5][4][3][2][1][0]");
18
- })
19
- .add('Parser#basic_list_projection', function() {
20
- jmespath.compile("foo[*].bar");
21
- })
22
- .on('cycle', function(event) {
23
- var bench = event.target;
24
- var mean = bench.stats.mean * 1000;
25
- var variance = bench.stats.variance * 1000000;
26
- var result = 'Mean time: ' + mean.toFixed(6) + 'msec ';
27
- result += event.target.toString();
28
- console.log(result);
29
- })
30
- .on('complete', function() {
31
- })
32
- // run async
33
- .run({ 'async': false });
@@ -1,4 +0,0 @@
1
- {
2
- "vars": [ "define", "require", "exports"],
3
- "props": ["compile", "search", "tokenize", "jmespath", "parse", "stringify", "prototype", "length"]
4
- }