@okee-e2ee/protocol 0.1.2 → 0.1.4

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 (100) hide show
  1. package/dist/crypto-core/model/brand.d.ts +4 -0
  2. package/dist/crypto-core/model/brand.d.ts.map +1 -1
  3. package/dist/crypto-core/signature/codecs/HybridSignatureCodec.d.ts +10 -0
  4. package/dist/crypto-core/signature/codecs/HybridSignatureCodec.d.ts.map +1 -0
  5. package/dist/crypto-core/signature/codecs/HybridSignatureCodec.js +27 -0
  6. package/dist/crypto-core/signature/codecs/HybridSignaturePublicKeyCodec.d.ts +10 -0
  7. package/dist/crypto-core/signature/codecs/HybridSignaturePublicKeyCodec.d.ts.map +1 -0
  8. package/dist/{transport/codecs/RelayIdentityPublicKeyCodec.js → crypto-core/signature/codecs/HybridSignaturePublicKeyCodec.js} +3 -3
  9. package/dist/crypto-core/signature/codecs/index.d.ts +3 -0
  10. package/dist/crypto-core/signature/codecs/index.d.ts.map +1 -0
  11. package/dist/crypto-core/signature/codecs/index.js +2 -0
  12. package/dist/crypto-core/signature/index.d.ts +1 -0
  13. package/dist/crypto-core/signature/index.d.ts.map +1 -1
  14. package/dist/crypto-core/signature/index.js +1 -0
  15. package/dist/transport/codecs/DestinationSendRequestCodec.d.ts +10 -0
  16. package/dist/transport/codecs/DestinationSendRequestCodec.d.ts.map +1 -0
  17. package/dist/transport/codecs/DestinationSendRequestCodec.js +34 -0
  18. package/dist/transport/codecs/DestinationSendResponseCodec.d.ts +10 -0
  19. package/dist/transport/codecs/DestinationSendResponseCodec.d.ts.map +1 -0
  20. package/dist/transport/codecs/DestinationSendResponseCodec.js +65 -0
  21. package/dist/transport/codecs/TransportPacketCodec.d.ts +15 -0
  22. package/dist/transport/codecs/TransportPacketCodec.d.ts.map +1 -0
  23. package/dist/transport/codecs/TransportPacketCodec.js +214 -0
  24. package/dist/transport/codecs/encode-destination-send-authorization-input.d.ts +4 -0
  25. package/dist/transport/codecs/encode-destination-send-authorization-input.d.ts.map +1 -0
  26. package/dist/transport/codecs/encode-destination-send-authorization-input.js +6 -0
  27. package/dist/transport/codecs/encode-relay-key-bundle-signature-input.d.ts.map +1 -0
  28. package/dist/transport/{helpers → codecs}/encode-relay-key-bundle-signature-input.js +1 -1
  29. package/dist/transport/codecs/encode-s2d-associated-data.d.ts +5 -0
  30. package/dist/transport/codecs/encode-s2d-associated-data.d.ts.map +1 -0
  31. package/dist/transport/codecs/encode-s2d-associated-data.js +19 -0
  32. package/dist/transport/codecs/encode-transport-request-authorization-input.d.ts +4 -0
  33. package/dist/transport/codecs/encode-transport-request-authorization-input.d.ts.map +1 -0
  34. package/dist/transport/codecs/encode-transport-request-authorization-input.js +35 -0
  35. package/dist/transport/codecs/index.d.ts +7 -2
  36. package/dist/transport/codecs/index.d.ts.map +1 -1
  37. package/dist/transport/codecs/index.js +7 -2
  38. package/dist/transport/codecs/internal/InternalCodec.d.ts +7 -0
  39. package/dist/transport/codecs/internal/InternalCodec.d.ts.map +1 -0
  40. package/dist/transport/codecs/internal/InternalCodec.js +16 -0
  41. package/dist/transport/codecs/{RelayEncryptionKeyBundleCodec.d.ts → internal/RelayEncryptionKeyBundleCodec.d.ts} +2 -3
  42. package/dist/transport/codecs/internal/RelayEncryptionKeyBundleCodec.d.ts.map +1 -0
  43. package/dist/transport/codecs/{RelayEncryptionKeyBundleCodec.js → internal/RelayEncryptionKeyBundleCodec.js} +4 -5
  44. package/dist/transport/codecs/internal/S2DEncryptedRequestCodec.d.ts +9 -0
  45. package/dist/transport/codecs/internal/S2DEncryptedRequestCodec.d.ts.map +1 -0
  46. package/dist/transport/codecs/internal/S2DEncryptedRequestCodec.js +45 -0
  47. package/dist/transport/codecs/internal/S2DEncryptedResponseCodec.d.ts +9 -0
  48. package/dist/transport/codecs/internal/S2DEncryptedResponseCodec.d.ts.map +1 -0
  49. package/dist/transport/codecs/internal/S2DEncryptedResponseCodec.js +38 -0
  50. package/dist/transport/codecs/internal/SignedRelayEncryptionKeyBundleCodec.d.ts +9 -0
  51. package/dist/transport/codecs/internal/SignedRelayEncryptionKeyBundleCodec.d.ts.map +1 -0
  52. package/dist/transport/codecs/internal/SignedRelayEncryptionKeyBundleCodec.js +35 -0
  53. package/dist/transport/codecs/internal/destination-send-codec-helpers.d.ts +5 -0
  54. package/dist/transport/codecs/internal/destination-send-codec-helpers.d.ts.map +1 -0
  55. package/dist/transport/codecs/internal/destination-send-codec-helpers.js +58 -0
  56. package/dist/transport/codecs/internal/transport-payload-codecs.d.ts +7 -0
  57. package/dist/transport/codecs/internal/transport-payload-codecs.d.ts.map +1 -0
  58. package/dist/transport/codecs/internal/transport-payload-codecs.js +128 -0
  59. package/dist/transport/constants/index.d.ts +1 -0
  60. package/dist/transport/constants/index.d.ts.map +1 -1
  61. package/dist/transport/constants/index.js +1 -0
  62. package/dist/transport/constants/relay-constants.d.ts +5 -0
  63. package/dist/transport/constants/relay-constants.d.ts.map +1 -1
  64. package/dist/transport/constants/relay-constants.js +5 -0
  65. package/dist/transport/constants/transport-packet-constants.d.ts +5 -0
  66. package/dist/transport/constants/transport-packet-constants.d.ts.map +1 -0
  67. package/dist/transport/constants/transport-packet-constants.js +4 -0
  68. package/dist/transport/helpers/derive-relay-identity-fingerprint.d.ts.map +1 -1
  69. package/dist/transport/helpers/derive-relay-identity-fingerprint.js +2 -3
  70. package/dist/transport/helpers/derive-s2d-key-material.d.ts +4 -0
  71. package/dist/transport/helpers/derive-s2d-key-material.d.ts.map +1 -0
  72. package/dist/transport/helpers/derive-s2d-key-material.js +25 -0
  73. package/dist/transport/helpers/index.d.ts +1 -1
  74. package/dist/transport/helpers/index.d.ts.map +1 -1
  75. package/dist/transport/helpers/index.js +1 -1
  76. package/dist/transport/model/destination-send.d.ts +44 -0
  77. package/dist/transport/model/destination-send.d.ts.map +1 -0
  78. package/dist/transport/model/destination-send.js +14 -0
  79. package/dist/transport/model/index.d.ts +4 -0
  80. package/dist/transport/model/index.d.ts.map +1 -1
  81. package/dist/transport/model/index.js +4 -0
  82. package/dist/transport/model/queue-model.d.ts +11 -4
  83. package/dist/transport/model/queue-model.d.ts.map +1 -1
  84. package/dist/transport/model/relay-key-bundle.d.ts +2 -2
  85. package/dist/transport/model/relay-key-bundle.d.ts.map +1 -1
  86. package/dist/transport/model/s2d-envelope.d.ts +28 -0
  87. package/dist/transport/model/s2d-envelope.d.ts.map +1 -0
  88. package/dist/transport/model/s2d-envelope.js +1 -0
  89. package/dist/transport/model/transport-command.d.ts +94 -0
  90. package/dist/transport/model/transport-command.d.ts.map +1 -0
  91. package/dist/transport/model/transport-command.js +19 -0
  92. package/dist/transport/model/transport-packet.d.ts +73 -0
  93. package/dist/transport/model/transport-packet.d.ts.map +1 -0
  94. package/dist/transport/model/transport-packet.js +11 -0
  95. package/package.json +1 -1
  96. package/dist/transport/codecs/RelayEncryptionKeyBundleCodec.d.ts.map +0 -1
  97. package/dist/transport/codecs/RelayIdentityPublicKeyCodec.d.ts +0 -10
  98. package/dist/transport/codecs/RelayIdentityPublicKeyCodec.d.ts.map +0 -1
  99. package/dist/transport/helpers/encode-relay-key-bundle-signature-input.d.ts.map +0 -1
  100. /package/dist/transport/{helpers → codecs}/encode-relay-key-bundle-signature-input.d.ts +0 -0
@@ -0,0 +1,14 @@
1
+ export var DestinationSendResponseStatus;
2
+ (function (DestinationSendResponseStatus) {
3
+ DestinationSendResponseStatus[DestinationSendResponseStatus["ERROR"] = 0] = "ERROR";
4
+ DestinationSendResponseStatus[DestinationSendResponseStatus["SUCCESS"] = 1] = "SUCCESS";
5
+ })(DestinationSendResponseStatus || (DestinationSendResponseStatus = {}));
6
+ export var DestinationSendErrorCode;
7
+ (function (DestinationSendErrorCode) {
8
+ DestinationSendErrorCode[DestinationSendErrorCode["QUEUE_NOT_FOUND"] = 0] = "QUEUE_NOT_FOUND";
9
+ DestinationSendErrorCode[DestinationSendErrorCode["AUTHORIZATION_INVALID"] = 1] = "AUTHORIZATION_INVALID";
10
+ DestinationSendErrorCode[DestinationSendErrorCode["SETUP_CAPABILITY_INVALID"] = 2] = "SETUP_CAPABILITY_INVALID";
11
+ DestinationSendErrorCode[DestinationSendErrorCode["SENDER_KEY_CONFLICT"] = 3] = "SENDER_KEY_CONFLICT";
12
+ DestinationSendErrorCode[DestinationSendErrorCode["DELIVERY_CONFLICT"] = 4] = "DELIVERY_CONFLICT";
13
+ DestinationSendErrorCode[DestinationSendErrorCode["PAYLOAD_TOO_LARGE"] = 5] = "PAYLOAD_TOO_LARGE";
14
+ })(DestinationSendErrorCode || (DestinationSendErrorCode = {}));
@@ -1,4 +1,8 @@
1
+ export * from "./destination-send";
1
2
  export * from "./queue-model";
2
3
  export * from "./relay-address";
3
4
  export * from "./relay-key-bundle";
5
+ export * from "./s2d-envelope";
6
+ export * from "./transport-command";
7
+ export * from "./transport-packet";
4
8
  //# 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,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -1,3 +1,7 @@
1
+ export * from "./destination-send";
1
2
  export * from "./queue-model";
2
3
  export * from "./relay-address";
3
4
  export * from "./relay-key-bundle";
5
+ export * from "./s2d-envelope";
6
+ export * from "./transport-command";
7
+ 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,C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,MAAM,yBAAyB,GAAG,OAAO,CAC9C,wBAAwB,EACxB,oCAAoC,CACpC,CAAC;AAEF,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,iBAAiB,GAAG;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;IAC9D,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;CAC3C,CAAC;AAEF,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,10 +1,10 @@
1
1
  import { Branded, XWingPublicKey } from "../../crypto-core";
2
2
  import { HybridSignature } from "../../crypto-core/signature/model";
3
3
  import { RELAY_KEY_BUNDLE_FORMAT_VERSION } from "../constants";
4
- export type RelayEncryptionKeyId = Branded<bigint, "TransportRelayEncryptionKeyId">;
4
+ export type RelayEncryptionKeyEpoch = Branded<bigint, "TransportRelayEncryptionKeyEpoch">;
5
5
  export type RelayEncryptionKeyBundle = {
6
6
  readonly formatVersion: typeof RELAY_KEY_BUNDLE_FORMAT_VERSION;
7
- readonly keyId: RelayEncryptionKeyId;
7
+ readonly epoch: RelayEncryptionKeyEpoch;
8
8
  readonly publicKey: XWingPublicKey;
9
9
  readonly validFrom: bigint;
10
10
  readonly expiresAt: bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"relay-key-bundle.d.ts","sourceRoot":"","sources":["../../../src/trans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AAS,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,GAAG;IACvE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;CACpC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { Bytes, EncryptedPayload, XWingCiphertext } from "../../crypto-core";
2
+ import { S2D_ENVELOPE_FORMAT_VERSION } from "../constants";
3
+ import { RelayAddress } from "./relay-address";
4
+ import { RelayEncryptionKeyEpoch } from "./relay-key-bundle";
5
+ import type { RequestId } from "./transport-packet";
6
+ export type S2DKeyMaterial = {
7
+ readonly requestKey: Bytes;
8
+ readonly requestNonce: Bytes;
9
+ readonly responseKey: Bytes;
10
+ readonly responseNonce: Bytes;
11
+ };
12
+ export type S2DAssociatedDataInput = {
13
+ readonly requestId: RequestId;
14
+ readonly destination: RelayAddress;
15
+ readonly epoch: RelayEncryptionKeyEpoch;
16
+ readonly encapsulation: XWingCiphertext;
17
+ };
18
+ export type S2DEncryptedRequest<T> = {
19
+ readonly formatVersion: typeof S2D_ENVELOPE_FORMAT_VERSION;
20
+ readonly epoch: RelayEncryptionKeyEpoch;
21
+ readonly encapsulation: XWingCiphertext;
22
+ readonly ciphertext: EncryptedPayload<T>;
23
+ };
24
+ export type S2DEncryptedResponse<T> = {
25
+ readonly formatVersion: typeof S2D_ENVELOPE_FORMAT_VERSION;
26
+ readonly ciphertext: EncryptedPayload<T>;
27
+ };
28
+ //# sourceMappingURL=s2d-envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s2d-envelope.d.ts","sourceRoot":"","sources":["../../../src/transport/model/s2d-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACpC,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,CAAC;IAC3D,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACrC,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,CAAC;IAC3D,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACzC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,94 @@
1
+ import { HybridSignaturePublicKey } from "../../crypto-core";
2
+ import { DestinationSendRequest, DestinationSendResponse } from "./destination-send";
3
+ import { DeliveryId, QueueRegistration, RecipientQueueId, SenderQueueId } from "./queue-model";
4
+ import { RelayAddress } from "./relay-address";
5
+ import { SignedRelayEncryptionKeyBundle } from "./relay-key-bundle";
6
+ import { S2DEncryptedRequest, S2DEncryptedResponse } from "./s2d-envelope";
7
+ export declare enum TransportCommandType {
8
+ HEALTH = 0,
9
+ CREATE_QUEUE = 1,
10
+ REMOVE_QUEUE = 2,
11
+ SUBSCRIBE_QUEUE = 3,
12
+ UNSUBSCRIBE_QUEUE = 4,
13
+ SEND = 5,
14
+ ACK = 6,
15
+ GET_DESTINATION_BUNDLE = 7
16
+ }
17
+ export declare enum TransportErrorCode {
18
+ UNAVAILABLE = 0,
19
+ TIMEOUT = 1,
20
+ KEY_UNKNOWN = 2,
21
+ KEY_EXPIRED = 3,
22
+ RESPONSE_INVALID = 4
23
+ }
24
+ export type HealthCommandRequestPayload = undefined;
25
+ export type CreateQueueCommandRequestPayload = {
26
+ readonly registration: QueueRegistration;
27
+ };
28
+ export type RemoveQueueCommandRequestPayload = {
29
+ readonly recipientQueueId: RecipientQueueId;
30
+ };
31
+ export type SubscribeQueueCommandRequestPayload = {
32
+ readonly recipientQueueId: RecipientQueueId;
33
+ };
34
+ export type UnsubscribeQueueCommandRequestPayload = {
35
+ readonly recipientQueueId: RecipientQueueId;
36
+ };
37
+ export type GetDestinationBundleCommandRequestPayload = {
38
+ readonly destination: RelayAddress;
39
+ };
40
+ export type SendCommandRequestPayload = {
41
+ readonly destination: RelayAddress;
42
+ readonly encryptedRequest: S2DEncryptedRequest<DestinationSendRequest>;
43
+ };
44
+ export type AckCommandRequestPayload = {
45
+ readonly recipientQueueId: RecipientQueueId;
46
+ readonly deliveryIds: readonly DeliveryId[];
47
+ };
48
+ export type TransportRequestPayloadMap = {
49
+ readonly [TransportCommandType.HEALTH]: HealthCommandRequestPayload;
50
+ readonly [TransportCommandType.CREATE_QUEUE]: CreateQueueCommandRequestPayload;
51
+ readonly [TransportCommandType.REMOVE_QUEUE]: RemoveQueueCommandRequestPayload;
52
+ readonly [TransportCommandType.SUBSCRIBE_QUEUE]: SubscribeQueueCommandRequestPayload;
53
+ readonly [TransportCommandType.UNSUBSCRIBE_QUEUE]: UnsubscribeQueueCommandRequestPayload;
54
+ readonly [TransportCommandType.SEND]: SendCommandRequestPayload;
55
+ readonly [TransportCommandType.ACK]: AckCommandRequestPayload;
56
+ readonly [TransportCommandType.GET_DESTINATION_BUNDLE]: GetDestinationBundleCommandRequestPayload;
57
+ };
58
+ export type HealthCommandResponsePayload = undefined;
59
+ export type CreateQueueCommandResponsePayload = {
60
+ readonly recipientQueueId: RecipientQueueId;
61
+ readonly senderQueueId: SenderQueueId;
62
+ };
63
+ export type RemoveQueueCommandResponsePayload = {
64
+ readonly recipientQueueId: RecipientQueueId;
65
+ };
66
+ export type SubscribeQueueCommandResponsePayload = {
67
+ readonly recipientQueueId: RecipientQueueId;
68
+ };
69
+ export type UnsubscribeQueueCommandResponsePayload = {
70
+ readonly recipientQueueId: RecipientQueueId;
71
+ };
72
+ export type GetDestinationBundleCommandResponsePayload = {
73
+ readonly destination: RelayAddress;
74
+ readonly identityPublicKey: HybridSignaturePublicKey;
75
+ readonly bundle: SignedRelayEncryptionKeyBundle;
76
+ };
77
+ export type SendCommandResponsePayload = {
78
+ readonly encryptedResponse: S2DEncryptedResponse<DestinationSendResponse>;
79
+ };
80
+ export type AckCommandResponsePayload = {
81
+ readonly recipientQueueId: RecipientQueueId;
82
+ readonly deliveryIds: readonly DeliveryId[];
83
+ };
84
+ export type TransportResponsePayloadMap = {
85
+ readonly [TransportCommandType.HEALTH]: HealthCommandResponsePayload;
86
+ readonly [TransportCommandType.CREATE_QUEUE]: CreateQueueCommandResponsePayload;
87
+ readonly [TransportCommandType.REMOVE_QUEUE]: RemoveQueueCommandResponsePayload;
88
+ readonly [TransportCommandType.SUBSCRIBE_QUEUE]: SubscribeQueueCommandResponsePayload;
89
+ readonly [TransportCommandType.UNSUBSCRIBE_QUEUE]: UnsubscribeQueueCommandResponsePayload;
90
+ readonly [TransportCommandType.SEND]: SendCommandResponsePayload;
91
+ readonly [TransportCommandType.ACK]: AckCommandResponsePayload;
92
+ readonly [TransportCommandType.GET_DESTINATION_BUNDLE]: GetDestinationBundleCommandResponsePayload;
93
+ };
94
+ //# 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,EAAS,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3E,oBAAY,oBAAoB;IAC/B,MAAM,IAAI;IACV,YAAY,IAAI;IAChB,YAAY,IAAI;IAChB,eAAe,IAAI;IACnB,iBAAiB,IAAI;IACrB,IAAI,IAAI;IACR,GAAG,IAAI;IACP,sBAAsB,IAAI;CAC1B;AAED,oBAAY,kBAAkB;IAC7B,WAAW,IAAI;IACf,OAAO,IAAI;IACX,WAAW,IAAI;IACf,WAAW,IAAI;IACf,gBAAgB,IAAI;CACpB;AAED,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC;AAEpD,MAAM,MAAM,gCAAgC,GAAG;IAC9C,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IACjD,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IACnD,QAAQ,CAAC,gBAAgB,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,oBAAoB,CAAC,GAAG,CAAC,EAAE,yBAAyB,CAAC;IAC/D,QAAQ,CAAC,CAAC,oBAAoB,CAAC,sBAAsB,CAAC,EAAE,0CAA0C,CAAC;CACnG,CAAC"}
@@ -0,0 +1,19 @@
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["GET_DESTINATION_BUNDLE"] = 7] = "GET_DESTINATION_BUNDLE";
11
+ })(TransportCommandType || (TransportCommandType = {}));
12
+ export var TransportErrorCode;
13
+ (function (TransportErrorCode) {
14
+ TransportErrorCode[TransportErrorCode["UNAVAILABLE"] = 0] = "UNAVAILABLE";
15
+ TransportErrorCode[TransportErrorCode["TIMEOUT"] = 1] = "TIMEOUT";
16
+ TransportErrorCode[TransportErrorCode["KEY_UNKNOWN"] = 2] = "KEY_UNKNOWN";
17
+ TransportErrorCode[TransportErrorCode["KEY_EXPIRED"] = 3] = "KEY_EXPIRED";
18
+ TransportErrorCode[TransportErrorCode["RESPONSE_INVALID"] = 4] = "RESPONSE_INVALID";
19
+ })(TransportErrorCode || (TransportErrorCode = {}));
@@ -0,0 +1,73 @@
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, TransportErrorCode, 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 CommandWithoutPacketAuthorization = TransportCommandType.HEALTH | TransportCommandType.SEND | TransportCommandType.GET_DESTINATION_BUNDLE;
27
+ type TransportRequestPacketWithoutAuthorization = {
28
+ readonly [C in CommandWithoutPacketAuthorization]: TransportRequestPacketBase<C> & {
29
+ readonly authorization?: never;
30
+ };
31
+ }[CommandWithoutPacketAuthorization];
32
+ export type TransportAuthorizedCommandType = Exclude<TransportCommandType, CommandWithoutPacketAuthorization>;
33
+ export type TransportRequestAuthorizationInput = {
34
+ readonly [C in TransportAuthorizedCommandType]: TransportRequestPacketBase<C>;
35
+ }[TransportAuthorizedCommandType];
36
+ export type TransportAuthorizedRequestPacket = {
37
+ readonly [C in TransportAuthorizedCommandType]: TransportRequestPacketBase<C> & {
38
+ readonly authorization: HybridSignature;
39
+ };
40
+ }[TransportAuthorizedCommandType];
41
+ export type TransportRequestPacket = TransportRequestPacketWithoutAuthorization | TransportAuthorizedRequestPacket;
42
+ type TransportResponsePacketBase<C extends TransportCommandType> = {
43
+ readonly formatVersion: typeof TRANSPORT_PACKET_FORMAT_VERSION;
44
+ readonly type: TransportPacketType.RESPONSE;
45
+ readonly requestId: RequestId;
46
+ readonly command: C;
47
+ };
48
+ export type TransportSuccessResponsePacket = {
49
+ readonly [C in TransportCommandType]: TransportResponsePacketBase<C> & {
50
+ readonly status: TransportResponseStatus.SUCCESS;
51
+ readonly payload: TransportResponsePayloadMap[C];
52
+ };
53
+ }[TransportCommandType];
54
+ export type TransportErrorResponsePacket = {
55
+ readonly [C in TransportCommandType]: TransportResponsePacketBase<C> & {
56
+ readonly status: TransportResponseStatus.ERROR;
57
+ readonly errorCode: TransportErrorCode;
58
+ };
59
+ }[TransportCommandType];
60
+ export type TransportResponsePacket = TransportSuccessResponsePacket | TransportErrorResponsePacket;
61
+ export type TransportDelivery = {
62
+ readonly deliveryId: DeliveryId;
63
+ readonly payload: Bytes;
64
+ };
65
+ export type TransportDeliveryPacket = {
66
+ readonly formatVersion: typeof TRANSPORT_PACKET_FORMAT_VERSION;
67
+ readonly type: TransportPacketType.DELIVERY;
68
+ readonly recipientQueueId: RecipientQueueId;
69
+ readonly deliveries: readonly TransportDelivery[];
70
+ };
71
+ export type TransportPacket = TransportRequestPacket | TransportResponsePacket | TransportDeliveryPacket;
72
+ export {};
73
+ //# 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,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC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AAa,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.4",
4
4
  "description": "Shared cryptographic and wire protocol definitions for Okee clients and relays",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"RelayEncryptionKeyBundleCodec.d.ts","sourceRoot":"","sources":["../../../src/transport/codecs/RelayEncryptionKeyBundleCodec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAkB,MAAM,uCAAuC,CAAC;AAG9E,OAAO,EAAE,wBAAwB,EAAwB,MAAM,UAAU,CAAC;AAE1E,qBAAa,6BAA8B,YAAW,aAAa,CAAC,wBAAwB,CAAC;IACrF,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,KAAK,CAYpD;IAEM,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAyBzE;CACD"}
@@ -1,10 +0,0 @@
1
- import { Result } from "@okee-e2ee/core";
2
- import { DecodeError } from "@okee-e2ee/core/errors";
3
- import { CodecContract } from "../../crypto-core/contracts";
4
- import { Bytes } from "../../crypto-core/model";
5
- import { HybridSignaturePublicKey } from "../../crypto-core/signature/model";
6
- export declare class RelayIdentityPublicKeyCodec implements CodecContract<HybridSignaturePublicKey> {
7
- encode(value: HybridSignaturePublicKey): Bytes;
8
- decode(bytes: Bytes): Result<HybridSignaturePublicKey, DecodeError>;
9
- }
10
- //# sourceMappingURL=RelayIdentityPublicKeyCodec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RelayIdentityPublicKeyCodec.d.ts","sourceRoot":"","sources":["../../../src/transport/codecs/RelayIdentityPublicKeyCodec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAC9D,OAAO,EAEN,wBAAwB,EAExB,MAAM,iDAAiD,CAAC;AAEzD,qBAAa,2BAA4B,YAAW,aAAa,CAAC,wBAAwB,CAAC;IACnF,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,KAAK,CAKpD;IAEM,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,wBAAwB,EAAE,WAAW,CAAC,CAgBzE;CACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"encode-relay-key-bundle-signature-input.d.ts","sourceRoot":"","sources":["../../../src/transport/helpers/encode-relay-key-bundle-signature-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAwB,MAAM,iCAAiC,CAAC;AAI9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAIpD,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,wBAAwB,GAAG,KAAK,CAE1F"}