jmap-kit 0.0.0 → 1.0.2

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 (198) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +138 -3
  3. package/dist/src/capabilities/blob/blob.d.ts +83 -0
  4. package/dist/src/capabilities/blob/blob.js +98 -0
  5. package/dist/src/capabilities/blob/blob.js.map +1 -0
  6. package/dist/src/capabilities/blob/types.d.ts +212 -0
  7. package/dist/src/capabilities/blob/types.js +16 -0
  8. package/dist/src/capabilities/blob/types.js.map +1 -0
  9. package/dist/src/capabilities/blob-capability.d.ts +195 -0
  10. package/dist/src/capabilities/blob-capability.js +277 -0
  11. package/dist/src/capabilities/blob-capability.js.map +1 -0
  12. package/dist/src/capabilities/core/core.d.ts +47 -0
  13. package/dist/src/capabilities/core/core.js +59 -0
  14. package/dist/src/capabilities/core/core.js.map +1 -0
  15. package/dist/src/capabilities/core/types.d.ts +13 -0
  16. package/dist/src/capabilities/core/types.js +2 -0
  17. package/dist/src/capabilities/core/types.js.map +1 -0
  18. package/dist/src/capabilities/core-capability.d.ts +307 -0
  19. package/dist/src/capabilities/core-capability.js +344 -0
  20. package/dist/src/capabilities/core-capability.js.map +1 -0
  21. package/dist/src/capabilities/email/email.d.ts +124 -0
  22. package/dist/src/capabilities/email/email.js +136 -0
  23. package/dist/src/capabilities/email/email.js.map +1 -0
  24. package/dist/src/capabilities/email/types.d.ts +776 -0
  25. package/dist/src/capabilities/email/types.js +2 -0
  26. package/dist/src/capabilities/email/types.js.map +1 -0
  27. package/dist/src/capabilities/email-capability.d.ts +266 -0
  28. package/dist/src/capabilities/email-capability.js +241 -0
  29. package/dist/src/capabilities/email-capability.js.map +1 -0
  30. package/dist/src/capabilities/emailsubmission/emailsubmission.d.ts +95 -0
  31. package/dist/src/capabilities/emailsubmission/emailsubmission.js +107 -0
  32. package/dist/src/capabilities/emailsubmission/emailsubmission.js.map +1 -0
  33. package/dist/src/capabilities/emailsubmission/types.d.ts +256 -0
  34. package/dist/src/capabilities/emailsubmission/types.js +2 -0
  35. package/dist/src/capabilities/emailsubmission/types.js.map +1 -0
  36. package/dist/src/capabilities/example/example.d.ts +80 -0
  37. package/dist/src/capabilities/example/example.js +91 -0
  38. package/dist/src/capabilities/example/example.js.map +1 -0
  39. package/dist/src/capabilities/example/types.d.ts +33 -0
  40. package/dist/src/capabilities/example/types.js +2 -0
  41. package/dist/src/capabilities/example/types.js.map +1 -0
  42. package/dist/src/capabilities/identity/identity.d.ts +71 -0
  43. package/dist/src/capabilities/identity/identity.js +83 -0
  44. package/dist/src/capabilities/identity/identity.js.map +1 -0
  45. package/dist/src/capabilities/identity/types.d.ts +110 -0
  46. package/dist/src/capabilities/identity/types.js +2 -0
  47. package/dist/src/capabilities/identity/types.js.map +1 -0
  48. package/dist/src/capabilities/mailbox/mailbox.d.ts +91 -0
  49. package/dist/src/capabilities/mailbox/mailbox.js +103 -0
  50. package/dist/src/capabilities/mailbox/mailbox.js.map +1 -0
  51. package/dist/src/capabilities/mailbox/types.d.ts +248 -0
  52. package/dist/src/capabilities/mailbox/types.js +2 -0
  53. package/dist/src/capabilities/mailbox/types.js.map +1 -0
  54. package/dist/src/capabilities/maskedemail/maskedemail.d.ts +60 -0
  55. package/dist/src/capabilities/maskedemail/maskedemail.js +72 -0
  56. package/dist/src/capabilities/maskedemail/maskedemail.js.map +1 -0
  57. package/dist/src/capabilities/maskedemail/types.d.ts +67 -0
  58. package/dist/src/capabilities/maskedemail/types.js +4 -0
  59. package/dist/src/capabilities/maskedemail/types.js.map +1 -0
  60. package/dist/src/capabilities/maskedemail-capability.d.ts +112 -0
  61. package/dist/src/capabilities/maskedemail-capability.js +166 -0
  62. package/dist/src/capabilities/maskedemail-capability.js.map +1 -0
  63. package/dist/src/capabilities/searchsnippet/searchsnippet.d.ts +51 -0
  64. package/dist/src/capabilities/searchsnippet/searchsnippet.js +63 -0
  65. package/dist/src/capabilities/searchsnippet/searchsnippet.js.map +1 -0
  66. package/dist/src/capabilities/searchsnippet/types.d.ts +88 -0
  67. package/dist/src/capabilities/searchsnippet/types.js +2 -0
  68. package/dist/src/capabilities/searchsnippet/types.js.map +1 -0
  69. package/dist/src/capabilities/submission-capability.d.ts +89 -0
  70. package/dist/src/capabilities/submission-capability.js +75 -0
  71. package/dist/src/capabilities/submission-capability.js.map +1 -0
  72. package/dist/src/capabilities/thread/thread.d.ts +58 -0
  73. package/dist/src/capabilities/thread/thread.js +70 -0
  74. package/dist/src/capabilities/thread/thread.js.map +1 -0
  75. package/dist/src/capabilities/thread/types.d.ts +43 -0
  76. package/dist/src/capabilities/thread/types.js +2 -0
  77. package/dist/src/capabilities/thread/types.js.map +1 -0
  78. package/dist/src/capabilities/utils/assert-invocation-datatype.d.ts +7 -0
  79. package/dist/src/capabilities/utils/assert-invocation-datatype.js +13 -0
  80. package/dist/src/capabilities/utils/assert-invocation-datatype.js.map +1 -0
  81. package/dist/src/capabilities/utils/assert-invocation-method.d.ts +7 -0
  82. package/dist/src/capabilities/utils/assert-invocation-method.js +13 -0
  83. package/dist/src/capabilities/utils/assert-invocation-method.js.map +1 -0
  84. package/dist/src/capabilities/utils/assert-invocation.d.ts +7 -0
  85. package/dist/src/capabilities/utils/assert-invocation.js +22 -0
  86. package/dist/src/capabilities/utils/assert-invocation.js.map +1 -0
  87. package/dist/src/capabilities/utils/assert-non-nullish.d.ts +1 -0
  88. package/dist/src/capabilities/utils/assert-non-nullish.js +6 -0
  89. package/dist/src/capabilities/utils/assert-non-nullish.js.map +1 -0
  90. package/dist/src/capabilities/utils/create-readonly-account-validator.d.ts +49 -0
  91. package/dist/src/capabilities/utils/create-readonly-account-validator.js +80 -0
  92. package/dist/src/capabilities/utils/create-readonly-account-validator.js.map +1 -0
  93. package/dist/src/capabilities/vacationresponse/types.d.ts +100 -0
  94. package/dist/src/capabilities/vacationresponse/types.js +2 -0
  95. package/dist/src/capabilities/vacationresponse/types.js.map +1 -0
  96. package/dist/src/capabilities/vacationresponse/vacationresponse.d.ts +61 -0
  97. package/dist/src/capabilities/vacationresponse/vacationresponse.js +73 -0
  98. package/dist/src/capabilities/vacationresponse/vacationresponse.js.map +1 -0
  99. package/dist/src/capabilities/vacationresponse-capability.d.ts +65 -0
  100. package/dist/src/capabilities/vacationresponse-capability.js +68 -0
  101. package/dist/src/capabilities/vacationresponse-capability.js.map +1 -0
  102. package/dist/src/capability-registry/capability-registry.d.ts +148 -0
  103. package/dist/src/capability-registry/capability-registry.js +360 -0
  104. package/dist/src/capability-registry/capability-registry.js.map +1 -0
  105. package/dist/src/capability-registry/types.d.ts +385 -0
  106. package/dist/src/capability-registry/types.js +2 -0
  107. package/dist/src/capability-registry/types.js.map +1 -0
  108. package/dist/src/capability-registry/utils.d.ts +71 -0
  109. package/dist/src/capability-registry/utils.js +163 -0
  110. package/dist/src/capability-registry/utils.js.map +1 -0
  111. package/dist/src/common/registry.d.ts +366 -0
  112. package/dist/src/common/registry.js +321 -0
  113. package/dist/src/common/registry.js.map +1 -0
  114. package/dist/src/common/types.d.ts +338 -0
  115. package/dist/src/common/types.js +21 -0
  116. package/dist/src/common/types.js.map +1 -0
  117. package/dist/src/common/utils.d.ts +20 -0
  118. package/dist/src/common/utils.js +26 -0
  119. package/dist/src/common/utils.js.map +1 -0
  120. package/dist/src/index.d.ts +40 -0
  121. package/dist/src/index.js +33 -0
  122. package/dist/src/index.js.map +1 -0
  123. package/dist/src/invocation/arguments-proxy.d.ts +14 -0
  124. package/dist/src/invocation/arguments-proxy.js +37 -0
  125. package/dist/src/invocation/arguments-proxy.js.map +1 -0
  126. package/dist/src/invocation/error-invocation.d.ts +27 -0
  127. package/dist/src/invocation/error-invocation.js +39 -0
  128. package/dist/src/invocation/error-invocation.js.map +1 -0
  129. package/dist/src/invocation/invocation.d.ts +111 -0
  130. package/dist/src/invocation/invocation.js +158 -0
  131. package/dist/src/invocation/invocation.js.map +1 -0
  132. package/dist/src/invocation/result-reference.d.ts +86 -0
  133. package/dist/src/invocation/result-reference.js +118 -0
  134. package/dist/src/invocation/result-reference.js.map +1 -0
  135. package/dist/src/invocation/types.d.ts +637 -0
  136. package/dist/src/invocation/types.js +2 -0
  137. package/dist/src/invocation/types.js.map +1 -0
  138. package/dist/src/invocation/utils.d.ts +21 -0
  139. package/dist/src/invocation/utils.js +30 -0
  140. package/dist/src/invocation/utils.js.map +1 -0
  141. package/dist/src/invocation-factory/invocation-factory-manager.d.ts +20 -0
  142. package/dist/src/invocation-factory/invocation-factory-manager.js +50 -0
  143. package/dist/src/invocation-factory/invocation-factory-manager.js.map +1 -0
  144. package/dist/src/invocation-factory/invocation-list.d.ts +32 -0
  145. package/dist/src/invocation-factory/invocation-list.js +77 -0
  146. package/dist/src/invocation-factory/invocation-list.js.map +1 -0
  147. package/dist/src/invocation-factory/types.d.ts +11 -0
  148. package/dist/src/invocation-factory/types.js +2 -0
  149. package/dist/src/invocation-factory/types.js.map +1 -0
  150. package/dist/src/jmap-client/jmap-client.d.ts +252 -0
  151. package/dist/src/jmap-client/jmap-client.js +777 -0
  152. package/dist/src/jmap-client/jmap-client.js.map +1 -0
  153. package/dist/src/jmap-client/types.d.ts +427 -0
  154. package/dist/src/jmap-client/types.js +21 -0
  155. package/dist/src/jmap-client/types.js.map +1 -0
  156. package/dist/src/jmap-client/utils/abort-controller.d.ts +8 -0
  157. package/dist/src/jmap-client/utils/abort-controller.js +24 -0
  158. package/dist/src/jmap-client/utils/abort-controller.js.map +1 -0
  159. package/dist/src/jmap-client/utils/assert-connected.d.ts +7 -0
  160. package/dist/src/jmap-client/utils/assert-connected.js +11 -0
  161. package/dist/src/jmap-client/utils/assert-connected.js.map +1 -0
  162. package/dist/src/jmap-client/utils/deep-freeze.d.ts +7 -0
  163. package/dist/src/jmap-client/utils/deep-freeze.js +17 -0
  164. package/dist/src/jmap-client/utils/deep-freeze.js.map +1 -0
  165. package/dist/src/jmap-client/utils/emitter.d.ts +9 -0
  166. package/dist/src/jmap-client/utils/emitter.js +18 -0
  167. package/dist/src/jmap-client/utils/emitter.js.map +1 -0
  168. package/dist/src/jmap-client/utils/filter-session-capabilities.d.ts +22 -0
  169. package/dist/src/jmap-client/utils/filter-session-capabilities.js +40 -0
  170. package/dist/src/jmap-client/utils/filter-session-capabilities.js.map +1 -0
  171. package/dist/src/jmap-client/utils/jmap-request-error.d.ts +28 -0
  172. package/dist/src/jmap-client/utils/jmap-request-error.js +48 -0
  173. package/dist/src/jmap-client/utils/jmap-request-error.js.map +1 -0
  174. package/dist/src/jmap-client/utils/logger.d.ts +6 -0
  175. package/dist/src/jmap-client/utils/logger.js +22 -0
  176. package/dist/src/jmap-client/utils/logger.js.map +1 -0
  177. package/dist/src/jmap-client/utils/merge-headers.d.ts +11 -0
  178. package/dist/src/jmap-client/utils/merge-headers.js +40 -0
  179. package/dist/src/jmap-client/utils/merge-headers.js.map +1 -0
  180. package/dist/src/jmap-client/utils/template-utils.d.ts +27 -0
  181. package/dist/src/jmap-client/utils/template-utils.js +61 -0
  182. package/dist/src/jmap-client/utils/template-utils.js.map +1 -0
  183. package/dist/src/jmap-client/utils/track-utils.d.ts +19 -0
  184. package/dist/src/jmap-client/utils/track-utils.js +35 -0
  185. package/dist/src/jmap-client/utils/track-utils.js.map +1 -0
  186. package/dist/src/jmap-client/utils/transport.d.ts +12 -0
  187. package/dist/src/jmap-client/utils/transport.js +38 -0
  188. package/dist/src/jmap-client/utils/transport.js.map +1 -0
  189. package/dist/src/jmap-client/utils/validate-session.d.ts +19 -0
  190. package/dist/src/jmap-client/utils/validate-session.js +29 -0
  191. package/dist/src/jmap-client/utils/validate-session.js.map +1 -0
  192. package/dist/src/request-builder/request-builder.d.ts +95 -0
  193. package/dist/src/request-builder/request-builder.js +343 -0
  194. package/dist/src/request-builder/request-builder.js.map +1 -0
  195. package/dist/src/request-builder/types.d.ts +32 -0
  196. package/dist/src/request-builder/types.js +2 -0
  197. package/dist/src/request-builder/types.js.map +1 -0
  198. package/package.json +69 -3
@@ -0,0 +1,71 @@
1
+ import type { JMAPCapability, JMAPMethodName } from "../../common/types.js";
2
+ import { Invocation } from "../../invocation/invocation.js";
3
+ import type { InvocationArgs, InvocationFactory } from "../../invocation/types.js";
4
+ import type { IdentityGetRequestInvocationArgs, IdentityGetResponseInvocationArgs, IdentityRequestInvocationArgs, IdentityResponseInvocationArgs, IdentitySetRequestInvocationArgs, IdentitySetResponseInvocationArgs } from "./types.js";
5
+ /**
6
+ * IdentityInvocation represents a JMAP Identity capability invocation.
7
+ *
8
+ * An Identity object stores information about an email address or domain the user may send from.
9
+ * It supports standard JMAP methods for retrieving, tracking changes, and modifying identities.
10
+ *
11
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6 | RFC 8621 Section 6: Identities}
12
+ */
13
+ export declare class IdentityInvocation<TArgs extends IdentityRequestInvocationArgs | IdentityResponseInvocationArgs> extends Invocation<TArgs> {
14
+ get uri(): JMAPCapability;
15
+ /**
16
+ * Constructs an IdentityInvocation
17
+ *
18
+ * @param method The name of the method being invoked (e.g., "get", "set")
19
+ * @param args The arguments for the method invocation
20
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
21
+ */
22
+ constructor(method: JMAPMethodName, args: InvocationArgs<TArgs>, methodCallId?: symbol);
23
+ /**
24
+ * Create an invocation factory function
25
+ *
26
+ * @param method The name of the method to create
27
+ * @returns A new Identity invocation factory function for creating invocations of the specified type
28
+ */
29
+ static createInvocationFactory<TArgs extends IdentityRequestInvocationArgs | IdentityResponseInvocationArgs>(method: JMAPMethodName): InvocationFactory<TArgs, IdentityInvocation<TArgs>>;
30
+ }
31
+ export declare const Identity: {
32
+ request: {
33
+ /**
34
+ * Retrieves Identity objects by their IDs.
35
+ *
36
+ * The `ids` argument may be `null` to fetch all at once.
37
+ *
38
+ * @param args The invocation arguments for Identity/get
39
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
40
+ * @returns An IdentityInvocation representing the Identity/get request
41
+ *
42
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6.1 | RFC 8621 Section 6.1: Identity/get}
43
+ */
44
+ get: InvocationFactory<IdentityGetRequestInvocationArgs, IdentityInvocation<IdentityGetRequestInvocationArgs>>;
45
+ /**
46
+ * Returns changes to Identity objects since a given state.
47
+ *
48
+ * @param args The invocation arguments for Identity/changes
49
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
50
+ * @returns An IdentityInvocation representing the Identity/changes request
51
+ *
52
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6.2 | RFC 8621 Section 6.2: Identity/changes}
53
+ */
54
+ changes: InvocationFactory<import("../../invocation/types.js").BaseChangesRequestInvocationArgs, IdentityInvocation<import("../../invocation/types.js").BaseChangesRequestInvocationArgs>>;
55
+ /**
56
+ * Creates, updates, or destroys Identity objects.
57
+ *
58
+ * @param args The invocation arguments for Identity/set
59
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
60
+ * @returns An IdentityInvocation representing the Identity/set request
61
+ *
62
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6.3 | RFC 8621 Section 6.3: Identity/set}
63
+ */
64
+ set: InvocationFactory<IdentitySetRequestInvocationArgs, IdentityInvocation<IdentitySetRequestInvocationArgs>>;
65
+ };
66
+ response: {
67
+ get: InvocationFactory<IdentityGetResponseInvocationArgs, IdentityInvocation<IdentityGetResponseInvocationArgs>>;
68
+ changes: InvocationFactory<import("../../invocation/types.js").BaseChangesResponseInvocationArgs, IdentityInvocation<import("../../invocation/types.js").BaseChangesResponseInvocationArgs>>;
69
+ set: InvocationFactory<IdentitySetResponseInvocationArgs, IdentityInvocation<IdentitySetResponseInvocationArgs>>;
70
+ };
71
+ };
@@ -0,0 +1,83 @@
1
+ import { SUBMISSION_CAPABILITY_URI } from "../../common/registry.js";
2
+ import { Invocation } from "../../invocation/invocation.js";
3
+ /**
4
+ * IdentityInvocation represents a JMAP Identity capability invocation.
5
+ *
6
+ * An Identity object stores information about an email address or domain the user may send from.
7
+ * It supports standard JMAP methods for retrieving, tracking changes, and modifying identities.
8
+ *
9
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6 | RFC 8621 Section 6: Identities}
10
+ */
11
+ export class IdentityInvocation extends Invocation {
12
+ get uri() {
13
+ return SUBMISSION_CAPABILITY_URI;
14
+ }
15
+ /**
16
+ * Constructs an IdentityInvocation
17
+ *
18
+ * @param method The name of the method being invoked (e.g., "get", "set")
19
+ * @param args The arguments for the method invocation
20
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
21
+ */
22
+ constructor(method, args, methodCallId) {
23
+ super("Identity", method, args, methodCallId);
24
+ }
25
+ /**
26
+ * Create an invocation factory function
27
+ *
28
+ * @param method The name of the method to create
29
+ * @returns A new Identity invocation factory function for creating invocations of the specified type
30
+ */
31
+ static createInvocationFactory(method) {
32
+ /**
33
+ * An invocation factory function to create an `Identity/{method}` invocation.
34
+ *
35
+ * @param args The invocation arguments for the specified `method`
36
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
37
+ * @returns An object representing the named arguments for the specified `method`
38
+ */
39
+ return (args, methodCallId) => new IdentityInvocation(method, args, methodCallId);
40
+ }
41
+ }
42
+ export const Identity = {
43
+ request: {
44
+ /**
45
+ * Retrieves Identity objects by their IDs.
46
+ *
47
+ * The `ids` argument may be `null` to fetch all at once.
48
+ *
49
+ * @param args The invocation arguments for Identity/get
50
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
51
+ * @returns An IdentityInvocation representing the Identity/get request
52
+ *
53
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6.1 | RFC 8621 Section 6.1: Identity/get}
54
+ */
55
+ get: IdentityInvocation.createInvocationFactory("get"),
56
+ /**
57
+ * Returns changes to Identity objects since a given state.
58
+ *
59
+ * @param args The invocation arguments for Identity/changes
60
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
61
+ * @returns An IdentityInvocation representing the Identity/changes request
62
+ *
63
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6.2 | RFC 8621 Section 6.2: Identity/changes}
64
+ */
65
+ changes: IdentityInvocation.createInvocationFactory("changes"),
66
+ /**
67
+ * Creates, updates, or destroys Identity objects.
68
+ *
69
+ * @param args The invocation arguments for Identity/set
70
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
71
+ * @returns An IdentityInvocation representing the Identity/set request
72
+ *
73
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6.3 | RFC 8621 Section 6.3: Identity/set}
74
+ */
75
+ set: IdentityInvocation.createInvocationFactory("set"),
76
+ },
77
+ response: {
78
+ get: IdentityInvocation.createInvocationFactory("get"),
79
+ changes: IdentityInvocation.createInvocationFactory("changes"),
80
+ set: IdentityInvocation.createInvocationFactory("set"),
81
+ },
82
+ };
83
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../../src/capabilities/identity/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAa5D;;;;;;;GAOG;AACH,MAAM,OAAO,kBAEX,SAAQ,UAAiB;IACvB,IAAI,GAAG;QACH,OAAO,yBAAyB,CAAC;IACrC,CAAC;IAED;;;;;;OAMG;IACH,YAAY,MAAsB,EAAE,IAA2B,EAAE,YAAqB;QAClF,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,uBAAuB,CAC1B,MAAsB;QAEtB;;;;;;WAMG;QACH,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAQ,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IAC7F,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,OAAO,EAAE;QACL;;;;;;;;;;WAUG;QACH,GAAG,EAAE,kBAAkB,CAAC,uBAAuB,CAAmC,KAAK,CAAC;QACxF;;;;;;;;WAQG;QACH,OAAO,EAAE,kBAAkB,CAAC,uBAAuB,CAAuC,SAAS,CAAC;QACpG;;;;;;;;WAQG;QACH,GAAG,EAAE,kBAAkB,CAAC,uBAAuB,CAAmC,KAAK,CAAC;KAC3F;IACD,QAAQ,EAAE;QACN,GAAG,EAAE,kBAAkB,CAAC,uBAAuB,CAAoC,KAAK,CAAC;QACzF,OAAO,EAAE,kBAAkB,CAAC,uBAAuB,CAAwC,SAAS,CAAC;QACrG,GAAG,EAAE,kBAAkB,CAAC,uBAAuB,CAAoC,KAAK,CAAC;KAC5F;CACkC,CAAC"}
@@ -0,0 +1,110 @@
1
+ import type { Id } from "../../common/types.js";
2
+ import type { BaseChangesRequestInvocationArgs, BaseChangesResponseInvocationArgs, BaseGetRequestInvocationArgs, BaseGetResponseInvocationArgs, BaseSetRequestInvocationArgs, BaseSetResponseInvocationArgs } from "../../invocation/types.js";
3
+ import type { EmailAddress } from "../email/types.js";
4
+ /**
5
+ * IdentityObject properties set by the server. These cannot be set by an `Identity/set` call.
6
+ *
7
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6 | RFC 8621 Section 6: Identities}
8
+ */
9
+ export type IdentityObjectServerSet = Readonly<{
10
+ /**
11
+ * (immutable; server-set) The id of the Identity.
12
+ */
13
+ id: Id;
14
+ /**
15
+ * (server-set) Is the user allowed to delete this Identity? Servers may wish to set this
16
+ * to `false` for the user's username or other default address. Attempts to destroy an
17
+ * Identity with `mayDelete: false` will be rejected with a standard `forbidden` SetError.
18
+ */
19
+ mayDelete: boolean;
20
+ }>;
21
+ /**
22
+ * IdentityObject properties that may be set via an `Identity/set` call.
23
+ *
24
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6 | RFC 8621 Section 6: Identities}
25
+ */
26
+ export type IdentityObjectSettable = {
27
+ /**
28
+ * (default: `""`) The `From` name the client SHOULD use when creating a new
29
+ * Email from this Identity.
30
+ */
31
+ name?: string;
32
+ /**
33
+ * (immutable) The `From` email address the client MUST use when creating a new
34
+ * Email from this Identity. If the `mailbox` part of the address (the section
35
+ * before the `@`) is the single character `*` (e.g., `*@example.com`), the client
36
+ * may use any valid address ending in that domain (e.g., `foo@example.com`).
37
+ */
38
+ readonly email: string;
39
+ /**
40
+ * (default: `null`) The Reply-To value the client SHOULD set when creating a new
41
+ * Email from this Identity.
42
+ *
43
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.2.3 | RFC 8621 Section 4.1.2.3}
44
+ * for the definition of EmailAddress.
45
+ */
46
+ replyTo?: EmailAddress[] | null;
47
+ /**
48
+ * (default: `null`) The Bcc value the client SHOULD set when creating a new Email
49
+ * from this Identity.
50
+ *
51
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.2.3 | RFC 8621 Section 4.1.2.3}
52
+ * for the definition of EmailAddress.
53
+ */
54
+ bcc?: EmailAddress[] | null;
55
+ /**
56
+ * (default: `""`) A signature the client SHOULD insert into new plaintext messages
57
+ * that will be sent from this Identity. Clients MAY ignore this and/or combine this
58
+ * with a client-specific signature preference.
59
+ */
60
+ textSignature?: string;
61
+ /**
62
+ * (default: `""`) A signature the client SHOULD insert into new HTML messages that
63
+ * will be sent from this Identity. This text MUST be an HTML snippet to be inserted
64
+ * into the `<body></body>` section of the HTML. Clients MAY ignore this and/or combine
65
+ * this with a client-specific signature preference.
66
+ */
67
+ htmlSignature?: string;
68
+ };
69
+ /**
70
+ * Properties of the Identity object.
71
+ *
72
+ * An Identity object stores information about an email address or domain the user may send from.
73
+ * Multiple identities with the same email address MAY exist, to allow for different settings the
74
+ * user wants to pick between (for example, with different names/signatures).
75
+ *
76
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6 | RFC 8621 Section 6: Identities}
77
+ */
78
+ export type IdentityObject = IdentityObjectServerSet & IdentityObjectSettable;
79
+ /**
80
+ * The arguments for fetching Identity objects via an `Identity/get` call.
81
+ */
82
+ export type IdentityGetRequestInvocationArgs = BaseGetRequestInvocationArgs<IdentityObject>;
83
+ /**
84
+ * The response to an `Identity/get` call.
85
+ */
86
+ export type IdentityGetResponseInvocationArgs = BaseGetResponseInvocationArgs<IdentityObject>;
87
+ /**
88
+ * The arguments for fetching Identity changes via an `Identity/changes` call.
89
+ */
90
+ export type IdentityChangesRequestInvocationArgs = BaseChangesRequestInvocationArgs;
91
+ /**
92
+ * The response to an `Identity/changes` call.
93
+ */
94
+ export type IdentityChangesResponseInvocationArgs = BaseChangesResponseInvocationArgs;
95
+ /**
96
+ * The arguments for creating, updating, and destroying Identity objects via an `Identity/set` call.
97
+ */
98
+ export type IdentitySetRequestInvocationArgs = BaseSetRequestInvocationArgs<IdentityObjectSettable>;
99
+ /**
100
+ * The response to an `Identity/set` call.
101
+ */
102
+ export type IdentitySetResponseInvocationArgs = BaseSetResponseInvocationArgs<IdentityObject>;
103
+ /**
104
+ * Union type of all Identity capability request invocation arguments.
105
+ */
106
+ export type IdentityRequestInvocationArgs = IdentityGetRequestInvocationArgs | IdentityChangesRequestInvocationArgs | IdentitySetRequestInvocationArgs;
107
+ /**
108
+ * Union type of all Identity capability response invocation arguments.
109
+ */
110
+ export type IdentityResponseInvocationArgs = IdentityGetResponseInvocationArgs | IdentityChangesResponseInvocationArgs | IdentitySetResponseInvocationArgs;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/capabilities/identity/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,91 @@
1
+ import type { JMAPCapability, JMAPMethodName } from "../../common/types.js";
2
+ import { Invocation } from "../../invocation/invocation.js";
3
+ import type { InvocationArgs, InvocationFactory } from "../../invocation/types.js";
4
+ import type { MailboxChangesResponseInvocationArgs, MailboxGetRequestInvocationArgs, MailboxGetResponseInvocationArgs, MailboxQueryChangesRequestInvocationArgs, MailboxQueryRequestInvocationArgs, MailboxRequestInvocationArgs, MailboxResponseInvocationArgs, MailboxSetRequestInvocationArgs, MailboxSetResponseInvocationArgs } from "./types.js";
5
+ /**
6
+ * MailboxInvocation represents a JMAP Mailbox capability invocation.
7
+ *
8
+ * The Mailbox data type represents folders/mailboxes for organising email messages. It supports
9
+ * standard JMAP methods for retrieving, querying, and modifying mailbox structures.
10
+ *
11
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2 | RFC 8621 Section 2: Mailboxes}
12
+ */
13
+ export declare class MailboxInvocation<TArgs extends MailboxRequestInvocationArgs | MailboxResponseInvocationArgs> extends Invocation<TArgs> {
14
+ get uri(): JMAPCapability;
15
+ /**
16
+ * Constructs a MailboxInvocation
17
+ *
18
+ * @param method The name of the method being invoked (e.g., "get", "set", "query")
19
+ * @param args The arguments for the method invocation
20
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
21
+ */
22
+ constructor(method: JMAPMethodName, args: InvocationArgs<TArgs>, methodCallId?: symbol);
23
+ /**
24
+ * Create an invocation factory function
25
+ *
26
+ * @param method The name of the method to create
27
+ * @returns A new Mailbox invocation factory function for creating invocations of the specified type
28
+ */
29
+ static createInvocationFactory<TArgs extends MailboxRequestInvocationArgs | MailboxResponseInvocationArgs>(method: JMAPMethodName): InvocationFactory<TArgs, MailboxInvocation<TArgs>>;
30
+ }
31
+ export declare const Mailbox: {
32
+ request: {
33
+ /**
34
+ * Retrieves Mailbox objects by their IDs.
35
+ *
36
+ * @param args The invocation arguments for Mailbox/get
37
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
38
+ * @returns A MailboxInvocation representing the Mailbox/get request
39
+ *
40
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.1 | RFC 8621 Section 2.1: Mailbox/get}
41
+ */
42
+ get: InvocationFactory<MailboxGetRequestInvocationArgs, MailboxInvocation<MailboxGetRequestInvocationArgs>>;
43
+ /**
44
+ * Returns changes to Mailbox objects since a given state.
45
+ *
46
+ * @param args The invocation arguments for Mailbox/changes
47
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
48
+ * @returns A MailboxInvocation representing the Mailbox/changes request
49
+ *
50
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.2 | RFC 8621 Section 2.2: Mailbox/changes}
51
+ */
52
+ changes: InvocationFactory<import("../../invocation/types.js").BaseChangesRequestInvocationArgs, MailboxInvocation<import("../../invocation/types.js").BaseChangesRequestInvocationArgs>>;
53
+ /**
54
+ * Queries for Mailbox objects matching specified criteria.
55
+ *
56
+ * @param args The invocation arguments for Mailbox/query
57
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
58
+ * @returns A MailboxInvocation representing the Mailbox/query request
59
+ *
60
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.3 | RFC 8621 Section 2.3: Mailbox/query}
61
+ */
62
+ query: InvocationFactory<MailboxQueryRequestInvocationArgs, MailboxInvocation<MailboxQueryRequestInvocationArgs>>;
63
+ /**
64
+ * Returns changes to a query result since a given state.
65
+ *
66
+ * @param args The invocation arguments for Mailbox/queryChanges
67
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
68
+ * @returns A MailboxInvocation representing the Mailbox/queryChanges request
69
+ *
70
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.4 | RFC 8621 Section 2.4: Mailbox/queryChanges}
71
+ */
72
+ queryChanges: InvocationFactory<MailboxQueryChangesRequestInvocationArgs, MailboxInvocation<MailboxQueryChangesRequestInvocationArgs>>;
73
+ /**
74
+ * Creates, updates, or destroys Mailbox objects.
75
+ *
76
+ * @param args The invocation arguments for Mailbox/set
77
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
78
+ * @returns A MailboxInvocation representing the Mailbox/set request
79
+ *
80
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5 | RFC 8621 Section 2.5: Mailbox/set}
81
+ */
82
+ set: InvocationFactory<MailboxSetRequestInvocationArgs, MailboxInvocation<MailboxSetRequestInvocationArgs>>;
83
+ };
84
+ response: {
85
+ get: InvocationFactory<MailboxGetResponseInvocationArgs, MailboxInvocation<MailboxGetResponseInvocationArgs>>;
86
+ changes: InvocationFactory<MailboxChangesResponseInvocationArgs, MailboxInvocation<MailboxChangesResponseInvocationArgs>>;
87
+ query: InvocationFactory<import("../../invocation/types.js").BaseQueryResponseInvocationArgs, MailboxInvocation<import("../../invocation/types.js").BaseQueryResponseInvocationArgs>>;
88
+ queryChanges: InvocationFactory<import("../../invocation/types.js").BaseQueryChangesResponseInvocationArgs, MailboxInvocation<import("../../invocation/types.js").BaseQueryChangesResponseInvocationArgs>>;
89
+ set: InvocationFactory<MailboxSetResponseInvocationArgs, MailboxInvocation<MailboxSetResponseInvocationArgs>>;
90
+ };
91
+ };
@@ -0,0 +1,103 @@
1
+ import { EMAIL_CAPABILITY_URI } from "../../common/registry.js";
2
+ import { Invocation } from "../../invocation/invocation.js";
3
+ /**
4
+ * MailboxInvocation represents a JMAP Mailbox capability invocation.
5
+ *
6
+ * The Mailbox data type represents folders/mailboxes for organising email messages. It supports
7
+ * standard JMAP methods for retrieving, querying, and modifying mailbox structures.
8
+ *
9
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2 | RFC 8621 Section 2: Mailboxes}
10
+ */
11
+ export class MailboxInvocation extends Invocation {
12
+ get uri() {
13
+ return EMAIL_CAPABILITY_URI;
14
+ }
15
+ /**
16
+ * Constructs a MailboxInvocation
17
+ *
18
+ * @param method The name of the method being invoked (e.g., "get", "set", "query")
19
+ * @param args The arguments for the method invocation
20
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
21
+ */
22
+ constructor(method, args, methodCallId) {
23
+ super("Mailbox", method, args, methodCallId);
24
+ }
25
+ /**
26
+ * Create an invocation factory function
27
+ *
28
+ * @param method The name of the method to create
29
+ * @returns A new Mailbox invocation factory function for creating invocations of the specified type
30
+ */
31
+ static createInvocationFactory(method) {
32
+ /**
33
+ * An invocation factory function to create a `Mailbox/{method}` invocation`.
34
+ *
35
+ * @param args The invocation arguments for the specified `method`
36
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
37
+ * @returns An object representing the named arguments for the specified `method`
38
+ */
39
+ return (args, methodCallId) => new MailboxInvocation(method, args, methodCallId);
40
+ }
41
+ }
42
+ export const Mailbox = {
43
+ request: {
44
+ /**
45
+ * Retrieves Mailbox objects by their IDs.
46
+ *
47
+ * @param args The invocation arguments for Mailbox/get
48
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
49
+ * @returns A MailboxInvocation representing the Mailbox/get request
50
+ *
51
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.1 | RFC 8621 Section 2.1: Mailbox/get}
52
+ */
53
+ get: MailboxInvocation.createInvocationFactory("get"),
54
+ /**
55
+ * Returns changes to Mailbox objects since a given state.
56
+ *
57
+ * @param args The invocation arguments for Mailbox/changes
58
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
59
+ * @returns A MailboxInvocation representing the Mailbox/changes request
60
+ *
61
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.2 | RFC 8621 Section 2.2: Mailbox/changes}
62
+ */
63
+ changes: MailboxInvocation.createInvocationFactory("changes"),
64
+ /**
65
+ * Queries for Mailbox objects matching specified criteria.
66
+ *
67
+ * @param args The invocation arguments for Mailbox/query
68
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
69
+ * @returns A MailboxInvocation representing the Mailbox/query request
70
+ *
71
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.3 | RFC 8621 Section 2.3: Mailbox/query}
72
+ */
73
+ query: MailboxInvocation.createInvocationFactory("query"),
74
+ /**
75
+ * Returns changes to a query result since a given state.
76
+ *
77
+ * @param args The invocation arguments for Mailbox/queryChanges
78
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
79
+ * @returns A MailboxInvocation representing the Mailbox/queryChanges request
80
+ *
81
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.4 | RFC 8621 Section 2.4: Mailbox/queryChanges}
82
+ */
83
+ queryChanges: MailboxInvocation.createInvocationFactory("queryChanges"),
84
+ /**
85
+ * Creates, updates, or destroys Mailbox objects.
86
+ *
87
+ * @param args The invocation arguments for Mailbox/set
88
+ * @param methodCallId An optional unique symbol to identify this method call for result referencing
89
+ * @returns A MailboxInvocation representing the Mailbox/set request
90
+ *
91
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5 | RFC 8621 Section 2.5: Mailbox/set}
92
+ */
93
+ set: MailboxInvocation.createInvocationFactory("set"),
94
+ },
95
+ response: {
96
+ get: MailboxInvocation.createInvocationFactory("get"),
97
+ changes: MailboxInvocation.createInvocationFactory("changes"),
98
+ query: MailboxInvocation.createInvocationFactory("query"),
99
+ queryChanges: MailboxInvocation.createInvocationFactory("queryChanges"),
100
+ set: MailboxInvocation.createInvocationFactory("set"),
101
+ },
102
+ };
103
+ //# sourceMappingURL=mailbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailbox.js","sourceRoot":"","sources":["../../../../src/capabilities/mailbox/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAiB5D;;;;;;;GAOG;AACH,MAAM,OAAO,iBAEX,SAAQ,UAAiB;IACvB,IAAI,GAAG;QACH,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,YAAY,MAAsB,EAAE,IAA2B,EAAE,YAAqB;QAClF,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,uBAAuB,CAC1B,MAAsB;QAEtB;;;;;;WAMG;QACH,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAQ,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IAC5F,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,OAAO,EAAE;QACL;;;;;;;;WAQG;QACH,GAAG,EAAE,iBAAiB,CAAC,uBAAuB,CAAkC,KAAK,CAAC;QACtF;;;;;;;;WAQG;QACH,OAAO,EAAE,iBAAiB,CAAC,uBAAuB,CAAsC,SAAS,CAAC;QAClG;;;;;;;;WAQG;QACH,KAAK,EAAE,iBAAiB,CAAC,uBAAuB,CAAoC,OAAO,CAAC;QAC5F;;;;;;;;WAQG;QACH,YAAY,EACR,iBAAiB,CAAC,uBAAuB,CAA2C,cAAc,CAAC;QACvG;;;;;;;;WAQG;QACH,GAAG,EAAE,iBAAiB,CAAC,uBAAuB,CAAkC,KAAK,CAAC;KACzF;IACD,QAAQ,EAAE;QACN,GAAG,EAAE,iBAAiB,CAAC,uBAAuB,CAAmC,KAAK,CAAC;QACvF,OAAO,EAAE,iBAAiB,CAAC,uBAAuB,CAAuC,SAAS,CAAC;QACnG,KAAK,EAAE,iBAAiB,CAAC,uBAAuB,CAAqC,OAAO,CAAC;QAC7F,YAAY,EACR,iBAAiB,CAAC,uBAAuB,CAA4C,cAAc,CAAC;QACxG,GAAG,EAAE,iBAAiB,CAAC,uBAAuB,CAAmC,KAAK,CAAC;KAC1F;CACkC,CAAC"}