@anchrd/colab-sdk 0.0.0-stage → 0.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.
- package/README.md +65 -2
- package/dist/actions/actions.d.ts +810 -0
- package/dist/actions/actions.js +177 -0
- package/dist/admin-mode.d.ts +2 -0
- package/dist/admin-mode.js +5 -0
- package/dist/apps/apps.d.ts +108 -0
- package/dist/apps/apps.js +73 -0
- package/dist/archive/archive.d.ts +25 -0
- package/dist/archive/archive.js +27 -0
- package/dist/auth/auth.d.ts +27 -0
- package/dist/auth/auth.js +22 -0
- package/dist/authorization/authorization.d.ts +36 -0
- package/dist/authorization/authorization.js +23 -0
- package/dist/boards/boards.d.ts +612 -0
- package/dist/boards/boards.js +289 -0
- package/dist/columns/columns.d.ts +28 -0
- package/dist/columns/columns.js +28 -0
- package/dist/connections/connections.d.ts +149 -0
- package/dist/connections/connections.js +74 -0
- package/dist/connectors/connectors.d.ts +148 -0
- package/dist/connectors/connectors.js +83 -0
- package/dist/dashboards/dashboards.d.ts +221 -0
- package/dist/dashboards/dashboards.js +520 -0
- package/dist/directory/directory.d.ts +20 -0
- package/dist/directory/directory.js +18 -0
- package/dist/documents/documents.d.ts +61 -0
- package/dist/documents/documents.js +58 -0
- package/dist/error/error.d.ts +34 -0
- package/dist/error/error.js +30 -0
- package/dist/events/events.d.ts +104 -0
- package/dist/events/events.js +69 -0
- package/dist/files/files.d.ts +60 -0
- package/dist/files/files.js +139 -0
- package/dist/functions/functions.d.ts +26 -0
- package/dist/functions/functions.js +28 -0
- package/dist/grammar/grammar.d.ts +62 -0
- package/dist/grammar/grammar.js +197 -0
- package/dist/grants/grants.d.ts +93 -0
- package/dist/grants/grants.js +66 -0
- package/dist/ids/ids.d.ts +5 -0
- package/dist/ids/ids.js +12 -0
- package/dist/instructions/instructions.d.ts +19 -0
- package/dist/instructions/instructions.js +35 -0
- package/dist/interfaces/interfaces.d.ts +41 -0
- package/dist/interfaces/interfaces.js +52 -0
- package/dist/invitations/invitations.d.ts +98 -0
- package/dist/invitations/invitations.js +58 -0
- package/dist/links/links.d.ts +76 -0
- package/dist/links/links.js +73 -0
- package/dist/list-input.d.ts +3 -0
- package/dist/list-input.js +11 -0
- package/dist/machines/machines.d.ts +69 -0
- package/dist/machines/machines.js +39 -0
- package/dist/messages/messages.d.ts +117 -0
- package/dist/messages/messages.js +77 -0
- package/dist/nodes/nodes.d.ts +673 -0
- package/dist/nodes/nodes.js +354 -0
- package/dist/operators/operators.d.ts +898 -0
- package/dist/operators/operators.js +398 -0
- package/dist/pages/pages.d.ts +89 -0
- package/dist/pages/pages.js +62 -0
- package/dist/primitives/primitives.d.ts +5 -0
- package/dist/primitives/primitives.js +19 -0
- package/dist/profile/profile.d.ts +37 -0
- package/dist/profile/profile.js +43 -0
- package/dist/roles/roles.d.ts +135 -0
- package/dist/roles/roles.js +87 -0
- package/dist/runs/runs.d.ts +244 -0
- package/dist/runs/runs.js +137 -0
- package/dist/runtime-config.d.ts +12 -0
- package/dist/runtime-config.js +18 -0
- package/dist/sdk.d.ts +45 -0
- package/dist/sdk.js +48 -0
- package/dist/secrets/secrets.d.ts +65 -0
- package/dist/secrets/secrets.js +57 -0
- package/dist/service-client/service-client.d.ts +35 -0
- package/dist/service-client/service-client.js +90 -0
- package/dist/services/services.d.ts +122 -0
- package/dist/services/services.js +89 -0
- package/dist/sso/sso.d.ts +70 -0
- package/dist/sso/sso.js +54 -0
- package/dist/tables/tables.d.ts +133 -0
- package/dist/tables/tables.js +131 -0
- package/dist/tool.d.ts +31 -0
- package/dist/tool.js +4 -0
- package/dist/user-settings/user-settings.d.ts +44 -0
- package/dist/user-settings/user-settings.js +44 -0
- package/dist/users/users.d.ts +254 -0
- package/dist/users/users.js +125 -0
- package/dist/validation/validation.d.ts +106 -0
- package/dist/validation/validation.js +41 -0
- package/dist/versions/versions.d.ts +100 -0
- package/dist/versions/versions.js +70 -0
- package/package.json +27 -4
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { idSchema } from "../ids/ids.js";
|
|
3
|
+
import { Limit as PageSize } from "../list-input.js";
|
|
4
|
+
import { NodeId, NodePerson, SecretFields } from "../nodes/nodes.js";
|
|
5
|
+
import { Rev } from "../primitives/primitives.js";
|
|
6
|
+
import { TableColumn } from "../tables/tables.js";
|
|
7
|
+
// Versions of documents, tables and files (#38, Funktionen › Freigeben und Versionen, E37, E70): the
|
|
8
|
+
// inputs of `intelligence_node_version_list`, `_get` and `_create`, and their answers. Content is
|
|
9
|
+
// written by the tools of its kind (#39, #40, #41); these three only read the history and restore.
|
|
10
|
+
// Every answer carries the node's `rev`, the state the next save sends back (E70); people see the
|
|
11
|
+
// version number, never the rev.
|
|
12
|
+
export const VersionId = idSchema("version").describe("The version's id, `version_…`.");
|
|
13
|
+
// The kinds that have versions (E37): the same three that are validated.
|
|
14
|
+
export const versionKinds = ["document", "table", "file"];
|
|
15
|
+
export const NodeVersionListInput = z.strictObject({
|
|
16
|
+
nodeId: NodeId.describe("The document, table or file whose versions to list."),
|
|
17
|
+
cursor: z
|
|
18
|
+
.string()
|
|
19
|
+
.max(100)
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("The nextCursor of the previous page, unchanged. Leaving it out starts at the newest."),
|
|
22
|
+
limit: PageSize.optional().describe("How many versions one page holds, 1 to 100. Leaving it out gives 50."),
|
|
23
|
+
});
|
|
24
|
+
export const NodeVersionGetInput = z.strictObject({
|
|
25
|
+
nodeId: NodeId.describe("The document, table or file the version belongs to."),
|
|
26
|
+
versionId: VersionId.describe("The version to read, from intelligence_node_version_list. A version of another node answers not_found."),
|
|
27
|
+
});
|
|
28
|
+
export const NodeVersionCreateInput = z.strictObject({
|
|
29
|
+
nodeId: NodeId.describe("The document, table or file to restore an earlier state of."),
|
|
30
|
+
fromVersionId: VersionId.describe("The version whose content becomes the newest version again. Nothing is deleted: the versions after it stay, and the new one says which number it was restored from."),
|
|
31
|
+
rev: Rev,
|
|
32
|
+
});
|
|
33
|
+
// One entry of the history.
|
|
34
|
+
export const NodeVersion = z.strictObject({
|
|
35
|
+
versionId: VersionId,
|
|
36
|
+
nodeId: NodeId,
|
|
37
|
+
// Counts from 1 per node; what people read ("Version 6").
|
|
38
|
+
number: z.number().int(),
|
|
39
|
+
// When the version began, and when its editing session last saved into it.
|
|
40
|
+
createdAt: z.iso.datetime(),
|
|
41
|
+
updatedAt: z.iso.datetime(),
|
|
42
|
+
createdBy: NodePerson,
|
|
43
|
+
// The OAuth client the author wrote through, null in the browser and for a machine's own token.
|
|
44
|
+
appHandle: z.string().nullable(),
|
|
45
|
+
// The number this version restored ("Zurückgesetzt 6 → 3"); null for an ordinary save.
|
|
46
|
+
restoredFrom: z.number().int().nullable(),
|
|
47
|
+
// The newest version, the one the node shows ("Aktuell").
|
|
48
|
+
current: z.boolean(),
|
|
49
|
+
// Bytes of the content (UTF-8 for text, the object for a file).
|
|
50
|
+
size: z.number().int(),
|
|
51
|
+
});
|
|
52
|
+
export const NodeVersionList = z.strictObject({
|
|
53
|
+
items: z.array(NodeVersion),
|
|
54
|
+
nextCursor: z.string().nullable(),
|
|
55
|
+
// The node's revision now, to send with a restore.
|
|
56
|
+
rev: z.number().int(),
|
|
57
|
+
});
|
|
58
|
+
export const NodeVersionDetail = NodeVersion.extend({
|
|
59
|
+
// The text of a document (Markdown) or a table; null for a file, whose bytes come with #41.
|
|
60
|
+
content: z.string().nullable(),
|
|
61
|
+
// Only for a file: its media type.
|
|
62
|
+
mediaType: z.string().nullable(),
|
|
63
|
+
// Only for a table: its columns with their types in this version (#40).
|
|
64
|
+
columns: z.array(TableColumn).nullable(),
|
|
65
|
+
// The node's revision now: after a restore the one the next save sends.
|
|
66
|
+
rev: z.number().int(),
|
|
67
|
+
// A version of a secret node (#357): `content` and `columns` are null while it is `locked` for
|
|
68
|
+
// this caller.
|
|
69
|
+
...SecretFields,
|
|
70
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchrd/colab-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Types, Zod schemas and the service client of Colab, the contract between its UI, backends and outside services.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/anchrd/colab.git",
|
|
10
|
+
"directory": "packages/sdk"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/sdk.d.ts",
|
|
16
|
+
"default": "./dist/sdk.js"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/sdk.js",
|
|
21
|
+
"types": "./dist/sdk.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"ulid": "^3.0.2",
|
|
27
|
+
"zod": "^4.4.3"
|
|
28
|
+
}
|
|
29
|
+
}
|