summaryrefslogtreecommitdiffstats
path: root/comm/mail/components/extensions/schemas/accounts.json
blob: fb325425b277d30e81ae27d17f979f63e858a694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
[
  {
    "namespace": "manifest",
    "types": [
      {
        "$extend": "OptionalPermission",
        "choices": [
          {
            "type": "string",
            "enum": ["accountsRead"]
          }
        ]
      }
    ]
  },
  {
    "namespace": "accounts",
    "permissions": ["accountsRead"],
    "types": [
      {
        "id": "MailAccount",
        "description": "An object describing a mail account, as returned for example by the :ref:`accounts.list` and :ref:`accounts.get` methods. The ``folders`` property is only included if requested.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A unique identifier for this account."
          },
          "name": {
            "type": "string",
            "description": "The human-friendly name of this account."
          },
          "type": {
            "type": "string",
            "description": "What sort of account this is, e.g. <value>imap</value>, <value>nntp</value>, or <value>pop3</value>."
          },
          "folders": {
            "type": "array",
            "optional": true,
            "description": "The folders for this account are only included if requested.",
            "items": {
              "$ref": "folders.MailFolder"
            }
          },
          "identities": {
            "type": "array",
            "description": "The identities associated with this account. The default identity is listed first, others in no particular order.",
            "items": {
              "$ref": "identities.MailIdentity"
            }
          }
        }
      }
    ],
    "functions": [
      {
        "name": "list",
        "type": "function",
        "description": "Returns all mail accounts. They will be returned in the same order as used in Thunderbird's folder pane.",
        "async": "callback",
        "parameters": [
          {
            "name": "includeFolders",
            "description": "Specifies whether the returned :ref:`accounts.MailAccount` objects should included their account's folders. Defaults to <value>true</value>.",
            "optional": true,
            "default": true,
            "type": "boolean"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "type": "array",
                "items": {
                  "$ref": "accounts.MailAccount"
                }
              }
            ]
          }
        ]
      },
      {
        "name": "get",
        "type": "function",
        "description": "Returns details of the requested account, or <value>null</value> if it doesn't exist.",
        "async": "callback",
        "parameters": [
          {
            "name": "accountId",
            "type": "string"
          },
          {
            "name": "includeFolders",
            "description": "Specifies whether the returned :ref:`accounts.MailAccount` object should included the account's folders. Defaults to <value>true</value>.",
            "optional": true,
            "default": true,
            "type": "boolean"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "accounts.MailAccount",
                "optional": true
              }
            ]
          }
        ]
      },
      {
        "name": "getDefault",
        "type": "function",
        "description": "Returns the default account, or <value>null</value> if it is not defined.",
        "async": "callback",
        "parameters": [
          {
            "name": "includeFolders",
            "description": "Specifies whether the returned :ref:`accounts.MailAccount` object should included the account's folders. Defaults to <value>true</value>.",
            "optional": true,
            "default": true,
            "type": "boolean"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "accounts.MailAccount",
                "optional": true
              }
            ]
          }
        ]
      },
      {
        "name": "setDefaultIdentity",
        "type": "function",
        "description": "Sets the default identity for an account.",
        "async": true,
        "deprecated": "This will be removed. Use :ref:`identities.setDefault` instead.",
        "parameters": [
          {
            "name": "accountId",
            "type": "string"
          },
          {
            "name": "identityId",
            "type": "string"
          }
        ]
      },
      {
        "name": "getDefaultIdentity",
        "type": "function",
        "description": "Returns the default identity for an account, or <value>null</value> if it is not defined.",
        "async": "callback",
        "deprecated": "This will be removed. Use :ref:`identities.getDefault` instead.",
        "parameters": [
          {
            "name": "accountId",
            "type": "string"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "identities.MailIdentity"
              }
            ]
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onCreated",
        "type": "function",
        "description": "Fired when a new account has been created.",
        "parameters": [
          {
            "name": "id",
            "type": "string"
          },
          {
            "name": "account",
            "$ref": "MailAccount"
          }
        ]
      },
      {
        "name": "onDeleted",
        "type": "function",
        "description": "Fired when an account has been removed.",
        "parameters": [
          {
            "name": "id",
            "type": "string"
          }
        ]
      },
      {
        "name": "onUpdated",
        "type": "function",
        "description": "Fired when a property of an account has been modified. Folders and identities of accounts are not monitored by this event, use the dedicated folder and identity events instead. A changed ``defaultIdentity`` is reported only after a different identity has been assigned as default identity, but not after a property of the default identity has been changed.",
        "parameters": [
          {
            "name": "id",
            "type": "string"
          },
          {
            "name": "changedValues",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "The human-friendly name of this account."
              },
              "defaultIdentity": {
                "$ref": "identities.MailIdentity",
                "description": "The default identity of this account."
              }
            }
          }
        ]
      }
    ]
  }
]