@servicetitan/docs-anvil-uikit-contrib 27.6.0 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,7 +36,7 @@ Configure API response.
36
36
 
37
37
  ```ts
38
38
  add(
39
- path: RegExp,
39
+ path: RegExp | string,
40
40
  response: {
41
41
  body?: (url: string) => any,
42
42
  status?: number,
@@ -44,7 +44,7 @@ add(
44
44
  )
45
45
  ```
46
46
 
47
- - `path`: regular expression to match against GET request URLs. If a URL matches more than one path, the first one wins.
47
+ - `path`: regular expression to match against GET request URLs, or string value that must equal GET request URL. If a URL matches more than one path, the first one wins.
48
48
  - `body`: function that returns the API response. If omitted, or if it returns `undefined`, the mock returns an empty object (`{}`).
49
49
  - `status`: HTTP status code for API response. Defaults to 200.
50
50
 
@@ -54,6 +54,9 @@ apiResponses.add(/desktop\/version\.json/, { body: () => ({ clientVersion }) });
54
54
 
55
55
  // Configure GET /Admin/GetClientData to return 401 status
56
56
  apiResponses.add(/Admin\/GetClientData/, { status: 401 });
57
+
58
+ // Configure GET /Admin/GetClientData to return 403 status, using exact path
59
+ apiResponses.add('/Admin/GetClientData', { status: 403 });
57
60
  ```
58
61
 
59
62
  **Note:** `MockApiCalls` passes the request URL to the `body` function so that it can customize the return value based on query params or other attributes. This also facilitates logging API calls for debugging purposes.
@@ -69,7 +72,7 @@ Replace a previously configured API response.
69
72
 
70
73
  ```ts
71
74
  replace(
72
- path: RegExp,
75
+ path: RegExp | string,
73
76
  response: {
74
77
  body?: (url: string) => any,
75
78
  status?: number,
@@ -77,7 +80,7 @@ replace(
77
80
  )
78
81
  ```
79
82
 
80
- - `path`: the exact regular expression to replace
83
+ - `path`: the exact regular expression to replace or exact string value to replace.
81
84
  - `response`: see [add](#add)
82
85
 
83
86
  The `path` must exactly match a previously configured API response. Otherwise, the function does nothing.
@@ -85,6 +88,9 @@ The `path` must exactly match a previously configured API response. Otherwise, t
85
88
  ```ts
86
89
  // Change GET /Admin/GetClientData to return 403 status
87
90
  apiResponses.replace(/Admin\/GetClientData/, { status: 403 });
91
+
92
+ // Change GET /Admin/GetClientData to return 401 status, using exact path
93
+ apiResponses.replace('/Admin/GetClientData', { status: 401 });
88
94
  ```
89
95
 
90
96
  ### reset
@@ -18,7 +18,7 @@ AnvilSelect component with built-in customizable list of time zone options.
18
18
 
19
19
  <CodeDemo example={TimeZoneSelectDemo} srcPath="time-zones/src/demo/time-zone-select.tsx" />
20
20
 
21
- ## Extended Time Picker
21
+ ## Time Picker Extended
22
22
 
23
23
  Standard Anvil TimePicker with added options for displaying the time zone that's provided via TimeZoneProvider, and customizing options content.
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-anvil-uikit-contrib",
3
- "version": "27.6.0",
3
+ "version": "28.0.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,5 +16,5 @@
16
16
  "cli": {
17
17
  "webpack": false
18
18
  },
19
- "gitHead": "7666b6d172355ebbf911fe13e9c2e0c53b33c59d"
19
+ "gitHead": "7093c94176a1cf164fbb81e186123625abd87795"
20
20
  }