@okee-e2ee/protocol 0.1.3 → 0.1.5

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 (97) 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/relay-constants.d.ts +5 -0
  60. package/dist/transport/constants/relay-constants.d.ts.map +1 -1
  61. package/dist/transport/constants/relay-constants.js +5 -0
  62. package/dist/transport/constants/transport-packet-constants.d.ts +3 -0
  63. package/dist/transport/constants/transport-packet-constants.d.ts.map +1 -1
  64. package/dist/transport/constants/transport-packet-constants.js +3 -0
  65. package/dist/transport/helpers/derive-queue-setup-verifier.d.ts +4 -0
  66. package/dist/transport/helpers/derive-queue-setup-verifier.d.ts.map +1 -0
  67. package/dist/transport/helpers/derive-queue-setup-verifier.js +6 -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 +2 -1
  74. package/dist/transport/helpers/index.d.ts.map +1 -1
  75. package/dist/transport/helpers/index.js +2 -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 +2 -0
  80. package/dist/transport/model/index.d.ts.map +1 -1
  81. package/dist/transport/model/index.js +2 -0
  82. package/dist/transport/model/relay-key-bundle.d.ts +2 -2
  83. package/dist/transport/model/relay-key-bundle.d.ts.map +1 -1
  84. package/dist/transport/model/s2d-envelope.d.ts +28 -0
  85. package/dist/transport/model/s2d-envelope.d.ts.map +1 -0
  86. package/dist/transport/model/s2d-envelope.js +1 -0
  87. package/dist/transport/model/transport-command.d.ts +30 -18
  88. package/dist/transport/model/transport-command.d.ts.map +1 -1
  89. package/dist/transport/model/transport-command.js +9 -0
  90. package/dist/transport/model/transport-packet.d.ts +39 -9
  91. package/dist/transport/model/transport-packet.d.ts.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/transport/codecs/RelayEncryptionKeyBundleCodec.d.ts.map +0 -1
  94. package/dist/transport/codecs/RelayIdentityPublicKeyCodec.d.ts +0 -10
  95. package/dist/transport/codecs/RelayIdentityPublicKeyCodec.d.ts.map +0 -1
  96. package/dist/transport/helpers/encode-relay-key-bundle-signature-input.d.ts.map +0 -1
  97. /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,6 +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";
4
6
  export * from "./transport-command";
5
7
  export * from "./transport-packet";
6
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;AACnC,cAAc,qBAAqB,CAAC;AACpC,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,5 +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";
4
6
  export * from "./transport-command";
5
7
  export * from "./transport-packet";
@@ -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/transport/model/relay-key-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAElF,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;AAEpF,MAAM,MAAM,wBAAwB,GAAG;IACtC,QAAQ,CAAC,aAAa,EAAE,OAAO,+BAA+B,CAAC;IAC/D,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,GAAG;IACvE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;CACpC,CAAC"}
1
+ {"version":3,"file":"relay-key-bundle.d.ts","sourceRoot":"","sources":["../../../src/transport/model/relay-key-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAElF,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC;AAE1F,MAAM,MAAM,wBAAwB,GAAG;IACtC,QAAQ,CAAC,aAAa,EAAE,OAAO,+BAA+B,CAAC;IAC/D,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,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 {};
@@ -1,5 +1,9 @@
1
- import { Bytes } from "../../crypto-core";
2
- import { DeliveryId, QueueRegistration, QueueSetupCapability, RecipientQueueId, SenderHybridAuthPublicKey, SenderQueueId } from "./queue-model";
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";
3
7
  export declare enum TransportCommandType {
4
8
  HEALTH = 0,
5
9
  CREATE_QUEUE = 1,
@@ -7,7 +11,15 @@ export declare enum TransportCommandType {
7
11
  SUBSCRIBE_QUEUE = 3,
8
12
  UNSUBSCRIBE_QUEUE = 4,
9
13
  SEND = 5,
10
- ACK = 6
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
11
23
  }
12
24
  export type HealthCommandRequestPayload = undefined;
13
25
  export type CreateQueueCommandRequestPayload = {
@@ -22,18 +34,13 @@ export type SubscribeQueueCommandRequestPayload = {
22
34
  export type UnsubscribeQueueCommandRequestPayload = {
23
35
  readonly recipientQueueId: RecipientQueueId;
24
36
  };
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 GetDestinationBundleCommandRequestPayload = {
38
+ readonly destination: RelayAddress;
39
+ };
40
+ export type SendCommandRequestPayload = {
41
+ readonly destination: RelayAddress;
42
+ readonly encryptedRequest: S2DEncryptedRequest<DestinationSendRequest>;
43
+ };
37
44
  export type AckCommandRequestPayload = {
38
45
  readonly recipientQueueId: RecipientQueueId;
39
46
  readonly deliveryIds: readonly DeliveryId[];
@@ -46,6 +53,7 @@ export type TransportRequestPayloadMap = {
46
53
  readonly [TransportCommandType.UNSUBSCRIBE_QUEUE]: UnsubscribeQueueCommandRequestPayload;
47
54
  readonly [TransportCommandType.SEND]: SendCommandRequestPayload;
48
55
  readonly [TransportCommandType.ACK]: AckCommandRequestPayload;
56
+ readonly [TransportCommandType.GET_DESTINATION_BUNDLE]: GetDestinationBundleCommandRequestPayload;
49
57
  };
50
58
  export type HealthCommandResponsePayload = undefined;
51
59
  export type CreateQueueCommandResponsePayload = {
@@ -61,9 +69,13 @@ export type SubscribeQueueCommandResponsePayload = {
61
69
  export type UnsubscribeQueueCommandResponsePayload = {
62
70
  readonly recipientQueueId: RecipientQueueId;
63
71
  };
72
+ export type GetDestinationBundleCommandResponsePayload = {
73
+ readonly destination: RelayAddress;
74
+ readonly identityPublicKey: HybridSignaturePublicKey;
75
+ readonly bundle: SignedRelayEncryptionKeyBundle;
76
+ };
64
77
  export type SendCommandResponsePayload = {
65
- readonly senderQueueId: SenderQueueId;
66
- readonly deliveryId: DeliveryId;
78
+ readonly encryptedResponse: S2DEncryptedResponse<DestinationSendResponse>;
67
79
  };
68
80
  export type AckCommandResponsePayload = {
69
81
  readonly recipientQueueId: RecipientQueueId;
@@ -77,6 +89,6 @@ export type TransportResponsePayloadMap = {
77
89
  readonly [TransportCommandType.UNSUBSCRIBE_QUEUE]: UnsubscribeQueueCommandResponsePayload;
78
90
  readonly [TransportCommandType.SEND]: SendCommandResponsePayload;
79
91
  readonly [TransportCommandType.ACK]: AckCommandResponsePayload;
92
+ readonly [TransportCommandType.GET_DESTINATION_BUNDLE]: GetDestinationBundleCommandResponsePayload;
80
93
  };
81
- export {};
82
94
  //# sourceMappingURL=transport-command.d.ts.map
@@ -1 +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,CAAC;AAEvB,oBAAY,oBAAoB;IAC/B,MAAM,IAAI;IACV,YAAY,IAAI;IAChB,YAAY,IAAI;IAChB,eAAe,IAAI;IACnB,iBAAiB,IAAI;IACrB,IAAI,IAAI;IACR,GAAG,IAAI;CACP;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,EAAE,gBAAgB,CAAC;CAC5C,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACpC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE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CRIBE_QUEUE"] = 4] = "UNSUBSCRIBE_QUEUE";
8
8
  TransportCommandType[TransportCommandType["SEND"] = 5] = "SEND";
9
9
  TransportCommandType[TransportCommandType["ACK"] = 6] = "ACK";
10
+ TransportCommandType[TransportCommandType["GET_DESTINATION_BUNDLE"] = 7] = "GET_DESTINATION_BUNDLE";
10
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 = {}));
@@ -2,7 +2,7 @@ import { Branded, Bytes } from "../../crypto-core";
2
2
  import { HybridSignature } from "../../crypto-core/signature/model";
3
3
  import { TRANSPORT_PACKET_FORMAT_VERSION } from "../constants";
4
4
  import { DeliveryId, RecipientQueueId } from "./queue-model";
5
- import { TransportCommandType, TransportRequestPayloadMap, TransportResponsePayloadMap } from "./transport-command";
5
+ import { TransportCommandType, TransportErrorCode, TransportRequestPayloadMap, TransportResponsePayloadMap } from "./transport-command";
6
6
  export type RequestId = Branded<string, "TransportRequestId">;
7
7
  export declare enum TransportPacketType {
8
8
  REQUEST = 0,
@@ -20,16 +20,46 @@ type TransportRequestPacketBase<C extends TransportCommandType> = {
20
20
  readonly command: C;
21
21
  readonly payload: TransportRequestPayloadMap[C];
22
22
  };
23
- export type TransportHealthRequestPacket = TransportRequestPacketBase<TransportCommandType.HEALTH> & {
24
- readonly authorization?: never;
25
- };
26
- type AuthorizedTransportCommandType = Exclude<TransportCommandType, TransportCommandType.HEALTH>;
23
+ export type TransportHealthRequestPacket = Extract<TransportRequestPacket, {
24
+ readonly command: TransportCommandType.HEALTH;
25
+ }>;
26
+ export type TransportSendRequestPacket = Extract<TransportRequestPacket, {
27
+ readonly command: TransportCommandType.SEND;
28
+ }>;
29
+ export type TransportGetDestinationBundleRequestPacket = Extract<TransportRequestPacket, {
30
+ readonly command: TransportCommandType.GET_DESTINATION_BUNDLE;
31
+ }>;
32
+ type CommandWithoutPacketAuthorization = TransportCommandType.HEALTH | TransportCommandType.SEND | TransportCommandType.GET_DESTINATION_BUNDLE;
33
+ type TransportRequestPacketWithoutAuthorization = {
34
+ readonly [C in CommandWithoutPacketAuthorization]: TransportRequestPacketBase<C> & {
35
+ readonly authorization?: never;
36
+ };
37
+ }[CommandWithoutPacketAuthorization];
38
+ export type TransportAuthorizedCommandType = Exclude<TransportCommandType, CommandWithoutPacketAuthorization>;
39
+ export type TransportRequestAuthorizationInput = {
40
+ readonly [C in TransportAuthorizedCommandType]: TransportRequestPacketBase<C>;
41
+ }[TransportAuthorizedCommandType];
27
42
  export type TransportAuthorizedRequestPacket = {
28
- readonly [C in AuthorizedTransportCommandType]: TransportRequestPacketBase<C> & {
43
+ readonly [C in TransportAuthorizedCommandType]: TransportRequestPacketBase<C> & {
29
44
  readonly authorization: HybridSignature;
30
45
  };
31
- }[AuthorizedTransportCommandType];
32
- export type TransportRequestPacket = TransportHealthRequestPacket | TransportAuthorizedRequestPacket;
46
+ }[TransportAuthorizedCommandType];
47
+ export type TransportRequestPacket = TransportRequestPacketWithoutAuthorization | TransportAuthorizedRequestPacket;
48
+ export type TransportCreateQueueRequestPacket = Extract<TransportRequestPacket, {
49
+ readonly command: TransportCommandType.CREATE_QUEUE;
50
+ }>;
51
+ export type TransportRemoveQueueRequestPacket = Extract<TransportRequestPacket, {
52
+ readonly command: TransportCommandType.REMOVE_QUEUE;
53
+ }>;
54
+ export type TransportAckRequestPacket = Extract<TransportRequestPacket, {
55
+ readonly command: TransportCommandType.ACK;
56
+ }>;
57
+ export type TransportSubscribeQueueRequestPacket = Extract<TransportRequestPacket, {
58
+ readonly command: TransportCommandType.SUBSCRIBE_QUEUE;
59
+ }>;
60
+ export type TransportUnsubscribeQueueRequestPacket = Extract<TransportRequestPacket, {
61
+ readonly command: TransportCommandType.UNSUBSCRIBE_QUEUE;
62
+ }>;
33
63
  type TransportResponsePacketBase<C extends TransportCommandType> = {
34
64
  readonly formatVersion: typeof TRANSPORT_PACKET_FORMAT_VERSION;
35
65
  readonly type: TransportPacketType.RESPONSE;
@@ -45,7 +75,7 @@ export type TransportSuccessResponsePacket = {
45
75
  export type TransportErrorResponsePacket = {
46
76
  readonly [C in TransportCommandType]: TransportResponsePacketBase<C> & {
47
77
  readonly status: TransportResponseStatus.ERROR;
48
- readonly errorCode: number;
78
+ readonly errorCode: TransportErrorCode;
49
79
  };
50
80
  }[TransportCommandType];
51
81
  export type TransportResponsePacket = TransportSuccessResponsePacket | TransportErrorResponsePacket;
@@ -1 +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;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AAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,eAAe,GAC1B,sBAAsB,GAAG,uBAAuB,GAAG,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okee-e2ee/protocol",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
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"}