@rocicorp/zero 1.10.0-canary.26 → 1.10.0-canary.27
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/out/zero/package.js +1 -1
- package/out/zero/package.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +87 -87
- package/out/zero-cache/src/workers/connect-params.d.ts +0 -7
- package/out/zero-cache/src/workers/connect-params.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connect-params.js +1 -20
- package/out/zero-cache/src/workers/connect-params.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +4 -4
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +8 -8
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.js +3 -4
- package/out/zero-client/src/client/zero.js.map +1 -1
- package/out/zero-protocol/src/connect.d.ts +0 -13
- package/out/zero-protocol/src/connect.d.ts.map +1 -1
- package/out/zero-protocol/src/connect.js +1 -30
- package/out/zero-protocol/src/connect.js.map +1 -1
- package/out/zero-protocol/src/poke.d.ts +4 -11
- package/out/zero-protocol/src/poke.d.ts.map +1 -1
- package/out/zero-protocol/src/poke.js +2 -3
- package/out/zero-protocol/src/poke.js.map +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts +6 -30
- package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.js +1 -1
- package/out/zero-protocol/src/protocol-version.js.map +1 -1
- package/package.json +1 -1
- package/out/shared/src/base64.d.ts +0 -19
- package/out/shared/src/base64.d.ts.map +0 -1
- package/out/shared/src/base64.js +0 -40
- package/out/shared/src/base64.js.map +0 -1
- package/out/zero-protocol/src/protocol-flag-enum.d.ts +0 -7
- package/out/zero-protocol/src/protocol-flag-enum.d.ts.map +0 -1
- package/out/zero-protocol/src/protocol-flag-enum.js +0 -7
- package/out/zero-protocol/src/protocol-flag-enum.js.map +0 -1
- package/out/zero-protocol/src/protocol-flag.d.ts +0 -14
- package/out/zero-protocol/src/protocol-flag.d.ts.map +0 -1
- package/out/zero-protocol/src/protocol-flag.js +0 -8
- package/out/zero-protocol/src/protocol-flag.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as v from '../../shared/src/valita.ts';
|
|
2
|
-
import { ProtocolFlags } from './protocol-flag.ts';
|
|
3
2
|
/**
|
|
4
3
|
* After opening a websocket the client waits for a `connected` message
|
|
5
4
|
* from the server. It then sends an `initConnection` message to the
|
|
@@ -101,18 +100,6 @@ export type ConnectedBody = v.Infer<typeof connectedBodySchema>;
|
|
|
101
100
|
export type ConnectedMessage = v.Infer<typeof connectedMessageSchema>;
|
|
102
101
|
export type InitConnectionBody = v.Infer<typeof initConnectionBodySchema>;
|
|
103
102
|
export type InitConnectionMessage = v.Infer<typeof initConnectionMessageSchema>;
|
|
104
|
-
/**
|
|
105
|
-
* Adds the client's protocol flags to the connect URL: every flag this client
|
|
106
|
-
* knows.
|
|
107
|
-
*/
|
|
108
|
-
export declare function setProtocolFlags(params: URLSearchParams): void;
|
|
109
|
-
/**
|
|
110
|
-
* Reads the protocol flags a client sent in the connect URL. A flag it didn't
|
|
111
|
-
* send means the server's default. Flags this server doesn't know are dropped,
|
|
112
|
-
* and a malformed value counts as no flags, so newer clients can always
|
|
113
|
-
* connect.
|
|
114
|
-
*/
|
|
115
|
-
export declare function getProtocolFlags(params: URLSearchParams): ProtocolFlags;
|
|
116
103
|
export declare function encodeSecProtocols(initConnectionMessage: InitConnectionMessage | undefined, authToken: string | undefined): string;
|
|
117
104
|
export declare function decodeSecProtocols(secProtocol: string): {
|
|
118
105
|
initConnectionMessage: InitConnectionMessage | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAKhD;;;;;;GAMG;AAEH,eAAO,MAAM,mBAAmB;;;aAG9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;eAGjC,CAAC;AAEH,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAe5B;;;;;OAKG;;IAEH,sDAAsD;;aAEtD,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAXtC;;;;;OAKG;;IAEH,sDAAsD;;eAOtD,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,qBAAqB,GAAG,SAAS,EACxD,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,CAgBR;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG;IACvD,qBAAqB,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACzD,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAIA"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { valita_exports } from "../../shared/src/valita.js";
|
|
2
2
|
import { clientSchemaSchema } from "./client-schema.js";
|
|
3
|
-
import { fromBase64url, toBase64url } from "../../shared/src/base64.js";
|
|
4
3
|
import { deleteClientsBodySchema } from "./delete-clients.js";
|
|
5
|
-
import { protocol_flag_enum_exports } from "./protocol-flag-enum.js";
|
|
6
|
-
import { ProtocolFlags } from "./protocol-flag.js";
|
|
7
4
|
import { upQueriesPatchSchema } from "./queries-patch.js";
|
|
8
5
|
//#region ../zero-protocol/src/connect.ts
|
|
9
6
|
/**
|
|
@@ -37,32 +34,6 @@ var initConnectionBodySchema = valita_exports.object({
|
|
|
37
34
|
traceparent: valita_exports.string().optional()
|
|
38
35
|
});
|
|
39
36
|
var initConnectionMessageSchema = valita_exports.tuple([valita_exports.literal("initConnection"), initConnectionBodySchema]);
|
|
40
|
-
var PROTOCOL_FLAGS_PARAM = "f";
|
|
41
|
-
/**
|
|
42
|
-
* Adds the client's protocol flags to the connect URL: every flag this client
|
|
43
|
-
* knows.
|
|
44
|
-
*/
|
|
45
|
-
function setProtocolFlags(params) {
|
|
46
|
-
const flags = Object.values(protocol_flag_enum_exports);
|
|
47
|
-
const bytes = new Uint8Array((Math.max(...flags) >> 3) + 1);
|
|
48
|
-
for (const flag of flags) bytes[flag >> 3] |= 1 << (flag & 7);
|
|
49
|
-
params.set(PROTOCOL_FLAGS_PARAM, toBase64url(bytes));
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Reads the protocol flags a client sent in the connect URL. A flag it didn't
|
|
53
|
-
* send means the server's default. Flags this server doesn't know are dropped,
|
|
54
|
-
* and a malformed value counts as no flags, so newer clients can always
|
|
55
|
-
* connect.
|
|
56
|
-
*/
|
|
57
|
-
function getProtocolFlags(params) {
|
|
58
|
-
let bytes;
|
|
59
|
-
try {
|
|
60
|
-
bytes = fromBase64url(params.get(PROTOCOL_FLAGS_PARAM) ?? "");
|
|
61
|
-
} catch {
|
|
62
|
-
return new ProtocolFlags();
|
|
63
|
-
}
|
|
64
|
-
return new ProtocolFlags(Object.values(protocol_flag_enum_exports).filter((flag) => ((bytes[flag >> 3] ?? 0) >> (flag & 7) & 1) !== 0));
|
|
65
|
-
}
|
|
66
37
|
function encodeSecProtocols(initConnectionMessage, authToken) {
|
|
67
38
|
const protocols = {
|
|
68
39
|
initConnectionMessage,
|
|
@@ -78,6 +49,6 @@ function decodeSecProtocols(secProtocol) {
|
|
|
78
49
|
return JSON.parse(new TextDecoder().decode(bytes));
|
|
79
50
|
}
|
|
80
51
|
//#endregion
|
|
81
|
-
export { connectedMessageSchema, decodeSecProtocols, encodeSecProtocols,
|
|
52
|
+
export { connectedMessageSchema, decodeSecProtocols, encodeSecProtocols, initConnectionMessageSchema };
|
|
82
53
|
|
|
83
54
|
//# sourceMappingURL=connect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","names":[],"sources":["../../../../zero-protocol/src/connect.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"connect.js","names":[],"sources":["../../../../zero-protocol/src/connect.ts"],"sourcesContent":["import * as v from '../../shared/src/valita.ts';\nimport {clientSchemaSchema} from './client-schema.ts';\nimport {deleteClientsBodySchema} from './delete-clients.ts';\nimport {upQueriesPatchSchema} from './queries-patch.ts';\n\n/**\n * After opening a websocket the client waits for a `connected` message\n * from the server. It then sends an `initConnection` message to the\n * server. The server waits for the `initConnection` message before\n * beginning to send pokes to the newly connected client, so as to avoid\n * syncing lots of queries which are no longer desired by the client.\n */\n\nexport const connectedBodySchema = v.object({\n wsid: v.string(),\n timestamp: v.number().optional(),\n});\n\nexport const connectedMessageSchema = v.tuple([\n v.literal('connected'),\n connectedBodySchema,\n]);\n\nconst initConnectionBodySchema = v.object({\n desiredQueriesPatch: upQueriesPatchSchema,\n // As the schema can be large, client only sends when it does not have a\n // server snapshot (i.e. a snapshot with a cookie). Once it has a server\n // snapshot it will assume the zero-cache already has the schema for this\n // client's client group in the CVR store.\n clientSchema: clientSchemaSchema.optional(),\n deleted: deleteClientsBodySchema.optional(),\n // parameters to configure the mutate endpoint\n userPushURL: v.string().optional(),\n userPushHeaders: v.record(v.string()).optional(),\n // parameters to configure the query endpoint\n userQueryURL: v.string().optional(),\n userQueryHeaders: v.record(v.string()).optional(),\n\n /**\n * `activeClients` is an optional array of client IDs that are currently active\n * in the client group. This is used to inform the server about the clients\n * that are currently active (aka running, aka alive), so it can inactive\n * queries from inactive clients.\n */\n activeClients: v.array(v.string()).optional(),\n /** W3C traceparent header for distributed tracing. */\n traceparent: v.string().optional(),\n});\n\nexport const initConnectionMessageSchema = v.tuple([\n v.literal('initConnection'),\n initConnectionBodySchema,\n]);\n\nexport type ConnectedBody = v.Infer<typeof connectedBodySchema>;\nexport type ConnectedMessage = v.Infer<typeof connectedMessageSchema>;\nexport type InitConnectionBody = v.Infer<typeof initConnectionBodySchema>;\nexport type InitConnectionMessage = v.Infer<typeof initConnectionMessageSchema>;\n\nexport function encodeSecProtocols(\n initConnectionMessage: InitConnectionMessage | undefined,\n authToken: string | undefined,\n): string {\n const protocols = {\n initConnectionMessage,\n authToken,\n };\n // WS sec protocols needs to be URI encoded. To save space, we base64 encode\n // the JSON before URI encoding it. But InitConnectionMessage can contain\n // arbitrary unicode strings, so we need to encode the JSON as UTF-8 first.\n // Phew!\n const bytes = new TextEncoder().encode(JSON.stringify(protocols));\n\n // Convert bytes to string without spreading all bytes as arguments\n // to avoid \"Maximum call stack size exceeded\" error with large data\n const s = Array.from(bytes, byte => String.fromCharCode(byte)).join('');\n\n return encodeURIComponent(btoa(s));\n}\n\nexport function decodeSecProtocols(secProtocol: string): {\n initConnectionMessage: InitConnectionMessage | undefined;\n authToken: string | undefined;\n} {\n const binString = atob(decodeURIComponent(secProtocol));\n const bytes = Uint8Array.from(binString, c => c.charCodeAt(0));\n return JSON.parse(new TextDecoder().decode(bytes));\n}\n"],"mappings":";;;;;;;;;;;;AAaA,IAAa,sBAAsB,eAAE,OAAO;CAC1C,MAAM,eAAE,OAAO;CACf,WAAW,eAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAED,IAAa,yBAAyB,eAAE,MAAM,CAC5C,eAAE,QAAQ,WAAW,GACrB,mBACF,CAAC;AAED,IAAM,2BAA2B,eAAE,OAAO;CACxC,qBAAqB;CAKrB,cAAc,mBAAmB,SAAS;CAC1C,SAAS,wBAAwB,SAAS;CAE1C,aAAa,eAAE,OAAO,EAAE,SAAS;CACjC,iBAAiB,eAAE,OAAO,eAAE,OAAO,CAAC,EAAE,SAAS;CAE/C,cAAc,eAAE,OAAO,EAAE,SAAS;CAClC,kBAAkB,eAAE,OAAO,eAAE,OAAO,CAAC,EAAE,SAAS;;;;;;;CAQhD,eAAe,eAAE,MAAM,eAAE,OAAO,CAAC,EAAE,SAAS;;CAE5C,aAAa,eAAE,OAAO,EAAE,SAAS;AACnC,CAAC;AAED,IAAa,8BAA8B,eAAE,MAAM,CACjD,eAAE,QAAQ,gBAAgB,GAC1B,wBACF,CAAC;AAOD,SAAgB,mBACd,uBACA,WACQ;CACR,MAAM,YAAY;EAChB;EACA;CACF;CAKA,MAAM,QAAQ,IAAI,YAAY,EAAE,OAAO,KAAK,UAAU,SAAS,CAAC;CAIhE,MAAM,IAAI,MAAM,KAAK,QAAO,SAAQ,OAAO,aAAa,IAAI,CAAC,EAAE,KAAK,EAAE;CAEtE,OAAO,mBAAmB,KAAK,CAAC,CAAC;AACnC;AAEA,SAAgB,mBAAmB,aAGjC;CACA,MAAM,YAAY,KAAK,mBAAmB,WAAW,CAAC;CACtD,MAAM,QAAQ,WAAW,KAAK,YAAW,MAAK,EAAE,WAAW,CAAC,CAAC;CAC7D,OAAO,KAAK,MAAM,IAAI,YAAY,EAAE,OAAO,KAAK,CAAC;AACnD"}
|
|
@@ -12,9 +12,8 @@ import * as v from '../../shared/src/valita.ts';
|
|
|
12
12
|
* the poke is updating from and the `cookie` the poke is updating to.
|
|
13
13
|
*
|
|
14
14
|
* Through protocol version 51, the poke continues with zero to many
|
|
15
|
-
* `poke-part` JSON messages. Starting in version 52,
|
|
16
|
-
*
|
|
17
|
-
* `pokeChunk` messages instead. Each binary message starts with a message
|
|
15
|
+
* `poke-part` JSON messages. Starting in version 52, it continues with zero to
|
|
16
|
+
* many binary `pokeChunk` messages. Each binary message starts with a message
|
|
18
17
|
* type byte. Concatenating and decoding the payload after that byte produces a
|
|
19
18
|
* PokePartBody array. pokeChunk boundaries have no semantic meaning.
|
|
20
19
|
*
|
|
@@ -271,15 +270,9 @@ export type PokeParts = v.Infer<typeof pokePartsSchema>;
|
|
|
271
270
|
export type PokeEndBody = v.Infer<typeof pokeEndBodySchema>;
|
|
272
271
|
/** The first byte identifying a binary WebSocket message as a poke chunk. */
|
|
273
272
|
export declare const POKE_CHUNK_MESSAGE_TYPE = 0;
|
|
274
|
-
/**
|
|
275
|
-
* The first protocol version that receives binary poke chunks without the
|
|
276
|
-
* `PokeChunk` protocol flag.
|
|
277
|
-
*/
|
|
273
|
+
/** The first protocol version that receives binary poke chunks. */
|
|
278
274
|
export declare const POKE_CHUNK_PROTOCOL_VERSION = 52;
|
|
279
|
-
/**
|
|
280
|
-
* The last protocol version that receives JSON pokePart messages unless the
|
|
281
|
-
* client sends the `PokeChunk` protocol flag.
|
|
282
|
-
*/
|
|
275
|
+
/** The last protocol version that receives JSON pokePart messages. */
|
|
283
276
|
export declare const LAST_POKE_PART_PROTOCOL_VERSION = 51;
|
|
284
277
|
/** A tagged binary poke chunk WebSocket message. */
|
|
285
278
|
export type PokeChunk = Uint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poke.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/poke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAMhD
|
|
1
|
+
{"version":3,"file":"poke.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/poke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAMhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,eAAO,MAAM,mBAAmB;;;IAM9B;;;OAGG;;;;;;aAQH,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAa7B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA8B,CAAC;AAE3D,eAAO,MAAM,iBAAiB;;;;aAO5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;IA5CjC;;;OAGG;;;;;;eA4CH,CAAC;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAGhC,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;eAG/B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,IAAO,CAAC;AAE5C,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,sEAAsE;AACtE,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD,oDAAoD;AACpD,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AAEnC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -17,9 +17,8 @@ import { nullableVersionSchema, versionSchema } from "./version.js";
|
|
|
17
17
|
* the poke is updating from and the `cookie` the poke is updating to.
|
|
18
18
|
*
|
|
19
19
|
* Through protocol version 51, the poke continues with zero to many
|
|
20
|
-
* `poke-part` JSON messages. Starting in version 52,
|
|
21
|
-
*
|
|
22
|
-
* `pokeChunk` messages instead. Each binary message starts with a message
|
|
20
|
+
* `poke-part` JSON messages. Starting in version 52, it continues with zero to
|
|
21
|
+
* many binary `pokeChunk` messages. Each binary message starts with a message
|
|
23
22
|
* type byte. Concatenating and decoding the payload after that byte produces a
|
|
24
23
|
* PokePartBody array. pokeChunk boundaries have no semantic meaning.
|
|
25
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poke.js","names":[],"sources":["../../../../zero-protocol/src/poke.ts"],"sourcesContent":["import * as v from '../../shared/src/valita.ts';\nimport {mutationsPatchSchema} from './mutations-patch.ts';\nimport {queriesPatchSchema} from './queries-patch.ts';\nimport {rowsPatchSchema} from './row-patch.ts';\nimport {nullableVersionSchema, versionSchema} from './version.ts';\n\n/**\n * Pokes use a multi-part format. Pokes send entity data to the client and can\n * be multiple mega-bytes in size. Using a multi-part format allows the server\n * to avoid having to have the full poke in memory at one time.\n *\n * Each poke is assigned a `pokeID`, a unique id (within the context of the\n * connection) for identifying the poke. All messages for a poke will have the\n * same `pokeID`.\n *\n * A poke begins with a `poke-start` message which contains the `baseCookie`\n * the poke is updating from and the `cookie` the poke is updating to.\n *\n * Through protocol version 51, the poke continues with zero to many\n * `poke-part` JSON messages. Starting in version 52,
|
|
1
|
+
{"version":3,"file":"poke.js","names":[],"sources":["../../../../zero-protocol/src/poke.ts"],"sourcesContent":["import * as v from '../../shared/src/valita.ts';\nimport {mutationsPatchSchema} from './mutations-patch.ts';\nimport {queriesPatchSchema} from './queries-patch.ts';\nimport {rowsPatchSchema} from './row-patch.ts';\nimport {nullableVersionSchema, versionSchema} from './version.ts';\n\n/**\n * Pokes use a multi-part format. Pokes send entity data to the client and can\n * be multiple mega-bytes in size. Using a multi-part format allows the server\n * to avoid having to have the full poke in memory at one time.\n *\n * Each poke is assigned a `pokeID`, a unique id (within the context of the\n * connection) for identifying the poke. All messages for a poke will have the\n * same `pokeID`.\n *\n * A poke begins with a `poke-start` message which contains the `baseCookie`\n * the poke is updating from and the `cookie` the poke is updating to.\n *\n * Through protocol version 51, the poke continues with zero to many\n * `poke-part` JSON messages. Starting in version 52, it continues with zero to\n * many binary `pokeChunk` messages. Each binary message starts with a message\n * type byte. Concatenating and decoding the payload after that byte produces a\n * PokePartBody array. pokeChunk boundaries have no semantic meaning.\n *\n * Finally, the poke ends with a `poke-end` message. The decoded patches can\n * now be applied as a whole to update from `baseCookie` to `cookie`.\n *\n * Poke messages can be intermingled with other `down` messages, but cannot be\n * intermingled with poke messages for a different `pokeID`. If this is\n * observed it is an unexpected error; the client should ignore both pokes,\n * disconnect, and reconnect.\n */\n\nexport const pokeStartBodySchema = v.object({\n pokeID: v.string(),\n // We always specify a Version as our cookie, but Replicache starts clients\n // with initial cookie `null`, before the first request. So we have to be\n // able to send a base cookie with value `null` to match that state.\n baseCookie: nullableVersionSchema,\n /**\n * This field is always set if the poke contains a `rowsPatch`.\n * It may be absent for patches that only update clients and queries.\n */\n schemaVersions: v\n .object({\n minSupportedVersion: v.number(),\n maxSupportedVersion: v.number(),\n })\n .optional(),\n timestamp: v.number().optional(),\n});\n\nexport const pokePartBodySchema = v.object({\n // Changes to last mutation id by client id.\n lastMutationIDChanges: v.record(v.number()).optional(),\n // Patches to the desired query sets by client id.\n desiredQueriesPatches: v.record(queriesPatchSchema).optional(),\n // Patches to the set of queries for which entities are sync'd in\n // rowsPatch.\n gotQueriesPatch: queriesPatchSchema.optional(),\n // Patches to the rows set.\n rowsPatch: rowsPatchSchema.optional(),\n // Mutation results patch\n mutationsPatch: mutationsPatchSchema.optional(),\n pokeID: v.string(),\n});\n\n/**\n * The logical payload carried by binary poke chunks. Chunk boundaries are\n * arbitrary; concatenating and decoding all chunks for a poke produces this\n * array.\n */\nexport const pokePartsSchema = v.array(pokePartBodySchema);\n\nexport const pokeEndBodySchema = v.object({\n pokeID: v.string(),\n // Note: This should be ignored (and may be empty) if cancel === `true`.\n cookie: versionSchema,\n // If `true`, the poke with id `pokeID` should be discarded without\n // applying it.\n cancel: v.boolean().optional(),\n});\n\nexport const pokeStartMessageSchema = v.tuple([\n v.literal('pokeStart'),\n pokeStartBodySchema,\n]);\nexport const pokePartMessageSchema = v.tuple([\n v.literal('pokePart'),\n pokePartBodySchema,\n]);\nexport const pokeEndMessageSchema = v.tuple([\n v.literal('pokeEnd'),\n pokeEndBodySchema,\n]);\n\nexport type PokeStartBody = v.Infer<typeof pokeStartBodySchema>;\nexport type PokePartBody = v.Infer<typeof pokePartBodySchema>;\nexport type PokeParts = v.Infer<typeof pokePartsSchema>;\nexport type PokeEndBody = v.Infer<typeof pokeEndBodySchema>;\n\n/** The first byte identifying a binary WebSocket message as a poke chunk. */\nexport const POKE_CHUNK_MESSAGE_TYPE = 0x00;\n\n/** The first protocol version that receives binary poke chunks. */\nexport const POKE_CHUNK_PROTOCOL_VERSION = 52;\n\n/** The last protocol version that receives JSON pokePart messages. */\nexport const LAST_POKE_PART_PROTOCOL_VERSION = 51;\n\n/** A tagged binary poke chunk WebSocket message. */\nexport type PokeChunk = Uint8Array;\n\nexport type PokeStartMessage = v.Infer<typeof pokeStartMessageSchema>;\nexport type PokePartMessage = v.Infer<typeof pokePartMessageSchema>;\nexport type PokeEndMessage = v.Infer<typeof pokeEndMessageSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAa,sBAAsB,eAAE,OAAO;CAC1C,QAAQ,eAAE,OAAO;CAIjB,YAAY;;;;;CAKZ,gBAAgB,eACb,OAAO;EACN,qBAAqB,eAAE,OAAO;EAC9B,qBAAqB,eAAE,OAAO;CAChC,CAAC,EACA,SAAS;CACZ,WAAW,eAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAED,IAAa,qBAAqB,eAAE,OAAO;CAEzC,uBAAuB,eAAE,OAAO,eAAE,OAAO,CAAC,EAAE,SAAS;CAErD,uBAAuB,eAAE,OAAO,kBAAkB,EAAE,SAAS;CAG7D,iBAAiB,mBAAmB,SAAS;CAE7C,WAAW,gBAAgB,SAAS;CAEpC,gBAAgB,qBAAqB,SAAS;CAC9C,QAAQ,eAAE,OAAO;AACnB,CAAC;;;;;;AAOD,IAAa,kBAAkB,eAAE,MAAM,kBAAkB;AAEzD,IAAa,oBAAoB,eAAE,OAAO;CACxC,QAAQ,eAAE,OAAO;CAEjB,QAAQ;CAGR,QAAQ,eAAE,QAAQ,EAAE,SAAS;AAC/B,CAAC;AAED,IAAa,yBAAyB,eAAE,MAAM,CAC5C,eAAE,QAAQ,WAAW,GACrB,mBACF,CAAC;AACD,IAAa,wBAAwB,eAAE,MAAM,CAC3C,eAAE,QAAQ,UAAU,GACpB,kBACF,CAAC;AACD,IAAa,uBAAuB,eAAE,MAAM,CAC1C,eAAE,QAAQ,SAAS,GACnB,iBACF,CAAC"}
|
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
* declared in the "/sync/v{#}/connect" URL). Clients send
|
|
4
|
-
* {@link CLIENT_PROTOCOL_VERSION}.
|
|
2
|
+
* The current `PROTOCOL_VERSION` of the code.
|
|
5
3
|
*
|
|
6
|
-
* The
|
|
4
|
+
* The `PROTOCOL_VERSION` encompasses both the wire-protocol of the `/sync/...`
|
|
7
5
|
* connection between the browser and `zero-cache`, as well as the format of
|
|
8
6
|
* the `AST` objects stored in both components (i.e. IDB and CVR).
|
|
9
7
|
*
|
|
10
|
-
* A
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* 1. A change an old server can ignore goes behind a protocol flag (see
|
|
15
|
-
* `protocol-flag-enum.ts`) and the client keeps sending the same
|
|
16
|
-
* {@link CLIENT_PROTOCOL_VERSION}. Old servers ignore flags they don't
|
|
17
|
-
* know, so the client must keep supporting the old behavior.
|
|
18
|
-
* 2. A change an old server can't ignore (e.g. new `AST` functionality)
|
|
19
|
-
* increments `PROTOCOL_VERSION` one release before clients start sending
|
|
20
|
-
* it in {@link CLIENT_PROTOCOL_VERSION}.
|
|
8
|
+
* A change in the `AST` schema (e.g. new functionality added) must be
|
|
9
|
+
* accompanied by an increment of the `PROTOCOL_VERSION` and a new major
|
|
10
|
+
* release. The server (`zero-cache`) must be deployed before clients start
|
|
11
|
+
* running the new code.
|
|
21
12
|
*/
|
|
22
13
|
export declare const PROTOCOL_VERSION = 52;
|
|
23
|
-
/**
|
|
24
|
-
* The sync protocol version clients send in the "/sync/v{#}/connect" URL.
|
|
25
|
-
*
|
|
26
|
-
* Kept below {@link PROTOCOL_VERSION} so that clients can connect to servers
|
|
27
|
-
* from earlier releases: 1.9 servers accept versions up to 51. Clients ask for
|
|
28
|
-
* newer behavior with protocol flags instead (rule 1 above). Only increase it
|
|
29
|
-
* to a version that every supported server already accepts (rule 2 above).
|
|
30
|
-
*
|
|
31
|
-
* This number is also part of the client's local database name (Replicache
|
|
32
|
-
* `schemaVersion`). Changing it opens a fresh local database, which drops
|
|
33
|
-
* unsent mutations because Zero disables mutation recovery. Canary clients
|
|
34
|
-
* already used 52 and 53 in their database names, so if the name changes it
|
|
35
|
-
* must move above 53; reusing 52 or 53 would open a stale canary database.
|
|
36
|
-
*/
|
|
37
|
-
export declare const CLIENT_PROTOCOL_VERSION = 51;
|
|
38
14
|
/**
|
|
39
15
|
* The minimum server-supported sync protocol version (i.e. the version
|
|
40
16
|
* declared in the "/sync/v{#}/connect" URL).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-version.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/protocol-version.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"protocol-version.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/protocol-version.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAgDH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kCAAkC,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../shared/src/asserts.js";
|
|
2
|
-
assert(true, "
|
|
2
|
+
assert(true, "MIN_SERVER_SUPPORTED_SYNC_PROTOCOL must be less than PROTOCOL_VERSION");
|
|
3
3
|
//#endregion
|
|
4
4
|
export {};
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-version.js","names":[],"sources":["../../../../zero-protocol/src/protocol-version.ts"],"sourcesContent":["import {assert} from '../../shared/src/asserts.ts';\n\n/**\n * The
|
|
1
|
+
{"version":3,"file":"protocol-version.js","names":[],"sources":["../../../../zero-protocol/src/protocol-version.ts"],"sourcesContent":["import {assert} from '../../shared/src/asserts.ts';\n\n/**\n * The current `PROTOCOL_VERSION` of the code.\n *\n * The `PROTOCOL_VERSION` encompasses both the wire-protocol of the `/sync/...`\n * connection between the browser and `zero-cache`, as well as the format of\n * the `AST` objects stored in both components (i.e. IDB and CVR).\n *\n * A change in the `AST` schema (e.g. new functionality added) must be\n * accompanied by an increment of the `PROTOCOL_VERSION` and a new major\n * release. The server (`zero-cache`) must be deployed before clients start\n * running the new code.\n */\n// History:\n// -- Version 5 adds support for `pokeEnd.cookie`. (0.14)\n// -- Version 6 makes `pokeStart.cookie` optional. (0.16)\n// -- Version 7 introduces the initConnection.clientSchema field. (0.17)\n// -- Version 8 drops support for Version 5 (0.18).\n// -- Version 11 adds inspect queries. (0.18)\n// -- Version 12 adds 'timestamp' and 'date' types to the ClientSchema ValueType. (not shipped, reversed by version 14)\n// -- Version 14 removes 'timestamp' and 'date' types from the ClientSchema ValueType. (0.18)\n// -- Version 15 adds a `userPushParams` field to `initConnection` (0.19)\n// -- Version 16 adds a new error type (alreadyProcessed) to mutation responses (0.19)\n// -- Version 17 deprecates `AST` in downstream query puts. It was never used anyway. (0.21)\n// -- Version 18 adds `name` and `args` to the `queries-patch` protocol (0.21)\n// -- Version 19 adds `activeClients` to the `initConnection` protocol (0.22)\n// -- Version 20 changes inspector down message (0.22)\n// -- Version 21 removes `AST` in downstream query puts which was deprecated in Version 17, removes support for versions < 18 (0.22)\n// -- Version 22 adds an optional 'userQueryParams' field to `initConnection` (0.22)\n// -- Version 23 add `mutationResults` to poke (0.22)\n// -- Version 24 adds `ackMutationResults` to upstream (0.22).\n// -- version 25 modifies `mutationsResults` to include `del` patches (0.22)\n// -- version 26 adds inspect/metrics and adds metrics to inspect/query (0.23)\n// -- version 27 adds inspect/version (0.23)\n// -- version 28 adds more inspect/metrics (0.23)\n// -- version 29 adds error responses for custom queries (0.23)\n// -- version 30 adds an optional primaryKey to the ClientSchema (0.24)\n// -- version 31 adds admin password authentication to inspector RPC calls (0.24)\n// -- version 32 adds analyze-query to the inspector RPC calls (0.24)\n// -- version 33 adds `flip` to CorrelatedSubquery (0.25)\n// -- version 34 moves `flip` from CorrelatedSubquery to CorrelatedSubqueryCondition (0.25)\n// -- version 35 adds `readRows`, `readRowCountsByQuery` and `readRowCount` to analyze-query result (0.25)\n// -- version 36 changes inspector analyze-query and adds error response to RPC (0.25)\n// -- version 37 adds `elapsed` to AnalyzeQueryResult (0.25)\n// -- version 38 adds structured push/transform error responses (0.25)\n// -- version 39 removes per-transform error types and adds `message` to app error (0.25)\n// -- version 40 adds `dbRowScansByQuery` to AnalyzeQueryResult (0.25)\n// -- version 41 makes ClientSchema.primaryKey required (0.25)\n// -- version 42 adds planner events to AnalyzeQueryResult (0.25)\n// -- version 43 renames `plans` to `sqlitePlans`, `plannerEvents` to `joinPlans`, and `plannerDebug` option to `joinPlans` (0.25)\n// -- version 44 adds profileID to connection URL (0.25)\n// -- version 45 adds userPushHeaders and userQueryHeaders to initConnection (0.25)\n// -- version 46 adds scalarSubquery condition type to AST\n// -- version 47 adds optional auth token to push body\n// -- version 48 adds updateAuth\n// -- version 49 adds `scalar` to CorrelatedSubqueryCondition, removes scalarSubquery\n// -- version 50 adds OTEL headers to push and query messages\n// -- version 51 changes inspector metrics fields\n// -- version 52 replaces JSON pokePart messages with binary poke chunks for\n// clients using protocol version 52 or newer. Older clients retain pokePart.\nexport const PROTOCOL_VERSION = 52;\n\n/**\n * The minimum server-supported sync protocol version (i.e. the version\n * declared in the \"/sync/v{#}/connect\" URL).\n *\n * CloudZero can serve applications running old client releases indefinitely.\n * Consequently, this value must never be increased: `zero-cache` must continue\n * to support every sync protocol from this version through `PROTOCOL_VERSION`.\n * A wire change that an old client cannot ignore must branch on the client's\n * protocol version and retain the old behavior. Keep each compatibility fork\n * isolated at the boundary that owns the changed behavior and test both sides\n * of its version cutoff.\n *\n * Client connections from protocol versions before this historical floor are\n * closed with a `VersionNotSupported` error.\n */\nexport const MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 30;\n\nassert(\n MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION,\n 'MIN_SERVER_SUPPORTED_SYNC_PROTOCOL must be less than PROTOCOL_VERSION',\n);\n"],"mappings":";AAgFA,OAAA,MAEE,uEACF"}
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Encodes `bytes` as unpadded base64url. */
|
|
2
|
-
export declare function toBase64url(bytes: Uint8Array): string;
|
|
3
|
-
/**
|
|
4
|
-
* Decodes base64url, padded or not.
|
|
5
|
-
*
|
|
6
|
-
* @throws SyntaxError if `encoded` is not base64url, including when it has
|
|
7
|
-
* whitespace, which the standard and atob skip. atob doesn't reject
|
|
8
|
-
* everything the standard rejects, so this checks first.
|
|
9
|
-
*/
|
|
10
|
-
export declare function fromBase64url(encoded: string): Uint8Array;
|
|
11
|
-
/** @visibleForTesting */
|
|
12
|
-
export declare function toBase64urlWithBtoa(bytes: Uint8Array): string;
|
|
13
|
-
/**
|
|
14
|
-
* Decodes base64url that {@link fromBase64url} has checked.
|
|
15
|
-
*
|
|
16
|
-
* @visibleForTesting
|
|
17
|
-
*/
|
|
18
|
-
export declare function fromBase64urlWithAtob(s: string): Uint8Array;
|
|
19
|
-
//# sourceMappingURL=base64.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../../shared/src/base64.ts"],"names":[],"mappings":"AAaA,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAOrD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAUzD;AAED,yBAAyB;AACzB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAU7D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAI3D"}
|
package/out/shared/src/base64.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//#region ../shared/src/base64.ts
|
|
2
|
-
var PADDING = /=+$/;
|
|
3
|
-
var BASE64URL = /^(?:[\w-]{4})*(?:[\w-]{2}(?:==)?|[\w-]{3}=?)?$/;
|
|
4
|
-
/** Encodes `bytes` as unpadded base64url. */
|
|
5
|
-
function toBase64url(bytes) {
|
|
6
|
-
const native = bytes;
|
|
7
|
-
return native.toBase64 ? native.toBase64({
|
|
8
|
-
alphabet: "base64url",
|
|
9
|
-
omitPadding: true
|
|
10
|
-
}) : toBase64urlWithBtoa(bytes);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Decodes base64url, padded or not.
|
|
14
|
-
*
|
|
15
|
-
* @throws SyntaxError if `encoded` is not base64url, including when it has
|
|
16
|
-
* whitespace, which the standard and atob skip. atob doesn't reject
|
|
17
|
-
* everything the standard rejects, so this checks first.
|
|
18
|
-
*/
|
|
19
|
-
function fromBase64url(encoded) {
|
|
20
|
-
if (!BASE64URL.test(encoded)) throw new SyntaxError("Invalid base64url");
|
|
21
|
-
const native = Uint8Array;
|
|
22
|
-
return native.fromBase64 ? native.fromBase64(encoded, { alphabet: "base64url" }) : fromBase64urlWithAtob(encoded);
|
|
23
|
-
}
|
|
24
|
-
/** @visibleForTesting */
|
|
25
|
-
function toBase64urlWithBtoa(bytes) {
|
|
26
|
-
const { fromCharCode } = String;
|
|
27
|
-
return btoa(Array.from(bytes, (b) => fromCharCode(b)).join("")).replaceAll("+", "-").replaceAll("/", "_").replace(PADDING, "");
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Decodes base64url that {@link fromBase64url} has checked.
|
|
31
|
-
*
|
|
32
|
-
* @visibleForTesting
|
|
33
|
-
*/
|
|
34
|
-
function fromBase64urlWithAtob(s) {
|
|
35
|
-
return Uint8Array.from(atob(s.replaceAll("-", "+").replaceAll("_", "/")), (c) => c.charCodeAt(0));
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
export { fromBase64url, toBase64url };
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=base64.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64.js","names":[],"sources":["../../../../shared/src/base64.ts"],"sourcesContent":["// Unpadded base64url (RFC 4648 §5: base64 with `-` and `_` instead of `+` and\n// `/`) for Uint8Arrays. Uses the standard `Uint8Array.prototype.toBase64` and\n// `Uint8Array.fromBase64` when the runtime has them, and btoa/atob otherwise\n// (Node 22, older browsers). Node's Buffer isn't used: React Native apps\n// often polyfill it with the `buffer` package, which has no base64url.\n\ntype Base64urlOptions = {alphabet: 'base64url'; omitPadding?: boolean};\n\nconst PADDING = /=+$/;\n// Whole groups of four characters, then an unpadded or correctly padded last\n// group.\nconst BASE64URL = /^(?:[\\w-]{4})*(?:[\\w-]{2}(?:==)?|[\\w-]{3}=?)?$/;\n\n/** Encodes `bytes` as unpadded base64url. */\nexport function toBase64url(bytes: Uint8Array): string {\n const native = bytes as Uint8Array & {\n toBase64?: (options: Base64urlOptions) => string;\n };\n return native.toBase64\n ? native.toBase64({alphabet: 'base64url', omitPadding: true})\n : toBase64urlWithBtoa(bytes);\n}\n\n/**\n * Decodes base64url, padded or not.\n *\n * @throws SyntaxError if `encoded` is not base64url, including when it has\n * whitespace, which the standard and atob skip. atob doesn't reject\n * everything the standard rejects, so this checks first.\n */\nexport function fromBase64url(encoded: string): Uint8Array {\n if (!BASE64URL.test(encoded)) {\n throw new SyntaxError('Invalid base64url');\n }\n const native = Uint8Array as {\n fromBase64?: (s: string, options: Base64urlOptions) => Uint8Array;\n };\n return native.fromBase64\n ? native.fromBase64(encoded, {alphabet: 'base64url'})\n : fromBase64urlWithAtob(encoded);\n}\n\n/** @visibleForTesting */\nexport function toBase64urlWithBtoa(bytes: Uint8Array): string {\n // A local, so the loop doesn't look it up on String for every byte\n // (Hermes).\n const {fromCharCode} = String;\n // One character per byte. Spreading a large array into fromCharCode could\n // overflow the stack.\n return btoa(Array.from(bytes, b => fromCharCode(b)).join(''))\n .replaceAll('+', '-')\n .replaceAll('/', '_')\n .replace(PADDING, '');\n}\n\n/**\n * Decodes base64url that {@link fromBase64url} has checked.\n *\n * @visibleForTesting\n */\nexport function fromBase64urlWithAtob(s: string): Uint8Array {\n return Uint8Array.from(atob(s.replaceAll('-', '+').replaceAll('_', '/')), c =>\n c.charCodeAt(0),\n );\n}\n"],"mappings":";AAQA,IAAM,UAAU;AAGhB,IAAM,YAAY;;AAGlB,SAAgB,YAAY,OAA2B;CACrD,MAAM,SAAS;CAGf,OAAO,OAAO,WACV,OAAO,SAAS;EAAC,UAAU;EAAa,aAAa;CAAI,CAAC,IAC1D,oBAAoB,KAAK;AAC/B;;;;;;;;AASA,SAAgB,cAAc,SAA6B;CACzD,IAAI,CAAC,UAAU,KAAK,OAAO,GACzB,MAAM,IAAI,YAAY,mBAAmB;CAE3C,MAAM,SAAS;CAGf,OAAO,OAAO,aACV,OAAO,WAAW,SAAS,EAAC,UAAU,YAAW,CAAC,IAClD,sBAAsB,OAAO;AACnC;;AAGA,SAAgB,oBAAoB,OAA2B;CAG7D,MAAM,EAAC,iBAAgB;CAGvB,OAAO,KAAK,MAAM,KAAK,QAAO,MAAK,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EACzD,WAAW,KAAK,GAAG,EACnB,WAAW,KAAK,GAAG,EACnB,QAAQ,SAAS,EAAE;AACxB;;;;;;AAOA,SAAgB,sBAAsB,GAAuB;CAC3D,OAAO,WAAW,KAAK,KAAK,EAAE,WAAW,KAAK,GAAG,EAAE,WAAW,KAAK,GAAG,CAAC,IAAG,MACxE,EAAE,WAAW,CAAC,CAChB;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-flag-enum.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/protocol-flag-enum.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../zero-protocol/src/protocol-flag-enum.ts
|
|
3
|
-
var protocol_flag_enum_exports = /* @__PURE__ */ __exportAll({ PokeChunk: () => 0 });
|
|
4
|
-
//#endregion
|
|
5
|
-
export { protocol_flag_enum_exports };
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=protocol-flag-enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-flag-enum.js","names":[],"sources":["../../../../zero-protocol/src/protocol-flag-enum.ts"],"sourcesContent":["// Protocol flags let a client ask for behavior that an older server can\n// ignore, without raising CLIENT_PROTOCOL_VERSION (see protocol-version.ts).\n//\n// The client sends its flags in one connect URL parameter (setProtocolFlags in\n// connect.ts). A flag the client doesn't send means the server's default. A\n// server ignores flags it doesn't know, so the client must keep supporting the\n// old behavior. A client can't turn off a feature that is on by default; to let\n// it, add a flag that turns the feature off.\n//\n// The numbers are part of the wire protocol: they are bit positions in that\n// parameter. Never change a flag's number, and never reuse the number of a\n// retired flag.\n\n/**\n * Binary poke chunks instead of JSON `pokePart` messages. Defaults to on for\n * clients at protocol version 52 or above.\n */\nexport const PokeChunk = 0;\n\nexport type PokeChunk = typeof PokeChunk;\n"],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Enum } from '../../shared/src/enum.ts';
|
|
2
|
-
import * as ProtocolFlagEnum from './protocol-flag-enum.ts';
|
|
3
|
-
export { ProtocolFlagEnum as ProtocolFlag };
|
|
4
|
-
export type ProtocolFlag = Enum<typeof ProtocolFlagEnum>;
|
|
5
|
-
/** A set of protocol flags. */
|
|
6
|
-
export type ProtocolFlags = ReadonlySet<Enum<typeof ProtocolFlagEnum>>;
|
|
7
|
-
/** `Set`, typed so that `new ProtocolFlags()` needs no type argument. */
|
|
8
|
-
export declare const ProtocolFlags: {
|
|
9
|
-
new (values?: readonly 0[] | null | undefined): Set<0>;
|
|
10
|
-
new (iterable?: Iterable<0> | null | undefined): Set<0>;
|
|
11
|
-
readonly prototype: Set<any>;
|
|
12
|
-
readonly [Symbol.species]: SetConstructor;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=protocol-flag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-flag.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/protocol-flag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAC,gBAAgB,IAAI,YAAY,EAAC,CAAC;AAC1C,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAKzD,+BAA+B;AAC/B,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC;AAEvE,yEAAyE;AACzE,eAAO,MAAM,aAAa;;;;;CAAqC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./protocol-flag-enum.js";
|
|
2
|
-
//#region ../zero-protocol/src/protocol-flag.ts
|
|
3
|
-
/** `Set`, typed so that `new ProtocolFlags()` needs no type argument. */
|
|
4
|
-
var ProtocolFlags = Set;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { ProtocolFlags };
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=protocol-flag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-flag.js","names":[],"sources":["../../../../zero-protocol/src/protocol-flag.ts"],"sourcesContent":["import type {Enum} from '../../shared/src/enum.ts';\nimport * as ProtocolFlagEnum from './protocol-flag-enum.ts';\n\nexport {ProtocolFlagEnum as ProtocolFlag};\nexport type ProtocolFlag = Enum<typeof ProtocolFlagEnum>;\n\n// Spelled out instead of using ProtocolFlag: TypeScript 6 can't emit\n// declarations that refer to a name this file both re-exports and declares.\n\n/** A set of protocol flags. */\nexport type ProtocolFlags = ReadonlySet<Enum<typeof ProtocolFlagEnum>>;\n\n/** `Set`, typed so that `new ProtocolFlags()` needs no type argument. */\nexport const ProtocolFlags = Set<Enum<typeof ProtocolFlagEnum>>;\n"],"mappings":";;;AAaA,IAAa,gBAAgB"}
|