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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
{
  "$defs": {
    "ArchiveWho": {
      "description": "`channels.archive`: who can archive a channel.",
      "oneOf": [
        {
          "const": "creator_and_managers",
          "description": "The channel's creator and channel managers.",
          "type": "string"
        },
        {
          "const": "managers",
          "description": "Channel managers only.",
          "type": "string"
        }
      ]
    },
    "ChannelCreateFloor": {
      "description": "`channels.create_*_floor`: the install-level gate on top of the create bit.",
      "oneOf": [
        {
          "const": "perm",
          "description": "The permission bit alone suffices.",
          "type": "string"
        },
        {
          "const": "space_admins",
          "description": "The bit plus being a space admin.",
          "type": "string"
        },
        {
          "const": "install_admins",
          "description": "The bit plus being an install owner or admin.",
          "type": "string"
        }
      ]
    },
    "DigestDetail": {
      "description": "Org policy `digest.detail`: what a digest mail names.",
      "oneOf": [
        {
          "const": "names",
          "description": "Conversations, counts, author names and times.",
          "type": "string"
        },
        {
          "const": "counts",
          "description": "Only the total and an \"Open Sew\" link.",
          "type": "string"
        }
      ]
    },
    "GuestInvite": {
      "description": "`guests.invite`: who can invite guests.",
      "oneOf": [
        {
          "const": "admins",
          "description": "Install owners and admins only.",
          "type": "string"
        },
        {
          "const": "perm",
          "description": "Anyone holding INVITE_GUESTS (bit 44).",
          "type": "string"
        }
      ]
    },
    "ManagedProfileField": {
      "description": "A profile field `identity.managed_fields` may give to K2. A listed field changes only\nthrough mgmt (`/mgmt/v1/principals/*`); a client write naming it answers `403\npolicy_denied` with `details.reason = \"managed_by_provider\"`. `username` and `email`\nare always K2's in K2 mode and are not listed.",
      "oneOf": [
        {
          "const": "display_name",
          "description": "The display name.",
          "type": "string"
        },
        {
          "const": "title",
          "description": "The title.",
          "type": "string"
        },
        {
          "const": "pronouns",
          "description": "The pronouns.",
          "type": "string"
        },
        {
          "const": "avatar",
          "description": "The avatar: `POST /api/v1/me/avatar` and `/me/avatar/clear` are refused, and\n`POST /mgmt/v1/principals/avatar` is the only writer (`force` replaces an avatar the\nmember set before).",
          "type": "string"
        }
      ]
    },
    "MeetingsCreate": {
      "description": "`meetings.create`: who may host a meeting.",
      "oneOf": [
        {
          "const": "members",
          "description": "Any active non-guest member of the Meetings Space (on a standalone install, any\nactive non-guest member: the first create adds them to the Space).",
          "type": "string"
        },
        {
          "const": "admins",
          "description": "Install owners and admins only.",
          "type": "string"
        }
      ]
    },
    "NotifyLevel": {
      "description": "A notification level (`*.level` codes 1–3).",
      "oneOf": [
        {
          "const": "all",
          "description": "Every message.",
          "type": "string"
        },
        {
          "const": "mentions",
          "description": "Mentions, DMs, keywords and followed threads.",
          "type": "string"
        },
        {
          "const": "none",
          "description": "Nothing (reminders still arrive).",
          "type": "string"
        }
      ]
    },
    "RecordingRequiredPolicy": {
      "description": "Org policy `recording.required`: whether rooms record every call with two or more\npeople.",
      "oneOf": [
        {
          "const": "off",
          "description": "Not required by the org (the default; Apps, Spaces and channels may still require\nit).",
          "type": "string"
        },
        {
          "const": "multi_person",
          "description": "Every call with two or more people is recorded.",
          "type": "string"
        }
      ]
    },
    "SpacesCreate": {
      "description": "`spaces.create`: who can create spaces.",
      "oneOf": [
        {
          "const": "admins",
          "description": "Install owners and admins only.",
          "type": "string"
        },
        {
          "const": "members",
          "description": "Any member.",
          "type": "string"
        }
      ]
    },
    "VerificationCode": {
      "description": "Policy `calls.verification_code`: whether \"Call info → Security code\" is\nshown. `required` is reserved for a later mode and refused by the policy validator.",
      "oneOf": [
        {
          "const": "shown",
          "description": "Shown on request, never modal (the default).",
          "type": "string"
        },
        {
          "const": "hidden",
          "description": "Not shown.",
          "type": "string"
        },
        {
          "const": "required",
          "description": "Reserved: \"confirm before you speak\" (refused in v1).",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "A partial policy change. Every key is optional; unknown keys are rejected.",
  "properties": {
    "agents.allowed_in_dms": {
      "description": "`agents.allowed_in_dms`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "agents.dm_with_box_people": {
      "description": "`agents.dm_with_box_people` (since 0.10.0).",
      "type": [
        "boolean",
        "null"
      ]
    },
    "calls.dm_enabled": {
      "description": "`calls.dm_enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "calls.stats_beacon": {
      "description": "`calls.stats_beacon`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "calls.verification_code": {
      "anyOf": [
        {
          "$ref": "#/$defs/VerificationCode"
        },
        {
          "type": "null"
        }
      ],
      "description": "`calls.verification_code`: `shown` or `hidden`; `required` is reserved."
    },
    "channels.archive": {
      "anyOf": [
        {
          "$ref": "#/$defs/ArchiveWho"
        },
        {
          "type": "null"
        }
      ],
      "description": "`channels.archive`."
    },
    "channels.create_private_floor": {
      "anyOf": [
        {
          "$ref": "#/$defs/ChannelCreateFloor"
        },
        {
          "type": "null"
        }
      ],
      "description": "`channels.create_private_floor`."
    },
    "channels.create_public_floor": {
      "anyOf": [
        {
          "$ref": "#/$defs/ChannelCreateFloor"
        },
        {
          "type": "null"
        }
      ],
      "description": "`channels.create_public_floor`."
    },
    "digest.detail": {
      "anyOf": [
        {
          "$ref": "#/$defs/DigestDetail"
        },
        {
          "type": "null"
        }
      ],
      "description": "`digest.detail`."
    },
    "digest.enabled": {
      "description": "`digest.enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "dm.read_receipts": {
      "description": "`dm.read_receipts`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "emoji.max_per_space": {
      "description": "`emoji.max_per_space`.",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "files.max_bytes": {
      "description": "`files.max_bytes` (≥ 1).",
      "format": "uint64",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "files.space_quota_bytes": {
      "description": "`files.space_quota_bytes`.",
      "format": "uint64",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "files.strip_image_location": {
      "description": "`files.strip_image_location`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "gifs.api_key_ref": {
      "description": "`gifs.api_key_ref` (≤ 256); `null` clears it.",
      "type": [
        "string",
        "null"
      ]
    },
    "gifs.enabled": {
      "description": "`gifs.enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "gifs.provider": {
      "description": "`gifs.provider` (≤ 64); `null` clears it.",
      "type": [
        "string",
        "null"
      ]
    },
    "guests.dm_non_channel_mates": {
      "description": "`guests.dm_non_channel_mates`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "guests.enabled": {
      "description": "`guests.enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "guests.invite": {
      "anyOf": [
        {
          "$ref": "#/$defs/GuestInvite"
        },
        {
          "type": "null"
        }
      ],
      "description": "`guests.invite`."
    },
    "identity.managed_fields": {
      "description": "`identity.managed_fields`: distinct known fields (an empty list gives K2 none of\nthem); `null` restores the default. Mgmt only.",
      "items": {
        "$ref": "#/$defs/ManagedProfileField"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "link_previews.enabled": {
      "description": "`link_previews.enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "meetings.create": {
      "anyOf": [
        {
          "$ref": "#/$defs/MeetingsCreate"
        },
        {
          "type": "null"
        }
      ],
      "description": "`meetings.create`."
    },
    "meetings.enabled": {
      "description": "`meetings.enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "meetings.grace_minutes": {
      "description": "`meetings.grace_minutes` (0–720).",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "meetings.link_guests": {
      "description": "`meetings.link_guests`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "meetings.max_duration_minutes": {
      "description": "`meetings.max_duration_minutes` (1–720).",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "meetings.max_participants": {
      "description": "`meetings.max_participants` (2–200).",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "meetings.privacy_contact": {
      "description": "`meetings.privacy_contact` (≤ 300 characters); `null` clears it.",
      "type": [
        "string",
        "null"
      ]
    },
    "mentions.channel_max_members": {
      "description": "`mentions.channel_max_members` (≥ 2).",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "messages.delete_own": {
      "description": "`messages.delete_own`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "messages.deleted_purge_days": {
      "description": "`messages.deleted_purge_days`: a read-only mirror; a write is refused with\n`managed_by_retention`.",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "messages.edit_window_s": {
      "description": "`messages.edit_window_s`.",
      "format": "uint64",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "notifications.default_level": {
      "anyOf": [
        {
          "$ref": "#/$defs/NotifyLevel"
        },
        {
          "type": "null"
        }
      ],
      "description": "`notifications.default_level`."
    },
    "notifications.mgmt_preview": {
      "description": "`notifications.mgmt_preview`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "presence.show_to_guests": {
      "description": "`presence.show_to_guests`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "private.space_admins_can_join": {
      "description": "`private.space_admins_can_join`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "recording.audio_default_days": {
      "description": "`recording.audio_default_days`.",
      "format": "uint16",
      "maximum": 65535,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "recording.audio_max_days": {
      "description": "`recording.audio_max_days`.",
      "format": "uint16",
      "maximum": 65535,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "recording.dm_enabled": {
      "description": "`recording.dm_enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "recording.enabled": {
      "description": "`recording.enabled`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "recording.require_consent_to_join": {
      "description": "`recording.require_consent_to_join`.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "recording.required": {
      "anyOf": [
        {
          "$ref": "#/$defs/RecordingRequiredPolicy"
        },
        {
          "type": "null"
        }
      ],
      "description": "`recording.required`."
    },
    "retention.default_days": {
      "description": "`retention.default_days`.",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "spaces.create": {
      "anyOf": [
        {
          "$ref": "#/$defs/SpacesCreate"
        },
        {
          "type": "null"
        }
      ],
      "description": "`spaces.create`."
    }
  },
  "title": "PolicyPatch",
  "type": "object"
}