@cratis/arc 20.1.0 → 20.1.3

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 (82) hide show
  1. package/Globals.ts +7 -0
  2. package/ICanBeConfigured.ts +1 -1
  3. package/UrlHelpers.ts +14 -1
  4. package/dist/cjs/Globals.d.ts +2 -0
  5. package/dist/cjs/Globals.d.ts.map +1 -1
  6. package/dist/cjs/Globals.js +1 -0
  7. package/dist/cjs/Globals.js.map +1 -1
  8. package/dist/cjs/ICanBeConfigured.d.ts +1 -1
  9. package/dist/cjs/ICanBeConfigured.d.ts.map +1 -1
  10. package/dist/cjs/UrlHelpers.d.ts.map +1 -1
  11. package/dist/cjs/UrlHelpers.js +11 -1
  12. package/dist/cjs/UrlHelpers.js.map +1 -1
  13. package/dist/cjs/identity/IdentityProvider.d.ts +1 -1
  14. package/dist/cjs/identity/IdentityProvider.d.ts.map +1 -1
  15. package/dist/cjs/identity/IdentityProvider.js.map +1 -1
  16. package/dist/cjs/queries/ServerSentEventHubConnection.d.ts.map +1 -1
  17. package/dist/cjs/queries/ServerSentEventHubConnection.js +4 -2
  18. package/dist/cjs/queries/ServerSentEventHubConnection.js.map +1 -1
  19. package/dist/cjs/queries/for_QueryFor/given/TestQueries.d.ts +9 -0
  20. package/dist/cjs/queries/for_QueryFor/given/TestQueries.d.ts.map +1 -1
  21. package/dist/cjs/queries/for_QueryFor/given/a_query_for.d.ts +2 -1
  22. package/dist/cjs/queries/for_QueryFor/given/a_query_for.d.ts.map +1 -1
  23. package/dist/cjs/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts +2 -0
  24. package/dist/cjs/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts.map +1 -0
  25. package/dist/cjs/reflection/ParameterDescriptor.d.ts +2 -1
  26. package/dist/cjs/reflection/ParameterDescriptor.d.ts.map +1 -1
  27. package/dist/cjs/reflection/ParameterDescriptor.js +3 -1
  28. package/dist/cjs/reflection/ParameterDescriptor.js.map +1 -1
  29. package/dist/esm/Globals.d.ts +2 -0
  30. package/dist/esm/Globals.d.ts.map +1 -1
  31. package/dist/esm/Globals.js +1 -0
  32. package/dist/esm/Globals.js.map +1 -1
  33. package/dist/esm/ICanBeConfigured.d.ts +1 -1
  34. package/dist/esm/ICanBeConfigured.d.ts.map +1 -1
  35. package/dist/esm/UrlHelpers.d.ts.map +1 -1
  36. package/dist/esm/UrlHelpers.js +11 -1
  37. package/dist/esm/UrlHelpers.js.map +1 -1
  38. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.d.ts +2 -0
  39. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.d.ts.map +1 -0
  40. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.js +16 -0
  41. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.js.map +1 -0
  42. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.d.ts +2 -0
  43. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.d.ts.map +1 -0
  44. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.js +17 -0
  45. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.js.map +1 -0
  46. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.d.ts +2 -0
  47. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.d.ts.map +1 -0
  48. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.js +17 -0
  49. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.js.map +1 -0
  50. package/dist/esm/identity/IdentityProvider.d.ts +1 -1
  51. package/dist/esm/identity/IdentityProvider.d.ts.map +1 -1
  52. package/dist/esm/identity/IdentityProvider.js.map +1 -1
  53. package/dist/esm/queries/ServerSentEventHubConnection.d.ts.map +1 -1
  54. package/dist/esm/queries/ServerSentEventHubConnection.js +4 -2
  55. package/dist/esm/queries/ServerSentEventHubConnection.js.map +1 -1
  56. package/dist/esm/queries/for_QueryFor/given/TestQueries.d.ts +9 -0
  57. package/dist/esm/queries/for_QueryFor/given/TestQueries.d.ts.map +1 -1
  58. package/dist/esm/queries/for_QueryFor/given/TestQueries.js +16 -0
  59. package/dist/esm/queries/for_QueryFor/given/TestQueries.js.map +1 -1
  60. package/dist/esm/queries/for_QueryFor/given/a_query_for.d.ts +2 -1
  61. package/dist/esm/queries/for_QueryFor/given/a_query_for.d.ts.map +1 -1
  62. package/dist/esm/queries/for_QueryFor/given/a_query_for.js +3 -1
  63. package/dist/esm/queries/for_QueryFor/given/a_query_for.js.map +1 -1
  64. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts +2 -0
  65. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts.map +1 -0
  66. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.js +66 -0
  67. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.js.map +1 -0
  68. package/dist/esm/reflection/ParameterDescriptor.d.ts +2 -1
  69. package/dist/esm/reflection/ParameterDescriptor.d.ts.map +1 -1
  70. package/dist/esm/reflection/ParameterDescriptor.js +3 -1
  71. package/dist/esm/reflection/ParameterDescriptor.js.map +1 -1
  72. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  73. package/for_UrlHelpers/when_building_query_params/with_array_values.ts +22 -0
  74. package/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.ts +23 -0
  75. package/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.ts +23 -0
  76. package/identity/IdentityProvider.ts +1 -1
  77. package/package.json +2 -2
  78. package/queries/ServerSentEventHubConnection.ts +6 -2
  79. package/queries/for_QueryFor/given/TestQueries.ts +20 -0
  80. package/queries/for_QueryFor/given/a_query_for.ts +4 -1
  81. package/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.ts +82 -0
  82. package/reflection/ParameterDescriptor.ts +2 -1
@@ -0,0 +1,16 @@
1
+ import { describe, it, beforeEach } from 'vitest';
2
+ import { UrlHelpers } from '../../UrlHelpers';
3
+ describe('when building query params with array values', () => {
4
+ let unusedParameters;
5
+ let result;
6
+ beforeEach(() => {
7
+ unusedParameters = { names: ['Alice', 'Bob', 'Charlie'] };
8
+ result = UrlHelpers.buildQueryParams(unusedParameters);
9
+ });
10
+ it('should append first value', () => result.getAll('names').should.include('Alice'));
11
+ it('should append second value', () => result.getAll('names').should.include('Bob'));
12
+ it('should append third value', () => result.getAll('names').should.include('Charlie'));
13
+ it('should have three entries for the key', () => result.getAll('names').length.should.equal(3));
14
+ it('should have only one unique key', () => Array.from(new Set(result.keys())).length.should.equal(1));
15
+ });
16
+ //# sourceMappingURL=with_array_values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_array_values.js","sourceRoot":"","sources":["../../../../for_UrlHelpers/when_building_query_params/with_array_values.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;IAC1D,IAAI,gBAAwB,CAAC;IAC7B,IAAI,MAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACZ,gBAAgB,GAAG,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;QAE1D,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACtF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACrF,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACxF,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3G,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_mixed_array_and_scalar_values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_mixed_array_and_scalar_values.d.ts","sourceRoot":"","sources":["../../../../for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { describe, it, beforeEach } from 'vitest';
2
+ import { UrlHelpers } from '../../UrlHelpers';
3
+ describe('when building query params with mixed array and scalar values', () => {
4
+ let unusedParameters;
5
+ let result;
6
+ beforeEach(() => {
7
+ unusedParameters = { filter: 'active', ids: [1, 2, 3] };
8
+ result = UrlHelpers.buildQueryParams(unusedParameters);
9
+ });
10
+ it('should contain scalar filter parameter', () => result.get('filter').should.equal('active'));
11
+ it('should append first id value', () => result.getAll('ids').should.include('1'));
12
+ it('should append second id value', () => result.getAll('ids').should.include('2'));
13
+ it('should append third id value', () => result.getAll('ids').should.include('3'));
14
+ it('should have three entries for ids key', () => result.getAll('ids').length.should.equal(3));
15
+ it('should have two unique keys', () => Array.from(new Set(result.keys())).length.should.equal(2));
16
+ });
17
+ //# sourceMappingURL=with_mixed_array_and_scalar_values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_mixed_array_and_scalar_values.js","sourceRoot":"","sources":["../../../../for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAQ,CAAC,+DAA+D,EAAE,GAAG,EAAE;IAC3E,IAAI,gBAAwB,CAAC;IAC7B,IAAI,MAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACZ,gBAAgB,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAExD,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjG,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACnF,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACnF,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACvG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_array_parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_array_parameters.d.ts","sourceRoot":"","sources":["../../../../for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { describe, it, beforeEach } from 'vitest';
2
+ import { UrlHelpers } from '../../UrlHelpers';
3
+ describe('when replacing route parameters with array values', () => {
4
+ let route;
5
+ let parameters;
6
+ let result;
7
+ beforeEach(() => {
8
+ route = '/api/search?names={names}&ids={ids}';
9
+ parameters = { names: ['Alice', 'Bob'], ids: [1, 2, 3] };
10
+ result = UrlHelpers.replaceRouteParameters(route, parameters);
11
+ });
12
+ it('should leave route template placeholders untouched for array values', () => result.route.should.equal('/api/search?names={names}&ids={ids}'));
13
+ it('should keep all array parameters as unused', () => Object.keys(result.unusedParameters).length.should.equal(2));
14
+ it('should contain names array in unused parameters', () => result.unusedParameters['names'].should.deep.equal(['Alice', 'Bob']));
15
+ it('should contain ids array in unused parameters', () => result.unusedParameters['ids'].should.deep.equal([1, 2, 3]));
16
+ });
17
+ //# sourceMappingURL=with_array_parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_array_parameters.js","sourceRoot":"","sources":["../../../../for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC/D,IAAI,KAAa,CAAC;IAClB,IAAI,UAAkB,CAAC;IACvB,IAAI,MAAmD,CAAC;IAExD,UAAU,CAAC,GAAG,EAAE;QACZ,KAAK,GAAG,qCAAqC,CAAC;QAC9C,UAAU,GAAG,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAEzD,MAAM,GAAG,UAAU,CAAC,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC,CAAC;IAClJ,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE,CAAE,MAAM,CAAC,gBAA6C,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChK,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE,CAAE,MAAM,CAAC,gBAA6C,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACzJ,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { Constructor } from '@cratis/fundamentals';
2
2
  import { IIdentityProvider } from './IIdentityProvider';
3
3
  import { IIdentity } from './IIdentity';
4
- import { GetHttpHeaders } from 'GetHttpHeaders';
4
+ import { GetHttpHeaders } from '../GetHttpHeaders';
5
5
  export declare class IdentityProvider extends IIdentityProvider {
6
6
  static readonly CookieName = ".cratis-identity";
7
7
  static httpHeadersCallback: GetHttpHeaders | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"IdentityProvider.d.ts","sourceRoot":"","sources":["../../../identity/IdentityProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQhD,qBAAa,gBAAiB,SAAQ,iBAAiB;IAEnD,MAAM,CAAC,QAAQ,CAAC,UAAU,sBAAsB;IAChD,MAAM,CAAC,mBAAmB,EAAE,cAAc,GAAG,SAAS,CAAC;IACvD,MAAM,CAAC,WAAW,EAAE,MAAM,CAAM;IAChC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAM3B,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAQ7D,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAQhD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;WAUzB,UAAU,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,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AW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAsB/G,UAAU,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;WAIjG,OAAO,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IA0BlH,OAAO,CAAC,MAAM,CAAC,SAAS;IAYxB,OAAO,CAAC,MAAM,CAAC,WAAW;CAI7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"IdentityProvider.js","sources":["../../../identity/IdentityProvider.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 { IIdentityProvider } from './IIdentityProvider';\nimport { IIdentity } from './IIdentity';\nimport { IdentityProviderResult } from './IdentityProviderResult';\nimport { GetHttpHeaders } from 'GetHttpHeaders';\nimport { Globals } from '../Globals';\nimport { UrlHelpers } from '../UrlHelpers';\nimport { joinPaths } from '../joinPaths';\n\n/**\n * Represents an implementation of {@link IIdentityProvider}.\n*/\nexport class IdentityProvider extends IIdentityProvider {\n\n static readonly CookieName = '.cratis-identity';\n static httpHeadersCallback: GetHttpHeaders | undefined;\n static apiBasePath: string = '';\n static origin: string = '';\n\n /**\n * Sets the HTTP headers callback.\n * @param callback Callback to set.\n */\n static setHttpHeadersCallback(callback: GetHttpHeaders): void {\n IdentityProvider.httpHeadersCallback = callback;\n }\n\n /**\n * Sets the API base path.\n * @param apiBasePath API base path to set.\n */\n static setApiBasePath(apiBasePath: string): void {\n IdentityProvider.apiBasePath = apiBasePath;\n }\n\n /**\n * Sets the origin.\n * @param origin Origin to set.\n */\n static setOrigin(origin: string): void {\n IdentityProvider.origin = origin;\n }\n\n /**\n * Gets the current identity by optionally specifying the details type.\n * @param type Optional constructor for the details type to enable type-safe deserialization.\n * @returns The current identity as {@link IIdentity}.\n * @remarks The `extends object` constraint is required for compatibility with JsonSerializer.deserializeFromInstance().\n */\n static async getCurrent<TDetails extends object = object>(type?: Constructor<TDetails>): Promise<IIdentity<TDetails>> {\n const cookie = this.getCookie();\n if (cookie.length == 2) {\n const json = atob(cookie[1]);\n const result = JSON.parse(json) as IdentityProviderResult;\n const details = type ? JsonSerializer.deserializeFromInstance(type, result.details) : result.details;\n return {\n id: result.id,\n name: result.name,\n roles: result.roles || [],\n details: details as TDetails,\n isSet: true,\n isInRole: (role: string) => (result.roles || []).includes(role),\n refresh: () => IdentityProvider.refresh(type)\n } as IIdentity<TDetails>;\n } else {\n const identity = await this.refresh<TDetails>(type);\n return identity;\n }\n }\n\n /** @inheritdoc */\n async getCurrent<TDetails extends object = object>(type?: Constructor<TDetails>): Promise<IIdentity<TDetails>> {\n return IdentityProvider.getCurrent<TDetails>(type);\n }\n\n static async refresh<TDetails extends object = object>(type?: Constructor<TDetails>): Promise<IIdentity<TDetails>> {\n IdentityProvider.clearCookie();\n const origin = IdentityProvider.origin || Globals.origin || '';\n const apiBasePath = IdentityProvider.apiBasePath || Globals.apiBasePath || '';\n const route = joinPaths(apiBasePath, '/.cratis/me');\n const url = UrlHelpers.createUrlFrom(origin, apiBasePath, route);\n const response = await fetch(\n url, {\n method: 'GET',\n headers: IdentityProvider.httpHeadersCallback?.() ?? {}\n });\n\n const result = await response.json() as IdentityProviderResult;\n const details = type ? JsonSerializer.deserializeFromInstance(type, result.details) : result.details;\n\n return {\n id: result.id,\n name: result.name,\n roles: result.roles || [],\n details: details as TDetails,\n isSet: true,\n isInRole: (role: string) => (result.roles || []).includes(role),\n refresh: () => IdentityProvider.refresh(type)\n };\n }\n\n private static getCookie() {\n if (typeof document === 'undefined') return [];\n const decoded = decodeURIComponent(document.cookie);\n const cookies = decoded.split(';').map(_ => _.trim());\n const cookie = cookies.find(_ => _.indexOf(`${IdentityProvider.CookieName}=`) == 0);\n if (cookie) {\n const keyValue = cookie.split('=');\n return [keyValue[0].trim(), keyValue[1].trim()];\n }\n return [];\n }\n\n private static clearCookie() {\n if (typeof document === 'undefined') return;\n document.cookie = `${IdentityProvider.CookieName}=;expires=Thu, 01 Jan 1970 00:00:00 GMT`;\n }\n}\n"],"names":[],"mappings":";;;;;;AAeM,MAAO,gBAAiB,SAAQ,iBAAiB,CAAA;AAEnD,IAAA,OAAgB,UAAU,GAAG,kBAAkB;IAC/C,OAAO,mBAAmB;AAC1B,IAAA,OAAO,WAAW,GAAW,EAAE;AAC/B,IAAA,OAAO,MAAM,GAAW,EAAE;IAM1B,OAAO,sBAAsB,CAAC,QAAwB,EAAA;AAClD,QAAA,gBAAgB,CAAC,mBAAmB,GAAG,QAAQ;IACnD;IAMA,OAAO,cAAc,CAAC,WAAmB,EAAA;AACrC,QAAA,gBAAgB,CAAC,WAAW,GAAG,WAAW;IAC9C;IAMA,OAAO,SAAS,CAAC,MAAc,EAAA;AAC3B,QAAA,gBAAgB,CAAC,MAAM,GAAG,MAAM;IACpC;AAQA,IAAA,aAAa,UAAU,CAAmC,IAA4B,EAAA;AAClF,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE;AAC/B,QAAA,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;YACpB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAA2B;YACzD,MAAM,OAAO,GAAG,IAAI,GAAG,cAAc,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,OAAO;YACpG,OAAO;gBACH,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,IAAI,EAAE,MAAM,CA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C7F;;;;;"}
1
+ {"version":3,"file":"IdentityProvider.js","sources":["../../../identity/IdentityProvider.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 { IIdentityProvider } from './IIdentityProvider';\nimport { IIdentity } from './IIdentity';\nimport { IdentityProviderResult } from './IdentityProviderResult';\nimport { GetHttpHeaders } from '../GetHttpHeaders';\nimport { Globals } from '../Globals';\nimport { UrlHelpers } from '../UrlHelpers';\nimport { joinPaths } from '../joinPaths';\n\n/**\n * Represents an implementation of {@link IIdentityProvider}.\n*/\nexport class IdentityProvider extends IIdentityProvider {\n\n static readonly CookieName = '.cratis-identity';\n static httpHeadersCallback: GetHttpHeaders | undefined;\n static apiBasePath: string = '';\n static origin: string = '';\n\n /**\n * Sets the HTTP headers callback.\n * @param callback Callback to set.\n */\n static setHttpHeadersCallback(callback: GetHttpHeaders): void {\n IdentityProvider.httpHeadersCallback = callback;\n }\n\n /**\n * Sets the API base path.\n * @param apiBasePath API base path to set.\n */\n static setApiBasePath(apiBasePath: string): void {\n IdentityProvider.apiBasePath = apiBasePath;\n }\n\n /**\n * Sets the origin.\n * @param origin Origin to set.\n */\n static setOrigin(origin: string): void {\n IdentityProvider.origin = origin;\n }\n\n /**\n * Gets the current identity by optionally specifying the details type.\n * @param type Optional constructor for the details type to enable type-safe deserialization.\n * @returns The current identity as {@link IIdentity}.\n * @remarks The `extends object` constraint is required for compatibility with JsonSerializer.deserializeFromInstance().\n */\n static async getCurrent<TDetails extends object = object>(type?: Constructor<TDetails>): Promise<IIdentity<TDetails>> {\n const cookie = this.getCookie();\n if (cookie.length == 2) {\n const json = atob(cookie[1]);\n const result = JSON.parse(json) as IdentityProviderResult;\n const details = type ? JsonSerializer.deserializeFromInstance(type, result.details) : result.details;\n return {\n id: result.id,\n name: result.name,\n roles: result.roles || [],\n details: details as TDetails,\n isSet: true,\n isInRole: (role: string) => (result.roles || []).includes(role),\n refresh: () => IdentityProvider.refresh(type)\n } as IIdentity<TDetails>;\n } else {\n const identity = await this.refresh<TDetails>(type);\n return identity;\n }\n }\n\n /** @inheritdoc */\n async getCurrent<TDetails extends object = object>(type?: Constructor<TDetails>): Promise<IIdentity<TDetails>> {\n return IdentityProvider.getCurrent<TDetails>(type);\n }\n\n static async refresh<TDetails extends object = object>(type?: Constructor<TDetails>): Promise<IIdentity<TDetails>> {\n IdentityProvider.clearCookie();\n const origin = IdentityProvider.origin || Globals.origin || '';\n const apiBasePath = IdentityProvider.apiBasePath || Globals.apiBasePath || '';\n const route = joinPaths(apiBasePath, '/.cratis/me');\n const url = UrlHelpers.createUrlFrom(origin, apiBasePath, route);\n const response = await fetch(\n url, {\n method: 'GET',\n headers: IdentityProvider.httpHeadersCallback?.() ?? {}\n });\n\n const result = await response.json() as IdentityProviderResult;\n const details = type ? JsonSerializer.deserializeFromInstance(type, result.details) : result.details;\n\n return {\n id: result.id,\n name: result.name,\n roles: result.roles || [],\n details: details as TDetails,\n isSet: true,\n isInRole: (role: string) => (result.roles || []).includes(role),\n refresh: () => IdentityProvider.refresh(type)\n };\n }\n\n private static getCookie() {\n if (typeof document === 'undefined') return [];\n const decoded = decodeURIComponent(document.cookie);\n const cookies = decoded.split(';').map(_ => _.trim());\n const cookie = cookies.find(_ => _.indexOf(`${IdentityProvider.CookieName}=`) == 0);\n if (cookie) {\n const keyValue = cookie.split('=');\n return [keyValue[0].trim(), keyValue[1].trim()];\n }\n return [];\n }\n\n private static clearCookie() {\n if (typeof document === 'undefined') return;\n document.cookie = `${IdentityProvider.CookieName}=;expires=Thu, 01 Jan 1970 00:00:00 GMT`;\n }\n}\n"],"names":[],"mappings":";;;;;;AAeM,MAAO,gBAAiB,SAAQ,iBAAiB,CAAA;AAEnD,IAAA,OAAgB,UAAU,GAAG,kBAAkB;IAC/C,OAAO,mBAAmB;AAC1B,IAAA,OAAO,WAAW,GAAW,EAAE;AAC/B,IAAA,O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AmB,EAAE,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI;IAe3F,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAclC,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,eAAe;IAwCvB,OAAO,CAAC,SAAS;IAwBjB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,eAAe;CAkB1B"}
@@ -202,9 +202,10 @@ class ServerSentEventHubConnection {
202
202
  queryId,
203
203
  request,
204
204
  };
205
+ const customHeaders = Globals.httpHeadersCallback?.() ?? {};
205
206
  fetch(this._subscribeUrl, {
206
207
  method: 'POST',
207
- headers: { 'Content-Type': 'application/json' },
208
+ headers: { 'Content-Type': 'application/json', ...customHeaders },
208
209
  body: JSON.stringify(body),
209
210
  }).catch(error => {
210
211
  console.error(`SSE hub: subscribe POST failed for '${queryId}'`, error);
@@ -217,9 +218,10 @@ class ServerSentEventHubConnection {
217
218
  connectionId: this._connectionId,
218
219
  queryId,
219
220
  };
221
+ const customHeaders = Globals.httpHeadersCallback?.() ?? {};
220
222
  fetch(this._unsubscribeUrl, {
221
223
  method: 'POST',
222
- headers: { 'Content-Type': 'application/json' },
224
+ headers: { 'Content-Type': 'application/json', ...customHeaders },
223
225
  body: JSON.stringify(body),
224
226
  }).catch(error => {
225
227
  console.error(`SSE hub: unsubscribe POST failed for '${queryId}'`, error);
@@ -1 +1 @@
1
- {"version":3,"file":"ServerSentEventHubConnection.js","sources":["../../../queries/ServerSentEventHubConnection.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 { Globals } from '../Globals';\nimport { IObservableQueryHubConnection } from './IObservableQueryHubConnection';\nimport { DataReceived } from './ObservableQueryConnection';\nimport { HubConnectionKeepAlive } from './HubConnectionKeepAlive';\nimport { IReconnectPolicy } from './IReconnectPolicy';\nimport { ReconnectPolicy } from './ReconnectPolicy';\nimport { QueryResult } from './QueryResult';\nimport { HubMessage, HubMessageType, SubscriptionRequest } from './WebSocketHubConnection';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ninterface ActiveSubscription {\n request: SubscriptionRequest;\n callback: DataReceived<any>;\n}\n\n/**\n * A multiplexed SSE hub connection that uses EventSource for server→client streaming\n * and fetch POST requests for client→server subscribe/unsubscribe commands.\n *\n * Protocol:\n * 1. Open EventSource to the SSE hub endpoint.\n * 2. Server sends a {@link HubMessageType.Connected} message with the connection identifier.\n * 3. Client sends POST to subscribe/unsubscribe endpoints using the connection identifier.\n * 4. Server streams {@link HubMessageType.QueryResult} messages tagged with queryId.\n * 5. When EventSource closes, server cleans up all subscriptions for this connection.\n */\nexport class ServerSentEventHubConnection implements IObservableQueryHubConnection {\n private _eventSource?: EventSource;\n private _connectionId?: string;\n private _disconnected = false;\n private _subscriptions: Map<string, ActiveSubscription> = new Map();\n private _pendingSubscriptions: Map<string, ActiveSubscription> = new Map();\n private _lastPongLatency: number = 0;\n private _latencySamples: number[] = [];\n private _connectTimeoutTimer?: ReturnType<typeof setTimeout>;\n private readonly _keepAlive: HubConnectionKeepAlive;\n\n /**\n * Initializes a new instance of {@link ServerSentEventHubConnection}.\n * @param {string} _sseUrl The SSE hub endpoint URL (e.g. `http://localhost:5000/.cratis/queries/sse`).\n * @param {string} _subscribeUrl The subscribe POST endpoint URL.\n * @param {string} _unsubscribeUrl The unsubscribe POST endpoint URL.\n * @param {string} _microservice The microservice name to pass as a query argument.\n * @param {number} keepAliveIntervalMs How long without any server message before the connection\n * is considered stale and a reconnect is forced (default: 30 000 ms).\n * @param {number} connectTimeoutMs How long to wait for the {@link HubMessageType.Connected}\n * message after the HTTP connection opens before giving up and retrying (default: 15 000 ms).\n * @param {IReconnectPolicy} _policy The reconnect policy to use (default: {@link ReconnectPolicy}).\n */\n constructor(\n private readonly _sseUrl: string,\n private readonly _subscribeUrl: string,\n private readonly _unsubscribeUrl: string,\n private readonly _microservice: string,\n keepAliveIntervalMs: number = 30000,\n private readonly _connectTimeoutMs: number = 15000,\n private readonly _policy: IReconnectPolicy = new ReconnectPolicy()\n ) {\n // SSE is server→client only: the client cannot send pings. Instead we watch for\n // inactivity — if the server stops sending messages (including its own keep-alive\n // pings) for the entire interval, the connection is stale and we reconnect.\n this._keepAlive = new HubConnectionKeepAlive(keepAliveIntervalMs, () => {\n if (!this._disconnected && this._subscriptions.size > 0) {\n console.warn(`SSE hub: no messages received for ${keepAliveIntervalMs}ms, reconnecting '${this._sseUrl}'`);\n this.reconnect();\n }\n });\n }\n\n /** @inheritdoc */\n get queryCount(): number {\n return this._subscriptions.size;\n }\n\n /** @inheritdoc */\n get lastPingLatency(): number {\n return this._lastPongLatency;\n }\n\n /** @inheritdoc */\n get averageLatency(): number {\n if (this._latencySamples.length === 0) return 0;\n return this._latencySamples.reduce((a, b) => a + b, 0) / this._latencySamples.length;\n }\n\n /** @inheritdoc */\n subscribe(queryId: string, request: SubscriptionRequest, callback: DataReceived<any>): void {\n const sub: ActiveSubscription = { request, callback };\n this._subscriptions.set(queryId, sub);\n\n this.ensureConnected();\n\n if (this._connectionId) {\n this.sendSubscribe(queryId, request);\n } else {\n // Not yet connected, queue for when Connected message arrives.\n this._pendingSubscriptions.set(queryId, sub);\n }\n }\n\n /** @inheritdoc */\n unsubscribe(queryId: string): void {\n this._subscriptions.delete(queryId);\n this._pendingSubscriptions.delete(queryId);\n\n if (this._connectionId) {\n this.sendUnsubscribe(queryId);\n }\n\n if (this._subscriptions.size === 0) {\n this.close();\n }\n }\n\n /** @inheritdoc */\n dispose(): void {\n this._disconnected = true;\n this._subscriptions.clear();\n this._pendingSubscriptions.clear();\n this._policy.cancel();\n this._keepAlive.stop();\n this.clearConnectTimeout();\n this._eventSource?.close();\n this._eventSource = undefined;\n this._connectionId = undefined;\n }\n\n private ensureConnected(): void {\n if (this._disconnected) {\n this._disconnected = false;\n }\n\n if (this._eventSource && this._eventSource.readyState !== EventSource.CLOSED) {\n return;\n }\n\n this.openEventSource();\n }\n\n private close(): void {\n this._disconnected = true;\n this._policy.cancel();\n this._keepAlive.stop();\n this.clearConnectTimeout();\n this._eventSource?.close();\n this._eventSource = undefined;\n this._connectionId = undefined;\n }\n\n private openEventSource(): void {\n let url = this._sseUrl;\n if (this._microservice?.length > 0) {\n const param = `${Globals.microserviceWSQueryArgument}=${encodeURIComponent(this._microservice)}`;\n url += (url.includes('?') ? '&' : '?') + param;\n }\n\n this._connectionId = undefined;\n this._eventSource = new EventSource(url);\n\n this._eventSource.onopen = () => {\n if (this._disconnected) return;\n console.log(`SSE hub connection established: '${url}'`);\n this._policy.reset();\n this._keepAlive.start();\n\n // If the server does not send a Connected message within the timeout, the\n // connection is broken. Close and retry via the reconnect policy.\n this.clearConnectTimeout();\n this._connectTimeoutTimer = setTimeout(() => {\n if (!this._disconnected && !this._connectionId) {\n console.warn(`SSE hub: no Connected message within ${this._connectTimeoutMs}ms, retrying '${url}'`);\n this.reconnect();\n }\n }, this._connectTimeoutMs);\n };\n\n this._eventSource.onmessage = (event: MessageEvent) => {\n if (this._disconnected) return;\n this._keepAlive.recordActivity();\n this.handleMessage(event.data as string);\n };\n\n this._eventSource.onerror = () => {\n if (this._disconnected) return;\n console.warn(`SSE hub connection error: '${url}'`);\n this.reconnect();\n };\n }\n\n private reconnect(): void {\n this._keepAlive.stop();\n this.clearConnectTimeout();\n\n // Close the EventSource so the reconnect policy manages the schedule.\n this._eventSource?.close();\n this._eventSource = undefined;\n this._connectionId = undefined;\n\n // Move all active subscriptions to pending so they re-subscribe when\n // the next Connected message arrives after the managed reconnect.\n for (const [queryId, sub] of this._subscriptions) {\n this._pendingSubscriptions.set(queryId, sub);\n }\n\n if (this._subscriptions.size === 0) return;\n\n this._policy.schedule(() => {\n if (!this._disconnected && this._subscriptions.size > 0) {\n this.openEventSource();\n }\n }, this._sseUrl);\n }\n\n private clearConnectTimeout(): void {\n if (this._connectTimeoutTimer !== undefined) {\n clearTimeout(this._connectTimeoutTimer);\n this._connectTimeoutTimer = undefined;\n }\n }\n\n private handleMessage(rawData: string): void {\n try {\n const message = JSON.parse(rawData) as HubMessage;\n\n switch (message.type) {\n case HubMessageType.Connected:\n this.handleConnected(message);\n break;\n case HubMessageType.QueryResult:\n this.handleQueryResult(message);\n break;\n case HubMessageType.Ping:\n // Server-sent keep-alive ping — activity already recorded in onmessage.\n break;\n case HubMessageType.Unauthorized:\n console.warn(`SSE hub: query '${message.queryId}' unauthorized`);\n break;\n case HubMessageType.Error:\n console.error(`SSE hub: query '${message.queryId}' error:`, message.payload);\n break;\n }\n } catch (error) {\n console.error('SSE hub: error parsing message', error);\n }\n }\n\n private handleConnected(message: HubMessage): void {\n this._connectionId = message.payload as string;\n console.log(`SSE hub: connected with id '${this._connectionId}'`);\n\n // Connected message arrived — cancel the connect timeout.\n this.clearConnectTimeout();\n\n // Send all pending subscriptions now that we have a connection ID.\n for (const [queryId, sub] of this._pendingSubscriptions) {\n this.sendSubscribe(queryId, sub.request);\n }\n this._pendingSubscriptions.clear();\n }\n\n private handleQueryResult(message: HubMessage): void {\n if (!message.queryId) return;\n\n const sub = this._subscriptions.get(message.queryId);\n if (!sub) return;\n\n const result = message.payload as QueryResult<any>;\n sub.callback(result);\n }\n\n private sendSubscribe(queryId: string, request: SubscriptionRequest): void {\n if (!this._connectionId) return;\n\n const body = {\n connectionId: this._connectionId,\n queryId,\n request,\n };\n\n fetch(this._subscribeUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n }).catch(error => {\n console.error(`SSE hub: subscribe POST failed for '${queryId}'`, error);\n });\n }\n\n private sendUnsubscribe(queryId: string): void {\n if (!this._connectionId) return;\n\n const body = {\n connectionId: this._connectionId,\n queryId,\n };\n\n fetch(this._unsubscribeUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n }).catch(error => {\n console.error(`SSE hub: unsubscribe POST failed for '${queryId}'`, error);\n });\n }\n}\n"],"names":[],"mappings":";;;;;MA8Ba,4BAA4B,CAAA;AAwBhB,IAAA,OAAA;AACA,IAAA,aAAA;AACA,IAAA,eAAA;AACA,IAAA,aAAA;AAEA,IAAA,iBAAA;AACA,IAAA,OAAA;AA7Bb,IAAA,YAAY;AACZ,IAAA,aAAa;IACb,aAAa,GAAG,KAAK;AACrB,IAAA,cAAc,GAAoC,IAAI,GAAG,EAAE;AAC3D,IAAA,qBAAqB,GAAoC,IAAI,GAAG,EAAE;IAClE,gBAAgB,GAAW,CAAC;IAC5B,eAAe,GAAa,EAAE;AAC9B,IAAA,oBAAoB;AACX,IAAA,UAAU;AAc3B,IAAA,WAAA,CACqB,OAAe,EACf,aAAqB,EACrB,eAAuB,EACvB,aAAqB,EACtC,mBAAA,GAA8B,KAAK,EAClB,iBAAA,GAA4B,KAAK,EACjC,OAAA,GAA4B,IAAI,eAAe,EAAE,EAAA;QANjD,IAAA,CAAA,OAAO,GAAP,OAAO;QACP,IAAA,CAAA,aAAa,GAAb,aAAa;QACb,IAAA,CAAA,eAAe,GAAf,eAAe;QACf,IAAA,CAAA,aAAa,GAAb,aAAa;QAEb,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;QACjB,IAAA,CAAA,OAAO,GAAP,OAAO;QAKxB,IAAI,CAAC,UAAU,GAAG,IAAI,sBAAsB,CAAC,mBAAmB,EAAE,MAAK;AACnE,YAAA,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,GAAG,CAAC,EAAE;gBACrD,OAAO,CAAC,IAAI,CAAC,CAAA,kCAAA,EAAqC,mBAAmB,CAAA,kBAAA,EAAqB,IAAI,CAAC,OAAO,CAAA,CAAA,CAAG,CAAC;gBAC1G,IAAI,CAAC,SAAS,EAAE;YACpB;AACJ,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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 { Globals } from '../Globals';\nimport { IObservableQueryHubConnection } from './IObservableQueryHubConnection';\nimport { DataReceived } from './ObservableQueryConnection';\nimport { HubConnectionKeepAlive } from './HubConnectionKeepAlive';\nimport { IReconnectPolicy } from './IReconnectPolicy';\nimport { ReconnectPolicy } from './ReconnectPolicy';\nimport { QueryResult } from './QueryResult';\nimport { HubMessage, HubMessageType, SubscriptionRequest } from './WebSocketHubConnection';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ninterface ActiveSubscription {\n request: SubscriptionRequest;\n callback: DataReceived<any>;\n}\n\n/**\n * A multiplexed SSE hub connection that uses EventSource for server→client streaming\n * and fetch POST requests for client→server subscribe/unsubscribe commands.\n *\n * Protocol:\n * 1. Open EventSource to the SSE hub endpoint.\n * 2. Server sends a {@link HubMessageType.Connected} message with the connection identifier.\n * 3. Client sends POST to subscribe/unsubscribe endpoints using the connection identifier.\n * 4. Server streams {@link HubMessageType.QueryResult} messages tagged with queryId.\n * 5. When EventSource closes, server cleans up all subscriptions for this connection.\n */\nexport class ServerSentEventHubConnection implements IObservableQueryHubConnection {\n private _eventSource?: EventSource;\n private _connectionId?: string;\n private _disconnected = false;\n private _subscriptions: Map<string, ActiveSubscription> = new Map();\n private _pendingSubscriptions: Map<string, ActiveSubscription> = new Map();\n private _lastPongLatency: number = 0;\n private _latencySamples: number[] = [];\n private _connectTimeoutTimer?: ReturnType<typeof setTimeout>;\n private readonly _keepAlive: HubConnectionKeepAlive;\n\n /**\n * Initializes a new instance of {@link ServerSentEventHubConnection}.\n * @param {string} _sseUrl The SSE hub endpoint URL (e.g. `http://localhost:5000/.cratis/queries/sse`).\n * @param {string} _subscribeUrl The subscribe POST endpoint URL.\n * @param {string} _unsubscribeUrl The unsubscribe POST endpoint URL.\n * @param {string} _microservice The microservice name to pass as a query argument.\n * @param {number} keepAliveIntervalMs How long without any server message before the connection\n * is considered stale and a reconnect is forced (default: 30 000 ms).\n * @param {number} connectTimeoutMs How long to wait for the {@link HubMessageType.Connected}\n * message after the HTTP connection opens before giving up and retrying (default: 15 000 ms).\n * @param {IReconnectPolicy} _policy The reconnect policy to use (default: {@link ReconnectPolicy}).\n */\n constructor(\n private readonly _sseUrl: string,\n private readonly _subscribeUrl: string,\n private readonly _unsubscribeUrl: string,\n private readonly _microservice: string,\n keepAliveIntervalMs: number = 30000,\n private readonly _connectTimeoutMs: number = 15000,\n private readonly _policy: IReconnectPolicy = new ReconnectPolicy()\n ) {\n // SSE is server→client only: the client cannot send pings. Instead we watch for\n // inactivity — if the server stops sending messages (including its own keep-alive\n // pings) for the entire interval, the connection is stale and we reconnect.\n this._keepAlive = new HubConnectionKeepAlive(keepAliveIntervalMs, () => {\n if (!this._disconnected && this._subscriptions.size > 0) {\n console.warn(`SSE hub: no messages received for ${keepAliveIntervalMs}ms, reconnecting '${this._sseUrl}'`);\n this.reconnect();\n }\n });\n }\n\n /** @inheritdoc */\n get queryCount(): number {\n return this._subscriptions.size;\n }\n\n /** @inheritdoc */\n get lastPingLatency(): number {\n return this._lastPongLatency;\n }\n\n /** @inheritdoc */\n get averageLatency(): number {\n if (this._latencySamples.length === 0) return 0;\n return this._latencySamples.reduce((a, b) => a + b, 0) / this._latencySamples.length;\n }\n\n /** @inheritdoc */\n subscribe(queryId: string, request: SubscriptionRequest, callback: DataReceived<any>): void {\n const sub: ActiveSubscription = { request, callback };\n this._subscriptions.set(queryId, sub);\n\n this.ensureConnected();\n\n if (this._connectionId) {\n this.sendSubscribe(queryId, request);\n } else {\n // Not yet connected, queue for when Connected message arrives.\n this._pendingSubscriptions.set(queryId, sub);\n }\n }\n\n /** @inheritdoc */\n unsubscribe(queryId: string): void {\n this._subscriptions.delete(queryId);\n this._pendingSubscriptions.delete(queryId);\n\n if (this._connectionId) {\n this.sendUnsubscribe(queryId);\n }\n\n if (this._subscriptions.size === 0) {\n this.close();\n }\n }\n\n /** @inheritdoc */\n dispose(): void {\n this._disconnected = true;\n this._subscriptions.clear();\n this._pendingSubscriptions.clear();\n this._policy.cancel();\n this._keepAlive.stop();\n this.clearConnectTimeout();\n this._eventSource?.close();\n this._eventSource = undefined;\n this._connectionId = undefined;\n }\n\n private ensureConnected(): void {\n if (this._disconnected) {\n this._disconnected = false;\n }\n\n if (this._eventSource && this._eventSource.readyState !== EventSource.CLOSED) {\n return;\n }\n\n this.openEventSource();\n }\n\n private close(): void {\n this._disconnected = true;\n this._policy.cancel();\n this._keepAlive.stop();\n this.clearConnectTimeout();\n this._eventSource?.close();\n this._eventSource = undefined;\n this._connectionId = undefined;\n }\n\n private openEventSource(): void {\n let url = this._sseUrl;\n if (this._microservice?.length > 0) {\n const param = `${Globals.microserviceWSQueryArgument}=${encodeURIComponent(this._microservice)}`;\n url += (url.includes('?') ? '&' : '?') + param;\n }\n\n this._connectionId = undefined;\n this._eventSource = new EventSource(url);\n\n this._eventSource.onopen = () => {\n if (this._disconnected) return;\n console.log(`SSE hub connection established: '${url}'`);\n this._policy.reset();\n this._keepAlive.start();\n\n // If the server does not send a Connected message within the timeout, the\n // connection is broken. Close and retry via the reconnect policy.\n this.clearConnectTimeout();\n this._connectTimeoutTimer = setTimeout(() => {\n if (!this._disconnected && !this._connectionId) {\n console.warn(`SSE hub: no Connected message within ${this._connectTimeoutMs}ms, retrying '${url}'`);\n this.reconnect();\n }\n }, this._connectTimeoutMs);\n };\n\n this._eventSource.onmessage = (event: MessageEvent) => {\n if (this._disconnected) return;\n this._keepAlive.recordActivity();\n this.handleMessage(event.data as string);\n };\n\n this._eventSource.onerror = () => {\n if (this._disconnected) return;\n console.warn(`SSE hub connection error: '${url}'`);\n this.reconnect();\n };\n }\n\n private reconnect(): void {\n this._keepAlive.stop();\n this.clearConnectTimeout();\n\n // Close the EventSource so the reconnect policy manages the schedule.\n this._eventSource?.close();\n this._eventSource = undefined;\n this._connectionId = undefined;\n\n // Move all active subscriptions to pending so they re-subscribe when\n // the next Connected message arrives after the managed reconnect.\n for (const [queryId, sub] of this._subscriptions) {\n this._pendingSubscriptions.set(queryId, sub);\n }\n\n if (this._subscriptions.size === 0) return;\n\n this._policy.schedule(() => {\n if (!this._disconnected && this._subscriptions.size > 0) {\n this.openEventSource();\n }\n }, this._sseUrl);\n }\n\n private clearConnectTimeout(): void {\n if (this._connectTimeoutTimer !== undefined) {\n clearTimeout(this._connectTimeoutTimer);\n this._connectTimeoutTimer = undefined;\n }\n }\n\n private handleMessage(rawData: string): void {\n try {\n const message = JSON.parse(rawData) as HubMessage;\n\n switch (message.type) {\n case HubMessageType.Connected:\n this.handleConnected(message);\n break;\n case HubMessageType.QueryResult:\n this.handleQueryResult(message);\n break;\n case HubMessageType.Ping:\n // Server-sent keep-alive ping — activity already recorded in onmessage.\n break;\n case HubMessageType.Unauthorized:\n console.warn(`SSE hub: query '${message.queryId}' unauthorized`);\n break;\n case HubMessageType.Error:\n console.error(`SSE hub: query '${message.queryId}' error:`, message.payload);\n break;\n }\n } catch (error) {\n console.error('SSE hub: error parsing message', error);\n }\n }\n\n private handleConnected(message: HubMessage): void {\n this._connectionId = message.payload as string;\n console.log(`SSE hub: connected with id '${this._connectionId}'`);\n\n // Connected message arrived — cancel the connect timeout.\n this.clearConnectTimeout();\n\n // Send all pending subscriptions now that we have a connection ID.\n for (const [queryId, sub] of this._pendingSubscriptions) {\n this.sendSubscribe(queryId, sub.request);\n }\n this._pendingSubscriptions.clear();\n }\n\n private handleQueryResult(message: HubMessage): void {\n if (!message.queryId) return;\n\n const sub = this._subscriptions.get(message.queryId);\n if (!sub) return;\n\n const result = message.payload as QueryResult<any>;\n sub.callback(result);\n }\n\n private sendSubscribe(queryId: string, request: SubscriptionRequest): void {\n if (!this._connectionId) return;\n\n const body = {\n connectionId: this._connectionId,\n queryId,\n request,\n };\n\n const customHeaders = Globals.httpHeadersCallback?.() ?? {};\n\n fetch(this._subscribeUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...customHeaders },\n body: JSON.stringify(body),\n }).catch(error => {\n console.error(`SSE hub: subscribe POST failed for '${queryId}'`, error);\n });\n }\n\n private sendUnsubscribe(queryId: string): void {\n if (!this._connectionId) return;\n\n const body = {\n connectionId: this._connectionId,\n queryId,\n };\n\n const customHeaders = Globals.httpHeadersCallback?.() ?? {};\n\n fetch(this._unsubscribeUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...customHeaders },\n body: JSON.stringify(body),\n }).catch(error => {\n console.error(`SSE hub: unsubscribe POST failed for '${queryId}'`, error);\n });\n }\n}\n"],"names":[],"mappings":";;;;;MA8Ba,4BAA4B,CAAA;AAwBhB,IAAA,OAAA;AACA,IAAA,aAAA;AACA,IAAA,eAAA;AACA,IAAA,aAAA;AAEA,IAAA,iBAAA;AACA,IAAA,OAAA;AA7Bb,IAAA,YAAY;AACZ,IAAA,aAAa;IACb,aAAa,GAAG,KAAK;AACrB,IAAA,cAAc,GAAoC,IAAI,GAAG,EAAE;AAC3D,IAAA,qBAAqB,GAAoC,IAAI,GAAG,EAAE;IAClE,gBAAgB,GAAW,CAAC;IAC5B,eAAe,GAAa,EAAE;AAC9B,IAAA,oBAAoB;AACX,IAAA,UAAU;AAc3B,IAAA,WAAA,CACqB,OAAe,EACf,aAAqB,EACrB,eAAuB,EACvB,aAAqB,EACtC,mBAAA,GAA8B,KAAK,EAClB,iBAAA,GAA4B,KAAK,EACjC,OAAA,GAA4B,IAAI,eAAe,EAAE,EAAA;QANjD,IAAA,CAAA,OAAO,GAAP,OAAO;QACP,IAAA,CAAA,aAAa,GAAb,aAAa;QACb,IAAA,CAAA,eAAe,GAAf,eAAe;QACf,IAAA,CAAA,aAAa,GAAb,aAAa;QAEb,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;QACjB,IAAA,CAAA,OAAO,GAAP,OAAO;QAKxB,IAAI,CAAC,UAAU,GAAG,IAAI,sBAAsB,CAAC,mBAAmB,EAAE,MAAK;AACnE,YAAA,IAAI,CAAC,IAAI,CAAC,aAAa,I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E,cAAc,EAAE,kBAAkB,EAAE,GAAG,aAAa,EAAE;AACjE,YAAA,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AAC7B,SAAA,CAAC,CAAC,KAAK,CAAC,KAAK,IAAG;YACb,OAAO,CAAC,KAAK,CAAC,CAAA,sCAAA,EAAyC,OAAO,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;AAC7E,QAAA,CAAC,CAAC;IACN;AACH;;;;"}
@@ -34,6 +34,15 @@ export declare class TestQueryForWithParameterDescriptorValues extends QueryFor<
34
34
  get requiredRequestParameters(): string[];
35
35
  constructor();
36
36
  }
37
+ export declare class TestQueryForWithEnumerableParameterDescriptorValues extends QueryFor<string[], object> {
38
+ readonly route = "/api/search-by-lists";
39
+ readonly defaultValue: string[];
40
+ readonly parameterDescriptors: ParameterDescriptor[];
41
+ names?: string[];
42
+ ids?: number[];
43
+ get requiredRequestParameters(): string[];
44
+ constructor();
45
+ }
37
46
  export interface TestQueryForWithMultipleRequiredParametersArguments {
38
47
  userId: string;
39
48
  category: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TestQueries.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/given/TestQueries.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,qBAAa,YAAa,SAAQ,QAAQ,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;IAC9D,QAAQ,CAAC,KAAK,oBAAoB;IAClC,QAAQ,CAAC,YAAY,MAAM;IAC3B,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAElD;IAEF,IAAI,yBAAyB,IAAI,MAAM,EAAE,CAExC;;CAKJ;AAED,qBAAa,sBAAuB,SAAQ,QAAQ,CAAC,MAAM,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;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AM,CAAC;IAC/F,QAAQ,CAAC,KAAK,0BAA0B;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAM;IACrC,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAGlD;IAEF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IAEf,IAAI,yBAAyB,IAAI,MAAM,EAAE,CAExC;;CAKJ;AAED,MAAM,WAAW,mDAAmD;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,0CAA2C,SAAQ,QAAQ,CAAC,MAAM,EAAE,mDAAmD,CAAC;IACjI,QAAQ,CAAC,KAAK,qCAAqC;IACnD,QAAQ,CAAC,YAAY,MAAM;IAC3B,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAGlD;IAEF,IAAI,yBAAyB,IAAI,MAAM,EAAE,CAExC;;CAKJ"}
@@ -53,6 +53,22 @@ export class TestQueryForWithParameterDescriptorValues extends QueryFor {
53
53
  super(String, false);
54
54
  }
55
55
  }
56
+ export class TestQueryForWithEnumerableParameterDescriptorValues extends QueryFor {
57
+ route = '/api/search-by-lists';
58
+ defaultValue = [];
59
+ parameterDescriptors = [
60
+ new ParameterDescriptor('names', String, true),
61
+ new ParameterDescriptor('ids', Number, true)
62
+ ];
63
+ names;
64
+ ids;
65
+ get requiredRequestParameters() {
66
+ return [];
67
+ }
68
+ constructor() {
69
+ super(String, true);
70
+ }
71
+ }
56
72
  export class TestQueryForWithMultipleRequiredParameters extends QueryFor {
57
73
  route = '/api/filter/{userId}/{category}';
58
74
  defaultValue = '';
@@ -1 +1 @@
1
- {"version":3,"file":"TestQueries.js","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/given/TestQueries.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBA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;AAOD,MAAM,OAAO,0CAA2C,SAAQ,QAAqE;IACxH,KAAK,GAAG,iCAAiC,CAAC;IAC1C,YAAY,GAAG,EAAE,CAAC;IAClB,oBAAoB,GAA0B;QACnD,IAAI,mBAAmB,CAAC,QAAQ,EAAE,MAAqB,CAAC;QACxD,IAAI,mBAAmB,CAAC,UAAU,EAAE,MAAqB,CAAC;KAC7D,CAAC;IAEF,IAAI,yBAAyB;QACzB,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAClC,CAAC;IAED;QACI,KAAK,CAAC,MAAqB,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;CACJ"}
@@ -1,9 +1,10 @@
1
- import { TestQueryFor, TestEnumerableQueryFor, TestQueryForWithoutRequiredParams, TestQueryForWithParameterDescriptorValues, TestQueryForWithMultipleRequiredParameters } from './TestQueries';
1
+ import { TestQueryFor, TestEnumerableQueryFor, TestQueryForWithoutRequiredParams, TestQueryForWithParameterDescriptorValues, TestQueryForWithMultipleRequiredParameters, TestQueryForWithEnumerableParameterDescriptorValues } from './TestQueries';
2
2
  export declare class a_query_for {
3
3
  query: TestQueryFor;
4
4
  enumerableQuery: TestEnumerableQueryFor;
5
5
  queryWithoutParams: TestQueryForWithoutRequiredParams;
6
6
  queryWithParameterDescriptorValues: TestQueryForWithParameterDescriptorValues;
7
+ queryWithEnumerableParameterDescriptorValues: TestQueryForWithEnumerableParameterDescriptorValues;
7
8
  queryWithMultipleRequiredParameters: TestQueryForWithMultipleRequiredParameters;
8
9
  constructor();
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"a_query_for.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/given/a_query_for.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,iCAAiC,EACjC,yCAAyC,EACzC,0CAA0C,EAC7C,MAAM,eAAe,CAAC;AAEvB,qBAAa,WAAW;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB,eAAe,EAAE,sBAAsB,CAAC;IACxC,kBAAkB,EAAE,iCAAiC,CAAC;IACtD,kCAAkC,EAAE,yCAAyC,CAAC;IAC9E,mCAAmC,EAAE,0CAA0C,CAAC;;CASnF"}
1
+ {"version":3,"file":"a_query_for.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/given/a_query_for.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,iCAAiC,EACjC,yCAAyC,EACzC,0CAA0C,EAC1C,mDAAmD,EACtD,MAAM,eAAe,CAAC;AAEvB,qBAAa,WAAW;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB,eAAe,EAAE,sBAAsB,CAAC;IACxC,kBAAkB,EAAE,iCAAiC,CAAC;IACtD,kCAAkC,EAAE,yCAAyC,CAAC;IAC9E,4CAA4C,EAAE,mDAAmD,CAAC;IAClG,mCAAmC,EAAE,0CAA0C,CAAC;;CAUnF"}
@@ -1,15 +1,17 @@
1
- import { TestQueryFor, TestEnumerableQueryFor, TestQueryForWithoutRequiredParams, TestQueryForWithParameterDescriptorValues, TestQueryForWithMultipleRequiredParameters } from './TestQueries';
1
+ import { TestQueryFor, TestEnumerableQueryFor, TestQueryForWithoutRequiredParams, TestQueryForWithParameterDescriptorValues, TestQueryForWithMultipleRequiredParameters, TestQueryForWithEnumerableParameterDescriptorValues } from './TestQueries';
2
2
  export class a_query_for {
3
3
  query;
4
4
  enumerableQuery;
5
5
  queryWithoutParams;
6
6
  queryWithParameterDescriptorValues;
7
+ queryWithEnumerableParameterDescriptorValues;
7
8
  queryWithMultipleRequiredParameters;
8
9
  constructor() {
9
10
  this.query = new TestQueryFor();
10
11
  this.enumerableQuery = new TestEnumerableQueryFor();
11
12
  this.queryWithoutParams = new TestQueryForWithoutRequiredParams();
12
13
  this.queryWithParameterDescriptorValues = new TestQueryForWithParameterDescriptorValues();
14
+ this.queryWithEnumerableParameterDescriptorValues = new TestQueryForWithEnumerableParameterDescriptorValues();
13
15
  this.queryWithMultipleRequiredParameters = new TestQueryForWithMultipleRequiredParameters();
14
16
  }
15
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"a_query_for.js","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/given/a_query_for.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,iCAAiC,EACjC,yCAAyC,EACzC,0CAA0C,EAC7C,MAAM,eAAe,CAAC;AAEvB,MAAM,OAAO,WAAW;IACpB,KAAK,CAAe;IACpB,eAAe,CAAyB;IACxC,kBAAkB,CAAoC;IACtD,kCAAkC,CAA4C;IAC9E,mCAAmC,CAA6C;IAEhF;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,IAAI,sBAAsB,EAAE,CAAC;QACpD,IAAI,CAAC,kBAAkB,GAAG,IAAI,iCAAiC,EAAE,CAAC;QAClE,IAAI,CAAC,kCAAkC,GAAG,IAAI,yCAAyC,EAAE,CAAC;QAC1F,IAAI,CAAC,mCAAmC,GAAG,IAAI,0CAA0C,EAAE,CAAC;IAChG,CAAC;CACJ"}
1
+ {"version":3,"file":"a_query_for.js","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/given/a_query_for.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,iCAAiC,EACjC,yCAAyC,EACzC,0CAA0C,EAC1C,mDAAmD,EACtD,MAAM,eAAe,CAAC;AAEvB,MAAM,OAAO,WAAW;IACpB,KAAK,CAAe;IACpB,eAAe,CAAyB;IACxC,kBAAkB,CAAoC;IACtD,kCAAkC,CAA4C;IAC9E,4CAA4C,CAAsD;IAClG,mCAAmC,CAA6C;IAEhF;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,IAAI,sBAAsB,EAAE,CAAC;QACpD,IAAI,CAAC,kBAAkB,GAAG,IAAI,iCAAiC,EAAE,CAAC;QAClE,IAAI,CAAC,kCAAkC,GAAG,IAAI,yCAAyC,EAAE,CAAC;QAC1F,IAAI,CAAC,4CAA4C,GAAG,IAAI,mDAAmD,EAAE,CAAC;QAC9G,IAAI,CAAC,mCAAmC,GAAG,IAAI,0CAA0C,EAAE,CAAC;IAChG,CAAC;CACJ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_enumerable_parameter_descriptor_values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_enumerable_parameter_descriptor_values.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.ts"],"names":[],"mappings":""}
@@ -0,0 +1,66 @@
1
+ import { a_query_for } from '../given/a_query_for';
2
+ import { given } from '../../../given';
3
+ import * as sinon from 'sinon';
4
+ import { createFetchHelper } from '../../../helpers/fetchHelper';
5
+ describe('with enumerable parameter descriptor values', given(a_query_for, context => {
6
+ let result;
7
+ let fetchStub;
8
+ let fetchHelper;
9
+ const mockResponse = {
10
+ data: [],
11
+ isSuccess: true,
12
+ isAuthorized: true,
13
+ isValid: true,
14
+ hasExceptions: false,
15
+ validationResults: [],
16
+ exceptionMessages: [],
17
+ exceptionStackTrace: '',
18
+ paging: {
19
+ totalItems: 0,
20
+ totalPages: 0,
21
+ page: 0,
22
+ size: 0
23
+ }
24
+ };
25
+ beforeEach(async () => {
26
+ fetchHelper = createFetchHelper();
27
+ fetchStub = fetchHelper.stubFetch();
28
+ fetchStub.resolves({
29
+ json: sinon.stub().resolves(mockResponse),
30
+ ok: true,
31
+ status: 200
32
+ });
33
+ context.queryWithEnumerableParameterDescriptorValues.setOrigin('https://api.example.com');
34
+ context.queryWithEnumerableParameterDescriptorValues.setApiBasePath('/api/v1');
35
+ context.queryWithEnumerableParameterDescriptorValues.names = ['Alice', 'Bob'];
36
+ context.queryWithEnumerableParameterDescriptorValues.ids = [1, 2, 3];
37
+ result = await context.queryWithEnumerableParameterDescriptorValues.perform();
38
+ });
39
+ afterEach(() => {
40
+ fetchHelper.restore();
41
+ });
42
+ it('should return successful result', () => {
43
+ result.isSuccess.should.be.true;
44
+ });
45
+ it('should include first name in URL as repeated query parameter', () => {
46
+ const url = fetchStub.getCall(0).args[0].href;
47
+ url.should.include('names=Alice');
48
+ });
49
+ it('should include second name in URL as repeated query parameter', () => {
50
+ const url = fetchStub.getCall(0).args[0].href;
51
+ url.should.include('names=Bob');
52
+ });
53
+ it('should include first id in URL as repeated query parameter', () => {
54
+ const url = fetchStub.getCall(0).args[0].href;
55
+ url.should.include('ids=1');
56
+ });
57
+ it('should include second id in URL as repeated query parameter', () => {
58
+ const url = fetchStub.getCall(0).args[0].href;
59
+ url.should.include('ids=2');
60
+ });
61
+ it('should include third id in URL as repeated query parameter', () => {
62
+ const url = fetchStub.getCall(0).args[0].href;
63
+ url.should.include('ids=3');
64
+ });
65
+ }));
66
+ //# sourceMappingURL=with_enumerable_parameter_descriptor_values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_enumerable_parameter_descriptor_values.js","sourceRoot":"","sources":["../../../../../queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,QAAQ,CAAC,6CAA6C,EAAE,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE;IACjF,IAAI,MAA6B,CAAC;IAClC,IAAI,SAA0B,CAAC;IAC/B,IAAI,WAAsE,CAAC;IAC3E,MAAM,YAAY,GAAG;QACjB,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,aA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C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACrE,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAClE,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACnE,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAClE,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC,CAAC"}
@@ -2,6 +2,7 @@ import { Constructor } from '@cratis/fundamentals';
2
2
  export declare class ParameterDescriptor {
3
3
  readonly name: string;
4
4
  readonly type: Constructor;
5
- constructor(name: string, type: Constructor);
5
+ readonly isEnumerable: boolean;
6
+ constructor(name: string, type: Constructor, isEnumerable?: boolean);
6
7
  }
7
8
  //# sourceMappingURL=ParameterDescriptor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterDescriptor.d.ts","sourceRoot":"","sources":["../../../reflection/ParameterDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKnD,qBAAa,mBAAmB;IAMhB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW;gBAAxC,IAAI,EAAE,MAAM,EAAW,IAAI,EAAE,WAAW;CAEhE"}
1
+ {"version":3,"file":"ParameterDescriptor.d.ts","sourceRoot":"","sources":["../../../reflection/ParameterDescriptor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKnD,qBAAa,mBAAmB;IAOhB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW;IAAE,QAAQ,CAAC,YAAY,EAAE,OAAO;gBAAxE,IAAI,EAAE,MAAM,EAAW,IAAI,EAAE,WAAW,EAAW,YAAY,GAAE,OAAe;CAExG"}
@@ -1,9 +1,11 @@
1
1
  class ParameterDescriptor {
2
2
  name;
3
3
  type;
4
- constructor(name, type) {
4
+ isEnumerable;
5
+ constructor(name, type, isEnumerable = false) {
5
6
  this.name = name;
6
7
  this.type = type;
8
+ this.isEnumerable = isEnumerable;
7
9
  }
8
10
  }
9
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterDescriptor.js","sources":["../../../reflection/ParameterDescriptor.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 } from '@cratis/fundamentals';\n\n/**\n * Represents a parameter descriptor.\n */\nexport class ParameterDescriptor {\n /**\n * Initializes a new instance of the {@link ParameterDescriptor} class.\n * @param name Name of the parameter.\n * @param type Type of the parameter.\n */\n constructor(readonly name: string, readonly type: Constructor) {\n }\n}\n"],"names":[],"mappings":"MAQa,mBAAmB,CAAA;AAMP,IAAA,IAAA;AAAuB,IAAA,IAAA;IAA5C,WAAA,CAAqB,IAAY,EAAW,IAAiB,EAAA;QAAxC,IAAA,CAAA,IAAI,GAAJ,IAAI;QAAmB,IAAA,CAAA,IAAI,GAAJ,IAAI;IAChD;AACH;;;;"}
1
+ {"version":3,"file":"ParameterDescriptor.js","sources":["../../../reflection/ParameterDescriptor.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 } from '@cratis/fundamentals';\n\n/**\n * Represents a parameter descriptor.\n */\nexport class ParameterDescriptor {\n /**\n * Initializes a new instance of the {@link ParameterDescriptor} class.\n * @param name Name of the parameter.\n * @param type Type of the parameter.\n * @param isEnumerable Whether the parameter is an enumerable (collection) type.\n */\n constructor(readonly name: string, readonly type: Constructor, readonly isEnumerable: boolean = false) {\n }\n}\n"],"names":[],"mappings":"MAQa,mBAAmB,CAAA;AAOP,IAAA,IAAA;AAAuB,IAAA,IAAA;AAA4B,IAAA,YAAA;AAAxE,IAAA,WAAA,CAAqB,IAAY,EAAW,IAAiB,EAAW,eAAwB,KAAK,EAAA;QAAhF,IAAA,CAAA,IAAI,GAAJ,IAAI;QAAmB,IAAA,CAAA,IAAI,GAAJ,IAAI;QAAwB,IAAA,CAAA,YAAY,GAAZ,YAAY;IACpF;AACH;;;;"}