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.
- package/LICENSE +21 -0
- package/README.md +138 -3
- package/dist/src/capabilities/blob/blob.d.ts +83 -0
- package/dist/src/capabilities/blob/blob.js +98 -0
- package/dist/src/capabilities/blob/blob.js.map +1 -0
- package/dist/src/capabilities/blob/types.d.ts +212 -0
- package/dist/src/capabilities/blob/types.js +16 -0
- package/dist/src/capabilities/blob/types.js.map +1 -0
- package/dist/src/capabilities/blob-capability.d.ts +195 -0
- package/dist/src/capabilities/blob-capability.js +277 -0
- package/dist/src/capabilities/blob-capability.js.map +1 -0
- package/dist/src/capabilities/core/core.d.ts +47 -0
- package/dist/src/capabilities/core/core.js +59 -0
- package/dist/src/capabilities/core/core.js.map +1 -0
- package/dist/src/capabilities/core/types.d.ts +13 -0
- package/dist/src/capabilities/core/types.js +2 -0
- package/dist/src/capabilities/core/types.js.map +1 -0
- package/dist/src/capabilities/core-capability.d.ts +307 -0
- package/dist/src/capabilities/core-capability.js +344 -0
- package/dist/src/capabilities/core-capability.js.map +1 -0
- package/dist/src/capabilities/email/email.d.ts +124 -0
- package/dist/src/capabilities/email/email.js +136 -0
- package/dist/src/capabilities/email/email.js.map +1 -0
- package/dist/src/capabilities/email/types.d.ts +776 -0
- package/dist/src/capabilities/email/types.js +2 -0
- package/dist/src/capabilities/email/types.js.map +1 -0
- package/dist/src/capabilities/email-capability.d.ts +266 -0
- package/dist/src/capabilities/email-capability.js +241 -0
- package/dist/src/capabilities/email-capability.js.map +1 -0
- package/dist/src/capabilities/emailsubmission/emailsubmission.d.ts +95 -0
- package/dist/src/capabilities/emailsubmission/emailsubmission.js +107 -0
- package/dist/src/capabilities/emailsubmission/emailsubmission.js.map +1 -0
- package/dist/src/capabilities/emailsubmission/types.d.ts +256 -0
- package/dist/src/capabilities/emailsubmission/types.js +2 -0
- package/dist/src/capabilities/emailsubmission/types.js.map +1 -0
- package/dist/src/capabilities/example/example.d.ts +80 -0
- package/dist/src/capabilities/example/example.js +91 -0
- package/dist/src/capabilities/example/example.js.map +1 -0
- package/dist/src/capabilities/example/types.d.ts +33 -0
- package/dist/src/capabilities/example/types.js +2 -0
- package/dist/src/capabilities/example/types.js.map +1 -0
- package/dist/src/capabilities/identity/identity.d.ts +71 -0
- package/dist/src/capabilities/identity/identity.js +83 -0
- package/dist/src/capabilities/identity/identity.js.map +1 -0
- package/dist/src/capabilities/identity/types.d.ts +110 -0
- package/dist/src/capabilities/identity/types.js +2 -0
- package/dist/src/capabilities/identity/types.js.map +1 -0
- package/dist/src/capabilities/mailbox/mailbox.d.ts +91 -0
- package/dist/src/capabilities/mailbox/mailbox.js +103 -0
- package/dist/src/capabilities/mailbox/mailbox.js.map +1 -0
- package/dist/src/capabilities/mailbox/types.d.ts +248 -0
- package/dist/src/capabilities/mailbox/types.js +2 -0
- package/dist/src/capabilities/mailbox/types.js.map +1 -0
- package/dist/src/capabilities/maskedemail/maskedemail.d.ts +60 -0
- package/dist/src/capabilities/maskedemail/maskedemail.js +72 -0
- package/dist/src/capabilities/maskedemail/maskedemail.js.map +1 -0
- package/dist/src/capabilities/maskedemail/types.d.ts +67 -0
- package/dist/src/capabilities/maskedemail/types.js +4 -0
- package/dist/src/capabilities/maskedemail/types.js.map +1 -0
- package/dist/src/capabilities/maskedemail-capability.d.ts +112 -0
- package/dist/src/capabilities/maskedemail-capability.js +166 -0
- package/dist/src/capabilities/maskedemail-capability.js.map +1 -0
- package/dist/src/capabilities/searchsnippet/searchsnippet.d.ts +51 -0
- package/dist/src/capabilities/searchsnippet/searchsnippet.js +63 -0
- package/dist/src/capabilities/searchsnippet/searchsnippet.js.map +1 -0
- package/dist/src/capabilities/searchsnippet/types.d.ts +88 -0
- package/dist/src/capabilities/searchsnippet/types.js +2 -0
- package/dist/src/capabilities/searchsnippet/types.js.map +1 -0
- package/dist/src/capabilities/submission-capability.d.ts +89 -0
- package/dist/src/capabilities/submission-capability.js +75 -0
- package/dist/src/capabilities/submission-capability.js.map +1 -0
- package/dist/src/capabilities/thread/thread.d.ts +58 -0
- package/dist/src/capabilities/thread/thread.js +70 -0
- package/dist/src/capabilities/thread/thread.js.map +1 -0
- package/dist/src/capabilities/thread/types.d.ts +43 -0
- package/dist/src/capabilities/thread/types.js +2 -0
- package/dist/src/capabilities/thread/types.js.map +1 -0
- package/dist/src/capabilities/utils/assert-invocation-datatype.d.ts +7 -0
- package/dist/src/capabilities/utils/assert-invocation-datatype.js +13 -0
- package/dist/src/capabilities/utils/assert-invocation-datatype.js.map +1 -0
- package/dist/src/capabilities/utils/assert-invocation-method.d.ts +7 -0
- package/dist/src/capabilities/utils/assert-invocation-method.js +13 -0
- package/dist/src/capabilities/utils/assert-invocation-method.js.map +1 -0
- package/dist/src/capabilities/utils/assert-invocation.d.ts +7 -0
- package/dist/src/capabilities/utils/assert-invocation.js +22 -0
- package/dist/src/capabilities/utils/assert-invocation.js.map +1 -0
- package/dist/src/capabilities/utils/assert-non-nullish.d.ts +1 -0
- package/dist/src/capabilities/utils/assert-non-nullish.js +6 -0
- package/dist/src/capabilities/utils/assert-non-nullish.js.map +1 -0
- package/dist/src/capabilities/utils/create-readonly-account-validator.d.ts +49 -0
- package/dist/src/capabilities/utils/create-readonly-account-validator.js +80 -0
- package/dist/src/capabilities/utils/create-readonly-account-validator.js.map +1 -0
- package/dist/src/capabilities/vacationresponse/types.d.ts +100 -0
- package/dist/src/capabilities/vacationresponse/types.js +2 -0
- package/dist/src/capabilities/vacationresponse/types.js.map +1 -0
- package/dist/src/capabilities/vacationresponse/vacationresponse.d.ts +61 -0
- package/dist/src/capabilities/vacationresponse/vacationresponse.js +73 -0
- package/dist/src/capabilities/vacationresponse/vacationresponse.js.map +1 -0
- package/dist/src/capabilities/vacationresponse-capability.d.ts +65 -0
- package/dist/src/capabilities/vacationresponse-capability.js +68 -0
- package/dist/src/capabilities/vacationresponse-capability.js.map +1 -0
- package/dist/src/capability-registry/capability-registry.d.ts +148 -0
- package/dist/src/capability-registry/capability-registry.js +360 -0
- package/dist/src/capability-registry/capability-registry.js.map +1 -0
- package/dist/src/capability-registry/types.d.ts +385 -0
- package/dist/src/capability-registry/types.js +2 -0
- package/dist/src/capability-registry/types.js.map +1 -0
- package/dist/src/capability-registry/utils.d.ts +71 -0
- package/dist/src/capability-registry/utils.js +163 -0
- package/dist/src/capability-registry/utils.js.map +1 -0
- package/dist/src/common/registry.d.ts +366 -0
- package/dist/src/common/registry.js +321 -0
- package/dist/src/common/registry.js.map +1 -0
- package/dist/src/common/types.d.ts +338 -0
- package/dist/src/common/types.js +21 -0
- package/dist/src/common/types.js.map +1 -0
- package/dist/src/common/utils.d.ts +20 -0
- package/dist/src/common/utils.js +26 -0
- package/dist/src/common/utils.js.map +1 -0
- package/dist/src/index.d.ts +40 -0
- package/dist/src/index.js +33 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/invocation/arguments-proxy.d.ts +14 -0
- package/dist/src/invocation/arguments-proxy.js +37 -0
- package/dist/src/invocation/arguments-proxy.js.map +1 -0
- package/dist/src/invocation/error-invocation.d.ts +27 -0
- package/dist/src/invocation/error-invocation.js +39 -0
- package/dist/src/invocation/error-invocation.js.map +1 -0
- package/dist/src/invocation/invocation.d.ts +111 -0
- package/dist/src/invocation/invocation.js +158 -0
- package/dist/src/invocation/invocation.js.map +1 -0
- package/dist/src/invocation/result-reference.d.ts +86 -0
- package/dist/src/invocation/result-reference.js +118 -0
- package/dist/src/invocation/result-reference.js.map +1 -0
- package/dist/src/invocation/types.d.ts +637 -0
- package/dist/src/invocation/types.js +2 -0
- package/dist/src/invocation/types.js.map +1 -0
- package/dist/src/invocation/utils.d.ts +21 -0
- package/dist/src/invocation/utils.js +30 -0
- package/dist/src/invocation/utils.js.map +1 -0
- package/dist/src/invocation-factory/invocation-factory-manager.d.ts +20 -0
- package/dist/src/invocation-factory/invocation-factory-manager.js +50 -0
- package/dist/src/invocation-factory/invocation-factory-manager.js.map +1 -0
- package/dist/src/invocation-factory/invocation-list.d.ts +32 -0
- package/dist/src/invocation-factory/invocation-list.js +77 -0
- package/dist/src/invocation-factory/invocation-list.js.map +1 -0
- package/dist/src/invocation-factory/types.d.ts +11 -0
- package/dist/src/invocation-factory/types.js +2 -0
- package/dist/src/invocation-factory/types.js.map +1 -0
- package/dist/src/jmap-client/jmap-client.d.ts +252 -0
- package/dist/src/jmap-client/jmap-client.js +777 -0
- package/dist/src/jmap-client/jmap-client.js.map +1 -0
- package/dist/src/jmap-client/types.d.ts +427 -0
- package/dist/src/jmap-client/types.js +21 -0
- package/dist/src/jmap-client/types.js.map +1 -0
- package/dist/src/jmap-client/utils/abort-controller.d.ts +8 -0
- package/dist/src/jmap-client/utils/abort-controller.js +24 -0
- package/dist/src/jmap-client/utils/abort-controller.js.map +1 -0
- package/dist/src/jmap-client/utils/assert-connected.d.ts +7 -0
- package/dist/src/jmap-client/utils/assert-connected.js +11 -0
- package/dist/src/jmap-client/utils/assert-connected.js.map +1 -0
- package/dist/src/jmap-client/utils/deep-freeze.d.ts +7 -0
- package/dist/src/jmap-client/utils/deep-freeze.js +17 -0
- package/dist/src/jmap-client/utils/deep-freeze.js.map +1 -0
- package/dist/src/jmap-client/utils/emitter.d.ts +9 -0
- package/dist/src/jmap-client/utils/emitter.js +18 -0
- package/dist/src/jmap-client/utils/emitter.js.map +1 -0
- package/dist/src/jmap-client/utils/filter-session-capabilities.d.ts +22 -0
- package/dist/src/jmap-client/utils/filter-session-capabilities.js +40 -0
- package/dist/src/jmap-client/utils/filter-session-capabilities.js.map +1 -0
- package/dist/src/jmap-client/utils/jmap-request-error.d.ts +28 -0
- package/dist/src/jmap-client/utils/jmap-request-error.js +48 -0
- package/dist/src/jmap-client/utils/jmap-request-error.js.map +1 -0
- package/dist/src/jmap-client/utils/logger.d.ts +6 -0
- package/dist/src/jmap-client/utils/logger.js +22 -0
- package/dist/src/jmap-client/utils/logger.js.map +1 -0
- package/dist/src/jmap-client/utils/merge-headers.d.ts +11 -0
- package/dist/src/jmap-client/utils/merge-headers.js +40 -0
- package/dist/src/jmap-client/utils/merge-headers.js.map +1 -0
- package/dist/src/jmap-client/utils/template-utils.d.ts +27 -0
- package/dist/src/jmap-client/utils/template-utils.js +61 -0
- package/dist/src/jmap-client/utils/template-utils.js.map +1 -0
- package/dist/src/jmap-client/utils/track-utils.d.ts +19 -0
- package/dist/src/jmap-client/utils/track-utils.js +35 -0
- package/dist/src/jmap-client/utils/track-utils.js.map +1 -0
- package/dist/src/jmap-client/utils/transport.d.ts +12 -0
- package/dist/src/jmap-client/utils/transport.js +38 -0
- package/dist/src/jmap-client/utils/transport.js.map +1 -0
- package/dist/src/jmap-client/utils/validate-session.d.ts +19 -0
- package/dist/src/jmap-client/utils/validate-session.js +29 -0
- package/dist/src/jmap-client/utils/validate-session.js.map +1 -0
- package/dist/src/request-builder/request-builder.d.ts +95 -0
- package/dist/src/request-builder/request-builder.js +343 -0
- package/dist/src/request-builder/request-builder.js.map +1 -0
- package/dist/src/request-builder/types.d.ts +32 -0
- package/dist/src/request-builder/types.js +2 -0
- package/dist/src/request-builder/types.js.map +1 -0
- package/package.json +69 -3
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
// Capability URIs
|
|
2
|
+
/**
|
|
3
|
+
* Prefix for all IETF-registered JMAP capability URIs.
|
|
4
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
5
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-2 RFC 8620 Section 2}
|
|
6
|
+
*/
|
|
7
|
+
export const JMAP_CAPABILITY_PREFIX = "urn:ietf:params:jmap:";
|
|
8
|
+
/**
|
|
9
|
+
* Prefix for JMAP request-level error types.
|
|
10
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-9.4.7 Registration for JMAP Error Placeholder in JMAP Capabilities Registry - RFC 8620 Section 9.4.7}
|
|
11
|
+
|
|
12
|
+
*/
|
|
13
|
+
export const ERROR_CAPABILITY_PREFIX = `${JMAP_CAPABILITY_PREFIX}error:`;
|
|
14
|
+
/**
|
|
15
|
+
* JMAP Blob management capability.
|
|
16
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
17
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9404.html#section-6.1 JMAP Capability Registration for "blob" - RFC 9404 Section 6.1}
|
|
18
|
+
*/
|
|
19
|
+
export const BLOB_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}blob`;
|
|
20
|
+
/**
|
|
21
|
+
* JMAP Core capability. This capability is always supported by all JMAP servers.
|
|
22
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
23
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-9.4.6 Initial Registration for JMAP Core - RFC 8620 Section 9.4.6}
|
|
24
|
+
|
|
25
|
+
*/
|
|
26
|
+
export const CORE_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}core`;
|
|
27
|
+
/**
|
|
28
|
+
* JMAP Mail capability.
|
|
29
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
30
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621#section-10.1 JMAP Capability Registration for "mail" - RFC 8621 Section 10.1}
|
|
31
|
+
|
|
32
|
+
*/
|
|
33
|
+
export const EMAIL_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}mail`;
|
|
34
|
+
/**
|
|
35
|
+
* JMAP Submission capability.
|
|
36
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
37
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621#section-10.2 JMAP Capability Registration for "submission" - RFC 8621 Section 10.2}
|
|
38
|
+
|
|
39
|
+
*/
|
|
40
|
+
export const SUBMISSION_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}submission`;
|
|
41
|
+
/**
|
|
42
|
+
* JMAP Vacation Response capability.
|
|
43
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
44
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621#section-10.3 JMAP Capability Registration for "vacationresponse" - RFC 8621 Section 10.3}
|
|
45
|
+
|
|
46
|
+
*/
|
|
47
|
+
export const VACATIONRESPONSE_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}vacationresponse`;
|
|
48
|
+
/**
|
|
49
|
+
* JMAP Message Disposition Notification (MDN) capability.
|
|
50
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
51
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9007.html#section-4.1 JMAP Capability Registration for "mdn" - RFC 9007 Section 4.1}
|
|
52
|
+
*/
|
|
53
|
+
export const MDN_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}mdn`;
|
|
54
|
+
/**
|
|
55
|
+
* JMAP S/MIME Signature Verification capability.
|
|
56
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
57
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9219.html#section-5.1 JMAP Capability Registration for "smimeverify" - RFC 9219 Section 5.1}
|
|
58
|
+
*/
|
|
59
|
+
export const SMIMEVERIFY_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}smimeverify`;
|
|
60
|
+
/**
|
|
61
|
+
* JMAP Quotas capability.
|
|
62
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
63
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9425.html#section-7.1 JMAP Capability Registration for "quota" - RFC 9425 Section 7.1}
|
|
64
|
+
*/
|
|
65
|
+
export const QUOTA_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}quota`;
|
|
66
|
+
/**
|
|
67
|
+
* JMAP WebPush VAPID capability.
|
|
68
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
69
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9749.html#section-7.1 JMAP Capability Registration for VAPID - RFC 9749 Section 7.1}
|
|
70
|
+
*/
|
|
71
|
+
export const WEBPUSH_VAPID_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}webpush-vapid`;
|
|
72
|
+
/**
|
|
73
|
+
* JMAP Calendars capability.
|
|
74
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
75
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars#section-10.1 JMAP Capability Registration for "calendars" - Draft IETF JMAP Calendars Section 10.1}
|
|
76
|
+
|
|
77
|
+
*/
|
|
78
|
+
export const CALENDARS_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}calendars`;
|
|
79
|
+
/**
|
|
80
|
+
* JMAP Calendar event parsing capability.
|
|
81
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
82
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars#section-1.5.3 Draft IETF JMAP Calendars Section 1.5.3}
|
|
83
|
+
|
|
84
|
+
*/
|
|
85
|
+
export const CALENDARS_PARSE_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}calendars:parse`;
|
|
86
|
+
/**
|
|
87
|
+
* JMAP Principals capability.
|
|
88
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
89
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9670.html#section-7.1 JMAP Capability Registration for "principals" - RFC 9670 Section 7.1}
|
|
90
|
+
|
|
91
|
+
*/
|
|
92
|
+
export const PRINCIPALS_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}principals`;
|
|
93
|
+
/**
|
|
94
|
+
* JMAP Service Provider availability capability.
|
|
95
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
96
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars#section-10.2 JMAP Capability Registration for "principals:availability" - Draft IETF JMAP Calendars Section 10.2}
|
|
97
|
+
|
|
98
|
+
*/
|
|
99
|
+
export const PRINCIPALS_AVAILABILITY_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}principals:availability`;
|
|
100
|
+
/**
|
|
101
|
+
* JMAP Principal owner capability.
|
|
102
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
103
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9670.html#section-7.2 JMAP Capability Registration for "principals:owner" - RFC 9670 Section 7.2}
|
|
104
|
+
|
|
105
|
+
*/
|
|
106
|
+
export const PRINCIPALS_OWNER_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}principals:owner`;
|
|
107
|
+
/**
|
|
108
|
+
* JMAP Contacts capability.
|
|
109
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
110
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9610.html#section-7.1 JMAP Capability Registration for "contacts" - RFC 9610 Section 7.1}
|
|
111
|
+
|
|
112
|
+
*/
|
|
113
|
+
export const CONTACTS_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}contacts`;
|
|
114
|
+
/**
|
|
115
|
+
* JMAP Tasks capability.
|
|
116
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
117
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-tasks#section-7.1 JMAP Capability Registration for "tasks" - Draft IETF JMAP Tasks Section 7.1}
|
|
118
|
+
|
|
119
|
+
*/
|
|
120
|
+
export const TASKS_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}tasks`;
|
|
121
|
+
/**
|
|
122
|
+
* JMAP Tasks Recurrences capability.
|
|
123
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
124
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-tasks#section-7.2 JMAP Capability Registration for "tasks:recurrences" - Draft IETF JMAP Tasks Section 7.2}
|
|
125
|
+
|
|
126
|
+
*/
|
|
127
|
+
export const TASKS_RECURRENCES_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}tasks:recurrences`;
|
|
128
|
+
/**
|
|
129
|
+
* JMAP Tasks Assignees capability.
|
|
130
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
131
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-tasks#section-7.3 JMAP Capability Registration for "tasks:assignees" - Draft IETF JMAP Tasks Section 7.3}
|
|
132
|
+
|
|
133
|
+
*/
|
|
134
|
+
export const TASKS_ASSIGNEES_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}tasks:assignees`;
|
|
135
|
+
/**
|
|
136
|
+
* JMAP Tasks Alerts capability.
|
|
137
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
138
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-tasks#section-7.4 JMAP Capability Registration for "tasks:alerts" - Draft IETF JMAP Tasks Section 7.4}
|
|
139
|
+
|
|
140
|
+
*/
|
|
141
|
+
export const TASKS_ALERTS_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}tasks:alerts`;
|
|
142
|
+
/**
|
|
143
|
+
* JMAP Tasks Multilingual capability.
|
|
144
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
145
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-tasks#section-7.5 JMAP Capability Registration for "tasks:multilingual" - Draft IETF JMAP Tasks Section 7.5}
|
|
146
|
+
|
|
147
|
+
*/
|
|
148
|
+
export const TASKS_MULTILINGUAL_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}tasks:multilingual`;
|
|
149
|
+
/**
|
|
150
|
+
* JMAP Tasks Custom Timezones capability.
|
|
151
|
+
* @see {@link https://www.iana.org/assignments/jmap/jmap.xhtml IANA JMAP Capabilities Registry}
|
|
152
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-tasks#section-7.6 JMAP Capability Registration for "tasks:customtimezones" - Draft IETF JMAP Tasks Section 7.6}
|
|
153
|
+
|
|
154
|
+
*/
|
|
155
|
+
export const TASKS_CUSTOMTIMEZONES_CAPABILITY_URI = `${JMAP_CAPABILITY_PREFIX}tasks:customtimezones`;
|
|
156
|
+
/**
|
|
157
|
+
* FastMail Masked Email capability. This is a vendor-specific extension.
|
|
158
|
+
* @see {@link https://www.fastmail.com/dev/#masked-email-api FastMail Masked Email API Documentation}
|
|
159
|
+
*/
|
|
160
|
+
export const MASKED_EMAIL_CAPABILITY_URI = `https://www.fastmail.com/dev/maskedemail`;
|
|
161
|
+
// Data Types
|
|
162
|
+
/**
|
|
163
|
+
* Core data type for JMAP Core objects.
|
|
164
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-4 The Core/Echo Method - RFC 8620 Section 4 }
|
|
165
|
+
|
|
166
|
+
*/ export const CORE_DATA_TYPE = "Core";
|
|
167
|
+
/**
|
|
168
|
+
* Blob data type for binary data management.
|
|
169
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-6 Binary Data - RFC 8620 Section 6}
|
|
170
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9404.html#name-blob-methods Blob Methods - RFC 9404 Section 4}
|
|
171
|
+
|
|
172
|
+
*/
|
|
173
|
+
export const BLOB_DATA_TYPE = "Blob";
|
|
174
|
+
/**
|
|
175
|
+
* PushSubscription data type for push notifications.
|
|
176
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2 PushSubscription - RFC 8620 Section 7.2}
|
|
177
|
+
|
|
178
|
+
*/
|
|
179
|
+
export const PUSHSUBSCRIPTION_DATA_TYPE = "PushSubscription";
|
|
180
|
+
/**
|
|
181
|
+
* Mailbox data type for email mailbox objects.
|
|
182
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-2 Mailboxes - RFC 8621 Section 2}
|
|
183
|
+
|
|
184
|
+
*/
|
|
185
|
+
export const MAILBOX_DATA_TYPE = "Mailbox";
|
|
186
|
+
/**
|
|
187
|
+
* Thread data type for email thread objects.
|
|
188
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-3 Threads - RFC 8621 Section 3}
|
|
189
|
+
|
|
190
|
+
*/
|
|
191
|
+
export const THREAD_DATA_TYPE = "Thread";
|
|
192
|
+
/**
|
|
193
|
+
* Email data type for email message objects.
|
|
194
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-4 Emails - RFC 8621 Section 4}
|
|
195
|
+
|
|
196
|
+
*/
|
|
197
|
+
export const EMAIL_DATA_TYPE = "Email";
|
|
198
|
+
/**
|
|
199
|
+
* EmailDelivery data type for push notifications. Has no methods; exists only to notify clients when new emails are added.
|
|
200
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-1.5 Push - RFC 8621 Section 1.5}
|
|
201
|
+
|
|
202
|
+
*/
|
|
203
|
+
export const EMAILDELIVERY_DATA_TYPE = "EmailDelivery";
|
|
204
|
+
/**
|
|
205
|
+
* SearchSnippet data type for email search result snippets.
|
|
206
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-5 Search Snippets - RFC 8621 Section 5}
|
|
207
|
+
|
|
208
|
+
*/
|
|
209
|
+
export const SEARCHSNIPPET_DATA_TYPE = "SearchSnippet";
|
|
210
|
+
/**
|
|
211
|
+
* Identity data type for sender identities in email submission.
|
|
212
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-6 Identity - RFC 8621 Section 6}
|
|
213
|
+
|
|
214
|
+
*/
|
|
215
|
+
export const IDENTITY_DATA_TYPE = "Identity";
|
|
216
|
+
/**
|
|
217
|
+
* EmailSubmission data type for email submission objects.
|
|
218
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-7 Email Submission - RFC 8621 Section 7}
|
|
219
|
+
|
|
220
|
+
*/
|
|
221
|
+
export const EMAILSUBMISSION_DATA_TYPE = "EmailSubmission";
|
|
222
|
+
/**
|
|
223
|
+
* VacationResponse data type for vacation/out-of-office responses.
|
|
224
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8621.html#section-8 Vacation Response - RFC 8621 Section 8}
|
|
225
|
+
|
|
226
|
+
*/
|
|
227
|
+
export const VACATIONRESPONSE_DATA_TYPE = "VacationResponse";
|
|
228
|
+
/**
|
|
229
|
+
* MDN (Message Disposition Notification) data type.
|
|
230
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9007.html#section-2 MDN - RFC 9007 Section 2}
|
|
231
|
+
*/
|
|
232
|
+
export const MDN_DATA_TYPE = "MDN";
|
|
233
|
+
/**
|
|
234
|
+
* Quota data type for quota management.
|
|
235
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9425.html#section-4 Quota - RFC 9425 Section 4}
|
|
236
|
+
*/
|
|
237
|
+
export const QUOTA_DATA_TYPE = "Quota";
|
|
238
|
+
/**
|
|
239
|
+
* SieveScript data type for Sieve script management.
|
|
240
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9661.html#section-2 SieveScript - RFC 9661 Section 2}
|
|
241
|
+
*/
|
|
242
|
+
export const SIEVESCRIPT_DATA_TYPE = "SieveScript";
|
|
243
|
+
/**
|
|
244
|
+
* Principal data type for principal objects.
|
|
245
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9670.html#section-2 Principals - RFC 9670 Section 2}
|
|
246
|
+
|
|
247
|
+
*/
|
|
248
|
+
export const PRINCIPAL_DATA_TYPE = "Principal";
|
|
249
|
+
/**
|
|
250
|
+
* ShareNotification data type for share notifications.
|
|
251
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9670.html#section-3 ShareNotifications - RFC 9670 Section 3}
|
|
252
|
+
|
|
253
|
+
*/
|
|
254
|
+
export const SHARENOTIFICATION_DATA_TYPE = "ShareNotification";
|
|
255
|
+
/**
|
|
256
|
+
* AddressBook data type for address book objects.
|
|
257
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9610.html#section-2 AddressBooks - RFC 9610 Section 2}
|
|
258
|
+
|
|
259
|
+
*/
|
|
260
|
+
export const ADDRESSBOOK_DATA_TYPE = "AddressBook";
|
|
261
|
+
/**
|
|
262
|
+
* ContactCard data type for contact card objects.
|
|
263
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc9610.html#section-3 ContactCards - RFC 9610 Section 3}
|
|
264
|
+
|
|
265
|
+
*/
|
|
266
|
+
export const CONTACTCARD_DATA_TYPE = "ContactCard";
|
|
267
|
+
/**
|
|
268
|
+
* Calendar data type for calendar objects.
|
|
269
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars#section-4 Calendars - Draft IETF JMAP Calendars Section 4}
|
|
270
|
+
|
|
271
|
+
*/
|
|
272
|
+
export const CALENDAR_DATA_TYPE = "Calendar";
|
|
273
|
+
/**
|
|
274
|
+
* CalendarEvent data type for calendar event objects.
|
|
275
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars#section-5 Calendar Events - Draft IETF JMAP Calendars Section 5}
|
|
276
|
+
|
|
277
|
+
*/
|
|
278
|
+
export const CALENDAREVENT_DATA_TYPE = "CalendarEvent";
|
|
279
|
+
/**
|
|
280
|
+
* CalendarEventNotification data type for calendar event notifications.
|
|
281
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars#section-7 Calendar Event Notifications - Draft IETF JMAP Calendars Section 7}
|
|
282
|
+
|
|
283
|
+
*/
|
|
284
|
+
export const CALENDAREVENTNOTIFICATION_DATA_TYPE = "CalendarEventNotification";
|
|
285
|
+
/**
|
|
286
|
+
* ParticipantIdentity data type for participant identity objects.
|
|
287
|
+
* @see {@link https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars#section-3 Participant Identities - Draft IETF JMAP Calendars Section 3}
|
|
288
|
+
|
|
289
|
+
*/
|
|
290
|
+
export const PARTICIPANTIDENTITY_DATA_TYPE = "ParticipantIdentity";
|
|
291
|
+
/**
|
|
292
|
+
* MaskedEmail data type for FastMail's masked email feature.
|
|
293
|
+
* @see {@link https://www.fastmail.com/dev/#masked-email-api FastMail Masked Email API Documentation}
|
|
294
|
+
*/
|
|
295
|
+
export const MASKED_EMAIL_TYPE = "MaskedEmail";
|
|
296
|
+
// Request Level Errors
|
|
297
|
+
/**
|
|
298
|
+
* The client included a capability in the "using" property of the request
|
|
299
|
+
* that the server does not support.
|
|
300
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.1 RFC 8620 Section 3.6.1 - Request-Level Errors}
|
|
301
|
+
*/
|
|
302
|
+
export const UNKNOWN_CAPABILITY = `${ERROR_CAPABILITY_PREFIX}unknownCapability`;
|
|
303
|
+
/**
|
|
304
|
+
* The content type of the request was not application/json or the request
|
|
305
|
+
* did not parse as I-JSON.
|
|
306
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.1 RFC 8620 Section 3.6.1 - Request-Level Errors}
|
|
307
|
+
*/
|
|
308
|
+
export const NOT_JSON = `${ERROR_CAPABILITY_PREFIX}notJSON`;
|
|
309
|
+
/**
|
|
310
|
+
* The request parsed as JSON but did not match the type signature of the Request object.
|
|
311
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.1 RFC 8620 Section 3.6.1 - Request-Level Errors}
|
|
312
|
+
*/
|
|
313
|
+
export const NOT_REQUEST = `${ERROR_CAPABILITY_PREFIX}notRequest`;
|
|
314
|
+
/**
|
|
315
|
+
* The request was rejected due to a server-defined limit.
|
|
316
|
+
* A "limit" property MUST also be present on the "problem details" object,
|
|
317
|
+
* containing the name of the limit being applied.
|
|
318
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.1 RFC 8620 Section 3.6.1 - Request-Level Errors}
|
|
319
|
+
*/
|
|
320
|
+
export const LIMIT = `${ERROR_CAPABILITY_PREFIX}limit`;
|
|
321
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/common/registry.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
import type { ADDRESSBOOK_DATA_TYPE, BLOB_CAPABILITY_URI, BLOB_DATA_TYPE, CALENDAREVENTNOTIFICATION_DATA_TYPE, CALENDAREVENT_DATA_TYPE, CALENDARS_CAPABILITY_URI, CALENDARS_PARSE_CAPABILITY_URI, CALENDAR_DATA_TYPE, CONTACTCARD_DATA_TYPE, CONTACTS_CAPABILITY_URI, CORE_DATA_TYPE, EMAILDELIVERY_DATA_TYPE, EMAILSUBMISSION_DATA_TYPE, EMAIL_CAPABILITY_URI, EMAIL_DATA_TYPE, IDENTITY_DATA_TYPE, LIMIT, MAILBOX_DATA_TYPE, MASKED_EMAIL_CAPABILITY_URI, MASKED_EMAIL_TYPE, MDN_CAPABILITY_URI, MDN_DATA_TYPE, NOT_JSON, NOT_REQUEST, PARTICIPANTIDENTITY_DATA_TYPE, PRINCIPALS_AVAILABILITY_CAPABILITY_URI, PRINCIPALS_CAPABILITY_URI, PRINCIPALS_OWNER_CAPABILITY_URI, PRINCIPAL_DATA_TYPE, PUSHSUBSCRIPTION_DATA_TYPE, QUOTA_CAPABILITY_URI, QUOTA_DATA_TYPE, SEARCHSNIPPET_DATA_TYPE, SHARENOTIFICATION_DATA_TYPE, SIEVESCRIPT_DATA_TYPE, SMIMEVERIFY_CAPABILITY_URI, SUBMISSION_CAPABILITY_URI, TASKS_ALERTS_CAPABILITY_URI, TASKS_ASSIGNEES_CAPABILITY_URI, TASKS_CAPABILITY_URI, TASKS_CUSTOMTIMEZONES_CAPABILITY_URI, TASKS_MULTILINGUAL_CAPABILITY_URI, TASKS_RECURRENCES_CAPABILITY_URI, THREAD_DATA_TYPE, UNKNOWN_CAPABILITY, VACATIONRESPONSE_CAPABILITY_URI, VACATIONRESPONSE_DATA_TYPE, WEBPUSH_VAPID_CAPABILITY_URI } from "./registry.js";
|
|
3
|
+
import { CORE_CAPABILITY_URI } from "./registry.js";
|
|
4
|
+
/**
|
|
5
|
+
* Any primitive, object or array value that can be represented in JSON
|
|
6
|
+
*/
|
|
7
|
+
export type JSONValue = string | number | boolean | null | {
|
|
8
|
+
[member: string]: JSONValue;
|
|
9
|
+
} | JSONValue[];
|
|
10
|
+
/**
|
|
11
|
+
* An empty object
|
|
12
|
+
*/
|
|
13
|
+
export type EmptyObject = Record<string | symbol, never>;
|
|
14
|
+
/**
|
|
15
|
+
* Any string value, with some known suggested values that may be used.
|
|
16
|
+
*/
|
|
17
|
+
export type HintedString<KnownValues extends string> = (string & {}) | KnownValues;
|
|
18
|
+
/**
|
|
19
|
+
* From `T`, make the specified properties in the union `K` required,
|
|
20
|
+
* and make all other properties optional
|
|
21
|
+
*/
|
|
22
|
+
export type RequireSome<T, K extends keyof T> = Required<Pick<T, K>> & Partial<Omit<T, K>>;
|
|
23
|
+
/**
|
|
24
|
+
* A type that can be either a value of type `T` or a Promise that resolves to a value of type `T`.
|
|
25
|
+
*/
|
|
26
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
27
|
+
/**
|
|
28
|
+
* A string of at least 1 and a maximum of 255 octets in size, and it MUST only contain
|
|
29
|
+
* characters from the “URL and Filename Safe” base64 alphabet, as defined in Section 5
|
|
30
|
+
* of {@link https://www.rfc-editor.org/rfc/rfc4648.html RFC 4648}, excluding the pad character
|
|
31
|
+
* (`=`). This means the allowed characters are the ASCII alphanumeric characters
|
|
32
|
+
* (`A-Za-z0-9`), hyphen (`-`), and underscore (`_`).
|
|
33
|
+
*/
|
|
34
|
+
export type Id = string & {};
|
|
35
|
+
/**
|
|
36
|
+
* An integer in the range -2^53+1 <= value <= 2^53-1, the safe range for integers stored
|
|
37
|
+
* in a floating-point double, represented as a JSON `Number`.
|
|
38
|
+
*/
|
|
39
|
+
export type Int = number & {};
|
|
40
|
+
/**
|
|
41
|
+
* An `Int` where the value MUST be in the range 0 <= value <= 2^53-1.
|
|
42
|
+
*/
|
|
43
|
+
export type UnsignedInt = number & {};
|
|
44
|
+
/**
|
|
45
|
+
* A string in date-time format {@link https://www.rfc-editor.org/rfc/rfc3339.html RFC 3339}.
|
|
46
|
+
* To ensure a normalised form, the time-secfrac MUST always be omitted if zero, and
|
|
47
|
+
* any letters in the string (e.g., “`T`” and “`Z`”) MUST be uppercase.
|
|
48
|
+
*
|
|
49
|
+
* For example, `"2014-10-30T14:12:00+08:00"`.
|
|
50
|
+
*/
|
|
51
|
+
export type TZDate = string & {};
|
|
52
|
+
/**
|
|
53
|
+
* A `Date` where the time-offset component MUST be `Z` (i.e., it must be in UTC time).
|
|
54
|
+
*
|
|
55
|
+
* For example, `"2014-10-30T06:12:00Z"`.
|
|
56
|
+
*/
|
|
57
|
+
export type UTCDate = string & {};
|
|
58
|
+
/**
|
|
59
|
+
* The list of data types defined in various JMAP specifications, including the core specification and extensions.
|
|
60
|
+
* This is not an exhaustive list of all possible data types, as servers may support additional private data types as well.
|
|
61
|
+
*/
|
|
62
|
+
export type JMAPDataType = HintedString<CORE_DATA_TYPE | BLOB_DATA_TYPE | PUSHSUBSCRIPTION_DATA_TYPE | MAILBOX_DATA_TYPE | THREAD_DATA_TYPE | EMAIL_DATA_TYPE | EMAILDELIVERY_DATA_TYPE | SEARCHSNIPPET_DATA_TYPE | IDENTITY_DATA_TYPE | EMAILSUBMISSION_DATA_TYPE | VACATIONRESPONSE_DATA_TYPE | MDN_DATA_TYPE | QUOTA_DATA_TYPE | SIEVESCRIPT_DATA_TYPE | PRINCIPAL_DATA_TYPE | SHARENOTIFICATION_DATA_TYPE | ADDRESSBOOK_DATA_TYPE | CONTACTCARD_DATA_TYPE | CALENDAR_DATA_TYPE | CALENDAREVENT_DATA_TYPE | CALENDAREVENTNOTIFICATION_DATA_TYPE | PARTICIPANTIDENTITY_DATA_TYPE | MASKED_EMAIL_TYPE>;
|
|
63
|
+
/**
|
|
64
|
+
* The list of method names defined in the JMAP core specification ({@link https://www.rfc-editor.org/rfc/rfc8620.html RFC 8620}).
|
|
65
|
+
*/
|
|
66
|
+
export type JMAPMethodName = HintedString<"changes" | "copy" | "echo" | "get" | "import" | "lookup" | "parse" | "query" | "queryChanges" | "set" | "upload">;
|
|
67
|
+
/**
|
|
68
|
+
* Zod schema for JMAPServerCapabilities.
|
|
69
|
+
*
|
|
70
|
+
* Validates the structural requirement that the Core capability key is present.
|
|
71
|
+
* Content validation of individual capabilities is handled by each capability's
|
|
72
|
+
* own StandardSchema, validated via {@link CapabilityRegistryInterface.validateServerCapabilities}.
|
|
73
|
+
*/
|
|
74
|
+
export declare const JMAPServerCapabilitiesSchema: z.ZodObject<{
|
|
75
|
+
"urn:ietf:params:jmap:core": z.ZodObject<{}, z.core.$loose>;
|
|
76
|
+
}, z.core.$loose>;
|
|
77
|
+
/**
|
|
78
|
+
* Registry of known server capability properties.
|
|
79
|
+
*
|
|
80
|
+
* This interface can be augmented by third-party plugins using `declare module` to add
|
|
81
|
+
* type-safe capability properties. `JMAPServerCapabilities` extends this interface
|
|
82
|
+
* and automatically picks up augmented properties.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* declare module "jmap-kit" {
|
|
87
|
+
* interface ServerCapabilityRegistry {
|
|
88
|
+
* "https://example.com/custom-capability"?: { customProp: string };
|
|
89
|
+
* }
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export interface ServerCapabilityRegistry {
|
|
94
|
+
[key: string & {}]: unknown;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* JMAPServerCapabilities
|
|
98
|
+
*
|
|
99
|
+
* Capabilities supported by the server, keyed by capability URI.
|
|
100
|
+
*
|
|
101
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-2 RFC 8620 Section 2 - The JMAP Session Resource}
|
|
102
|
+
*/
|
|
103
|
+
export interface JMAPServerCapabilities extends ServerCapabilityRegistry {
|
|
104
|
+
[key: string & {}]: unknown;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Zod schema for JMAPAccountCapabilities.
|
|
108
|
+
*
|
|
109
|
+
* Validates the structural shape of account capabilities. Content validation of individual
|
|
110
|
+
* capabilities is handled by each capability's own StandardSchema, validated via
|
|
111
|
+
* {@link CapabilityRegistryInterface.validateAccountCapabilities}.
|
|
112
|
+
*/
|
|
113
|
+
export declare const JMAPAccountCapabilitiesSchema: z.ZodObject<{}, z.core.$loose>;
|
|
114
|
+
/**
|
|
115
|
+
* Registry of known account capability properties.
|
|
116
|
+
*
|
|
117
|
+
* This interface can be augmented by third-party plugins using `declare module` to add
|
|
118
|
+
* type-safe capability properties. `JMAPAccountCapabilities` extends this interface
|
|
119
|
+
* and automatically picks up augmented properties.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* declare module “jmap-kit” {
|
|
124
|
+
* interface AccountCapabilityRegistry {
|
|
125
|
+
* “https://example.com/custom-capability”?: { customProp: string };
|
|
126
|
+
* }
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export interface AccountCapabilityRegistry {
|
|
131
|
+
[key: string & {}]: unknown;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* JMAPAccountCapabilities
|
|
135
|
+
*
|
|
136
|
+
* Capabilities supported by an account, keyed by capability URI.
|
|
137
|
+
*
|
|
138
|
+
* @see {@link https://www.rfc-editor.org/rfc/rfc8620.html#section-1.6.2 RFC 8620 Section 1.6.2 - Accounts}
|
|
139
|
+
*/
|
|
140
|
+
export interface JMAPAccountCapabilities extends AccountCapabilityRegistry {
|
|
141
|
+
[key: string & {}]: unknown;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* A capability is referenced by a URI. The JMAP capability URI can be a URN
|
|
145
|
+
* starting with urn:ietf:params:jmap: plus a unique suffix that is the index
|
|
146
|
+
* value in the jmap URN sub-namespace. These are registered in the
|
|
147
|
+
* {@link https://www.iana.org/assignments/jmap/jmap.xhtml JMAP Capabilities Register}.
|
|
148
|
+
*
|
|
149
|
+
* Identifiers for vendor extensions MUST be a URL belonging to a domain owned by
|
|
150
|
+
* the vendor, to avoid conflict. The URL SHOULD resolve to documentation for the
|
|
151
|
+
* changes the extension makes.
|
|
152
|
+
*
|
|
153
|
+
* This is the list of Capability URIs declared via the ServerCapabilityRegistry.
|
|
154
|
+
*
|
|
155
|
+
* @see {@link JMAPCapabilityUri}
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
export type JMAPCapability = keyof JMAPServerCapabilities;
|
|
159
|
+
/**
|
|
160
|
+
* A capability is referenced by a URI. The JMAP capability URI can be a URN
|
|
161
|
+
* starting with urn:ietf:params:jmap: plus a unique suffix that is the index
|
|
162
|
+
* value in the jmap URN sub-namespace. These are registered in the
|
|
163
|
+
* {@link https://www.iana.org/assignments/jmap/jmap.xhtml JMAP Capabilities Register}.
|
|
164
|
+
*
|
|
165
|
+
* Identifiers for vendor extensions MUST be a URL belonging to a domain owned by
|
|
166
|
+
* the vendor, to avoid conflict. The URL SHOULD resolve to documentation for the
|
|
167
|
+
* changes the extension makes.
|
|
168
|
+
*
|
|
169
|
+
* The` list of capability URIs defined in the JMAP core specification and extensions.
|
|
170
|
+
* This is not an exhaustive list of all possible capabilities, as servers may support
|
|
171
|
+
* additional private capabilities as well; or newer capabilities defined in future
|
|
172
|
+
* specifications.
|
|
173
|
+
*
|
|
174
|
+
* @see {@link JMAPCapability}
|
|
175
|
+
*/
|
|
176
|
+
export type JMAPCapabilityUri = HintedString<BLOB_CAPABILITY_URI | CORE_CAPABILITY_URI | EMAIL_CAPABILITY_URI | SUBMISSION_CAPABILITY_URI | VACATIONRESPONSE_CAPABILITY_URI | MDN_CAPABILITY_URI | SMIMEVERIFY_CAPABILITY_URI | QUOTA_CAPABILITY_URI | WEBPUSH_VAPID_CAPABILITY_URI | CALENDARS_CAPABILITY_URI | CALENDARS_PARSE_CAPABILITY_URI | PRINCIPALS_CAPABILITY_URI | PRINCIPALS_AVAILABILITY_CAPABILITY_URI | PRINCIPALS_OWNER_CAPABILITY_URI | CONTACTS_CAPABILITY_URI | TASKS_CAPABILITY_URI | TASKS_RECURRENCES_CAPABILITY_URI | TASKS_ASSIGNEES_CAPABILITY_URI | TASKS_ALERTS_CAPABILITY_URI | TASKS_MULTILINGUAL_CAPABILITY_URI | TASKS_CUSTOMTIMEZONES_CAPABILITY_URI | MASKED_EMAIL_CAPABILITY_URI> | JMAPCapability;
|
|
177
|
+
/**
|
|
178
|
+
* A map of a (client-specified) creation id to the id the server assigned when
|
|
179
|
+
* a record was successfully created.
|
|
180
|
+
*/
|
|
181
|
+
export type IdMap = Record<Id, Id>;
|
|
182
|
+
/**
|
|
183
|
+
* To allow clients to make more efficient use of the network and avoid round trips,
|
|
184
|
+
* an argument to one method can be taken from the result of a previous method call
|
|
185
|
+
* in the same request.
|
|
186
|
+
*/
|
|
187
|
+
export interface JMAPResultReference {
|
|
188
|
+
/**
|
|
189
|
+
* The method call id of a previous method call in the current request.
|
|
190
|
+
*/
|
|
191
|
+
resultOf: string;
|
|
192
|
+
/**
|
|
193
|
+
* The required name of a response to that method call.
|
|
194
|
+
*/
|
|
195
|
+
name: string;
|
|
196
|
+
/**
|
|
197
|
+
* A pointer into the arguments of the response selected via the name and resultOf properties.
|
|
198
|
+
* This is a JSON Pointer {@link https://www.rfc-editor.org/rfc/rfc6901.html RFC 6901}, except it also
|
|
199
|
+
* allows the use of `*` to map through an array.
|
|
200
|
+
*/
|
|
201
|
+
path: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* An object containing named arguments for a method request.
|
|
205
|
+
*
|
|
206
|
+
* The value of property names starting with a hash (`#`) must be Result References.
|
|
207
|
+
* All other property names may have any suitable value.
|
|
208
|
+
*/
|
|
209
|
+
export interface JMAPRequestInvocationArgs {
|
|
210
|
+
/**
|
|
211
|
+
* A named argument for a method.
|
|
212
|
+
*/
|
|
213
|
+
[key: string]: JSONValue;
|
|
214
|
+
/**
|
|
215
|
+
* A Result Reference to the result of a previous method call in a request.
|
|
216
|
+
*/
|
|
217
|
+
[ref: `#${string}`]: Omit<JSONValue & JMAPResultReference, "member">;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* An object containing named arguments for a method response.
|
|
221
|
+
*/
|
|
222
|
+
export interface JMAPResponseInvocationArgs {
|
|
223
|
+
/**
|
|
224
|
+
* A named argument for a method.
|
|
225
|
+
*/
|
|
226
|
+
[key: string]: JSONValue;
|
|
227
|
+
/**
|
|
228
|
+
* A Result Reference to the result of a previous method call cannot appear in a response.
|
|
229
|
+
*/
|
|
230
|
+
[ref: `#${string}`]: never;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* An object containing named arguments for a method response that represents an error.
|
|
234
|
+
*/
|
|
235
|
+
export type JMAPResponseInvocationErrorArgs = JMAPResponseInvocationArgs & {
|
|
236
|
+
/**
|
|
237
|
+
* The type of error that occurred, as a string. This is a HintedString, so it can be any string, but the JMAP core specification defines some known error types that servers may use.
|
|
238
|
+
*/
|
|
239
|
+
type: HintedString<"serverUnavailable" | "serverFail" | "serverPartialFail" | "unknownMethod" | "invalidArguments" | "invalidResultReference" | "forbidden" | "accountNotFound" | "accountNotSupportedByMethod" | "accountReadOnly" | "requestTooLarge" | "cannotCalculateChanges" | "stateMismatch" | "anchorNotFound" | "unsupportedSort" | "unsupportedFilter" | "tooManyChanges">;
|
|
240
|
+
/**
|
|
241
|
+
* A human-readable description of the error, which may be used for debugging or logging purposes.
|
|
242
|
+
*/
|
|
243
|
+
description?: string;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* This is a tuple, represented as a JSON array containing three elements:
|
|
247
|
+
*
|
|
248
|
+
* - The name of the method to call.
|
|
249
|
+
* - An object containing named arguments for that method request.
|
|
250
|
+
* - The method call id: an arbitrary string from the client to be echoed
|
|
251
|
+
* back with the responses emitted by that method call.
|
|
252
|
+
*/
|
|
253
|
+
export type JMAPRequestInvocation = [name: string, args: JMAPRequestInvocationArgs, methodCallId: Id];
|
|
254
|
+
/**
|
|
255
|
+
* This is a tuple, represented as a JSON array containing three elements:
|
|
256
|
+
*
|
|
257
|
+
* - The name of the method response.
|
|
258
|
+
* - An object containing named arguments for that response.
|
|
259
|
+
* - The method call id: an arbitrary string from corresponding request method set by the client
|
|
260
|
+
*/
|
|
261
|
+
export type JMAPResponseInvocation = [name: string, args: JMAPResponseInvocationArgs, methodCallId: Id];
|
|
262
|
+
/**
|
|
263
|
+
* A Request object.
|
|
264
|
+
*/
|
|
265
|
+
export type JMAPRequest = {
|
|
266
|
+
/**
|
|
267
|
+
* The set of capabilities the client wishes to use. The client MAY include
|
|
268
|
+
* capability identifiers even if the method calls it makes do not utilise
|
|
269
|
+
* those capabilities.
|
|
270
|
+
*/
|
|
271
|
+
using: JMAPCapability[];
|
|
272
|
+
/**
|
|
273
|
+
* An array of method calls to process on the server.
|
|
274
|
+
*/
|
|
275
|
+
methodCalls: JMAPRequestInvocation[];
|
|
276
|
+
/**
|
|
277
|
+
* An optional map of a (client-specified) creation id to the id the server
|
|
278
|
+
* assigned when a record was successfully created.
|
|
279
|
+
*/
|
|
280
|
+
createdIds?: IdMap;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* A Response object.
|
|
284
|
+
*/
|
|
285
|
+
export type JMAPResponse = {
|
|
286
|
+
/**
|
|
287
|
+
* An array of responses, in the same format as the methodCalls on the Request object.
|
|
288
|
+
*/
|
|
289
|
+
methodResponses: JMAPResponseInvocation[];
|
|
290
|
+
/**
|
|
291
|
+
* A map of a (client-specified) creation id to the id the server assigned
|
|
292
|
+
* when a record was successfully created.
|
|
293
|
+
*/
|
|
294
|
+
createdIds?: IdMap;
|
|
295
|
+
/**
|
|
296
|
+
* The current value of the `state` string on the Session object.
|
|
297
|
+
*/
|
|
298
|
+
sessionState: string;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Known JMAP request-level error types defined in the JMAP core specification (RFC 8620).
|
|
302
|
+
*/
|
|
303
|
+
export type JMAPRequestErrorTypes = UNKNOWN_CAPABILITY | NOT_JSON | NOT_REQUEST | LIMIT;
|
|
304
|
+
/**
|
|
305
|
+
* Structure of a Problem Details object used for JMAP request-level error responses.
|
|
306
|
+
*
|
|
307
|
+
* This follows {@link https://www.rfc-editor.org/rfc/rfc7807.html RFC 7807} "Problem Details for HTTP APIs" format.
|
|
308
|
+
*/
|
|
309
|
+
export interface ProblemDetails<T extends string = string> {
|
|
310
|
+
/**
|
|
311
|
+
* A URI reference that identifies the problem type.
|
|
312
|
+
* When dereferenced, it SHOULD provide human-readable documentation for the problem type.
|
|
313
|
+
* This MUST be a string in URI format.
|
|
314
|
+
*/
|
|
315
|
+
type: HintedString<T>;
|
|
316
|
+
/**
|
|
317
|
+
* A short, human-readable summary of the problem type.
|
|
318
|
+
* It SHOULD NOT change from occurrence to occurrence of the problem,
|
|
319
|
+
* except for purposes of localization.
|
|
320
|
+
*/
|
|
321
|
+
title?: string;
|
|
322
|
+
/**
|
|
323
|
+
* The HTTP status code for this occurrence of the problem.
|
|
324
|
+
*/
|
|
325
|
+
status?: number;
|
|
326
|
+
/**
|
|
327
|
+
* A human-readable explanation specific to this occurrence of the problem.
|
|
328
|
+
*/
|
|
329
|
+
detail?: string;
|
|
330
|
+
/**
|
|
331
|
+
* A URI reference that identifies the specific occurrence of the problem.
|
|
332
|
+
*/
|
|
333
|
+
instance?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Additional properties specific to the problem type.
|
|
336
|
+
*/
|
|
337
|
+
[key: string]: JSONValue | undefined;
|
|
338
|
+
}
|