@cratis/arc 20.40.1 → 20.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/cjs/index.d.ts +1 -0
  2. package/dist/cjs/index.d.ts.map +1 -1
  3. package/dist/cjs/index.js +1 -0
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/queries/QueryResult.d.ts.map +1 -1
  6. package/dist/cjs/queries/QueryResult.js +15 -5
  7. package/dist/cjs/queries/QueryResult.js.map +1 -1
  8. package/dist/cjs/queries/ValidateRequestArguments.js +3 -3
  9. package/dist/cjs/queries/ValidateRequestArguments.js.map +1 -1
  10. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.d.ts +2 -0
  11. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.d.ts.map +1 -0
  12. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.d.ts +2 -0
  13. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.d.ts.map +1 -0
  14. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.d.ts +2 -0
  15. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.d.ts.map +1 -0
  16. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.d.ts +2 -0
  17. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.d.ts.map +1 -0
  18. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.d.ts +2 -0
  19. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.d.ts.map +1 -0
  20. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.d.ts +2 -0
  21. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.d.ts.map +1 -0
  22. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.d.ts +2 -0
  23. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.d.ts.map +1 -0
  24. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.d.ts +2 -0
  25. package/dist/cjs/queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.d.ts.map +1 -0
  26. package/dist/esm/index.d.ts +1 -0
  27. package/dist/esm/index.d.ts.map +1 -1
  28. package/dist/esm/index.js +1 -0
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/queries/QueryResult.d.ts.map +1 -1
  31. package/dist/esm/queries/QueryResult.js +15 -5
  32. package/dist/esm/queries/QueryResult.js.map +1 -1
  33. package/dist/esm/queries/ValidateRequestArguments.js +3 -3
  34. package/dist/esm/queries/ValidateRequestArguments.js.map +1 -1
  35. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.d.ts +2 -0
  36. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.d.ts.map +1 -0
  37. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.js +9 -0
  38. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.js.map +1 -0
  39. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.d.ts +2 -0
  40. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.d.ts.map +1 -0
  41. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.js +9 -0
  42. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.js.map +1 -0
  43. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.d.ts +2 -0
  44. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.d.ts.map +1 -0
  45. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.js +9 -0
  46. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.js.map +1 -0
  47. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.d.ts +2 -0
  48. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.d.ts.map +1 -0
  49. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.js +9 -0
  50. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.js.map +1 -0
  51. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.d.ts +2 -0
  52. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.d.ts.map +1 -0
  53. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.js +9 -0
  54. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.js.map +1 -0
  55. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.d.ts +2 -0
  56. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.d.ts.map +1 -0
  57. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.js +9 -0
  58. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.js.map +1 -0
  59. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.d.ts +2 -0
  60. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.d.ts.map +1 -0
  61. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.js +9 -0
  62. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.js.map +1 -0
  63. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.d.ts +2 -0
  64. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.d.ts.map +1 -0
  65. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.js +9 -0
  66. package/dist/esm/queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.js.map +1 -0
  67. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  68. package/index.ts +1 -0
  69. package/package.json +2 -2
  70. package/queries/QueryResult.ts +15 -5
  71. package/queries/ValidateRequestArguments.ts +3 -3
  72. package/queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.ts +14 -0
  73. package/queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.ts +14 -0
  74. package/queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.ts +14 -0
  75. package/queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.ts +14 -0
  76. package/queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.ts +14 -0
  77. package/queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.ts +14 -0
  78. package/queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.ts +14 -0
  79. package/queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.ts +14 -0
@@ -1,3 +1,4 @@
1
+ import '@cratis/fundamentals/reflection';
1
2
  import * as commands from './commands';
2
3
  import * as identity from './identity';
3
4
  import * as messaging from './messaging';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,UAAU,GACb,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,OAAO,iCAAiC,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,UAAU,GACb,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ require('@cratis/fundamentals/reflection');
3
4
  var index = require('./commands/index.js');
4
5
  var index$1 = require('./identity/index.js');
5
6
  var index$2 = require('./messaging/index.js');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryResult.d.ts","sourceRoot":"","sources":["../../../queries/QueryResult.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE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B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAG1B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAGhC,QAAQ,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAG/C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAGrC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IAQrC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAKxC,IAAI,OAAO,IAAI,OAAO,CAQrB;CACJ"}
@@ -72,16 +72,19 @@ class QueryResult {
72
72
  this.paging.totalPages = result.paging.totalPages;
73
73
  if (result.data) {
74
74
  let data = result.data;
75
+ const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;
75
76
  if (enumerable) {
76
77
  if (Array.isArray(result.data)) {
77
- data = fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, data);
78
+ data = isPrimitive
79
+ ? Array.from(result.data)
80
+ : fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, data);
78
81
  }
79
82
  else {
80
83
  data = [];
81
84
  }
82
85
  }
83
86
  else {
84
- data = fundamentals.JsonSerializer.deserializeFromInstance(instanceType, data);
87
+ data = isPrimitive ? data : fundamentals.JsonSerializer.deserializeFromInstance(instanceType, data);
85
88
  }
86
89
  this.data = data;
87
90
  }
@@ -89,10 +92,17 @@ class QueryResult {
89
92
  this.data = (enumerable ? [] : null);
90
93
  }
91
94
  if (enumerable && result.changeSet) {
95
+ const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;
92
96
  this.changeSet = {
93
- added: fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),
94
- replaced: fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),
95
- removed: fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),
97
+ added: isPrimitive
98
+ ? Array.from(result.changeSet.added ?? [])
99
+ : fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),
100
+ replaced: isPrimitive
101
+ ? Array.from(result.changeSet.replaced ?? [])
102
+ : fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),
103
+ removed: isPrimitive
104
+ ? Array.from(result.changeSet.removed ?? [])
105
+ : fundamentals.JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),
96
106
  };
97
107
  }
98
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueryResult.js","sources":["../../../queries/QueryResult.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor, JsonSerializer } from '@cratis/fundamentals';\nimport { ValidationResult } from '../validation/ValidationResult';\nimport { IQueryResult } from './IQueryResult';\nimport { PagingInfo } from './PagingInfo';\nimport { ChangeSet } from './ChangeSet';\n\ntype ServerQueryResult = {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n data: any;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n isSuccess: boolean;\n isAuthorized: boolean;\n isValid: boolean;\n hasExceptions: boolean;\n validationResults: ServerValidationResult[];\n exceptionMessages: string[];\n exceptionStackTrace: string;\n paging: ServerPagingInfo;\n changeSet?: ServerChangeSet;\n}\n\ntype ServerChangeSet = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n added: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n replaced: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n removed: any[];\n}\n\ntype ServerValidationResult = {\n severity: number;\n message: string;\n members: string[];\n state: object;\n}\n\ntype ServerPagingInfo = {\n page: number;\n size: number; \n totalItems: number;\n totalPages: number;\n}\n\n/**\n * Represents the result from executing a {@link IQueryFor}.\n * @template TDataType The data type.\n */\nexport class QueryResult<TDataType = object> implements IQueryResult<TDataType> {\n\n static empty<TDataType>(defaultValue: TDataType): QueryResult<TDataType> {\n return new QueryResult({\n data: defaultValue as object,\n isSuccess: true,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n\n }, Object, false);\n }\n\n static unauthorized<TDataType>(): QueryResult<TDataType> {\n return new QueryResult({\n data: null as unknown as object,\n isSuccess: false,\n isAuthorized: false,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n }\n\n static noSuccess: QueryResult = new QueryResult({\n data: {},\n isSuccess: false,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n\n /**\n * Creates an instance of query result.\n * @param {*} result The raw result from the backend.\n * @param {Constructor} instanceType The type of instance to deserialize.\n * @param {boolean} enumerable Whether or not the result is supposed be an enumerable or not.\n */\n constructor(result: ServerQueryResult, instanceType: Constructor, enumerable: boolean) {\n this.isSuccess = result.isSuccess;\n this.isAuthorized = result.isAuthorized;\n this.isValid = result.isValid;\n this.hasExceptions = result.hasExceptions;\n this.validationResults = result.validationResults.map(_ => new ValidationResult(_.severity, _.message, _.members, _.state));\n this.exceptionMessages = result.exceptionMessages;\n this.exceptionStackTrace = result.exceptionStackTrace;\n this.paging = new PagingInfo();\n this.paging.page = result.paging.page;\n this.paging.size = result.paging.size;\n this.paging.totalItems = result.paging.totalItems;\n this.paging.totalPages = result.paging.totalPages;\n\n if (result.data) {\n let data: object = result.data;\n if (enumerable) {\n if (Array.isArray(result.data)) {\n data = JsonSerializer.deserializeArrayFromInstance(instanceType, data);\n } else {\n data = [];\n }\n } else {\n data = JsonSerializer.deserializeFromInstance(instanceType, data);\n }\n\n this.data = data as TDataType;\n } else {\n this.data = (enumerable ? [] : null) as TDataType;\n }\n\n if (enumerable && result.changeSet) {\n this.changeSet = {\n added: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),\n replaced: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),\n removed: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),\n } as ChangeSet<unknown>;\n }\n }\n\n /** @inheritdoc */\n readonly data: TDataType;\n\n /** @inheritdoc */\n readonly paging: PagingInfo;\n\n /** @inheritdoc */\n readonly isSuccess: boolean;\n\n /** @inheritdoc */\n readonly isAuthorized: boolean;\n\n /** @inheritdoc */\n readonly isValid: boolean;\n\n /** @inheritdoc */\n readonly hasExceptions: boolean;\n\n /** @inheritdoc */\n readonly validationResults: ValidationResult[];\n\n /** @inheritdoc */\n readonly exceptionMessages: string[];\n\n /** @inheritdoc */\n readonly exceptionStackTrace: string;\n\n /**\n * Gets the optional change set describing what changed since the previous update.\n * Set by the server when the delta transfer mode is active.\n * When present, clients can apply the delta to their local state rather than replacing\n * the full dataset.\n */\n readonly changeSet?: ChangeSet<unknown>;\n\n /**\n * Gets whether or not the query has data.\n */\n get hasData(): boolean {\n if (this.data) {\n if (Array.isArray(this.data)) {\n return this.data.length > 0;\n }\n return true;\n }\n return false;\n }\n}\n"],"names":["ValidationResult","PagingInfo","JsonSerializer"],"mappings":";;;;;;MAmDa,WAAW,CAAA;IAEpB,OAAO,KAAK,CAAY,YAAuB,EAAA;QAC3C,OAAO,IAAI,WAAW,CAAC;AACnB,YAAA,IAAI,EAAE,YAAsB;AAC5B,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,mBAAmB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BACH,IAAI,GAAGA,2BAAc,CAAC,uBAAuB,CAAC,YAAY,EAAE,IAAI,CAAC;YACrE;AAEA,YAAA,IAAI,CAAC,IAAI,GAAG,IAAiB;QACjC;aAAO;AACH,YAAA,IAAI,CAAC,IAAI,IAAI,UAAU,GAAG,EAAE,GAAG,IAAI,CAAc;QACrD;AAEA,QAAA,IAAI,UAAU,IAAI,MAAM,CAAC,SAAS,EAAE;YAChC,IAAI,CAAC,SAAS,GAAG;AACb,gBAAA,KAAK,EAAEA,2BAAc,CAAC,4BAA4B,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;AAC9F,gBAAA,QAAQ,EAAEA,2BAAc,CAAC,4BAA4B,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC;AACpG,gBAAA,OAAO,EAAEA,2BAAc,CAAC,4BAA4B,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC;aAC/E;QAC3B;IACJ;AAGS,IAAA,IAAI;AAGJ,IAAA,MAAM;AAGN,IAAA,SAAS;AAGT,IAAA,YAAY;AAGZ,IAAA,OAAO;AAGP,IAAA,aAAa;AAGb,IAAA,iBAAiB;AAGjB,IAAA,iBAAiB;AAGjB,IAAA,mBAAmB;AAQnB,IAAA,SAAS;AAKlB,IAAA,IAAI,OAAO,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC1B,gBAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YAC/B;AACA,YAAA,OAAO,IAAI;QACf;AACA,QAAA,OAAO,KAAK;IAChB;;;;;"}
1
+ {"version":3,"file":"QueryResult.js","sources":["../../../queries/QueryResult.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor, JsonSerializer } from '@cratis/fundamentals';\nimport { ValidationResult } from '../validation/ValidationResult';\nimport { IQueryResult } from './IQueryResult';\nimport { PagingInfo } from './PagingInfo';\nimport { ChangeSet } from './ChangeSet';\n\ntype ServerQueryResult = {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n data: any;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n isSuccess: boolean;\n isAuthorized: boolean;\n isValid: boolean;\n hasExceptions: boolean;\n validationResults: ServerValidationResult[];\n exceptionMessages: string[];\n exceptionStackTrace: string;\n paging: ServerPagingInfo;\n changeSet?: ServerChangeSet;\n}\n\ntype ServerChangeSet = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n added: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n replaced: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n removed: any[];\n}\n\ntype ServerValidationResult = {\n severity: number;\n message: string;\n members: string[];\n state: object;\n}\n\ntype ServerPagingInfo = {\n page: number;\n size: number; \n totalItems: number;\n totalPages: number;\n}\n\n/**\n * Represents the result from executing a {@link IQueryFor}.\n * @template TDataType The data type.\n */\nexport class QueryResult<TDataType = object> implements IQueryResult<TDataType> {\n\n static empty<TDataType>(defaultValue: TDataType): QueryResult<TDataType> {\n return new QueryResult({\n data: defaultValue as object,\n isSuccess: true,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n\n }, Object, false);\n }\n\n static unauthorized<TDataType>(): QueryResult<TDataType> {\n return new QueryResult({\n data: null as unknown as object,\n isSuccess: false,\n isAuthorized: false,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n }\n\n static noSuccess: QueryResult = new QueryResult({\n data: {},\n isSuccess: false,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n\n /**\n * Creates an instance of query result.\n * @param {*} result The raw result from the backend.\n * @param {Constructor} instanceType The type of instance to deserialize.\n * @param {boolean} enumerable Whether or not the result is supposed be an enumerable or not.\n */\n constructor(result: ServerQueryResult, instanceType: Constructor, enumerable: boolean) {\n this.isSuccess = result.isSuccess;\n this.isAuthorized = result.isAuthorized;\n this.isValid = result.isValid;\n this.hasExceptions = result.hasExceptions;\n this.validationResults = result.validationResults.map(_ => new ValidationResult(_.severity, _.message, _.members, _.state));\n this.exceptionMessages = result.exceptionMessages;\n this.exceptionStackTrace = result.exceptionStackTrace;\n this.paging = new PagingInfo();\n this.paging.page = result.paging.page;\n this.paging.size = result.paging.size;\n this.paging.totalItems = result.paging.totalItems;\n this.paging.totalPages = result.paging.totalPages;\n\n if (result.data) {\n let data: object = result.data;\n const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;\n if (enumerable) {\n if (Array.isArray(result.data)) {\n data = isPrimitive\n ? Array.from(result.data)\n : JsonSerializer.deserializeArrayFromInstance(instanceType, data);\n } else {\n data = [];\n }\n } else {\n data = isPrimitive ? data : JsonSerializer.deserializeFromInstance(instanceType, data);\n }\n\n this.data = data as TDataType;\n } else {\n this.data = (enumerable ? [] : null) as TDataType;\n }\n\n if (enumerable && result.changeSet) {\n const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;\n this.changeSet = {\n added: isPrimitive\n ? Array.from(result.changeSet.added ?? [])\n : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),\n replaced: isPrimitive\n ? Array.from(result.changeSet.replaced ?? [])\n : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),\n removed: isPrimitive\n ? Array.from(result.changeSet.removed ?? [])\n : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),\n } as ChangeSet<unknown>;\n }\n }\n\n /** @inheritdoc */\n readonly data: TDataType;\n\n /** @inheritdoc */\n readonly paging: PagingInfo;\n\n /** @inheritdoc */\n readonly isSuccess: boolean;\n\n /** @inheritdoc */\n readonly isAuthorized: boolean;\n\n /** @inheritdoc */\n readonly isValid: boolean;\n\n /** @inheritdoc */\n readonly hasExceptions: boolean;\n\n /** @inheritdoc */\n readonly validationResults: ValidationResult[];\n\n /** @inheritdoc */\n readonly exceptionMessages: string[];\n\n /** @inheritdoc */\n readonly exceptionStackTrace: string;\n\n /**\n * Gets the optional change set describing what changed since the previous update.\n * Set by the server when the delta transfer mode is active.\n * When present, clients can apply the delta to their local state rather than replacing\n * the full dataset.\n */\n readonly changeSet?: ChangeSet<unknown>;\n\n /**\n * Gets whether or not the query has data.\n */\n get hasData(): boolean {\n if (this.data) {\n if (Array.isArray(this.data)) {\n return this.data.length > 0;\n }\n return true;\n }\n return false;\n }\n}\n"],"names":["ValidationResult","PagingInfo","JsonSerializer"],"mappings":";;;;;;MAmDa,WAAW,CAAA;IAEpB,OAAO,KAAK,CAAY,YAAuB,EAAA;QAC3C,OAAO,IAAI,WAAW,CAAC;AACnB,YAAA,IAAI,EAAE,YAAsB;AAC5B,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,mBAAmB,EAAE,EAAE;AACvB,YAAA,MAAM,EAAE;AACJ,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,IAAI,EAAE;AACT;AAEJ,SAAA,EAAE,MAAM,EAAE,KAAK,CAAC;IACrB;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GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC1B,gBAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YAC/B;AACA,YAAA,OAAO,IAAI;QACf;AACA,QAAA,OAAO,KAAK;IAChB;;;;;"}
@@ -9,9 +9,9 @@ function ValidateRequestArguments(requestName, expectedRequestArguments, actualA
9
9
  else {
10
10
  for (const argument of expectedRequestArguments) {
11
11
  if (!actualArguments.hasOwnProperty(argument) ||
12
- actualArguments[argument] == undefined ||
13
- actualArguments[argument] == null ||
14
- actualArguments[argument] == '') {
12
+ actualArguments[argument] === undefined ||
13
+ actualArguments[argument] === null ||
14
+ actualArguments[argument] === '') {
15
15
  missing.push(argument);
16
16
  }
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ValidateRequestArguments.js","sources":["../../../queries/ValidateRequestArguments.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Validate request arguments.\n * @param {string} requestName Name of request.\n * @param {string[]} expectedRequestArguments Array of all expected arguments.\n * @param {*} actualArguments Object containing the arguments.\n * @returns True if valid, false if not.\n*/\nexport function ValidateRequestArguments(requestName: string, expectedRequestArguments: string[], actualArguments?: object): boolean {\n if (expectedRequestArguments.length > 0) {\n const missing: string[] = [];\n\n if (!actualArguments) {\n expectedRequestArguments.forEach(_ => missing.push(_));\n } else {\n for (const argument of expectedRequestArguments) {\n if (!actualArguments.hasOwnProperty(argument) ||\n actualArguments[argument] == undefined ||\n actualArguments[argument] == null ||\n actualArguments[argument] == '') {\n missing.push(argument);\n }\n }\n }\n\n if (missing.length > 0) {\n const missingArgumentsString = missing.join(', ');\n console.log(`Warning: Missing (${missingArgumentsString}) arguments for request (${requestName}). Will not perform.`);\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"mappings":";;SAUgB,wBAAwB,CAAC,WAAmB,EAAE,wBAAkC,EAAE,eAAwB,EAAA;AACtH,IAAA,IAAI,wBAAwB,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,MAAM,OAAO,GAAa,EAAE;QAE5B,IAAI,CAAC,eAAe,EAAE;AAClB,YAAA,wBAAwB,CAAC,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D;aAAO;AACH,YAAA,KAAK,MAAM,QAAQ,IAAI,wBAAwB,EAAE;AAC7C,gBAAA,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC;AACzC,oBAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,SAAS;AACtC,oBAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,IAAI;AACjC,oBAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE;AACjC,oBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC1B;YACJ;QACJ;AAEA,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,MAAM,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,CAAA,kBAAA,EAAqB,sBAAsB,CAAA,yBAAA,EAA4B,WAAW,CAAA,oBAAA,CAAsB,CAAC;AACrH,YAAA,OAAO,KAAK;QAChB;IACJ;AAEA,IAAA,OAAO,IAAI;AACf;;;;"}
1
+ {"version":3,"file":"ValidateRequestArguments.js","sources":["../../../queries/ValidateRequestArguments.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Validate request arguments.\n * @param {string} requestName Name of request.\n * @param {string[]} expectedRequestArguments Array of all expected arguments.\n * @param {*} actualArguments Object containing the arguments.\n * @returns True if valid, false if not.\n*/\nexport function ValidateRequestArguments(requestName: string, expectedRequestArguments: string[], actualArguments?: object): boolean {\n if (expectedRequestArguments.length > 0) {\n const missing: string[] = [];\n\n if (!actualArguments) {\n expectedRequestArguments.forEach(_ => missing.push(_));\n } else {\n for (const argument of expectedRequestArguments) {\n if (!actualArguments.hasOwnProperty(argument) ||\n actualArguments[argument] === undefined ||\n actualArguments[argument] === null ||\n actualArguments[argument] === '') {\n missing.push(argument);\n }\n }\n }\n\n if (missing.length > 0) {\n const missingArgumentsString = missing.join(', ');\n console.log(`Warning: Missing (${missingArgumentsString}) arguments for request (${requestName}). Will not perform.`);\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"mappings":";;SAUgB,wBAAwB,CAAC,WAAmB,EAAE,wBAAkC,EAAE,eAAwB,EAAA;AACtH,IAAA,IAAI,wBAAwB,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,MAAM,OAAO,GAAa,EAAE;QAE5B,IAAI,CAAC,eAAe,EAAE;AAClB,YAAA,wBAAwB,CAAC,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D;aAAO;AACH,YAAA,KAAK,MAAM,QAAQ,IAAI,wBAAwB,EAAE;AAC7C,gBAAA,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC;AACzC,oBAAA,eAAe,CAAC,QAAQ,CAAC,KAAK,SAAS;AACvC,oBAAA,eAAe,CAAC,QAAQ,CAAC,KAAK,IAAI;AAClC,oBAAA,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE;AAClC,oBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC1B;YACJ;QACJ;AAEA,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,MAAM,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,CAAA,kBAAA,EAAqB,sBAAsB,CAAA,yBAAA,EAA4B,WAAW,CAAA,oBAAA,CAAsB,CAAC;AACrH,YAAA,OAAO,KAAK;QAChB;IACJ;AAEA,IAAA,OAAO,IAAI;AACf;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_empty_string_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_empty_string_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_missing_property.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_missing_property.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_no_required_arguments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_no_required_arguments.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_null_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_numeric_zero_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_numeric_zero_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_undefined_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_valid_string_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_valid_string_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=without_arguments_object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"without_arguments_object.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.ts"],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import '@cratis/fundamentals/reflection';
1
2
  import * as commands from './commands';
2
3
  import * as identity from './identity';
3
4
  import * as messaging from './messaging';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,UAAU,GACb,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,OAAO,iCAAiC,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,UAAU,GACb,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import '@cratis/fundamentals/reflection';
1
2
  import * as index from './commands/index.js';
2
3
  export { index as commands };
3
4
  import * as index$1 from './identity/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryResult.d.ts","sourceRoot":"","sources":["../../../queries/QueryResult.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,iBAAiB,GAAG;IAErB,IAAI,EAAE,GAAG,CAAC;IAEV,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE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= result.paging.totalPages;
71
71
  if (result.data) {
72
72
  let data = result.data;
73
+ const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;
73
74
  if (enumerable) {
74
75
  if (Array.isArray(result.data)) {
75
- data = JsonSerializer.deserializeArrayFromInstance(instanceType, data);
76
+ data = isPrimitive
77
+ ? Array.from(result.data)
78
+ : JsonSerializer.deserializeArrayFromInstance(instanceType, data);
76
79
  }
77
80
  else {
78
81
  data = [];
79
82
  }
80
83
  }
81
84
  else {
82
- data = JsonSerializer.deserializeFromInstance(instanceType, data);
85
+ data = isPrimitive ? data : JsonSerializer.deserializeFromInstance(instanceType, data);
83
86
  }
84
87
  this.data = data;
85
88
  }
@@ -87,10 +90,17 @@ class QueryResult {
87
90
  this.data = (enumerable ? [] : null);
88
91
  }
89
92
  if (enumerable && result.changeSet) {
93
+ const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;
90
94
  this.changeSet = {
91
- added: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),
92
- replaced: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),
93
- removed: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),
95
+ added: isPrimitive
96
+ ? Array.from(result.changeSet.added ?? [])
97
+ : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),
98
+ replaced: isPrimitive
99
+ ? Array.from(result.changeSet.replaced ?? [])
100
+ : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),
101
+ removed: isPrimitive
102
+ ? Array.from(result.changeSet.removed ?? [])
103
+ : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),
94
104
  };
95
105
  }
96
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueryResult.js","sources":["../../../queries/QueryResult.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor, JsonSerializer } from '@cratis/fundamentals';\nimport { ValidationResult } from '../validation/ValidationResult';\nimport { IQueryResult } from './IQueryResult';\nimport { PagingInfo } from './PagingInfo';\nimport { ChangeSet } from './ChangeSet';\n\ntype ServerQueryResult = {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n data: any;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n isSuccess: boolean;\n isAuthorized: boolean;\n isValid: boolean;\n hasExceptions: boolean;\n validationResults: ServerValidationResult[];\n exceptionMessages: string[];\n exceptionStackTrace: string;\n paging: ServerPagingInfo;\n changeSet?: ServerChangeSet;\n}\n\ntype ServerChangeSet = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n added: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n replaced: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n removed: any[];\n}\n\ntype ServerValidationResult = {\n severity: number;\n message: string;\n members: string[];\n state: object;\n}\n\ntype ServerPagingInfo = {\n page: number;\n size: number; \n totalItems: number;\n totalPages: number;\n}\n\n/**\n * Represents the result from executing a {@link IQueryFor}.\n * @template TDataType The data type.\n */\nexport class QueryResult<TDataType = object> implements IQueryResult<TDataType> {\n\n static empty<TDataType>(defaultValue: TDataType): QueryResult<TDataType> {\n return new QueryResult({\n data: defaultValue as object,\n isSuccess: true,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n\n }, Object, false);\n }\n\n static unauthorized<TDataType>(): QueryResult<TDataType> {\n return new QueryResult({\n data: null as unknown as object,\n isSuccess: false,\n isAuthorized: false,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n }\n\n static noSuccess: QueryResult = new QueryResult({\n data: {},\n isSuccess: false,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n\n /**\n * Creates an instance of query result.\n * @param {*} result The raw result from the backend.\n * @param {Constructor} instanceType The type of instance to deserialize.\n * @param {boolean} enumerable Whether or not the result is supposed be an enumerable or not.\n */\n constructor(result: ServerQueryResult, instanceType: Constructor, enumerable: boolean) {\n this.isSuccess = result.isSuccess;\n this.isAuthorized = result.isAuthorized;\n this.isValid = result.isValid;\n this.hasExceptions = result.hasExceptions;\n this.validationResults = result.validationResults.map(_ => new ValidationResult(_.severity, _.message, _.members, _.state));\n this.exceptionMessages = result.exceptionMessages;\n this.exceptionStackTrace = result.exceptionStackTrace;\n this.paging = new PagingInfo();\n this.paging.page = result.paging.page;\n this.paging.size = result.paging.size;\n this.paging.totalItems = result.paging.totalItems;\n this.paging.totalPages = result.paging.totalPages;\n\n if (result.data) {\n let data: object = result.data;\n if (enumerable) {\n if (Array.isArray(result.data)) {\n data = JsonSerializer.deserializeArrayFromInstance(instanceType, data);\n } else {\n data = [];\n }\n } else {\n data = JsonSerializer.deserializeFromInstance(instanceType, data);\n }\n\n this.data = data as TDataType;\n } else {\n this.data = (enumerable ? [] : null) as TDataType;\n }\n\n if (enumerable && result.changeSet) {\n this.changeSet = {\n added: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),\n replaced: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),\n removed: JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),\n } as ChangeSet<unknown>;\n }\n }\n\n /** @inheritdoc */\n readonly data: TDataType;\n\n /** @inheritdoc */\n readonly paging: PagingInfo;\n\n /** @inheritdoc */\n readonly isSuccess: boolean;\n\n /** @inheritdoc */\n readonly isAuthorized: boolean;\n\n /** @inheritdoc */\n readonly isValid: boolean;\n\n /** @inheritdoc */\n readonly hasExceptions: boolean;\n\n /** @inheritdoc */\n readonly validationResults: ValidationResult[];\n\n /** @inheritdoc */\n readonly exceptionMessages: string[];\n\n /** @inheritdoc */\n readonly exceptionStackTrace: string;\n\n /**\n * Gets the optional change set describing what changed since the previous update.\n * Set by the server when the delta transfer mode is active.\n * When present, clients can apply the delta to their local state rather than replacing\n * the full dataset.\n */\n readonly changeSet?: ChangeSet<unknown>;\n\n /**\n * Gets whether or not the query has data.\n */\n get hasData(): boolean {\n if (this.data) {\n if (Array.isArray(this.data)) {\n return this.data.length > 0;\n }\n return true;\n }\n return false;\n }\n}\n"],"names":[],"mappings":";;;;MAmDa,WAAW,CAAA;IAEpB,OAAO,KAAK,CAAY,YAAuB,EAAA;QAC3C,OAAO,IAAI,WAAW,CAAC;AACnB,YAAA,IAAI,EAAE,YAAsB;AAC5B,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,mBAAmB,EAAE,EAAE;AACvB,YAAA,MAAM,EAAE;AACJ,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,IAAI,EAAE;AACT;AAEJ,SAAA,EAAE,MAAM,EAAE,KAAK,CAAC;IACrB;AAEA,IAAA,OAAO,YAAY,GAAA;QACf,OAAO,IAAI,WAAW,CAAC;AACnB,YAAA,IAAI,EAAE,IAAyB;AAC/B,YAAA,SAAS,EAAE,KAAK;AAChB,YAAA,YAAY,EAAE,KAAK;AACnB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,mBAAmB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E,CAAC;AACpG,gBAAA,OAAO,EAAE,cAAc,CAAC,4BAA4B,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC;aAC/E;QAC3B;IACJ;AAGS,IAAA,IAAI;AAGJ,IAAA,MAAM;AAGN,IAAA,SAAS;AAGT,IAAA,YAAY;AAGZ,IAAA,OAAO;AAGP,IAAA,aAAa;AAGb,IAAA,iBAAiB;AAGjB,IAAA,iBAAiB;AAGjB,IAAA,mBAAmB;AAQnB,IAAA,SAAS;AAKlB,IAAA,IAAI,OAAO,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC1B,gBAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YAC/B;AACA,YAAA,OAAO,IAAI;QACf;AACA,QAAA,OAAO,KAAK;IAChB;;;;;"}
1
+ {"version":3,"file":"QueryResult.js","sources":["../../../queries/QueryResult.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor, JsonSerializer } from '@cratis/fundamentals';\nimport { ValidationResult } from '../validation/ValidationResult';\nimport { IQueryResult } from './IQueryResult';\nimport { PagingInfo } from './PagingInfo';\nimport { ChangeSet } from './ChangeSet';\n\ntype ServerQueryResult = {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n data: any;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n isSuccess: boolean;\n isAuthorized: boolean;\n isValid: boolean;\n hasExceptions: boolean;\n validationResults: ServerValidationResult[];\n exceptionMessages: string[];\n exceptionStackTrace: string;\n paging: ServerPagingInfo;\n changeSet?: ServerChangeSet;\n}\n\ntype ServerChangeSet = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n added: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n replaced: any[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n removed: any[];\n}\n\ntype ServerValidationResult = {\n severity: number;\n message: string;\n members: string[];\n state: object;\n}\n\ntype ServerPagingInfo = {\n page: number;\n size: number; \n totalItems: number;\n totalPages: number;\n}\n\n/**\n * Represents the result from executing a {@link IQueryFor}.\n * @template TDataType The data type.\n */\nexport class QueryResult<TDataType = object> implements IQueryResult<TDataType> {\n\n static empty<TDataType>(defaultValue: TDataType): QueryResult<TDataType> {\n return new QueryResult({\n data: defaultValue as object,\n isSuccess: true,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n\n }, Object, false);\n }\n\n static unauthorized<TDataType>(): QueryResult<TDataType> {\n return new QueryResult({\n data: null as unknown as object,\n isSuccess: false,\n isAuthorized: false,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n }\n\n static noSuccess: QueryResult = new QueryResult({\n data: {},\n isSuccess: false,\n isAuthorized: true,\n isValid: true,\n hasExceptions: false,\n validationResults: [],\n exceptionMessages: [],\n exceptionStackTrace: '',\n paging: {\n totalItems: 0,\n totalPages: 0,\n page: 0,\n size: 0\n }\n }, Object, false);\n\n /**\n * Creates an instance of query result.\n * @param {*} result The raw result from the backend.\n * @param {Constructor} instanceType The type of instance to deserialize.\n * @param {boolean} enumerable Whether or not the result is supposed be an enumerable or not.\n */\n constructor(result: ServerQueryResult, instanceType: Constructor, enumerable: boolean) {\n this.isSuccess = result.isSuccess;\n this.isAuthorized = result.isAuthorized;\n this.isValid = result.isValid;\n this.hasExceptions = result.hasExceptions;\n this.validationResults = result.validationResults.map(_ => new ValidationResult(_.severity, _.message, _.members, _.state));\n this.exceptionMessages = result.exceptionMessages;\n this.exceptionStackTrace = result.exceptionStackTrace;\n this.paging = new PagingInfo();\n this.paging.page = result.paging.page;\n this.paging.size = result.paging.size;\n this.paging.totalItems = result.paging.totalItems;\n this.paging.totalPages = result.paging.totalPages;\n\n if (result.data) {\n let data: object = result.data;\n const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;\n if (enumerable) {\n if (Array.isArray(result.data)) {\n data = isPrimitive\n ? Array.from(result.data)\n : JsonSerializer.deserializeArrayFromInstance(instanceType, data);\n } else {\n data = [];\n }\n } else {\n data = isPrimitive ? data : JsonSerializer.deserializeFromInstance(instanceType, data);\n }\n\n this.data = data as TDataType;\n } else {\n this.data = (enumerable ? [] : null) as TDataType;\n }\n\n if (enumerable && result.changeSet) {\n const isPrimitive = instanceType === String || instanceType === Number || instanceType === Boolean;\n this.changeSet = {\n added: isPrimitive\n ? Array.from(result.changeSet.added ?? [])\n : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.added ?? []),\n replaced: isPrimitive\n ? Array.from(result.changeSet.replaced ?? [])\n : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.replaced ?? []),\n removed: isPrimitive\n ? Array.from(result.changeSet.removed ?? [])\n : JsonSerializer.deserializeArrayFromInstance(instanceType, result.changeSet.removed ?? []),\n } as ChangeSet<unknown>;\n }\n }\n\n /** @inheritdoc */\n readonly data: TDataType;\n\n /** @inheritdoc */\n readonly paging: PagingInfo;\n\n /** @inheritdoc */\n readonly isSuccess: boolean;\n\n /** @inheritdoc */\n readonly isAuthorized: boolean;\n\n /** @inheritdoc */\n readonly isValid: boolean;\n\n /** @inheritdoc */\n readonly hasExceptions: boolean;\n\n /** @inheritdoc */\n readonly validationResults: ValidationResult[];\n\n /** @inheritdoc */\n readonly exceptionMessages: string[];\n\n /** @inheritdoc */\n readonly exceptionStackTrace: string;\n\n /**\n * Gets the optional change set describing what changed since the previous update.\n * Set by the server when the delta transfer mode is active.\n * When present, clients can apply the delta to their local state rather than replacing\n * the full dataset.\n */\n readonly changeSet?: ChangeSet<unknown>;\n\n /**\n * Gets whether or not the query has data.\n */\n get hasData(): boolean {\n if (this.data) {\n if (Array.isArray(this.data)) {\n return this.data.length > 0;\n }\n return true;\n }\n return false;\n }\n}\n"],"names":[],"mappings":";;;;MAmDa,WAAW,CAAA;IAEpB,OAAO,KAAK,CAAY,YAAuB,EAAA;QAC3C,OAAO,IAAI,WAAW,CAAC;AACnB,YAAA,IAAI,EAAE,YAAsB;AAC5B,YAAA,SAAS,EAAE,IAAI;AACf,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,mBAAmB,EAAE,EAAE;AACvB,YAAA,MAAM,EAAE;AACJ,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,IAAI,EAAE;AACT;AAEJ,SAAA,EAAE,MAAM,EAAE,KAAK,CAAC;IACrB;AAEA,IAAA,OAAO,YAAY,GAAA;QACf,OAAO,IAAI,WAAW,CAAC;AACnB,YAAA,IAAI,EAAE,IAAyB;AAC/B,YAAA,SAAS,EAAE,KAAK;AAChB,YAAA,YAAY,EAAE,KAAK;AACnB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,iBAAiB,EAAE,EAAE;AACrB,YAAA,mBAAmB,EAAE,EAAE;AACvB,YAAA,MAAM,EAAE;AACJ,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,UAAU,EAAE,CAAC;AACb,gBAAA,IAAI,EAAE,CAAC;AACP,gBAAA,IAAI,EAAE;AACT;AACJ,SAAA,EAAE,MAAM,EAAE,KAAK,CAAC;IACrB;AAEA,IAAA,OAAO,SAAS,GAAgB,IAAI,WAAW,CA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AAI,EAAE,CAAC;AAC7F,gBAAA,QAAQ,EAAE;AACN,sBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,IAAI,EAAE;AAC5C,sBAAE,cAAc,CAAC,4BAA4B,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC;AAChG,gBAAA,OAAO,EAAE;AACL,sBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE;AAC3C,sBAAE,cAAc,CAAC,4BAA4B,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC;aAC5E;QAC3B;IACJ;AAGS,IAAA,IAAI;AAGJ,IAAA,MAAM;AAGN,IAAA,SAAS;AAGT,IAAA,YAAY;AAGZ,IAAA,OAAO;AAGP,IAAA,aAAa;AAGb,IAAA,iBAAiB;AAGjB,IAAA,iBAAiB;AAGjB,IAAA,mBAAmB;AAQnB,IAAA,SAAS;AAKlB,IAAA,IAAI,OAAO,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC1B,gBAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YAC/B;AACA,YAAA,OAAO,IAAI;QACf;AACA,QAAA,OAAO,KAAK;IAChB;;;;;"}
@@ -7,9 +7,9 @@ function ValidateRequestArguments(requestName, expectedRequestArguments, actualA
7
7
  else {
8
8
  for (const argument of expectedRequestArguments) {
9
9
  if (!actualArguments.hasOwnProperty(argument) ||
10
- actualArguments[argument] == undefined ||
11
- actualArguments[argument] == null ||
12
- actualArguments[argument] == '') {
10
+ actualArguments[argument] === undefined ||
11
+ actualArguments[argument] === null ||
12
+ actualArguments[argument] === '') {
13
13
  missing.push(argument);
14
14
  }
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ValidateRequestArguments.js","sources":["../../../queries/ValidateRequestArguments.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Validate request arguments.\n * @param {string} requestName Name of request.\n * @param {string[]} expectedRequestArguments Array of all expected arguments.\n * @param {*} actualArguments Object containing the arguments.\n * @returns True if valid, false if not.\n*/\nexport function ValidateRequestArguments(requestName: string, expectedRequestArguments: string[], actualArguments?: object): boolean {\n if (expectedRequestArguments.length > 0) {\n const missing: string[] = [];\n\n if (!actualArguments) {\n expectedRequestArguments.forEach(_ => missing.push(_));\n } else {\n for (const argument of expectedRequestArguments) {\n if (!actualArguments.hasOwnProperty(argument) ||\n actualArguments[argument] == undefined ||\n actualArguments[argument] == null ||\n actualArguments[argument] == '') {\n missing.push(argument);\n }\n }\n }\n\n if (missing.length > 0) {\n const missingArgumentsString = missing.join(', ');\n console.log(`Warning: Missing (${missingArgumentsString}) arguments for request (${requestName}). Will not perform.`);\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"mappings":"SAUgB,wBAAwB,CAAC,WAAmB,EAAE,wBAAkC,EAAE,eAAwB,EAAA;AACtH,IAAA,IAAI,wBAAwB,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,MAAM,OAAO,GAAa,EAAE;QAE5B,IAAI,CAAC,eAAe,EAAE;AAClB,YAAA,wBAAwB,CAAC,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D;aAAO;AACH,YAAA,KAAK,MAAM,QAAQ,IAAI,wBAAwB,EAAE;AAC7C,gBAAA,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC;AACzC,oBAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,SAAS;AACtC,oBAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,IAAI;AACjC,oBAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE;AACjC,oBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC1B;YACJ;QACJ;AAEA,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,MAAM,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,CAAA,kBAAA,EAAqB,sBAAsB,CAAA,yBAAA,EAA4B,WAAW,CAAA,oBAAA,CAAsB,CAAC;AACrH,YAAA,OAAO,KAAK;QAChB;IACJ;AAEA,IAAA,OAAO,IAAI;AACf;;;;"}
1
+ {"version":3,"file":"ValidateRequestArguments.js","sources":["../../../queries/ValidateRequestArguments.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Validate request arguments.\n * @param {string} requestName Name of request.\n * @param {string[]} expectedRequestArguments Array of all expected arguments.\n * @param {*} actualArguments Object containing the arguments.\n * @returns True if valid, false if not.\n*/\nexport function ValidateRequestArguments(requestName: string, expectedRequestArguments: string[], actualArguments?: object): boolean {\n if (expectedRequestArguments.length > 0) {\n const missing: string[] = [];\n\n if (!actualArguments) {\n expectedRequestArguments.forEach(_ => missing.push(_));\n } else {\n for (const argument of expectedRequestArguments) {\n if (!actualArguments.hasOwnProperty(argument) ||\n actualArguments[argument] === undefined ||\n actualArguments[argument] === null ||\n actualArguments[argument] === '') {\n missing.push(argument);\n }\n }\n }\n\n if (missing.length > 0) {\n const missingArgumentsString = missing.join(', ');\n console.log(`Warning: Missing (${missingArgumentsString}) arguments for request (${requestName}). Will not perform.`);\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"mappings":"SAUgB,wBAAwB,CAAC,WAAmB,EAAE,wBAAkC,EAAE,eAAwB,EAAA;AACtH,IAAA,IAAI,wBAAwB,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,MAAM,OAAO,GAAa,EAAE;QAE5B,IAAI,CAAC,eAAe,EAAE;AAClB,YAAA,wBAAwB,CAAC,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1D;aAAO;AACH,YAAA,KAAK,MAAM,QAAQ,IAAI,wBAAwB,EAAE;AAC7C,gBAAA,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC;AACzC,oBAAA,eAAe,CAAC,QAAQ,CAAC,KAAK,SAAS;AACvC,oBAAA,eAAe,CAAC,QAAQ,CAAC,KAAK,IAAI;AAClC,oBAAA,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE;AAClC,oBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC1B;YACJ;QACJ;AAEA,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,MAAM,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,CAAA,kBAAA,EAAqB,sBAAsB,CAAA,yBAAA,EAA4B,WAAW,CAAA,oBAAA,CAAsB,CAAC;AACrH,YAAA,OAAO,KAAK;QAChB;IACJ;AAEA,IAAA,OAAO,IAAI;AACf;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_empty_string_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_empty_string_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments with an empty string value', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', ['name'], { name: '' });
6
+ });
7
+ it('should return false', () => result.should.be.false);
8
+ });
9
+ //# sourceMappingURL=with_empty_string_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_empty_string_value.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_empty_string_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,sDAAsD,EAAE,GAAG,EAAE;IAClE,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_missing_property.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_missing_property.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments with a missing required property', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', ['name'], { other: 'value' });
6
+ });
7
+ it('should return false', () => result.should.be.false);
8
+ });
9
+ //# sourceMappingURL=with_missing_property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_missing_property.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_missing_property.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,4DAA4D,EAAE,GAAG,EAAE;IACxE,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_no_required_arguments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_no_required_arguments.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments with no required arguments', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', [], {});
6
+ });
7
+ it('should return true', () => result.should.be.true);
8
+ });
9
+ //# sourceMappingURL=with_no_required_arguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_no_required_arguments.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_no_required_arguments.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,sDAAsD,EAAE,GAAG,EAAE;IAClE,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_null_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments with a null value', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', ['name'], { name: null });
6
+ });
7
+ it('should return false', () => result.should.be.false);
8
+ });
9
+ //# sourceMappingURL=with_null_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_value.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_null_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,6CAA6C,EAAE,GAAG,EAAE;IACzD,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_numeric_zero_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_numeric_zero_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments with a numeric zero value', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', ['offset'], { offset: 0 });
6
+ });
7
+ it('should return true', () => result.should.be.true);
8
+ });
9
+ //# sourceMappingURL=with_numeric_zero_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_numeric_zero_value.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_numeric_zero_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;IACjE,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_undefined_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments with an undefined value', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', ['name'], { name: undefined });
6
+ });
7
+ it('should return false', () => result.should.be.false);
8
+ });
9
+ //# sourceMappingURL=with_undefined_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_value.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_undefined_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC/D,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_valid_string_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_valid_string_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments with a valid string value', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', ['name'], { name: 'some-value' });
6
+ });
7
+ it('should return true', () => result.should.be.true);
8
+ });
9
+ //# sourceMappingURL=with_valid_string_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_valid_string_value.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/with_valid_string_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;IACjE,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=without_arguments_object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"without_arguments_object.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ValidateRequestArguments } from '../../ValidateRequestArguments';
2
+ describe('when validating arguments without an arguments object', () => {
3
+ let result;
4
+ beforeEach(() => {
5
+ result = ValidateRequestArguments('TestRequest', ['name'], undefined);
6
+ });
7
+ it('should return false', () => result.should.be.false);
8
+ });
9
+ //# sourceMappingURL=without_arguments_object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"without_arguments_object.js","sourceRoot":"","sources":["../../../../../queries/for_ValidateRequestArguments/when_validating_arguments/without_arguments_object.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,QAAQ,CAAC,uDAAuD,EAAE,GAAG,EAAE;IACnE,IAAI,MAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACZ,MAAM,GAAG,wBAAwB,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}