@open-pencil/cloud 0.17.0-beta.2 → 0.17.0-beta.5

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.
Files changed (339) hide show
  1. package/README.md +3 -2
  2. package/dist/bin/server.mjs +1 -1
  3. package/dist/bin/server.mjs.map +1 -1
  4. package/dist/bin/{ai-relay.mjs → services.mjs} +9 -9
  5. package/dist/bin/services.mjs.map +1 -0
  6. package/dist/client.d.ts +525 -66
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +1257 -654
  9. package/dist/client.js.map +1 -1
  10. package/dist/contract.d.ts +2 -2
  11. package/dist/contract.js +2 -2
  12. package/dist/contract2.js +1028 -481
  13. package/dist/contract2.js.map +1 -1
  14. package/dist/email.d.ts +1780 -31
  15. package/dist/email.d.ts.map +1 -1
  16. package/dist/email.js +3556 -325
  17. package/dist/email.js.map +1 -1
  18. package/dist/errors.d.ts +2 -0
  19. package/dist/errors.js +48 -0
  20. package/dist/errors.js.map +1 -0
  21. package/dist/index.d.ts +929 -72
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index2.d.ts +35 -0
  24. package/dist/index2.d.ts.map +1 -0
  25. package/dist/listen.mjs +802 -927
  26. package/dist/listen.mjs.map +1 -1
  27. package/dist/runtime-cloudflare.d.ts +89 -0
  28. package/dist/runtime-cloudflare.d.ts.map +1 -0
  29. package/dist/runtime-cloudflare.js +15667 -0
  30. package/dist/runtime-cloudflare.js.map +1 -0
  31. package/dist/runtime-node.d.mts +7166 -3101
  32. package/dist/runtime-node.d.mts.map +1 -1
  33. package/dist/runtime-node.mjs +6 -5
  34. package/dist/runtime-node.mjs.map +1 -1
  35. package/dist/server.d.ts +6525 -2205
  36. package/dist/server.d.ts.map +1 -1
  37. package/dist/server.js +12500 -7613
  38. package/dist/server.js.map +1 -1
  39. package/dist/server.mjs +8625 -2878
  40. package/dist/server.mjs.map +1 -1
  41. package/dist/server2.mjs +101 -79
  42. package/dist/server2.mjs.map +1 -1
  43. package/package.json +27 -9
  44. package/src/admin/api/routes.ts +59 -0
  45. package/src/admin/audit/service.ts +27 -8
  46. package/src/admin/documents/service.ts +431 -0
  47. package/src/admin/errors.ts +9 -1
  48. package/src/admin/index.ts +6 -0
  49. package/src/admin/operations/service.ts +7 -0
  50. package/src/admin/reports/service.ts +153 -0
  51. package/src/admin/schema.ts +6 -0
  52. package/src/client/api.ts +28 -461
  53. package/src/client/auth/client.ts +22 -3
  54. package/src/client/auth/navigation.ts +6 -5
  55. package/src/client/billing.ts +80 -0
  56. package/src/client/community.ts +40 -0
  57. package/src/client/discovery.ts +35 -9
  58. package/src/client/documents.ts +160 -0
  59. package/src/client/index.ts +14 -7
  60. package/src/client/portal/account.ts +79 -2
  61. package/src/client/portal/administration.ts +56 -0
  62. package/src/client/portal/request.ts +2 -0
  63. package/src/client/response.ts +21 -0
  64. package/src/client/schema.ts +8 -0
  65. package/src/client/services.ts +118 -0
  66. package/src/client/sharing.ts +262 -0
  67. package/src/client/versions.ts +104 -0
  68. package/src/contract/account.ts +108 -2
  69. package/src/contract/admin/index.ts +67 -3
  70. package/src/contract/billing.ts +166 -0
  71. package/src/contract/collaboration.ts +11 -1
  72. package/src/contract/community.ts +60 -0
  73. package/src/contract/discovery.ts +83 -4
  74. package/src/contract/documents.ts +27 -0
  75. package/src/contract/entitlements.ts +12 -2
  76. package/src/contract/index.ts +114 -39
  77. package/src/contract/links.ts +57 -4
  78. package/src/contract/locale.ts +27 -0
  79. package/src/contract/portal.ts +12 -1
  80. package/src/contract/relay.ts +6 -0
  81. package/src/contract/reports.ts +42 -0
  82. package/src/contract/routes.ts +10 -0
  83. package/src/contract/services.ts +235 -0
  84. package/src/contract/sharing.ts +3 -9
  85. package/src/email/i18n.ts +174 -0
  86. package/src/email/index.ts +13 -2
  87. package/src/email/locales/ar.json +141 -0
  88. package/src/email/locales/de.json +141 -0
  89. package/src/email/locales/es.json +141 -0
  90. package/src/email/locales/fr.json +141 -0
  91. package/src/email/locales/it.json +141 -0
  92. package/src/email/locales/ja.json +141 -0
  93. package/src/email/locales/pl.json +141 -0
  94. package/src/email/locales/pt-br.json +141 -0
  95. package/src/email/locales/ru.json +141 -0
  96. package/src/email/locales/zh-cn.json +141 -0
  97. package/src/email/messages.ts +200 -0
  98. package/src/email/render.ts +138 -246
  99. package/src/email/samples.ts +115 -0
  100. package/src/email/schema.ts +79 -5
  101. package/src/email/templates/BrandEmail.vue +54 -0
  102. package/src/email/templates/DocumentBlocked.vue +45 -0
  103. package/src/email/templates/DocumentInvitation.vue +24 -0
  104. package/src/email/templates/DocumentReport.vue +32 -0
  105. package/src/email/templates/DocumentReportDecided.vue +36 -0
  106. package/src/email/templates/DocumentReportReceived.vue +18 -0
  107. package/src/email/templates/DocumentRestored.vue +24 -0
  108. package/src/email/templates/EmailChangeRequested.vue +24 -0
  109. package/src/email/templates/EmailRoot.vue +19 -0
  110. package/src/email/templates/EmailText.vue +9 -0
  111. package/src/email/templates/EmailVerification.vue +38 -0
  112. package/src/email/templates/EnrollmentNotification.vue +24 -0
  113. package/src/email/templates/EnrollmentUpdate.vue +52 -0
  114. package/src/email/templates/NewSignIn.vue +37 -0
  115. package/src/email/templates/PasswordChanged.vue +22 -0
  116. package/src/email/templates/PasswordReset.vue +23 -0
  117. package/src/email/templates/StorageLimitReached.vue +28 -0
  118. package/src/email/templates/TwoStepChanged.vue +32 -0
  119. package/src/email/templates/WaitlistConfirmation.vue +29 -0
  120. package/src/email/templates/WorkspaceInvitation.vue +28 -0
  121. package/src/email/templates/brand.ts +9 -61
  122. package/src/email/templates/localization.ts +17 -0
  123. package/src/errors/index.ts +6 -0
  124. package/src/errors/posthog.ts +80 -0
  125. package/src/global.d.ts +7 -0
  126. package/src/runtime/cloudflare/environment.ts +22 -11
  127. package/src/runtime/cloudflare/index.ts +1 -1
  128. package/src/runtime/cloudflare/logging.ts +15 -0
  129. package/src/runtime/cloudflare/maintenance.ts +31 -0
  130. package/src/runtime/cloudflare/relay/index.ts +69 -15
  131. package/src/runtime/cloudflare/tsconfig.json +2 -1
  132. package/src/runtime/cloudflare/worker.ts +46 -13
  133. package/src/runtime/node/application.ts +5 -3
  134. package/src/runtime/node/bootstrap.ts +15 -4
  135. package/src/runtime/node/cleanup.ts +20 -3
  136. package/src/runtime/node/email/transport.ts +13 -10
  137. package/src/runtime/node/entitlements/main.ts +14 -11
  138. package/src/runtime/node/index.ts +1 -1
  139. package/src/runtime/node/main.ts +1 -1
  140. package/src/runtime/node/migrate.ts +5 -1
  141. package/src/runtime/node/relay.ts +8 -2
  142. package/src/runtime/node/request-id.ts +13 -0
  143. package/src/runtime/node/server.ts +50 -16
  144. package/src/runtime/node/{ai-relay → services}/main.ts +7 -7
  145. package/src/runtime/node/{ai-relay → services}/server.ts +18 -18
  146. package/src/runtime/postgres/database.ts +20 -1
  147. package/src/runtime/posthog/errors.ts +15 -30
  148. package/src/runtime/s3/objects.ts +41 -1
  149. package/src/runtime/site/community.ts +101 -0
  150. package/src/runtime/site/server.ts +49 -6
  151. package/src/server/account/actions.ts +5 -0
  152. package/src/server/account/deletion.ts +304 -0
  153. package/src/server/account/routes.ts +281 -206
  154. package/src/server/account/terms.ts +42 -0
  155. package/src/server/account/tokens.ts +57 -0
  156. package/src/server/api/router.ts +32 -5
  157. package/src/server/api/types.ts +2 -0
  158. package/src/server/app/checks.ts +84 -0
  159. package/src/server/app/editors.ts +20 -0
  160. package/src/server/app/index.ts +128 -0
  161. package/src/server/app/indexing.ts +40 -0
  162. package/src/server/app/limiters.ts +53 -0
  163. package/src/server/app/routes.ts +114 -0
  164. package/src/server/app/services.ts +185 -0
  165. package/src/server/auth/access-control.ts +63 -0
  166. package/src/server/auth/access-tokens.ts +62 -0
  167. package/src/server/auth/adapter.ts +32 -1
  168. package/src/server/auth/email.ts +4 -1
  169. package/src/server/auth/endpoints.ts +5 -1
  170. package/src/server/auth/enrollment.ts +116 -0
  171. package/src/server/auth/factory.ts +116 -132
  172. package/src/server/auth/index.ts +10 -1
  173. package/src/server/auth/logger.ts +23 -0
  174. package/src/server/auth/mfa-assurance.ts +51 -0
  175. package/src/server/auth/passwords.ts +43 -0
  176. package/src/server/auth/session.ts +2 -0
  177. package/src/server/billing/index.ts +6 -0
  178. package/src/server/billing/routes.ts +27 -0
  179. package/src/server/billing/tokens.ts +37 -0
  180. package/src/server/cleanup/configured.ts +27 -7
  181. package/src/server/cleanup/documents.ts +165 -71
  182. package/src/server/cleanup/revisions.ts +16 -5
  183. package/src/server/cleanup/uploads.ts +8 -2
  184. package/src/server/cleanup/worker.ts +15 -3
  185. package/src/server/collaboration/relay/connection.ts +4 -3
  186. package/src/server/collaboration/relay/documents.ts +13 -10
  187. package/src/server/collaboration/relay/hub.ts +77 -122
  188. package/src/server/collaboration/relay/log.ts +5 -2
  189. package/src/server/collaboration/relay/room.ts +154 -0
  190. package/src/server/collaboration/service.ts +48 -33
  191. package/src/server/community/index.ts +2 -0
  192. package/src/server/community/routes.ts +93 -0
  193. package/src/server/community/service.ts +134 -0
  194. package/src/server/config/deployment.ts +41 -9
  195. package/src/server/config/index.ts +1 -1
  196. package/src/server/config/public.ts +11 -4
  197. package/src/server/config/schema.ts +91 -277
  198. package/src/server/config/toml/schema.ts +307 -0
  199. package/src/server/db/expressions.ts +15 -1
  200. package/src/server/db/index.ts +1 -0
  201. package/src/server/db/migrate.ts +46 -116
  202. package/src/server/db/migrations/001_accounts.ts +79 -0
  203. package/src/server/db/migrations/002_workspaces.ts +48 -0
  204. package/src/server/db/migrations/003_storage.ts +44 -0
  205. package/src/server/db/migrations/004_documents.ts +193 -0
  206. package/src/server/db/migrations/005_sharing.ts +95 -0
  207. package/src/server/db/migrations/006_operations.ts +110 -0
  208. package/src/server/db/migrations/007_trash.ts +33 -0
  209. package/src/server/db/migrations/008_terms.ts +18 -0
  210. package/src/server/db/migrations/009_access_tokens.ts +47 -0
  211. package/src/server/db/migrations/010_storage_limit_notices.ts +50 -0
  212. package/src/server/db/migrations/011_account_ids.ts +30 -0
  213. package/src/server/db/migrations/012_email_locales.ts +34 -0
  214. package/src/server/db/migrations/013_document_block_emails.ts +40 -0
  215. package/src/server/db/migrations/014_report_replies.ts +28 -0
  216. package/src/server/db/migrations/schema.ts +96 -0
  217. package/src/server/db/tables.ts +82 -4
  218. package/src/server/db/users.ts +22 -0
  219. package/src/server/documents/access.ts +66 -55
  220. package/src/server/documents/errors.ts +7 -0
  221. package/src/server/documents/images.ts +2 -1
  222. package/src/server/documents/index.ts +1 -1
  223. package/src/server/documents/limits.ts +14 -8
  224. package/src/server/documents/purge.ts +75 -0
  225. package/src/server/documents/repository.ts +2 -0
  226. package/src/server/documents/routes.ts +26 -0
  227. package/src/server/documents/service.ts +30 -406
  228. package/src/server/documents/summary.ts +1 -0
  229. package/src/server/documents/trash.ts +203 -0
  230. package/src/server/documents/uploads.ts +450 -0
  231. package/src/server/documents/versions/checkpoint.ts +2 -1
  232. package/src/server/documents/versions/history.ts +11 -7
  233. package/src/server/documents/versions/service.ts +94 -28
  234. package/src/server/email/invitations.ts +1 -0
  235. package/src/server/email/service.ts +31 -4
  236. package/src/server/email/types.ts +12 -0
  237. package/src/server/errors/index.ts +51 -16
  238. package/src/server/index.ts +52 -16
  239. package/src/server/internal/index.ts +3 -3
  240. package/src/server/internal/routes.ts +7 -10
  241. package/src/server/internal/schema.ts +1 -1
  242. package/src/server/internal/service.ts +17 -23
  243. package/src/server/invitations/budget.ts +66 -0
  244. package/src/server/invitations/index.ts +1 -0
  245. package/src/server/invitations/types.ts +5 -1
  246. package/src/server/logging.ts +76 -0
  247. package/src/server/objects/types.ts +5 -0
  248. package/src/server/pictures/service.ts +2 -1
  249. package/src/server/policy/configured.ts +9 -3
  250. package/src/server/policy/database.ts +52 -27
  251. package/src/server/policy/index.ts +2 -1
  252. package/src/server/policy/keys.ts +5 -2
  253. package/src/server/policy/policy.ts +40 -12
  254. package/src/server/policy/schema.ts +2 -2
  255. package/src/server/policy/service.ts +78 -56
  256. package/src/server/policy/static.ts +5 -5
  257. package/src/server/policy/storage.ts +33 -0
  258. package/src/server/policy/workspace.ts +41 -0
  259. package/src/server/quota/index.ts +6 -0
  260. package/src/server/quota/notices.ts +121 -0
  261. package/src/server/quota/reconcile.ts +2 -0
  262. package/src/server/quota/storage.ts +74 -31
  263. package/src/server/rate-limit/cleanup.ts +17 -5
  264. package/src/server/rate-limit/middleware.ts +6 -2
  265. package/src/server/reports/index.ts +9 -0
  266. package/src/server/reports/replies.ts +55 -0
  267. package/src/server/reports/routes.ts +39 -0
  268. package/src/server/reports/service.ts +145 -0
  269. package/src/server/services/errors.ts +7 -0
  270. package/src/server/services/index.ts +8 -0
  271. package/src/server/{ai → services}/keys.ts +11 -11
  272. package/src/server/services/routes.ts +47 -0
  273. package/src/server/{ai/service.ts → services/tokens.ts} +23 -20
  274. package/src/server/sharing/capabilities/service.ts +68 -23
  275. package/src/server/sharing/grants/service.ts +11 -18
  276. package/src/server/sharing/http.ts +4 -0
  277. package/src/server/sharing/invitations/service.ts +35 -15
  278. package/src/server/sharing/policy.ts +9 -14
  279. package/src/server/sharing/routes.ts +0 -16
  280. package/src/server/sharing/service.ts +1 -17
  281. package/src/server/validation.ts +4 -0
  282. package/src/server/workspaces/index.ts +1 -0
  283. package/src/server/workspaces/members.ts +91 -52
  284. package/src/server/workspaces/repository.ts +2 -1
  285. package/src/server/workspaces/routes.ts +4 -0
  286. package/src/{ai-relay → services}/app.ts +46 -44
  287. package/src/{ai-relay → services}/config.ts +26 -19
  288. package/src/services/db/index.ts +10 -0
  289. package/src/services/db/migrate.ts +37 -0
  290. package/src/{ai-relay/db/migrations/001_usage.ts → services/db/migrations/001_baseline.ts} +18 -7
  291. package/src/services/db/schema.ts +22 -0
  292. package/src/services/index.ts +18 -0
  293. package/src/{ai-relay → services}/metering.ts +2 -2
  294. package/src/{ai-relay → services}/usage.ts +35 -19
  295. package/dist/bin/ai-relay.mjs.map +0 -1
  296. package/src/ai-relay/db/index.ts +0 -10
  297. package/src/ai-relay/db/migrate.ts +0 -32
  298. package/src/ai-relay/db/schema.ts +0 -20
  299. package/src/ai-relay/index.ts +0 -18
  300. package/src/client/ai.ts +0 -96
  301. package/src/contract/ai.ts +0 -150
  302. package/src/email/templates/document-invitation.ts +0 -35
  303. package/src/email/templates/enrollment.ts +0 -27
  304. package/src/email/templates/layout.ts +0 -18
  305. package/src/server/ai/errors.ts +0 -7
  306. package/src/server/ai/index.ts +0 -4
  307. package/src/server/ai/routes.ts +0 -43
  308. package/src/server/app.ts +0 -379
  309. package/src/server/auth/workspace-access.ts +0 -23
  310. package/src/server/db/migrations/001_foundation.ts +0 -164
  311. package/src/server/db/migrations/002_upload_cleanup_claims.ts +0 -34
  312. package/src/server/db/migrations/003_document_cleanup_claims.ts +0 -23
  313. package/src/server/db/migrations/004_document_sharing.ts +0 -82
  314. package/src/server/db/migrations/005_document_collaboration_epoch.ts +0 -13
  315. package/src/server/db/migrations/006_invitation_continuation.ts +0 -27
  316. package/src/server/db/migrations/007_collaboration_state.ts +0 -25
  317. package/src/server/db/migrations/008_storage_reservations.ts +0 -37
  318. package/src/server/db/migrations/009_workspace_entitlements.ts +0 -22
  319. package/src/server/db/migrations/010_upload_finalization.ts +0 -22
  320. package/src/server/db/migrations/011_upload_finalization_lease.ts +0 -12
  321. package/src/server/db/migrations/012_transactional_email.ts +0 -48
  322. package/src/server/db/migrations/013_admin_enrollment.ts +0 -54
  323. package/src/server/db/migrations/014_enrollment_email_kinds.ts +0 -30
  324. package/src/server/db/migrations/015_cloud_rate_limit.ts +0 -22
  325. package/src/server/db/migrations/016_auth_schema.ts +0 -16
  326. package/src/server/db/migrations/017_authentication_email_kinds.ts +0 -32
  327. package/src/server/db/migrations/018_authentication_mfa.ts +0 -78
  328. package/src/server/db/migrations/019_better_auth_account_issuer.ts +0 -42
  329. package/src/server/db/migrations/020_workspace_invitations.ts +0 -57
  330. package/src/server/db/migrations/021_document_versions.ts +0 -66
  331. package/src/server/db/migrations/022_entitlement_external_version.ts +0 -17
  332. package/src/server/db/migrations/023_document_images.ts +0 -61
  333. package/src/server/db/migrations/024_account_activity.ts +0 -66
  334. package/src/server/db/migrations/025_table_names.ts +0 -58
  335. package/src/server/db/migrations/026_user_picture.ts +0 -30
  336. package/src/server/db/migrations/027_document_kind.ts +0 -19
  337. package/src/server/db/migrations/028_collaboration_updates.ts +0 -84
  338. package/src/server/db/migrations/helpers.ts +0 -78
  339. /package/dist/bin/{ai-relay.d.mts → services.d.mts} +0 -0
package/dist/client.d.ts CHANGED
@@ -1,16 +1,22 @@
1
1
  import * as v from "valibot";
2
+ import { hc } from "hono/client";
2
3
  import { createAuthClient } from "better-auth/client";
3
4
  //#region src/contract/account.d.ts
4
- declare const accountSecurityErrorCodeSchema: v.PicklistSchema<["current_password_invalid", "password_too_short", "password_too_long", "last_authentication_method", "session_not_fresh", "authentication_method_failed", "email_unchanged", "email_change_unavailable", "current_session", "picture_invalid"], undefined>;
5
+ declare const accountSecurityErrorCodeSchema: v.PicklistSchema<["current_password_invalid", "password_too_short", "password_too_long", "last_authentication_method", "session_not_fresh", "authentication_method_failed", "email_unchanged", "email_change_unavailable", "current_session", "picture_invalid", "account_sole_admin", "last_admin_required", "terms_changed"], undefined>;
6
+ declare const cloudAccessTokenCreateSchema: v.ObjectSchema<{
7
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
8
+ readonly expiresInDays: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 365, undefined>]>;
9
+ }, undefined>;
5
10
  type AccountSecurityErrorCode = v.InferOutput<typeof accountSecurityErrorCodeSchema>;
11
+ type CloudAccessTokenCreate = v.InferOutput<typeof cloudAccessTokenCreateSchema>;
6
12
  //#endregion
7
- //#region src/contract/ai.d.ts
8
- declare const aiTokenSchema: v.ObjectSchema<{
13
+ //#region src/contract/services.d.ts
14
+ declare const servicesTokenSchema: v.ObjectSchema<{
9
15
  readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
10
16
  readonly expiresAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
11
17
  }, undefined>;
12
- type AIToken = v.InferOutput<typeof aiTokenSchema>;
13
- declare const aiCatalogSchema: v.ObjectSchema<{
18
+ type ServicesToken = v.InferOutput<typeof servicesTokenSchema>;
19
+ declare const serviceCatalogSchema: v.ObjectSchema<{
14
20
  readonly models: v.ArraySchema<v.ObjectSchema<{
15
21
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
16
22
  readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -25,13 +31,16 @@ declare const aiCatalogSchema: v.ObjectSchema<{
25
31
  }, undefined>;
26
32
  }, undefined>, undefined>;
27
33
  readonly defaultModelID: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
34
+ readonly search: v.OptionalSchema<v.ObjectSchema<{
35
+ readonly creditsPerRequest: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
36
+ }, undefined>, undefined>;
28
37
  }, undefined>;
29
- type AICatalog = v.InferOutput<typeof aiCatalogSchema>;
38
+ type ServiceCatalog = v.InferOutput<typeof serviceCatalogSchema>;
30
39
  /**
31
40
  * A service records a request's charge before the request's answer ends, so a wallet read after
32
41
  * an answer includes what it cost.
33
42
  */
34
- declare const aiWalletSchema: v.ObjectSchema<{
43
+ declare const creditWalletSchema: v.ObjectSchema<{
35
44
  /** Credits left to spend; `null` when the service sets no limit. */
36
45
  readonly balance: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
37
46
  /** Spent first to last. */
@@ -41,25 +50,95 @@ declare const aiWalletSchema: v.ObjectSchema<{
41
50
  readonly expiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
42
51
  }, undefined>, undefined>;
43
52
  }, undefined>;
44
- type AIWallet = v.InferOutput<typeof aiWalletSchema>;
45
- /** Errors an AI service answers with, beside the upstream model's own. */
46
- declare const aiErrorCodeSchema: v.PicklistSchema<["unauthorized", "insufficient_credits", "model_not_allowed", "rate_limited"], undefined>;
47
- type AIErrorCode = v.InferOutput<typeof aiErrorCodeSchema>;
53
+ type CreditWallet = v.InferOutput<typeof creditWalletSchema>;
54
+ declare const searchRequestSchema: v.ObjectSchema<{
55
+ readonly query: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 1000, undefined>]>;
56
+ readonly numResults: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10, undefined>]>, 5>;
57
+ }, undefined>;
58
+ type SearchRequestInput = v.InferInput<typeof searchRequestSchema>;
59
+ declare const searchResponseSchema: v.ObjectSchema<{
60
+ readonly results: v.ArraySchema<v.ObjectSchema<{
61
+ readonly url: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, v.RegexAction<string, "A search result links to an HTTP(S) page">]>;
62
+ readonly title: v.StringSchema<undefined>;
63
+ readonly publishedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
64
+ readonly author: v.NullableSchema<v.StringSchema<undefined>, undefined>;
65
+ readonly text: v.StringSchema<undefined>;
66
+ }, undefined>, undefined>;
67
+ }, undefined>;
68
+ type SearchResponse = v.InferOutput<typeof searchResponseSchema>;
69
+ /** Errors a service answers with, beside the upstream provider's own. */
70
+ declare const serviceErrorCodeSchema: v.PicklistSchema<["invalid_request", "unauthorized", "insufficient_credits", "model_not_allowed", "capability_unavailable", "rate_limited"], undefined>;
71
+ type ServiceErrorCode = v.InferOutput<typeof serviceErrorCodeSchema>;
72
+ //#endregion
73
+ //#region src/contract/billing.d.ts
74
+ declare const billingTokenSchema: v.ObjectSchema<{
75
+ readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
76
+ readonly expiresAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
77
+ }, undefined>;
78
+ type BillingToken = v.InferOutput<typeof billingTokenSchema>;
79
+ /** What the service sells; an account without a plan has its deployment's free entitlements. */
80
+ declare const billingCatalogSchema: v.ObjectSchema<{
81
+ readonly plans: v.ArraySchema<v.ObjectSchema<{
82
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
83
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
84
+ readonly monthlyPriceCents: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
85
+ readonly storageBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
86
+ readonly monthlyCredits: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
87
+ }, undefined>, undefined>;
88
+ readonly creditPacks: v.ArraySchema<v.ObjectSchema<{
89
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
90
+ readonly credits: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
91
+ readonly priceCents: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
92
+ /** How long the credits last from purchase. */
93
+ readonly validDays: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
94
+ }, undefined>, undefined>;
95
+ }, undefined>;
96
+ type BillingCatalog = v.InferOutput<typeof billingCatalogSchema>;
97
+ /**
98
+ * The account's subscription as the payment provider holds it, or `null` without one. A
99
+ * `past_due` plan keeps its entitlements while payment is retried.
100
+ */
101
+ declare const billingAccountSchema: v.ObjectSchema<{
102
+ readonly subscription: v.NullableSchema<v.ObjectSchema<{
103
+ readonly planId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
104
+ readonly status: v.PicklistSchema<["active", "past_due"], undefined>;
105
+ /** When the current period ends: the next charge, or the end of a cancelled plan. */
106
+ readonly currentPeriodEnd: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
107
+ /** Whether the plan ends at `currentPeriodEnd` instead of renewing. */
108
+ readonly cancelsAtPeriodEnd: v.BooleanSchema<undefined>;
109
+ }, undefined>, undefined>;
110
+ }, undefined>;
111
+ type BillingAccount = v.InferOutput<typeof billingAccountSchema>;
112
+ /** What to buy: a plan to subscribe to, or a credit pack. */
113
+ declare const checkoutRequestSchema: v.UnionSchema<[v.ObjectSchema<{
114
+ readonly planId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
115
+ }, undefined>, v.ObjectSchema<{
116
+ readonly creditPackId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
117
+ }, undefined>], undefined>;
118
+ type CheckoutRequest = v.InferOutput<typeof checkoutRequestSchema>;
119
+ declare const billingErrorCodeSchema: v.PicklistSchema<["invalid_request", "unauthorized", "not_allowed", "provider_unavailable"], undefined>;
120
+ type BillingErrorCode = v.InferOutput<typeof billingErrorCodeSchema>;
48
121
  //#endregion
49
122
  //#region src/contract/admin/index.d.ts
50
- declare const adminErrorCodeSchema: v.PicklistSchema<["bad_request", "unauthorized", "forbidden", "not_found", "rate_limited", "invalid_enrollment_transition", "last_admin_required", "self_admin_action_forbidden", "email_regeneration_unavailable", "mfa_required"], undefined>;
123
+ declare const adminErrorCodeSchema: v.PicklistSchema<["bad_request", "unauthorized", "forbidden", "not_found", "rate_limited", "invalid_enrollment_transition", "last_admin_required", "self_admin_action_forbidden", "email_regeneration_unavailable", "mfa_required", "document_not_restorable", "workspace_gone"], undefined>;
51
124
  declare const enrollmentStatusSchema: v.PicklistSchema<["pending", "approved", "rejected", "revoked"], undefined>;
52
125
  /** Which accounts a list of people shows. */
53
126
  declare const cloudAdminUserFilterSchema: v.PicklistSchema<["all", "administrators", "suspended", "without-two-step"], undefined>;
54
127
  /** Which messages a list of email shows, by how their delivery went. */
55
128
  declare const cloudAdminEmailFilterSchema: v.PicklistSchema<["all", "sent", "waiting", "failed"], undefined>;
56
129
  /** Which events a list of activity shows, by what they are about. */
57
- declare const cloudAdminAuditFilterSchema: v.PicklistSchema<["all", "accounts", "requests", "email"], undefined>;
130
+ declare const cloudAdminAuditFilterSchema: v.PicklistSchema<["all", "accounts", "requests", "email", "documents"], undefined>;
131
+ /** Which documents a list shows: live ones, or those deleted forever an administrator can restore. */
132
+ declare const cloudAdminDocumentFilterSchema: v.PicklistSchema<["all", "reported", "disabled", "purged"], undefined>;
133
+ /** Which reports a list shows, by where they stand. */
134
+ declare const cloudAdminReportFilterSchema: v.PicklistSchema<["open", "actioned", "dismissed", "all"], undefined>;
58
135
  type AdminErrorCode = v.InferOutput<typeof adminErrorCodeSchema>;
59
136
  type CloudAdminUserFilter = v.InferOutput<typeof cloudAdminUserFilterSchema>;
60
137
  type CloudAdminEmailFilter = v.InferOutput<typeof cloudAdminEmailFilterSchema>;
61
138
  type CloudAdminAuditFilter = v.InferOutput<typeof cloudAdminAuditFilterSchema>;
62
139
  type EnrollmentStatus = v.InferOutput<typeof enrollmentStatusSchema>;
140
+ type CloudAdminDocumentFilter = v.InferOutput<typeof cloudAdminDocumentFilterSchema>;
141
+ type CloudAdminReportFilter = v.InferOutput<typeof cloudAdminReportFilterSchema>;
63
142
  //#endregion
64
143
  //#region src/contract/collaboration.d.ts
65
144
  declare const collaborationTicketSchema: v.ObjectSchema<{
@@ -80,9 +159,19 @@ declare const collaborationTicketSchema: v.ObjectSchema<{
80
159
  readonly name: v.StringSchema<undefined>;
81
160
  }, undefined>], undefined>;
82
161
  readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
162
+ /**
163
+ * Why a peer whose access would let them edit may only view: `storage-limit` when the document's
164
+ * owner holds their whole storage allowance, until they free space or their plan grows.
165
+ */
166
+ readonly readOnly: v.OptionalSchema<v.PicklistSchema<["storage-limit"], undefined>, undefined>;
83
167
  readonly roomEpoch: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
84
168
  readonly expiresAt: v.StringSchema<undefined>;
85
169
  readonly serverEnforcedWrites: v.BooleanSchema<undefined>;
170
+ /**
171
+ * Whether the relay answers `RELAY_HEARTBEAT`. A relay from before it takes a ping for a
172
+ * malformed frame and turns the peer away, so editors ask only a relay that says it answers.
173
+ */
174
+ readonly relayHeartbeat: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
86
175
  }, undefined>;
87
176
  type CollaborationTicket = v.InferOutput<typeof collaborationTicketSchema>;
88
177
  //#endregion
@@ -95,7 +184,7 @@ declare const workspaceEntitlementsSchema: v.ObjectSchema<{
95
184
  readonly guestPresence: v.BooleanSchema<undefined>;
96
185
  readonly collaboration: v.BooleanSchema<undefined>;
97
186
  readonly revisionHistory: v.BooleanSchema<undefined>;
98
- readonly cloudAI: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
187
+ readonly cloudServices: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
99
188
  }, undefined>;
100
189
  readonly limits: v.ObjectSchema<{
101
190
  readonly maximumFileBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
@@ -109,6 +198,7 @@ declare const workspaceEntitlementsSchema: v.ObjectSchema<{
109
198
  }, undefined>;
110
199
  }, undefined>;
111
200
  type WorkspaceEntitlements = v.InferOutput<typeof workspaceEntitlementsSchema>;
201
+ type AccountEntitlements = WorkspaceEntitlements;
112
202
  //#endregion
113
203
  //#region src/contract/discovery.d.ts
114
204
  declare const cloudDiscoverySchema: v.ObjectSchema<{
@@ -146,14 +236,37 @@ declare const cloudDiscoverySchema: v.ObjectSchema<{
146
236
  readonly listing: v.OptionalSchema<v.ObjectSchema<{
147
237
  readonly minimumEditorVersion: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
148
238
  }, undefined>, undefined>;
149
- /** The AI service editors reach with Cloud-signed tokens; absent when the deployment has none. */
150
- readonly ai: v.OptionalSchema<v.ObjectSchema<{
239
+ /**
240
+ * The oldest editor version the server works with. Older editors ask to be updated instead of
241
+ * connecting, and the server refuses their requests.
242
+ */
243
+ readonly minimumEditorVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
244
+ /** The services editors reach with Cloud-signed tokens; absent when the deployment has none. */
245
+ readonly services: v.OptionalSchema<v.ObjectSchema<{
151
246
  readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
152
247
  readonly contractVersion: v.LiteralSchema<"1", undefined>;
153
248
  }, undefined>, undefined>;
154
249
  /** Where people manage their plan and buy credits; absent when the deployment does not bill. */
155
250
  readonly billing: v.OptionalSchema<v.ObjectSchema<{
156
- readonly portalURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
251
+ readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
252
+ readonly contractVersion: v.LiteralSchema<"1", undefined>;
253
+ }, undefined>, undefined>;
254
+ /** The community gallery; absent when the deployment has none. */
255
+ readonly community: v.OptionalSchema<v.ObjectSchema<{
256
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
257
+ }, undefined>, undefined>;
258
+ readonly legal: v.OptionalSchema<v.ObjectSchema<{
259
+ readonly termsURL: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
260
+ readonly privacyURL: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
261
+ readonly termsVersion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
262
+ readonly requireAcceptance: v.BooleanSchema<undefined>;
263
+ readonly abuseEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
264
+ readonly minimumAge: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
265
+ }, undefined>, undefined>;
266
+ readonly branding: v.OptionalSchema<v.ObjectSchema<{
267
+ readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, undefined>;
268
+ readonly logoURL: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>, v.CheckAction<string, undefined>]>, undefined>;
269
+ readonly helpURL: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>, v.CheckAction<string, undefined>]>, undefined>;
157
270
  }, undefined>, undefined>;
158
271
  }, undefined>;
159
272
  type CloudDiscovery = v.InferOutput<typeof cloudDiscoverySchema>;
@@ -208,6 +321,24 @@ declare const sharedDocumentSchema: v.ObjectSchema<{
208
321
  readonly updatedAt: v.StringSchema<undefined>;
209
322
  }, undefined>;
210
323
  type SharedDocument = v.InferOutput<typeof sharedDocumentSchema>;
324
+ /**
325
+ * A document in Trash the person may restore: who deleted it and when, and when it goes for good.
326
+ * `canPurge` says whether they may also delete it for good before then.
327
+ */
328
+ declare const trashedDocumentSchema: v.ObjectSchema<{
329
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
330
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
331
+ readonly workspaceName: v.StringSchema<undefined>;
332
+ readonly name: v.StringSchema<undefined>;
333
+ readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
334
+ readonly deletedAt: v.StringSchema<undefined>;
335
+ readonly deletedBy: v.NullableSchema<v.ObjectSchema<{
336
+ readonly name: v.StringSchema<undefined>;
337
+ }, undefined>, undefined>;
338
+ readonly purgeAt: v.StringSchema<undefined>;
339
+ readonly canPurge: v.BooleanSchema<undefined>;
340
+ }, undefined>;
341
+ type TrashedDocument = v.InferOutput<typeof trashedDocumentSchema>;
211
342
  declare const documentDownloadSchema: v.ObjectSchema<{
212
343
  readonly document: v.ObjectSchema<{
213
344
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -460,10 +591,6 @@ declare const acceptedInvitationSchema: v.VariantSchema<"kind", [v.ObjectSchema<
460
591
  readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
461
592
  }, undefined>], undefined>;
462
593
  type AcceptedInvitation = v.InferOutput<typeof acceptedInvitationSchema>;
463
- declare const lookupCloudUserSchema: v.ObjectSchema<{
464
- readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
465
- }, undefined>;
466
- type LookupCloudUserInput = v.InferOutput<typeof lookupCloudUserSchema>;
467
594
  declare const putDocumentGrantSchema: v.ObjectSchema<{
468
595
  readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
469
596
  }, undefined>;
@@ -709,17 +836,114 @@ declare const documentVersionDownloadSchema: v.ObjectSchema<{
709
836
  }, undefined>;
710
837
  type DocumentVersionDownload = v.InferOutput<typeof documentVersionDownloadSchema>;
711
838
  //#endregion
839
+ //#region src/contract/community.d.ts
840
+ /** The community workspace's documents, most recently changed first. */
841
+ declare const communityDocumentsSchema: v.ObjectSchema<{
842
+ readonly documents: v.ArraySchema<v.ObjectSchema<{
843
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
844
+ readonly name: v.StringSchema<undefined>;
845
+ readonly kind: v.PicklistSchema<["design", "board"], undefined>;
846
+ readonly updatedAt: v.StringSchema<undefined>;
847
+ readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
848
+ readonly thumbnailPath: v.StringSchema<undefined>;
849
+ readonly versions: v.ArraySchema<v.ObjectSchema<{
850
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
851
+ readonly name: v.StringSchema<undefined>;
852
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
853
+ readonly createdAt: v.StringSchema<undefined>;
854
+ /** Whether the document holds this version now, with nothing changed since it was named. */
855
+ readonly current: v.BooleanSchema<undefined>;
856
+ }, undefined>, undefined>;
857
+ }, undefined>, undefined>;
858
+ }, undefined>;
859
+ type CommunityDocuments = v.InferOutput<typeof communityDocumentsSchema>;
860
+ /** A community document, or one of its named versions, with where to download it. */
861
+ declare const communityDownloadSchema: v.ObjectSchema<{
862
+ readonly document: v.ObjectSchema<{
863
+ readonly document: v.ObjectSchema<{
864
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
865
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
866
+ readonly name: v.StringSchema<undefined>;
867
+ readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
868
+ readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
869
+ readonly version: v.NumberSchema<undefined>;
870
+ readonly createdAt: v.StringSchema<undefined>;
871
+ readonly updatedAt: v.StringSchema<undefined>;
872
+ }, undefined>;
873
+ readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
874
+ readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
875
+ readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
876
+ readonly contentType: v.StringSchema<undefined>;
877
+ readonly download: v.ObjectSchema<{
878
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
879
+ readonly method: v.LiteralSchema<"GET", undefined>;
880
+ readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
881
+ readonly expiresAt: v.StringSchema<undefined>;
882
+ }, undefined>;
883
+ readonly images: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
884
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
885
+ readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
886
+ readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
887
+ readonly download: v.ObjectSchema<{
888
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
889
+ readonly method: v.LiteralSchema<"GET", undefined>;
890
+ readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
891
+ readonly expiresAt: v.StringSchema<undefined>;
892
+ }, undefined>;
893
+ }, undefined>, undefined>, v.MaxLengthAction<{
894
+ name: string;
895
+ checksum: string;
896
+ byteSize: number;
897
+ download: {
898
+ url: string;
899
+ method: "GET";
900
+ headers: {
901
+ [x: string]: string;
902
+ };
903
+ expiresAt: string;
904
+ };
905
+ }[], 10000, undefined>]>;
906
+ }, undefined>;
907
+ readonly version: v.NullableSchema<v.ObjectSchema<{
908
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
909
+ readonly name: v.StringSchema<undefined>;
910
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
911
+ readonly createdAt: v.StringSchema<undefined>;
912
+ /** Whether the document holds this version now, with nothing changed since it was named. */
913
+ readonly current: v.BooleanSchema<undefined>;
914
+ }, undefined>, undefined>;
915
+ }, undefined>;
916
+ type CommunityDownload = v.InferOutput<typeof communityDownloadSchema>;
917
+ //#endregion
918
+ //#region src/contract/reports.d.ts
919
+ /**
920
+ * A report about a document someone opened from a share link: the link's secret proves they can
921
+ * see it, as resolving the link does, and a guest names themselves as they do there.
922
+ */
923
+ declare const fileDocumentReportSchema: v.ObjectSchema<{
924
+ readonly secret: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
925
+ readonly guestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
926
+ readonly reason: v.PicklistSchema<["spam-phishing", "illegal", "copyright", "harassment", "other"], undefined>;
927
+ readonly description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
928
+ /** Where an administrator may answer; optional, and never shown to the document's people. */
929
+ readonly replyEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 254, undefined>]>, undefined>;
930
+ }, undefined>;
931
+ type FileDocumentReportInput = v.InferOutput<typeof fileDocumentReportSchema>;
932
+ //#endregion
712
933
  //#region src/client/discovery.d.ts
713
934
  type CloudFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
714
935
  type DiscoverCloudOptions = {
715
936
  fetch?: CloudFetch;
716
937
  signal?: AbortSignal;
938
+ /** The editor's own version, checked against the server's minimum. */
939
+ editorVersion?: string;
717
940
  };
718
941
  /**
719
942
  * Why a server could not be used: the address is not a web address, nothing answered, something
720
- * answered but not as OpenPencil Cloud, or it speaks another protocol version.
943
+ * answered but not as OpenPencil Cloud, the server is older than this editor supports, or this
944
+ * editor is older than the server supports.
721
945
  */
722
- type CloudDiscoveryFailure = 'invalid-address' | 'unreachable' | 'not-cloud' | 'outdated';
946
+ type CloudDiscoveryFailure = 'invalid-address' | 'unreachable' | 'not-cloud' | 'server-outdated' | 'editor-outdated';
723
947
  declare class CloudClientError extends Error {
724
948
  readonly cause?: unknown | undefined;
725
949
  readonly reason: CloudDiscoveryFailure;
@@ -727,40 +951,77 @@ declare class CloudClientError extends Error {
727
951
  }
728
952
  declare function discoverCloud(serverURL: string, options?: DiscoverCloudOptions): Promise<CloudDiscovery>;
729
953
  //#endregion
730
- //#region src/client/ai.d.ts
954
+ //#region src/client/services.d.ts
731
955
  /** Where a request gets the token it sends, and how it drops one the service refused. */
732
- type CloudAITokenSource = {
956
+ type CloudServicesTokenSource = {
733
957
  token(): Promise<string>;
734
958
  /** Forgets `token`, so the next call signs a new one. */
735
959
  invalidate(token: string): void;
736
960
  };
737
- declare class CloudAIError extends Error {
961
+ declare class CloudServiceError extends Error {
738
962
  readonly status: number;
739
- readonly code?: AIErrorCode | undefined;
740
- readonly name = "CloudAIError";
741
- constructor(status: number, code?: AIErrorCode | undefined);
963
+ readonly code?: ServiceErrorCode | undefined;
964
+ readonly name = "CloudServiceError";
965
+ constructor(status: number, code?: ServiceErrorCode | undefined);
966
+ }
967
+ /** A service endpoint a token would reach in the clear, which no request is sent to. */
968
+ declare class CloudServiceInsecureEndpointError extends Error {
969
+ readonly url: string;
970
+ readonly name = "CloudServiceInsecureEndpointError";
971
+ constructor(url: string);
742
972
  }
743
973
  /**
744
974
  * Sends each request with a current token. A token the service refuses, for instance one signed
745
975
  * by a key Cloud has since replaced, is dropped and a request that can be replayed is sent once
746
976
  * more with a new one.
747
977
  */
748
- declare function cloudAIFetch(tokens: CloudAITokenSource, fetch: CloudFetch): CloudFetch;
749
- type CloudAIClientOptions = {
978
+ declare function cloudServicesFetch(tokens: CloudServicesTokenSource, fetch: CloudFetch): CloudFetch;
979
+ type CloudServicesClientOptions = {
750
980
  /** The service's endpoint, as Cloud's discovery names it. */
751
981
  endpoint: string;
752
- tokens: CloudAITokenSource;
982
+ tokens: CloudServicesTokenSource;
753
983
  fetch: CloudFetch;
754
984
  };
755
- /** The AI service a Cloud advertises: its model API base URL, catalog, and the wallet. */
756
- declare function createCloudAIClient(options: CloudAIClientOptions): {
985
+ /** The services a Cloud advertises: the model API base URL, catalog, wallet, and search. */
986
+ declare function createCloudServicesClient(options: CloudServicesClientOptions): {
757
987
  /** The base URL an OpenAI-compatible client sends chat completions below. */
758
988
  modelBaseURL: string;
759
989
  fetch: CloudFetch;
760
- catalog(): Promise<AICatalog>;
761
- wallet(): Promise<AIWallet>;
990
+ catalog(): Promise<ServiceCatalog>;
991
+ wallet(): Promise<CreditWallet>;
992
+ /** A web search, charged to the workspace; only when the catalog lists `search`. */
993
+ search(input: SearchRequestInput): Promise<SearchResponse>;
762
994
  };
763
- type CloudAIClient = ReturnType<typeof createCloudAIClient>;
995
+ type CloudServicesClient = ReturnType<typeof createCloudServicesClient>;
996
+ //#endregion
997
+ //#region src/client/billing.d.ts
998
+ declare class CloudBillingError extends Error {
999
+ readonly status: number;
1000
+ readonly code?: BillingErrorCode | undefined;
1001
+ readonly name = "CloudBillingError";
1002
+ constructor(status: number, code?: BillingErrorCode | undefined);
1003
+ }
1004
+ type CloudBillingClientOptions = {
1005
+ /** The billing service's endpoint, as Cloud's discovery names it. */
1006
+ endpoint: string;
1007
+ /** Billing tokens for the signed-in person, from `requestBillingToken`. */
1008
+ tokens: CloudServicesTokenSource;
1009
+ fetch: CloudFetch;
1010
+ };
1011
+ /**
1012
+ * The billing a Cloud advertises: what it sells, the account's subscription, and where to buy or
1013
+ * manage it. Checkout and the portal answer with the payment provider's page to open, so a token
1014
+ * never travels in a URL.
1015
+ */
1016
+ declare function createCloudBillingClient(options: CloudBillingClientOptions): {
1017
+ catalog(): Promise<BillingCatalog>;
1018
+ account(): Promise<BillingAccount>;
1019
+ /** The checkout page that buys `request` for the account. */
1020
+ checkout(request: CheckoutRequest): Promise<string>;
1021
+ /** The page where the account cancels, changes its card, and reads its invoices. */
1022
+ portal(): Promise<string>;
1023
+ };
1024
+ type CloudBillingClient = ReturnType<typeof createCloudBillingClient>;
764
1025
  //#endregion
765
1026
  //#region src/client/auth/failure.d.ts
766
1027
  /** Why a sign-in step did not go through, in terms a page or dialog can explain. */
@@ -792,7 +1053,23 @@ type DeviceActionResult = Promise<{
792
1053
  error_description: string;
793
1054
  };
794
1055
  }>;
795
- type CloudAuthClient = Pick<ReturnType<typeof createAuthClient>, 'getSession' | 'signIn' | 'signOut' | 'signUp' | 'sendVerificationEmail' | 'requestPasswordReset' | 'resetPassword'> & {
1056
+ type CloudAuthClient = Pick<ReturnType<typeof createAuthClient>, 'getSession' | 'signIn' | 'signOut' | 'sendVerificationEmail' | 'requestPasswordReset' | 'resetPassword'> & {
1057
+ signUp: {
1058
+ /** Also takes the language the server writes to the account in, a field Cloud adds. */
1059
+ email(input: {
1060
+ name: string;
1061
+ email: string;
1062
+ password: string;
1063
+ locale: string;
1064
+ callbackURL?: string;
1065
+ }): Promise<{
1066
+ data: unknown;
1067
+ error: {
1068
+ code?: string;
1069
+ status: number;
1070
+ } | null;
1071
+ }>;
1072
+ };
796
1073
  signIn: ReturnType<typeof createAuthClient>['signIn'] & {
797
1074
  passkey(): Promise<{
798
1075
  data: unknown;
@@ -890,12 +1167,16 @@ declare function signInToCloudWithEmail(discovery: CloudDiscovery, input: {
890
1167
  email: string;
891
1168
  password: string;
892
1169
  }, options?: CloudEmailAuthOptions): Promise<CloudAuthResult<CloudEmailSignIn>>;
893
- /** Creates an account; the server emails a link that opens `verifiedURL` once it is confirmed. */
1170
+ /**
1171
+ * Creates an account; the server emails a link that opens `verifiedURL` once it is confirmed,
1172
+ * written in `locale`, the app's language.
1173
+ */
894
1174
  declare function signUpToCloudWithEmail(discovery: CloudDiscovery, input: {
895
1175
  name: string;
896
1176
  email: string;
897
1177
  password: string;
898
1178
  verifiedURL: string;
1179
+ locale: string;
899
1180
  }, options?: CloudEmailAuthOptions): Promise<CloudAuthResult>;
900
1181
  declare function resendCloudVerification(discovery: CloudDiscovery, input: {
901
1182
  email: string;
@@ -906,11 +1187,11 @@ declare function resendCloudVerification(discovery: CloudDiscovery, input: {
906
1187
  /** The instance owns authentication; only its own editor may receive the return. */
907
1188
  declare function cloudEditorReturnURL(discovery: CloudDiscovery, value: string): string;
908
1189
  /**
909
- * The server's sign-in page, coming back to `returnURL` on its editor afterwards. A `provider`
910
- * starts that provider's sign-in at once, while the server's pages still handle two-step sign-in
911
- * and approval before the return.
1190
+ * The server's sign-in page, or with `page` its sign-up page, coming back to `returnURL` on its
1191
+ * editor afterwards. A `provider` starts that provider's sign-in at once, while the server's pages
1192
+ * still handle two-step sign-in and approval before the return.
912
1193
  */
913
- declare function cloudSignInURL(discovery: CloudDiscovery, returnURL: string, provider?: CloudSocialProvider): string;
1194
+ declare function cloudSignInURL(discovery: CloudDiscovery, returnURL: string, provider?: CloudSocialProvider, page?: 'sign-in' | 'sign-up'): string;
914
1195
  /** Accept only same-origin application paths for post-authentication navigation. */
915
1196
  declare function cloudRedirectPath(value: unknown, fallback?: string): string;
916
1197
  //#endregion
@@ -923,7 +1204,7 @@ declare class CloudAPIError extends Error {
923
1204
  constructor(message: string, status: number, code?: string | undefined);
924
1205
  }
925
1206
  //#endregion
926
- //#region src/client/api.d.ts
1207
+ //#region src/client/documents.d.ts
927
1208
  declare const uploadResponseSchema: v.ObjectSchema<{
928
1209
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
929
1210
  readonly upload: v.VariantSchema<"kind", [v.ObjectSchema<{
@@ -945,21 +1226,18 @@ declare const uploadResponseSchema: v.ObjectSchema<{
945
1226
  readonly expiresAt: v.StringSchema<undefined>;
946
1227
  }, undefined>], undefined>;
947
1228
  }, undefined>;
1229
+ type CloudUpload = v.InferOutput<typeof uploadResponseSchema>;
1230
+ //#endregion
1231
+ //#region src/client/api.d.ts
948
1232
  type CloudRequestOptions = {
949
1233
  fetch?: CloudFetch;
950
1234
  signal?: AbortSignal;
951
1235
  accessToken?: string;
952
1236
  onDiagnostic?: CloudClientDiagnostic;
953
1237
  };
954
- type CloudUpload = v.InferOutput<typeof uploadResponseSchema>;
955
1238
  declare function createCloudAPIClient(baseURL: string, options?: CloudRequestOptions): {
956
- /** Documents shared with the person directly, outside their workspaces. */
957
- listSharedDocuments(): Promise<SharedDocument[]>;
958
- listDocuments(workspaceId: string): Promise<DocumentSummary[]>;
959
- createDocument(workspaceId: string, input: CreateDocumentRequest): Promise<DocumentSummary>;
960
- deleteDocument(documentId: string): Promise<void>;
961
- getDocument(documentId: string): Promise<DocumentDownload>;
962
- getDocumentAccess(documentId: string): Promise<DocumentAccess>;
1239
+ listCommunityDocuments(): Promise<CommunityDocuments>;
1240
+ getCommunityDocument(documentId: string, versionId?: string | null): Promise<CommunityDownload>;
963
1241
  listDocumentShares(documentId: string): Promise<DocumentShare[]>;
964
1242
  createDocumentShare(documentId: string, input: CreateDocumentShareInput): Promise<{
965
1243
  share: {
@@ -1015,12 +1293,13 @@ declare function createCloudAPIClient(baseURL: string, options?: CloudRequestOpt
1015
1293
  createInvitationContinuation(input: CreateInvitationContinuationInput): Promise<InvitationContinuation>;
1016
1294
  consumeInvitationContinuation(id: string): Promise<CreateInvitationContinuationInput>;
1017
1295
  previewInvitation(invitationId: string, input: AcceptDocumentInvitationInput): Promise<InvitationPreview>;
1018
- /** Accepts a document or workspace invitation, and says which it was. */
1019
1296
  acceptInvitation(invitationId: string, input: AcceptDocumentInvitationInput): Promise<AcceptedInvitation>;
1020
1297
  revokeDocumentInvitation(documentId: string, invitationId: string): Promise<void>;
1298
+ fileDocumentReport(shareId: string, input: FileDocumentReportInput): Promise<void>;
1021
1299
  resolveDocumentShare(shareId: string, input: ResolveDocumentShareInput): Promise<{
1022
1300
  documentId: string;
1023
1301
  permission: "view" | "edit";
1302
+ linkPermission: "view" | "edit";
1024
1303
  principal: {
1025
1304
  kind: "user";
1026
1305
  userId: string;
@@ -1037,6 +1316,7 @@ declare function createCloudAPIClient(baseURL: string, options?: CloudRequestOpt
1037
1316
  resolution: {
1038
1317
  documentId: string;
1039
1318
  permission: "view" | "edit";
1319
+ linkPermission: "view" | "edit";
1040
1320
  principal: {
1041
1321
  kind: "user";
1042
1322
  userId: string;
@@ -1088,10 +1368,6 @@ declare function createCloudAPIClient(baseURL: string, options?: CloudRequestOpt
1088
1368
  };
1089
1369
  }>;
1090
1370
  getSharedCollaborationTicket(shareId: string, input: ResolveDocumentShareInput): Promise<CollaborationTicket>;
1091
- getCollaborationTicket(documentId: string): Promise<CollaborationTicket>;
1092
- createUpload(documentId: string, input: CreateUploadInput): Promise<CloudUpload>;
1093
- commitUpload(uploadId: string, input: CommitUploadRequest): Promise<DocumentSummary>;
1094
- /** A page of the document's version history, newest first. */
1095
1371
  listDocumentVersions(documentId: string, page?: {
1096
1372
  before?: string;
1097
1373
  limit?: number;
@@ -1126,6 +1402,19 @@ declare function createCloudAPIClient(baseURL: string, options?: CloudRequestOpt
1126
1402
  };
1127
1403
  }>;
1128
1404
  duplicateDocumentVersion(documentId: string, versionId: string, input: DuplicateDocumentVersionInput): Promise<DocumentSummary>;
1405
+ getUserProfile(documentId: string, userId: string): Promise<CloudUserProfile | null>;
1406
+ listSharedDocuments(): Promise<SharedDocument[]>;
1407
+ listDocuments(workspaceId: string): Promise<DocumentSummary[]>;
1408
+ createDocument(workspaceId: string, input: CreateDocumentRequest): Promise<DocumentSummary>;
1409
+ listTrash(): Promise<TrashedDocument[]>;
1410
+ restoreDocument(documentId: string): Promise<void>;
1411
+ purgeDocument(documentId: string): Promise<void>;
1412
+ deleteDocument(documentId: string): Promise<void>;
1413
+ getDocument(documentId: string): Promise<DocumentDownload>;
1414
+ getDocumentAccess(documentId: string): Promise<DocumentAccess>;
1415
+ getCollaborationTicket(documentId: string): Promise<CollaborationTicket>;
1416
+ createUpload(documentId: string, input: CreateUploadInput): Promise<CloudUpload>;
1417
+ commitUpload(uploadId: string, input: CommitUploadRequest): Promise<DocumentSummary>;
1129
1418
  requestImageUploads(documentId: string, input: RequestImageUploadsInput): Promise<ImageUploadOffer[]>;
1130
1419
  commitImageUploads(documentId: string, uploads: CommitImageUploadsInput["uploads"]): Promise<void>;
1131
1420
  getImageLinks(documentId: string, checksums: string[]): Promise<DocumentImageLink[]>;
@@ -1143,10 +1432,12 @@ declare function createCloudAPIClient(baseURL: string, options?: CloudRequestOpt
1143
1432
  getWorkspaceEntitlements(workspaceId: string): Promise<WorkspaceEntitlements>;
1144
1433
  getUsage(workspaceId: string): Promise<WorkspaceUsage>;
1145
1434
  getSession(): Promise<CloudSession | null>;
1146
- /** A short-lived token for the deployment's AI service, on the workspace's behalf. */
1147
- requestAIToken(workspaceId: string): Promise<AIToken>;
1148
- lookupUser(documentId: string, input: LookupCloudUserInput): Promise<CloudUserProfile | null>;
1149
- getUserProfile(documentId: string, userId: string): Promise<CloudUserProfile | null>;
1435
+ /** A short-lived token for the deployment's services, on the workspace's behalf. */
1436
+ requestServicesToken(workspaceId: string): Promise<ServicesToken>;
1437
+ /** A short-lived token for the deployment's billing, for the signed-in person's own account. */
1438
+ requestBillingToken(): Promise<BillingToken>;
1439
+ /** The signed-in account's plan, and the storage its workspaces hold together. */
1440
+ getAccountEntitlements(): Promise<AccountEntitlements>;
1150
1441
  };
1151
1442
  type CloudAPIClient = ReturnType<typeof createCloudAPIClient>;
1152
1443
  //#endregion
@@ -1224,16 +1515,16 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1224
1515
  total: number;
1225
1516
  counts: {
1226
1517
  pending: number;
1227
- approved: number;
1228
1518
  rejected: number;
1229
1519
  revoked: number;
1520
+ approved: number;
1230
1521
  };
1231
1522
  enrollments: {
1232
1523
  id: string;
1233
1524
  email: string;
1234
1525
  name: string | null;
1235
1526
  reason: string | null;
1236
- status: "pending" | "approved" | "rejected" | "revoked";
1527
+ status: "pending" | "rejected" | "revoked" | "approved";
1237
1528
  requestedAt: string;
1238
1529
  reviewedAt: string | null;
1239
1530
  reviewedBy: string | null;
@@ -1249,7 +1540,7 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1249
1540
  email: string;
1250
1541
  name: string | null;
1251
1542
  reason: string | null;
1252
- status: "pending" | "approved" | "rejected" | "revoked";
1543
+ status: "pending" | "rejected" | "revoked" | "approved";
1253
1544
  requestedAt: string;
1254
1545
  reviewedAt: string | null;
1255
1546
  reviewedBy: string | null;
@@ -1365,6 +1656,7 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1365
1656
  total: number;
1366
1657
  counts: {
1367
1658
  email: number;
1659
+ documents: number;
1368
1660
  all: number;
1369
1661
  accounts: number;
1370
1662
  requests: number;
@@ -1385,11 +1677,96 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1385
1677
  createdAt: string;
1386
1678
  }[];
1387
1679
  }>;
1680
+ reports(request: AdminListRequest<CloudAdminReportFilter>, signal?: AbortSignal): Promise<{
1681
+ total: number;
1682
+ counts: {
1683
+ open: number;
1684
+ all: number;
1685
+ dismissed: number;
1686
+ actioned: number;
1687
+ };
1688
+ reports: {
1689
+ id: string;
1690
+ reason: "other" | "spam-phishing" | "illegal" | "copyright" | "harassment";
1691
+ description: string;
1692
+ status: "open" | "dismissed" | "actioned";
1693
+ reporter: {
1694
+ id: string;
1695
+ name: string | null;
1696
+ } | null;
1697
+ replyEmail: string | null;
1698
+ createdAt: string;
1699
+ resolvedAt: string | null;
1700
+ document: {
1701
+ id: string;
1702
+ name: string;
1703
+ workspace: {
1704
+ id: string;
1705
+ name: string;
1706
+ };
1707
+ owner: {
1708
+ id: string;
1709
+ name: string;
1710
+ email: string;
1711
+ } | null;
1712
+ createdAt: string;
1713
+ updatedAt: string;
1714
+ disabledAt: string | null;
1715
+ disabledReason: string | null;
1716
+ openReports: number;
1717
+ purgedAt: string | null;
1718
+ destroyedAt: string | null;
1719
+ };
1720
+ share: {
1721
+ id: string;
1722
+ revoked: boolean;
1723
+ } | null;
1724
+ }[];
1725
+ }>;
1726
+ resolveReport(id: string, action: "dismiss" | "action", signal?: AbortSignal): Promise<{
1727
+ ok: true;
1728
+ }>;
1729
+ documents(request: AdminListRequest<CloudAdminDocumentFilter>, signal?: AbortSignal): Promise<{
1730
+ total: number;
1731
+ counts: {
1732
+ all: number;
1733
+ reported: number;
1734
+ disabled: number;
1735
+ purged: number;
1736
+ };
1737
+ documents: {
1738
+ id: string;
1739
+ name: string;
1740
+ workspace: {
1741
+ id: string;
1742
+ name: string;
1743
+ };
1744
+ owner: {
1745
+ id: string;
1746
+ name: string;
1747
+ email: string;
1748
+ } | null;
1749
+ createdAt: string;
1750
+ updatedAt: string;
1751
+ disabledAt: string | null;
1752
+ disabledReason: string | null;
1753
+ openReports: number;
1754
+ purgedAt: string | null;
1755
+ destroyedAt: string | null;
1756
+ }[];
1757
+ }>;
1758
+ documentAction(id: string, action: "disable" | "enable" | "undelete", reason?: string, signal?: AbortSignal): Promise<{
1759
+ ok: true;
1760
+ }>;
1761
+ revokeShare(id: string, signal?: AbortSignal): Promise<{
1762
+ ok: true;
1763
+ }>;
1388
1764
  operations(signal?: AbortSignal): Promise<{
1389
1765
  deployment: "official" | "self-hosted";
1390
1766
  enrollmentMode: "open" | "approval" | "closed";
1391
1767
  emailTransport: "none" | "smtp" | "cloudflare";
1392
1768
  pendingEnrollment: number;
1769
+ openReports: number;
1393
1770
  pendingEmail: number;
1394
1771
  failedEmail: number;
1395
1772
  accounts: number;
@@ -1397,6 +1774,33 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1397
1774
  documents: number;
1398
1775
  storedBytes: number;
1399
1776
  }>;
1777
+ entitlements(signal?: AbortSignal): Promise<{
1778
+ entitlements: {
1779
+ features: {
1780
+ links: boolean;
1781
+ guestView: boolean;
1782
+ guestEdit: boolean;
1783
+ guestPresence: boolean;
1784
+ collaboration: boolean;
1785
+ revisionHistory: boolean;
1786
+ cloudServices: boolean;
1787
+ };
1788
+ limits: {
1789
+ maximumFileBytes: number;
1790
+ maximumStorageBytes: number | null;
1791
+ maximumParticipants: number | null;
1792
+ monthlyCreditAllowance: number | null;
1793
+ };
1794
+ usage: {
1795
+ committedStorageBytes: number;
1796
+ reservedStorageBytes: number;
1797
+ };
1798
+ };
1799
+ }>;
1800
+ billingToken(signal?: AbortSignal): Promise<{
1801
+ token: string;
1802
+ expiresAt: string;
1803
+ }>;
1400
1804
  accountStatus(signal?: AbortSignal): Promise<{
1401
1805
  user: {
1402
1806
  userId: string;
@@ -1405,7 +1809,10 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1405
1809
  image?: string | null | undefined;
1406
1810
  deploymentRole?: "user" | "admin" | undefined;
1407
1811
  };
1408
- state: "pending" | "rejected" | "revoked" | "active";
1812
+ state: "active" | "pending" | "rejected" | "revoked" | "terms";
1813
+ }>;
1814
+ acceptTerms(version: string, signal?: AbortSignal): Promise<{
1815
+ ok: true;
1409
1816
  }>;
1410
1817
  authenticationMethods(signal?: AbortSignal): Promise<{
1411
1818
  methods: {
@@ -1469,6 +1876,9 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1469
1876
  image: string | null;
1470
1877
  };
1471
1878
  }>;
1879
+ setLocale(locale: string, signal?: AbortSignal): Promise<{
1880
+ ok: true;
1881
+ }>;
1472
1882
  updateProfile(name: string, signal?: AbortSignal): Promise<{
1473
1883
  ok: true;
1474
1884
  }>;
@@ -1481,6 +1891,30 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1481
1891
  changeEmail(newEmail: string, callbackURL: string, signal?: AbortSignal): Promise<{
1482
1892
  ok: true;
1483
1893
  }>;
1894
+ accessTokens(signal?: AbortSignal): Promise<{
1895
+ tokens: {
1896
+ id: string;
1897
+ name: string;
1898
+ start: string | null;
1899
+ createdAt: string;
1900
+ expiresAt: string | null;
1901
+ lastUsedAt: string | null;
1902
+ }[];
1903
+ }>;
1904
+ createAccessToken(input: CloudAccessTokenCreate, signal?: AbortSignal): Promise<{
1905
+ token: string;
1906
+ accessToken: {
1907
+ id: string;
1908
+ name: string;
1909
+ start: string | null;
1910
+ createdAt: string;
1911
+ expiresAt: string | null;
1912
+ lastUsedAt: string | null;
1913
+ };
1914
+ }>;
1915
+ revokeAccessToken(id: string, signal?: AbortSignal): Promise<{
1916
+ ok: true;
1917
+ }>;
1484
1918
  sessions(signal?: AbortSignal): Promise<{
1485
1919
  sessions: {
1486
1920
  id: string;
@@ -1510,11 +1944,36 @@ declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
1510
1944
  createdAt: string;
1511
1945
  }[];
1512
1946
  }>;
1947
+ accountDeletion(signal?: AbortSignal): Promise<{
1948
+ deletion: {
1949
+ lastAdministrator: boolean;
1950
+ blockedBy: {
1951
+ id: string;
1952
+ name: string;
1953
+ }[];
1954
+ deletes: {
1955
+ id: string;
1956
+ name: string;
1957
+ }[];
1958
+ leaves: {
1959
+ id: string;
1960
+ name: string;
1961
+ }[];
1962
+ documents: {
1963
+ id: string;
1964
+ name: string;
1965
+ workspaceName: string;
1966
+ }[];
1967
+ };
1968
+ }>;
1969
+ deleteAccount(password?: string, signal?: AbortSignal): Promise<{
1970
+ ok: true;
1971
+ }>;
1513
1972
  unlinkAuthenticationMethod(methodId: string, signal?: AbortSignal): Promise<{
1514
1973
  ok: true;
1515
1974
  }>;
1516
1975
  };
1517
1976
  type CloudPortalClient = ReturnType<typeof createCloudPortalClient>;
1518
1977
  //#endregion
1519
- export { type CloudAIClient, type CloudAIClientOptions, CloudAIError, type CloudAITokenSource, type CloudAPIClient, CloudAPIError, type CloudAuthClient, type CloudAuthClientOptions, type CloudAuthFailure, type CloudAuthResult, CloudClientError, type CloudDeviceAuthorization, CloudDeviceAuthorizationError, type CloudDeviceAuthorizationOptions, type CloudDeviceErrorCode, type CloudDeviceToken, type CloudDiscoveryFailure, type CloudEmailSignIn, type CloudFetch, CloudPortalAPIError, type CloudPortalAPIErrorKind, type CloudPortalClient, type CloudPortalClientOptions, type CloudRequestOptions, type CloudSignInOptions, type CloudSocialProvider, type CloudUpload, type DiscoverCloudOptions, cloudAIFetch, cloudAuthFailure, cloudEditorReturnURL, cloudRedirectPath, cloudSignInURL, createCloudAIClient, createCloudAPIClient, createCloudAuthClient, createCloudPortalClient, discoverCloud, pollCloudDeviceToken, requestCloudDeviceAuthorization, resendCloudVerification, signInToCloud, signInToCloudWithEmail, signOutFromCloud, signUpToCloudWithEmail };
1978
+ export { type CloudAPIClient, CloudAPIError, type CloudAuthClient, type CloudAuthClientOptions, type CloudAuthFailure, type CloudAuthResult, type CloudBillingClient, type CloudBillingClientOptions, CloudBillingError, CloudClientError, type CloudDeviceAuthorization, CloudDeviceAuthorizationError, type CloudDeviceAuthorizationOptions, type CloudDeviceErrorCode, type CloudDeviceToken, type CloudDiscoveryFailure, type CloudEmailSignIn, type CloudFetch, CloudPortalAPIError, type CloudPortalAPIErrorKind, type CloudPortalClient, type CloudPortalClientOptions, type CloudRequestOptions, CloudServiceError, CloudServiceInsecureEndpointError, type CloudServicesClient, type CloudServicesClientOptions, type CloudServicesTokenSource, type CloudSignInOptions, type CloudSocialProvider, type CloudUpload, type DiscoverCloudOptions, cloudAuthFailure, cloudEditorReturnURL, cloudRedirectPath, cloudServicesFetch, cloudSignInURL, createCloudAPIClient, createCloudAuthClient, createCloudBillingClient, createCloudPortalClient, createCloudServicesClient, discoverCloud, pollCloudDeviceToken, requestCloudDeviceAuthorization, resendCloudVerification, signInToCloud, signInToCloudWithEmail, signOutFromCloud, signUpToCloudWithEmail };
1520
1979
  //# sourceMappingURL=client.d.ts.map