@fidscript/instant-admin 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.
Files changed (41) hide show
  1. package/dist/commonjs/fidscript-defaults.d.ts +14 -0
  2. package/dist/commonjs/fidscript-defaults.d.ts.map +1 -0
  3. package/dist/commonjs/fidscript-defaults.js +17 -0
  4. package/dist/commonjs/fidscript-defaults.js.map +1 -0
  5. package/dist/commonjs/index.d.ts +608 -0
  6. package/dist/commonjs/index.d.ts.map +1 -0
  7. package/dist/commonjs/index.js +1051 -0
  8. package/dist/commonjs/index.js.map +1 -0
  9. package/dist/commonjs/polyfill.d.ts +17 -0
  10. package/dist/commonjs/polyfill.d.ts.map +1 -0
  11. package/dist/commonjs/polyfill.js +26 -0
  12. package/dist/commonjs/polyfill.js.map +1 -0
  13. package/dist/commonjs/subscribe.d.ts +39 -0
  14. package/dist/commonjs/subscribe.d.ts.map +1 -0
  15. package/dist/commonjs/subscribe.js +306 -0
  16. package/dist/commonjs/subscribe.js.map +1 -0
  17. package/dist/commonjs/version.d.ts +3 -0
  18. package/dist/commonjs/version.d.ts.map +1 -0
  19. package/dist/commonjs/version.js +5 -0
  20. package/dist/commonjs/version.js.map +1 -0
  21. package/dist/esm/fidscript-defaults.d.ts +14 -0
  22. package/dist/esm/fidscript-defaults.d.ts.map +1 -0
  23. package/dist/esm/fidscript-defaults.js +14 -0
  24. package/dist/esm/fidscript-defaults.js.map +1 -0
  25. package/dist/esm/index.d.ts +608 -0
  26. package/dist/esm/index.d.ts.map +1 -0
  27. package/dist/esm/index.js +1038 -0
  28. package/dist/esm/index.js.map +1 -0
  29. package/dist/esm/polyfill.d.ts +17 -0
  30. package/dist/esm/polyfill.d.ts.map +1 -0
  31. package/dist/esm/polyfill.js +22 -0
  32. package/dist/esm/polyfill.js.map +1 -0
  33. package/dist/esm/subscribe.d.ts +39 -0
  34. package/dist/esm/subscribe.d.ts.map +1 -0
  35. package/dist/esm/subscribe.js +300 -0
  36. package/dist/esm/subscribe.js.map +1 -0
  37. package/dist/esm/version.d.ts +3 -0
  38. package/dist/esm/version.d.ts.map +1 -0
  39. package/dist/esm/version.js +3 -0
  40. package/dist/esm/version.js.map +1 -0
  41. package/package.json +33 -0
@@ -0,0 +1,14 @@
1
+ /**
2
+ * FIDScript Self-Hosted InstantDB Configuration
3
+ *
4
+ * Canonical FIDScript Production Endpoints:
5
+ * API: https://apiinstant.fidscript.com
6
+ * Runtime: wss://apiinstant.fidscript.com/runtime/session
7
+ * Dashboard: https://instant.fidscript.com
8
+ */
9
+ export declare const fidscriptDefaults: {
10
+ readonly apiURI: "https://apiinstant.fidscript.com";
11
+ readonly websocketURI: "wss://apiinstant.fidscript.com/runtime/session";
12
+ };
13
+ export declare const fidscriptDashURI = "https://instant.fidscript.com";
14
+ //# sourceMappingURL=fidscript-defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fidscript-defaults.d.ts","sourceRoot":"","sources":["../../src/fidscript-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,eAAO,MAAM,gBAAgB,kCAAkC,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * FIDScript Self-Hosted InstantDB Configuration
4
+ *
5
+ * Canonical FIDScript Production Endpoints:
6
+ * API: https://apiinstant.fidscript.com
7
+ * Runtime: wss://apiinstant.fidscript.com/runtime/session
8
+ * Dashboard: https://instant.fidscript.com
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.fidscriptDashURI = exports.fidscriptDefaults = void 0;
12
+ exports.fidscriptDefaults = {
13
+ apiURI: 'https://apiinstant.fidscript.com',
14
+ websocketURI: 'wss://apiinstant.fidscript.com/runtime/session',
15
+ };
16
+ exports.fidscriptDashURI = 'https://instant.fidscript.com';
17
+ //# sourceMappingURL=fidscript-defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fidscript-defaults.js","sourceRoot":"","sources":["../../src/fidscript-defaults.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEU,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,kCAAkC;IAC1C,YAAY,EAAE,gDAAgD;CACtD,CAAC;AAEE,QAAA,gBAAgB,GAAG,+BAA+B,CAAC","sourcesContent":["/**\n * FIDScript Self-Hosted InstantDB Configuration\n *\n * Canonical FIDScript Production Endpoints:\n * API: https://apiinstant.fidscript.com\n * Runtime: wss://apiinstant.fidscript.com/runtime/session\n * Dashboard: https://instant.fidscript.com\n */\n\nexport const fidscriptDefaults = {\n apiURI: 'https://apiinstant.fidscript.com',\n websocketURI: 'wss://apiinstant.fidscript.com/runtime/session',\n} as const;\n\nexport const fidscriptDashURI = 'https://instant.fidscript.com';\n"]}
@@ -0,0 +1,608 @@
1
+ import type { Readable } from 'node:stream';
2
+ import { tx, lookup, i, id, InstantAPIError, setInstantWarningsEnabled, type InstantIssue, type TransactionChunk, type AuthToken, type User, type Query, InstantError, type QueryResponse, type InstaQLResponse, type InstaQLParams, type ValidQuery, type InstaQLFields, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type BackwardsCompatibleSchema, type IInstantDatabase, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type InstantUnknownSchemaDef, type LinksDef, type RoomsOf, type RoomsDef, type PresenceOf, type RoomHandle, type ResolveAttrs, type ValueTypes, type InstantSchemaDef, type InstantUnknownSchema, type InstaQLEntity, type InstaQLResult, type InstaQLEntitySubquery, type InstantRules, type UpdateParams, type CreateParams, type LinkParams, type RuleParams, type FileOpts, type UploadFileResponse, type DeleteFileResponse, createInstantRouteHandler, type InstantRouteHandlerPayloadByType, type InstantRouteHandlerType, type InstantRouteHandlerBody, InstantStream, type WritableStreamCtor, type ReadableStreamCtor, InstantWritableStream, InstantReadableStream, type Logger } from '@fidscript/instant-sdk';
3
+ import { SubscribeQueryCallback, SubscribeQueryResponse, SubscribeQueryPayload, SubscriptionReadyState } from './subscribe.ts';
4
+ import { Webhooks, WebhooksManager, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams } from '@instantdb/webhooks';
5
+ type DebugCheckResult = {
6
+ /** The ID of the record. */
7
+ id: string;
8
+ /** The namespace/table of the record. */
9
+ entity: string;
10
+ /** The value of the record. */
11
+ record: Record<string, any>;
12
+ /** The result of evaluating the corresponding permissions rule for a record. */
13
+ check: any;
14
+ };
15
+ type Config = {
16
+ appId: string;
17
+ adminToken?: string;
18
+ apiURI?: string;
19
+ useDateObjects?: boolean;
20
+ disableValidation?: boolean;
21
+ verbose?: boolean;
22
+ logger?: Logger;
23
+ };
24
+ export type InstantConfig<Schema extends InstantSchemaDef<any, any, any>, UseDates extends boolean = false> = {
25
+ appId: string;
26
+ adminToken?: string;
27
+ apiURI?: string;
28
+ schema?: Schema;
29
+ useDateObjects: UseDates;
30
+ disableValidation?: boolean;
31
+ verbose?: boolean;
32
+ logger?: Logger;
33
+ WritableStream?: WritableStreamCtor;
34
+ ReadableStream?: ReadableStreamCtor;
35
+ };
36
+ type InstantConfigFilled<Schema extends InstantSchemaDef<any, any, any>, UseDates extends boolean> = InstantConfig<Schema, UseDates> & {
37
+ apiURI: string;
38
+ };
39
+ type FilledConfig = Config & {
40
+ apiURI: string;
41
+ };
42
+ type ImpersonationOpts = {
43
+ email: string;
44
+ } | {
45
+ token: AuthToken;
46
+ } | {
47
+ guest: boolean;
48
+ };
49
+ type DebugTransactResult = {
50
+ 'tx-id': number;
51
+ 'all-checks-ok?': boolean;
52
+ };
53
+ /**
54
+ *
55
+ * The first step: init your application!
56
+ *
57
+ * Visit https://instantdb.com/dash to get your `appId` :)
58
+ *
59
+ * @example
60
+ * import { init } from "@instantdb/admin"
61
+ *
62
+ * const db = init({
63
+ * appId: process.env.INSTANT_APP_ID!,
64
+ * adminToken: process.env.INSTANT_APP_ADMIN_TOKEN
65
+ * })
66
+ *
67
+ * // You can also provide a schema for type safety and editor autocomplete!
68
+ *
69
+ * import { init } from "@instantdb/admin"
70
+ * import schema from ""../instant.schema.ts";
71
+ *
72
+ * const db = init({
73
+ * appId: process.env.INSTANT_APP_ID!,
74
+ * adminToken: process.env.INSTANT_APP_ADMIN_TOKEN,
75
+ * schema,
76
+ * })
77
+ * // To learn more: https://instantdb.com/docs/modeling-data
78
+ */
79
+ declare function init<Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema, UseDates extends boolean = false>(config: Omit<InstantConfig<Schema, UseDates>, 'useDateObjects'> & {
80
+ useDateObjects?: UseDates;
81
+ }): InstantAdminDatabase<Schema, UseDates, InstantConfig<Schema, UseDates>>;
82
+ /**
83
+ * @deprecated
84
+ * `init_experimental` is deprecated. You can replace it with `init`.
85
+ *
86
+ * @example
87
+ *
88
+ * // Before
89
+ * import { init_experimental } from "@instantdb/admin"
90
+ * const db = init_experimental({ ... });
91
+ *
92
+ * // After
93
+ * import { init } from "@instantdb/admin"
94
+ * const db = init({ ... });
95
+ */
96
+ declare const init_experimental: typeof init;
97
+ type PresenceResult<Data> = {
98
+ [peerId: string]: {
99
+ data: Data;
100
+ 'peer-id': string;
101
+ user: User | null;
102
+ };
103
+ };
104
+ declare class Rooms<Schema extends InstantSchemaDef<any, any, any>> {
105
+ config: FilledConfig;
106
+ constructor(config: FilledConfig);
107
+ getPresence<RoomType extends string & keyof RoomsOf<Schema>>(roomType: RoomType, roomId: string): Promise<PresenceResult<PresenceOf<Schema, RoomType>>>;
108
+ }
109
+ declare class Auth<Schema extends InstantSchemaDef<any, any, any>> {
110
+ config: FilledConfig;
111
+ constructor(config: FilledConfig);
112
+ /**
113
+ * Generates a magic code for the user with the given email.
114
+ * This is useful if you want to use your own email provider
115
+ * to send magic codes.
116
+ *
117
+ * @example
118
+ * // Generate a magic code
119
+ * const { code } = await db.auth.generateMagicCode({ email })
120
+ * // Send the magic code to the user with your own email provider
121
+ * await customEmailProvider.sendMagicCode(email, code)
122
+ *
123
+ * @see https://instantdb.com/docs/backend#custom-magic-codes
124
+ */
125
+ generateMagicCode: (email: string) => Promise<{
126
+ code: string;
127
+ }>;
128
+ /**
129
+ * Sends a magic code to the user with the given email.
130
+ * This uses Instant's built-in email provider.
131
+ *
132
+ * @example
133
+ * // Send an email to user with magic code
134
+ * await db.auth.sendMagicCode({ email })
135
+ *
136
+ * @see https://instantdb.com/docs/backend#custom-magic-codes
137
+ */
138
+ sendMagicCode: (email: string) => Promise<{
139
+ code: string;
140
+ }>;
141
+ /**
142
+ * @deprecated Use {@link checkMagicCode} instead to get the `created` field
143
+ * and support `extraFields`.
144
+ *
145
+ * @see https://instantdb.com/docs/backend#custom-magic-codes
146
+ */
147
+ verifyMagicCode: (email: string, code: string) => Promise<User>;
148
+ /**
149
+ * Verifies a magic code and returns the user along with whether
150
+ * the user was newly created. Supports `extraFields` to set custom
151
+ * `$users` properties at signup.
152
+ *
153
+ * @example
154
+ * const { user, created } = await db.auth.checkMagicCode(
155
+ * email,
156
+ * code,
157
+ * { extraFields: { nickname: 'ari' } },
158
+ * );
159
+ *
160
+ * @see https://instantdb.com/docs/backend#custom-magic-codes
161
+ */
162
+ checkMagicCode: (email: string, code: string, options?: {
163
+ extraFields?: UpdateParams<Schema, "$users">;
164
+ }) => Promise<{
165
+ user: User;
166
+ created: boolean;
167
+ }>;
168
+ /**
169
+ * Creates a login token for the user with the given email.
170
+ * If that user does not exist, we create one.
171
+ *
172
+ * This is often useful for writing custom auth flows.
173
+ *
174
+ * @example
175
+ * app.post('/custom_sign_in', async (req, res) => {
176
+ * // ... your custom flow for users
177
+ * const token = await db.auth.createToken({ email })
178
+ * return res.status(200).send({ token })
179
+ * })
180
+ *
181
+ * @see https://instantdb.com/docs/backend#custom-auth
182
+ */
183
+ createToken(email: {
184
+ email: string;
185
+ } | {
186
+ id: string;
187
+ }): Promise<AuthToken>;
188
+ /**
189
+ *
190
+ * @deprecated Passing an email string directly is deprecated.
191
+ *
192
+ * Use an object with the `email` key instead.
193
+ *
194
+ * @example
195
+ * // Before
196
+ * const token = await auth.createToken(email)
197
+ * // After
198
+ * const token = await auth.createToken({ email })
199
+ */
200
+ createToken(email: string): Promise<AuthToken>;
201
+ /**
202
+ * Verifies a given token and returns the associated user.
203
+ *
204
+ * This is often useful for writing custom endpoints, where you need
205
+ * to authenticate users.
206
+ *
207
+ * @example
208
+ * app.post('/custom_endpoint', async (req, res) => {
209
+ * const user = await db.auth.verifyToken(req.headers['token'])
210
+ * if (!user) {
211
+ * return res.status(401).send('Uh oh, you are not authenticated')
212
+ * }
213
+ * // ...
214
+ * })
215
+ * @see https://instantdb.com/docs/backend#custom-endpoints
216
+ */
217
+ verifyToken: (token: AuthToken) => Promise<User>;
218
+ /**
219
+ * Retrieves an app user by id, email, or refresh token.
220
+ * Resolves to `null` when no user matches; throws on malformed
221
+ * input or auth errors.
222
+ *
223
+ * @example
224
+ * const user = await db.auth.getUser({ email });
225
+ * if (!user) {
226
+ * console.log("No user found");
227
+ * return;
228
+ * }
229
+ * console.log("Found user:", user);
230
+ *
231
+ * @see https://instantdb.com/docs/backend#retrieve-a-user
232
+ */
233
+ getUser: (params: {
234
+ email: string;
235
+ } | {
236
+ id: string;
237
+ } | {
238
+ refresh_token: string;
239
+ }) => Promise<Omit<User, "refresh_token"> | null>;
240
+ /**
241
+ * Deletes an app user by id, email, or refresh token.
242
+ * Resolves to `null` when no user matches; throws on malformed
243
+ * input or auth errors.
244
+ *
245
+ * NB: This _only_ deletes the user; it does not delete all user data.
246
+ * You will need to handle this manually.
247
+ *
248
+ * @example
249
+ * const deletedUser = await db.auth.deleteUser({ email });
250
+ * if (!deletedUser) {
251
+ * console.log("No user found to delete");
252
+ * return;
253
+ * }
254
+ * console.log("Deleted user:", deletedUser);
255
+ *
256
+ * @see https://instantdb.com/docs/backend#delete-a-user
257
+ */
258
+ deleteUser: (params: {
259
+ email: string;
260
+ } | {
261
+ id: string;
262
+ } | {
263
+ refresh_token: string;
264
+ }) => Promise<User | null>;
265
+ /**
266
+ * Signs out the user with the given email.
267
+ * This invalidates any tokens associated with the user.
268
+ * If the user is not found, an error will be thrown.
269
+ *
270
+ * @example
271
+ * try {
272
+ * await auth.signOut({ email: "alyssa_p_hacker@instantdb.com" });
273
+ * console.log("Successfully signed out");
274
+ * } catch (err) {
275
+ * console.error("Sign out failed:", err.message);
276
+ * }
277
+ *
278
+ * @see https://instantdb.com/docs/backend#sign-out
279
+ */
280
+ signOut(params: {
281
+ email: string;
282
+ } | {
283
+ id: string;
284
+ } | {
285
+ refresh_token: string;
286
+ }): Promise<void>;
287
+ /**
288
+ * @deprecated Passing an email string directly is deprecated.
289
+ * Use an object with the `email` key instead.
290
+ *
291
+ * @example
292
+ * // Before
293
+ * auth.signOut(email)
294
+ *
295
+ * // After
296
+ * auth.signOut({ email })
297
+ */
298
+ signOut(email: string): Promise<void>;
299
+ /**
300
+ * Get instant user from Request
301
+ *
302
+ * Reads cookies and gets a validated user
303
+ * @param req The request containing a cookie synced with createInstantRouteHandler
304
+ * @param opts Allow disabling validation of refresh token
305
+ */
306
+ getUserFromRequest: (req: Request, opts?: {
307
+ disableValidation?: boolean;
308
+ }) => Promise<User | null>;
309
+ }
310
+ type StorageFile = {
311
+ key: string;
312
+ name: string;
313
+ size: number;
314
+ etag: string;
315
+ last_modified: number;
316
+ };
317
+ type DeleteManyFileResponse = {
318
+ data: {
319
+ ids: string[] | null;
320
+ };
321
+ };
322
+ /**
323
+ * Functions to manage file storage.
324
+ */
325
+ declare class Storage {
326
+ config: FilledConfig;
327
+ impersonationOpts?: ImpersonationOpts;
328
+ constructor(config: FilledConfig, impersonationOpts?: ImpersonationOpts);
329
+ /**
330
+ * Uploads file at the provided path. Accepts a Buffer or a Readable stream.
331
+ *
332
+ * @see https://instantdb.com/docs/storage
333
+ * @example
334
+ * const buffer = fs.readFileSync('demo.png');
335
+ * const isSuccess = await db.storage.uploadFile('photos/demo.png', buffer);
336
+ */
337
+ uploadFile: (path: string, file: Buffer | Readable | ReadableStream | Uint8Array, metadata?: FileOpts) => Promise<UploadFileResponse>;
338
+ /**
339
+ * Deletes a file by its path name (e.g. "photos/demo.png").
340
+ *
341
+ * @deprecated Use `db.transact` to delete files instead:
342
+ * @example
343
+ * // Delete by id
344
+ * await db.transact(db.tx.$files[fileId].delete());
345
+ *
346
+ * // Delete by path
347
+ * await db.transact(db.tx.$files[lookup('path', 'photos/demo.png')].delete());
348
+ *
349
+ * @see https://instantdb.com/docs/storage
350
+ */
351
+ delete: (pathname: string) => Promise<DeleteFileResponse>;
352
+ /**
353
+ * Deletes multiple files by their path names.
354
+ *
355
+ * @deprecated Use `db.transact` to delete files instead:
356
+ * @example
357
+ * // Delete multiple files by path
358
+ * const paths = ['images/1.png', 'images/2.png', 'images/3.png'];
359
+ * await db.transact(paths.map(p => db.tx.$files[lookup('path', p)].delete()));
360
+ *
361
+ * @see https://instantdb.com/docs/storage
362
+ */
363
+ deleteMany: (pathnames: string[]) => Promise<DeleteManyFileResponse>;
364
+ /**
365
+ * @deprecated. This method will be removed in the future. Use `uploadFile`
366
+ * instead
367
+ */
368
+ upload: (pathname: string, file: Buffer, metadata?: FileOpts) => Promise<boolean>;
369
+ /**
370
+ * @deprecated. This method will be removed in the future. Use `query` instead
371
+ * @example
372
+ * const files = await db.query({ $files: {}})
373
+ */
374
+ list: () => Promise<StorageFile[]>;
375
+ /**
376
+ * @deprecated. getDownloadUrl will be removed in the future.
377
+ * Use `query` instead to query and fetch for valid urls
378
+ *
379
+ * db.useQuery({
380
+ * $files: {
381
+ * $: {
382
+ * where: {
383
+ * path: "moop.png"
384
+ * }
385
+ * }
386
+ * }
387
+ * })
388
+ */
389
+ getDownloadUrl: (pathname: string) => Promise<string>;
390
+ }
391
+ type CreateReadStreamOpts = {
392
+ clientId?: string | null | undefined;
393
+ streamId?: string | null | undefined;
394
+ byteOffset?: number | null | undefined;
395
+ ruleParams?: RuleParams | null | undefined;
396
+ };
397
+ type CreateWriteStreamOpts = {
398
+ clientId: string;
399
+ /**
400
+ * A function that takes a promise and ensures that the current program stays alive
401
+ * until the promise is resolved.
402
+ *
403
+ * Useful in serverless environments to ensure the writer fully flushes before the
404
+ * environment is shut down.
405
+ *
406
+ * @example
407
+ * import { after } from 'next/server'
408
+ * db.streams.createWriteStream({clientId, waitUntil: after})
409
+ */
410
+ waitUntil?: (promise: Promise<any>) => void | null | undefined;
411
+ ruleParams?: RuleParams | null | undefined;
412
+ };
413
+ /**
414
+ * Functions to manage streams.
415
+ */
416
+ declare class Streams {
417
+ #private;
418
+ constructor(ensureInstantStream: () => InstantStream);
419
+ /**
420
+ * Creates a new ReadableStream for the given clientId.
421
+ *
422
+ * @example
423
+ * const stream = db.streams.createReadStream({clientId: clientId})
424
+ * for await (const chunk of stream) {
425
+ * console.log(chunk);
426
+ * }
427
+ */
428
+ createReadStream: (opts: CreateReadStreamOpts) => InstantReadableStream<string>;
429
+ /**
430
+ * Creates a new WritableStream for the given clientId.
431
+ *
432
+ * @example
433
+ * const writeStream = db.streams.createWriteStream({clientId: clientId})
434
+ * const writer = writeStream.getWriter();
435
+ * writer.write('Hello world');
436
+ * writer.close();
437
+ */
438
+ createWriteStream: (opts: CreateWriteStreamOpts) => InstantWritableStream<string>;
439
+ }
440
+ type AdminQueryOpts = {
441
+ ruleParams?: RuleParams;
442
+ fetchOpts?: RequestInit;
443
+ };
444
+ /**
445
+ *
446
+ * The first step: init your application!
447
+ *
448
+ * Visit https://instantdb.com/dash to get your `appId` and `adminToken` :)
449
+ *
450
+ * @example
451
+ * const db = init({ appId: "my-app-id", adminToken: "my-admin-token" })
452
+ */
453
+ declare class InstantAdminDatabase<Schema extends InstantSchemaDef<any, any, any>, UseDates extends boolean = false, Config extends InstantConfig<Schema, UseDates> = InstantConfig<Schema, UseDates>> {
454
+ #private;
455
+ config: InstantConfigFilled<Schema, UseDates>;
456
+ auth: Auth<Schema>;
457
+ storage: Storage;
458
+ streams: Streams;
459
+ rooms: Rooms<Schema>;
460
+ impersonationOpts?: ImpersonationOpts;
461
+ webhooks: Webhooks<Schema>;
462
+ tx: import("@fidscript/instant-sdk").TxChunk<NonNullable<Schema>>;
463
+ constructor(_config: Config);
464
+ /**
465
+ * Sometimes you want to scope queries to a specific user.
466
+ *
467
+ * You can provide a user's auth token, email, or impersonate a guest.
468
+ *
469
+ * @see https://instantdb.com/docs/backend#impersonating-users
470
+ * @example
471
+ * await db.asUser({email: "stopa@instantdb.com"}).query({ goals: {} })
472
+ */
473
+ asUser: (opts: ImpersonationOpts) => InstantAdminDatabase<Schema, UseDates, Config>;
474
+ /**
475
+ * Use this to query your data!
476
+ *
477
+ * @see https://instantdb.com/docs/instaql
478
+ *
479
+ * @example
480
+ * // fetch all goals
481
+ * await db.query({ goals: {} })
482
+ *
483
+ * // goals where the title is "Get Fit"
484
+ * await db.query({ goals: { $: { where: { title: "Get Fit" } } } })
485
+ *
486
+ * // all goals, _alongside_ their todos
487
+ * await db.query({ goals: { todos: {} } })
488
+ */
489
+ query: <Q extends ValidQuery<Q, Schema>>(query: Q, opts?: AdminQueryOpts) => Promise<InstaQLResponse<Schema, Q, UseDates>>;
490
+ /**
491
+ * Use this to to get a live view of your data!
492
+ *
493
+ * @see https://www.instantdb.com/docs/backend
494
+ *
495
+ * @example
496
+ * // create a subscription to a query
497
+ * const query = { goals: { $: { where: { title: "Get Fit" } } } }
498
+ * const sub = db.subscribeQuery(query);
499
+ *
500
+ * // iterate through the results with an async iterator
501
+ * for await (const payload of sub) {
502
+ * if (payload.error) {
503
+ * console.log(payload.error);
504
+ * // Stop the subscription
505
+ * sub.close();
506
+ * } else {
507
+ * console.log(payload.data);
508
+ * }
509
+ * }
510
+ *
511
+ * // Stop the subscription
512
+ * sub.close();
513
+ *
514
+ * // Create a subscription with a callback
515
+ * const sub = db.subscribeQuery(query, (payload) => {
516
+ * if (payload.error) {
517
+ * console.log(payload.error);
518
+ * // Stop the subscription
519
+ * sub.close();
520
+ * } else {
521
+ * console.log(payload.data);
522
+ * }
523
+ * });
524
+ */
525
+ subscribeQuery<Q extends ValidQuery<Q, Schema>>(query: Q, cb?: SubscribeQueryCallback<Schema, Q, UseDates>, opts?: AdminQueryOpts): SubscribeQueryResponse<Schema, Q, UseDates>;
526
+ /**
527
+ * Use this to write data! You can create, update, delete, and link objects
528
+ *
529
+ * @see https://instantdb.com/docs/instaml
530
+ *
531
+ * @example
532
+ * // Create a new object in the `goals` namespace
533
+ * const goalId = id();
534
+ * db.transact(db.tx.goals[goalId].update({title: "Get fit"}))
535
+ *
536
+ * // Update the title
537
+ * db.transact(db.tx.goals[goalId].update({title: "Get super fit"}))
538
+ *
539
+ * // Delete it
540
+ * db.transact(db.tx.goals[goalId].delete())
541
+ *
542
+ * // Or create an association:
543
+ * todoId = id();
544
+ * db.transact([
545
+ * db.tx.todos[todoId].update({ title: 'Go on a run' }),
546
+ * db.tx.goals[goalId].link({todos: todoId}),
547
+ * ])
548
+ */
549
+ transact: (inputChunks: TransactionChunk<any, any> | TransactionChunk<any, any>[]) => Promise<any>;
550
+ /**
551
+ * Like `query`, but returns debugging information
552
+ * for permissions checks along with the result.
553
+ * Useful for inspecting the values returned by the permissions checks.
554
+ * Note, this will return debug information for *all* entities
555
+ * that match the query's `where` clauses.
556
+ *
557
+ * Requires a user/guest context to be set with `asUser`,
558
+ * since permissions checks are user-specific.
559
+ *
560
+ * Accepts an optional configuration object with a `rules` key.
561
+ * The provided rules will override the rules in the database for the query.
562
+ *
563
+ * @see https://instantdb.com/docs/instaql
564
+ *
565
+ * @example
566
+ * await db.asUser({ guest: true }).debugQuery(
567
+ * { goals: {} },
568
+ * { rules: { goals: { allow: { read: "auth.id != null" } } }
569
+ * )
570
+ */
571
+ debugQuery: <Q extends ValidQuery<Q, Schema>>(query: Q, opts?: {
572
+ rules?: any;
573
+ ruleParams?: {
574
+ [key: string]: any;
575
+ };
576
+ ip?: string | null | undefined;
577
+ origin?: string | null | undefined;
578
+ cardinalityInference?: boolean;
579
+ }) => Promise<{
580
+ result: InstaQLResponse<Schema, Q, UseDates>;
581
+ checkResults: DebugCheckResult[];
582
+ }>;
583
+ /**
584
+ * Like `transact`, but does not write to the database.
585
+ * Returns debugging information for permissions checks.
586
+ * Useful for inspecting the values returned by the permissions checks.
587
+ *
588
+ * Requires a user/guest context to be set with `asUser`,
589
+ * since permissions checks are user-specific.
590
+ *
591
+ * Accepts an optional configuration object with a `rules` key.
592
+ * The provided rules will override the rules in the database for the duration of the transaction.
593
+ *
594
+ * @example
595
+ * const goalId = id();
596
+ * db.asUser({ guest: true }).debugTransact(
597
+ * [db.tx.goals[goalId].update({title: "Get fit"})],
598
+ * { rules: { goals: { allow: { update: "auth.id != null" } } }
599
+ * )
600
+ */
601
+ debugTransact: (inputChunks: TransactionChunk<any, any> | TransactionChunk<any, any>[], opts?: {
602
+ rules?: any;
603
+ ip?: string | null | undefined;
604
+ origin?: string | null | undefined;
605
+ }) => Promise<DebugTransactResult>;
606
+ }
607
+ export { init, init_experimental, id, tx, lookup, i, createInstantRouteHandler, type InstantRouteHandlerPayloadByType, type InstantRouteHandlerType, type InstantRouteHandlerBody, Webhooks, WebhooksManager, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams, InstantAPIError, setInstantWarningsEnabled, type Config, type ImpersonationOpts, type TransactionChunk, type DebugCheckResult, type InstantAdminDatabase, type User, type InstaQLParams, type ValidQuery, type Query, InstantError, type QueryResponse, type InstaQLResponse, type InstantQuery, type InstantUnknownSchemaDef, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type IInstantDatabase, type InstantObject, type InstantEntity, type BackwardsCompatibleSchema, type InstaQLFields, type SubscribeQueryCallback, type SubscribeQueryResponse, type SubscribeQueryPayload, type SubscriptionReadyState, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type RoomsOf, type PresenceOf, type RoomsDef, type RoomHandle, type ValueTypes, type InstantSchemaDef, type InstantUnknownSchema, type InstaQLEntity, type InstaQLResult, type InstaQLEntitySubquery, type InstantRules, type CreateParams, type UpdateParams, type LinkParams, type FileOpts, type UploadFileResponse, type DeleteFileResponse, type DeleteManyFileResponse, type CreateReadStreamOpts, type CreateWriteStreamOpts, type InstantWritableStream, type InstantIssue, type Logger, };
608
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,OAAO,EACL,EAAE,EACF,MAAM,EAEN,CAAC,EACD,EAAE,EAGF,eAAe,EACf,yBAAyB,EACzB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAGd,KAAK,IAAI,EACT,KAAK,KAAK,EACV,YAAY,EAGZ,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAGrB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KA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