@squadbase/vantage-sdk 0.1.2-dev1.50b3caa → 0.1.2-dev1.5764814
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 +7 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ when no response came back), `errorCode` (Squadbase's error code, or `null`), an
|
|
|
111
111
|
|---|---|
|
|
112
112
|
| `invalidId` | The id is not a UUID (nothing was sent) |
|
|
113
113
|
| `unavailable` | Function definitions are not available in this environment |
|
|
114
|
-
| `unauthorized` | The viewer is not signed in, or the session expired |
|
|
114
|
+
| `unauthorized` | The app is private and the viewer is not signed in, or the session expired. A public app never returns this: anyone who can open it, signed in or not, runs the call as an anonymous viewer |
|
|
115
115
|
| `forbidden` | The viewer may not access this app |
|
|
116
116
|
| `notFound` | The definition does not exist or this app cannot use it |
|
|
117
117
|
| `invalidParams` | The arguments do not match the definition or are too large |
|
|
@@ -129,6 +129,11 @@ when no response came back), `errorCode` (Squadbase's error code, or `null`), an
|
|
|
129
129
|
`/_sqcore/queries/{queryId}/execute` on the app's own origin with the viewer's session, so the page
|
|
130
130
|
holds no credentials and the app needs no `server/api` handler for it.
|
|
131
131
|
|
|
132
|
+
In a **public app**, `runQuery` and `runDefinition` also work for viewers who are not signed in:
|
|
133
|
+
anyone who can open the page can run the Queries and definitions the published build calls, with
|
|
134
|
+
any arguments. Only call a Query or definition from a public page if its result is fine to show to
|
|
135
|
+
anyone for every argument value.
|
|
136
|
+
|
|
132
137
|
```ts
|
|
133
138
|
import { QueryExecutionError, runQuery } from "@squadbase/vantage-sdk/client";
|
|
134
139
|
|
|
@@ -162,7 +167,7 @@ Every other failure is a `QueryExecutionError` with the same fields as `Definiti
|
|
|
162
167
|
|---|---|
|
|
163
168
|
| `invalidId` | The id is not a UUID (nothing was sent) |
|
|
164
169
|
| `unavailable` | Running Queries from a page is not available in this environment |
|
|
165
|
-
| `unauthorized` | The viewer is not signed in, or the session expired |
|
|
170
|
+
| `unauthorized` | The app is private and the viewer is not signed in, or the session expired. A public app never returns this: anyone who can open it, signed in or not, runs the call as an anonymous viewer |
|
|
166
171
|
| `forbidden` | The viewer may not access this app |
|
|
167
172
|
| `notFound` | The Query does not exist or this app cannot use it |
|
|
168
173
|
| `notCallable` | The Query cannot be run from a page (an HTTP Query, or one that writes) |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squadbase/vantage-sdk",
|
|
3
|
-
"version": "0.1.2-dev1.
|
|
3
|
+
"version": "0.1.2-dev1.5764814",
|
|
4
4
|
"description": "SDK for Squadbase Vantage apps (server handlers and the browser)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"vite": "^8.3.4",
|
|
30
30
|
"vitest": "^5.0.5"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "5764814cb35fe4ce90e4266d5242413a906e3880",
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rm -rf dist && tsup",
|
|
35
35
|
"type-check": "tsc && tsc -p tsconfig.client.json",
|