@rebasepro/client 0.12.0 → 0.12.1-canary.gdfba2a1
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/index.es.js +5 -4
- package/dist/index.es.js.map +1 -1
- package/package.json +8 -8
- package/src/functions.ts +9 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.1-canary.gdfba2a1",
|
|
5
5
|
"description": "HTTP SDK client for the Rebase custom backend",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/rebaseco"
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"./package.json": "./package.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@rebasepro/common": "0.12.
|
|
33
|
-
"@rebasepro/types": "0.12.
|
|
34
|
-
"@rebasepro/utils": "0.12.
|
|
32
|
+
"@rebasepro/common": "0.12.1-canary.gdfba2a1",
|
|
33
|
+
"@rebasepro/types": "0.12.1-canary.gdfba2a1",
|
|
34
|
+
"@rebasepro/utils": "0.12.1-canary.gdfba2a1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@jest/globals": "^30.4.1",
|
|
38
38
|
"@types/jest": "^30.0.0",
|
|
39
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^26.1.2",
|
|
40
40
|
"@types/ws": "^8.18.1",
|
|
41
41
|
"cross-env": "^10.1.0",
|
|
42
42
|
"fake-indexeddb": "^6.2.5",
|
|
43
43
|
"jest": "^30.4.2",
|
|
44
|
-
"ts-jest": "^29.4.
|
|
44
|
+
"ts-jest": "^29.4.12",
|
|
45
45
|
"tsd": "^0.33.0",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
|
-
"vite": "^8.
|
|
48
|
-
"ws": "^8.21.
|
|
47
|
+
"vite": "^8.1.5",
|
|
48
|
+
"ws": "^8.21.1"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"dist",
|
package/src/functions.ts
CHANGED
|
@@ -55,7 +55,15 @@ export function createFunctionsClient(transport: Transport): FunctionsClient {
|
|
|
55
55
|
options?: FunctionInvokeOptions
|
|
56
56
|
): Promise<T> {
|
|
57
57
|
const method = options?.method ?? "POST";
|
|
58
|
-
|
|
58
|
+
// A `path` that starts the query or fragment is appended as-is. Only a
|
|
59
|
+
// real sub-path gets a separator: inserting one before `?days=30` asks
|
|
60
|
+
// for `/functions/dashboard-stats/?days=30`, and the trailing slash
|
|
61
|
+
// misses the route, so a function that exists answers 404 — and the
|
|
62
|
+
// caller sees it as the backend being down rather than as a bad URL.
|
|
63
|
+
const rawPath = options?.path;
|
|
64
|
+
const subPath = rawPath
|
|
65
|
+
? (/^[?#]/.test(rawPath) ? rawPath : `/${rawPath.replace(/^\//, "")}`)
|
|
66
|
+
: "";
|
|
59
67
|
const routePath = `/functions/${encodeURIComponent(name)}${subPath}`;
|
|
60
68
|
|
|
61
69
|
const init: RequestInit = { method };
|