@servicetitan/docs-anvil-uikit-contrib 27.7.0 → 28.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: TanStack Query MobX Integration
3
+ ---
4
+
5
+ `@servicetitan/tanstack-query-mobx` contains integrations for using TanStack Query inside MobX stores.
6
+
7
+ Documentation for setup and use can be seen [here](https://docs.google.com/document/d/1MfFMtwF4Rb3rj076GWJSgNiA9PtfVThlZBNK4frZHrs/edit?usp=drive_link)
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-anvil-uikit-contrib",
3
- "version": "27.7.0",
3
+ "version": "28.1.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": "27efae7a3654b22f8a7c563950522cda0b2ae078"
19
+ "gitHead": "5cb8f2f396504486683170821c9768208f3d1edd"
20
20
  }