Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update @comapeo/schema to 1.2.0, adding alerts and server #805

Merged
merged 27 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c826f31
add `remoteDetectionAlert` dataType
Sep 2, 2024
5906c49
add `remoteDetectionAlert` to data namespace
Sep 3, 2024
0b3f2be
add crud test for `remoteDetectionAlert`
Sep 3, 2024
e2f0e68
Merge branch 'main' of github.com:digidem/mapeo-core-next into feat/a…
Sep 3, 2024
068ef5a
Merge branch 'main' of github.com:digidem/mapeo-core-next into feat/a…
Sep 3, 2024
1357bb7
Merge branch 'main' of github.com:digidem/comapeo-core into feat/addR…
Sep 26, 2024
eedd446
remove old mapeo-schema
Sep 26, 2024
a7a3ecd
udpate 'remoteDetectionAlert' fixture with geometry
Sep 26, 2024
b1fad02
Merge branch 'main' of github.com:digidem/comapeo-core into feat/addR…
Sep 26, 2024
09fcce4
Merge branch 'main' of github.com:digidem/comapeo-core into feat/addR…
Sep 30, 2024
495198a
re-generate db, update local comapeo/schema
Sep 30, 2024
339a8bb
Merge branch 'main' of github.com:digidem/comapeo-core into feat/addR…
Oct 1, 2024
8546b17
Minor: reorder things to be alphabetical
EvanHahn Oct 1, 2024
95095b1
Fix type error
EvanHahn Oct 1, 2024
0763ce6
Fix test because mapeo-mock-data lacked support
EvanHahn Oct 1, 2024
916da66
migration on drizzle project
Oct 2, 2024
b12de1c
Merge branch 'main' of github.com:digidem/comapeo-core into feat/addR…
Oct 2, 2024
44b1f9c
Merge branch 'main' of github.com:digidem/comapeo-core into feat/addR…
Oct 3, 2024
95dadfc
use published version of comapeo/schema, use local build of mock-data
Oct 10, 2024
91c5faf
update mock-data with published version
Oct 14, 2024
67f3a88
remove locally built schema and mock-data
Oct 14, 2024
48fcacd
Merge branch 'main' of github.com:digidem/comapeo-core into feat/addR…
Oct 14, 2024
9e6262c
update schema after wrong merge
Oct 14, 2024
fdd8f04
Merge branch 'main' into feat/addRemoteDetectionAlertDataType
EvanHahn Oct 24, 2024
2d54b34
Update to schema 1.2.0, rebuild migrations
EvanHahn Oct 24, 2024
8511d54
mapeo-mock-data now has remoteDetectionAlert support
EvanHahn Oct 24, 2024
cf4e6a3
Remove unnecessary fixture helper
EvanHahn Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drizzle/client/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "sqlite",
"id": "efbe54ff-5195-4127-b634-76e303657276",
"id": "1709ba00-6a2c-4811-a3fd-8cc8b2901b12",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"localDeviceInfo": {
Expand Down
4 changes: 2 additions & 2 deletions drizzle/client/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "5",
"when": 1724972191819,
"tag": "0000_cultured_nick_fury",
"when": 1725300014349,
"tag": "0000_confused_texas_twister",
"breakpoints": true
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,27 @@ CREATE TABLE `preset` (
`forks` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `remoteDetectionAlert_backlink` (
`versionId` text PRIMARY KEY NOT NULL
);
--> statement-breakpoint
CREATE TABLE `remoteDetectionAlert` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`originalVersionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
`detectionDateStart` text NOT NULL,
`detectionDateEnd` text NOT NULL,
`sourceId` text NOT NULL,
`metadata` text NOT NULL,
`geometry` text NOT NULL,
`forks` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `role_backlink` (
`versionId` text PRIMARY KEY NOT NULL
);
Expand Down
125 changes: 124 additions & 1 deletion drizzle/project/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "sqlite",
"id": "2be32705-ddce-45ee-97c1-c6f2fc748568",
"id": "d8c8d9af-787d-4962-91c5-80346f991ca1",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"coreOwnership_backlink": {
Expand Down Expand Up @@ -787,6 +787,129 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"remoteDetectionAlert_backlink": {
"name": "remoteDetectionAlert_backlink",
"columns": {
"versionId": {
"name": "versionId",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"remoteDetectionAlert": {
"name": "remoteDetectionAlert",
"columns": {
"docId": {
"name": "docId",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"versionId": {
"name": "versionId",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"originalVersionId": {
"name": "originalVersionId",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"schemaName": {
"name": "schemaName",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updatedAt": {
"name": "updatedAt",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"links": {
"name": "links",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"deleted": {
"name": "deleted",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"detectionDateStart": {
"name": "detectionDateStart",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"detectionDateEnd": {
"name": "detectionDateEnd",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"sourceId": {
"name": "sourceId",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"metadata": {
"name": "metadata",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"geometry": {
"name": "geometry",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"forks": {
"name": "forks",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"role_backlink": {
"name": "role_backlink",
"columns": {
Expand Down
4 changes: 2 additions & 2 deletions drizzle/project/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "5",
"when": 1724972190927,
"tag": "0000_woozy_stryfe",
"when": 1725300018841,
"tag": "0000_fearless_mariko_yashida",
"breakpoints": true
}
]
Expand Down
Binary file added mapeo-schema-3.0.0-next.25.tgz
Binary file not shown.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"@fastify/type-provider-typebox": "^4.0.0",
"@hyperswarm/secret-stream": "^6.1.2",
"@mapeo/crypto": "1.0.0-alpha.10",
"@mapeo/schema": "^3.0.0-next.24",
"@mapeo/schema": "file:mapeo-schema-3.0.0-next.25.tgz",
"@mapeo/sqlite-indexer": "1.0.0-alpha.9",
"@sinclair/typebox": "^0.29.6",
"b4a": "^1.6.3",
Expand Down
12 changes: 12 additions & 0 deletions src/mapeo-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
roleTable,
iconTable,
translationTable,
remoteDetectionAlertTable,
} from './schema/project.js'
import {
CoreOwnership,
Expand Down Expand Up @@ -168,6 +169,7 @@ export class MapeoProject extends TypedEmitter {
deviceInfoTable,
iconTable,
translationTable,
remoteDetectionAlertTable,
],
sqlite: this.#sqlite,
getWinner,
Expand Down Expand Up @@ -224,6 +226,12 @@ export class MapeoProject extends TypedEmitter {
db,
getTranslations,
}),
remoteDetectionAlert: new DataType({
dataStore: this.#dataStores.data,
table: remoteDetectionAlertTable,
db,
getTranslations,
}),
preset: new DataType({
dataStore: this.#dataStores.config,
table: presetTable,
Expand Down Expand Up @@ -499,6 +507,10 @@ export class MapeoProject extends TypedEmitter {
return this.#dataTypes.field
}

get alert() {
return this.#dataTypes.remoteDetectionAlert
}

get $member() {
return this.#memberApi
}
Expand Down
7 changes: 7 additions & 0 deletions src/schema/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export const observationTable = sqliteTable(
toColumns(schemas.observation)
)
export const trackTable = sqliteTable('track', toColumns(schemas.track))
export const remoteDetectionAlertTable = sqliteTable(
'remoteDetectionAlert',
toColumns(schemas.remoteDetectionAlert)
)
export const presetTable = sqliteTable('preset', toColumns(schemas.preset))
export const fieldTable = sqliteTable('field', toColumns(schemas.field))
export const coreOwnershipTable = sqliteTable(
Expand All @@ -31,6 +35,9 @@ export const iconTable = sqliteTable('icon', toColumns(schemas.icon))
export const translationBacklinkTable = backlinkTable(translationTable)
export const observationBacklinkTable = backlinkTable(observationTable)
export const trackBacklinkTable = backlinkTable(trackTable)
export const remoteDetectionAlertBacklinkTable = backlinkTable(
remoteDetectionAlertTable
)
export const presetBacklinkTable = backlinkTable(presetTable)
export const fieldBacklinkTable = backlinkTable(fieldTable)
export const coreOwnershipBacklinkTable = backlinkTable(coreOwnershipTable)
Expand Down
Loading