@gentiq/core 1.0.0-alpha.7 → 1.0.0-alpha.9
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/dist/client/api.es.js +11 -9
- package/dist/index.d.ts +1269 -77
- package/dist/index.es.js +27 -25
- package/dist/internal.d.ts +1259 -79
- package/package.json +1 -1
package/dist/client/api.es.js
CHANGED
|
@@ -7,26 +7,26 @@ const h = 3e4;
|
|
|
7
7
|
function _(t = {}, s = {}) {
|
|
8
8
|
const n = m(
|
|
9
9
|
t.authAdapter ?? g(t.cacheNamespace ?? "gentiq")
|
|
10
|
-
),
|
|
10
|
+
), u = q({
|
|
11
11
|
basePath: t.basePath ?? "/api",
|
|
12
12
|
fetch: t.fetch,
|
|
13
13
|
timeout: t.timeout ?? h,
|
|
14
14
|
getHeaders: n.getHeaders,
|
|
15
15
|
credentials: n.credentials
|
|
16
|
-
}), c = T(
|
|
17
|
-
http:
|
|
16
|
+
}), c = T(u, n, t), e = p((r, d) => c.uploadAttachment(r, d)), a = f({
|
|
17
|
+
http: u,
|
|
18
18
|
resolveAttachment: (r) => c.getAttachmentBlobUrl(r),
|
|
19
19
|
throttleMs: s.throttleMs,
|
|
20
20
|
getRunOptions: s.getRunOptions
|
|
21
21
|
});
|
|
22
|
-
return { api: c, http:
|
|
22
|
+
return { api: c, http: u, auth: n, options: t, composerFiles: e, composerDrafts: b(), chat: a };
|
|
23
23
|
}
|
|
24
24
|
function C(t) {
|
|
25
25
|
return _(t).api;
|
|
26
26
|
}
|
|
27
27
|
const o = (t) => t.replace(/^\//, "");
|
|
28
28
|
function T(t, s, n) {
|
|
29
|
-
const
|
|
29
|
+
const u = n.timeout ?? h;
|
|
30
30
|
async function c(e) {
|
|
31
31
|
return URL.createObjectURL(await e.blob());
|
|
32
32
|
}
|
|
@@ -61,9 +61,9 @@ function T(t, s, n) {
|
|
|
61
61
|
* Create an account and sign in. `values` maps each enabled login field to the value the
|
|
62
62
|
* user gave for it; the backend requires at least one.
|
|
63
63
|
*/
|
|
64
|
-
register: async (e, a, r,
|
|
64
|
+
register: async (e, a, r, d, l) => {
|
|
65
65
|
const i = await t.request("post", "/public/auth/register", {
|
|
66
|
-
body: { ...e, password: a, name: r, surname:
|
|
66
|
+
body: { ...e, password: a, name: r, surname: d, metadata: l },
|
|
67
67
|
auth: !1
|
|
68
68
|
});
|
|
69
69
|
return s.setToken(i.token), i;
|
|
@@ -150,7 +150,7 @@ function T(t, s, n) {
|
|
|
150
150
|
transcribe: (e, a) => t.request("post", "/chat/transcribe", {
|
|
151
151
|
blob: e.type ? e : new Blob([e], { type: "audio/webm" }),
|
|
152
152
|
signal: a,
|
|
153
|
-
timeout:
|
|
153
|
+
timeout: u * 4
|
|
154
154
|
}),
|
|
155
155
|
/**
|
|
156
156
|
* Upload a file for a message the user is about to send. A file part names the answer's `id`
|
|
@@ -171,7 +171,9 @@ function T(t, s, n) {
|
|
|
171
171
|
},
|
|
172
172
|
getAppConfig: (e) => t.request("get", "/config", { signal: e, auth: !1 }),
|
|
173
173
|
/** Whether the service is under maintenance. Public; polled by `useGentiqStatus`. */
|
|
174
|
-
getStatus: (e) => t.request("get", "/status", { signal: e, auth: !1 })
|
|
174
|
+
getStatus: (e) => t.request("get", "/status", { signal: e, auth: !1 }),
|
|
175
|
+
/** Submit a bug report, feature request or general feedback from the signed-in user. */
|
|
176
|
+
submitUserReport: (e, a) => t.request("post", "/users/me/reports", { body: e, signal: a })
|
|
175
177
|
};
|
|
176
178
|
}
|
|
177
179
|
export {
|