@fitzzero/quickdraw-core 5.1.1 → 5.1.3
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 +1308 -219
- package/dist/{admin-DKwkIh5i.d.ts → admin-CS7JB_UH.d.ts} +2 -2
- package/dist/{adminSchemas-2DUA_hZ8.d.ts → adminSchemas-29cGgrg5.d.ts} +6 -4
- package/dist/{auth-BhWqdyb-.d.ts → auth-DtdYjrZ9.d.ts} +51 -21
- package/dist/{caller-CXTFswBO.d.ts → caller-BTwGl7vm.d.ts} +296 -33
- package/dist/chunk-2FDSKLBO.js +82 -0
- package/dist/chunk-2FDSKLBO.js.map +1 -0
- package/dist/{chunk-RT6OILOI.js → chunk-4D2DOGAW.js} +2 -14
- package/dist/chunk-4D2DOGAW.js.map +1 -0
- package/dist/{chunk-OECZPRPW.js → chunk-64I6MYBC.js} +162 -775
- package/dist/chunk-64I6MYBC.js.map +1 -0
- package/dist/chunk-7473HK24.js +17 -0
- package/dist/chunk-7473HK24.js.map +1 -0
- package/dist/chunk-7Y5ROPXL.js +33 -0
- package/dist/chunk-7Y5ROPXL.js.map +1 -0
- package/dist/chunk-A2RBQD66.js +7 -0
- package/dist/chunk-A2RBQD66.js.map +1 -0
- package/dist/chunk-AK23XSWD.js +16 -0
- package/dist/chunk-AK23XSWD.js.map +1 -0
- package/dist/chunk-ASAMUGHG.js +651 -0
- package/dist/chunk-ASAMUGHG.js.map +1 -0
- package/dist/{chunk-B2P7AZ25.js → chunk-CYE4UBOB.js} +6 -4
- package/dist/chunk-CYE4UBOB.js.map +1 -0
- package/dist/chunk-DKE6QO26.js +136 -0
- package/dist/chunk-DKE6QO26.js.map +1 -0
- package/dist/chunk-DNP65TD5.js +832 -0
- package/dist/chunk-DNP65TD5.js.map +1 -0
- package/dist/{chunk-H23KEFBA.js → chunk-DUBU3BB3.js} +30 -1
- package/dist/chunk-DUBU3BB3.js.map +1 -0
- package/dist/chunk-GYLWEJHW.js +19 -0
- package/dist/chunk-GYLWEJHW.js.map +1 -0
- package/dist/{chunk-SHEGLZEP.js → chunk-I3JCFS7H.js} +34 -13
- package/dist/chunk-I3JCFS7H.js.map +1 -0
- package/dist/{chunk-X5CWPX7H.js → chunk-IIQ3WMJK.js} +13 -2
- package/dist/chunk-IIQ3WMJK.js.map +1 -0
- package/dist/{chunk-RZTP4IEW.js → chunk-JVTONQFI.js} +6339 -4226
- package/dist/chunk-JVTONQFI.js.map +1 -0
- package/dist/{chunk-QEKVYG5F.js → chunk-KKQANRLG.js} +2 -2
- package/dist/chunk-KKQANRLG.js.map +1 -0
- package/dist/{chunk-CDKG4TFA.js → chunk-MPQAT55F.js} +38 -205
- package/dist/chunk-MPQAT55F.js.map +1 -0
- package/dist/chunk-NO4M6PO5.js +101 -0
- package/dist/chunk-NO4M6PO5.js.map +1 -0
- package/dist/{chunk-TBMKJ26R.js → chunk-NW6U45HX.js} +3 -1
- package/dist/chunk-NW6U45HX.js.map +1 -0
- package/dist/chunk-NX2V6SIL.js +202 -0
- package/dist/chunk-NX2V6SIL.js.map +1 -0
- package/dist/{chunk-ZIVPHYRG.js → chunk-NZHA4TZD.js} +72 -175
- package/dist/chunk-NZHA4TZD.js.map +1 -0
- package/dist/{chunk-2PWMUVC7.js → chunk-OCZJ4EYV.js} +518 -27
- package/dist/chunk-OCZJ4EYV.js.map +1 -0
- package/dist/{chunk-REX5YPHX.js → chunk-PHCURHC7.js} +76 -21
- package/dist/chunk-PHCURHC7.js.map +1 -0
- package/dist/{chunk-4YO5H5ON.js → chunk-Q4OGQM5I.js} +4 -10
- package/dist/chunk-Q4OGQM5I.js.map +1 -0
- package/dist/chunk-QSU47XEX.js +13 -0
- package/dist/chunk-QSU47XEX.js.map +1 -0
- package/dist/{chunk-DD4SKCNO.js → chunk-RZXJTDH5.js} +13 -2
- package/dist/chunk-RZXJTDH5.js.map +1 -0
- package/dist/{chunk-Z2LZ7IZ7.js → chunk-SN3OZVEQ.js} +5 -31
- package/dist/chunk-SN3OZVEQ.js.map +1 -0
- package/dist/{chunk-4DIQHASK.js → chunk-SQ5VUG77.js} +28 -8
- package/dist/chunk-SQ5VUG77.js.map +1 -0
- package/dist/chunk-STH5DLQP.js +1192 -0
- package/dist/chunk-STH5DLQP.js.map +1 -0
- package/dist/{chunk-QCHKWIRS.js → chunk-VZFJTKIW.js} +13 -13
- package/dist/{chunk-QCHKWIRS.js.map → chunk-VZFJTKIW.js.map} +1 -1
- package/dist/{chunk-VSQBHPWH.js → chunk-X4ZU4QH5.js} +54 -22
- package/dist/chunk-X4ZU4QH5.js.map +1 -0
- package/dist/chunk-XD7SRDUY.js +188 -0
- package/dist/chunk-XD7SRDUY.js.map +1 -0
- package/dist/chunk-XH2IZVLT.js +62 -0
- package/dist/chunk-XH2IZVLT.js.map +1 -0
- package/dist/chunk-Z7I6SONO.js +825 -0
- package/dist/chunk-Z7I6SONO.js.map +1 -0
- package/dist/cli/quickdraw-docs.js +132 -112
- package/dist/cli/quickdraw-docs.js.map +1 -1
- package/dist/client/core.d.ts +387 -0
- package/dist/client/core.js +109 -0
- package/dist/client/index.d.ts +52 -203
- package/dist/client/index.js +59 -218
- package/dist/client/index.js.map +1 -1
- package/dist/{clientTypes-Bc-G8n-U.d.ts → clientTypes-CUUNJwWs.d.ts} +3 -3
- package/dist/{connection-Cr1BU07W.d.ts → connection-2EeQ_Et0.d.ts} +22 -11
- package/dist/{createServer-CP9eDHZZ.d.ts → createServer-Bx5HOcYK.d.ts} +67 -17
- package/dist/{createTestApp-UKVGEmOf.d.ts → createTestApp-DAMANT79.d.ts} +46 -13
- package/dist/{envelope-Cp3YcVxC.d.ts → envelope-BMBaxppV.d.ts} +216 -10
- package/dist/{http-Djj2Inuu.d.ts → http-YzLAar3w.d.ts} +76 -60
- package/dist/index.d.ts +8 -7
- package/dist/index.js +82 -25
- package/dist/index.js.map +1 -1
- package/dist/{infer-Teo1xpsd.d.ts → infer-Br62cnyW.d.ts} +82 -11
- package/dist/logger-Yz93KzdV.d.ts +30 -0
- package/dist/{metrics-BdBu5o8G.d.ts → metrics-CTVpw0gu.d.ts} +2 -2
- package/dist/origins-kvpxnVcW.d.ts +8 -0
- package/dist/parser.js +2 -1
- package/dist/prisma/index.d.ts +14 -7
- package/dist/prisma/index.js +279 -70
- package/dist/prisma/index.js.map +1 -1
- package/dist/{rateLimit-ZMIZJUZF.js → rateLimit-5RKBFLUR.js} +2 -2
- package/dist/rateLimit-5RKBFLUR.js.map +1 -0
- package/dist/remote-N7OUAGOW.js +15 -0
- package/dist/remote-N7OUAGOW.js.map +1 -0
- package/dist/server/auth/index.d.ts +82 -33
- package/dist/server/auth/index.js +277 -270
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/express/index.d.ts +9 -2
- package/dist/server/express/index.js +1 -1
- package/dist/server/index.d.ts +268 -84
- package/dist/server/index.js +664 -418
- package/dist/server/index.js.map +1 -1
- package/dist/server/mcp/index.d.ts +89 -27
- package/dist/server/mcp/index.js +281 -62
- package/dist/server/mcp/index.js.map +1 -1
- package/dist/server/otel.d.ts +3 -3
- package/dist/{sharing-DVa8W-yR.d.ts → sharing-BrsmlDv_.d.ts} +3 -3
- package/dist/testing/client.d.ts +14 -14
- package/dist/testing/client.js +19 -10
- package/dist/testing/client.js.map +1 -1
- package/dist/testing/index.d.ts +50 -13
- package/dist/testing/index.js +113 -21
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/mock.d.ts +5 -5
- package/dist/testing/mock.js +17 -9
- package/dist/tracked-BR5b2O-U.d.ts +43 -0
- package/dist/{types-Cu0vmx7c.d.ts → types-CLRCQGnO.d.ts} +4 -3
- package/dist/types-tMagHbjy.d.ts +151 -0
- package/dist/utils/index.d.ts +16 -4
- package/dist/utils/index.js +6 -3
- package/package.json +5 -1
- package/dist/chunk-2PWMUVC7.js.map +0 -1
- package/dist/chunk-4DIQHASK.js.map +0 -1
- package/dist/chunk-4YO5H5ON.js.map +0 -1
- package/dist/chunk-B2P7AZ25.js.map +0 -1
- package/dist/chunk-CDKG4TFA.js.map +0 -1
- package/dist/chunk-DD4SKCNO.js.map +0 -1
- package/dist/chunk-H23KEFBA.js.map +0 -1
- package/dist/chunk-OECZPRPW.js.map +0 -1
- package/dist/chunk-QEKVYG5F.js.map +0 -1
- package/dist/chunk-REX5YPHX.js.map +0 -1
- package/dist/chunk-RT6OILOI.js.map +0 -1
- package/dist/chunk-RZTP4IEW.js.map +0 -1
- package/dist/chunk-SHEGLZEP.js.map +0 -1
- package/dist/chunk-TBMKJ26R.js.map +0 -1
- package/dist/chunk-VSQBHPWH.js.map +0 -1
- package/dist/chunk-X5CWPX7H.js.map +0 -1
- package/dist/chunk-YSWH776Y.js +0 -13
- package/dist/chunk-YSWH776Y.js.map +0 -1
- package/dist/chunk-Z2LZ7IZ7.js.map +0 -1
- package/dist/chunk-ZIVPHYRG.js.map +0 -1
- package/dist/logger-BY28acW-.d.ts +0 -16
- /package/dist/{rateLimit-ZMIZJUZF.js.map → client/core.js.map} +0 -0
|
@@ -296,7 +296,11 @@ interface ViaScope<Model extends string = string, Entry extends string = string,
|
|
|
296
296
|
}
|
|
297
297
|
/** What `via(...)` takes: the junction model, its entry and scope columns, and `refreshEntry`. */
|
|
298
298
|
interface ViaOptions<Model extends string = string, Entry extends string = string, Scope extends string = string> {
|
|
299
|
-
/**
|
|
299
|
+
/**
|
|
300
|
+
* The junction model, as the database client names it: `"chatMember"`. It
|
|
301
|
+
* needs an `id` column (keep the pair unique with `@@unique`, never a
|
|
302
|
+
* composite `@@id`), or its writes are not tracked and never move a scope.
|
|
303
|
+
*/
|
|
300
304
|
readonly model: Model;
|
|
301
305
|
/** The junction column holding the entry's id: `"chatId"`. */
|
|
302
306
|
readonly entry: Entry;
|
|
@@ -378,9 +382,12 @@ declare const STREAM_MAX_SEED = 1000;
|
|
|
378
382
|
/** A channel's sustained rate when it declares none: messages per second per socket. */
|
|
379
383
|
declare const CHANNEL_DEFAULT_RATE = 30;
|
|
380
384
|
/**
|
|
381
|
-
* The app room a stream's subscriber must be in (`access: { room }`):
|
|
382
|
-
* room's name, `{ prefix }` for any room whose name
|
|
383
|
-
* scoped stream a function of the scope
|
|
385
|
+
* The app room a stream's subscriber must be in (`access: { room }`): for a
|
|
386
|
+
* global stream the room's name, or `{ prefix }` for any room whose name
|
|
387
|
+
* starts with it; for a scoped stream a function of the scope
|
|
388
|
+
* (`(worldId) => \`world:${worldId}\``), since a name or a prefix would let
|
|
389
|
+
* a socket in that room read every scope (`defineContract` refuses them
|
|
390
|
+
* there).
|
|
384
391
|
*/
|
|
385
392
|
type StreamRoom = string | RoomPrefix | ((scope: string) => string | null | undefined);
|
|
386
393
|
/**
|
|
@@ -391,7 +398,9 @@ type StreamRoom = string | RoomPrefix | ((scope: string) => string | null | unde
|
|
|
391
398
|
* `{ room }` opens it to the sockets in an app room a method joined them to
|
|
392
399
|
* (signed in or not), as a channel's `requires: { room }` does its messages:
|
|
393
400
|
* a socket that leaves the room, or is taken out of it, leaves the feed too.
|
|
394
|
-
* A stream that
|
|
401
|
+
* A scoped stream computes that room from its scope; a name or `{ prefix }`
|
|
402
|
+
* serves a global stream only. A stream that declares none is closed: no
|
|
403
|
+
* client may subscribe.
|
|
395
404
|
*/
|
|
396
405
|
type StreamAccess = "public" | "authenticated" | {
|
|
397
406
|
readonly service: AccessLevel;
|
|
@@ -418,6 +427,12 @@ type StreamAccess = "public" | "authenticated" | {
|
|
|
418
427
|
readonly scope?: undefined;
|
|
419
428
|
readonly of?: undefined;
|
|
420
429
|
};
|
|
430
|
+
/**
|
|
431
|
+
* Who serves a channel or a stream: the server, or the host of the app room
|
|
432
|
+
* it names (host mode, RFC 0003 section 12.5), a client the app chose with
|
|
433
|
+
* `ctx.rooms.setHost`, over its peer links.
|
|
434
|
+
*/
|
|
435
|
+
type RealtimeServe = "server" | "host";
|
|
421
436
|
/** A server-to-client stream of append-only items (RFC 0003 section 12.5). */
|
|
422
437
|
interface StreamDef<Item extends StandardSchemaV1 = StandardSchemaV1> {
|
|
423
438
|
/** One item's schema. Pushed items are checked against it before they are sent. */
|
|
@@ -436,6 +451,14 @@ interface StreamDef<Item extends StandardSchemaV1 = StandardSchemaV1> {
|
|
|
436
451
|
readonly volatile?: boolean;
|
|
437
452
|
/** Who may subscribe. Without it the stream is closed. */
|
|
438
453
|
readonly access?: StreamAccess;
|
|
454
|
+
/**
|
|
455
|
+
* Who pushes the items: `"server"`, the default, or `"host"`, the host of
|
|
456
|
+
* the room `access: { room }` computes from the scope. The host's client
|
|
457
|
+
* pushes them over its peer links, keeping the latest `seed` per scope for
|
|
458
|
+
* a peer that subscribes later, and the server never sees them. A
|
|
459
|
+
* host-served stream has a scope and `access: { room: (scope) => room }`.
|
|
460
|
+
*/
|
|
461
|
+
readonly serve?: RealtimeServe | (string & Record<never, never>);
|
|
439
462
|
/** What the stream carries, in a sentence or two, for the generated docs. */
|
|
440
463
|
readonly describe?: string;
|
|
441
464
|
}
|
|
@@ -459,9 +482,10 @@ interface RoomPrefix {
|
|
|
459
482
|
* (`(payload) => \`lobby:${payload.lobbyId}\``), or `{ prefix }`, any room
|
|
460
483
|
* whose name starts with it (`{ prefix: "world:" }`). Unlike a
|
|
461
484
|
* {@link PayloadSelector}, a string here is the room's name, not a payload
|
|
462
|
-
* key. A name starting with `qd:` or `user
|
|
463
|
-
*
|
|
464
|
-
*
|
|
485
|
+
* key. A name starting with `qd:` or `user:`, or one with the shape of a
|
|
486
|
+
* Socket.IO socket id (20 letters, digits, `_` or `-`), is never an app
|
|
487
|
+
* room: a literal one (or such a prefix) is refused when the contract is
|
|
488
|
+
* defined, and a computed one drops the message.
|
|
465
489
|
*/
|
|
466
490
|
type RoomSelector = string | ((payload: never) => string | null | undefined) | RoomPrefix;
|
|
467
491
|
/**
|
|
@@ -500,8 +524,22 @@ interface ChannelDef<Payload extends StandardSchemaV1 = StandardSchemaV1> {
|
|
|
500
524
|
readonly ratePerSecond?: number;
|
|
501
525
|
/** How many messages one socket may send at once. Default twice `ratePerSecond`. */
|
|
502
526
|
readonly burst?: number;
|
|
503
|
-
/**
|
|
527
|
+
/**
|
|
528
|
+
* What the sender must already be subscribed to, or the app room it must
|
|
529
|
+
* be in. Without it every signed-in user may send the channel, about any
|
|
530
|
+
* row or room its payload names, and the server warns
|
|
531
|
+
* `channel-without-requires` unless the service declares the channel's
|
|
532
|
+
* `access` (`"authenticated"` when any signed-in user may send it).
|
|
533
|
+
*/
|
|
504
534
|
readonly requires?: ChannelRequires;
|
|
535
|
+
/**
|
|
536
|
+
* Who handles a message: `"server"`, the default, or `"host"`, the host of
|
|
537
|
+
* the room `requires: { room }` names. The sender's client sends it over
|
|
538
|
+
* its peer link to that host, whose client checks it as the server checks
|
|
539
|
+
* a channel message; the server never sees it. A host-served channel
|
|
540
|
+
* requires a room and takes no server handler.
|
|
541
|
+
*/
|
|
542
|
+
readonly serve?: RealtimeServe | (string & Record<never, never>);
|
|
505
543
|
/** What a message says, in a sentence or two, for the generated docs. */
|
|
506
544
|
readonly describe?: string;
|
|
507
545
|
}
|
|
@@ -795,12 +833,29 @@ type CheckChannels<Def> = CheckRealtimeNames<Def, ChannelsIn<Def>, "channel", ke
|
|
|
795
833
|
RequiresProblem<Def, Name, ChannelsIn<Def>[Name]>
|
|
796
834
|
] extends [never] ? unknown : Problem<RequiresProblem<Def, Name, ChannelsIn<Def>[Name]>>;
|
|
797
835
|
};
|
|
836
|
+
/**
|
|
837
|
+
* A scoped stream's `access: { room }` is a function of its scope (the 5.1
|
|
838
|
+
* audit's RT-4): a name or `{ prefix }` would let a socket in that room read
|
|
839
|
+
* every scope. As `IsScopedStream` reads it, a scope other than `"global"`
|
|
840
|
+
* makes a stream scoped.
|
|
841
|
+
*/
|
|
842
|
+
type StreamRoomProblem<Name, Stream> = Stream extends {
|
|
843
|
+
readonly scope: infer Scope extends string;
|
|
844
|
+
readonly access: {
|
|
845
|
+
readonly room: infer Room;
|
|
846
|
+
};
|
|
847
|
+
} ? Scope extends "global" ? never : Room extends (...args: never[]) => unknown ? never : `stream "${Name & string}" is scoped: its access room is a function of the scope, (scope) => room; a name or { prefix } lets a socket in that room read every scope` : never;
|
|
848
|
+
type CheckStreams<Def> = CheckRealtimeNames<Def, StreamsIn<Def>, "stream", never> & {
|
|
849
|
+
readonly [Name in keyof StreamsIn<Def>]: [StreamRoomProblem<Name, StreamsIn<Def>[Name]>] extends [
|
|
850
|
+
never
|
|
851
|
+
] ? unknown : Problem<StreamRoomProblem<Name, StreamsIn<Def>[Name]>>;
|
|
852
|
+
};
|
|
798
853
|
type DefinitionChecks<Def> = CheckKeys<Def, keyof ContractDefinition, "contract"> & {
|
|
799
854
|
readonly methods?: CheckMethods<Def>;
|
|
800
855
|
readonly collections?: CheckCollections<Def>;
|
|
801
856
|
readonly projections?: CheckProjections<Def>;
|
|
802
857
|
readonly fields?: CheckFields<Def>;
|
|
803
|
-
readonly streams?:
|
|
858
|
+
readonly streams?: CheckStreams<Def>;
|
|
804
859
|
readonly channels?: CheckChannels<Def>;
|
|
805
860
|
readonly events?: CheckRealtimeNames<Def, EventsIn<Def>, "event", keyof StreamsIn<Def> | keyof ChannelsIn<Def>>;
|
|
806
861
|
};
|
|
@@ -925,6 +980,22 @@ type StreamName<C extends AnyContract> = keyof C["streams"] & string;
|
|
|
925
980
|
type ChannelName<C extends AnyContract> = keyof C["channels"] & string;
|
|
926
981
|
/** The names of a contract's typed room events. */
|
|
927
982
|
type EventName<C extends AnyContract> = keyof C["events"] & string;
|
|
983
|
+
/** The names of a contract's channels the room's host handles (`serve: "host"`). */
|
|
984
|
+
type HostChannelName<C extends AnyContract> = {
|
|
985
|
+
readonly [K in ChannelName<C>]: C["channels"][K] extends {
|
|
986
|
+
readonly serve: "host";
|
|
987
|
+
} ? K : never;
|
|
988
|
+
}[ChannelName<C>];
|
|
989
|
+
/** The names of a contract's channels the server handles. */
|
|
990
|
+
type ServerChannelName<C extends AnyContract> = Exclude<ChannelName<C>, HostChannelName<C>>;
|
|
991
|
+
/** The names of a contract's streams the room's host pushes (`serve: "host"`). */
|
|
992
|
+
type HostStreamName<C extends AnyContract> = {
|
|
993
|
+
readonly [K in StreamName<C>]: C["streams"][K] extends {
|
|
994
|
+
readonly serve: "host";
|
|
995
|
+
} ? K : never;
|
|
996
|
+
}[StreamName<C>];
|
|
997
|
+
/** The names of a contract's streams the server pushes. */
|
|
998
|
+
type ServerStreamName<C extends AnyContract> = Exclude<StreamName<C>, HostStreamName<C>>;
|
|
928
999
|
/** The item type of a stream: what `push` takes and subscribers receive. */
|
|
929
1000
|
type StreamItemOf<C extends AnyContract, K extends StreamName<C>> = InferOutput<C["streams"][K]["item"]>;
|
|
930
1001
|
/**
|
|
@@ -941,4 +1012,4 @@ type ChannelInputOf<C extends AnyContract, K extends ChannelName<C>> = InferInpu
|
|
|
941
1012
|
/** The payload type of a custom event: what `ctx.rooms.emit` takes and `useEvent` receives. */
|
|
942
1013
|
type EventPayloadOf<C extends AnyContract, K extends EventName<C>> = InferOutput<C["events"][K]["payload"]>;
|
|
943
1014
|
|
|
944
|
-
export { isScopedStream as $, type AccessLevel as A, type ViaScope as B, type CollectionDef as C, DEFAULT_COLLECTION_LIMIT as D, type EntityProjection as E, type Viewer as F, type ViewPredicate as G, defineContract as H, type InferInput as I, type AnyContract as J, type Contract as K, type ContractDefinition as L, type MethodDef as M, type NullableProjection as N, type OrderBy as O, type ProjectionList as P, type QueryDef as Q, type IndexRow as R, StandardJSONSchemaV1 as S, TODO_SCHEMA_VENDOR as T, type ReservedMethodName as U, type ValidationIssue as V, type Watch as W, type RowSchema as X, CHANNEL_DEFAULT_RATE as Y, GLOBAL_STREAM as Z, STREAM_MAX_SEED as _, type ACE as a, type ChannelDef as a0, type ChannelRequires as a1, type EventDef as a2, type PayloadSelector as a3, type RoomPrefix as a4, type RoomSelector as a5, type StreamAccess as a6, type StreamDef as a7, type StreamRoom as a8, type ChannelInputOf as a9, type ViewName as aA, type ChannelName as aa, type ChannelPayloadOf as ab, type CollectionName as ac, type CollectionOf as ad, type ContractMap as ae, type EntityOf as af, type EventName as ag, type EventPayloadOf as ah, type FullProjectionOf as ai, type IndexFieldOf as aj, type IndexRowOf as ak, type InputOf as al, type IsScopedStream as am, type ItemOf as an, type KindOf as ao, type MethodName as ap, type MethodOf as aq, type OutputOf as ar, type ParsedInputOf as as, type ProjectionName as at, type ProjectionOf as au, type ReceivedRow as av, type ScopeOf as aw, type ServiceNameOf as ax, type StreamItemOf as ay, type StreamName as az, type ACL as b, type InferOutput as c, StandardSchemaV1 as d, type StandardSchemaWithJSON as e, StandardTypedV1 as f, type TodoSchemaOptions as g, hasJsonSchema as h, isStandardSchema as i, type ValidationResult as j, type MethodKind as k, listOf as l, mutation as m, nullable as n, type MethodOutput as o, type MutationDef as p, query as q, type ProjectionRef as r, type ServiceModelsWatch as s, todoSchema as t, type ServiceWatch as u, validate as v, DEFAULT_COLLECTION_MAX_LIMIT as w, via as x, type CollectionWhere as y, type SortDirection as z };
|
|
1015
|
+
export { isScopedStream as $, type AccessLevel as A, type ViaScope as B, type CollectionDef as C, DEFAULT_COLLECTION_LIMIT as D, type EntityProjection as E, type Viewer as F, type ViewPredicate as G, defineContract as H, type InferInput as I, type AnyContract as J, type Contract as K, type ContractDefinition as L, type MethodDef as M, type NullableProjection as N, type OrderBy as O, type ProjectionList as P, type QueryDef as Q, type IndexRow as R, StandardJSONSchemaV1 as S, TODO_SCHEMA_VENDOR as T, type ReservedMethodName as U, type ValidationIssue as V, type Watch as W, type RowSchema as X, CHANNEL_DEFAULT_RATE as Y, GLOBAL_STREAM as Z, STREAM_MAX_SEED as _, type ACE as a, type ChannelDef as a0, type ChannelRequires as a1, type EventDef as a2, type PayloadSelector as a3, type RoomPrefix as a4, type RoomSelector as a5, type StreamAccess as a6, type StreamDef as a7, type StreamRoom as a8, type ChannelInputOf as a9, type ViewName as aA, type ServerChannelName as aB, type ServerStreamName as aC, type HostStreamName as aD, type HostChannelName as aE, type ChannelName as aa, type ChannelPayloadOf as ab, type CollectionName as ac, type CollectionOf as ad, type ContractMap as ae, type EntityOf as af, type EventName as ag, type EventPayloadOf as ah, type FullProjectionOf as ai, type IndexFieldOf as aj, type IndexRowOf as ak, type InputOf as al, type IsScopedStream as am, type ItemOf as an, type KindOf as ao, type MethodName as ap, type MethodOf as aq, type OutputOf as ar, type ParsedInputOf as as, type ProjectionName as at, type ProjectionOf as au, type ReceivedRow as av, type ScopeOf as aw, type ServiceNameOf as ax, type StreamItemOf as ay, type StreamName as az, type ACL as b, type InferOutput as c, StandardSchemaV1 as d, type StandardSchemaWithJSON as e, StandardTypedV1 as f, type TodoSchemaOptions as g, hasJsonSchema as h, isStandardSchema as i, type ValidationResult as j, type MethodKind as k, listOf as l, mutation as m, nullable as n, type MethodOutput as o, type MutationDef as p, query as q, type ProjectionRef as r, type ServiceModelsWatch as s, todoSchema as t, type ServiceWatch as u, validate as v, DEFAULT_COLLECTION_MAX_LIMIT as w, via as x, type CollectionWhere as y, type SortDirection as z };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger interface compatible with Winston and other loggers
|
|
3
|
+
*/
|
|
4
|
+
interface Logger {
|
|
5
|
+
info(message: string, meta?: Record<string, unknown>): void;
|
|
6
|
+
warn(message: string, meta?: Record<string, unknown>): void;
|
|
7
|
+
error(message: string, meta?: Record<string, unknown>): void;
|
|
8
|
+
debug(message: string, meta?: Record<string, unknown>): void;
|
|
9
|
+
child(options: Record<string, unknown>): Logger;
|
|
10
|
+
}
|
|
11
|
+
/** A logger's levels, lowest first. */
|
|
12
|
+
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
13
|
+
/** Options of {@link createConsoleLogger}. */
|
|
14
|
+
interface ConsoleLoggerOptions {
|
|
15
|
+
/**
|
|
16
|
+
* The lowest level written. Default `"info"` when `NODE_ENV` is
|
|
17
|
+
* `"production"` (read at each call), else `"debug"`.
|
|
18
|
+
*/
|
|
19
|
+
readonly level?: LogLevel;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A logger that writes to the console from `level` up: by default every
|
|
23
|
+
* level, but `debug` when `NODE_ENV` is "production". `child` returns the
|
|
24
|
+
* same logger.
|
|
25
|
+
*/
|
|
26
|
+
declare function createConsoleLogger(options?: ConsoleLoggerOptions): Logger;
|
|
27
|
+
/** The default console logger: every level, but `debug` in production. */
|
|
28
|
+
declare const consoleLogger: Logger;
|
|
29
|
+
|
|
30
|
+
export { type ConsoleLoggerOptions as C, type Logger as L, createConsoleLogger as a, type LogLevel as b, consoleLogger as c };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { k as MethodKind } from './infer-
|
|
1
|
+
import { k as MethodKind } from './infer-Br62cnyW.js';
|
|
2
2
|
import { a as ErrorCode } from './errors-S-bxEIBC.js';
|
|
3
|
-
import { T as Transport } from './types-
|
|
3
|
+
import { T as Transport } from './types-CLRCQGnO.js';
|
|
4
4
|
|
|
5
5
|
/** How a call ended: `"ok"`, `"not-modified"`, or the error code it failed with. */
|
|
6
6
|
type CallOutcome = "ok" | "not-modified" | ErrorCode;
|
package/dist/parser.js
CHANGED
package/dist/prisma/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { L as Logger } from '../logger-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { L as Logger } from '../logger-Yz93KzdV.js';
|
|
2
|
+
import { T as Tracked } from '../tracked-BR5b2O-U.js';
|
|
3
|
+
export { a as TrackedTransaction } from '../tracked-BR5b2O-U.js';
|
|
4
|
+
export { C as CountArgs, F as FindManyArgs, c as StatementCount, S as StorageAdapter, a as StorageRow, b as StorageWhere, s as storageOf } from '../caller-BTwGl7vm.js';
|
|
5
|
+
import '../infer-Br62cnyW.js';
|
|
6
|
+
import '../types-CLRCQGnO.js';
|
|
7
|
+
import '../envelope-BMBaxppV.js';
|
|
5
8
|
import '../errors-S-bxEIBC.js';
|
|
6
|
-
import '../types-Cu0vmx7c.js';
|
|
7
9
|
|
|
8
10
|
/** Options of {@link trackPrisma}. */
|
|
9
11
|
interface TrackPrismaOptions {
|
|
@@ -37,6 +39,11 @@ interface PrismaClientLike {
|
|
|
37
39
|
* Nested writes, raw SQL and database cascades are not seen; record those
|
|
38
40
|
* with `ctx.touch`.
|
|
39
41
|
*
|
|
42
|
+
* The result is a `Tracked<C>` (`tracked.ts`): still a `C`, but the
|
|
43
|
+
* untracked client is no `Tracked<C>`, so a helper that writes takes
|
|
44
|
+
* `db: Tracked<Db>` (or `TrackedTransaction<Db>`, which a transaction's `tx`
|
|
45
|
+
* is too) and the compiler refuses the untracked client there.
|
|
46
|
+
*
|
|
40
47
|
* Prefer interactive transactions (`db.$transaction(async (tx) => ...)`). An
|
|
41
48
|
* array-form `db.$transaction([...])` has no transaction client, so the rows
|
|
42
49
|
* a `deleteMany` or `updateMany` there reads first (and an `update`'s old
|
|
@@ -49,7 +56,7 @@ interface PrismaClientLike {
|
|
|
49
56
|
* export const qd = initQuickdraw<{ db: typeof db; principal: AppPrincipal }>();
|
|
50
57
|
* const server = qd.createServer({ app, services, db, auth });
|
|
51
58
|
*/
|
|
52
|
-
declare function trackPrisma<C extends PrismaClientLike>(client: C, options?: TrackPrismaOptions): C
|
|
59
|
+
declare function trackPrisma<C extends PrismaClientLike>(client: C, options?: TrackPrismaOptions): Tracked<C>;
|
|
53
60
|
|
|
54
61
|
/** One nested write found in a write's `data`. */
|
|
55
62
|
interface NestedWrite {
|
|
@@ -61,4 +68,4 @@ interface NestedWrite {
|
|
|
61
68
|
/** The nested writes in `data`, one per relation field that has one. */
|
|
62
69
|
declare function findNestedWrites(data: unknown): NestedWrite[];
|
|
63
70
|
|
|
64
|
-
export { type NestedWrite, type PrismaClientLike, type TrackPrismaOptions, findNestedWrites, trackPrisma };
|
|
71
|
+
export { type NestedWrite, type PrismaClientLike, type TrackPrismaOptions, Tracked, findNestedWrites, trackPrisma };
|