@webority/support-react 0.24.0 → 0.26.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.
package/README.md CHANGED
@@ -38,7 +38,9 @@ export function App() {
38
38
  ```
39
39
 
40
40
  `createSupportClient(http, basePath = "/api/support")` accepts any axios-like instance with
41
- `get(url, config)` and `post(url, data, config)` that resolve to `{ data }`. Every method
41
+ `get(url, config)` and `post(url, data, config)` that resolve to `{ data }`. The second argument
42
+ is the base path as a string, or as `{ base }` the way `createChatClient(http, { base })` takes
43
+ it: `createSupportClient(userClient, { base: "/api/support" })`. Every method
42
44
  rejects with a `SupportApiError` carrying `code`, `status` and a `message` written for the
43
45
  person, which the components show as-is.
44
46
 
@@ -45,7 +45,7 @@ function z(e, t, n, r) {
45
45
  });
46
46
  }
47
47
  function ee(e, t = "/api/support") {
48
- let n = t.replace(/\/+$/, ""), r = (e) => `${n}/tickets/${encodeURIComponent(e)}`;
48
+ let n = (typeof t == "string" ? t : t?.base ?? "/api/support").replace(/\/+$/, ""), r = (e) => `${n}/tickets/${encodeURIComponent(e)}`;
49
49
  return {
50
50
  getConfig: () => L(() => e.get(`${n}/settings`)),
51
51
  listTickets: ({ status: t, search: r, page: i, pageSize: a } = {}) => {
@@ -164,7 +164,10 @@ export type SupportClient = {
164
164
  * Binds the support HTTP contract to the product's own authenticated client.
165
165
  *
166
166
  * @param {SupportHttp} http The product's axios-like instance (bearer token and refresh already wired).
167
- * @param {string} [basePath="/api/support"] The prefix the API maps the support endpoints under.
167
+ * @param {string | { base?: string }} [options="/api/support"] The prefix the API maps the support endpoints
168
+ * under, as a string or as `{ base }` like `createChatClient`.
168
169
  * @returns {SupportClient}
169
170
  */
170
- export declare function createSupportClient(http: SupportHttp, basePath?: string): SupportClient;
171
+ export declare function createSupportClient(http: SupportHttp, options?: string | {
172
+ base?: string;
173
+ }): SupportClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/support-react",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "Webority customer support for React portals: ticket centre, report-an-issue with a page screenshot, and support contact details, built on @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "react": "^19.0.0",
33
33
  "react-bootstrap": "^2.10.0",
34
34
  "react-dom": "^19.0.0",
35
- "@webority/ui-react": "0.24.0"
35
+ "@webority/ui-react": "0.26.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@testing-library/dom": "10.4.2",
@@ -50,7 +50,7 @@
50
50
  "typescript": "^7.0.2",
51
51
  "vite": "^8.0.12",
52
52
  "vitest": "5.0.1",
53
- "@webority/ui-react": "0.24.0"
53
+ "@webority/ui-react": "0.26.0"
54
54
  },
55
55
  "dependencies": {
56
56
  "html-to-image": "^1.11.13"