@comapeo/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +31 -0
  3. package/dist/blob-api.d.ts +92 -0
  4. package/dist/blob-api.d.ts.map +1 -0
  5. package/dist/blob-store/index.d.ts +163 -0
  6. package/dist/blob-store/index.d.ts.map +1 -0
  7. package/dist/blob-store/live-download.d.ts +107 -0
  8. package/dist/blob-store/live-download.d.ts.map +1 -0
  9. package/dist/config-import.d.ts +74 -0
  10. package/dist/config-import.d.ts.map +1 -0
  11. package/dist/constants.d.ts +14 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/core-manager/bitfield-rle.d.ts +25 -0
  14. package/dist/core-manager/bitfield-rle.d.ts.map +1 -0
  15. package/dist/core-manager/core-index.d.ts +56 -0
  16. package/dist/core-manager/core-index.d.ts.map +1 -0
  17. package/dist/core-manager/index.d.ts +125 -0
  18. package/dist/core-manager/index.d.ts.map +1 -0
  19. package/dist/core-manager/random-access-file-pool.d.ts +17 -0
  20. package/dist/core-manager/random-access-file-pool.d.ts.map +1 -0
  21. package/dist/core-manager/remote-bitfield.d.ts +146 -0
  22. package/dist/core-manager/remote-bitfield.d.ts.map +1 -0
  23. package/dist/core-ownership.d.ts +112 -0
  24. package/dist/core-ownership.d.ts.map +1 -0
  25. package/dist/datastore/index.d.ts +91 -0
  26. package/dist/datastore/index.d.ts.map +1 -0
  27. package/dist/datatype/index.d.ts +108 -0
  28. package/dist/discovery/local-discovery.d.ts +64 -0
  29. package/dist/discovery/local-discovery.d.ts.map +1 -0
  30. package/dist/errors.d.ts +4 -0
  31. package/dist/errors.d.ts.map +1 -0
  32. package/dist/fastify-controller.d.ts +27 -0
  33. package/dist/fastify-controller.d.ts.map +1 -0
  34. package/dist/fastify-plugins/blobs.d.ts +6 -0
  35. package/dist/fastify-plugins/blobs.d.ts.map +1 -0
  36. package/dist/fastify-plugins/constants.d.ts +3 -0
  37. package/dist/fastify-plugins/constants.d.ts.map +1 -0
  38. package/dist/fastify-plugins/icons.d.ts +6 -0
  39. package/dist/fastify-plugins/icons.d.ts.map +1 -0
  40. package/dist/fastify-plugins/maps/index.d.ts +11 -0
  41. package/dist/fastify-plugins/maps/index.d.ts.map +1 -0
  42. package/dist/fastify-plugins/maps/offline-fallback-map.d.ts +12 -0
  43. package/dist/fastify-plugins/maps/offline-fallback-map.d.ts.map +1 -0
  44. package/dist/fastify-plugins/maps/static-maps.d.ts +11 -0
  45. package/dist/fastify-plugins/maps/static-maps.d.ts.map +1 -0
  46. package/dist/fastify-plugins/utils.d.ts +23 -0
  47. package/dist/fastify-plugins/utils.d.ts.map +1 -0
  48. package/dist/generated/extensions.d.ts +44 -0
  49. package/dist/generated/extensions.d.ts.map +1 -0
  50. package/dist/generated/keys.d.ts +36 -0
  51. package/dist/generated/keys.d.ts.map +1 -0
  52. package/dist/generated/rpc.d.ts +87 -0
  53. package/dist/generated/rpc.d.ts.map +1 -0
  54. package/dist/icon-api.d.ts +109 -0
  55. package/dist/icon-api.d.ts.map +1 -0
  56. package/dist/index-writer/index.d.ts +51 -0
  57. package/dist/index-writer/index.d.ts.map +1 -0
  58. package/dist/index.d.ts +14 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/invite-api.d.ts +70 -0
  61. package/dist/invite-api.d.ts.map +1 -0
  62. package/dist/lib/hashmap.d.ts +62 -0
  63. package/dist/lib/hashmap.d.ts.map +1 -0
  64. package/dist/lib/hypercore-helpers.d.ts +6 -0
  65. package/dist/lib/hypercore-helpers.d.ts.map +1 -0
  66. package/dist/lib/noise-secret-stream-helpers.d.ts +45 -0
  67. package/dist/lib/noise-secret-stream-helpers.d.ts.map +1 -0
  68. package/dist/lib/ponyfills.d.ts +10 -0
  69. package/dist/lib/ponyfills.d.ts.map +1 -0
  70. package/dist/lib/string.d.ts +2 -0
  71. package/dist/lib/string.d.ts.map +1 -0
  72. package/dist/lib/timing-safe-equal.d.ts +15 -0
  73. package/dist/lib/timing-safe-equal.d.ts.map +1 -0
  74. package/dist/local-peers.d.ts +151 -0
  75. package/dist/local-peers.d.ts.map +1 -0
  76. package/dist/logger.d.ts +32 -0
  77. package/dist/logger.d.ts.map +1 -0
  78. package/dist/mapeo-manager.d.ts +178 -0
  79. package/dist/mapeo-manager.d.ts.map +1 -0
  80. package/dist/mapeo-project.d.ts +3233 -0
  81. package/dist/mapeo-project.d.ts.map +1 -0
  82. package/dist/member-api.d.ts +114 -0
  83. package/dist/member-api.d.ts.map +1 -0
  84. package/dist/roles.d.ts +157 -0
  85. package/dist/roles.d.ts.map +1 -0
  86. package/dist/schema/client.d.ts +284 -0
  87. package/dist/schema/client.d.ts.map +1 -0
  88. package/dist/schema/project.d.ts +1812 -0
  89. package/dist/schema/project.d.ts.map +1 -0
  90. package/dist/schema/schema-to-drizzle.d.ts +20 -0
  91. package/dist/schema/schema-to-drizzle.d.ts.map +1 -0
  92. package/dist/schema/types.d.ts +98 -0
  93. package/dist/schema/types.d.ts.map +1 -0
  94. package/dist/schema/utils.d.ts +55 -0
  95. package/dist/schema/utils.d.ts.map +1 -0
  96. package/dist/sync/core-sync-state.d.ts +252 -0
  97. package/dist/sync/core-sync-state.d.ts.map +1 -0
  98. package/dist/sync/namespace-sync-state.d.ts +47 -0
  99. package/dist/sync/namespace-sync-state.d.ts.map +1 -0
  100. package/dist/sync/peer-sync-controller.d.ts +44 -0
  101. package/dist/sync/peer-sync-controller.d.ts.map +1 -0
  102. package/dist/sync/sync-api.d.ts +158 -0
  103. package/dist/sync/sync-api.d.ts.map +1 -0
  104. package/dist/sync/sync-state.d.ts +40 -0
  105. package/dist/sync/sync-state.d.ts.map +1 -0
  106. package/dist/translation-api.d.ts +288 -0
  107. package/dist/translation-api.d.ts.map +1 -0
  108. package/dist/types.d.ts +115 -0
  109. package/dist/types.d.ts.map +1 -0
  110. package/dist/utils.d.ts +115 -0
  111. package/dist/utils.d.ts.map +1 -0
  112. package/dist/utils_types.d.ts +14 -0
  113. package/drizzle/client/0000_bumpy_carnage.sql +33 -0
  114. package/drizzle/client/meta/0000_snapshot.json +199 -0
  115. package/drizzle/client/meta/_journal.json +13 -0
  116. package/drizzle/project/0000_spooky_lady_ursula.sql +192 -0
  117. package/drizzle/project/meta/0000_snapshot.json +1137 -0
  118. package/drizzle/project/meta/_journal.json +13 -0
  119. package/package.json +202 -0
  120. package/src/blob-api.js +139 -0
  121. package/src/blob-store/index.js +325 -0
  122. package/src/blob-store/live-download.js +373 -0
  123. package/src/config-import.js +604 -0
  124. package/src/constants.js +34 -0
  125. package/src/core-manager/bitfield-rle.js +235 -0
  126. package/src/core-manager/core-index.js +87 -0
  127. package/src/core-manager/index.js +504 -0
  128. package/src/core-manager/random-access-file-pool.js +30 -0
  129. package/src/core-manager/remote-bitfield.js +416 -0
  130. package/src/core-ownership.js +235 -0
  131. package/src/datastore/README.md +46 -0
  132. package/src/datastore/index.js +234 -0
  133. package/src/datatype/README.md +33 -0
  134. package/src/datatype/index.d.ts +108 -0
  135. package/src/datatype/index.js +358 -0
  136. package/src/discovery/local-discovery.js +303 -0
  137. package/src/errors.js +5 -0
  138. package/src/fastify-controller.js +84 -0
  139. package/src/fastify-plugins/blobs.js +139 -0
  140. package/src/fastify-plugins/constants.js +5 -0
  141. package/src/fastify-plugins/icons.js +158 -0
  142. package/src/fastify-plugins/maps/index.js +173 -0
  143. package/src/fastify-plugins/maps/offline-fallback-map.js +114 -0
  144. package/src/fastify-plugins/maps/static-maps.js +271 -0
  145. package/src/fastify-plugins/utils.js +52 -0
  146. package/src/generated/README.md +3 -0
  147. package/src/generated/extensions.d.ts +44 -0
  148. package/src/generated/extensions.js +196 -0
  149. package/src/generated/extensions.ts +237 -0
  150. package/src/generated/keys.d.ts +36 -0
  151. package/src/generated/keys.js +148 -0
  152. package/src/generated/keys.ts +185 -0
  153. package/src/generated/rpc.d.ts +87 -0
  154. package/src/generated/rpc.js +389 -0
  155. package/src/generated/rpc.ts +463 -0
  156. package/src/icon-api.js +282 -0
  157. package/src/index-writer/README.md +38 -0
  158. package/src/index-writer/index.js +124 -0
  159. package/src/index.js +16 -0
  160. package/src/invite-api.js +450 -0
  161. package/src/lib/hashmap.js +91 -0
  162. package/src/lib/hypercore-helpers.js +18 -0
  163. package/src/lib/noise-secret-stream-helpers.js +37 -0
  164. package/src/lib/ponyfills.js +25 -0
  165. package/src/lib/string.js +7 -0
  166. package/src/lib/timing-safe-equal.js +34 -0
  167. package/src/local-peers.js +737 -0
  168. package/src/logger.js +99 -0
  169. package/src/mapeo-manager.js +914 -0
  170. package/src/mapeo-project.js +980 -0
  171. package/src/member-api.js +319 -0
  172. package/src/roles.js +412 -0
  173. package/src/schema/client.js +55 -0
  174. package/src/schema/project.js +44 -0
  175. package/src/schema/schema-to-drizzle.js +118 -0
  176. package/src/schema/types.ts +153 -0
  177. package/src/schema/utils.js +51 -0
  178. package/src/sync/core-sync-state.js +440 -0
  179. package/src/sync/namespace-sync-state.js +193 -0
  180. package/src/sync/peer-sync-controller.js +332 -0
  181. package/src/sync/sync-api.js +588 -0
  182. package/src/sync/sync-state.js +63 -0
  183. package/src/translation-api.js +141 -0
  184. package/src/types.ts +149 -0
  185. package/src/utils.js +210 -0
  186. package/src/utils_types.d.ts +14 -0
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @param {String|Buffer} id
3
+ * @returns {Buffer | Uint8Array}
4
+ */
5
+ export function idToKey(id: string | Buffer): Buffer | Uint8Array;
6
+ /**
7
+ *
8
+ * @param {Buffer|String} key
9
+ * @returns {String}
10
+ */
11
+ export function keyToId(key: Buffer | string): string;
12
+ /**
13
+ * @param {String} version
14
+ * @returns {{coreId: String, blockIndex: Number}}
15
+ */
16
+ export function parseVersion(version: string): {
17
+ coreId: string;
18
+ blockIndex: number;
19
+ };
20
+ /**
21
+ * @returns {void}
22
+ */
23
+ export function noop(): void;
24
+ /**
25
+ * @param {unknown} condition
26
+ * @param {string} message
27
+ * @returns {asserts condition}
28
+ */
29
+ export function assert(condition: unknown, message: string): asserts condition;
30
+ /**
31
+ * Return a function that itself returns whether a value is part of the set.
32
+ *
33
+ * Similar to binding `Set.prototype.has`, but (1) is shorter (2) refines the type.
34
+ *
35
+ * @template T
36
+ * @param {Readonly<Set<T>>} set
37
+ * @example
38
+ * const mySet = new Set([1, 2, 3])
39
+ * const isInMySet = setHas(mySet)
40
+ *
41
+ * console.log(isInMySet(2))
42
+ * // => true
43
+ */
44
+ export function setHas<T>(set: Readonly<Set<T>>): (value: unknown) => value is T;
45
+ /**
46
+ * @template T
47
+ * @param {undefined | T} value
48
+ * @returns {value is T}
49
+ */
50
+ export function isDefined<T>(value: undefined | T): value is T;
51
+ /**
52
+ * When reading from SQLite, any optional properties are set to `null`. This
53
+ * converts `null` back to `undefined` to match the input types (e.g. the types
54
+ * defined in @comapeo/schema)
55
+ * @template {{}} T
56
+ * @param {T} obj
57
+ * @returns {import('./types.js').NullableToOptional<T>}
58
+ */
59
+ export function deNullify<T extends {}>(obj: T): import("./types.js").NullableToOptional<T>;
60
+ /**
61
+ * @template {import('@comapeo/schema').MapeoDoc & { forks?: string[] }} T
62
+ * @param {T} doc
63
+ * @returns {Omit<T, 'docId' | 'versionId' | 'originalVersionId' | 'links' | 'forks' | 'createdAt' | 'updatedAt' | 'deleted'>}
64
+ */
65
+ export function valueOf<T extends import("@comapeo/schema").MapeoDoc & {
66
+ forks?: string[];
67
+ }>(doc: T): Omit<T, "docId" | "versionId" | "originalVersionId" | "links" | "forks" | "createdAt" | "updatedAt" | "deleted">;
68
+ /**
69
+ * Create an internal ID from a project key
70
+ * @param {Buffer} projectKey
71
+ * @returns {string}
72
+ */
73
+ export function projectKeyToId(projectKey: Buffer): string;
74
+ /**
75
+ * Create a public ID from a project key
76
+ * @param {Buffer} projectKey
77
+ * @returns {string}
78
+ */
79
+ export function projectKeyToPublicId(projectKey: Buffer): string;
80
+ /**
81
+ * Generate an invite ID from a project key
82
+ * @param {Readonly<Buffer>} projectKey
83
+ * @returns {Buffer}
84
+ */
85
+ export function projectKeyToProjectInviteId(projectKey: Readonly<Buffer>): Buffer;
86
+ /**
87
+ * @param {string} projectId Project internal ID
88
+ * @returns {Buffer} 24-byte nonce (same length as sodium.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES)
89
+ */
90
+ export function projectIdToNonce(projectId: string): Buffer;
91
+ /**
92
+ * @param {import('@mapeo/crypto').KeyManager} keyManager
93
+ * @returns {string}
94
+ */
95
+ export function getDeviceId(keyManager: import("@mapeo/crypto/dist/key-manager.js")): string;
96
+ /**
97
+ * Small helper to create a typed map
98
+ *
99
+ * @template {string} K
100
+ * @template {any} V
101
+ * @param {ReadonlyArray<K>} keys
102
+ * @param {V} value
103
+ * @returns {Record<K, V extends () => infer T ? T : V>} */
104
+ export function createMap<K extends string, V extends unknown>(keys: ReadonlyArray<K>, value: V): Record<K, V extends () => infer T ? T : V>;
105
+ /**
106
+ * create a sha256 hash of an object using json-stable-stringify for deterministic results
107
+ * @param {Object} obj
108
+ * @returns {String} hash of the object
109
+ */
110
+ export function hashObject(obj: Object): string;
111
+ export class ExhaustivenessError extends Error {
112
+ /** @param {never} value */
113
+ constructor(value: never);
114
+ }
115
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH,4BAHW,SAAO,MAAM,GACX,MAAM,GAAG,UAAU,CAQ/B;AAED;;;;GAIG;AACH,6BAHW,MAAM,SAAO,UASvB;AAED;;;GAGG;AACH,+CAFa;IAAC,MAAM,SAAS;IAAC,UAAU,SAAQ;CAAC,CAQhD;AAUD;;GAEG;AACH,wBAFa,IAAI,CAEQ;AAEzB;;;;GAIG;AACH,kCAJW,OAAO,WACP,MAAM,GACJ,QAAQ,SAAS,CAI7B;AAED;;;;;;;;;;;;;GAaG;AACH,uBATa,CAAC,OACH,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAUd,OAAO,KACL,KAAK,IAAI,CAAC,CAGxB;AAED;;;;GAIG;AACH,0BAJa,CAAC,SACH,SAAS,GAAG,CAAC,GACX,KAAK,IAAI,CAAC,CAItB;AAED;;;;;;;GAOG;AAEH,0BALkB,CAAC,SAAN,EAAI,OACN,CAAC,GACC,OAAO,YAAY,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAUtD;AAED;;;;GAIG;AACH,wBAJyE,CAAC,SAA5D,OAAO,iBAAiB,EAAE,QAAQ,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAAG,OAC7D,CAAC,GACC,IAAI,CAAC,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC,CAiB5H;AAED;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,iDAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,wDAHW,QAAQ,CAAC,MAAM,CAAC,GACd,MAAM,CAMlB;AAED;;;GAGG;AACH,4CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;GAGG;AACH,wCAHW,2CAAkC,GAChC,MAAM,CAIlB;AAED;;;;;;;2DAO2D;AAC3D,0BALsB,CAAC,SAAV,MAAQ,EACF,CAAC,wBACT,aAAa,CAAC,CAAC,CAAC,SAChB,CAAC,GACC,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAOtD;AAED;;;;GAIG;AACH,gCAHW,MAAM,UAQhB;AApKD;IACE,2BAA2B;IAC3B,mBADY,KAAK,EAIhB;CACF"}
@@ -0,0 +1,14 @@
1
+ import type { TypedEmitter } from 'tiny-typed-emitter'
2
+
3
+ export type TypedEvents<T extends TypedEmitter<any>> = T extends TypedEmitter<
4
+ infer Result
5
+ >
6
+ ? Result
7
+ : never
8
+
9
+ export type TypedEventsFor<T extends TypedEmitter<any>> = keyof TypedEvents<T>
10
+
11
+ export type TypedEventArgs<
12
+ Emitter extends TypedEmitter<any>,
13
+ Event extends TypedEventsFor<Emitter>
14
+ > = Parameters<TypedEvents<Emitter>[Event]>
@@ -0,0 +1,33 @@
1
+ CREATE TABLE `localDeviceInfo` (
2
+ `deviceId` text NOT NULL,
3
+ `deviceInfo` text NOT NULL
4
+ );
5
+ --> statement-breakpoint
6
+ CREATE TABLE `projectSettings_backlink` (
7
+ `versionId` text PRIMARY KEY NOT NULL
8
+ );
9
+ --> statement-breakpoint
10
+ CREATE TABLE `projectKeys` (
11
+ `projectId` text PRIMARY KEY NOT NULL,
12
+ `projectPublicId` text NOT NULL,
13
+ `projectInviteId` blob NOT NULL,
14
+ `keysCipher` blob NOT NULL,
15
+ `projectInfo` text DEFAULT '{}' NOT NULL
16
+ );
17
+ --> statement-breakpoint
18
+ CREATE TABLE `projectSettings` (
19
+ `docId` text PRIMARY KEY NOT NULL,
20
+ `versionId` text NOT NULL,
21
+ `originalVersionId` text NOT NULL,
22
+ `schemaName` text NOT NULL,
23
+ `createdAt` text NOT NULL,
24
+ `updatedAt` text NOT NULL,
25
+ `links` text NOT NULL,
26
+ `deleted` integer NOT NULL,
27
+ `name` text,
28
+ `defaultPresets` text,
29
+ `configMetadata` text,
30
+ `forks` text NOT NULL
31
+ );
32
+ --> statement-breakpoint
33
+ CREATE UNIQUE INDEX `localDeviceInfo_deviceId_unique` ON `localDeviceInfo` (`deviceId`);
@@ -0,0 +1,199 @@
1
+ {
2
+ "version": "5",
3
+ "dialect": "sqlite",
4
+ "id": "e75103ab-bbcb-4ca9-a0c4-2d9095b63add",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "localDeviceInfo": {
8
+ "name": "localDeviceInfo",
9
+ "columns": {
10
+ "deviceId": {
11
+ "name": "deviceId",
12
+ "type": "text",
13
+ "primaryKey": false,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "deviceInfo": {
18
+ "name": "deviceInfo",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ }
24
+ },
25
+ "indexes": {
26
+ "localDeviceInfo_deviceId_unique": {
27
+ "name": "localDeviceInfo_deviceId_unique",
28
+ "columns": [
29
+ "deviceId"
30
+ ],
31
+ "isUnique": true
32
+ }
33
+ },
34
+ "foreignKeys": {},
35
+ "compositePrimaryKeys": {},
36
+ "uniqueConstraints": {}
37
+ },
38
+ "projectSettings_backlink": {
39
+ "name": "projectSettings_backlink",
40
+ "columns": {
41
+ "versionId": {
42
+ "name": "versionId",
43
+ "type": "text",
44
+ "primaryKey": true,
45
+ "notNull": true,
46
+ "autoincrement": false
47
+ }
48
+ },
49
+ "indexes": {},
50
+ "foreignKeys": {},
51
+ "compositePrimaryKeys": {},
52
+ "uniqueConstraints": {}
53
+ },
54
+ "projectKeys": {
55
+ "name": "projectKeys",
56
+ "columns": {
57
+ "projectId": {
58
+ "name": "projectId",
59
+ "type": "text",
60
+ "primaryKey": true,
61
+ "notNull": true,
62
+ "autoincrement": false
63
+ },
64
+ "projectPublicId": {
65
+ "name": "projectPublicId",
66
+ "type": "text",
67
+ "primaryKey": false,
68
+ "notNull": true,
69
+ "autoincrement": false
70
+ },
71
+ "projectInviteId": {
72
+ "name": "projectInviteId",
73
+ "type": "blob",
74
+ "primaryKey": false,
75
+ "notNull": true,
76
+ "autoincrement": false
77
+ },
78
+ "keysCipher": {
79
+ "name": "keysCipher",
80
+ "type": "blob",
81
+ "primaryKey": false,
82
+ "notNull": true,
83
+ "autoincrement": false
84
+ },
85
+ "projectInfo": {
86
+ "name": "projectInfo",
87
+ "type": "text",
88
+ "primaryKey": false,
89
+ "notNull": true,
90
+ "autoincrement": false,
91
+ "default": "'{}'"
92
+ }
93
+ },
94
+ "indexes": {},
95
+ "foreignKeys": {},
96
+ "compositePrimaryKeys": {},
97
+ "uniqueConstraints": {}
98
+ },
99
+ "projectSettings": {
100
+ "name": "projectSettings",
101
+ "columns": {
102
+ "docId": {
103
+ "name": "docId",
104
+ "type": "text",
105
+ "primaryKey": true,
106
+ "notNull": true,
107
+ "autoincrement": false
108
+ },
109
+ "versionId": {
110
+ "name": "versionId",
111
+ "type": "text",
112
+ "primaryKey": false,
113
+ "notNull": true,
114
+ "autoincrement": false
115
+ },
116
+ "originalVersionId": {
117
+ "name": "originalVersionId",
118
+ "type": "text",
119
+ "primaryKey": false,
120
+ "notNull": true,
121
+ "autoincrement": false
122
+ },
123
+ "schemaName": {
124
+ "name": "schemaName",
125
+ "type": "text",
126
+ "primaryKey": false,
127
+ "notNull": true,
128
+ "autoincrement": false
129
+ },
130
+ "createdAt": {
131
+ "name": "createdAt",
132
+ "type": "text",
133
+ "primaryKey": false,
134
+ "notNull": true,
135
+ "autoincrement": false
136
+ },
137
+ "updatedAt": {
138
+ "name": "updatedAt",
139
+ "type": "text",
140
+ "primaryKey": false,
141
+ "notNull": true,
142
+ "autoincrement": false
143
+ },
144
+ "links": {
145
+ "name": "links",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": true,
149
+ "autoincrement": false
150
+ },
151
+ "deleted": {
152
+ "name": "deleted",
153
+ "type": "integer",
154
+ "primaryKey": false,
155
+ "notNull": true,
156
+ "autoincrement": false
157
+ },
158
+ "name": {
159
+ "name": "name",
160
+ "type": "text",
161
+ "primaryKey": false,
162
+ "notNull": false,
163
+ "autoincrement": false
164
+ },
165
+ "defaultPresets": {
166
+ "name": "defaultPresets",
167
+ "type": "text",
168
+ "primaryKey": false,
169
+ "notNull": false,
170
+ "autoincrement": false
171
+ },
172
+ "configMetadata": {
173
+ "name": "configMetadata",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": false,
177
+ "autoincrement": false
178
+ },
179
+ "forks": {
180
+ "name": "forks",
181
+ "type": "text",
182
+ "primaryKey": false,
183
+ "notNull": true,
184
+ "autoincrement": false
185
+ }
186
+ },
187
+ "indexes": {},
188
+ "foreignKeys": {},
189
+ "compositePrimaryKeys": {},
190
+ "uniqueConstraints": {}
191
+ }
192
+ },
193
+ "enums": {},
194
+ "_meta": {
195
+ "schemas": {},
196
+ "tables": {},
197
+ "columns": {}
198
+ }
199
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "5",
3
+ "dialect": "sqlite",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "5",
8
+ "when": 1726514276007,
9
+ "tag": "0000_bumpy_carnage",
10
+ "breakpoints": true
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,192 @@
1
+ CREATE TABLE `coreOwnership_backlink` (
2
+ `versionId` text PRIMARY KEY NOT NULL
3
+ );
4
+ --> statement-breakpoint
5
+ CREATE TABLE `coreOwnership` (
6
+ `docId` text PRIMARY KEY NOT NULL,
7
+ `versionId` text NOT NULL,
8
+ `originalVersionId` text NOT NULL,
9
+ `schemaName` text NOT NULL,
10
+ `createdAt` text NOT NULL,
11
+ `updatedAt` text NOT NULL,
12
+ `links` text NOT NULL,
13
+ `deleted` integer NOT NULL,
14
+ `authCoreId` text NOT NULL,
15
+ `configCoreId` text NOT NULL,
16
+ `dataCoreId` text NOT NULL,
17
+ `blobCoreId` text NOT NULL,
18
+ `blobIndexCoreId` text NOT NULL,
19
+ `forks` text NOT NULL
20
+ );
21
+ --> statement-breakpoint
22
+ CREATE TABLE `cores` (
23
+ `publicKey` blob NOT NULL,
24
+ `namespace` text NOT NULL
25
+ );
26
+ --> statement-breakpoint
27
+ CREATE TABLE `deviceInfo_backlink` (
28
+ `versionId` text PRIMARY KEY NOT NULL
29
+ );
30
+ --> statement-breakpoint
31
+ CREATE TABLE `deviceInfo` (
32
+ `docId` text PRIMARY KEY NOT NULL,
33
+ `versionId` text NOT NULL,
34
+ `originalVersionId` text NOT NULL,
35
+ `schemaName` text NOT NULL,
36
+ `createdAt` text NOT NULL,
37
+ `updatedAt` text NOT NULL,
38
+ `links` text NOT NULL,
39
+ `deleted` integer NOT NULL,
40
+ `name` text NOT NULL,
41
+ `deviceType` text NOT NULL,
42
+ `forks` text NOT NULL
43
+ );
44
+ --> statement-breakpoint
45
+ CREATE TABLE `field_backlink` (
46
+ `versionId` text PRIMARY KEY NOT NULL
47
+ );
48
+ --> statement-breakpoint
49
+ CREATE TABLE `field` (
50
+ `docId` text PRIMARY KEY NOT NULL,
51
+ `versionId` text NOT NULL,
52
+ `originalVersionId` text NOT NULL,
53
+ `schemaName` text NOT NULL,
54
+ `createdAt` text NOT NULL,
55
+ `updatedAt` text NOT NULL,
56
+ `links` text NOT NULL,
57
+ `deleted` integer NOT NULL,
58
+ `tagKey` text NOT NULL,
59
+ `type` text NOT NULL,
60
+ `label` text NOT NULL,
61
+ `appearance` text,
62
+ `snakeCase` integer,
63
+ `options` text,
64
+ `universal` integer,
65
+ `placeholder` text,
66
+ `helperText` text,
67
+ `forks` text NOT NULL
68
+ );
69
+ --> statement-breakpoint
70
+ CREATE TABLE `icon_backlink` (
71
+ `versionId` text PRIMARY KEY NOT NULL
72
+ );
73
+ --> statement-breakpoint
74
+ CREATE TABLE `icon` (
75
+ `docId` text PRIMARY KEY NOT NULL,
76
+ `versionId` text NOT NULL,
77
+ `originalVersionId` text NOT NULL,
78
+ `schemaName` text NOT NULL,
79
+ `createdAt` text NOT NULL,
80
+ `updatedAt` text NOT NULL,
81
+ `links` text NOT NULL,
82
+ `deleted` integer NOT NULL,
83
+ `name` text NOT NULL,
84
+ `variants` text NOT NULL,
85
+ `forks` text NOT NULL
86
+ );
87
+ --> statement-breakpoint
88
+ CREATE TABLE `observation_backlink` (
89
+ `versionId` text PRIMARY KEY NOT NULL
90
+ );
91
+ --> statement-breakpoint
92
+ CREATE TABLE `observation` (
93
+ `docId` text PRIMARY KEY NOT NULL,
94
+ `versionId` text NOT NULL,
95
+ `originalVersionId` text NOT NULL,
96
+ `schemaName` text NOT NULL,
97
+ `createdAt` text NOT NULL,
98
+ `updatedAt` text NOT NULL,
99
+ `links` text NOT NULL,
100
+ `deleted` integer NOT NULL,
101
+ `lat` real,
102
+ `lon` real,
103
+ `attachments` text NOT NULL,
104
+ `tags` text NOT NULL,
105
+ `metadata` text,
106
+ `presetRef` text,
107
+ `forks` text NOT NULL
108
+ );
109
+ --> statement-breakpoint
110
+ CREATE TABLE `preset_backlink` (
111
+ `versionId` text PRIMARY KEY NOT NULL
112
+ );
113
+ --> statement-breakpoint
114
+ CREATE TABLE `preset` (
115
+ `docId` text PRIMARY KEY NOT NULL,
116
+ `versionId` text NOT NULL,
117
+ `originalVersionId` text NOT NULL,
118
+ `schemaName` text NOT NULL,
119
+ `createdAt` text NOT NULL,
120
+ `updatedAt` text NOT NULL,
121
+ `links` text NOT NULL,
122
+ `deleted` integer NOT NULL,
123
+ `name` text NOT NULL,
124
+ `geometry` text NOT NULL,
125
+ `tags` text NOT NULL,
126
+ `addTags` text NOT NULL,
127
+ `removeTags` text NOT NULL,
128
+ `fieldRefs` text NOT NULL,
129
+ `iconRef` text,
130
+ `terms` text NOT NULL,
131
+ `color` text,
132
+ `forks` text NOT NULL
133
+ );
134
+ --> statement-breakpoint
135
+ CREATE TABLE `role_backlink` (
136
+ `versionId` text PRIMARY KEY NOT NULL
137
+ );
138
+ --> statement-breakpoint
139
+ CREATE TABLE `role` (
140
+ `docId` text PRIMARY KEY NOT NULL,
141
+ `versionId` text NOT NULL,
142
+ `originalVersionId` text NOT NULL,
143
+ `schemaName` text NOT NULL,
144
+ `createdAt` text NOT NULL,
145
+ `updatedAt` text NOT NULL,
146
+ `links` text NOT NULL,
147
+ `deleted` integer NOT NULL,
148
+ `roleId` text NOT NULL,
149
+ `fromIndex` integer NOT NULL,
150
+ `forks` text NOT NULL
151
+ );
152
+ --> statement-breakpoint
153
+ CREATE TABLE `track_backlink` (
154
+ `versionId` text PRIMARY KEY NOT NULL
155
+ );
156
+ --> statement-breakpoint
157
+ CREATE TABLE `track` (
158
+ `docId` text PRIMARY KEY NOT NULL,
159
+ `versionId` text NOT NULL,
160
+ `originalVersionId` text NOT NULL,
161
+ `schemaName` text NOT NULL,
162
+ `createdAt` text NOT NULL,
163
+ `updatedAt` text NOT NULL,
164
+ `links` text NOT NULL,
165
+ `deleted` integer NOT NULL,
166
+ `locations` text NOT NULL,
167
+ `observationRefs` text NOT NULL,
168
+ `tags` text NOT NULL,
169
+ `forks` text NOT NULL
170
+ );
171
+ --> statement-breakpoint
172
+ CREATE TABLE `translation_backlink` (
173
+ `versionId` text PRIMARY KEY NOT NULL
174
+ );
175
+ --> statement-breakpoint
176
+ CREATE TABLE `translation` (
177
+ `docId` text PRIMARY KEY NOT NULL,
178
+ `versionId` text NOT NULL,
179
+ `originalVersionId` text NOT NULL,
180
+ `schemaName` text NOT NULL,
181
+ `createdAt` text NOT NULL,
182
+ `updatedAt` text NOT NULL,
183
+ `links` text NOT NULL,
184
+ `deleted` integer NOT NULL,
185
+ `docRef` text NOT NULL,
186
+ `docRefType` text NOT NULL,
187
+ `propertyRef` text NOT NULL,
188
+ `languageCode` text NOT NULL,
189
+ `regionCode` text,
190
+ `message` text NOT NULL,
191
+ `forks` text NOT NULL
192
+ );