@cratis/arc 20.0.0 → 20.1.1

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 (66) hide show
  1. package/ICanBeConfigured.ts +1 -1
  2. package/UrlHelpers.ts +14 -1
  3. package/dist/cjs/ICanBeConfigured.d.ts +1 -1
  4. package/dist/cjs/ICanBeConfigured.d.ts.map +1 -1
  5. package/dist/cjs/UrlHelpers.d.ts.map +1 -1
  6. package/dist/cjs/UrlHelpers.js +11 -1
  7. package/dist/cjs/UrlHelpers.js.map +1 -1
  8. package/dist/cjs/identity/IdentityProvider.d.ts +1 -1
  9. package/dist/cjs/identity/IdentityProvider.d.ts.map +1 -1
  10. package/dist/cjs/identity/IdentityProvider.js.map +1 -1
  11. package/dist/cjs/queries/for_QueryFor/given/TestQueries.d.ts +9 -0
  12. package/dist/cjs/queries/for_QueryFor/given/TestQueries.d.ts.map +1 -1
  13. package/dist/cjs/queries/for_QueryFor/given/a_query_for.d.ts +2 -1
  14. package/dist/cjs/queries/for_QueryFor/given/a_query_for.d.ts.map +1 -1
  15. package/dist/cjs/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts +2 -0
  16. package/dist/cjs/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts.map +1 -0
  17. package/dist/cjs/reflection/ParameterDescriptor.d.ts +2 -1
  18. package/dist/cjs/reflection/ParameterDescriptor.d.ts.map +1 -1
  19. package/dist/cjs/reflection/ParameterDescriptor.js +3 -1
  20. package/dist/cjs/reflection/ParameterDescriptor.js.map +1 -1
  21. package/dist/esm/ICanBeConfigured.d.ts +1 -1
  22. package/dist/esm/ICanBeConfigured.d.ts.map +1 -1
  23. package/dist/esm/UrlHelpers.d.ts.map +1 -1
  24. package/dist/esm/UrlHelpers.js +11 -1
  25. package/dist/esm/UrlHelpers.js.map +1 -1
  26. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.d.ts +2 -0
  27. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.d.ts.map +1 -0
  28. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.js +16 -0
  29. package/dist/esm/for_UrlHelpers/when_building_query_params/with_array_values.js.map +1 -0
  30. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.d.ts +2 -0
  31. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.d.ts.map +1 -0
  32. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.js +17 -0
  33. package/dist/esm/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.js.map +1 -0
  34. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.d.ts +2 -0
  35. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.d.ts.map +1 -0
  36. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.js +17 -0
  37. package/dist/esm/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.js.map +1 -0
  38. package/dist/esm/identity/IdentityProvider.d.ts +1 -1
  39. package/dist/esm/identity/IdentityProvider.d.ts.map +1 -1
  40. package/dist/esm/identity/IdentityProvider.js.map +1 -1
  41. package/dist/esm/queries/for_QueryFor/given/TestQueries.d.ts +9 -0
  42. package/dist/esm/queries/for_QueryFor/given/TestQueries.d.ts.map +1 -1
  43. package/dist/esm/queries/for_QueryFor/given/TestQueries.js +16 -0
  44. package/dist/esm/queries/for_QueryFor/given/TestQueries.js.map +1 -1
  45. package/dist/esm/queries/for_QueryFor/given/a_query_for.d.ts +2 -1
  46. package/dist/esm/queries/for_QueryFor/given/a_query_for.d.ts.map +1 -1
  47. package/dist/esm/queries/for_QueryFor/given/a_query_for.js +3 -1
  48. package/dist/esm/queries/for_QueryFor/given/a_query_for.js.map +1 -1
  49. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts +2 -0
  50. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.d.ts.map +1 -0
  51. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.js +66 -0
  52. package/dist/esm/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.js.map +1 -0
  53. package/dist/esm/reflection/ParameterDescriptor.d.ts +2 -1
  54. package/dist/esm/reflection/ParameterDescriptor.d.ts.map +1 -1
  55. package/dist/esm/reflection/ParameterDescriptor.js +3 -1
  56. package/dist/esm/reflection/ParameterDescriptor.js.map +1 -1
  57. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  58. package/for_UrlHelpers/when_building_query_params/with_array_values.ts +22 -0
  59. package/for_UrlHelpers/when_building_query_params/with_mixed_array_and_scalar_values.ts +23 -0
  60. package/for_UrlHelpers/when_replacing_route_parameters/with_array_parameters.ts +23 -0
  61. package/identity/IdentityProvider.ts +1 -1
  62. package/package.json +2 -2
  63. package/queries/for_QueryFor/given/TestQueries.ts +20 -0
  64. package/queries/for_QueryFor/given/a_query_for.ts +4 -1
  65. package/queries/for_QueryFor/when_performing/with_enumerable_parameter_descriptor_values.ts +82 -0
  66. package/reflection/ParameterDescriptor.ts +2 -1
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
- import { GetHttpHeaders } from 'GetHttpHeaders';
4
+ import { GetHttpHeaders } from './GetHttpHeaders';
5
5
 
6
6
  /**
7
7
  * Represents the concept of something that can be configured.
package/UrlHelpers.ts CHANGED
@@ -33,6 +33,12 @@ export class UrlHelpers {
33
33
  const unusedParameters: Partial<T> = { ...parameters };
34
34
 
35
35
  for (const [key, value] of Object.entries(parameters)) {
36
+ // Array values cannot be encoded as a single route segment — leave them as unused so
37
+ // they are serialized as repeated query string parameters (e.g. ?ids=1&ids=2&ids=3).
38
+ if (Array.isArray(value)) {
39
+ continue;
40
+ }
41
+
36
42
  const pattern = new RegExp(`\\{${key}\\}`, 'gi');
37
43
  const newRoute = result.replace(pattern, encodeURIComponent(String(value)));
38
44
 
@@ -47,6 +53,7 @@ export class UrlHelpers {
47
53
 
48
54
  /**
49
55
  * Builds URLSearchParams from the given parameters and additional query parameters.
56
+ * Array values are serialized as repeated key=value pairs (e.g. ?ids=1&ids=2&ids=3).
50
57
  * @param unusedParameters Parameters that were not used in route replacement.
51
58
  * @param additionalParams Additional query parameters to include.
52
59
  * @returns URLSearchParams containing all parameters.
@@ -56,7 +63,13 @@ export class UrlHelpers {
56
63
 
57
64
  for (const [key, value] of Object.entries(unusedParameters)) {
58
65
  if (value !== undefined && value !== null) {
59
- queryParams.set(key, String(value));
66
+ if (Array.isArray(value)) {
67
+ for (const item of value) {
68
+ queryParams.append(key, String(item));
69
+ }
70
+ } else {
71
+ queryParams.set(key, String(value));
72
+ }
60
73
  }
61
74
  }
62
75
 
@@ -1,4 +1,4 @@
1
- import { GetHttpHeaders } from 'GetHttpHeaders';
1
+ import { GetHttpHeaders } from './GetHttpHeaders';
2
2
  export interface ICanBeConfigured {
3
3
  setMicroservice(microservice: string): any;
4
4
  setApiBasePath(apiBasePath: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ICanBeConfigured.d.ts","sourceRoot":"","sources":["../../ICanBeConfigured.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhD,MAAM,WAAW,gBAAgB;IAK7B,eAAe,CAAC,YAAY,EAAE,MAAM,OAAE;IAMtC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAM1C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAMhC,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;CAC1D"}
1
+ {"version":3,"file":"ICanBeConfigured.d.ts","sourceRoot":"","sources":["../../ICanBeConfigured.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAA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CAAC,CAAC,CAAA;KAAE;IAkC/H,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,eAAe;CAuBzH"}
@@ -14,6 +14,9 @@ class UrlHelpers {
14
14
  let result = route;
15
15
  const unusedParameters = { ...parameters };
16
16
  for (const [key, value] of Object.entries(parameters)) {
17
+ if (Array.isArray(value)) {
18
+ continue;
19
+ }
17
20
  const pattern = new RegExp(`\\{${key}\\}`, 'gi');
18
21
  const newRoute = result.replace(pattern, encodeURIComponent(String(value)));
19
22
  if (newRoute !== result) {
@@ -27,7 +30,14 @@ class UrlHelpers {
27
30
  const queryParams = new URLSearchParams();
28
31
  for (const [key, value] of Object.entries(unusedParameters)) {
29
32
  if (value !== undefined && value !== null) {
30
- queryParams.set(key, String(value));
33
+ if (Array.isArray(value)) {
34
+ for (const item of value) {
35
+ queryParams.append(key, String(item));
36
+ }
37
+ }
38
+ else {
39
+ queryParams.set(key, String(value));
40
+ }
31
41
  }
32
42
  }
33
43
  if (additionalParams) {
@@ -1 +1 @@
1
- {"version":3,"file":"UrlHelpers.js","sources":["../../UrlHelpers.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\nexport class UrlHelpers {\n /**\n * Creates a URL from the given origin, API base path, and route.\n * @param origin The origin of the request. If not provided, it defaults to the current document's origin.\n * @param apiBasePath The base path for the API.\n * @param route The specific route for the request.\n * @returns The constructed URL.\n */\n static createUrlFrom(origin: string, apiBasePath: string, route: string): URL {\n if ((!origin || origin.length === 0) && typeof document !== 'undefined') {\n origin = document.location?.origin ?? '';\n }\n\n return new URL(route, `${origin}${apiBasePath}`);\n }\n\n /**\n * Replaces route parameters in the route template with values from the parameters object.\n * Returns both the updated route and the parameters that were not used in the route.\n * @param route The route template with placeholders like {paramName}.\n * @param parameters The parameters to replace in the route.\n * @returns An object containing the updated route and unused parameters.\n */\n static replaceRouteParameters<T extends object>(route: string, parameters?: T): { route: string; unusedParameters: Partial<T> } {\n if (!parameters) {\n return { route, unusedParameters: {} };\n }\n\n let result = route;\n const unusedParameters: Partial<T> = { ...parameters };\n\n for (const [key, value] of Object.entries(parameters)) {\n const pattern = new RegExp(`\\\\{${key}\\\\}`, 'gi');\n const newRoute = result.replace(pattern, encodeURIComponent(String(value)));\n \n if (newRoute !== result) {\n delete unusedParameters[key as keyof T];\n result = newRoute;\n }\n }\n\n return { route: result, unusedParameters };\n }\n\n /**\n * Builds URLSearchParams from the given parameters and additional query parameters.\n * @param unusedParameters Parameters that were not used in route replacement.\n * @param additionalParams Additional query parameters to include.\n * @returns URLSearchParams containing all parameters.\n */\n static buildQueryParams(unusedParameters: object, additionalParams?: Record<string, string | number>): URLSearchParams {\n const queryParams = new URLSearchParams();\n\n for (const [key, value] of Object.entries(unusedParameters)) {\n if (value !== undefined && value !== null) {\n queryParams.set(key, String(value));\n }\n }\n\n if (additionalParams) {\n for (const [key, value] of Object.entries(additionalParams)) {\n queryParams.set(key, String(value));\n }\n }\n\n return queryParams;\n }\n}"],"names":[],"mappings":";;MAGa,UAAU,CAAA;AAQnB,IAAA,OAAO,aAAa,CAAC,MAAc,EAAE,WAAmB,EAAE,KAAa,EAAA;AACnE,QAAA,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,KAAK,OAAO,QAAQ,KAAK,WAAW,EAAE;YACrE,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE;QAC5C;QAEA,OAAO,IAAI,GAAG,CAAC,KAAK,EAAE,CAAA,EAAG,MAAM,CAAA,EAAG,WAAW,CAAA,CAAE,CAAC;IACpD;AASA,IAAA,OAAO,sBAAsB,CAAmB,KAAa,EAAE,UAAc,EAAA;QACzE,IAAI,CAAC,UAAU,EAAE;AACb,YAAA,OAAO,EAAE,KAAK,EAAE,gBAAg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WAAW;IACtB;AACH;;;;"}
1
+ {"version":3,"file":"UrlHelpers.js","sources":["../../UrlHelpers.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\nexport class UrlHelpers {\n /**\n * Creates a URL from the given origin, API base path, and route.\n * @param origin The origin of the request. If not provided, it defaults to the current document's origin.\n * @param apiBasePath The base path for the API.\n * @param route The specific route for the request.\n * @returns The constructed URL.\n */\n static createUrlFrom(origin: string, apiBasePath: string, route: string): URL {\n if ((!origin || origin.length === 0) && typeof document !== 'undefined') {\n origin = document.location?.origin ?? '';\n }\n\n return new URL(route, `${origin}${apiBasePath}`);\n }\n\n /**\n * Replaces route parameters in the route template with values from the parameters object.\n * Returns both the updated route and the parameters that were not used in the route.\n * @param route The route template with placeholders like {paramName}.\n * @param parameters The parameters to replace in the route.\n * @returns An object containing the updated route and unused parameters.\n */\n static replaceRouteParameters<T extends object>(route: string, parameters?: T): { route: string; unusedParameters: Partial<T> } {\n if (!parameters) {\n return { route, unusedParameters: {} };\n }\n\n let result = route;\n const unusedParameters: Partial<T> = { ...parameters };\n\n for (const [key, value] of Object.entries(parameters)) {\n // Array values cannot be encoded as a single route segment — leave them as unused so\n // they are serialized as repeated query string parameters (e.g. ?ids=1&ids=2&ids=3).\n if (Array.isArray(value)) {\n continue;\n }\n\n const pattern = new RegExp(`\\\\{${key}\\\\}`, 'gi');\n const newRoute = result.replace(pattern, encodeURIComponent(String(value)));\n \n if (newRoute !== result) {\n delete unusedParameters[key as keyof T];\n result = newRoute;\n }\n }\n\n return { route: result, unusedParameters };\n }\n\n /**\n * Builds URLSearchParams from the given parameters and additional query parameters.\n * Array values are serialized as repeated key=value pairs (e.g. ?ids=1&ids=2&ids=3).\n * @param unusedParameters Parameters that were not used in route replacement.\n * @param additionalParams Additional query parameters to include.\n * @returns URLSearchParams containing all parameters.\n */\n static buildQueryParams(unusedParameters: object, additionalParams?: Record<string, string | number>): URLSearchParams {\n const queryParams = new URLSearchParams();\n\n for (const [key, value] of Object.entries(unusedParameters)) {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n for (const item of value) {\n queryParams.append(key, String(item));\n }\n } else {\n queryParams.set(key, String(value));\n }\n }\n }\n\n if (additionalParams) {\n for (const [key, value] of Object.entries(additionalParams)) {\n queryParams.set(key, String(value));\n }\n }\n\n return queryParams;\n }\n}"],"names":[],"mappings":";;MAGa,UAAU,CAAA;AAQnB,IAAA,OAAO,aAAa,CAAC,MAAc,EAAE,WAAmB,EAAE,KAAa,EAAA;AACnE,QAAA,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,KAAK,OAAO,QAAQ,KAAK,WAAW,EAAE;YACrE,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE;QAC5C;QAEA,OAAO,IAAI,GAAG,CAAC,KAAK,EAAE,CAAA,EAAG,MAAM,CAAA,EAAG,WAAW,CAAA,CAAE,CAAC;IACpD;AASA,IAAA,OAAO,sBAAsB,CAAmB,KAAa,EAAE,UAAc,EAAA;QACzE,IAAI,CAAC,UAAU,EAAE;AACb,YAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE;QAC1C;QAEA,IAAI,MAAM,GAAG,KAAK;AAClB,QAAA,MAAM,gBAAgB,GAAe,EAAE,GAAG,UAAU,EAAE;AAEtD,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAGnD,YAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACtB;YACJ;YAEA,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,CAAA,GAAA,EAAM,GAAG,CAAA,GAAA,CAAK,EAAE,IAAI,CAAC;AAChD,YAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAE3E,YAAA,IAAI,QAAQ,KAAK,MAAM,EAAE;AACrB,gBAAA,OAAO,gBAAgB,CAAC,GAAc,CAAC;gBACvC,MAAM,GAAG,QAAQ;YACrB;QACJ;AAEA,QAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAC9C;AASA,IAAA,OAAO,gBAAgB,CAAC,gBAAwB,EAAE,gBAAkD,EAAA;AAChG,QAAA,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE;AAEzC,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;YACzD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;AACvC,gBAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACtB,oBAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;wBACtB,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;oBACzC;gBACJ;qBAAO;oBACH,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvC;YACJ;QACJ;QAEA,IAAI,gBAAgB,EAAE;AAClB,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;gBACzD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YACvC;QACJ;AAEA,QAAA,OAAO,WAAW;IACtB;AACH;;;;"}
@@ -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,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,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AC,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":["IIdentityProvider","JsonSerializer","Globals","joinPaths","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CAAC,IAAY,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;YAC/D,OAAO,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,IAAI;SAC/C;IACL;AAEQ,IAAA,OAAO,SAAS,GAAA;QACpB,IAAI,OAAO,QAAQ,KAAK,WAAW;AAAE,YAAA,OAAO,EAAE;QAC9C,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC;QACnD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QACrD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA,EAAG,gBAAgB,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;QACnF,IAAI,MAAM,EAAE;YACR,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAClC,YAAA,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD;AACA,QAAA,OAAO,EAAE;IACb;AAEQ,IAAA,OAAO,WAAW,GAAA;QACtB,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE;QACrC,QAAQ,CAAC,MAAM,GAAG,CAAA,EAAG,gBAAgB,CAAC,UAAU,yCAAyC;IAC7F;;;;;"}
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":["IIdentityProvider","JsonSerializer","Globals","joinPaths","UrlHelpers"],"mappings":";;;;;;;;AAeM,MAAO,gBAAiB,SAAQA,mCAAiB,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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I,CAAC,CAAC,IAAI,EAAE,CAAC;QACrD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA,EAAG,gBAAgB,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;QACnF,IAAI,MAAM,EAAE;YACR,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAClC,YAAA,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD;AACA,QAAA,OAAO,EAAE;IACb;AAEQ,IAAA,OAAO,WAAW,GAAA;QACtB,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE;QACrC,QAAQ,CAAC,MAAM,GAAG,CAAA,EAAG,gBAAgB,CAAC,UAAU,yCAAyC;IAC7F;;;;;"}
@@ -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,EA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C,KAAK,iBAAiB;IAC/B,QAAQ,CAAC,YAAY,MAAM;IAC3B,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAGlD;IAEF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,IAAI,yBAAyB,IAAI,MAAM,EAAE,CAExC;;CAKJ;AAED,qBAAa,mDAAoD,SAAQ,QAAQ,CAAC,MAAM,EAAE,EAAE,MAAM,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"}
@@ -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"}
@@ -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":""}
@@ -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"}
@@ -3,9 +3,11 @@
3
3
  class ParameterDescriptor {
4
4
  name;
5
5
  type;
6
- constructor(name, type) {
6
+ isEnumerable;
7
+ constructor(name, type, isEnumerable = false) {
7
8
  this.name = name;
8
9
  this.type = type;
10
+ this.isEnumerable = isEnumerable;
9
11
  }
10
12
  }
11
13
 
@@ -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;;;;"}
@@ -1,4 +1,4 @@
1
- import { GetHttpHeaders } from 'GetHttpHeaders';
1
+ import { GetHttpHeaders } from './GetHttpHeaders';
2
2
  export interface ICanBeConfigured {
3
3
  setMicroservice(microservice: string): any;
4
4
  setApiBasePath(apiBasePath: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ICanBeConfigured.d.ts","sourceRoot":"","sources":["../../ICanBeConfigured.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhD,MAAM,WAAW,gBAAgB;IAK7B,eAAe,CAAC,YAAY,EAAE,MAAM,OAAE;IAMtC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAM1C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAMhC,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;CAC1D"}
1
+ {"version":3,"file":"ICanBeConfigured.d.ts","sourceRoot":"","sources":["../../ICanBeConfigured.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,MAAM,WAAW,gBAAgB;IAK7B,eAAe,CAAC,YAAY,EAAE,MAAM,OAAE;IAMtC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAM1C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAMhC,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;CAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"UrlHelpers.d.ts","sourceRoot":"","sources":["../../UrlHelpers.ts"],"names":[],"mappings":"AAGA,qBAAa,UAAU;IAQnB,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG;IAe7E,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE;IA2B/H,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,eAAe;CAiBzH"}
1
+ {"version":3,"file":"UrlHelpers.d.ts","sourceRoot":"","sources":["../../UrlHelpers.ts"],"names":[],"mappings":"AAGA,qBAAa,UAAU;IAQnB,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG;IAe7E,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE;IAkC/H,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,eAAe;CAuBzH"}
@@ -12,6 +12,9 @@ class UrlHelpers {
12
12
  let result = route;
13
13
  const unusedParameters = { ...parameters };
14
14
  for (const [key, value] of Object.entries(parameters)) {
15
+ if (Array.isArray(value)) {
16
+ continue;
17
+ }
15
18
  const pattern = new RegExp(`\\{${key}\\}`, 'gi');
16
19
  const newRoute = result.replace(pattern, encodeURIComponent(String(value)));
17
20
  if (newRoute !== result) {
@@ -25,7 +28,14 @@ class UrlHelpers {
25
28
  const queryParams = new URLSearchParams();
26
29
  for (const [key, value] of Object.entries(unusedParameters)) {
27
30
  if (value !== undefined && value !== null) {
28
- queryParams.set(key, String(value));
31
+ if (Array.isArray(value)) {
32
+ for (const item of value) {
33
+ queryParams.append(key, String(item));
34
+ }
35
+ }
36
+ else {
37
+ queryParams.set(key, String(value));
38
+ }
29
39
  }
30
40
  }
31
41
  if (additionalParams) {
@@ -1 +1 @@
1
- {"version":3,"file":"UrlHelpers.js","sources":["../../UrlHelpers.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\nexport class UrlHelpers {\n /**\n * Creates a URL from the given origin, API base path, and route.\n * @param origin The origin of the request. If not provided, it defaults to the current document's origin.\n * @param apiBasePath The base path for the API.\n * @param route The specific route for the request.\n * @returns The constructed URL.\n */\n static createUrlFrom(origin: string, apiBasePath: string, route: string): URL {\n if ((!origin || origin.length === 0) && typeof document !== 'undefined') {\n origin = document.location?.origin ?? '';\n }\n\n return new URL(route, `${origin}${apiBasePath}`);\n }\n\n /**\n * Replaces route parameters in the route template with values from the parameters object.\n * Returns both the updated route and the parameters that were not used in the route.\n * @param route The route template with placeholders like {paramName}.\n * @param parameters The parameters to replace in the route.\n * @returns An object containing the updated route and unused parameters.\n */\n static replaceRouteParameters<T extends object>(route: string, parameters?: T): { route: string; unusedParameters: Partial<T> } {\n if (!parameters) {\n return { route, unusedParameters: {} };\n }\n\n let result = route;\n const unusedParameters: Partial<T> = { ...parameters };\n\n for (const [key, value] of Object.entries(parameters)) {\n const pattern = new RegExp(`\\\\{${key}\\\\}`, 'gi');\n const newRoute = result.replace(pattern, encodeURIComponent(String(value)));\n \n if (newRoute !== result) {\n delete unusedParameters[key as keyof T];\n result = newRoute;\n }\n }\n\n return { route: result, unusedParameters };\n }\n\n /**\n * Builds URLSearchParams from the given parameters and additional query parameters.\n * @param unusedParameters Parameters that were not used in route replacement.\n * @param additionalParams Additional query parameters to include.\n * @returns URLSearchParams containing all parameters.\n */\n static buildQueryParams(unusedParameters: object, additionalParams?: Record<string, string | number>): URLSearchParams {\n const queryParams = new URLSearchParams();\n\n for (const [key, value] of Object.entries(unusedParameters)) {\n if (value !== undefined && value !== null) {\n queryParams.set(key, String(value));\n }\n }\n\n if (additionalParams) {\n for (const [key, value] of Object.entries(additionalParams)) {\n queryParams.set(key, String(value));\n }\n }\n\n return queryParams;\n }\n}"],"names":[],"mappings":"MAGa,UAAU,CAAA;AAQnB,IAAA,OAAO,aAAa,CAAC,MAAc,EAAE,WAAmB,EAAE,KAAa,EAAA;AACnE,QAAA,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,KAAK,OAAO,QAAQ,KAAK,WAAW,EAAE;YACrE,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE;QAC5C;QAEA,OAAO,IAAI,GAAG,CAAC,KAAK,EAAE,CAAA,EAAG,MAAM,CAAA,EAAG,WAAW,CAAA,CAAE,CAAC;IACpD;AASA,IAAA,OAAO,sBAAsB,CAAmB,KAAa,EAAE,UAAc,EAAA;QACzE,IAAI,CAAC,UAAU,EAAE;AACb,YAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE;QAC1C;QAEA,IAAI,MAAM,GAAG,KAAK;AAClB,QAAA,MAAM,gBAAgB,GAAe,EAAE,GAAG,UAAU,EAAE;AAEtD,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACnD,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,CAAA,GAAA,EAAM,GAAG,CAAA,GAAA,CAAK,EAAE,IAAI,CAAC;AAChD,YAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAE3E,YAAA,IAAI,QAAQ,KAAK,MAAM,EAAE;AACrB,gBAAA,OAAO,gBAAgB,CAAC,GAAc,CAAC;gBACvC,MAAM,GAAG,QAAQ;YACrB;QACJ;AAEA,QAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAC9C;AAQA,IAAA,OAAO,gBAAgB,CAAC,gBAAwB,EAAE,gBAAkD,EAAA;AAChG,QAAA,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE;AAEzC,QAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;YACzD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;gBACvC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YACvC;QACJ;QAEA,IAAI,gBAAgB,EAAE;AAClB,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;gBACzD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YACvC;QACJ;AAEA,QAAA,OAAO,WAAW;IACtB;AACH;;;;"}
1
+ {"version":3,"file":"UrlHelpers.js","sources":["../../UrlHelpers.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\nexport class UrlHelpers {\n /**\n * Creates a URL from the given origin, API base path, and route.\n * @param origin The origin of the request. If not provided, it defaults to the current document's origin.\n * @param apiBasePath The base path for the API.\n * @param route The specific route for the request.\n * @returns The constructed URL.\n */\n static createUrlFrom(origin: string, apiBasePath: string, route: string): URL {\n if ((!origin || origin.length === 0) && typeof document !== 'undefined') {\n origin = document.location?.origin ?? '';\n }\n\n return new URL(route, `${origin}${apiBasePath}`);\n }\n\n /**\n * Replaces route parameters in the route template with values from the parameters object.\n * Returns both the updated route and the parameters that were not used in the route.\n * @param route The route template with placeholders like {paramName}.\n * @param parameters The parameters to replace in the route.\n * @returns An object containing the updated route and unused parameters.\n */\n static replaceRouteParameters<T extends object>(route: string, parameters?: T): { route: string; unusedParameters: Partial<T> } {\n if (!parameters) {\n return { route, unusedParameters: {} };\n }\n\n let result = route;\n const unusedParameters: Partial<T> = { ...parameters };\n\n for (const [key, value] of Object.entries(parameters)) {\n // Array values cannot be encoded as a single route segment — leave them as unused so\n // they are serialized as repeated query string parameters (e.g. ?ids=1&ids=2&ids=3).\n if (Array.isArray(value)) {\n continue;\n }\n\n const pattern = new RegExp(`\\\\{${key}\\\\}`, 'gi');\n const newRoute = result.replace(pattern, encodeURIComponent(String(value)));\n \n if (newRoute !== result) {\n delete unusedParameters[key as keyof T];\n result = newRoute;\n }\n }\n\n return { route: result, unusedParameters };\n }\n\n /**\n * Builds URLSearchParams from the given parameters and additional query parameters.\n * Array values are serialized as repeated key=value pairs (e.g. ?ids=1&ids=2&ids=3).\n * @param unusedParameters Parameters that were not used in route replacement.\n * @param additionalParams Additional query parameters to include.\n * @returns URLSearchParams containing all parameters.\n */\n static buildQueryParams(unusedParameters: object, additionalParams?: Record<string, string | number>): URLSearchParams {\n const queryParams = new URLSearchParams();\n\n for (const [key, value] of Object.entries(unusedParameters)) {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n for (const item of value) {\n queryParams.append(key, String(item));\n }\n } else {\n queryParams.set(key, String(value));\n }\n }\n }\n\n if (additionalParams) {\n for (const [key, value] of Object.entries(additionalParams)) {\n queryParams.set(key, String(value));\n }\n }\n\n return queryParams;\n }\n}"],"names":[],"mappings":"MAGa,UAAU,CAAA;AAQnB,IAAA,OAAO,aAAa,CAAC,MAAc,EAAE,WAAmB,EAAE,KAAa,EAAA;AACnE,QAAA,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,KAAK,OAAO,QAAQ,KAAK,WAAW,EAAE;YACrE,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE;QAC5C;QAEA,OAAO,IAAI,GAAG,CAAC,KAAK,EAAE,CAAA,EAAG,MAAM,CAAA,EAAG,WAAW,CAAA,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AK,EAAE;wBACtB,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;oBACzC;gBACJ;qBAAO;oBACH,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvC;YACJ;QACJ;QAEA,IAAI,gBAAgB,EAAE;AAClB,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;gBACzD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YACvC;QACJ;AAEA,QAAA,OAAO,WAAW;IACtB;AACH;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_array_values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_array_values.d.ts","sourceRoot":"","sources":["../../../../for_UrlHelpers/when_building_query_params/with_array_values.ts"],"names":[],"mappings":""}
@@ -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,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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,C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a,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQnD,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,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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I,EAAE,CAAC;QACrD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA,EAAG,gBAAgB,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;QACnF,IAAI,MAAM,EAAE;YACR,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAClC,YAAA,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD;AACA,QAAA,OAAO,EAAE;IACb;AAEQ,IAAA,OAAO,WAAW,GAAA;QACtB,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE;QACrC,QAAQ,CAAC,MAAM,GAAG,CAAA,EAAG,gBAAgB,CAAC,UAAU,yCAAyC;IAC7F;;;;;"}
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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,KAAK,WAAW;YAAE;QACrC,QAAQ,CAAC,MAAM,GAAG,CAAA,EAAG,gBAAgB,CAAC,UAAU,yCAAyC;IAC7F;;;;;"}
@@ -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;CAAE,CAAC;IAChF,QAAQ,CAAC,KAAK,2BAA2B;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAM;IACrC,QAAQ,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,CAElD;IAEF,IAAI,yBAAyB,IAAI,MAAM,E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E,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,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,MAAM,OAAO,YAAa,SAAQ,QAAgC;IACrD,KAAK,GAAG,gBAAgB,CAAC;IACzB,YAAY,GAAG,EAAE,CAAC;IAClB,oBAAoB,GAA0B;QACnD,IAAI,mBAAmB,CAAC,I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ACxD,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"}