agntcy-dir 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agntcy-dir.d.ts +303 -2
- package/dist/index.cjs +159 -0
- package/dist/index.mjs +159 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/dist/agntcy-dir.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { GenMessage } from '@bufbuild/protobuf/codegenv2';
|
|
|
6
6
|
import type { GenService } from '@bufbuild/protobuf/codegenv2';
|
|
7
7
|
import type { JsonObject } from '@bufbuild/protobuf';
|
|
8
8
|
import type { Message } from '@bufbuild/protobuf';
|
|
9
|
+
import type { Timestamp } from '@bufbuild/protobuf/wkt';
|
|
9
10
|
import { Transport } from '@connectrpc/connect';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -55,9 +56,11 @@ export declare class Client {
|
|
|
55
56
|
config: Config;
|
|
56
57
|
storeClient: Client_2<typeof models_2.store_v1.StoreService>;
|
|
57
58
|
routingClient: Client_2<typeof models_2.routing_v1.RoutingService>;
|
|
59
|
+
publicationClient: Client_2<typeof models_2.routing_v1.PublicationService>;
|
|
58
60
|
searchClient: Client_2<typeof models_2.search_v1.SearchService>;
|
|
59
61
|
signClient: Client_2<typeof models_2.sign_v1.SignService>;
|
|
60
62
|
syncClient: Client_2<typeof models_2.store_v1.SyncService>;
|
|
63
|
+
eventClient: Client_2<typeof models_2.events_v1.EventService>;
|
|
61
64
|
/**
|
|
62
65
|
* Initialize the client with the given configuration.
|
|
63
66
|
*
|
|
@@ -432,6 +435,56 @@ export declare class Client {
|
|
|
432
435
|
* ```
|
|
433
436
|
*/
|
|
434
437
|
delete_sync(request: models_2.store_v1.DeleteSyncRequest): Promise<models_2.store_v1.DeleteSyncResponse>;
|
|
438
|
+
/**
|
|
439
|
+
* Get events from the Event API matching the specified criteria.
|
|
440
|
+
*
|
|
441
|
+
* Retrieves a list of events that match the filtering and query criteria
|
|
442
|
+
* specified in the request.
|
|
443
|
+
*
|
|
444
|
+
* @param request - ListenRequest specifying filtering criteria, pagination, etc.
|
|
445
|
+
* @returns Promise that resolves to an array of ListenResponse objects matching the criteria
|
|
446
|
+
*
|
|
447
|
+
* @throws {Error} If the gRPC call fails or the get events operation fails
|
|
448
|
+
*/
|
|
449
|
+
listen(request: models_2.events_v1.ListenRequest): AsyncIterable<models_2.events_v1.ListenResponse>;
|
|
450
|
+
/**
|
|
451
|
+
* CreatePublication creates a new publication request that will be processed by the PublicationWorker.
|
|
452
|
+
* The publication request can specify either a query, a list of specific CIDs,
|
|
453
|
+
* or all records to be announced to the DHT.
|
|
454
|
+
*
|
|
455
|
+
* @param request - PublishRequest containing record references and queries options.
|
|
456
|
+
*
|
|
457
|
+
* @returns CreatePublicationResponse returns the result of creating a publication request.
|
|
458
|
+
* This includes the publication ID and any relevant metadata.
|
|
459
|
+
*
|
|
460
|
+
* @throws {Error} If the gRPC call fails or the list operation fails
|
|
461
|
+
*/
|
|
462
|
+
create_publication(request: models_2.routing_v1.PublishRequest): Promise<models_2.routing_v1.CreatePublicationResponse>;
|
|
463
|
+
/**
|
|
464
|
+
* ListPublications returns a stream of all publication requests in the system.
|
|
465
|
+
* This allows monitoring of pending, processing, and completed publication requests.
|
|
466
|
+
*
|
|
467
|
+
* @param request - ListPublicationsRequest contains optional filters for listing publication requests.
|
|
468
|
+
*
|
|
469
|
+
* @returns Promise that resolves to an array of ListPublicationsItem represents
|
|
470
|
+
* a single publication request in the list response.
|
|
471
|
+
* Contains publication details including ID, status, and creation timestamp.
|
|
472
|
+
*
|
|
473
|
+
* @throws {Error} If the gRPC call fails or the list operation fails
|
|
474
|
+
*/
|
|
475
|
+
list_publication(request: models_2.routing_v1.ListPublicationsRequest): Promise<models_2.routing_v1.ListPublicationsItem[]>;
|
|
476
|
+
/**
|
|
477
|
+
* GetPublication retrieves details of a specific publication request by its identifier.
|
|
478
|
+
* This includes the current status and any associated metadata.
|
|
479
|
+
*
|
|
480
|
+
* @param request - GetPublicationRequest specifies which publication to retrieve by its identifier.
|
|
481
|
+
*
|
|
482
|
+
* @returns GetPublicationResponse contains the full details of a specific publication request.
|
|
483
|
+
* Includes status, progress information, and any error details if applicable.
|
|
484
|
+
*
|
|
485
|
+
* @throws {Error} If the gRPC call fails or the get operation fails
|
|
486
|
+
*/
|
|
487
|
+
get_publication(request: models_2.routing_v1.GetPublicationRequest): Promise<models_2.routing_v1.GetPublicationResponse>;
|
|
435
488
|
/**
|
|
436
489
|
* Sign a record using a private key.
|
|
437
490
|
*
|
|
@@ -643,11 +696,198 @@ declare type DeleteSyncResponse = Message<"agntcy.dir.store.v1.DeleteSyncRespons
|
|
|
643
696
|
*/
|
|
644
697
|
declare const DeleteSyncResponseSchema: GenMessage<DeleteSyncResponse>;
|
|
645
698
|
|
|
699
|
+
/**
|
|
700
|
+
* Event represents a system event that occurred.
|
|
701
|
+
*
|
|
702
|
+
* @generated from message agntcy.dir.events.v1.Event
|
|
703
|
+
*/
|
|
704
|
+
declare type Event_2 = Message<"agntcy.dir.events.v1.Event"> & {
|
|
705
|
+
/**
|
|
706
|
+
* Unique event identifier (generated by the system).
|
|
707
|
+
*
|
|
708
|
+
* @generated from field: string id = 1;
|
|
709
|
+
*/
|
|
710
|
+
id: string;
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Type of event that occurred.
|
|
714
|
+
*
|
|
715
|
+
* @generated from field: agntcy.dir.events.v1.EventType type = 2;
|
|
716
|
+
*/
|
|
717
|
+
type: EventType;
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* When the event occurred.
|
|
721
|
+
*
|
|
722
|
+
* @generated from field: google.protobuf.Timestamp timestamp = 3;
|
|
723
|
+
*/
|
|
724
|
+
timestamp?: Timestamp;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Resource identifier (CID for records, sync_id for syncs, etc.).
|
|
728
|
+
*
|
|
729
|
+
* @generated from field: string resource_id = 4;
|
|
730
|
+
*/
|
|
731
|
+
resourceId: string;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Optional labels associated with the record (for record events).
|
|
735
|
+
*
|
|
736
|
+
* @generated from field: repeated string labels = 5;
|
|
737
|
+
*/
|
|
738
|
+
labels: string[];
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Optional metadata for additional context.
|
|
742
|
+
* Used for flexible event-specific data that doesn't fit standard fields.
|
|
743
|
+
*
|
|
744
|
+
* @generated from field: map<string, string> metadata = 7;
|
|
745
|
+
*/
|
|
746
|
+
metadata: { [key: string]: string };
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
export declare namespace events_v1 {
|
|
750
|
+
export {
|
|
751
|
+
file_agntcy_dir_events_v1_event_service,
|
|
752
|
+
ListenRequest,
|
|
753
|
+
ListenRequestSchema,
|
|
754
|
+
ListenResponse,
|
|
755
|
+
ListenResponseSchema,
|
|
756
|
+
Event_2 as Event,
|
|
757
|
+
EventSchema,
|
|
758
|
+
EventType,
|
|
759
|
+
EventTypeSchema,
|
|
760
|
+
EventService
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Describes the message agntcy.dir.events.v1.Event.
|
|
766
|
+
* Use `create(EventSchema)` to create a new message.
|
|
767
|
+
*/
|
|
768
|
+
declare const EventSchema: GenMessage<Event_2>;
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* EventService provides real-time event streaming for all system operations.
|
|
772
|
+
* Events are delivered from subscription time forward with no history or replay.
|
|
773
|
+
* This service enables external applications to react to system changes in real-time.
|
|
774
|
+
*
|
|
775
|
+
* @generated from service agntcy.dir.events.v1.EventService
|
|
776
|
+
*/
|
|
777
|
+
declare const EventService: GenService<{
|
|
778
|
+
/**
|
|
779
|
+
* Listen establishes a streaming connection to receive events.
|
|
780
|
+
* Events are only delivered while the stream is active.
|
|
781
|
+
* On disconnect, missed events are not recoverable.
|
|
782
|
+
*
|
|
783
|
+
* @generated from rpc agntcy.dir.events.v1.EventService.Listen
|
|
784
|
+
*/
|
|
785
|
+
listen: {
|
|
786
|
+
methodKind: "server_streaming";
|
|
787
|
+
input: typeof ListenRequestSchema;
|
|
788
|
+
output: typeof ListenResponseSchema;
|
|
789
|
+
},
|
|
790
|
+
}>;
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* EventType represents all valid event types in the system.
|
|
794
|
+
* Each value represents a specific operation that can occur.
|
|
795
|
+
*
|
|
796
|
+
* Supported Events:
|
|
797
|
+
* - Store: RECORD_PUSHED, RECORD_PULLED, RECORD_DELETED
|
|
798
|
+
* - Routing: RECORD_PUBLISHED, RECORD_UNPUBLISHED
|
|
799
|
+
* - Sync: SYNC_CREATED, SYNC_COMPLETED, SYNC_FAILED
|
|
800
|
+
* - Sign: RECORD_SIGNED
|
|
801
|
+
*
|
|
802
|
+
* @generated from enum agntcy.dir.events.v1.EventType
|
|
803
|
+
*/
|
|
804
|
+
declare enum EventType {
|
|
805
|
+
/**
|
|
806
|
+
* Unknown/unspecified event type.
|
|
807
|
+
*
|
|
808
|
+
* @generated from enum value: EVENT_TYPE_UNSPECIFIED = 0;
|
|
809
|
+
*/
|
|
810
|
+
UNSPECIFIED = 0,
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* A record was pushed to local storage.
|
|
814
|
+
*
|
|
815
|
+
* @generated from enum value: EVENT_TYPE_RECORD_PUSHED = 1;
|
|
816
|
+
*/
|
|
817
|
+
RECORD_PUSHED = 1,
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* A record was pulled from storage.
|
|
821
|
+
*
|
|
822
|
+
* @generated from enum value: EVENT_TYPE_RECORD_PULLED = 2;
|
|
823
|
+
*/
|
|
824
|
+
RECORD_PULLED = 2,
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* A record was deleted from storage.
|
|
828
|
+
*
|
|
829
|
+
* @generated from enum value: EVENT_TYPE_RECORD_DELETED = 3;
|
|
830
|
+
*/
|
|
831
|
+
RECORD_DELETED = 3,
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* A record was published/announced to the network.
|
|
835
|
+
*
|
|
836
|
+
* @generated from enum value: EVENT_TYPE_RECORD_PUBLISHED = 4;
|
|
837
|
+
*/
|
|
838
|
+
RECORD_PUBLISHED = 4,
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* A record was unpublished from the network.
|
|
842
|
+
*
|
|
843
|
+
* @generated from enum value: EVENT_TYPE_RECORD_UNPUBLISHED = 5;
|
|
844
|
+
*/
|
|
845
|
+
RECORD_UNPUBLISHED = 5,
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* A sync operation was created/initiated.
|
|
849
|
+
*
|
|
850
|
+
* @generated from enum value: EVENT_TYPE_SYNC_CREATED = 6;
|
|
851
|
+
*/
|
|
852
|
+
SYNC_CREATED = 6,
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* A sync operation completed successfully.
|
|
856
|
+
*
|
|
857
|
+
* @generated from enum value: EVENT_TYPE_SYNC_COMPLETED = 7;
|
|
858
|
+
*/
|
|
859
|
+
SYNC_COMPLETED = 7,
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* A sync operation failed.
|
|
863
|
+
*
|
|
864
|
+
* @generated from enum value: EVENT_TYPE_SYNC_FAILED = 8;
|
|
865
|
+
*/
|
|
866
|
+
SYNC_FAILED = 8,
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* A record was signed.
|
|
870
|
+
*
|
|
871
|
+
* @generated from enum value: EVENT_TYPE_RECORD_SIGNED = 9;
|
|
872
|
+
*/
|
|
873
|
+
RECORD_SIGNED = 9,
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Describes the enum agntcy.dir.events.v1.EventType.
|
|
878
|
+
*/
|
|
879
|
+
declare const EventTypeSchema: GenEnum<EventType>;
|
|
880
|
+
|
|
646
881
|
/**
|
|
647
882
|
* Describes the file agntcy/dir/core/v1/record.proto.
|
|
648
883
|
*/
|
|
649
884
|
declare const file_agntcy_dir_core_v1_record: GenFile;
|
|
650
885
|
|
|
886
|
+
/**
|
|
887
|
+
* Describes the file agntcy/dir/events/v1/event_service.proto.
|
|
888
|
+
*/
|
|
889
|
+
declare const file_agntcy_dir_events_v1_event_service: GenFile;
|
|
890
|
+
|
|
651
891
|
/**
|
|
652
892
|
* Describes the file agntcy/dir/routing/v1/peer.proto.
|
|
653
893
|
*/
|
|
@@ -835,6 +1075,65 @@ declare type GetSyncResponse = Message<"agntcy.dir.store.v1.GetSyncResponse"> &
|
|
|
835
1075
|
*/
|
|
836
1076
|
declare const GetSyncResponseSchema: GenMessage<GetSyncResponse>;
|
|
837
1077
|
|
|
1078
|
+
/**
|
|
1079
|
+
* ListenRequest specifies filters for event subscription.
|
|
1080
|
+
*
|
|
1081
|
+
* @generated from message agntcy.dir.events.v1.ListenRequest
|
|
1082
|
+
*/
|
|
1083
|
+
declare type ListenRequest = Message<"agntcy.dir.events.v1.ListenRequest"> & {
|
|
1084
|
+
/**
|
|
1085
|
+
* Event types to subscribe to.
|
|
1086
|
+
* If empty, subscribes to all event types.
|
|
1087
|
+
*
|
|
1088
|
+
* @generated from field: repeated agntcy.dir.events.v1.EventType event_types = 1;
|
|
1089
|
+
*/
|
|
1090
|
+
eventTypes: EventType[];
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* Optional label filters (e.g., "/skills/AI", "/domains/research").
|
|
1094
|
+
* Only events for records matching these labels are delivered.
|
|
1095
|
+
* Uses substring matching.
|
|
1096
|
+
*
|
|
1097
|
+
* @generated from field: repeated string label_filters = 2;
|
|
1098
|
+
*/
|
|
1099
|
+
labelFilters: string[];
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Optional CID filters.
|
|
1103
|
+
* Only events for specific CIDs are delivered.
|
|
1104
|
+
*
|
|
1105
|
+
* @generated from field: repeated string cid_filters = 3;
|
|
1106
|
+
*/
|
|
1107
|
+
cidFilters: string[];
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Describes the message agntcy.dir.events.v1.ListenRequest.
|
|
1112
|
+
* Use `create(ListenRequestSchema)` to create a new message.
|
|
1113
|
+
*/
|
|
1114
|
+
declare const ListenRequestSchema: GenMessage<ListenRequest>;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* ListenResponse is the response message for the Listen RPC.
|
|
1118
|
+
* Wraps the Event message to allow for future extensions without breaking the Event structure.
|
|
1119
|
+
*
|
|
1120
|
+
* @generated from message agntcy.dir.events.v1.ListenResponse
|
|
1121
|
+
*/
|
|
1122
|
+
declare type ListenResponse = Message<"agntcy.dir.events.v1.ListenResponse"> & {
|
|
1123
|
+
/**
|
|
1124
|
+
* The event that occurred.
|
|
1125
|
+
*
|
|
1126
|
+
* @generated from field: agntcy.dir.events.v1.Event event = 1;
|
|
1127
|
+
*/
|
|
1128
|
+
event?: Event_2;
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Describes the message agntcy.dir.events.v1.ListenResponse.
|
|
1133
|
+
* Use `create(ListenResponseSchema)` to create a new message.
|
|
1134
|
+
*/
|
|
1135
|
+
declare const ListenResponseSchema: GenMessage<ListenResponse>;
|
|
1136
|
+
|
|
838
1137
|
/**
|
|
839
1138
|
* ListPublicationsItem represents a single publication request in the list response.
|
|
840
1139
|
* Contains publication details including ID, status, and creation timestamp.
|
|
@@ -1025,7 +1324,8 @@ export declare namespace models {
|
|
|
1025
1324
|
routing_v1,
|
|
1026
1325
|
search_v1,
|
|
1027
1326
|
sign_v1,
|
|
1028
|
-
store_v1
|
|
1327
|
+
store_v1,
|
|
1328
|
+
events_v1
|
|
1029
1329
|
}
|
|
1030
1330
|
}
|
|
1031
1331
|
|
|
@@ -1035,7 +1335,8 @@ declare namespace models_2 {
|
|
|
1035
1335
|
routing_v1,
|
|
1036
1336
|
search_v1,
|
|
1037
1337
|
sign_v1,
|
|
1038
|
-
store_v1
|
|
1338
|
+
store_v1,
|
|
1339
|
+
events_v1
|
|
1039
1340
|
}
|
|
1040
1341
|
}
|
|
1041
1342
|
|
package/dist/index.cjs
CHANGED
|
@@ -4919,6 +4919,24 @@ function fileDesc(b64, imports) {
|
|
|
4919
4919
|
return reg.getFile(root.name);
|
|
4920
4920
|
}
|
|
4921
4921
|
|
|
4922
|
+
// Copyright 2021-2025 Buf Technologies, Inc.
|
|
4923
|
+
//
|
|
4924
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4925
|
+
// you may not use this file except in compliance with the License.
|
|
4926
|
+
// You may obtain a copy of the License at
|
|
4927
|
+
//
|
|
4928
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
4929
|
+
//
|
|
4930
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
4931
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
4932
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4933
|
+
// See the License for the specific language governing permissions and
|
|
4934
|
+
// limitations under the License.
|
|
4935
|
+
/**
|
|
4936
|
+
* Describes the file google/protobuf/timestamp.proto.
|
|
4937
|
+
*/
|
|
4938
|
+
const file_google_protobuf_timestamp = /*@__PURE__*/ fileDesc("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM");
|
|
4939
|
+
|
|
4922
4940
|
// Copyright 2021-2025 Buf Technologies, Inc.
|
|
4923
4941
|
//
|
|
4924
4942
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -10250,9 +10268,86 @@ var store_v1 = /*#__PURE__*/Object.freeze({
|
|
|
10250
10268
|
// Copyright AGNTCY Contributors (https://github.com/agntcy)
|
|
10251
10269
|
// SPDX-License-Identifier: Apache-2.0
|
|
10252
10270
|
|
|
10271
|
+
|
|
10272
|
+
/**
|
|
10273
|
+
* Describes the file agntcy/dir/events/v1/event_service.proto.
|
|
10274
|
+
*/
|
|
10275
|
+
const file_agntcy_dir_events_v1_event_service = /*@__PURE__*/
|
|
10276
|
+
fileDesc("CihhZ250Y3kvZGlyL2V2ZW50cy92MS9ldmVudF9zZXJ2aWNlLnByb3RvEhRhZ250Y3kuZGlyLmV2ZW50cy52MSJxCg1MaXN0ZW5SZXF1ZXN0EjQKC2V2ZW50X3R5cGVzGAEgAygOMh8uYWdudGN5LmRpci5ldmVudHMudjEuRXZlbnRUeXBlEhUKDWxhYmVsX2ZpbHRlcnMYAiADKAkSEwoLY2lkX2ZpbHRlcnMYAyADKAkiPAoOTGlzdGVuUmVzcG9uc2USKgoFZXZlbnQYASABKAsyGy5hZ250Y3kuZGlyLmV2ZW50cy52MS5FdmVudCKEAgoFRXZlbnQSCgoCaWQYASABKAkSLQoEdHlwZRgCIAEoDjIfLmFnbnRjeS5kaXIuZXZlbnRzLnYxLkV2ZW50VHlwZRItCgl0aW1lc3RhbXAYAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhMKC3Jlc291cmNlX2lkGAQgASgJEg4KBmxhYmVscxgFIAMoCRI7CghtZXRhZGF0YRgHIAMoCzIpLmFnbnRjeS5kaXIuZXZlbnRzLnYxLkV2ZW50Lk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBKrwCCglFdmVudFR5cGUSGgoWRVZFTlRfVFlQRV9VTlNQRUNJRklFRBAAEhwKGEVWRU5UX1RZUEVfUkVDT1JEX1BVU0hFRBABEhwKGEVWRU5UX1RZUEVfUkVDT1JEX1BVTExFRBACEh0KGUVWRU5UX1RZUEVfUkVDT1JEX0RFTEVURUQQAxIfChtFVkVOVF9UWVBFX1JFQ09SRF9QVUJMSVNIRUQQBBIhCh1FVkVOVF9UWVBFX1JFQ09SRF9VTlBVQkxJU0hFRBAFEhsKF0VWRU5UX1RZUEVfU1lOQ19DUkVBVEVEEAYSHQoZRVZFTlRfVFlQRV9TWU5DX0NPTVBMRVRFRBAHEhoKFkVWRU5UX1RZUEVfU1lOQ19GQUlMRUQQCBIcChhFVkVOVF9UWVBFX1JFQ09SRF9TSUdORUQQCTJlCgxFdmVudFNlcnZpY2USVQoGTGlzdGVuEiMuYWdudGN5LmRpci5ldmVudHMudjEuTGlzdGVuUmVxdWVzdBokLmFnbnRjeS5kaXIuZXZlbnRzLnYxLkxpc3RlblJlc3BvbnNlMAFCxQEKGGNvbS5hZ250Y3kuZGlyLmV2ZW50cy52MUIRRXZlbnRTZXJ2aWNlUHJvdG9QAVojZ2l0aHViLmNvbS9hZ250Y3kvZGlyL2FwaS9ldmVudHMvdjGiAgNBREWqAhRBZ250Y3kuRGlyLkV2ZW50cy5WMcoCFEFnbnRjeVxEaXJcRXZlbnRzXFYx4gIgQWdudGN5XERpclxFdmVudHNcVjFcR1BCTWV0YWRhdGHqAhdBZ250Y3k6OkRpcjo6RXZlbnRzOjpWMWIGcHJvdG8z", [file_google_protobuf_timestamp]);
|
|
10277
|
+
|
|
10278
|
+
/**
|
|
10279
|
+
* Describes the message agntcy.dir.events.v1.ListenRequest.
|
|
10280
|
+
* Use `create(ListenRequestSchema)` to create a new message.
|
|
10281
|
+
*/
|
|
10282
|
+
const ListenRequestSchema = /*@__PURE__*/
|
|
10283
|
+
messageDesc(file_agntcy_dir_events_v1_event_service, 0);
|
|
10284
|
+
|
|
10285
|
+
/**
|
|
10286
|
+
* Describes the message agntcy.dir.events.v1.ListenResponse.
|
|
10287
|
+
* Use `create(ListenResponseSchema)` to create a new message.
|
|
10288
|
+
*/
|
|
10289
|
+
const ListenResponseSchema = /*@__PURE__*/
|
|
10290
|
+
messageDesc(file_agntcy_dir_events_v1_event_service, 1);
|
|
10291
|
+
|
|
10292
|
+
/**
|
|
10293
|
+
* Describes the message agntcy.dir.events.v1.Event.
|
|
10294
|
+
* Use `create(EventSchema)` to create a new message.
|
|
10295
|
+
*/
|
|
10296
|
+
const EventSchema = /*@__PURE__*/
|
|
10297
|
+
messageDesc(file_agntcy_dir_events_v1_event_service, 2);
|
|
10298
|
+
|
|
10299
|
+
/**
|
|
10300
|
+
* Describes the enum agntcy.dir.events.v1.EventType.
|
|
10301
|
+
*/
|
|
10302
|
+
const EventTypeSchema = /*@__PURE__*/
|
|
10303
|
+
enumDesc(file_agntcy_dir_events_v1_event_service, 0);
|
|
10304
|
+
|
|
10305
|
+
/**
|
|
10306
|
+
* EventType represents all valid event types in the system.
|
|
10307
|
+
* Each value represents a specific operation that can occur.
|
|
10308
|
+
*
|
|
10309
|
+
* Supported Events:
|
|
10310
|
+
* - Store: RECORD_PUSHED, RECORD_PULLED, RECORD_DELETED
|
|
10311
|
+
* - Routing: RECORD_PUBLISHED, RECORD_UNPUBLISHED
|
|
10312
|
+
* - Sync: SYNC_CREATED, SYNC_COMPLETED, SYNC_FAILED
|
|
10313
|
+
* - Sign: RECORD_SIGNED
|
|
10314
|
+
*
|
|
10315
|
+
* @generated from enum agntcy.dir.events.v1.EventType
|
|
10316
|
+
*/
|
|
10317
|
+
const EventType = /*@__PURE__*/
|
|
10318
|
+
tsEnum(EventTypeSchema);
|
|
10319
|
+
|
|
10320
|
+
/**
|
|
10321
|
+
* EventService provides real-time event streaming for all system operations.
|
|
10322
|
+
* Events are delivered from subscription time forward with no history or replay.
|
|
10323
|
+
* This service enables external applications to react to system changes in real-time.
|
|
10324
|
+
*
|
|
10325
|
+
* @generated from service agntcy.dir.events.v1.EventService
|
|
10326
|
+
*/
|
|
10327
|
+
const EventService = /*@__PURE__*/
|
|
10328
|
+
serviceDesc(file_agntcy_dir_events_v1_event_service, 0);
|
|
10329
|
+
|
|
10330
|
+
// Copyright AGNTCY Contributors (https://github.com/agntcy)
|
|
10331
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
10332
|
+
|
|
10333
|
+
var events_v1 = /*#__PURE__*/Object.freeze({
|
|
10334
|
+
__proto__: null,
|
|
10335
|
+
EventSchema: EventSchema,
|
|
10336
|
+
EventService: EventService,
|
|
10337
|
+
EventType: EventType,
|
|
10338
|
+
EventTypeSchema: EventTypeSchema,
|
|
10339
|
+
ListenRequestSchema: ListenRequestSchema,
|
|
10340
|
+
ListenResponseSchema: ListenResponseSchema,
|
|
10341
|
+
file_agntcy_dir_events_v1_event_service: file_agntcy_dir_events_v1_event_service
|
|
10342
|
+
});
|
|
10343
|
+
|
|
10344
|
+
// Copyright AGNTCY Contributors (https://github.com/agntcy)
|
|
10345
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
10346
|
+
|
|
10253
10347
|
var index = /*#__PURE__*/Object.freeze({
|
|
10254
10348
|
__proto__: null,
|
|
10255
10349
|
core_v1: core_v1,
|
|
10350
|
+
events_v1: events_v1,
|
|
10256
10351
|
routing_v1: routing_v1,
|
|
10257
10352
|
search_v1: search_v1,
|
|
10258
10353
|
sign_v1: sign_v1,
|
|
@@ -10372,9 +10467,11 @@ class Client {
|
|
|
10372
10467
|
// Set clients for all services
|
|
10373
10468
|
this.storeClient = createClient(StoreService, grpcTransport);
|
|
10374
10469
|
this.routingClient = createClient(RoutingService, grpcTransport);
|
|
10470
|
+
this.publicationClient = createClient(PublicationService, grpcTransport);
|
|
10375
10471
|
this.searchClient = createClient(SearchService, grpcTransport);
|
|
10376
10472
|
this.signClient = createClient(SignService, grpcTransport);
|
|
10377
10473
|
this.syncClient = createClient(SyncService, grpcTransport);
|
|
10474
|
+
this.eventClient = createClient(EventService, grpcTransport);
|
|
10378
10475
|
}
|
|
10379
10476
|
static convertToPEM(bytes, label) {
|
|
10380
10477
|
// Convert Uint8Array to base64 string
|
|
@@ -10957,6 +11054,68 @@ class Client {
|
|
|
10957
11054
|
async delete_sync(request) {
|
|
10958
11055
|
return await this.syncClient.deleteSync(request);
|
|
10959
11056
|
}
|
|
11057
|
+
/**
|
|
11058
|
+
* Get events from the Event API matching the specified criteria.
|
|
11059
|
+
*
|
|
11060
|
+
* Retrieves a list of events that match the filtering and query criteria
|
|
11061
|
+
* specified in the request.
|
|
11062
|
+
*
|
|
11063
|
+
* @param request - ListenRequest specifying filtering criteria, pagination, etc.
|
|
11064
|
+
* @returns Promise that resolves to an array of ListenResponse objects matching the criteria
|
|
11065
|
+
*
|
|
11066
|
+
* @throws {Error} If the gRPC call fails or the get events operation fails
|
|
11067
|
+
*/
|
|
11068
|
+
listen(request) {
|
|
11069
|
+
return this.eventClient.listen(request);
|
|
11070
|
+
}
|
|
11071
|
+
/**
|
|
11072
|
+
* CreatePublication creates a new publication request that will be processed by the PublicationWorker.
|
|
11073
|
+
* The publication request can specify either a query, a list of specific CIDs,
|
|
11074
|
+
* or all records to be announced to the DHT.
|
|
11075
|
+
*
|
|
11076
|
+
* @param request - PublishRequest containing record references and queries options.
|
|
11077
|
+
*
|
|
11078
|
+
* @returns CreatePublicationResponse returns the result of creating a publication request.
|
|
11079
|
+
* This includes the publication ID and any relevant metadata.
|
|
11080
|
+
*
|
|
11081
|
+
* @throws {Error} If the gRPC call fails or the list operation fails
|
|
11082
|
+
*/
|
|
11083
|
+
async create_publication(request) {
|
|
11084
|
+
return await this.publicationClient.createPublication(request);
|
|
11085
|
+
}
|
|
11086
|
+
/**
|
|
11087
|
+
* ListPublications returns a stream of all publication requests in the system.
|
|
11088
|
+
* This allows monitoring of pending, processing, and completed publication requests.
|
|
11089
|
+
*
|
|
11090
|
+
* @param request - ListPublicationsRequest contains optional filters for listing publication requests.
|
|
11091
|
+
*
|
|
11092
|
+
* @returns Promise that resolves to an array of ListPublicationsItem represents
|
|
11093
|
+
* a single publication request in the list response.
|
|
11094
|
+
* Contains publication details including ID, status, and creation timestamp.
|
|
11095
|
+
*
|
|
11096
|
+
* @throws {Error} If the gRPC call fails or the list operation fails
|
|
11097
|
+
*/
|
|
11098
|
+
async list_publication(request) {
|
|
11099
|
+
const results = [];
|
|
11100
|
+
for await (const response of this.publicationClient.listPublications(request)) {
|
|
11101
|
+
results.push(response);
|
|
11102
|
+
}
|
|
11103
|
+
return results;
|
|
11104
|
+
}
|
|
11105
|
+
/**
|
|
11106
|
+
* GetPublication retrieves details of a specific publication request by its identifier.
|
|
11107
|
+
* This includes the current status and any associated metadata.
|
|
11108
|
+
*
|
|
11109
|
+
* @param request - GetPublicationRequest specifies which publication to retrieve by its identifier.
|
|
11110
|
+
*
|
|
11111
|
+
* @returns GetPublicationResponse contains the full details of a specific publication request.
|
|
11112
|
+
* Includes status, progress information, and any error details if applicable.
|
|
11113
|
+
*
|
|
11114
|
+
* @throws {Error} If the gRPC call fails or the get operation fails
|
|
11115
|
+
*/
|
|
11116
|
+
async get_publication(request) {
|
|
11117
|
+
return await this.publicationClient.getPublication(request);
|
|
11118
|
+
}
|
|
10960
11119
|
/**
|
|
10961
11120
|
* Sign a record using a private key.
|
|
10962
11121
|
*
|