kuvert 3.0.0__tar.gz → 3.2.0__tar.gz

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.
@@ -151,3 +151,6 @@ data
151
151
  fakts.yaml
152
152
  # Local-source override for the integration stack (see tests/conftest.py)
153
153
  tests/integration/docker-compose.local.yml
154
+
155
+ # The server version the integration tests ran against, stamped into a release.
156
+ kuvert/_tested.json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: kuvert
3
- Version: 3.0.0
3
+ Version: 3.2.0
4
4
  Summary: The python client for kuvert, the arkitekt mail service
5
5
  Author-email: jhnnsrs <jhnnsrs@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -0,0 +1 @@
1
+ {"version": "9.4.0"}
@@ -68,7 +68,7 @@
68
68
  "external_modules": [],
69
69
  "additional_bases": {},
70
70
  "additional_config": {},
71
- "directive_class_vars": [],
71
+ "class_fields": [],
72
72
  "force_plugin_order": true,
73
73
  "omitted_document_rules": [],
74
74
  "parsers": [],
@@ -88,6 +88,18 @@
88
88
  {
89
89
  "type": "turms.plugins.client.ClientPlugin",
90
90
  "client_class": "KuvertApi",
91
+ "client_fields": [
92
+ {
93
+ "name": "__scopes__",
94
+ "kind": "tuple[str, ...]",
95
+ "collector": {
96
+ "type": "root_field_directive",
97
+ "directive": "auth",
98
+ "argument": "required_scopes"
99
+ },
100
+ "combine": "union"
101
+ }
102
+ ],
91
103
  "global_kwargs": [
92
104
  {
93
105
  "key": "task",
@@ -1,5 +1,7 @@
1
1
  directive @auth(required_scopes: [String!], required_roles: [String!], required_org_roles: [String!], any_scope_of: [String!], any_role_of: [String!], any_org_role_of: [String!], allow_scoped: Boolean) on FIELD_DEFINITION
2
2
 
3
+ directive @identified(by: String!) on OBJECT
4
+
3
5
  directive @oneOf on INPUT_OBJECT
4
6
 
5
7
  schema @link(url: "https://specs.apollo.dev/federation/v2.11", import: ["@key"]) {
@@ -907,7 +909,7 @@ type MailPreset {
907
909
  """
908
910
  A provider the organization's admins set up (an IMAP server, a Gmail or Microsoft OAuth client). Every mailbox is linked through one; credentials are never returned.
909
911
  """
910
- type MailProvider @key(fields: "id", resolvable: true) {
912
+ type MailProvider @key(fields: "id", resolvable: true) @identified(by: "@kuvert/mailprovider") {
911
913
  id: ID!
912
914
 
913
915
  """
@@ -1021,7 +1023,7 @@ input MarkMessagesInput {
1021
1023
  """
1022
1024
  A message in a folder. A copy in another folder is another message with the same `messageId`.
1023
1025
  """
1024
- type Message @key(fields: "id", resolvable: true) {
1026
+ type Message @key(fields: "id", resolvable: true) @identified(by: "@kuvert/message") {
1025
1027
  id: ID!
1026
1028
 
1027
1029
  """The mailbox."""
@@ -1195,162 +1197,162 @@ input MoveMessagesInput {
1195
1197
 
1196
1198
  type Mutation {
1197
1199
  """Admins: set up an IMAP provider, with fixed servers or open to any."""
1198
- createServerProvider(input: CreateServerProviderInput!): MailProvider! @auth(required_org_roles: ["admin"])
1200
+ createServerProvider(input: CreateServerProviderInput!): MailProvider! @auth(required_scopes: ["kuvert_providers"], any_role_of: ["kuvert_admin"])
1199
1201
 
1200
1202
  """
1201
1203
  Admins: change an IMAP provider; its mailboxes follow new fixed servers.
1202
1204
  """
1203
- updateServerProvider(input: UpdateServerProviderInput!): MailProvider! @auth(required_org_roles: ["admin"])
1205
+ updateServerProvider(input: UpdateServerProviderInput!): MailProvider! @auth(required_scopes: ["kuvert_providers"], any_role_of: ["kuvert_admin"])
1204
1206
 
1205
1207
  """Admins: set up a Gmail or Microsoft OAuth client as a provider."""
1206
- createOAuthProvider(input: CreateOAuthProviderInput!): MailProvider! @auth(required_org_roles: ["admin"])
1208
+ createOAuthProvider(input: CreateOAuthProviderInput!): MailProvider! @auth(required_scopes: ["kuvert_providers"], any_role_of: ["kuvert_admin"])
1207
1209
 
1208
1210
  """
1209
1211
  Admins: change a Gmail or Microsoft provider; an empty secret keeps the stored one.
1210
1212
  """
1211
- updateOAuthProvider(input: UpdateOAuthProviderInput!): MailProvider! @auth(required_org_roles: ["admin"])
1213
+ updateOAuthProvider(input: UpdateOAuthProviderInput!): MailProvider! @auth(required_scopes: ["kuvert_providers"], any_role_of: ["kuvert_admin"])
1212
1214
 
1213
1215
  """
1214
1216
  Admins: rename, enable or disable any provider, or change its capabilities.
1215
1217
  """
1216
- updateProvider(input: UpdateProviderInput!): MailProvider! @auth(required_org_roles: ["admin"])
1218
+ updateProvider(input: UpdateProviderInput!): MailProvider! @auth(required_scopes: ["kuvert_providers"], any_role_of: ["kuvert_admin"])
1217
1219
 
1218
1220
  """Admins: remove a provider no mailbox goes through."""
1219
- deleteProvider(id: ID!): ID! @auth(required_org_roles: ["admin"])
1221
+ deleteProvider(id: ID!): ID! @auth(required_scopes: ["kuvert_providers"], any_role_of: ["kuvert_admin"])
1220
1222
 
1221
1223
  """
1222
1224
  Link a mailbox with a username and (app) password through an IMAP provider; the login is tested first.
1223
1225
  """
1224
- createMailAccount(input: CreateMailAccountInput!): MailAccount! @auth
1226
+ createMailAccount(input: CreateMailAccountInput!): MailAccount! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1225
1227
 
1226
1228
  """
1227
1229
  Change a mailbox (owner only); new servers or credentials are tested first.
1228
1230
  """
1229
- updateMailAccount(input: UpdateMailAccountInput!): MailAccount! @auth
1231
+ updateMailAccount(input: UpdateMailAccountInput!): MailAccount! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1230
1232
 
1231
1233
  """Log in to a mailbox's servers now."""
1232
- testMailAccount(id: ID!): MailAccount! @auth
1234
+ testMailAccount(id: ID!): MailAccount! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1233
1235
 
1234
1236
  """Unlink a mailbox (owner only). Mail on the server is untouched."""
1235
- deleteMailAccount(id: ID!): ID! @auth
1237
+ deleteMailAccount(id: ID!): ID! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1236
1238
 
1237
1239
  """Set who sees a mailbox (owner only)."""
1238
- shareMailAccount(input: ShareMailAccountInput!): MailAccount! @auth
1240
+ shareMailAccount(input: ShareMailAccountInput!): MailAccount! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1239
1241
 
1240
1242
  """Turn syncing a folder on or off."""
1241
- updateMailFolder(input: UpdateMailFolderInput!): MailFolder! @auth
1243
+ updateMailFolder(input: UpdateMailFolderInput!): MailFolder! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1242
1244
 
1243
1245
  """Sync a mailbox now."""
1244
- syncMailAccount(id: ID!, folders: [ID!] = null): SyncResult! @auth
1246
+ syncMailAccount(id: ID!, folders: [ID!] = null): SyncResult! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1245
1247
 
1246
1248
  """
1247
1249
  Start linking (or re-linking) a mailbox through a Gmail or Microsoft provider.
1248
1250
  """
1249
- startOAuthLink(input: StartOAuthLinkInput!): AuthSession! @auth
1251
+ startOAuthLink(input: StartOAuthLinkInput!): AuthSession! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1250
1252
 
1251
1253
  """
1252
1254
  REDIRECT: finish with the code. POLL: advance one step; call until not PENDING.
1253
1255
  """
1254
- completeAuth(input: CompleteAuthInput!): AuthSession! @auth
1256
+ completeAuth(input: CompleteAuthInput!): AuthSession! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1255
1257
 
1256
1258
  """
1257
1259
  The same login again (a fresh openUrl if the old one cannot be reused).
1258
1260
  """
1259
- resumeAuth(state: String!): AuthSession! @auth
1261
+ resumeAuth(state: String!): AuthSession! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1260
1262
 
1261
1263
  """Drop a login that will not be finished. Idempotent."""
1262
- cancelAuth(state: String!): AuthSession! @auth
1264
+ cancelAuth(state: String!): AuthSession! @auth(required_scopes: ["kuvert_mailboxes"], any_role_of: ["kuvert_editor"])
1263
1265
 
1264
1266
  """Add and remove flags of messages."""
1265
- setMessageFlags(input: SetMessageFlagsInput!): [Message!]! @auth
1267
+ setMessageFlags(input: SetMessageFlagsInput!): [Message!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1266
1268
 
1267
1269
  """Mark messages read or unread."""
1268
- markMessagesRead(input: MarkMessagesInput!): [Message!]! @auth
1270
+ markMessagesRead(input: MarkMessagesInput!): [Message!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1269
1271
 
1270
1272
  """Move messages to another folder of their mailbox."""
1271
- moveMessages(input: MoveMessagesInput!): [Message!]! @auth
1273
+ moveMessages(input: MoveMessagesInput!): [Message!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1272
1274
 
1273
1275
  """Delete messages (into Trash, or for good)."""
1274
- deleteMessages(input: DeleteMessagesInput!): DeleteResult! @auth
1276
+ deleteMessages(input: DeleteMessagesInput!): DeleteResult! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1275
1277
 
1276
1278
  """Put messages into categories and take them out."""
1277
- categorizeMessages(input: CategorizeMessagesInput!): [Message!]! @auth
1279
+ categorizeMessages(input: CategorizeMessagesInput!): [Message!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1278
1280
 
1279
1281
  """Take back changes that have not reached the server."""
1280
- undoMailChanges(input: UndoMailChangesInput!): [Message!]! @auth
1282
+ undoMailChanges(input: UndoMailChangesInput!): [Message!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1281
1283
 
1282
1284
  """
1283
1285
  Drop local-only and queued flag changes of messages: back to what the server has.
1284
1286
  """
1285
- revertMessagesToServer(messages: [ID!]!): [Message!]! @auth
1287
+ revertMessagesToServer(messages: [ID!]!): [Message!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1286
1288
 
1287
1289
  """Queue failed changes again."""
1288
- retryMailChanges(changes: [ID!]!): [MailChange!]! @auth
1290
+ retryMailChanges(changes: [ID!]!): [MailChange!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1289
1291
 
1290
1292
  """Push a mailbox's due changes now."""
1291
- pushMailChanges(account: ID!): PushResult! @auth
1293
+ pushMailChanges(account: ID!): PushResult! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1292
1294
 
1293
1295
  """Create a category of a mailbox."""
1294
- createCategory(input: CreateCategoryInput!): Category! @auth
1296
+ createCategory(input: CreateCategoryInput!): Category! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1295
1297
 
1296
1298
  """Change a category."""
1297
- updateCategory(input: UpdateCategoryInput!): Category! @auth
1299
+ updateCategory(input: UpdateCategoryInput!): Category! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1298
1300
 
1299
1301
  """Delete a category."""
1300
- deleteCategory(id: ID!, removeKeywords: Boolean! = false): ID! @auth
1302
+ deleteCategory(id: ID!, removeKeywords: Boolean! = false): ID! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1301
1303
 
1302
1304
  """Create a task list."""
1303
- createTaskList(input: CreateTaskListInput!): TaskList! @auth
1305
+ createTaskList(input: CreateTaskListInput!): TaskList! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1304
1306
 
1305
1307
  """Rename, recolor or move a task list."""
1306
- updateTaskList(input: UpdateTaskListInput!): TaskList! @auth
1308
+ updateTaskList(input: UpdateTaskListInput!): TaskList! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1307
1309
 
1308
1310
  """Delete a task list; its tasks stay, on no list."""
1309
- deleteTaskList(id: ID!): ID! @auth
1311
+ deleteTaskList(id: ID!): ID! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1310
1312
 
1311
1313
  """Create a task, optionally with conversations."""
1312
- createTask(input: CreateTaskInput!): Task! @auth
1314
+ createTask(input: CreateTaskInput!): Task! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1313
1315
 
1314
1316
  """
1315
1317
  Create or update the caller's task with this externalKey, and add conversations to it.
1316
1318
  """
1317
- upsertTask(input: UpsertTaskInput!): Task! @auth
1319
+ upsertTask(input: UpsertTaskInput!): Task! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1318
1320
 
1319
1321
  """Change a task."""
1320
- updateTask(input: UpdateTaskInput!): Task! @auth
1322
+ updateTask(input: UpdateTaskInput!): Task! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1321
1323
 
1322
1324
  """Delete a task."""
1323
- deleteTask(id: ID!): ID! @auth
1325
+ deleteTask(id: ID!): ID! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1324
1326
 
1325
1327
  """Mark tasks OPEN, DONE or DISMISSED."""
1326
- setTaskStatus(input: SetTaskStatusInput!): [Task!]! @auth
1328
+ setTaskStatus(input: SetTaskStatusInput!): [Task!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1327
1329
 
1328
1330
  """Snooze tasks until a time (null wakes them)."""
1329
- snoozeTasks(input: SnoozeTasksInput!): [Task!]! @auth
1331
+ snoozeTasks(input: SnoozeTasksInput!): [Task!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1330
1332
 
1331
1333
  """Put conversations into a task."""
1332
- linkThreads(input: LinkThreadsInput!): [TaskThread!]! @auth
1334
+ linkThreads(input: LinkThreadsInput!): [TaskThread!]! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1333
1335
 
1334
1336
  """Take conversations out of a task."""
1335
- unlinkThreads(input: UnlinkThreadsInput!): Task! @auth
1337
+ unlinkThreads(input: UnlinkThreadsInput!): Task! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1336
1338
 
1337
1339
  """Send a message through a mailbox's SMTP server."""
1338
- sendMessage(input: SendMessageInput!): OutgoingMessage! @auth
1340
+ sendMessage(input: SendMessageInput!): OutgoingMessage! @auth(required_scopes: ["kuvert_send"], any_role_of: ["kuvert_editor"])
1339
1341
 
1340
1342
  """
1341
1343
  Request temporary S3 credentials to upload one file (an attachment to send).
1342
1344
  """
1343
- requestBigfileUpload(input: RequestBigFileUploadInput!): BigFileUploadGrant! @auth(any_role_of: ["admin", "editor", "bot"])
1345
+ requestBigfileUpload(input: RequestBigFileUploadInput!): BigFileUploadGrant! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1344
1346
 
1345
1347
  """
1346
1348
  Finalize the caller's file upload after the client has written the object.
1347
1349
  """
1348
- finishBigfileUpload(input: FinishBigFileUploadInput!): BigFileStore! @auth(any_role_of: ["admin", "editor", "bot"])
1350
+ finishBigfileUpload(input: FinishBigFileUploadInput!): BigFileStore! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1349
1351
 
1350
1352
  """
1351
1353
  Reissue upload credentials for a bigfile upload still in flight, to the same key, so a write that outlives its credentials carries on. Only the uploader may, never for a finished store, and never past the upload's time limit
1352
1354
  """
1353
- refreshBigfileUpload(input: RefreshUploadInput!): BigFileUploadGrant! @auth(any_role_of: ["admin", "editor", "bot"])
1355
+ refreshBigfileUpload(input: RefreshUploadInput!): BigFileUploadGrant! @auth(required_scopes: ["kuvert_write"], any_role_of: ["kuvert_editor"])
1354
1356
  }
1355
1357
 
1356
1358
  """
@@ -1397,7 +1399,7 @@ type Organization @key(fields: "id", resolvable: true) {
1397
1399
  }
1398
1400
 
1399
1401
  """A message sent through a mailbox's SMTP server."""
1400
- type OutgoingMessage @key(fields: "id", resolvable: true) {
1402
+ type OutgoingMessage @key(fields: "id", resolvable: true) @identified(by: "@kuvert/outgoingmessage") {
1401
1403
  id: ID!
1402
1404
 
1403
1405
  """The mailbox it is sent from."""
@@ -1556,91 +1558,91 @@ type Query {
1556
1558
  """
1557
1559
  The providers the organization set up; every mailbox is linked through one.
1558
1560
  """
1559
- mailProviders(filters: MailProviderFilter, pagination: OffsetPaginationInput): [MailProvider!]! @auth
1561
+ mailProviders(filters: MailProviderFilter, pagination: OffsetPaginationInput): [MailProvider!]! @auth(required_scopes: ["kuvert_read"])
1560
1562
 
1561
1563
  """A provider by id."""
1562
- mailProvider(id: ID!): MailProvider! @auth
1564
+ mailProvider(id: ID!): MailProvider! @auth(required_scopes: ["kuvert_read"])
1563
1565
 
1564
1566
  """The kinds of provider this server can run, each with its capabilities."""
1565
- providerKinds: [ProviderKind!]! @auth
1567
+ providerKinds: [ProviderKind!]! @auth(required_scopes: ["kuvert_read"])
1566
1568
 
1567
1569
  """
1568
1570
  The mailboxes the caller sees: their own, shared with them, and the organization's.
1569
1571
  """
1570
- mailAccounts(filters: MailAccountFilter, pagination: OffsetPaginationInput): [MailAccount!]! @auth
1572
+ mailAccounts(filters: MailAccountFilter, pagination: OffsetPaginationInput): [MailAccount!]! @auth(required_scopes: ["kuvert_read"])
1571
1573
 
1572
1574
  """A mailbox by id."""
1573
- mailAccount(id: ID!): MailAccount! @auth
1575
+ mailAccount(id: ID!): MailAccount! @auth(required_scopes: ["kuvert_read"])
1574
1576
 
1575
1577
  """Folders of the visible mailboxes (filter by `account`)."""
1576
- mailFolders(filters: MailFolderFilter, pagination: OffsetPaginationInput): [MailFolder!]! @auth
1578
+ mailFolders(filters: MailFolderFilter, pagination: OffsetPaginationInput): [MailFolder!]! @auth(required_scopes: ["kuvert_read"])
1577
1579
 
1578
1580
  """A folder by id."""
1579
- mailFolder(id: ID!): MailFolder! @auth
1581
+ mailFolder(id: ID!): MailFolder! @auth(required_scopes: ["kuvert_read"])
1580
1582
 
1581
1583
  """
1582
1584
  Messages of the visible mailboxes (paginated, filterable — `search` also matches by meaning — and orderable).
1583
1585
  """
1584
- messages(filters: MessageFilter, ordering: [MessageOrder!]! = [], pagination: OffsetPaginationInput): [Message!]! @auth
1586
+ messages(filters: MessageFilter, ordering: [MessageOrder!]! = [], pagination: OffsetPaginationInput): [Message!]! @auth(required_scopes: ["kuvert_read"])
1585
1587
 
1586
1588
  """A message by id."""
1587
- message(id: ID!): Message! @auth
1589
+ message(id: ID!): Message! @auth(required_scopes: ["kuvert_read"])
1588
1590
 
1589
1591
  """
1590
1592
  Conversations of the visible mailboxes (paginated, filterable, orderable).
1591
1593
  """
1592
- threads(filters: ThreadFilter, ordering: [ThreadOrder!]! = [], pagination: OffsetPaginationInput): [Thread!]! @auth
1594
+ threads(filters: ThreadFilter, ordering: [ThreadOrder!]! = [], pagination: OffsetPaginationInput): [Thread!]! @auth(required_scopes: ["kuvert_read"])
1593
1595
 
1594
1596
  """A conversation by id."""
1595
- thread(id: ID!): Thread! @auth
1597
+ thread(id: ID!): Thread! @auth(required_scopes: ["kuvert_read"])
1596
1598
 
1597
1599
  """How many conversations match the filters (for a list header)."""
1598
- threadsCount(filters: ThreadFilter = null): Int! @auth
1600
+ threadsCount(filters: ThreadFilter = null): Int! @auth(required_scopes: ["kuvert_read"])
1599
1601
 
1600
1602
  """How many messages match the filters."""
1601
- messagesCount(filters: MessageFilter = null): Int! @auth
1603
+ messagesCount(filters: MessageFilter = null): Int! @auth(required_scopes: ["kuvert_read"])
1602
1604
 
1603
1605
  """The caller's task lists."""
1604
- taskLists(filters: TaskListFilter, pagination: OffsetPaginationInput): [TaskList!]! @auth
1606
+ taskLists(filters: TaskListFilter, pagination: OffsetPaginationInput): [TaskList!]! @auth(required_scopes: ["kuvert_read"])
1605
1607
 
1606
1608
  """A task list by id."""
1607
- taskList(id: ID!): TaskList! @auth
1609
+ taskList(id: ID!): TaskList! @auth(required_scopes: ["kuvert_read"])
1608
1610
 
1609
1611
  """
1610
1612
  The caller's tasks (paginated, filterable — `active` is the Inbox view — and orderable).
1611
1613
  """
1612
- tasks(filters: TaskFilter, ordering: [TaskOrder!]! = [], pagination: OffsetPaginationInput): [Task!]! @auth
1614
+ tasks(filters: TaskFilter, ordering: [TaskOrder!]! = [], pagination: OffsetPaginationInput): [Task!]! @auth(required_scopes: ["kuvert_read"])
1613
1615
 
1614
1616
  """A task by id."""
1615
- task(id: ID!): Task! @auth
1617
+ task(id: ID!): Task! @auth(required_scopes: ["kuvert_read"])
1616
1618
 
1617
1619
  """How many of the caller's tasks match the filters."""
1618
- tasksCount(filters: TaskFilter = null): Int! @auth
1620
+ tasksCount(filters: TaskFilter = null): Int! @auth(required_scopes: ["kuvert_read"])
1619
1621
 
1620
1622
  """Categories of the visible mailboxes (filter by `account`)."""
1621
- categories(filters: CategoryFilter, pagination: OffsetPaginationInput): [Category!]! @auth
1623
+ categories(filters: CategoryFilter, pagination: OffsetPaginationInput): [Category!]! @auth(required_scopes: ["kuvert_read"])
1622
1624
 
1623
1625
  """A category by id."""
1624
- category(id: ID!): Category! @auth
1626
+ category(id: ID!): Category! @auth(required_scopes: ["kuvert_read"])
1625
1627
 
1626
1628
  """
1627
1629
  Changes made here that have not reached the server yet (pending or failed), oldest first.
1628
1630
  """
1629
- mailChanges(filters: MailChangeFilter, pagination: OffsetPaginationInput): [MailChange!]! @auth
1631
+ mailChanges(filters: MailChangeFilter, pagination: OffsetPaginationInput): [MailChange!]! @auth(required_scopes: ["kuvert_read"])
1630
1632
 
1631
1633
  """Mail sent through the visible mailboxes, newest first."""
1632
- outbox(filters: OutgoingMessageFilter, pagination: OffsetPaginationInput): [OutgoingMessage!]! @auth
1634
+ outbox(filters: OutgoingMessageFilter, pagination: OffsetPaginationInput): [OutgoingMessage!]! @auth(required_scopes: ["kuvert_read"])
1633
1635
 
1634
1636
  """A sent message by id."""
1635
- outgoingMessage(id: ID!): OutgoingMessage! @auth
1637
+ outgoingMessage(id: ID!): OutgoingMessage! @auth(required_scopes: ["kuvert_read"])
1636
1638
 
1637
1639
  """
1638
1640
  Server settings of well-known providers (the one for `address`, when given).
1639
1641
  """
1640
- mailPresets(address: String): [MailPreset!]! @auth
1642
+ mailPresets(address: String): [MailPreset!]! @auth(required_scopes: ["kuvert_read"])
1641
1643
 
1642
1644
  """Where a login is. No side effect."""
1643
- authSession(state: String!): AuthSession! @auth
1645
+ authSession(state: String!): AuthSession! @auth(required_scopes: ["kuvert_read"])
1644
1646
  }
1645
1647
 
1646
1648
  """A recipient."""
@@ -1775,7 +1777,7 @@ input StartOAuthLinkInput {
1775
1777
 
1776
1778
  type Subscription {
1777
1779
  """Events whenever a visible mailbox finished syncing."""
1778
- mailboxSyncs: MailboxSyncEvent! @auth
1780
+ mailboxSyncs: MailboxSyncEvent! @auth(required_scopes: ["kuvert_read"])
1779
1781
  }
1780
1782
 
1781
1783
  """What one mailbox sync did."""
@@ -1997,7 +1999,7 @@ type TaskThread @key(fields: "id", resolvable: true) {
1997
1999
  """
1998
2000
  A conversation: messages linked by In-Reply-To/References, across the mailbox's folders.
1999
2001
  """
2000
- type Thread @key(fields: "id", resolvable: true) {
2002
+ type Thread @key(fields: "id", resolvable: true) @identified(by: "@kuvert/thread") {
2001
2003
  id: ID!
2002
2004
 
2003
2005
  """The mailbox the conversation is in."""
@@ -4,7 +4,7 @@ from enum import Enum
4
4
  from pydantic import AliasChoices, BaseModel, ConfigDict, Field
5
5
  from rath.scalars import ID, IDCoercible
6
6
  from rath.task import TaskLike
7
- from typing import Annotated, Any, AsyncIterator, Iterable, Iterator, Literal
7
+ from typing import Annotated, Any, AsyncIterator, ClassVar, Iterable, Iterator, Literal
8
8
 
9
9
  class GraphQLDefault:
10
10
  """Records a GraphQL field schema default value. The client omits the field so the server applies its own default; this preserves the value for introspection."""
@@ -2686,6 +2686,7 @@ class KuvertApi:
2686
2686
  """Every operation of this API as a method. Generated by turms.
2687
2687
 
2688
2688
  Each method hands its operation to ``execute``, ``aexecute``, ``subscribe``, ``asubscribe`` of ``self``, which the class this one is mixed into (or a base of it) provides."""
2689
+ __scopes__: ClassVar[tuple[str, ...]] = ('kuvert_mailboxes', 'kuvert_providers', 'kuvert_read', 'kuvert_send', 'kuvert_write')
2689
2690
 
2690
2691
  async def acreate_mail_account(self, provider: IDCoercible, email_address: str, password: str, name: str | None | UnsetType=UNSET, display_name: str | None | UnsetType=UNSET, protocol: Protocol | None | UnsetType=UNSET, incoming: ServerInput | None | UnsetType=UNSET, smtp: ServerInput | None | UnsetType=UNSET, username: str | None | UnsetType=UNSET, smtp_username: str | None | UnsetType=UNSET, smtp_password: str | None | UnsetType=UNSET, save_sent_copy: bool | None | UnsetType=UNSET, pop_leave_on_server: bool | None | UnsetType=UNSET, visibility: Visibility | None | UnsetType=UNSET, task: TaskLike | None=None) -> DetailMailAccount:
2691
2692
  """CreateMailAccount
@@ -8,14 +8,14 @@ ask for the client it returns. An app takes all of it in with
8
8
  import os
9
9
  from typing import Annotated
10
10
 
11
+ from arkitekt_spec.declare.app import AppRegistry
12
+ from arkitekt_spec.declare.widgets import SearchWidget
11
13
  from fakts import Alias, Require, TokenLoader
12
14
  from fakts.contrib.rath.auth import FaktsAuthLink
13
15
  from rath.links.aiohttp import AIOHttpLink
14
16
  from rath.links.compose import compose
15
17
  from rath.links.graphql_ws import GraphQLWSLink
16
18
  from rath.links.split import SplitLink
17
- from rekuest.app import AppRegistry
18
- from rekuest.widgets import SearchWidget
19
19
 
20
20
  from graphql import OperationType
21
21
  from kuvert.api.schema import (
@@ -44,6 +44,17 @@ registry = AppRegistry()
44
44
  """What kuvert brings to an app: its service, and the types it can send by id."""
45
45
 
46
46
 
47
+ try:
48
+ from arkitekt_spec.declare.tested import tested_against
49
+ except ImportError:
50
+ # kuvert names no arkitekt-spec of its own (arkitekt brings one): one before 12.9
51
+ # reads no stamp, and its Require takes no version.
52
+ WANTED: dict[str, str] = {}
53
+ else:
54
+ WANTED = {"version": tested} if (tested := tested_against("kuvert")) else {}
55
+ """What this release wants of the kuvert server: the one its release job tested it against."""
56
+
57
+
47
58
  @registry.service(
48
59
  schema=build_relative_path("api", "schema.graphql"),
49
60
  turms=build_relative_path("api", "project.json"),
@@ -54,6 +65,7 @@ def kuvert(
54
65
  Require(
55
66
  "live.arkitekt.kuvert",
56
67
  "Where the linked mailboxes and their mail are served",
68
+ **WANTED,
57
69
  ),
58
70
  ],
59
71
  tokens: TokenLoader,
@@ -21,13 +21,15 @@ dependencies = [
21
21
  [tool.uv]
22
22
  dev-dependencies = [
23
23
  "dokker>=2.8",
24
+ # Stamps the server version the integration tests ran against, and checks it at release.
25
+ "arkitekt-spec>=12.9",
24
26
  "pytest>=8.3.5",
25
27
  "pytest-asyncio>=0.26.0",
26
28
  "pytest-aiohttp>=1.0.5,<2",
27
29
  "pytest-cov>=5.0.0,<6",
28
30
  "python-semantic-release>=9.21.1",
29
31
  "ruff>0.11",
30
- "turms>=2.3.0",
32
+ "turms>=3.0",
31
33
  "basedpyright>=1.21",
32
34
  ]
33
35
 
@@ -36,12 +38,23 @@ include = ["kuvert"]
36
38
  exclude = ["**/__pycache__", "tests"]
37
39
  typeCheckingMode = "standard"
38
40
 
41
+ # `_tested.json` is written by the integration tests (the server version they ran against)
42
+ # and is not in git: named as an artifact, on both, it is shipped all the same.
39
43
  [tool.hatch.build.targets.sdist]
40
44
  include = ["kuvert"]
45
+ artifacts = ["kuvert/_tested.json"]
41
46
 
42
47
  [tool.hatch.build.targets.wheel]
43
48
  include = ["kuvert"]
49
+ artifacts = ["kuvert/_tested.json"]
44
50
 
51
+
52
+ [tool.ruff.lint]
53
+ extend-select = ["UP"]
54
+ extend-ignore = ["UP037", "UP038", "UP042"]
55
+
56
+ [tool.ruff.lint.per-file-ignores]
57
+ "kuvert/api/schema.py" = ["UP035"]
45
58
  [build-system]
46
59
  requires = ["hatchling", "hatch-vcs"]
47
60
  build-backend = "hatchling.build"
File without changes
File without changes
File without changes
File without changes
File without changes