@rocicorp/zero 1.10.0-canary.25 → 1.10.0-canary.26

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 (39) hide show
  1. package/out/zero/package.js +1 -1
  2. package/out/zero/package.js.map +1 -1
  3. package/out/zero-cache/src/workers/connect-params.d.ts +6 -15
  4. package/out/zero-cache/src/workers/connect-params.d.ts.map +1 -1
  5. package/out/zero-cache/src/workers/connect-params.js +14 -15
  6. package/out/zero-cache/src/workers/connect-params.js.map +1 -1
  7. package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
  8. package/out/zero-cache/src/workers/connection.js +1 -1
  9. package/out/zero-cache/src/workers/connection.js.map +1 -1
  10. package/out/zero-client/src/client/version.js +1 -1
  11. package/out/zero-client/src/client/zero.js +2 -2
  12. package/out/zero-client/src/client/zero.js.map +1 -1
  13. package/out/zero-protocol/src/connect.d.ts +9 -12
  14. package/out/zero-protocol/src/connect.d.ts.map +1 -1
  15. package/out/zero-protocol/src/connect.js +19 -16
  16. package/out/zero-protocol/src/connect.js.map +1 -1
  17. package/out/zero-protocol/src/poke.d.ts +3 -3
  18. package/out/zero-protocol/src/poke.js +1 -1
  19. package/out/zero-protocol/src/poke.js.map +1 -1
  20. package/out/zero-protocol/src/{feature-flag-enum.d.ts → protocol-flag-enum.d.ts} +1 -1
  21. package/out/zero-protocol/src/protocol-flag-enum.d.ts.map +1 -0
  22. package/out/zero-protocol/src/protocol-flag-enum.js +7 -0
  23. package/out/zero-protocol/src/protocol-flag-enum.js.map +1 -0
  24. package/out/zero-protocol/src/protocol-flag.d.ts +14 -0
  25. package/out/zero-protocol/src/protocol-flag.d.ts.map +1 -0
  26. package/out/zero-protocol/src/protocol-flag.js +8 -0
  27. package/out/zero-protocol/src/protocol-flag.js.map +1 -0
  28. package/out/zero-protocol/src/protocol-version.d.ts +3 -3
  29. package/out/zero-protocol/src/protocol-version.js.map +1 -1
  30. package/package.json +1 -1
  31. package/out/shared/src/packed-boolean-map.d.ts +0 -7
  32. package/out/shared/src/packed-boolean-map.d.ts.map +0 -1
  33. package/out/shared/src/packed-boolean-map.js +0 -36
  34. package/out/shared/src/packed-boolean-map.js.map +0 -1
  35. package/out/zero-protocol/src/feature-flag-enum.d.ts.map +0 -1
  36. package/out/zero-protocol/src/feature-flag-enum.js +0 -7
  37. package/out/zero-protocol/src/feature-flag-enum.js.map +0 -1
  38. package/out/zero-protocol/src/feature-flag.d.ts +0 -5
  39. package/out/zero-protocol/src/feature-flag.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as v from '../../shared/src/valita.ts';
2
- import { FeatureFlag } from './feature-flag.ts';
2
+ import { ProtocolFlags } from './protocol-flag.ts';
3
3
  /**
4
4
  * After opening a websocket the client waits for a `connected` message
5
5
  * from the server. It then sends an `initConnection` message to the
@@ -102,20 +102,17 @@ export type ConnectedMessage = v.Infer<typeof connectedMessageSchema>;
102
102
  export type InitConnectionBody = v.Infer<typeof initConnectionBodySchema>;
103
103
  export type InitConnectionMessage = v.Infer<typeof initConnectionMessageSchema>;
104
104
  /**
105
- * The feature flags a client sent. A missing flag means the server's default.
105
+ * Adds the client's protocol flags to the connect URL: every flag this client
106
+ * knows.
106
107
  */
107
- export type FeatureFlags = ReadonlyMap<FeatureFlag, boolean>;
108
+ export declare function setProtocolFlags(params: URLSearchParams): void;
108
109
  /**
109
- * Adds the client's feature flags to the connect URL: every flag this client
110
- * knows, turned on.
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.
111
114
  */
112
- export declare function setFeatureFlags(params: URLSearchParams): void;
113
- /**
114
- * Reads the feature flags a client sent in the connect URL. Flags this server
115
- * doesn't know are dropped, and a malformed value counts as no flags, so newer
116
- * clients can always connect.
117
- */
118
- export declare function getFeatureFlags(params: URLSearchParams): FeatureFlags;
115
+ export declare function getProtocolFlags(params: URLSearchParams): ProtocolFlags;
119
116
  export declare function encodeSecProtocols(initConnectionMessage: InitConnectionMessage | undefined, authToken: string | undefined): string;
120
117
  export declare function decodeSecProtocols(secProtocol: string): {
121
118
  initConnectionMessage: InitConnectionMessage | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAGhD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAG9C;;;;;;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;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAO7D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAG7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAQrE;AAED,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
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/connect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAGhD,OAAO,EAAe,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAG/D;;;;;;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;AAMhF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAO9D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,CAYvE;AAED,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,9 @@
1
1
  import { valita_exports } from "../../shared/src/valita.js";
2
2
  import { clientSchemaSchema } from "./client-schema.js";
3
3
  import { fromBase64url, toBase64url } from "../../shared/src/base64.js";
4
- import { packBooleanMap, unpackBooleanMap } from "../../shared/src/packed-boolean-map.js";
5
4
  import { deleteClientsBodySchema } from "./delete-clients.js";
6
- import { feature_flag_enum_exports } from "./feature-flag-enum.js";
5
+ import { protocol_flag_enum_exports } from "./protocol-flag-enum.js";
6
+ import { ProtocolFlags } from "./protocol-flag.js";
7
7
  import { upQueriesPatchSchema } from "./queries-patch.js";
8
8
  //#region ../zero-protocol/src/connect.ts
9
9
  /**
@@ -37,28 +37,31 @@ var initConnectionBodySchema = valita_exports.object({
37
37
  traceparent: valita_exports.string().optional()
38
38
  });
39
39
  var initConnectionMessageSchema = valita_exports.tuple([valita_exports.literal("initConnection"), initConnectionBodySchema]);
40
- var FEATURE_FLAGS_PARAM = "f";
40
+ var PROTOCOL_FLAGS_PARAM = "f";
41
41
  /**
42
- * Adds the client's feature flags to the connect URL: every flag this client
43
- * knows, turned on.
42
+ * Adds the client's protocol flags to the connect URL: every flag this client
43
+ * knows.
44
44
  */
45
- function setFeatureFlags(params) {
46
- const flags = new Map(Object.values(feature_flag_enum_exports).map((flag) => [flag, true]));
47
- params.set(FEATURE_FLAGS_PARAM, toBase64url(packBooleanMap(flags)));
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));
48
50
  }
49
51
  /**
50
- * Reads the feature flags a client sent in the connect URL. Flags this server
51
- * doesn't know are dropped, and a malformed value counts as no flags, so newer
52
- * clients can always connect.
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.
53
56
  */
54
- function getFeatureFlags(params) {
57
+ function getProtocolFlags(params) {
55
58
  let bytes;
56
59
  try {
57
- bytes = fromBase64url(params.get(FEATURE_FLAGS_PARAM) ?? "");
60
+ bytes = fromBase64url(params.get(PROTOCOL_FLAGS_PARAM) ?? "");
58
61
  } catch {
59
- return /* @__PURE__ */ new Map();
62
+ return new ProtocolFlags();
60
63
  }
61
- return unpackBooleanMap(bytes, Object.values(feature_flag_enum_exports));
64
+ return new ProtocolFlags(Object.values(protocol_flag_enum_exports).filter((flag) => ((bytes[flag >> 3] ?? 0) >> (flag & 7) & 1) !== 0));
62
65
  }
63
66
  function encodeSecProtocols(initConnectionMessage, authToken) {
64
67
  const protocols = {
@@ -75,6 +78,6 @@ function decodeSecProtocols(secProtocol) {
75
78
  return JSON.parse(new TextDecoder().decode(bytes));
76
79
  }
77
80
  //#endregion
78
- export { connectedMessageSchema, decodeSecProtocols, encodeSecProtocols, getFeatureFlags, initConnectionMessageSchema, setFeatureFlags };
81
+ export { connectedMessageSchema, decodeSecProtocols, encodeSecProtocols, getProtocolFlags, initConnectionMessageSchema, setProtocolFlags };
79
82
 
80
83
  //# sourceMappingURL=connect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.js","names":[],"sources":["../../../../zero-protocol/src/connect.ts"],"sourcesContent":["import {fromBase64url, toBase64url} from '../../shared/src/base64.ts';\nimport {\n packBooleanMap,\n unpackBooleanMap,\n} from '../../shared/src/packed-boolean-map.ts';\nimport * as v from '../../shared/src/valita.ts';\nimport {clientSchemaSchema} from './client-schema.ts';\nimport {deleteClientsBodySchema} from './delete-clients.ts';\nimport {FeatureFlag} from './feature-flag.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\n/**\n * The feature flags a client sent. A missing flag means the server's default.\n */\nexport type FeatureFlags = ReadonlyMap<FeatureFlag, boolean>;\n\n// The connect URL parameter that carries the feature flags: a byte array with\n// two bits per flag, the low bit saying the client sent the flag and the high\n// bit its value (see packed-boolean-map.ts), in unpadded base64url.\nconst FEATURE_FLAGS_PARAM = 'f';\n\n/**\n * Adds the client's feature flags to the connect URL: every flag this client\n * knows, turned on.\n */\nexport function setFeatureFlags(params: URLSearchParams): void {\n const flags = new Map(Object.values(FeatureFlag).map(flag => [flag, true]));\n params.set(FEATURE_FLAGS_PARAM, toBase64url(packBooleanMap(flags)));\n}\n\n/**\n * Reads the feature flags a client sent in the connect URL. Flags this server\n * doesn't know are dropped, and a malformed value counts as no flags, so newer\n * clients can always connect.\n */\nexport function getFeatureFlags(params: URLSearchParams): FeatureFlags {\n let bytes: Uint8Array;\n try {\n bytes = fromBase64url(params.get(FEATURE_FLAGS_PARAM) ?? '');\n } catch {\n return new Map();\n }\n return unpackBooleanMap(bytes, Object.values(FeatureFlag));\n}\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":";;;;;;;;;;;;;;;AAmBA,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;AAeD,IAAM,sBAAsB;;;;;AAM5B,SAAgB,gBAAgB,QAA+B;CAC7D,MAAM,QAAQ,IAAI,IAAI,OAAO,OAAO,yBAAW,EAAE,KAAI,SAAQ,CAAC,MAAM,IAAI,CAAC,CAAC;CAC1E,OAAO,IAAI,qBAAqB,YAAY,eAAe,KAAK,CAAC,CAAC;AACpE;;;;;;AAOA,SAAgB,gBAAgB,QAAuC;CACrE,IAAI;CACJ,IAAI;EACF,QAAQ,cAAc,OAAO,IAAI,mBAAmB,KAAK,EAAE;CAC7D,QAAQ;EACN,uBAAO,IAAI,IAAI;CACjB;CACA,OAAO,iBAAiB,OAAO,OAAO,OAAO,yBAAW,CAAC;AAC3D;AAEA,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"}
1
+ {"version":3,"file":"connect.js","names":[],"sources":["../../../../zero-protocol/src/connect.ts"],"sourcesContent":["import {fromBase64url, toBase64url} from '../../shared/src/base64.ts';\nimport * as v from '../../shared/src/valita.ts';\nimport {clientSchemaSchema} from './client-schema.ts';\nimport {deleteClientsBodySchema} from './delete-clients.ts';\nimport {ProtocolFlag, ProtocolFlags} from './protocol-flag.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\n// The connect URL parameter that carries the protocol flags: a bit set with\n// flag n at bit n % 8 of byte floor(n / 8), in unpadded base64url.\nconst PROTOCOL_FLAGS_PARAM = 'f';\n\n/**\n * Adds the client's protocol flags to the connect URL: every flag this client\n * knows.\n */\nexport function setProtocolFlags(params: URLSearchParams): void {\n const flags = Object.values(ProtocolFlag);\n const bytes = new Uint8Array((Math.max(...flags) >> 3) + 1);\n for (const flag of flags) {\n bytes[flag >> 3] |= 1 << (flag & 7);\n }\n params.set(PROTOCOL_FLAGS_PARAM, toBase64url(bytes));\n}\n\n/**\n * Reads the protocol flags a client sent in the connect URL. A flag it didn't\n * send means the server's default. Flags this server doesn't know are dropped,\n * and a malformed value counts as no flags, so newer clients can always\n * connect.\n */\nexport function getProtocolFlags(params: URLSearchParams): ProtocolFlags {\n let bytes: Uint8Array;\n try {\n bytes = fromBase64url(params.get(PROTOCOL_FLAGS_PARAM) ?? '');\n } catch {\n return new ProtocolFlags();\n }\n return new ProtocolFlags(\n Object.values(ProtocolFlag).filter(\n flag => (((bytes[flag >> 3] ?? 0) >> (flag & 7)) & 1) !== 0,\n ),\n );\n}\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":";;;;;;;;;;;;;;;AAeA,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;AASD,IAAM,uBAAuB;;;;;AAM7B,SAAgB,iBAAiB,QAA+B;CAC9D,MAAM,QAAQ,OAAO,OAAO,0BAAY;CACxC,MAAM,QAAQ,IAAI,YAAY,KAAK,IAAI,GAAG,KAAK,KAAK,KAAK,CAAC;CAC1D,KAAK,MAAM,QAAQ,OACjB,MAAM,QAAQ,MAAM,MAAM,OAAO;CAEnC,OAAO,IAAI,sBAAsB,YAAY,KAAK,CAAC;AACrD;;;;;;;AAQA,SAAgB,iBAAiB,QAAwC;CACvE,IAAI;CACJ,IAAI;EACF,QAAQ,cAAc,OAAO,IAAI,oBAAoB,KAAK,EAAE;CAC9D,QAAQ;EACN,OAAO,IAAI,cAAc;CAC3B;CACA,OAAO,IAAI,cACT,OAAO,OAAO,0BAAY,EAAE,QAC1B,WAAW,MAAM,QAAQ,MAAM,OAAO,OAAO,KAAM,OAAO,CAC5D,CACF;AACF;AAEA,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"}
@@ -13,7 +13,7 @@ import * as v from '../../shared/src/valita.ts';
13
13
  *
14
14
  * Through protocol version 51, the poke continues with zero to many
15
15
  * `poke-part` JSON messages. Starting in version 52, or when the client sends
16
- * the `PokeChunk` feature flag, it continues with zero to many binary
16
+ * the `PokeChunk` protocol flag, it continues with zero to many binary
17
17
  * `pokeChunk` messages instead. Each binary message starts with a message
18
18
  * type byte. Concatenating and decoding the payload after that byte produces a
19
19
  * PokePartBody array. pokeChunk boundaries have no semantic meaning.
@@ -273,12 +273,12 @@ export type PokeEndBody = v.Infer<typeof pokeEndBodySchema>;
273
273
  export declare const POKE_CHUNK_MESSAGE_TYPE = 0;
274
274
  /**
275
275
  * The first protocol version that receives binary poke chunks without the
276
- * `PokeChunk` feature flag.
276
+ * `PokeChunk` protocol flag.
277
277
  */
278
278
  export declare const POKE_CHUNK_PROTOCOL_VERSION = 52;
279
279
  /**
280
280
  * The last protocol version that receives JSON pokePart messages unless the
281
- * client sends the `PokeChunk` feature flag.
281
+ * client sends the `PokeChunk` protocol flag.
282
282
  */
283
283
  export declare const LAST_POKE_PART_PROTOCOL_VERSION = 51;
284
284
  /** A tagged binary poke chunk WebSocket message. */
@@ -18,7 +18,7 @@ import { nullableVersionSchema, versionSchema } from "./version.js";
18
18
  *
19
19
  * Through protocol version 51, the poke continues with zero to many
20
20
  * `poke-part` JSON messages. Starting in version 52, or when the client sends
21
- * the `PokeChunk` feature flag, it continues with zero to many binary
21
+ * the `PokeChunk` protocol flag, it continues with zero to many binary
22
22
  * `pokeChunk` messages instead. Each binary message starts with a message
23
23
  * type byte. Concatenating and decoding the payload after that byte produces a
24
24
  * PokePartBody array. pokeChunk boundaries have no semantic meaning.
@@ -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, or when the client sends\n * the `PokeChunk` feature flag, it continues with zero to many binary\n * `pokeChunk` messages instead. 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/**\n * The first protocol version that receives binary poke chunks without the\n * `PokeChunk` feature flag.\n */\nexport const POKE_CHUNK_PROTOCOL_VERSION = 52;\n\n/**\n * The last protocol version that receives JSON pokePart messages unless the\n * client sends the `PokeChunk` feature flag.\n */\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,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
+ {"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, or when the client sends\n * the `PokeChunk` protocol flag, it continues with zero to many binary\n * `pokeChunk` messages instead. 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/**\n * The first protocol version that receives binary poke chunks without the\n * `PokeChunk` protocol flag.\n */\nexport const POKE_CHUNK_PROTOCOL_VERSION = 52;\n\n/**\n * The last protocol version that receives JSON pokePart messages unless the\n * client sends the `PokeChunk` protocol flag.\n */\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,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"}
@@ -4,4 +4,4 @@
4
4
  */
5
5
  export declare const PokeChunk = 0;
6
6
  export type PokeChunk = typeof PokeChunk;
7
- //# sourceMappingURL=feature-flag-enum.d.ts.map
7
+ //# sourceMappingURL=protocol-flag-enum.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,7 @@
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
@@ -0,0 +1 @@
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":""}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"}
@@ -11,8 +11,8 @@
11
11
  * that clients and `zero-cache` can be updated and rolled back in either
12
12
  * order. Two rules keep that working:
13
13
  *
14
- * 1. A change an old server can ignore goes behind a feature flag (see
15
- * `feature-flag-enum.ts`) and the client keeps sending the same
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
16
  * {@link CLIENT_PROTOCOL_VERSION}. Old servers ignore flags they don't
17
17
  * know, so the client must keep supporting the old behavior.
18
18
  * 2. A change an old server can't ignore (e.g. new `AST` functionality)
@@ -25,7 +25,7 @@ export declare const PROTOCOL_VERSION = 52;
25
25
  *
26
26
  * Kept below {@link PROTOCOL_VERSION} so that clients can connect to servers
27
27
  * from earlier releases: 1.9 servers accept versions up to 51. Clients ask for
28
- * newer behavior with feature flags instead (rule 1 above). Only increase it
28
+ * newer behavior with protocol flags instead (rule 1 above). Only increase it
29
29
  * to a version that every supported server already accepts (rule 2 above).
30
30
  *
31
31
  * This number is also part of the client's local database name (Replicache
@@ -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 highest sync protocol version `zero-cache` accepts (i.e. the version\n * declared in the \"/sync/v{#}/connect\" URL). Clients send\n * {@link CLIENT_PROTOCOL_VERSION}.\n *\n * The protocol 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 client one release ahead of the server must still be able to connect, so\n * that clients and `zero-cache` can be updated and rolled back in either\n * order. Two rules keep that working:\n *\n * 1. A change an old server can ignore goes behind a feature flag (see\n * `feature-flag-enum.ts`) and the client keeps sending the same\n * {@link CLIENT_PROTOCOL_VERSION}. Old servers ignore flags they don't\n * know, so the client must keep supporting the old behavior.\n * 2. A change an old server can't ignore (e.g. new `AST` functionality)\n * increments `PROTOCOL_VERSION` one release before clients start sending\n * it in {@link CLIENT_PROTOCOL_VERSION}.\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\n// unless they send the `PokeChunk` feature flag. (1.10 canaries)\nexport const PROTOCOL_VERSION = 52;\n\n/**\n * The sync protocol version clients send in the \"/sync/v{#}/connect\" URL.\n *\n * Kept below {@link PROTOCOL_VERSION} so that clients can connect to servers\n * from earlier releases: 1.9 servers accept versions up to 51. Clients ask for\n * newer behavior with feature flags instead (rule 1 above). Only increase it\n * to a version that every supported server already accepts (rule 2 above).\n *\n * This number is also part of the client's local database name (Replicache\n * `schemaVersion`). Changing it opens a fresh local database, which drops\n * unsent mutations because Zero disables mutation recovery. Canary clients\n * already used 52 and 53 in their database names, so if the name changes it\n * must move above 53; reusing 52 or 53 would open a stale canary database.\n */\nexport const CLIENT_PROTOCOL_VERSION = 51;\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 <= CLIENT_PROTOCOL_VERSION &&\n CLIENT_PROTOCOL_VERSION <= PROTOCOL_VERSION,\n 'CLIENT_PROTOCOL_VERSION must be between MIN_SERVER_SUPPORTED_SYNC_PROTOCOL and PROTOCOL_VERSION',\n);\n"],"mappings":";AA0GA,OAAA,MAGE,iGACF"}
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 highest sync protocol version `zero-cache` accepts (i.e. the version\n * declared in the \"/sync/v{#}/connect\" URL). Clients send\n * {@link CLIENT_PROTOCOL_VERSION}.\n *\n * The protocol 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 client one release ahead of the server must still be able to connect, so\n * that clients and `zero-cache` can be updated and rolled back in either\n * order. Two rules keep that working:\n *\n * 1. A change an old server can ignore goes behind a protocol flag (see\n * `protocol-flag-enum.ts`) and the client keeps sending the same\n * {@link CLIENT_PROTOCOL_VERSION}. Old servers ignore flags they don't\n * know, so the client must keep supporting the old behavior.\n * 2. A change an old server can't ignore (e.g. new `AST` functionality)\n * increments `PROTOCOL_VERSION` one release before clients start sending\n * it in {@link CLIENT_PROTOCOL_VERSION}.\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\n// unless they send the `PokeChunk` protocol flag. (1.10 canaries)\nexport const PROTOCOL_VERSION = 52;\n\n/**\n * The sync protocol version clients send in the \"/sync/v{#}/connect\" URL.\n *\n * Kept below {@link PROTOCOL_VERSION} so that clients can connect to servers\n * from earlier releases: 1.9 servers accept versions up to 51. Clients ask for\n * newer behavior with protocol flags instead (rule 1 above). Only increase it\n * to a version that every supported server already accepts (rule 2 above).\n *\n * This number is also part of the client's local database name (Replicache\n * `schemaVersion`). Changing it opens a fresh local database, which drops\n * unsent mutations because Zero disables mutation recovery. Canary clients\n * already used 52 and 53 in their database names, so if the name changes it\n * must move above 53; reusing 52 or 53 would open a stale canary database.\n */\nexport const CLIENT_PROTOCOL_VERSION = 51;\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 <= CLIENT_PROTOCOL_VERSION &&\n CLIENT_PROTOCOL_VERSION <= PROTOCOL_VERSION,\n 'CLIENT_PROTOCOL_VERSION must be between MIN_SERVER_SUPPORTED_SYNC_PROTOCOL and PROTOCOL_VERSION',\n);\n"],"mappings":";AA0GA,OAAA,MAGE,iGACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rocicorp/zero",
3
- "version": "1.10.0-canary.25",
3
+ "version": "1.10.0-canary.26",
4
4
  "description": "Zero is a web framework for serverless web development.",
5
5
  "homepage": "https://zero.rocicorp.dev",
6
6
  "bugs": {
@@ -1,7 +0,0 @@
1
- export declare function packBooleanMap(map: ReadonlyMap<number, boolean>): Uint8Array;
2
- /**
3
- * Reads `keys` from `bytes`. Keys not in `keys` are ignored, as is a value bit
4
- * without its present bit.
5
- */
6
- export declare function unpackBooleanMap<K extends number>(bytes: Uint8Array, keys: Iterable<K>): Map<K, boolean>;
7
- //# sourceMappingURL=packed-boolean-map.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"packed-boolean-map.d.ts","sourceRoot":"","sources":["../../../../shared/src/packed-boolean-map.ts"],"names":[],"mappings":"AAkBA,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAc5E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAChB,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CASjB"}
@@ -1,36 +0,0 @@
1
- import { assert } from "./asserts.js";
2
- //#region ../shared/src/packed-boolean-map.ts
3
- var PRESENT = 1;
4
- var TRUE = 2;
5
- function byteIndex(key) {
6
- return key >> 2;
7
- }
8
- function shift(key) {
9
- return (key & 3) * 2;
10
- }
11
- function packBooleanMap(map) {
12
- let size = 0;
13
- for (const key of map.keys()) {
14
- assert(Number.isInteger(key) && key >= 0, "Key must be a non-negative integer");
15
- size = Math.max(size, byteIndex(key) + 1);
16
- }
17
- const bytes = new Uint8Array(size);
18
- for (const [key, value] of map) bytes[byteIndex(key)] |= (value ? PRESENT | TRUE : PRESENT) << shift(key);
19
- return bytes;
20
- }
21
- /**
22
- * Reads `keys` from `bytes`. Keys not in `keys` are ignored, as is a value bit
23
- * without its present bit.
24
- */
25
- function unpackBooleanMap(bytes, keys) {
26
- const map = /* @__PURE__ */ new Map();
27
- for (const key of keys) {
28
- const bits = (bytes[byteIndex(key)] ?? 0) >> shift(key);
29
- if (bits & PRESENT) map.set(key, (bits & TRUE) !== 0);
30
- }
31
- return map;
32
- }
33
- //#endregion
34
- export { packBooleanMap, unpackBooleanMap };
35
-
36
- //# sourceMappingURL=packed-boolean-map.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"packed-boolean-map.js","names":[],"sources":["../../../../shared/src/packed-boolean-map.ts"],"sourcesContent":["// Packs a map from small non-negative integers to booleans into bytes, two\n// bits per key, four keys per byte. Key n uses the two bits at 2 * (n % 4) in\n// byte floor(n / 4): the low bit says the key is present and the high bit is\n// its value. Unlike a bit set, this tells a missing key apart from `false`.\n\nimport {assert} from './asserts.ts';\n\nconst PRESENT = 0b01;\nconst TRUE = 0b10;\n\nfunction byteIndex(key: number): number {\n return key >> 2;\n}\n\nfunction shift(key: number): number {\n return (key & 3) * 2;\n}\n\nexport function packBooleanMap(map: ReadonlyMap<number, boolean>): Uint8Array {\n let size = 0;\n for (const key of map.keys()) {\n assert(\n Number.isInteger(key) && key >= 0,\n 'Key must be a non-negative integer',\n );\n size = Math.max(size, byteIndex(key) + 1);\n }\n const bytes = new Uint8Array(size);\n for (const [key, value] of map) {\n bytes[byteIndex(key)] |= (value ? PRESENT | TRUE : PRESENT) << shift(key);\n }\n return bytes;\n}\n\n/**\n * Reads `keys` from `bytes`. Keys not in `keys` are ignored, as is a value bit\n * without its present bit.\n */\nexport function unpackBooleanMap<K extends number>(\n bytes: Uint8Array,\n keys: Iterable<K>,\n): Map<K, boolean> {\n const map = new Map<K, boolean>();\n for (const key of keys) {\n const bits = (bytes[byteIndex(key)] ?? 0) >> shift(key);\n if (bits & PRESENT) {\n map.set(key, (bits & TRUE) !== 0);\n }\n }\n return map;\n}\n"],"mappings":";;AAOA,IAAM,UAAU;AAChB,IAAM,OAAO;AAEb,SAAS,UAAU,KAAqB;CACtC,OAAO,OAAO;AAChB;AAEA,SAAS,MAAM,KAAqB;CAClC,QAAQ,MAAM,KAAK;AACrB;AAEA,SAAgB,eAAe,KAA+C;CAC5E,IAAI,OAAO;CACX,KAAK,MAAM,OAAO,IAAI,KAAK,GAAG;EAC5B,OACE,OAAO,UAAU,GAAG,KAAK,OAAO,GAChC,oCACF;EACA,OAAO,KAAK,IAAI,MAAM,UAAU,GAAG,IAAI,CAAC;CAC1C;CACA,MAAM,QAAQ,IAAI,WAAW,IAAI;CACjC,KAAK,MAAM,CAAC,KAAK,UAAU,KACzB,MAAM,UAAU,GAAG,OAAO,QAAQ,UAAU,OAAO,YAAY,MAAM,GAAG;CAE1E,OAAO;AACT;;;;;AAMA,SAAgB,iBACd,OACA,MACiB;CACjB,MAAM,sBAAM,IAAI,IAAgB;CAChC,KAAK,MAAM,OAAO,MAAM;EACtB,MAAM,QAAQ,MAAM,UAAU,GAAG,MAAM,MAAM,MAAM,GAAG;EACtD,IAAI,OAAO,SACT,IAAI,IAAI,MAAM,OAAO,UAAU,CAAC;CAEpC;CACA,OAAO;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"feature-flag-enum.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/feature-flag-enum.ts"],"names":[],"mappings":"AAYA;;;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/feature-flag-enum.ts
3
- var feature_flag_enum_exports = /* @__PURE__ */ __exportAll({ PokeChunk: () => 0 });
4
- //#endregion
5
- export { feature_flag_enum_exports };
6
-
7
- //# sourceMappingURL=feature-flag-enum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feature-flag-enum.js","names":[],"sources":["../../../../zero-protocol/src/feature-flag-enum.ts"],"sourcesContent":["// Feature 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 (setFeatureFlags 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.\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,5 +0,0 @@
1
- import type { Enum } from '../../shared/src/enum.ts';
2
- import * as FeatureFlagEnum from './feature-flag-enum.ts';
3
- export { FeatureFlagEnum as FeatureFlag };
4
- export type FeatureFlag = Enum<typeof FeatureFlagEnum>;
5
- //# sourceMappingURL=feature-flag.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feature-flag.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/feature-flag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAC,eAAe,IAAI,WAAW,EAAC,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC"}