@raisindb/functions-types 0.4.5 → 0.5.4

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/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@raisindb/functions-types",
3
- "version": "0.4.5",
3
+ "version": "0.5.4",
4
4
  "description": "TypeScript type definitions for the RaisinDB server-side function runtime (QuickJS)",
5
5
  "license": "MIT",
6
6
  "types": "raisin.d.ts",
7
7
  "files": [
8
8
  "raisin.d.ts",
9
+ "raisin.generated.d.ts",
9
10
  "index.d.ts"
10
11
  ],
11
12
  "repository": {
@@ -0,0 +1,206 @@
1
+ // Code generated by `cargo run -p raisin-functions --bin gen-bindings`.
2
+ // DO NOT EDIT — edit `crates/raisin-functions/src/runtime/bindings/` and
3
+ // re-run `make gen-bindings` instead.
4
+ //
5
+ // Generated companion to the hand-written `raisin.d.ts`. It describes the
6
+ // `raisin.*` surface exactly as the bindings registry defines it, with no
7
+ // prose and no hand-authored helper types.
8
+
9
+ declare namespace raisin {
10
+ namespace admin {
11
+ namespace nodes {
12
+ function create(workspace: string, parentPath: string, data: any): Promise<any>;
13
+ function delete(workspace: string, path: string): Promise<void>;
14
+ function get(workspace: string, path: string): Promise<any | null>;
15
+ function getById(workspace: string, id: string): Promise<any | null>;
16
+ function getChildren(workspace: string, parentPath: string, limit?: number): Promise<any[]>;
17
+ function query(workspace: string, query: any): Promise<any[]>;
18
+ function update(workspace: string, path: string, data: any): Promise<any>;
19
+ function updateProperty(workspace: string, nodePath: string, propertyPath: string, value: any): Promise<void>;
20
+ }
21
+ namespace sql {
22
+ function execute(sql: string, params: any[]): Promise<number>;
23
+ function query(sql: string, params: any[]): Promise<any>;
24
+ }
25
+ }
26
+
27
+ namespace ai {
28
+ function completion(request: any): Promise<any>;
29
+ function embed(request: any): Promise<any>;
30
+ function getDefaultModel(useCase: string): Promise<any | null>;
31
+ function listModels(): Promise<any[]>;
32
+ function listProviders(): Promise<any[]>;
33
+ }
34
+
35
+ namespace assets {
36
+ function ensureContent(workspace: string, nodeRef: string): Promise<any>;
37
+ function reextract(workspace: string, nodeRef: string): Promise<any>;
38
+ function setExtractedText(workspace: string, nodeRef: string, text: string, options: any): Promise<any>;
39
+ function signedUrl(workspace: string, nodeRef: string, options: any): Promise<any>;
40
+ }
41
+
42
+ namespace branches {
43
+ function compare(branch: string, baseBranch: string): Promise<any>;
44
+ function copyNodes(sourceBranch: string, targetBranch: string, opts: any): Promise<any>;
45
+ function diff(branch: string, baseBranch: string): Promise<any>;
46
+ }
47
+
48
+ namespace crypto {
49
+ function generateKeyPair(alg?: string | null): Promise<any>;
50
+ function hash(input: string, alg?: string | null): Promise<string>;
51
+ function randomBytes(n: number): Promise<string>;
52
+ function signJwt(claims: any, private_jwk: any, opts?: any): Promise<string>;
53
+ function uuid(): Promise<string>;
54
+ function verifyJwt(token: string, opts?: any): Promise<any>;
55
+ }
56
+
57
+ namespace date {
58
+ function addDays(timestamp: number, days: number): Promise<number>;
59
+ function diffDays(ts1: number, ts2: number): Promise<number>;
60
+ function format(timestamp: number, format?: string | null): Promise<string>;
61
+ function now(): Promise<string>;
62
+ function parse(dateStr: string, format?: string | null): Promise<number>;
63
+ function timestamp(): Promise<number>;
64
+ function timestampMillis(): Promise<number>;
65
+ }
66
+
67
+ namespace email {
68
+ function providers(): Promise<any>;
69
+ function send(message: any): Promise<any>;
70
+ }
71
+
72
+ namespace events {
73
+ function emit(eventType: string, data: any): Promise<void>;
74
+ }
75
+
76
+ namespace flows {
77
+ function run(flowPath: string, input: any): Promise<any>;
78
+ }
79
+
80
+ namespace functions {
81
+ function call(functionPath: string, arguments: any): Promise<any>;
82
+ function execute(functionPath: string, arguments: any, context: any): Promise<any>;
83
+ }
84
+
85
+ namespace http {
86
+ function request(method: string, url: string, options: any): Promise<any>;
87
+ }
88
+
89
+ namespace identities {
90
+ function findByEmail(email: string): Promise<any | null>;
91
+ function update(id: string, patch: any): Promise<any>;
92
+ }
93
+
94
+ namespace imap {
95
+ function fetchMessage(conn: any, uid: number, opts?: any): Promise<any>;
96
+ function fetchSince(conn: any, sinceUid: number, opts?: any): Promise<any>;
97
+ function listMailboxes(conn: any): Promise<any>;
98
+ }
99
+
100
+ namespace integrations {
101
+ function syncNow(mountId: string, mode?: string | null): Promise<any>;
102
+ }
103
+
104
+ namespace inventory {
105
+ function claim(pool: string, n: number, capacity: number): Promise<any>;
106
+ function release(pool: string, n: number): Promise<number>;
107
+ }
108
+
109
+ namespace locks {
110
+ function acquire(key: string, ttlMs: number, owner?: string | null): Promise<any>;
111
+ function release(key: string, token: number): Promise<boolean>;
112
+ function renew(key: string, token: number, ttlMs: number): Promise<boolean>;
113
+ }
114
+
115
+ namespace nodes {
116
+ function addResource(workspace: string, nodePath: string, propertyPath: string, uploadData: any): Promise<any>;
117
+ function applyChildOrder(workspace: string, parentPath: string, sourceBranch: string, targetBranch: string): Promise<void>;
118
+ function create(workspace: string, parentPath: string, data: any): Promise<any>;
119
+ function delete(workspace: string, path: string): Promise<void>;
120
+ function get(workspace: string, path: string): Promise<any | null>;
121
+ function getById(workspace: string, id: string): Promise<any | null>;
122
+ function getChildren(workspace: string, parentPath: string, limit?: number): Promise<any[]>;
123
+ function history(workspace: string, id: string, limit?: number): Promise<any[]>;
124
+ function move(workspace: string, nodePath: string, newParentPath: string): Promise<any>;
125
+ function moveChildAfter(workspace: string, parentPath: string, childName: string, afterChildName: string): Promise<void>;
126
+ function moveChildBefore(workspace: string, parentPath: string, childName: string, beforeChildName: string): Promise<void>;
127
+ function query(workspace: string, query: any): Promise<any[]>;
128
+ function reorderChild(workspace: string, parentPath: string, childName: string, position: number): Promise<void>;
129
+ function update(workspace: string, path: string, data: any): Promise<any>;
130
+ function updateProperty(workspace: string, nodePath: string, propertyPath: string, value: any): Promise<void>;
131
+ }
132
+
133
+ namespace notify {
134
+ function notify(options: any): Promise<any>;
135
+ }
136
+
137
+ namespace ocr {
138
+ function image(base64Data: string, options: any): Promise<any>;
139
+ }
140
+
141
+ namespace pdf {
142
+ function extractText(base64Data: string): Promise<any>;
143
+ function getPageCount(base64Data: string): Promise<number>;
144
+ function ocr(base64Data: string, options: any): Promise<any>;
145
+ function processFromStorage(storageKey: string, options: any): Promise<any>;
146
+ }
147
+
148
+ namespace platform {
149
+ function hook(name: string, payload: any): Promise<any>;
150
+ }
151
+
152
+ namespace resources {
153
+ function getBinary(storageKey: string): Promise<string>;
154
+ }
155
+
156
+ namespace scheduler {
157
+ function cancel(jobIdOrKey: string): Promise<any>;
158
+ function get(jobIdOrKey: string): Promise<any>;
159
+ function list(filter?: any): Promise<any>;
160
+ function schedule(request: any): Promise<any>;
161
+ }
162
+
163
+ namespace secrets {
164
+ function delete(name: string): Promise<any>;
165
+ function get(name: string, version?: number): Promise<string>;
166
+ function list(): Promise<any[]>;
167
+ function put(name: string, value: string): Promise<any>;
168
+ function resolve(value: string): Promise<string>;
169
+ function rotate(name: string, value: string): Promise<any>;
170
+ }
171
+
172
+ namespace sql {
173
+ function execute(sql: string, params: any[]): Promise<number>;
174
+ function query(sql: string, params: any[]): Promise<any>;
175
+ }
176
+
177
+ namespace tasks {
178
+ function complete(task_id: string, response: any): Promise<any>;
179
+ function create(request: any): Promise<any>;
180
+ function query(query: any): Promise<any[]>;
181
+ function update(task_id: string, updates: any): Promise<any>;
182
+ }
183
+
184
+ namespace tx {
185
+ function add(txId: string, workspace: string, data: any): Promise<any>;
186
+ function begin(): Promise<string>;
187
+ function commit(txId: string): Promise<void>;
188
+ function create(txId: string, workspace: string, parentPath: string, data: any): Promise<any>;
189
+ function createDeep(txId: string, workspace: string, parentPath: string, data: any, parentNodeType: string): Promise<any>;
190
+ function delete(txId: string, workspace: string, path: string): Promise<void>;
191
+ function deleteById(txId: string, workspace: string, id: string): Promise<void>;
192
+ function get(txId: string, workspace: string, id: string): Promise<any | null>;
193
+ function getByPath(txId: string, workspace: string, path: string): Promise<any | null>;
194
+ function listChildren(txId: string, workspace: string, parentPath: string): Promise<any[]>;
195
+ function move(txId: string, workspace: string, nodePath: string, newParentPath: string): Promise<any>;
196
+ function put(txId: string, workspace: string, data: any): Promise<void>;
197
+ function rollback(txId: string): Promise<void>;
198
+ function setActor(txId: string, actor: string): Promise<void>;
199
+ function setMessage(txId: string, message: string): Promise<void>;
200
+ function update(txId: string, workspace: string, path: string, data: any): Promise<void>;
201
+ function updateProperty(txId: string, workspace: string, nodePath: string, propertyPath: string, value: any): Promise<void>;
202
+ function upsert(txId: string, workspace: string, data: any): Promise<void>;
203
+ function upsertDeep(txId: string, workspace: string, data: any, parentNodeType: string): Promise<void>;
204
+ }
205
+
206
+ }