sew-proto 0.11.6

Sew wire contracts: ids, addresses, errors, HTTP and gateway bodies, permissions, policies, audit.
Documentation
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
{
  "$defs": {
    "Channel": {
      "description": "A channel, DM or group DM.",
      "properties": {
        "archived_at": {
          "description": "When the channel was archived.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "assistant_reader_ids": {
          "description": "Assistants that read this DM or group DM through their pinned person. Empty (and absent) for\nspace channels.",
          "items": {
            "description": "A Sew id: a decimal string of a 64-bit time-sortable id (1 to 9223372036854775807).",
            "pattern": "^[1-9][0-9]{0,18}$",
            "type": "string"
          },
          "type": "array"
        },
        "category_id": {
          "description": "Its category.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": [
            "string",
            "null"
          ]
        },
        "closing": {
          "description": "A voice room K2 is closing: joins and moves into it are refused\n(`409 conflict` `channel_closing`) and it is archived when its last person leaves.\nAbsent when `false`; never set on an archived channel.",
          "type": "boolean"
        },
        "created_at": {
          "description": "When the channel was created.",
          "format": "date-time",
          "type": "string"
        },
        "created_by": {
          "description": "Who created the channel. Optional on the wire so older payloads still parse; the\nserver always sends it.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": [
            "string",
            "null"
          ]
        },
        "dm_member_ids": {
          "description": "The DM's members; empty for space channels.",
          "items": {
            "description": "A Sew id: a decimal string of a 64-bit time-sortable id (1 to 9223372036854775807).",
            "pattern": "^[1-9][0-9]{0,18}$",
            "type": "string"
          },
          "type": "array"
        },
        "file_retention_days": {
          "description": "Effective file retention in days. Absent = forever.",
          "format": "uint32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "has_guests": {
          "default": false,
          "description": "Whether any member of the channel or DM is a guest. Old payloads read as `false`.",
          "type": "boolean"
        },
        "head_seq": {
          "description": "Head of the channel change log.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "id": {
          "description": "The channel id.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": "string"
        },
        "last_message_id": {
          "description": "The newest message.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": [
            "string",
            "null"
          ]
        },
        "meeting": {
          "anyOf": [
            {
              "$ref": "#/$defs/ChannelMeeting"
            },
            {
              "type": "null"
            }
          ],
          "description": "A meeting channel's meeting; absent on every other channel."
        },
        "member_count": {
          "default": 0,
          "description": "Joined members. Old payloads without it read as 0.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "members_can_leave": {
          "description": "Since 0.10.0: in a governed Space (App- or server-governed), the members of this\nprivate channel may leave it (`POST /channels/{id}/leave`), which they otherwise cannot.\nSet over mgmt only. Absent when `false` (and from older servers).",
          "type": "boolean"
        },
        "my_perms": {
          "description": "The viewer's effective permissions here.",
          "pattern": "^(0|[1-9][0-9]{0,19})$",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "The name; absent for 1:1 DMs and for group DMs nobody has named (clients then show\nthe members of `dm_member_ids`).",
          "type": [
            "string",
            "null"
          ]
        },
        "position": {
          "description": "Sort position in its category.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "purpose": {
          "description": "The purpose.",
          "type": [
            "string",
            "null"
          ]
        },
        "recording_audio_days": {
          "description": "The channel's default audio keep days for recordings; absent = the org\ndefault.",
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "recording_auto": {
          "description": "Voice channels: a recording starts on the first join. Absent = off.",
          "type": "boolean"
        },
        "recording_require_consent": {
          "description": "Voice channels: declining the recording notice means not joining;\nabsent = the org policy `recording.require_consent_to_join`.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "recording_required": {
          "description": "Voice channels: the channel's own \"record every call with more than one person\";\nabsent = it inherits (its Space, its governing App and the org policy may still require\nit; `false` never removes their rule).",
          "type": [
            "boolean",
            "null"
          ]
        },
        "recording_rule": {
          "$ref": "#/$defs/RecordingRule",
          "description": "Voice channels, DMs and group DMs: the rule the room records under, every source\napplied: `auto` (a recording starts on the first join), `required` (every call with\nmore than one person is recorded) or `none` (people press Record). Absent = `none`."
        },
        "retention_days": {
          "description": "Effective message retention in days (holds ignored). Absent = forever.",
          "format": "uint32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "slow_mode_s": {
          "default": 0,
          "description": "Slow mode in seconds, 0 = off. Always sent; old payloads read as 0.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "slug": {
          "description": "The slug; absent for DMs.",
          "pattern": "^[a-z0-9][a-z0-9-]{0,79}$",
          "type": [
            "string",
            "null"
          ]
        },
        "space_id": {
          "description": "Its space; absent for DMs.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": [
            "string",
            "null"
          ]
        },
        "synced": {
          "description": "Whether overwrites follow the category.",
          "type": "boolean"
        },
        "topic": {
          "description": "The topic.",
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "$ref": "#/$defs/ChannelType",
          "description": "The channel type."
        },
        "user_limit": {
          "description": "Voice channels: at most this many people in the call, 0 = no per-channel limit.\nAbsent (0) for other types.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "visibility": {
          "$ref": "#/$defs/Visibility",
          "description": "Public or private; DMs are private."
        }
      },
      "required": [
        "id",
        "type",
        "visibility",
        "position",
        "synced",
        "head_seq",
        "dm_member_ids",
        "created_at"
      ],
      "type": "object"
    },
    "ChannelMeeting": {
      "description": "`meeting` on a meeting channel's JSON: the meeting it belongs to.",
      "properties": {
        "id": {
          "description": "The meeting id.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "ChannelType": {
      "description": "Channel type.",
      "oneOf": [
        {
          "const": "text",
          "description": "A text channel.",
          "type": "string"
        },
        {
          "const": "voice",
          "description": "A voice channel.",
          "type": "string"
        },
        {
          "const": "announcement",
          "description": "An announcement channel: `@everyone` posts only in threads by default.",
          "type": "string"
        },
        {
          "const": "dm",
          "description": "A 1:1 DM (no space, slug or name; always private).",
          "type": "string"
        },
        {
          "const": "group_dm",
          "description": "A group DM of up to 9 people.",
          "type": "string"
        }
      ]
    },
    "MeetingLobbyKind": {
      "description": "Who knocked.",
      "oneOf": [
        {
          "const": "link_guest",
          "description": "A link guest (redeemed the link without an account).",
          "type": "string"
        },
        {
          "const": "member",
          "description": "A signed-in member of the install who knocked with the link.",
          "type": "string"
        }
      ]
    },
    "MeetingPerson": {
      "description": "One person in a meeting channel, as everyone in that channel sees them: the\ndisplay name and whether they are a link guest, nothing else (no handle, email, role,\nstatus, profile field or Space membership). Answered by `GET /api/v1/channels/{id}/people`\nand carried as `person` by a meeting channel's `channel_member_added`. A link guest's name is\ntext the guest chooses: treat it as untrusted, and show it as plain text, after a fixed\n\"Guest\" badge.",
      "properties": {
        "display_name": {
          "description": "Their display name.",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/MeetingLobbyKind",
          "description": "A link guest or a member of the install (the lobby's `kind`)."
        },
        "member_id": {
          "description": "The member.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": "string"
        }
      },
      "required": [
        "member_id",
        "display_name",
        "kind"
      ],
      "type": "object"
    },
    "RecordingRule": {
      "description": "The rule a voice room records under, as its settings and their sources resolve it.",
      "oneOf": [
        {
          "const": "none",
          "description": "People press Record.",
          "type": "string"
        },
        {
          "const": "auto",
          "description": "The room records from its first join.",
          "type": "string"
        },
        {
          "const": "required",
          "description": "The room records every call with two or more people.",
          "type": "string"
        }
      ]
    },
    "Visibility": {
      "description": "Channel visibility.",
      "oneOf": [
        {
          "const": "public",
          "description": "Every space member can see and join it.",
          "type": "string"
        },
        {
          "const": "private",
          "description": "Members only.",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Body of `channel_member_added` and `channel_member_removed`.",
  "properties": {
    "channel": {
      "anyOf": [
        {
          "$ref": "#/$defs/Channel"
        },
        {
          "type": "null"
        }
      ],
      "description": "The channel; set only in the copy sent to the joining member."
    },
    "channel_id": {
      "description": "The channel.",
      "pattern": "^[1-9][0-9]{0,18}$",
      "type": "string"
    },
    "member_id": {
      "description": "The member.",
      "pattern": "^[1-9][0-9]{0,18}$",
      "type": "string"
    },
    "person": {
      "anyOf": [
        {
          "$ref": "#/$defs/MeetingPerson"
        },
        {
          "type": "null"
        }
      ],
      "description": "On a meeting channel's `channel_member_added` only, the joiner's name and\nkind, as `GET /api/v1/channels/{id}/people` shows them (a link guest learns other\npeople's names this way and from that route only)."
    },
    "seq": {
      "description": "The channel change seq of the `member_joined` / `member_left` entry.",
      "format": "uint64",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    }
  },
  "required": [
    "channel_id",
    "member_id"
  ],
  "title": "ChannelMemberEvent",
  "type": "object"
}