From a2c45917a0c1c7a3dc117777c1154785405983e7 Mon Sep 17 00:00:00 2001 From: Pasha Podolsky Date: Sun, 19 May 2024 12:23:59 +0300 Subject: [PATCH] [ref] Fix build --- .../src/components/consumers/dummy.rs | 45 ------------------- summa-server/src/components/consumers/mod.rs | 1 - summa-wasm/Cargo.toml | 6 +-- summa-wasm/build.sh | 3 +- summa-wasm/package-lock.json | 4 +- summa-wasm/package.json | 2 +- summa-wasm/src/grpc-web/index_service.ts | 43 +++++++++++++++--- 7 files changed, 45 insertions(+), 59 deletions(-) delete mode 100644 summa-server/src/components/consumers/dummy.rs diff --git a/summa-server/src/components/consumers/dummy.rs b/summa-server/src/components/consumers/dummy.rs deleted file mode 100644 index 57c20407..00000000 --- a/summa-server/src/components/consumers/dummy.rs +++ /dev/null @@ -1,45 +0,0 @@ -use std::fmt::Debug; - -use async_trait::async_trait; -use summa_core::components::IndexWriterHolder; -use summa_proto::proto::ConflictStrategy; -use tantivy::schema::Schema; -use tokio::sync::OwnedRwLockReadGuard; - -use crate::components::consumers::ConsumerThread; -use crate::configs::consumer::Config; -use crate::SummaServerResult; - -#[derive(Debug)] -struct DummyConsumerThread; - -#[async_trait] -impl ConsumerThread for DummyConsumerThread { - fn consumer_name(&self) -> &str { - unimplemented!() - } - - async fn start(&self, _: OwnedRwLockReadGuard, _: ConflictStrategy, _: Schema) -> SummaServerResult<()> { - unimplemented!() - } - - async fn stop(&self) -> SummaServerResult<()> { - unimplemented!() - } - - async fn commit(&self) -> SummaServerResult<()> { - unimplemented!() - } - - async fn on_create(&self) -> SummaServerResult<()> { - unimplemented!() - } - - async fn on_delete(&self) -> SummaServerResult<()> { - unimplemented!() - } - - fn config(&self) -> &Config { - unimplemented!() - } -} diff --git a/summa-server/src/components/consumers/mod.rs b/summa-server/src/components/consumers/mod.rs index c0ed5c19..3373d888 100644 --- a/summa-server/src/components/consumers/mod.rs +++ b/summa-server/src/components/consumers/mod.rs @@ -1,7 +1,6 @@ //! Consuming documents from Kafka mod consumer_thread; -pub mod dummy; #[cfg(feature = "kafka")] pub mod kafka; diff --git a/summa-wasm/Cargo.toml b/summa-wasm/Cargo.toml index 99165ec9..3aae65e1 100644 --- a/summa-wasm/Cargo.toml +++ b/summa-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "summa-wasm" -version = "0.136.0" +version = "0.136.1" authors = ["Pasha Podolsky "] edition = "2021" license-file = "LICENSE" @@ -26,11 +26,11 @@ prost = { workspace = true } serde = { workspace = true } serde-wasm-bindgen = "0.6" strfmt = { workspace = true } -summa-core = { version = "0.23.2", path = "../summa-core", default_features = false } +summa-core = { version = "0.23.2", path = "../summa-core", default-features = false } summa-proto = { workspace = true } tantivy = { workspace = true, features = ["wasm"] } thiserror = { workspace = true } -tokio = { workspace = true, default_features = false, features = ["sync"] } +tokio = { workspace = true, default-features = false, features = ["sync"] } tracing = { workspace = true } tracing-wasm = "0.2" wasm-bindgen = "0.2.83" diff --git a/summa-wasm/build.sh b/summa-wasm/build.sh index c959c8bd..0708e25f 100755 --- a/summa-wasm/build.sh +++ b/summa-wasm/build.sh @@ -6,7 +6,6 @@ npx protoc \ --proto_path ../summa-proto/proto \ ../summa-proto/proto/*.proto - -PATH="/usr/local/opt/llvm/bin/:$PATH" CC=/usr/local/opt/llvm/bin/clang AR=/usr/local/opt/llvm/bin/llvm-ar npm run build +npm run build sed -i '' 's/document.baseURI ||//g' dist/root-worker.js sed -i '' 's/document.baseURI||//g' dist/root-worker.js diff --git a/summa-wasm/package-lock.json b/summa-wasm/package-lock.json index 052d72bc..a6a414fd 100644 --- a/summa-wasm/package-lock.json +++ b/summa-wasm/package-lock.json @@ -1,12 +1,12 @@ { "name": "summa-wasm", - "version": "0.132.1", + "version": "0.136.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "summa-wasm", - "version": "0.132.1", + "version": "0.136.1", "dependencies": { "@grpc/proto-loader": "^0.7.10", "@protobuf-ts/plugin": "^2.9.1", diff --git a/summa-wasm/package.json b/summa-wasm/package.json index 9aa31635..caa221e8 100644 --- a/summa-wasm/package.json +++ b/summa-wasm/package.json @@ -1,7 +1,7 @@ { "name": "summa-wasm", "description": "WASM-bindings for Summa", - "version": "0.136.0", + "version": "0.136.1", "keywords": [ "search", "database", diff --git a/summa-wasm/src/grpc-web/index_service.ts b/summa-wasm/src/grpc-web/index_service.ts index 4c8820d7..e9d9bc68 100644 --- a/summa-wasm/src/grpc-web/index_service.ts +++ b/summa-wasm/src/grpc-web/index_service.ts @@ -300,6 +300,10 @@ export interface IndexAttributes { * @generated from protobuf field: repeated summa.proto.MappedField mapped_fields = 9; */ mapped_fields: MappedField[]; + /** + * @generated from protobuf field: optional string auto_id_field = 10; + */ + auto_id_field?: string; } /** * Request for index creation @@ -485,6 +489,10 @@ export interface IndexDocumentStreamRequest { * @generated from protobuf field: optional summa.proto.ConflictStrategy conflict_strategy = 3; */ conflict_strategy?: ConflictStrategy; + /** + * @generated from protobuf field: bool skip_updated_at_modification = 4; + */ + skip_updated_at_modification: boolean; } /** * @generated from protobuf message summa.proto.IndexDocumentStreamResponse @@ -515,6 +523,10 @@ export interface IndexDocumentRequest { * @generated from protobuf field: bytes document = 2; */ document: Uint8Array; + /** + * @generated from protobuf field: bool skip_updated_at_modification = 3; + */ + skip_updated_at_modification: boolean; } /** * @generated from protobuf message summa.proto.IndexDocumentResponse @@ -1679,7 +1691,8 @@ class IndexAttributes$Type extends MessageType { { no: 4, name: "multi_fields", kind: "scalar", localName: "multi_fields", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 8, name: "conflict_strategy", kind: "enum", localName: "conflict_strategy", T: () => ["summa.proto.ConflictStrategy", ConflictStrategy] }, - { no: 9, name: "mapped_fields", kind: "message", localName: "mapped_fields", repeat: 1 /*RepeatType.PACKED*/, T: () => MappedField } + { no: 9, name: "mapped_fields", kind: "message", localName: "mapped_fields", repeat: 1 /*RepeatType.PACKED*/, T: () => MappedField }, + { no: 10, name: "auto_id_field", kind: "scalar", localName: "auto_id_field", opt: true, T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): IndexAttributes { @@ -1712,6 +1725,9 @@ class IndexAttributes$Type extends MessageType { case /* repeated summa.proto.MappedField mapped_fields */ 9: message.mapped_fields.push(MappedField.internalBinaryRead(reader, reader.uint32(), options)); break; + case /* optional string auto_id_field */ 10: + message.auto_id_field = reader.string(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -1742,6 +1758,9 @@ class IndexAttributes$Type extends MessageType { /* repeated summa.proto.MappedField mapped_fields = 9; */ for (let i = 0; i < message.mapped_fields.length; i++) MappedField.internalBinaryWrite(message.mapped_fields[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + /* optional string auto_id_field = 10; */ + if (message.auto_id_field !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.auto_id_field); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -2372,11 +2391,12 @@ class IndexDocumentStreamRequest$Type extends MessageType ["summa.proto.ConflictStrategy", ConflictStrategy] } + { no: 3, name: "conflict_strategy", kind: "enum", localName: "conflict_strategy", opt: true, T: () => ["summa.proto.ConflictStrategy", ConflictStrategy] }, + { no: 4, name: "skip_updated_at_modification", kind: "scalar", localName: "skip_updated_at_modification", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): IndexDocumentStreamRequest { - const message = { index_name: "", documents: [] }; + const message = { index_name: "", documents: [], skip_updated_at_modification: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2396,6 +2416,9 @@ class IndexDocumentStreamRequest$Type extends MessageType { constructor() { super("summa.proto.IndexDocumentRequest", [ { no: 1, name: "index_name", kind: "scalar", localName: "index_name", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "document", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + { no: 2, name: "document", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "skip_updated_at_modification", kind: "scalar", localName: "skip_updated_at_modification", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): IndexDocumentRequest { - const message = { index_name: "", document: new Uint8Array(0) }; + const message = { index_name: "", document: new Uint8Array(0), skip_updated_at_modification: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2514,6 +2541,9 @@ class IndexDocumentRequest$Type extends MessageType { case /* bytes document */ 2: message.document = reader.bytes(); break; + case /* bool skip_updated_at_modification */ 3: + message.skip_updated_at_modification = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -2532,6 +2562,9 @@ class IndexDocumentRequest$Type extends MessageType { /* bytes document = 2; */ if (message.document.length) writer.tag(2, WireType.LengthDelimited).bytes(message.document); + /* bool skip_updated_at_modification = 3; */ + if (message.skip_updated_at_modification !== false) + writer.tag(3, WireType.Varint).bool(message.skip_updated_at_modification); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);