@opencrvs/toolkit 1.9.2-rc.b675f4b → 1.9.2-rc.fd254a6

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.
@@ -11,6 +11,21 @@ export type SystemVariables = {
11
11
  province: string;
12
12
  district: string;
13
13
  };
14
+ $window: {
15
+ location: {
16
+ href: string;
17
+ pathname: string;
18
+ hostname: string;
19
+ };
20
+ };
21
+ };
22
+ /**
23
+ * Resolves `window().location.get('href')` to `window.location.href` to allow us to 1) type check system variables 2) change the implementation later if needed
24
+ */
25
+ export declare const window: () => {
26
+ location: {
27
+ get: (key: "href" | "pathname" | "hostname") => string;
28
+ };
14
29
  };
15
30
  /**
16
31
  * Recursively flatten the keys of an object. Used to limit types when configuring default values in country config.
@@ -371,6 +371,7 @@ __export(events_exports, {
371
371
  validate: () => validate,
372
372
  validateFieldInput: () => validateFieldInput,
373
373
  validateValue: () => validateValue,
374
+ window: () => window2,
374
375
  workqueueActions: () => workqueueActions,
375
376
  writeActions: () => writeActions
376
377
  });
@@ -8499,6 +8500,13 @@ var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
8499
8500
  ]);
8500
8501
 
8501
8502
  // ../commons/src/events/TemplateConfig.ts
8503
+ var window2 = () => ({
8504
+ location: {
8505
+ get: (key) => {
8506
+ return `$window.location.${key}`;
8507
+ }
8508
+ }
8509
+ });
8502
8510
  function isTemplateVariable(value) {
8503
8511
  return typeof value === "string" && value.startsWith("$");
8504
8512
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.2-rc.b675f4b",
3
+ "version": "1.9.2-rc.fd254a6",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {