@nmshd/runtime 2.5.2 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -548,10 +548,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
548
548
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
549
549
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
550
550
  exports.buildInformation = {
551
- version: "2.5.2",
552
- build: "156",
553
- date: "2023-07-13T14:45:52+00:00",
554
- commit: "cfd1e4319bd78295a7ea7e73d9af4365b0fbaf0c",
551
+ version: "2.5.4",
552
+ build: "159",
553
+ date: "2023-07-26T18:50:31+00:00",
554
+ commit: "8e081c8f634f6bc11cd25424a6fc7bd33255239a",
555
555
  dependencies: {"@js-soft/docdb-querytranslator":"1.1.0","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.8","@js-soft/ts-utils":"^2.3.1","@nmshd/consumption":"3.2.2","@nmshd/content":"2.3.6","@nmshd/crypto":"2.0.4","@nmshd/transport":"2.0.5","ajv":"^8.12.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.3.0","qrcode":"1.5.3","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
556
556
  libraries: {
557
557
  serval: ts_serval_1.buildInformation,
@@ -1476,7 +1476,7 @@ let DataViewExpander = exports.DataViewExpander = class DataViewExpander {
1476
1476
  async expandRelationshipAttributeQuery(query) {
1477
1477
  const valueType = query.attributeCreationHints.valueType;
1478
1478
  let name = "i18n://dvo.attributeQuery.name.RelationshipAttributeQuery";
1479
- let description = "i18n://dvo.attributeQuery.name.RelationshipAttributeQuery";
1479
+ let description = "i18n://dvo.attributeQuery.description.RelationshipAttributeQuery";
1480
1480
  if (query.attributeCreationHints.title) {
1481
1481
  name = query.attributeCreationHints.title;
1482
1482
  }
@@ -1505,7 +1505,7 @@ let DataViewExpander = exports.DataViewExpander = class DataViewExpander {
1505
1505
  }
1506
1506
  async expandThirdPartyRelationshipAttributeQuery(query) {
1507
1507
  const name = "i18n://dvo.attributeQuery.name.ThirdPartyRelationshipAttributeQuery";
1508
- const description = "i18n://dvo.attributeQuery.name.ThirdPartyRelationshipAttributeQuery";
1508
+ const description = "i18n://dvo.attributeQuery.description.ThirdPartyRelationshipAttributeQuery";
1509
1509
  const thirdParty = await Promise.all(query.thirdParty.map((tp) => this.expandAddress(tp)));
1510
1510
  return {
1511
1511
  type: "ThirdPartyRelationshipAttributeQueryDVO",
@@ -1522,7 +1522,7 @@ let DataViewExpander = exports.DataViewExpander = class DataViewExpander {
1522
1522
  }
1523
1523
  expandIQLQuery(query) {
1524
1524
  const name = "i18n://dvo.attributeQuery.name.IQLQuery";
1525
- const description = "i18n://dvo.attributeQuery.name.IQLQuery";
1525
+ const description = "i18n://dvo.attributeQuery.description.IQLQuery";
1526
1526
  return {
1527
1527
  type: "IQLQueryDVO",
1528
1528
  id: "",
@@ -1616,11 +1616,17 @@ let DataViewExpander = exports.DataViewExpander = class DataViewExpander {
1616
1616
  async processIQLQuery(query) {
1617
1617
  const matchedAttributeDTOResult = await this.consumption.attributes.executeIQLQuery({ query });
1618
1618
  const matchedAttributeDVOs = await this.expandLocalAttributeDTOs(matchedAttributeDTOResult.value);
1619
+ const { valueType, renderHints, valueHints } = matchedAttributeDVOs.every((dvo) => dvo.valueType === matchedAttributeDVOs[0].valueType)
1620
+ ? { valueType: matchedAttributeDVOs[0].valueType, renderHints: matchedAttributeDVOs[0].renderHints, valueHints: matchedAttributeDVOs[0].valueHints }
1621
+ : { valueType: undefined, renderHints: undefined, valueHints: undefined };
1619
1622
  return {
1620
1623
  ...this.expandIQLQuery(query),
1621
1624
  type: "ProcessedIQLQueryDVO",
1622
1625
  results: matchedAttributeDVOs,
1623
- isProcessed: true
1626
+ isProcessed: true,
1627
+ valueType,
1628
+ renderHints,
1629
+ valueHints
1624
1630
  };
1625
1631
  }
1626
1632
  async expandIdentityAttribute(attribute, attributeInstance) {
@@ -3677,7 +3683,7 @@ exports.AttributesFacade = void 0;
3677
3683
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
3678
3684
  const useCases_1 = __webpack_require__(/*! ../../../useCases */ "./dist/useCases/index.js");
3679
3685
  let AttributesFacade = exports.AttributesFacade = class AttributesFacade {
3680
- constructor(createAttributeUseCase, createSharedAttributeCopyUseCase, deleteAttributeUseCase, getPeerAttributesUseCase, getSharedToPeerAttributesUseCase, getAttributeUseCase, getAttributesUseCase, succeedAttributeUseCase, updateAttributeUseCase, executeIdentityAttributeQueryUseCase, executeRelationshipAttributeQueryUseCase, executeThirdPartyRelationshipAttributeQueryUseCase, executeIQLQueryUseCase, shareAttributeUseCase) {
3686
+ constructor(createAttributeUseCase, createSharedAttributeCopyUseCase, deleteAttributeUseCase, getPeerAttributesUseCase, getSharedToPeerAttributesUseCase, getAttributeUseCase, getAttributesUseCase, succeedAttributeUseCase, updateAttributeUseCase, executeIdentityAttributeQueryUseCase, executeRelationshipAttributeQueryUseCase, executeThirdPartyRelationshipAttributeQueryUseCase, executeIQLQueryUseCase, validateIQLQueryUseCase, shareAttributeUseCase) {
3681
3687
  this.createAttributeUseCase = createAttributeUseCase;
3682
3688
  this.createSharedAttributeCopyUseCase = createSharedAttributeCopyUseCase;
3683
3689
  this.deleteAttributeUseCase = deleteAttributeUseCase;
@@ -3691,6 +3697,7 @@ let AttributesFacade = exports.AttributesFacade = class AttributesFacade {
3691
3697
  this.executeRelationshipAttributeQueryUseCase = executeRelationshipAttributeQueryUseCase;
3692
3698
  this.executeThirdPartyRelationshipAttributeQueryUseCase = executeThirdPartyRelationshipAttributeQueryUseCase;
3693
3699
  this.executeIQLQueryUseCase = executeIQLQueryUseCase;
3700
+ this.validateIQLQueryUseCase = validateIQLQueryUseCase;
3694
3701
  this.shareAttributeUseCase = shareAttributeUseCase;
3695
3702
  }
3696
3703
  async createAttribute(request) {
@@ -3726,6 +3733,9 @@ let AttributesFacade = exports.AttributesFacade = class AttributesFacade {
3726
3733
  async executeIQLQuery(request) {
3727
3734
  return await this.executeIQLQueryUseCase.execute(request);
3728
3735
  }
3736
+ async validateIQLQuery(request) {
3737
+ return await this.validateIQLQueryUseCase.execute(request);
3738
+ }
3729
3739
  async succeedAttribute(request) {
3730
3740
  return await this.succeedAttributeUseCase.execute(request);
3731
3741
  }
@@ -3751,6 +3761,7 @@ exports.AttributesFacade = AttributesFacade = __decorate([
3751
3761
  __param(11, typescript_ioc_1.Inject),
3752
3762
  __param(12, typescript_ioc_1.Inject),
3753
3763
  __param(13, typescript_ioc_1.Inject),
3764
+ __param(14, typescript_ioc_1.Inject),
3754
3765
  __metadata("design:paramtypes", [useCases_1.CreateAttributeUseCase,
3755
3766
  useCases_1.CreateSharedAttributeCopyUseCase,
3756
3767
  useCases_1.DeleteAttributeUseCase,
@@ -3764,6 +3775,7 @@ exports.AttributesFacade = AttributesFacade = __decorate([
3764
3775
  useCases_1.ExecuteRelationshipAttributeQueryUseCase,
3765
3776
  useCases_1.ExecuteThirdPartyRelationshipAttributeQueryUseCase,
3766
3777
  useCases_1.ExecuteIQLQueryUseCase,
3778
+ useCases_1.ValidateIQLQueryUseCase,
3767
3779
  useCases_1.ShareAttributeUseCase])
3768
3780
  ], AttributesFacade);
3769
3781
  //# sourceMappingURL=AttributesFacade.js.map
@@ -6307,8 +6319,8 @@ exports.JsonSchema = JsonSchema;
6307
6319
  "use strict";
6308
6320
 
6309
6321
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6310
- exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.LoadItemFromTruncatedReferenceRequest = exports.DownloadFileRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.ShareAttributeRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.DiscardOutgoingRequestRequest = exports.CreateOutgoingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CanCreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.GetSharedToPeerAttributesRequest = exports.GetPeerAttributesRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.ExecuteThirdPartyRelationshipAttributeQueryRequest = exports.ExecuteRelationshipAttributeQueryRequest = exports.ExecuteIQLQueryRequest = exports.ExecuteIdentityAttributeQueryRequest = exports.DeleteAttributeRequest = exports.CreateSharedAttributeCopyRequest = exports.CreateAttributeRequest = exports.GetAttributeListenerRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
6311
- exports.LoadPeerTokenRequest = exports.LoadPeerTokenViaSecretRequest = exports.LoadPeerTokenViaReferenceRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.LoadPeerRelationshipTemplateViaReferenceRequest = exports.LoadPeerRelationshipTemplateViaSecretRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateQrCodeForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.GetAttributesForRelationshipRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileValidatableRequest = exports.UploadOwnFileRequest = exports.GetOrLoadFileRequest = exports.GetOrLoadFileViaReferenceRequest = exports.GetOrLoadFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.CreateQrCodeForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = void 0;
6322
+ exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.LoadItemFromTruncatedReferenceRequest = exports.DownloadFileRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.ValidateIQLQueryRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.ShareAttributeRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.DiscardOutgoingRequestRequest = exports.CreateOutgoingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CanCreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.GetSharedToPeerAttributesRequest = exports.GetPeerAttributesRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.ExecuteThirdPartyRelationshipAttributeQueryRequest = exports.ExecuteRelationshipAttributeQueryRequest = exports.ExecuteIQLQueryRequest = exports.ExecuteIdentityAttributeQueryRequest = exports.DeleteAttributeRequest = exports.CreateSharedAttributeCopyRequest = exports.CreateAttributeRequest = exports.GetAttributeListenerRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
6323
+ exports.LoadPeerTokenRequest = exports.LoadPeerTokenViaSecretRequest = exports.LoadPeerTokenViaReferenceRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.LoadPeerRelationshipTemplateViaReferenceRequest = exports.LoadPeerRelationshipTemplateViaSecretRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateQrCodeForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.GetAttributesForRelationshipRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileValidatableRequest = exports.UploadOwnFileRequest = exports.GetOrLoadFileRequest = exports.GetOrLoadFileViaReferenceRequest = exports.GetOrLoadFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.CreateQrCodeForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = void 0;
6312
6324
  exports.LoadPeerTokenAnonymousByIdAndKeyRequest = {
6313
6325
  "$schema": "http://json-schema.org/draft-07/schema#",
6314
6326
  "$ref": "#/definitions/LoadPeerTokenAnonymousByIdAndKeyRequest",
@@ -26792,6 +26804,66 @@ exports.UpdateAttributeRequest = {
26792
26804
  }
26793
26805
  }
26794
26806
  };
26807
+ exports.ValidateIQLQueryRequest = {
26808
+ "$schema": "http://json-schema.org/draft-07/schema#",
26809
+ "$ref": "#/definitions/ValidateIQLQueryRequest",
26810
+ "definitions": {
26811
+ "ValidateIQLQueryRequest": {
26812
+ "type": "object",
26813
+ "properties": {
26814
+ "query": {
26815
+ "anyOf": [
26816
+ {
26817
+ "$ref": "#/definitions/IIQLQuery"
26818
+ },
26819
+ {
26820
+ "$ref": "#/definitions/IQLQueryJSON"
26821
+ }
26822
+ ]
26823
+ }
26824
+ },
26825
+ "required": [
26826
+ "query"
26827
+ ],
26828
+ "additionalProperties": false
26829
+ },
26830
+ "IIQLQuery": {
26831
+ "type": "object",
26832
+ "properties": {
26833
+ "queryString": {
26834
+ "type": "string"
26835
+ }
26836
+ },
26837
+ "required": [
26838
+ "queryString"
26839
+ ],
26840
+ "additionalProperties": false
26841
+ },
26842
+ "IQLQueryJSON": {
26843
+ "type": "object",
26844
+ "properties": {
26845
+ "@type": {
26846
+ "type": "string",
26847
+ "const": "IQLQuery"
26848
+ },
26849
+ "@context": {
26850
+ "type": "string"
26851
+ },
26852
+ "@version": {
26853
+ "type": "string"
26854
+ },
26855
+ "queryString": {
26856
+ "type": "string"
26857
+ }
26858
+ },
26859
+ "required": [
26860
+ "@type",
26861
+ "queryString"
26862
+ ],
26863
+ "additionalProperties": false
26864
+ }
26865
+ }
26866
+ };
26795
26867
  exports.CreateDraftRequest = {
26796
26868
  "$schema": "http://json-schema.org/draft-07/schema#",
26797
26869
  "$ref": "#/definitions/CreateDraftRequest",
@@ -29703,9 +29775,18 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
29703
29775
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
29704
29776
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
29705
29777
  const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
29778
+ let Validator = class Validator extends common_1.SchemaValidator {
29779
+ constructor(schemaRepository) {
29780
+ super(schemaRepository.getSchema("ExecuteIQLQueryRequest"));
29781
+ }
29782
+ };
29783
+ Validator = __decorate([
29784
+ __param(0, typescript_ioc_1.Inject),
29785
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
29786
+ ], Validator);
29706
29787
  let ExecuteIQLQueryUseCase = exports.ExecuteIQLQueryUseCase = class ExecuteIQLQueryUseCase extends common_1.UseCase {
29707
- constructor(attributeController) {
29708
- super();
29788
+ constructor(attributeController, validator) {
29789
+ super(validator);
29709
29790
  this.attributeController = attributeController;
29710
29791
  }
29711
29792
  async executeInternal(request) {
@@ -29716,7 +29797,8 @@ let ExecuteIQLQueryUseCase = exports.ExecuteIQLQueryUseCase = class ExecuteIQLQu
29716
29797
  };
29717
29798
  exports.ExecuteIQLQueryUseCase = ExecuteIQLQueryUseCase = __decorate([
29718
29799
  __param(0, typescript_ioc_1.Inject),
29719
- __metadata("design:paramtypes", [consumption_1.AttributesController])
29800
+ __param(1, typescript_ioc_1.Inject),
29801
+ __metadata("design:paramtypes", [consumption_1.AttributesController, Validator])
29720
29802
  ], ExecuteIQLQueryUseCase);
29721
29803
  //# sourceMappingURL=ExecuteIQLQuery.js.map
29722
29804
 
@@ -30405,6 +30487,60 @@ exports.UpdateAttributeUseCase = UpdateAttributeUseCase = __decorate([
30405
30487
 
30406
30488
  /***/ }),
30407
30489
 
30490
+ /***/ "./dist/useCases/consumption/attributes/ValidateIQLQuery.js":
30491
+ /*!******************************************************************!*\
30492
+ !*** ./dist/useCases/consumption/attributes/ValidateIQLQuery.js ***!
30493
+ \******************************************************************/
30494
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
30495
+
30496
+ "use strict";
30497
+
30498
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
30499
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
30500
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
30501
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
30502
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
30503
+ };
30504
+ var __metadata = (this && this.__metadata) || function (k, v) {
30505
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
30506
+ };
30507
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
30508
+ return function (target, key) { decorator(target, key, paramIndex); }
30509
+ };
30510
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
30511
+ exports.ValidateIQLQueryUseCase = void 0;
30512
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
30513
+ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
30514
+ const iql_1 = __webpack_require__(/*! @nmshd/iql */ "./node_modules/@nmshd/iql/dist/src/index.js");
30515
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
30516
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
30517
+ let Validator = class Validator extends common_1.SchemaValidator {
30518
+ constructor(schemaRepository) {
30519
+ super(schemaRepository.getSchema("ValidateIQLQueryRequest"));
30520
+ }
30521
+ };
30522
+ Validator = __decorate([
30523
+ __param(0, typescript_ioc_1.Inject),
30524
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
30525
+ ], Validator);
30526
+ let ValidateIQLQueryUseCase = exports.ValidateIQLQueryUseCase = class ValidateIQLQueryUseCase extends common_1.UseCase {
30527
+ constructor(validator) {
30528
+ super(validator);
30529
+ }
30530
+ executeInternal(request) {
30531
+ const query = content_1.IQLQuery.from(request.query);
30532
+ const validationResult = (0, iql_1.validate)(query.queryString);
30533
+ return ts_utils_1.Result.ok(validationResult);
30534
+ }
30535
+ };
30536
+ exports.ValidateIQLQueryUseCase = ValidateIQLQueryUseCase = __decorate([
30537
+ __param(0, typescript_ioc_1.Inject),
30538
+ __metadata("design:paramtypes", [Validator])
30539
+ ], ValidateIQLQueryUseCase);
30540
+ //# sourceMappingURL=ValidateIQLQuery.js.map
30541
+
30542
+ /***/ }),
30543
+
30408
30544
  /***/ "./dist/useCases/consumption/attributes/index.js":
30409
30545
  /*!*******************************************************!*\
30410
30546
  !*** ./dist/useCases/consumption/attributes/index.js ***!
@@ -30443,6 +30579,7 @@ __exportStar(__webpack_require__(/*! ./GetSharedToPeerAttributes */ "./dist/useC
30443
30579
  __exportStar(__webpack_require__(/*! ./ShareAttribute */ "./dist/useCases/consumption/attributes/ShareAttribute.js"), exports);
30444
30580
  __exportStar(__webpack_require__(/*! ./SucceedAttribute */ "./dist/useCases/consumption/attributes/SucceedAttribute.js"), exports);
30445
30581
  __exportStar(__webpack_require__(/*! ./UpdateAttribute */ "./dist/useCases/consumption/attributes/UpdateAttribute.js"), exports);
30582
+ __exportStar(__webpack_require__(/*! ./ValidateIQLQuery */ "./dist/useCases/consumption/attributes/ValidateIQLQuery.js"), exports);
30446
30583
  //# sourceMappingURL=index.js.map
30447
30584
 
30448
30585
  /***/ }),
@@ -37815,6 +37952,1574 @@ exports.sleep = sleep;
37815
37952
 
37816
37953
  /***/ }),
37817
37954
 
37955
+ /***/ "./node_modules/@nmshd/iql/dist/generated/iql.js":
37956
+ /*!*******************************************************!*\
37957
+ !*** ./node_modules/@nmshd/iql/dist/generated/iql.js ***!
37958
+ \*******************************************************/
37959
+ /***/ ((module) => {
37960
+
37961
+ "use strict";
37962
+ // Generated by Peggy 3.0.2.
37963
+ //
37964
+ // https://peggyjs.org/
37965
+
37966
+ /**
37967
+ * Takes the path through a nested dict as an array of strings and returns
37968
+ * the value, or a fallback value, if the path does not exist.
37969
+ */
37970
+ function resolvePath(dict, path, fallback = null) {
37971
+ let val = dict;
37972
+ for (const e of path) {
37973
+ if (!Object.keys(val).includes(e)) {
37974
+ return fallback;
37975
+ }
37976
+ val = val[e];
37977
+ }
37978
+ return val;
37979
+ }
37980
+ /**
37981
+ * Generic matching function for attributes.
37982
+ *
37983
+ * attributes: Array of attributes
37984
+ * path: Path to data field to apply matchFn to, represented as an
37985
+ * array of strings. E.g. Foo.bar.baz is represented as ["Foo",
37986
+ * "bar", "baz"].
37987
+ * matchFn: Predicate function applied to the value of the extracted
37988
+ * attribute data field represented by 'path'.
37989
+ * attributeType: See comment below.
37990
+ */
37991
+ function match(attributes, path, matchFn, attributeType = undefined) {
37992
+ const indices = [];
37993
+ for (let ii = 0; ii < attributes.length; ii++) {
37994
+ const val = resolvePath(attributes[ii], path, null);
37995
+ // If attributeType is defined, assert that it matches the attribute's
37996
+ // type. When matching primary fields the mechanism presented by matchFn
37997
+ // below is insufficient as it's not given the full attribute but only
37998
+ // the selected data field.
37999
+ if (attributeType !== undefined && attributes[ii].value["@type"] !== attributeType) {
38000
+ continue;
38001
+ }
38002
+ if (val !== null && matchFn(val)) {
38003
+ indices.push(ii);
38004
+ }
38005
+ }
38006
+ return indices;
38007
+ }
38008
+ /**
38009
+ * Returns the union of two sets (represented as arrays of primitive
38010
+ * elements).
38011
+ */
38012
+ function union(arr1, arr2) {
38013
+ const result = Array.from(new Set([...arr1, ...arr2]));
38014
+ result.sort((a, b) => { return a - b; });
38015
+ return result;
38016
+ }
38017
+ /**
38018
+ * Returns the intersection of two sets (represented as arrays of primitive
38019
+ * elements).
38020
+ */
38021
+ function intersect(b, ...a) {
38022
+ const result = [b, ...a].reduce((p, c) => p.filter(e => c.includes(e)));
38023
+ result.sort((a, b) => { return a - b; });
38024
+ return result;
38025
+ }
38026
+ /**
38027
+ * Returns the asymmetric difference of two sets (represented as arrays of
38028
+ * primitive elements).
38029
+ */
38030
+ function diffAsym(arr1, arr2) {
38031
+ const result = arr1.filter((x) => { return !arr2.includes(x); });
38032
+ result.sort((a, b) => { return a - b; });
38033
+ return result;
38034
+ }
38035
+ function peg$subclass(child, parent) {
38036
+ function C() { this.constructor = child; }
38037
+ C.prototype = parent.prototype;
38038
+ child.prototype = new C();
38039
+ }
38040
+ function peg$SyntaxError(message, expected, found, location) {
38041
+ var self = Error.call(this, message);
38042
+ // istanbul ignore next Check is a necessary evil to support older environments
38043
+ if (Object.setPrototypeOf) {
38044
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
38045
+ }
38046
+ self.expected = expected;
38047
+ self.found = found;
38048
+ self.location = location;
38049
+ self.name = "SyntaxError";
38050
+ return self;
38051
+ }
38052
+ peg$subclass(peg$SyntaxError, Error);
38053
+ function peg$padEnd(str, targetLength, padString) {
38054
+ padString = padString || " ";
38055
+ if (str.length > targetLength) {
38056
+ return str;
38057
+ }
38058
+ targetLength -= str.length;
38059
+ padString += padString.repeat(targetLength);
38060
+ return str + padString.slice(0, targetLength);
38061
+ }
38062
+ peg$SyntaxError.prototype.format = function (sources) {
38063
+ var str = "Error: " + this.message;
38064
+ if (this.location) {
38065
+ var src = null;
38066
+ var k;
38067
+ for (k = 0; k < sources.length; k++) {
38068
+ if (sources[k].source === this.location.source) {
38069
+ src = sources[k].text.split(/\r\n|\n|\r/g);
38070
+ break;
38071
+ }
38072
+ }
38073
+ var s = this.location.start;
38074
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
38075
+ ? this.location.source.offset(s)
38076
+ : s;
38077
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
38078
+ if (src) {
38079
+ var e = this.location.end;
38080
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
38081
+ var line = src[s.line - 1];
38082
+ var last = s.line === e.line ? e.column : line.length + 1;
38083
+ var hatLen = (last - s.column) || 1;
38084
+ str += "\n --> " + loc + "\n"
38085
+ + filler + " |\n"
38086
+ + offset_s.line + " | " + line + "\n"
38087
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
38088
+ + peg$padEnd("", hatLen, "^");
38089
+ }
38090
+ else {
38091
+ str += "\n at " + loc;
38092
+ }
38093
+ }
38094
+ return str;
38095
+ };
38096
+ peg$SyntaxError.buildMessage = function (expected, found) {
38097
+ var DESCRIBE_EXPECTATION_FNS = {
38098
+ literal: function (expectation) {
38099
+ return "\"" + literalEscape(expectation.text) + "\"";
38100
+ },
38101
+ class: function (expectation) {
38102
+ var escapedParts = expectation.parts.map(function (part) {
38103
+ return Array.isArray(part)
38104
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
38105
+ : classEscape(part);
38106
+ });
38107
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
38108
+ },
38109
+ any: function () {
38110
+ return "any character";
38111
+ },
38112
+ end: function () {
38113
+ return "end of input";
38114
+ },
38115
+ other: function (expectation) {
38116
+ return expectation.description;
38117
+ }
38118
+ };
38119
+ function hex(ch) {
38120
+ return ch.charCodeAt(0).toString(16).toUpperCase();
38121
+ }
38122
+ function literalEscape(s) {
38123
+ return s
38124
+ .replace(/\\/g, "\\\\")
38125
+ .replace(/"/g, "\\\"")
38126
+ .replace(/\0/g, "\\0")
38127
+ .replace(/\t/g, "\\t")
38128
+ .replace(/\n/g, "\\n")
38129
+ .replace(/\r/g, "\\r")
38130
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
38131
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
38132
+ }
38133
+ function classEscape(s) {
38134
+ return s
38135
+ .replace(/\\/g, "\\\\")
38136
+ .replace(/\]/g, "\\]")
38137
+ .replace(/\^/g, "\\^")
38138
+ .replace(/-/g, "\\-")
38139
+ .replace(/\0/g, "\\0")
38140
+ .replace(/\t/g, "\\t")
38141
+ .replace(/\n/g, "\\n")
38142
+ .replace(/\r/g, "\\r")
38143
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
38144
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
38145
+ }
38146
+ function describeExpectation(expectation) {
38147
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
38148
+ }
38149
+ function describeExpected(expected) {
38150
+ var descriptions = expected.map(describeExpectation);
38151
+ var i, j;
38152
+ descriptions.sort();
38153
+ if (descriptions.length > 0) {
38154
+ for (i = 1, j = 1; i < descriptions.length; i++) {
38155
+ if (descriptions[i - 1] !== descriptions[i]) {
38156
+ descriptions[j] = descriptions[i];
38157
+ j++;
38158
+ }
38159
+ }
38160
+ descriptions.length = j;
38161
+ }
38162
+ switch (descriptions.length) {
38163
+ case 1:
38164
+ return descriptions[0];
38165
+ case 2:
38166
+ return descriptions[0] + " or " + descriptions[1];
38167
+ default:
38168
+ return descriptions.slice(0, -1).join(", ")
38169
+ + ", or "
38170
+ + descriptions[descriptions.length - 1];
38171
+ }
38172
+ }
38173
+ function describeFound(found) {
38174
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
38175
+ }
38176
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
38177
+ };
38178
+ function peg$parse(input, options) {
38179
+ options = options !== undefined ? options : {};
38180
+ var peg$FAILED = {};
38181
+ var peg$source = options.grammarSource;
38182
+ var peg$startRuleFunctions = { Expr: peg$parseExpr };
38183
+ var peg$startRuleFunction = peg$parseExpr;
38184
+ var peg$c0 = "||";
38185
+ var peg$c1 = "&&";
38186
+ var peg$c2 = "!";
38187
+ var peg$c3 = "(";
38188
+ var peg$c4 = ")";
38189
+ var peg$c5 = ".";
38190
+ var peg$c6 = "#";
38191
+ var peg$c7 = "'";
38192
+ var peg$c8 = "\\\\";
38193
+ var peg$c9 = "\\'";
38194
+ var peg$r0 = /^[=><~]/;
38195
+ var peg$r1 = /^[?]/;
38196
+ var peg$r2 = /^[^'\\]/;
38197
+ var peg$r3 = /^[^'\\ ]/;
38198
+ var peg$r4 = /^[a-z]/;
38199
+ var peg$r5 = /^[A-za-z0-9]/;
38200
+ var peg$r6 = /^[A-Z]/;
38201
+ var peg$r7 = /^[A-Za-z0-9]/;
38202
+ var peg$r8 = /^[ \t\n\r]/;
38203
+ var peg$e0 = peg$literalExpectation("||", false);
38204
+ var peg$e1 = peg$literalExpectation("&&", false);
38205
+ var peg$e2 = peg$literalExpectation("!", false);
38206
+ var peg$e3 = peg$literalExpectation("(", false);
38207
+ var peg$e4 = peg$literalExpectation(")", false);
38208
+ var peg$e5 = peg$otherExpectation("metadata field term");
38209
+ var peg$e6 = peg$literalExpectation(".", false);
38210
+ var peg$e7 = peg$otherExpectation("tag term");
38211
+ var peg$e8 = peg$literalExpectation("#", false);
38212
+ var peg$e9 = peg$otherExpectation("primary field term");
38213
+ var peg$e10 = peg$classExpectation(["=", ">", "<", "~"], false, false);
38214
+ var peg$e11 = peg$classExpectation(["?"], false, false);
38215
+ var peg$e12 = peg$literalExpectation("'", false);
38216
+ var peg$e13 = peg$literalExpectation("\\\\", false);
38217
+ var peg$e14 = peg$literalExpectation("\\'", false);
38218
+ var peg$e15 = peg$classExpectation(["'", "\\"], true, false);
38219
+ var peg$e16 = peg$classExpectation(["'", "\\", " "], true, false);
38220
+ var peg$e17 = peg$classExpectation([["a", "z"]], false, false);
38221
+ var peg$e18 = peg$classExpectation([["A", "z"], ["a", "z"], ["0", "9"]], false, false);
38222
+ var peg$e19 = peg$otherExpectation("attribute type");
38223
+ var peg$e20 = peg$classExpectation([["A", "Z"]], false, false);
38224
+ var peg$e21 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"]], false, false);
38225
+ var peg$e22 = peg$otherExpectation("whitespace");
38226
+ var peg$e23 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false);
38227
+ var peg$f0 = function (h, t) {
38228
+ return t.reduce((acc, element) => {
38229
+ return union(acc, element);
38230
+ }, h);
38231
+ };
38232
+ var peg$f1 = function (h, t) {
38233
+ return t.reduce((acc, element) => {
38234
+ return intersect(acc, element);
38235
+ }, h);
38236
+ };
38237
+ var peg$f2 = function (expr) {
38238
+ const allIndices = [...Array(options.attributes.length).keys()];
38239
+ return diffAsym(allIndices, expr);
38240
+ };
38241
+ var peg$f3 = function (pathPrefix, pathSuffix, matchFn) {
38242
+ return match(options.attributes, [pathPrefix, ...pathSuffix], matchFn);
38243
+ };
38244
+ var peg$f4 = function (tag) {
38245
+ return match(options.attributes, ["tags"], (fieldVal) => { return Array.isArray(fieldVal) && fieldVal.includes(tag); });
38246
+ };
38247
+ var peg$f5 = function (attributeType, path, matchFn) {
38248
+ const result = match(options.attributes, ["value", ...path], matchFn, attributeType);
38249
+ return result;
38250
+ };
38251
+ var peg$f6 = function (attributeType, matchFn) {
38252
+ return match(options.attributes, ["value", "value"], matchFn, attributeType);
38253
+ };
38254
+ var peg$f7 = function (attributeType) {
38255
+ // Providing only the attribute type returns attributes whose type
38256
+ // matches. E.g. 'PhoneNumber' will return all attributes whose type is
38257
+ // 'PhoneNumber', regardless of the values of any of their fields.
38258
+ return match(options.attributes, ["value", "@type"], (fieldVal) => { return fieldVal === attributeType; });
38259
+ };
38260
+ var peg$f8 = function (op, rhs) {
38261
+ switch (op) {
38262
+ case "=":
38263
+ return (fieldVal) => { return String(fieldVal) === rhs; };
38264
+ case ">":
38265
+ return (fieldVal) => { return new Date(fieldVal) >= new Date(rhs); };
38266
+ case "<":
38267
+ return (fieldVal) => { return new Date(fieldVal) <= new Date(rhs); };
38268
+ case "~":
38269
+ return (fieldVal) => { return Array.isArray(fieldVal) && fieldVal.includes(rhs); };
38270
+ }
38271
+ };
38272
+ var peg$f9 = function (op) {
38273
+ switch (op) {
38274
+ case "?":
38275
+ return (fieldVal) => { return fieldVal != undefined; };
38276
+ }
38277
+ };
38278
+ var peg$f10 = function (val) {
38279
+ return val.join("").replaceAll("\\\\", "\\").replaceAll("\\'", "'");
38280
+ };
38281
+ var peg$f11 = function (val) {
38282
+ return val.join("").replaceAll("\\\\", "\\").replaceAll("\\'", "'");
38283
+ };
38284
+ var peg$currPos = 0;
38285
+ var peg$savedPos = 0;
38286
+ var peg$posDetailsCache = [{ line: 1, column: 1 }];
38287
+ var peg$maxFailPos = 0;
38288
+ var peg$maxFailExpected = [];
38289
+ var peg$silentFails = 0;
38290
+ var peg$result;
38291
+ if ("startRule" in options) {
38292
+ if (!(options.startRule in peg$startRuleFunctions)) {
38293
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
38294
+ }
38295
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
38296
+ }
38297
+ function text() {
38298
+ return input.substring(peg$savedPos, peg$currPos);
38299
+ }
38300
+ function offset() {
38301
+ return peg$savedPos;
38302
+ }
38303
+ function range() {
38304
+ return {
38305
+ source: peg$source,
38306
+ start: peg$savedPos,
38307
+ end: peg$currPos
38308
+ };
38309
+ }
38310
+ function location() {
38311
+ return peg$computeLocation(peg$savedPos, peg$currPos);
38312
+ }
38313
+ function expected(description, location) {
38314
+ location = location !== undefined
38315
+ ? location
38316
+ : peg$computeLocation(peg$savedPos, peg$currPos);
38317
+ throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
38318
+ }
38319
+ function error(message, location) {
38320
+ location = location !== undefined
38321
+ ? location
38322
+ : peg$computeLocation(peg$savedPos, peg$currPos);
38323
+ throw peg$buildSimpleError(message, location);
38324
+ }
38325
+ function peg$literalExpectation(text, ignoreCase) {
38326
+ return { type: "literal", text: text, ignoreCase: ignoreCase };
38327
+ }
38328
+ function peg$classExpectation(parts, inverted, ignoreCase) {
38329
+ return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
38330
+ }
38331
+ function peg$anyExpectation() {
38332
+ return { type: "any" };
38333
+ }
38334
+ function peg$endExpectation() {
38335
+ return { type: "end" };
38336
+ }
38337
+ function peg$otherExpectation(description) {
38338
+ return { type: "other", description: description };
38339
+ }
38340
+ function peg$computePosDetails(pos) {
38341
+ var details = peg$posDetailsCache[pos];
38342
+ var p;
38343
+ if (details) {
38344
+ return details;
38345
+ }
38346
+ else {
38347
+ p = pos - 1;
38348
+ while (!peg$posDetailsCache[p]) {
38349
+ p--;
38350
+ }
38351
+ details = peg$posDetailsCache[p];
38352
+ details = {
38353
+ line: details.line,
38354
+ column: details.column
38355
+ };
38356
+ while (p < pos) {
38357
+ if (input.charCodeAt(p) === 10) {
38358
+ details.line++;
38359
+ details.column = 1;
38360
+ }
38361
+ else {
38362
+ details.column++;
38363
+ }
38364
+ p++;
38365
+ }
38366
+ peg$posDetailsCache[pos] = details;
38367
+ return details;
38368
+ }
38369
+ }
38370
+ function peg$computeLocation(startPos, endPos, offset) {
38371
+ var startPosDetails = peg$computePosDetails(startPos);
38372
+ var endPosDetails = peg$computePosDetails(endPos);
38373
+ var res = {
38374
+ source: peg$source,
38375
+ start: {
38376
+ offset: startPos,
38377
+ line: startPosDetails.line,
38378
+ column: startPosDetails.column
38379
+ },
38380
+ end: {
38381
+ offset: endPos,
38382
+ line: endPosDetails.line,
38383
+ column: endPosDetails.column
38384
+ }
38385
+ };
38386
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
38387
+ res.start = peg$source.offset(res.start);
38388
+ res.end = peg$source.offset(res.end);
38389
+ }
38390
+ return res;
38391
+ }
38392
+ function peg$fail(expected) {
38393
+ if (peg$currPos < peg$maxFailPos) {
38394
+ return;
38395
+ }
38396
+ if (peg$currPos > peg$maxFailPos) {
38397
+ peg$maxFailPos = peg$currPos;
38398
+ peg$maxFailExpected = [];
38399
+ }
38400
+ peg$maxFailExpected.push(expected);
38401
+ }
38402
+ function peg$buildSimpleError(message, location) {
38403
+ return new peg$SyntaxError(message, null, null, location);
38404
+ }
38405
+ function peg$buildStructuredError(expected, found, location) {
38406
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
38407
+ }
38408
+ function peg$parseExpr() {
38409
+ var s0, s1, s2, s3, s4, s5, s6, s7;
38410
+ s0 = peg$currPos;
38411
+ s1 = peg$parseExpr0();
38412
+ if (s1 !== peg$FAILED) {
38413
+ s2 = [];
38414
+ s3 = peg$currPos;
38415
+ s4 = [];
38416
+ s5 = peg$parse_();
38417
+ if (s5 !== peg$FAILED) {
38418
+ while (s5 !== peg$FAILED) {
38419
+ s4.push(s5);
38420
+ s5 = peg$parse_();
38421
+ }
38422
+ }
38423
+ else {
38424
+ s4 = peg$FAILED;
38425
+ }
38426
+ if (s4 !== peg$FAILED) {
38427
+ if (input.substr(peg$currPos, 2) === peg$c0) {
38428
+ s5 = peg$c0;
38429
+ peg$currPos += 2;
38430
+ }
38431
+ else {
38432
+ s5 = peg$FAILED;
38433
+ if (peg$silentFails === 0) {
38434
+ peg$fail(peg$e0);
38435
+ }
38436
+ }
38437
+ if (s5 !== peg$FAILED) {
38438
+ s6 = [];
38439
+ s7 = peg$parse_();
38440
+ if (s7 !== peg$FAILED) {
38441
+ while (s7 !== peg$FAILED) {
38442
+ s6.push(s7);
38443
+ s7 = peg$parse_();
38444
+ }
38445
+ }
38446
+ else {
38447
+ s6 = peg$FAILED;
38448
+ }
38449
+ if (s6 !== peg$FAILED) {
38450
+ s7 = peg$parseExpr0();
38451
+ if (s7 !== peg$FAILED) {
38452
+ s3 = s7;
38453
+ }
38454
+ else {
38455
+ peg$currPos = s3;
38456
+ s3 = peg$FAILED;
38457
+ }
38458
+ }
38459
+ else {
38460
+ peg$currPos = s3;
38461
+ s3 = peg$FAILED;
38462
+ }
38463
+ }
38464
+ else {
38465
+ peg$currPos = s3;
38466
+ s3 = peg$FAILED;
38467
+ }
38468
+ }
38469
+ else {
38470
+ peg$currPos = s3;
38471
+ s3 = peg$FAILED;
38472
+ }
38473
+ while (s3 !== peg$FAILED) {
38474
+ s2.push(s3);
38475
+ s3 = peg$currPos;
38476
+ s4 = [];
38477
+ s5 = peg$parse_();
38478
+ if (s5 !== peg$FAILED) {
38479
+ while (s5 !== peg$FAILED) {
38480
+ s4.push(s5);
38481
+ s5 = peg$parse_();
38482
+ }
38483
+ }
38484
+ else {
38485
+ s4 = peg$FAILED;
38486
+ }
38487
+ if (s4 !== peg$FAILED) {
38488
+ if (input.substr(peg$currPos, 2) === peg$c0) {
38489
+ s5 = peg$c0;
38490
+ peg$currPos += 2;
38491
+ }
38492
+ else {
38493
+ s5 = peg$FAILED;
38494
+ if (peg$silentFails === 0) {
38495
+ peg$fail(peg$e0);
38496
+ }
38497
+ }
38498
+ if (s5 !== peg$FAILED) {
38499
+ s6 = [];
38500
+ s7 = peg$parse_();
38501
+ if (s7 !== peg$FAILED) {
38502
+ while (s7 !== peg$FAILED) {
38503
+ s6.push(s7);
38504
+ s7 = peg$parse_();
38505
+ }
38506
+ }
38507
+ else {
38508
+ s6 = peg$FAILED;
38509
+ }
38510
+ if (s6 !== peg$FAILED) {
38511
+ s7 = peg$parseExpr0();
38512
+ if (s7 !== peg$FAILED) {
38513
+ s3 = s7;
38514
+ }
38515
+ else {
38516
+ peg$currPos = s3;
38517
+ s3 = peg$FAILED;
38518
+ }
38519
+ }
38520
+ else {
38521
+ peg$currPos = s3;
38522
+ s3 = peg$FAILED;
38523
+ }
38524
+ }
38525
+ else {
38526
+ peg$currPos = s3;
38527
+ s3 = peg$FAILED;
38528
+ }
38529
+ }
38530
+ else {
38531
+ peg$currPos = s3;
38532
+ s3 = peg$FAILED;
38533
+ }
38534
+ }
38535
+ peg$savedPos = s0;
38536
+ s0 = peg$f0(s1, s2);
38537
+ }
38538
+ else {
38539
+ peg$currPos = s0;
38540
+ s0 = peg$FAILED;
38541
+ }
38542
+ return s0;
38543
+ }
38544
+ function peg$parseExpr0() {
38545
+ var s0, s1, s2, s3, s4, s5, s6, s7;
38546
+ s0 = peg$currPos;
38547
+ s1 = peg$parseExpr1();
38548
+ if (s1 !== peg$FAILED) {
38549
+ s2 = [];
38550
+ s3 = peg$currPos;
38551
+ s4 = [];
38552
+ s5 = peg$parse_();
38553
+ if (s5 !== peg$FAILED) {
38554
+ while (s5 !== peg$FAILED) {
38555
+ s4.push(s5);
38556
+ s5 = peg$parse_();
38557
+ }
38558
+ }
38559
+ else {
38560
+ s4 = peg$FAILED;
38561
+ }
38562
+ if (s4 !== peg$FAILED) {
38563
+ if (input.substr(peg$currPos, 2) === peg$c1) {
38564
+ s5 = peg$c1;
38565
+ peg$currPos += 2;
38566
+ }
38567
+ else {
38568
+ s5 = peg$FAILED;
38569
+ if (peg$silentFails === 0) {
38570
+ peg$fail(peg$e1);
38571
+ }
38572
+ }
38573
+ if (s5 !== peg$FAILED) {
38574
+ s6 = [];
38575
+ s7 = peg$parse_();
38576
+ if (s7 !== peg$FAILED) {
38577
+ while (s7 !== peg$FAILED) {
38578
+ s6.push(s7);
38579
+ s7 = peg$parse_();
38580
+ }
38581
+ }
38582
+ else {
38583
+ s6 = peg$FAILED;
38584
+ }
38585
+ if (s6 !== peg$FAILED) {
38586
+ s7 = peg$parseExpr1();
38587
+ if (s7 !== peg$FAILED) {
38588
+ s3 = s7;
38589
+ }
38590
+ else {
38591
+ peg$currPos = s3;
38592
+ s3 = peg$FAILED;
38593
+ }
38594
+ }
38595
+ else {
38596
+ peg$currPos = s3;
38597
+ s3 = peg$FAILED;
38598
+ }
38599
+ }
38600
+ else {
38601
+ peg$currPos = s3;
38602
+ s3 = peg$FAILED;
38603
+ }
38604
+ }
38605
+ else {
38606
+ peg$currPos = s3;
38607
+ s3 = peg$FAILED;
38608
+ }
38609
+ while (s3 !== peg$FAILED) {
38610
+ s2.push(s3);
38611
+ s3 = peg$currPos;
38612
+ s4 = [];
38613
+ s5 = peg$parse_();
38614
+ if (s5 !== peg$FAILED) {
38615
+ while (s5 !== peg$FAILED) {
38616
+ s4.push(s5);
38617
+ s5 = peg$parse_();
38618
+ }
38619
+ }
38620
+ else {
38621
+ s4 = peg$FAILED;
38622
+ }
38623
+ if (s4 !== peg$FAILED) {
38624
+ if (input.substr(peg$currPos, 2) === peg$c1) {
38625
+ s5 = peg$c1;
38626
+ peg$currPos += 2;
38627
+ }
38628
+ else {
38629
+ s5 = peg$FAILED;
38630
+ if (peg$silentFails === 0) {
38631
+ peg$fail(peg$e1);
38632
+ }
38633
+ }
38634
+ if (s5 !== peg$FAILED) {
38635
+ s6 = [];
38636
+ s7 = peg$parse_();
38637
+ if (s7 !== peg$FAILED) {
38638
+ while (s7 !== peg$FAILED) {
38639
+ s6.push(s7);
38640
+ s7 = peg$parse_();
38641
+ }
38642
+ }
38643
+ else {
38644
+ s6 = peg$FAILED;
38645
+ }
38646
+ if (s6 !== peg$FAILED) {
38647
+ s7 = peg$parseExpr1();
38648
+ if (s7 !== peg$FAILED) {
38649
+ s3 = s7;
38650
+ }
38651
+ else {
38652
+ peg$currPos = s3;
38653
+ s3 = peg$FAILED;
38654
+ }
38655
+ }
38656
+ else {
38657
+ peg$currPos = s3;
38658
+ s3 = peg$FAILED;
38659
+ }
38660
+ }
38661
+ else {
38662
+ peg$currPos = s3;
38663
+ s3 = peg$FAILED;
38664
+ }
38665
+ }
38666
+ else {
38667
+ peg$currPos = s3;
38668
+ s3 = peg$FAILED;
38669
+ }
38670
+ }
38671
+ peg$savedPos = s0;
38672
+ s0 = peg$f1(s1, s2);
38673
+ }
38674
+ else {
38675
+ peg$currPos = s0;
38676
+ s0 = peg$FAILED;
38677
+ }
38678
+ return s0;
38679
+ }
38680
+ function peg$parseExpr1() {
38681
+ var s0, s1, s2;
38682
+ s0 = peg$currPos;
38683
+ if (input.charCodeAt(peg$currPos) === 33) {
38684
+ s1 = peg$c2;
38685
+ peg$currPos++;
38686
+ }
38687
+ else {
38688
+ s1 = peg$FAILED;
38689
+ if (peg$silentFails === 0) {
38690
+ peg$fail(peg$e2);
38691
+ }
38692
+ }
38693
+ if (s1 !== peg$FAILED) {
38694
+ s2 = peg$parseExpr1();
38695
+ if (s2 !== peg$FAILED) {
38696
+ peg$savedPos = s0;
38697
+ s0 = peg$f2(s2);
38698
+ }
38699
+ else {
38700
+ peg$currPos = s0;
38701
+ s0 = peg$FAILED;
38702
+ }
38703
+ }
38704
+ else {
38705
+ peg$currPos = s0;
38706
+ s0 = peg$FAILED;
38707
+ }
38708
+ if (s0 === peg$FAILED) {
38709
+ s0 = peg$parseExpr2();
38710
+ }
38711
+ return s0;
38712
+ }
38713
+ function peg$parseExpr2() {
38714
+ var s0, s1, s2, s3, s4, s5;
38715
+ s0 = peg$currPos;
38716
+ if (input.charCodeAt(peg$currPos) === 40) {
38717
+ s1 = peg$c3;
38718
+ peg$currPos++;
38719
+ }
38720
+ else {
38721
+ s1 = peg$FAILED;
38722
+ if (peg$silentFails === 0) {
38723
+ peg$fail(peg$e3);
38724
+ }
38725
+ }
38726
+ if (s1 !== peg$FAILED) {
38727
+ s2 = [];
38728
+ s3 = peg$parse_();
38729
+ if (s3 !== peg$FAILED) {
38730
+ while (s3 !== peg$FAILED) {
38731
+ s2.push(s3);
38732
+ s3 = peg$parse_();
38733
+ }
38734
+ }
38735
+ else {
38736
+ s2 = peg$FAILED;
38737
+ }
38738
+ if (s2 !== peg$FAILED) {
38739
+ s3 = peg$parseExpr();
38740
+ if (s3 !== peg$FAILED) {
38741
+ s4 = [];
38742
+ s5 = peg$parse_();
38743
+ if (s5 !== peg$FAILED) {
38744
+ while (s5 !== peg$FAILED) {
38745
+ s4.push(s5);
38746
+ s5 = peg$parse_();
38747
+ }
38748
+ }
38749
+ else {
38750
+ s4 = peg$FAILED;
38751
+ }
38752
+ if (s4 !== peg$FAILED) {
38753
+ if (input.charCodeAt(peg$currPos) === 41) {
38754
+ s5 = peg$c4;
38755
+ peg$currPos++;
38756
+ }
38757
+ else {
38758
+ s5 = peg$FAILED;
38759
+ if (peg$silentFails === 0) {
38760
+ peg$fail(peg$e4);
38761
+ }
38762
+ }
38763
+ if (s5 !== peg$FAILED) {
38764
+ s0 = s3;
38765
+ }
38766
+ else {
38767
+ peg$currPos = s0;
38768
+ s0 = peg$FAILED;
38769
+ }
38770
+ }
38771
+ else {
38772
+ peg$currPos = s0;
38773
+ s0 = peg$FAILED;
38774
+ }
38775
+ }
38776
+ else {
38777
+ peg$currPos = s0;
38778
+ s0 = peg$FAILED;
38779
+ }
38780
+ }
38781
+ else {
38782
+ peg$currPos = s0;
38783
+ s0 = peg$FAILED;
38784
+ }
38785
+ }
38786
+ else {
38787
+ peg$currPos = s0;
38788
+ s0 = peg$FAILED;
38789
+ }
38790
+ if (s0 === peg$FAILED) {
38791
+ s0 = peg$parseTerm();
38792
+ }
38793
+ return s0;
38794
+ }
38795
+ function peg$parseTerm() {
38796
+ var s0;
38797
+ s0 = peg$parsePrimaryFieldTerm();
38798
+ if (s0 === peg$FAILED) {
38799
+ s0 = peg$parseMetadataFieldTerm();
38800
+ if (s0 === peg$FAILED) {
38801
+ s0 = peg$parseTagTerm();
38802
+ }
38803
+ }
38804
+ return s0;
38805
+ }
38806
+ function peg$parseMetadataFieldTerm() {
38807
+ var s0, s1, s2, s3, s4, s5;
38808
+ peg$silentFails++;
38809
+ s0 = peg$currPos;
38810
+ s1 = peg$parsePathSegment();
38811
+ if (s1 !== peg$FAILED) {
38812
+ s2 = [];
38813
+ s3 = peg$currPos;
38814
+ if (input.charCodeAt(peg$currPos) === 46) {
38815
+ s4 = peg$c5;
38816
+ peg$currPos++;
38817
+ }
38818
+ else {
38819
+ s4 = peg$FAILED;
38820
+ if (peg$silentFails === 0) {
38821
+ peg$fail(peg$e6);
38822
+ }
38823
+ }
38824
+ if (s4 !== peg$FAILED) {
38825
+ s5 = peg$parsePathSegment();
38826
+ if (s5 !== peg$FAILED) {
38827
+ s3 = s5;
38828
+ }
38829
+ else {
38830
+ peg$currPos = s3;
38831
+ s3 = peg$FAILED;
38832
+ }
38833
+ }
38834
+ else {
38835
+ peg$currPos = s3;
38836
+ s3 = peg$FAILED;
38837
+ }
38838
+ while (s3 !== peg$FAILED) {
38839
+ s2.push(s3);
38840
+ s3 = peg$currPos;
38841
+ if (input.charCodeAt(peg$currPos) === 46) {
38842
+ s4 = peg$c5;
38843
+ peg$currPos++;
38844
+ }
38845
+ else {
38846
+ s4 = peg$FAILED;
38847
+ if (peg$silentFails === 0) {
38848
+ peg$fail(peg$e6);
38849
+ }
38850
+ }
38851
+ if (s4 !== peg$FAILED) {
38852
+ s5 = peg$parsePathSegment();
38853
+ if (s5 !== peg$FAILED) {
38854
+ s3 = s5;
38855
+ }
38856
+ else {
38857
+ peg$currPos = s3;
38858
+ s3 = peg$FAILED;
38859
+ }
38860
+ }
38861
+ else {
38862
+ peg$currPos = s3;
38863
+ s3 = peg$FAILED;
38864
+ }
38865
+ }
38866
+ s3 = peg$parsePredicate();
38867
+ if (s3 !== peg$FAILED) {
38868
+ peg$savedPos = s0;
38869
+ s0 = peg$f3(s1, s2, s3);
38870
+ }
38871
+ else {
38872
+ peg$currPos = s0;
38873
+ s0 = peg$FAILED;
38874
+ }
38875
+ }
38876
+ else {
38877
+ peg$currPos = s0;
38878
+ s0 = peg$FAILED;
38879
+ }
38880
+ peg$silentFails--;
38881
+ if (s0 === peg$FAILED) {
38882
+ s1 = peg$FAILED;
38883
+ if (peg$silentFails === 0) {
38884
+ peg$fail(peg$e5);
38885
+ }
38886
+ }
38887
+ return s0;
38888
+ }
38889
+ function peg$parseTagTerm() {
38890
+ var s0, s1, s2;
38891
+ peg$silentFails++;
38892
+ s0 = peg$currPos;
38893
+ if (input.charCodeAt(peg$currPos) === 35) {
38894
+ s1 = peg$c6;
38895
+ peg$currPos++;
38896
+ }
38897
+ else {
38898
+ s1 = peg$FAILED;
38899
+ if (peg$silentFails === 0) {
38900
+ peg$fail(peg$e8);
38901
+ }
38902
+ }
38903
+ if (s1 !== peg$FAILED) {
38904
+ s2 = peg$parsePredicateRHS();
38905
+ if (s2 !== peg$FAILED) {
38906
+ peg$savedPos = s0;
38907
+ s0 = peg$f4(s2);
38908
+ }
38909
+ else {
38910
+ peg$currPos = s0;
38911
+ s0 = peg$FAILED;
38912
+ }
38913
+ }
38914
+ else {
38915
+ peg$currPos = s0;
38916
+ s0 = peg$FAILED;
38917
+ }
38918
+ peg$silentFails--;
38919
+ if (s0 === peg$FAILED) {
38920
+ s1 = peg$FAILED;
38921
+ if (peg$silentFails === 0) {
38922
+ peg$fail(peg$e7);
38923
+ }
38924
+ }
38925
+ return s0;
38926
+ }
38927
+ function peg$parsePrimaryFieldTerm() {
38928
+ var s0, s1, s2, s3, s4, s5;
38929
+ peg$silentFails++;
38930
+ s0 = peg$currPos;
38931
+ s1 = peg$parseAttributeType();
38932
+ if (s1 !== peg$FAILED) {
38933
+ s2 = [];
38934
+ s3 = peg$currPos;
38935
+ if (input.charCodeAt(peg$currPos) === 46) {
38936
+ s4 = peg$c5;
38937
+ peg$currPos++;
38938
+ }
38939
+ else {
38940
+ s4 = peg$FAILED;
38941
+ if (peg$silentFails === 0) {
38942
+ peg$fail(peg$e6);
38943
+ }
38944
+ }
38945
+ if (s4 !== peg$FAILED) {
38946
+ s5 = peg$parsePathSegment();
38947
+ if (s5 !== peg$FAILED) {
38948
+ s3 = s5;
38949
+ }
38950
+ else {
38951
+ peg$currPos = s3;
38952
+ s3 = peg$FAILED;
38953
+ }
38954
+ }
38955
+ else {
38956
+ peg$currPos = s3;
38957
+ s3 = peg$FAILED;
38958
+ }
38959
+ if (s3 !== peg$FAILED) {
38960
+ while (s3 !== peg$FAILED) {
38961
+ s2.push(s3);
38962
+ s3 = peg$currPos;
38963
+ if (input.charCodeAt(peg$currPos) === 46) {
38964
+ s4 = peg$c5;
38965
+ peg$currPos++;
38966
+ }
38967
+ else {
38968
+ s4 = peg$FAILED;
38969
+ if (peg$silentFails === 0) {
38970
+ peg$fail(peg$e6);
38971
+ }
38972
+ }
38973
+ if (s4 !== peg$FAILED) {
38974
+ s5 = peg$parsePathSegment();
38975
+ if (s5 !== peg$FAILED) {
38976
+ s3 = s5;
38977
+ }
38978
+ else {
38979
+ peg$currPos = s3;
38980
+ s3 = peg$FAILED;
38981
+ }
38982
+ }
38983
+ else {
38984
+ peg$currPos = s3;
38985
+ s3 = peg$FAILED;
38986
+ }
38987
+ }
38988
+ }
38989
+ else {
38990
+ s2 = peg$FAILED;
38991
+ }
38992
+ if (s2 !== peg$FAILED) {
38993
+ s3 = peg$parsePredicate();
38994
+ if (s3 !== peg$FAILED) {
38995
+ peg$savedPos = s0;
38996
+ s0 = peg$f5(s1, s2, s3);
38997
+ }
38998
+ else {
38999
+ peg$currPos = s0;
39000
+ s0 = peg$FAILED;
39001
+ }
39002
+ }
39003
+ else {
39004
+ peg$currPos = s0;
39005
+ s0 = peg$FAILED;
39006
+ }
39007
+ }
39008
+ else {
39009
+ peg$currPos = s0;
39010
+ s0 = peg$FAILED;
39011
+ }
39012
+ if (s0 === peg$FAILED) {
39013
+ s0 = peg$currPos;
39014
+ s1 = peg$parseAttributeType();
39015
+ if (s1 !== peg$FAILED) {
39016
+ s2 = peg$parsePredicate();
39017
+ if (s2 !== peg$FAILED) {
39018
+ peg$savedPos = s0;
39019
+ s0 = peg$f6(s1, s2);
39020
+ }
39021
+ else {
39022
+ peg$currPos = s0;
39023
+ s0 = peg$FAILED;
39024
+ }
39025
+ }
39026
+ else {
39027
+ peg$currPos = s0;
39028
+ s0 = peg$FAILED;
39029
+ }
39030
+ if (s0 === peg$FAILED) {
39031
+ s0 = peg$currPos;
39032
+ s1 = peg$parseAttributeType();
39033
+ if (s1 !== peg$FAILED) {
39034
+ peg$savedPos = s0;
39035
+ s1 = peg$f7(s1);
39036
+ }
39037
+ s0 = s1;
39038
+ }
39039
+ }
39040
+ peg$silentFails--;
39041
+ if (s0 === peg$FAILED) {
39042
+ s1 = peg$FAILED;
39043
+ if (peg$silentFails === 0) {
39044
+ peg$fail(peg$e9);
39045
+ }
39046
+ }
39047
+ return s0;
39048
+ }
39049
+ function peg$parsePredicate() {
39050
+ var s0, s1, s2;
39051
+ s0 = peg$currPos;
39052
+ if (peg$r0.test(input.charAt(peg$currPos))) {
39053
+ s1 = input.charAt(peg$currPos);
39054
+ peg$currPos++;
39055
+ }
39056
+ else {
39057
+ s1 = peg$FAILED;
39058
+ if (peg$silentFails === 0) {
39059
+ peg$fail(peg$e10);
39060
+ }
39061
+ }
39062
+ if (s1 !== peg$FAILED) {
39063
+ s2 = peg$parsePredicateRHS();
39064
+ if (s2 !== peg$FAILED) {
39065
+ peg$savedPos = s0;
39066
+ s0 = peg$f8(s1, s2);
39067
+ }
39068
+ else {
39069
+ peg$currPos = s0;
39070
+ s0 = peg$FAILED;
39071
+ }
39072
+ }
39073
+ else {
39074
+ peg$currPos = s0;
39075
+ s0 = peg$FAILED;
39076
+ }
39077
+ if (s0 === peg$FAILED) {
39078
+ s0 = peg$currPos;
39079
+ if (peg$r1.test(input.charAt(peg$currPos))) {
39080
+ s1 = input.charAt(peg$currPos);
39081
+ peg$currPos++;
39082
+ }
39083
+ else {
39084
+ s1 = peg$FAILED;
39085
+ if (peg$silentFails === 0) {
39086
+ peg$fail(peg$e11);
39087
+ }
39088
+ }
39089
+ if (s1 !== peg$FAILED) {
39090
+ peg$savedPos = s0;
39091
+ s1 = peg$f9(s1);
39092
+ }
39093
+ s0 = s1;
39094
+ }
39095
+ return s0;
39096
+ }
39097
+ function peg$parsePredicateRHS() {
39098
+ var s0, s1, s2, s3;
39099
+ s0 = peg$currPos;
39100
+ if (input.charCodeAt(peg$currPos) === 39) {
39101
+ s1 = peg$c7;
39102
+ peg$currPos++;
39103
+ }
39104
+ else {
39105
+ s1 = peg$FAILED;
39106
+ if (peg$silentFails === 0) {
39107
+ peg$fail(peg$e12);
39108
+ }
39109
+ }
39110
+ if (s1 !== peg$FAILED) {
39111
+ s2 = [];
39112
+ if (input.substr(peg$currPos, 2) === peg$c8) {
39113
+ s3 = peg$c8;
39114
+ peg$currPos += 2;
39115
+ }
39116
+ else {
39117
+ s3 = peg$FAILED;
39118
+ if (peg$silentFails === 0) {
39119
+ peg$fail(peg$e13);
39120
+ }
39121
+ }
39122
+ if (s3 === peg$FAILED) {
39123
+ if (input.substr(peg$currPos, 2) === peg$c9) {
39124
+ s3 = peg$c9;
39125
+ peg$currPos += 2;
39126
+ }
39127
+ else {
39128
+ s3 = peg$FAILED;
39129
+ if (peg$silentFails === 0) {
39130
+ peg$fail(peg$e14);
39131
+ }
39132
+ }
39133
+ if (s3 === peg$FAILED) {
39134
+ if (peg$r2.test(input.charAt(peg$currPos))) {
39135
+ s3 = input.charAt(peg$currPos);
39136
+ peg$currPos++;
39137
+ }
39138
+ else {
39139
+ s3 = peg$FAILED;
39140
+ if (peg$silentFails === 0) {
39141
+ peg$fail(peg$e15);
39142
+ }
39143
+ }
39144
+ }
39145
+ }
39146
+ while (s3 !== peg$FAILED) {
39147
+ s2.push(s3);
39148
+ if (input.substr(peg$currPos, 2) === peg$c8) {
39149
+ s3 = peg$c8;
39150
+ peg$currPos += 2;
39151
+ }
39152
+ else {
39153
+ s3 = peg$FAILED;
39154
+ if (peg$silentFails === 0) {
39155
+ peg$fail(peg$e13);
39156
+ }
39157
+ }
39158
+ if (s3 === peg$FAILED) {
39159
+ if (input.substr(peg$currPos, 2) === peg$c9) {
39160
+ s3 = peg$c9;
39161
+ peg$currPos += 2;
39162
+ }
39163
+ else {
39164
+ s3 = peg$FAILED;
39165
+ if (peg$silentFails === 0) {
39166
+ peg$fail(peg$e14);
39167
+ }
39168
+ }
39169
+ if (s3 === peg$FAILED) {
39170
+ if (peg$r2.test(input.charAt(peg$currPos))) {
39171
+ s3 = input.charAt(peg$currPos);
39172
+ peg$currPos++;
39173
+ }
39174
+ else {
39175
+ s3 = peg$FAILED;
39176
+ if (peg$silentFails === 0) {
39177
+ peg$fail(peg$e15);
39178
+ }
39179
+ }
39180
+ }
39181
+ }
39182
+ }
39183
+ if (input.charCodeAt(peg$currPos) === 39) {
39184
+ s3 = peg$c7;
39185
+ peg$currPos++;
39186
+ }
39187
+ else {
39188
+ s3 = peg$FAILED;
39189
+ if (peg$silentFails === 0) {
39190
+ peg$fail(peg$e12);
39191
+ }
39192
+ }
39193
+ if (s3 !== peg$FAILED) {
39194
+ peg$savedPos = s0;
39195
+ s0 = peg$f10(s2);
39196
+ }
39197
+ else {
39198
+ peg$currPos = s0;
39199
+ s0 = peg$FAILED;
39200
+ }
39201
+ }
39202
+ else {
39203
+ peg$currPos = s0;
39204
+ s0 = peg$FAILED;
39205
+ }
39206
+ if (s0 === peg$FAILED) {
39207
+ s0 = peg$currPos;
39208
+ s1 = [];
39209
+ if (input.substr(peg$currPos, 2) === peg$c8) {
39210
+ s2 = peg$c8;
39211
+ peg$currPos += 2;
39212
+ }
39213
+ else {
39214
+ s2 = peg$FAILED;
39215
+ if (peg$silentFails === 0) {
39216
+ peg$fail(peg$e13);
39217
+ }
39218
+ }
39219
+ if (s2 === peg$FAILED) {
39220
+ if (input.substr(peg$currPos, 2) === peg$c9) {
39221
+ s2 = peg$c9;
39222
+ peg$currPos += 2;
39223
+ }
39224
+ else {
39225
+ s2 = peg$FAILED;
39226
+ if (peg$silentFails === 0) {
39227
+ peg$fail(peg$e14);
39228
+ }
39229
+ }
39230
+ if (s2 === peg$FAILED) {
39231
+ if (peg$r3.test(input.charAt(peg$currPos))) {
39232
+ s2 = input.charAt(peg$currPos);
39233
+ peg$currPos++;
39234
+ }
39235
+ else {
39236
+ s2 = peg$FAILED;
39237
+ if (peg$silentFails === 0) {
39238
+ peg$fail(peg$e16);
39239
+ }
39240
+ }
39241
+ }
39242
+ }
39243
+ while (s2 !== peg$FAILED) {
39244
+ s1.push(s2);
39245
+ if (input.substr(peg$currPos, 2) === peg$c8) {
39246
+ s2 = peg$c8;
39247
+ peg$currPos += 2;
39248
+ }
39249
+ else {
39250
+ s2 = peg$FAILED;
39251
+ if (peg$silentFails === 0) {
39252
+ peg$fail(peg$e13);
39253
+ }
39254
+ }
39255
+ if (s2 === peg$FAILED) {
39256
+ if (input.substr(peg$currPos, 2) === peg$c9) {
39257
+ s2 = peg$c9;
39258
+ peg$currPos += 2;
39259
+ }
39260
+ else {
39261
+ s2 = peg$FAILED;
39262
+ if (peg$silentFails === 0) {
39263
+ peg$fail(peg$e14);
39264
+ }
39265
+ }
39266
+ if (s2 === peg$FAILED) {
39267
+ if (peg$r3.test(input.charAt(peg$currPos))) {
39268
+ s2 = input.charAt(peg$currPos);
39269
+ peg$currPos++;
39270
+ }
39271
+ else {
39272
+ s2 = peg$FAILED;
39273
+ if (peg$silentFails === 0) {
39274
+ peg$fail(peg$e16);
39275
+ }
39276
+ }
39277
+ }
39278
+ }
39279
+ }
39280
+ peg$savedPos = s0;
39281
+ s1 = peg$f11(s1);
39282
+ s0 = s1;
39283
+ }
39284
+ return s0;
39285
+ }
39286
+ function peg$parsePathSegment() {
39287
+ var s0, s1, s2, s3, s4;
39288
+ s0 = peg$currPos;
39289
+ s1 = peg$currPos;
39290
+ if (peg$r4.test(input.charAt(peg$currPos))) {
39291
+ s2 = input.charAt(peg$currPos);
39292
+ peg$currPos++;
39293
+ }
39294
+ else {
39295
+ s2 = peg$FAILED;
39296
+ if (peg$silentFails === 0) {
39297
+ peg$fail(peg$e17);
39298
+ }
39299
+ }
39300
+ if (s2 !== peg$FAILED) {
39301
+ s3 = [];
39302
+ if (peg$r5.test(input.charAt(peg$currPos))) {
39303
+ s4 = input.charAt(peg$currPos);
39304
+ peg$currPos++;
39305
+ }
39306
+ else {
39307
+ s4 = peg$FAILED;
39308
+ if (peg$silentFails === 0) {
39309
+ peg$fail(peg$e18);
39310
+ }
39311
+ }
39312
+ if (s4 !== peg$FAILED) {
39313
+ while (s4 !== peg$FAILED) {
39314
+ s3.push(s4);
39315
+ if (peg$r5.test(input.charAt(peg$currPos))) {
39316
+ s4 = input.charAt(peg$currPos);
39317
+ peg$currPos++;
39318
+ }
39319
+ else {
39320
+ s4 = peg$FAILED;
39321
+ if (peg$silentFails === 0) {
39322
+ peg$fail(peg$e18);
39323
+ }
39324
+ }
39325
+ }
39326
+ }
39327
+ else {
39328
+ s3 = peg$FAILED;
39329
+ }
39330
+ if (s3 !== peg$FAILED) {
39331
+ s2 = [s2, s3];
39332
+ s1 = s2;
39333
+ }
39334
+ else {
39335
+ peg$currPos = s1;
39336
+ s1 = peg$FAILED;
39337
+ }
39338
+ }
39339
+ else {
39340
+ peg$currPos = s1;
39341
+ s1 = peg$FAILED;
39342
+ }
39343
+ if (s1 !== peg$FAILED) {
39344
+ s0 = input.substring(s0, peg$currPos);
39345
+ }
39346
+ else {
39347
+ s0 = s1;
39348
+ }
39349
+ return s0;
39350
+ }
39351
+ function peg$parseAttributeType() {
39352
+ var s0, s1, s2, s3, s4;
39353
+ peg$silentFails++;
39354
+ s0 = peg$currPos;
39355
+ s1 = peg$currPos;
39356
+ if (peg$r6.test(input.charAt(peg$currPos))) {
39357
+ s2 = input.charAt(peg$currPos);
39358
+ peg$currPos++;
39359
+ }
39360
+ else {
39361
+ s2 = peg$FAILED;
39362
+ if (peg$silentFails === 0) {
39363
+ peg$fail(peg$e20);
39364
+ }
39365
+ }
39366
+ if (s2 !== peg$FAILED) {
39367
+ s3 = [];
39368
+ if (peg$r7.test(input.charAt(peg$currPos))) {
39369
+ s4 = input.charAt(peg$currPos);
39370
+ peg$currPos++;
39371
+ }
39372
+ else {
39373
+ s4 = peg$FAILED;
39374
+ if (peg$silentFails === 0) {
39375
+ peg$fail(peg$e21);
39376
+ }
39377
+ }
39378
+ while (s4 !== peg$FAILED) {
39379
+ s3.push(s4);
39380
+ if (peg$r7.test(input.charAt(peg$currPos))) {
39381
+ s4 = input.charAt(peg$currPos);
39382
+ peg$currPos++;
39383
+ }
39384
+ else {
39385
+ s4 = peg$FAILED;
39386
+ if (peg$silentFails === 0) {
39387
+ peg$fail(peg$e21);
39388
+ }
39389
+ }
39390
+ }
39391
+ s2 = [s2, s3];
39392
+ s1 = s2;
39393
+ }
39394
+ else {
39395
+ peg$currPos = s1;
39396
+ s1 = peg$FAILED;
39397
+ }
39398
+ if (s1 !== peg$FAILED) {
39399
+ s0 = input.substring(s0, peg$currPos);
39400
+ }
39401
+ else {
39402
+ s0 = s1;
39403
+ }
39404
+ peg$silentFails--;
39405
+ if (s0 === peg$FAILED) {
39406
+ s1 = peg$FAILED;
39407
+ if (peg$silentFails === 0) {
39408
+ peg$fail(peg$e19);
39409
+ }
39410
+ }
39411
+ return s0;
39412
+ }
39413
+ function peg$parse_() {
39414
+ var s0, s1;
39415
+ peg$silentFails++;
39416
+ if (peg$r8.test(input.charAt(peg$currPos))) {
39417
+ s0 = input.charAt(peg$currPos);
39418
+ peg$currPos++;
39419
+ }
39420
+ else {
39421
+ s0 = peg$FAILED;
39422
+ if (peg$silentFails === 0) {
39423
+ peg$fail(peg$e23);
39424
+ }
39425
+ }
39426
+ peg$silentFails--;
39427
+ if (s0 === peg$FAILED) {
39428
+ s1 = peg$FAILED;
39429
+ if (peg$silentFails === 0) {
39430
+ peg$fail(peg$e22);
39431
+ }
39432
+ }
39433
+ return s0;
39434
+ }
39435
+ peg$result = peg$startRuleFunction();
39436
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
39437
+ return peg$result;
39438
+ }
39439
+ else {
39440
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
39441
+ peg$fail(peg$endExpectation());
39442
+ }
39443
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length
39444
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
39445
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
39446
+ }
39447
+ }
39448
+ module.exports = {
39449
+ SyntaxError: peg$SyntaxError,
39450
+ parse: peg$parse
39451
+ };
39452
+ //# sourceMappingURL=iql.js.map
39453
+
39454
+ /***/ }),
39455
+
39456
+ /***/ "./node_modules/@nmshd/iql/dist/src/index.js":
39457
+ /*!***************************************************!*\
39458
+ !*** ./node_modules/@nmshd/iql/dist/src/index.js ***!
39459
+ \***************************************************/
39460
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
39461
+
39462
+ "use strict";
39463
+
39464
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
39465
+ exports.validate = exports.execute = void 0;
39466
+ const iql_js_1 = __webpack_require__(/*! ../generated/iql.js */ "./node_modules/@nmshd/iql/dist/generated/iql.js");
39467
+ /**
39468
+ * Executes IQL query, returning array of indicies of matched attributes in
39469
+ * attribute array.
39470
+ */
39471
+ function execute(iqlQuery, attributes) {
39472
+ return (0, iql_js_1.parse)(iqlQuery, { attributes });
39473
+ }
39474
+ exports.execute = execute;
39475
+ function validate(iqlQuery) {
39476
+ try {
39477
+ (0, iql_js_1.parse)(iqlQuery, { attributes: [] });
39478
+ return { isValid: true };
39479
+ }
39480
+ catch (error) {
39481
+ // FIXME: Is there a cleaner way to catch IQL SyntaxErrors?
39482
+ // For the sake of backwards compatibility peggy compiles to old
39483
+ // js without the use of classes. Thus the static type inference
39484
+ // for the SyntaxError type is severely crippled.
39485
+ if (error instanceof iql_js_1.SyntaxError) {
39486
+ const err = error; // see FIXME above.
39487
+ return {
39488
+ isValid: false,
39489
+ error: {
39490
+ message: err.message,
39491
+ location: {
39492
+ start: err.location.start,
39493
+ end: err.location.end
39494
+ }
39495
+ }
39496
+ };
39497
+ }
39498
+ return {
39499
+ isValid: false,
39500
+ error: {
39501
+ message: JSON.stringify(error),
39502
+ location: {
39503
+ start: {
39504
+ column: 0,
39505
+ line: 0,
39506
+ offset: 0
39507
+ },
39508
+ end: {
39509
+ column: 0,
39510
+ line: 0,
39511
+ offset: 0
39512
+ }
39513
+ }
39514
+ }
39515
+ };
39516
+ }
39517
+ }
39518
+ exports.validate = validate;
39519
+ //# sourceMappingURL=index.js.map
39520
+
39521
+ /***/ }),
39522
+
37818
39523
  /***/ "./node_modules/ajv-errors/dist/index.js":
37819
39524
  /*!***********************************************!*\
37820
39525
  !*** ./node_modules/ajv-errors/dist/index.js ***!