@okee-e2ee/protocol 0.1.2 → 0.1.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.
@@ -1,3 +1,4 @@
1
1
  export * from "./relay-constants";
2
2
  export * from "./transport-context";
3
+ export * from "./transport-packet-constants";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from "./relay-constants";
2
2
  export * from "./transport-context";
3
+ export * from "./transport-packet-constants";
@@ -0,0 +1,2 @@
1
+ export declare const TRANSPORT_PACKET_FORMAT_VERSION = 1;
2
+ //# sourceMappingURL=transport-packet-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-packet-constants.d.ts","sourceRoot":"","sources":["../../../src/transport/constants/transport-packet-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,IAAI,CAAC"}
@@ -0,0 +1 @@
1
+ export const TRANSPORT_PACKET_FORMAT_VERSION = 1;
@@ -1,4 +1,6 @@
1
1
  export * from "./queue-model";
2
2
  export * from "./relay-address";
3
3
  export * from "./relay-key-bundle";
4
+ export * from "./transport-command";
5
+ export * from "./transport-packet";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export * from "./queue-model";
2
2
  export * from "./relay-address";
3
3
  export * from "./relay-key-bundle";
4
+ export * from "./transport-command";
5
+ export * from "./transport-packet";
@@ -1,13 +1,20 @@
1
- import { Branded, Bytes, PublicKey } from "../../crypto-core";
1
+ import { Branded, Bytes, XWingPublicKey } from "../../crypto-core";
2
+ import { HybridSignaturePublicKey } from "../../crypto-core/signature/model";
2
3
  import { RelayAddress } from "./relay-address";
3
4
  export type RecipientQueueId = Branded<string, "TransportRecipientQueueId">;
4
5
  export type SenderQueueId = Branded<string, "TransportSenderQueueId">;
5
- export type TransportOperationId = Branded<string, "TransportOperationId">;
6
6
  export type DeliveryId = Branded<string, "TransportDeliveryId">;
7
- export type RecipientHybridAuthPublicKey = PublicKey<Bytes, "TransportRecipientHybridAuth">;
8
- export type SenderHybridAuthPublicKey = PublicKey<Bytes, "TransportSenderHybridAuth">;
7
+ export type RecipientHybridAuthPublicKey = Branded<HybridSignaturePublicKey, "TransportRecipientHybridAuthPublicKey">;
8
+ export type SenderHybridAuthPublicKey = Branded<HybridSignaturePublicKey, "TransportSenderHybridAuthPublicKey">;
9
9
  export type QueueSetupCapability = Branded<Bytes, "TransportQueueSetupCapability">;
10
10
  export type QueueSetupVerifier = Branded<Bytes, "TransportQueueSetupVerifier">;
11
+ export type QueueRegistration = {
12
+ readonly recipientQueueId: RecipientQueueId;
13
+ readonly senderQueueId: SenderQueueId;
14
+ readonly recipientAuthPublicKey: RecipientHybridAuthPublicKey;
15
+ readonly d2rPublicKey: XWingPublicKey;
16
+ readonly setupVerifier: QueueSetupVerifier;
17
+ };
11
18
  export type SendQueueAddress = {
12
19
  readonly senderQueueId: SenderQueueId;
13
20
  readonly relay: RelayAddress;
@@ -1 +1 @@
1
- {"version":3,"file":"queue-model.d.ts","sourceRoot":"","sources":["../../../src/transport/model/queue-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;AAC5E,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AAEhE,MAAM,MAAM,4BAA4B,GAAG,SAAS,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC;AAC5F,MAAM,MAAM,yBAAyB,GAAG,SAAS,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC;AAEtF,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,KAAK,EAAE,+BAA+B,CAAC,CAAC;AACnF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,KAAK,EAAE,6BAA6B,CAAC,CAAC;AAE/E,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,oBAAoB,CAAC;CAC/C,CAAC"}
1
+ {"version":3,"file":"queue-model.d.ts","sourceRoot":"","sources":["../../../src/transport/model/queue-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC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queue-model";
3
+ export declare enum TransportCommandType {
4
+ HEALTH = 0,
5
+ CREATE_QUEUE = 1,
6
+ REMOVE_QUEUE = 2,
7
+ SUBSCRIBE_QUEUE = 3,
8
+ UNSUBSCRIBE_QUEUE = 4,
9
+ SEND = 5,
10
+ ACK = 6
11
+ }
12
+ export type HealthCommandRequestPayload = undefined;
13
+ export type CreateQueueCommandRequestPayload = {
14
+ readonly registration: QueueRegistration;
15
+ };
16
+ export type RemoveQueueCommandRequestPayload = {
17
+ readonly recipientQueueId: RecipientQueueId;
18
+ };
19
+ export type SubscribeQueueCommandRequestPayload = {
20
+ readonly recipientQueueId: RecipientQueueId;
21
+ };
22
+ export type UnsubscribeQueueCommandRequestPayload = {
23
+ readonly recipientQueueId: RecipientQueueId;
24
+ };
25
+ type SendCommandRequestPayloadBase = {
26
+ readonly senderQueueId: SenderQueueId;
27
+ readonly deliveryId: DeliveryId;
28
+ readonly payload: Bytes;
29
+ };
30
+ export type SendCommandRequestPayload = SendCommandRequestPayloadBase & ({
31
+ readonly setupCapability: QueueSetupCapability;
32
+ readonly senderAuthPublicKey: SenderHybridAuthPublicKey;
33
+ } | {
34
+ readonly setupCapability?: never;
35
+ readonly senderAuthPublicKey?: never;
36
+ });
37
+ export type AckCommandRequestPayload = {
38
+ readonly recipientQueueId: RecipientQueueId;
39
+ readonly deliveryIds: readonly DeliveryId[];
40
+ };
41
+ export type TransportRequestPayloadMap = {
42
+ readonly [TransportCommandType.HEALTH]: HealthCommandRequestPayload;
43
+ readonly [TransportCommandType.CREATE_QUEUE]: CreateQueueCommandRequestPayload;
44
+ readonly [TransportCommandType.REMOVE_QUEUE]: RemoveQueueCommandRequestPayload;
45
+ readonly [TransportCommandType.SUBSCRIBE_QUEUE]: SubscribeQueueCommandRequestPayload;
46
+ readonly [TransportCommandType.UNSUBSCRIBE_QUEUE]: UnsubscribeQueueCommandRequestPayload;
47
+ readonly [TransportCommandType.SEND]: SendCommandRequestPayload;
48
+ readonly [TransportCommandType.ACK]: AckCommandRequestPayload;
49
+ };
50
+ export type HealthCommandResponsePayload = undefined;
51
+ export type CreateQueueCommandResponsePayload = {
52
+ readonly recipientQueueId: RecipientQueueId;
53
+ readonly senderQueueId: SenderQueueId;
54
+ };
55
+ export type RemoveQueueCommandResponsePayload = {
56
+ readonly recipientQueueId: RecipientQueueId;
57
+ };
58
+ export type SubscribeQueueCommandResponsePayload = {
59
+ readonly recipientQueueId: RecipientQueueId;
60
+ };
61
+ export type UnsubscribeQueueCommandResponsePayload = {
62
+ readonly recipientQueueId: RecipientQueueId;
63
+ };
64
+ export type SendCommandResponsePayload = {
65
+ readonly senderQueueId: SenderQueueId;
66
+ readonly deliveryId: DeliveryId;
67
+ };
68
+ export type AckCommandResponsePayload = {
69
+ readonly recipientQueueId: RecipientQueueId;
70
+ readonly deliveryIds: readonly DeliveryId[];
71
+ };
72
+ export type TransportResponsePayloadMap = {
73
+ readonly [TransportCommandType.HEALTH]: HealthCommandResponsePayload;
74
+ readonly [TransportCommandType.CREATE_QUEUE]: CreateQueueCommandResponsePayload;
75
+ readonly [TransportCommandType.REMOVE_QUEUE]: RemoveQueueCommandResponsePayload;
76
+ readonly [TransportCommandType.SUBSCRIBE_QUEUE]: SubscribeQueueCommandResponsePayload;
77
+ readonly [TransportCommandType.UNSUBSCRIBE_QUEUE]: UnsubscribeQueueCommandResponsePayload;
78
+ readonly [TransportCommandType.SEND]: SendCommandResponsePayload;
79
+ readonly [TransportCommandType.ACK]: AckCommandResponsePayload;
80
+ };
81
+ export {};
82
+ //# sourceMappingURL=transport-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-command.d.ts","sourceRoot":"","sources":["../../../src/transport/model/transport-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExD,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,MAAM,eAAe,CA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C,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACzC,QAAQ,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,4BAA4B,CAAC;IACrE,QAAQ,CAAC,CAAC,oBAAoB,CAAC,YAAY,CAAC,EAAE,iCAAiC,CAAC;IAChF,QAAQ,CAAC,CAAC,oBAAoB,CAAC,YAAY,CAAC,EAAE,iCAAiC,CAAC;IAChF,QAAQ,CAAC,CAAC,oBAAoB,CAAC,eAAe,CAAC,EAAE,oCAAoC,CAAC;IACtF,QAAQ,CAAC,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,sCAAsC,CAAC;IAC1F,QAAQ,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,0BAA0B,CAAC;IACjE,QAAQ,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,yBAAyB,CAAC;CAC/D,CAAC"}
@@ -0,0 +1,10 @@
1
+ export var TransportCommandType;
2
+ (function (TransportCommandType) {
3
+ TransportCommandType[TransportCommandType["HEALTH"] = 0] = "HEALTH";
4
+ TransportCommandType[TransportCommandType["CREATE_QUEUE"] = 1] = "CREATE_QUEUE";
5
+ TransportCommandType[TransportCommandType["REMOVE_QUEUE"] = 2] = "REMOVE_QUEUE";
6
+ TransportCommandType[TransportCommandType["SUBSCRIBE_QUEUE"] = 3] = "SUBSCRIBE_QUEUE";
7
+ TransportCommandType[TransportCommandType["UNSUBSCRIBE_QUEUE"] = 4] = "UNSUBSCRIBE_QUEUE";
8
+ TransportCommandType[TransportCommandType["SEND"] = 5] = "SEND";
9
+ TransportCommandType[TransportCommandType["ACK"] = 6] = "ACK";
10
+ })(TransportCommandType || (TransportCommandType = {}));
@@ -0,0 +1,64 @@
1
+ import { Branded, Bytes } from "../../crypto-core";
2
+ import { HybridSignature } from "../../crypto-core/signature/model";
3
+ import { TRANSPORT_PACKET_FORMAT_VERSION } from "../constants";
4
+ import { DeliveryId, RecipientQueueId } from "./queue-model";
5
+ import { TransportCommandType, TransportRequestPayloadMap, TransportResponsePayloadMap } from "./transport-command";
6
+ export type RequestId = Branded<string, "TransportRequestId">;
7
+ export declare enum TransportPacketType {
8
+ REQUEST = 0,
9
+ DELIVERY = 1,
10
+ RESPONSE = 2
11
+ }
12
+ export declare enum TransportResponseStatus {
13
+ ERROR = 0,
14
+ SUCCESS = 1
15
+ }
16
+ type TransportRequestPacketBase<C extends TransportCommandType> = {
17
+ readonly formatVersion: typeof TRANSPORT_PACKET_FORMAT_VERSION;
18
+ readonly type: TransportPacketType.REQUEST;
19
+ readonly requestId: RequestId;
20
+ readonly command: C;
21
+ readonly payload: TransportRequestPayloadMap[C];
22
+ };
23
+ export type TransportHealthRequestPacket = TransportRequestPacketBase<TransportCommandType.HEALTH> & {
24
+ readonly authorization?: never;
25
+ };
26
+ type AuthorizedTransportCommandType = Exclude<TransportCommandType, TransportCommandType.HEALTH>;
27
+ export type TransportAuthorizedRequestPacket = {
28
+ readonly [C in AuthorizedTransportCommandType]: TransportRequestPacketBase<C> & {
29
+ readonly authorization: HybridSignature;
30
+ };
31
+ }[AuthorizedTransportCommandType];
32
+ export type TransportRequestPacket = TransportHealthRequestPacket | TransportAuthorizedRequestPacket;
33
+ type TransportResponsePacketBase<C extends TransportCommandType> = {
34
+ readonly formatVersion: typeof TRANSPORT_PACKET_FORMAT_VERSION;
35
+ readonly type: TransportPacketType.RESPONSE;
36
+ readonly requestId: RequestId;
37
+ readonly command: C;
38
+ };
39
+ export type TransportSuccessResponsePacket = {
40
+ readonly [C in TransportCommandType]: TransportResponsePacketBase<C> & {
41
+ readonly status: TransportResponseStatus.SUCCESS;
42
+ readonly payload: TransportResponsePayloadMap[C];
43
+ };
44
+ }[TransportCommandType];
45
+ export type TransportErrorResponsePacket = {
46
+ readonly [C in TransportCommandType]: TransportResponsePacketBase<C> & {
47
+ readonly status: TransportResponseStatus.ERROR;
48
+ readonly errorCode: number;
49
+ };
50
+ }[TransportCommandType];
51
+ export type TransportResponsePacket = TransportSuccessResponsePacket | TransportErrorResponsePacket;
52
+ export type TransportDelivery = {
53
+ readonly deliveryId: DeliveryId;
54
+ readonly payload: Bytes;
55
+ };
56
+ export type TransportDeliveryPacket = {
57
+ readonly formatVersion: typeof TRANSPORT_PACKET_FORMAT_VERSION;
58
+ readonly type: TransportPacketType.DELIVERY;
59
+ readonly recipientQueueId: RecipientQueueId;
60
+ readonly deliveries: readonly TransportDelivery[];
61
+ };
62
+ export type TransportPacket = TransportRequestPacket | TransportResponsePacket | TransportDeliveryPacket;
63
+ export {};
64
+ //# sourceMappingURL=transport-packet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-packet.d.ts","sourceRoot":"","sources":["../../../src/transport/model/transport-packet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAElF,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACN,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAE9D,oBAAY,mBAAmB;IAC9B,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,QAAQ,IAAI;CACZ;AAED,oBAAY,uBAAuB;IAClC,KAAK,IAAI;IACT,OAAO,IAAI;CACX;AAED,KAAK,0BAA0B,CAAC,CAAC,SAAS,oBAAoB,IAAI;IACjE,QAAQ,CAAC,aAAa,EAAE,OAAO,+BAA+B,CAAC;IAC/D,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CA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AAG;QACtE,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC;QAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC3B;CACD,CAAC,oBAAoB,CAAC,CAAC;AAExB,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,GAAG,4BAA4B,CAAC;AAEpG,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,CAAC,aAAa,EAAE,OAAO,+BAA+B,CAAC;IAC/D,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC;IAC5C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,eAAe,GAC1B,sBAAsB,GAAG,uBAAuB,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export var TransportPacketType;
2
+ (function (TransportPacketType) {
3
+ TransportPacketType[TransportPacketType["REQUEST"] = 0] = "REQUEST";
4
+ TransportPacketType[TransportPacketType["DELIVERY"] = 1] = "DELIVERY";
5
+ TransportPacketType[TransportPacketType["RESPONSE"] = 2] = "RESPONSE";
6
+ })(TransportPacketType || (TransportPacketType = {}));
7
+ export var TransportResponseStatus;
8
+ (function (TransportResponseStatus) {
9
+ TransportResponseStatus[TransportResponseStatus["ERROR"] = 0] = "ERROR";
10
+ TransportResponseStatus[TransportResponseStatus["SUCCESS"] = 1] = "SUCCESS";
11
+ })(TransportResponseStatus || (TransportResponseStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okee-e2ee/protocol",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Shared cryptographic and wire protocol definitions for Okee clients and relays",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",