@open-pencil/cloud 0.0.0-stage → 0.17.0-beta.1
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.
- package/LICENSE +202 -0
- package/LICENSE-MIT +21 -0
- package/NOTICE +7 -0
- package/README.md +37 -2
- package/dist/bin/ai-relay.d.mts +1 -0
- package/dist/bin/ai-relay.mjs +31 -0
- package/dist/bin/ai-relay.mjs.map +1 -0
- package/dist/bin/server.d.mts +1 -0
- package/dist/bin/server.mjs +29 -0
- package/dist/bin/server.mjs.map +1 -0
- package/dist/client.d.ts +1520 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1917 -0
- package/dist/client.js.map +1 -0
- package/dist/contract.d.ts +2 -0
- package/dist/contract.js +2 -0
- package/dist/contract2.js +1453 -0
- package/dist/contract2.js.map +1 -0
- package/dist/email.d.ts +169 -0
- package/dist/email.d.ts.map +1 -0
- package/dist/email.js +670 -0
- package/dist/email.js.map +1 -0
- package/dist/index.d.ts +1755 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/listen.mjs +1881 -0
- package/dist/listen.mjs.map +1 -0
- package/dist/runtime-node.d.mts +10040 -0
- package/dist/runtime-node.d.mts.map +1 -0
- package/dist/runtime-node.mjs +32 -0
- package/dist/runtime-node.mjs.map +1 -0
- package/dist/server.d.ts +12792 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +8475 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +8324 -0
- package/dist/server.mjs.map +1 -0
- package/dist/server2.mjs +505 -0
- package/dist/server2.mjs.map +1 -0
- package/package.json +124 -4
- package/src/admin/api/routes.ts +223 -0
- package/src/admin/api/security.ts +12 -0
- package/src/admin/audit/service.ts +138 -0
- package/src/admin/email/service.ts +140 -0
- package/src/admin/enrollment/email.ts +77 -0
- package/src/admin/enrollment/service.ts +308 -0
- package/src/admin/errors.ts +20 -0
- package/src/admin/index.ts +19 -0
- package/src/admin/list.ts +61 -0
- package/src/admin/operations/service.ts +70 -0
- package/src/admin/schema.ts +28 -0
- package/src/admin/users/service.ts +369 -0
- package/src/ai-relay/app.ts +251 -0
- package/src/ai-relay/config.ts +120 -0
- package/src/ai-relay/db/index.ts +10 -0
- package/src/ai-relay/db/migrate.ts +32 -0
- package/src/ai-relay/db/migrations/001_usage.ts +26 -0
- package/src/ai-relay/db/schema.ts +20 -0
- package/src/ai-relay/index.ts +18 -0
- package/src/ai-relay/metering.ts +68 -0
- package/src/ai-relay/usage.ts +115 -0
- package/src/client/ai.ts +96 -0
- package/src/client/api.ts +528 -0
- package/src/client/auth/client.ts +188 -0
- package/src/client/auth/failure.ts +54 -0
- package/src/client/auth/navigation.ts +45 -0
- package/src/client/device-authorization.ts +134 -0
- package/src/client/discovery.ts +105 -0
- package/src/client/images.ts +81 -0
- package/src/client/index.ts +53 -0
- package/src/client/portal/account.ts +183 -0
- package/src/client/portal/administration.ts +130 -0
- package/src/client/portal/client.ts +18 -0
- package/src/client/portal/request.ts +115 -0
- package/src/client/response.ts +51 -0
- package/src/client/workspaces.ts +142 -0
- package/src/contract/account.ts +204 -0
- package/src/contract/admin/index.ts +187 -0
- package/src/contract/ai.ts +150 -0
- package/src/contract/collaboration.ts +45 -0
- package/src/contract/discovery.ts +81 -0
- package/src/contract/documents.ts +265 -0
- package/src/contract/entitlements.ts +28 -0
- package/src/contract/index.ts +204 -0
- package/src/contract/links.ts +87 -0
- package/src/contract/portal.ts +11 -0
- package/src/contract/relay.ts +368 -0
- package/src/contract/sharing.ts +191 -0
- package/src/contract/versions.ts +87 -0
- package/src/contract/workspaces.ts +100 -0
- package/src/email/index.ts +14 -0
- package/src/email/render.ts +276 -0
- package/src/email/schema.ts +144 -0
- package/src/email/templates/brand.ts +105 -0
- package/src/email/templates/document-invitation.ts +35 -0
- package/src/email/templates/enrollment.ts +27 -0
- package/src/email/templates/layout.ts +18 -0
- package/src/runtime/cloudflare/email.ts +70 -0
- package/src/runtime/cloudflare/environment.ts +57 -0
- package/src/runtime/cloudflare/index.ts +3 -0
- package/src/runtime/cloudflare/relay.ts +136 -0
- package/src/runtime/cloudflare/site.ts +13 -0
- package/src/runtime/cloudflare/tsconfig.json +21 -0
- package/src/runtime/cloudflare/worker.ts +160 -0
- package/src/runtime/node/admin.ts +59 -0
- package/src/runtime/node/ai-relay/main.ts +35 -0
- package/src/runtime/node/ai-relay/server.ts +63 -0
- package/src/runtime/node/application.ts +50 -0
- package/src/runtime/node/bootstrap.ts +22 -0
- package/src/runtime/node/cleanup.ts +24 -0
- package/src/runtime/node/command.ts +17 -0
- package/src/runtime/node/config.ts +16 -0
- package/src/runtime/node/email/runtime.ts +43 -0
- package/src/runtime/node/email/transport.ts +112 -0
- package/src/runtime/node/entitlements/main.ts +41 -0
- package/src/runtime/node/entitlements/refusal.ts +15 -0
- package/src/runtime/node/index.ts +25 -0
- package/src/runtime/node/listen.ts +35 -0
- package/src/runtime/node/main.ts +29 -0
- package/src/runtime/node/migrate.ts +13 -0
- package/src/runtime/node/quota-reconcile.ts +9 -0
- package/src/runtime/node/relay.ts +54 -0
- package/src/runtime/node/server.ts +121 -0
- package/src/runtime/node/site.ts +64 -0
- package/src/runtime/postgres/database.ts +19 -0
- package/src/runtime/s3/objects.ts +244 -0
- package/src/runtime/site/server.ts +82 -0
- package/src/server/account/actions.ts +66 -0
- package/src/server/account/routes.ts +300 -0
- package/src/server/ai/errors.ts +7 -0
- package/src/server/ai/index.ts +4 -0
- package/src/server/ai/keys.ts +43 -0
- package/src/server/ai/routes.ts +43 -0
- package/src/server/ai/service.ts +70 -0
- package/src/server/api/index.ts +8 -0
- package/src/server/api/router.ts +117 -0
- package/src/server/api/types.ts +7 -0
- package/src/server/app.ts +375 -0
- package/src/server/auth/account.ts +73 -0
- package/src/server/auth/activity.ts +213 -0
- package/src/server/auth/adapter.ts +79 -0
- package/src/server/auth/email.ts +125 -0
- package/src/server/auth/endpoints.ts +57 -0
- package/src/server/auth/factory.ts +583 -0
- package/src/server/auth/index.ts +17 -0
- package/src/server/auth/mfa-assurance.ts +55 -0
- package/src/server/auth/runtime.ts +26 -0
- package/src/server/auth/session.ts +19 -0
- package/src/server/auth/social-providers.ts +55 -0
- package/src/server/auth/user-agent.ts +16 -0
- package/src/server/auth/workspace-access.ts +23 -0
- package/src/server/cleanup/configured.ts +38 -0
- package/src/server/cleanup/documents.ts +231 -0
- package/src/server/cleanup/index.ts +29 -0
- package/src/server/cleanup/objects.ts +27 -0
- package/src/server/cleanup/revisions.ts +232 -0
- package/src/server/cleanup/uploads.ts +129 -0
- package/src/server/cleanup/worker.ts +79 -0
- package/src/server/collaboration/index.ts +28 -0
- package/src/server/collaboration/relay/authorize.ts +53 -0
- package/src/server/collaboration/relay/awareness.ts +104 -0
- package/src/server/collaboration/relay/documents.ts +39 -0
- package/src/server/collaboration/relay/hub.ts +524 -0
- package/src/server/collaboration/relay/index.ts +15 -0
- package/src/server/collaboration/relay/persistence.ts +48 -0
- package/src/server/collaboration/routes.ts +77 -0
- package/src/server/collaboration/service.ts +188 -0
- package/src/server/config/deployment.ts +178 -0
- package/src/server/config/index.ts +20 -0
- package/src/server/config/limits.ts +8 -0
- package/src/server/config/public.ts +66 -0
- package/src/server/config/schema.ts +512 -0
- package/src/server/db/database.ts +15 -0
- package/src/server/db/expressions.ts +13 -0
- package/src/server/db/index.ts +21 -0
- package/src/server/db/migrate.ts +177 -0
- package/src/server/db/migrations/001_foundation.ts +164 -0
- package/src/server/db/migrations/002_upload_cleanup_claims.ts +34 -0
- package/src/server/db/migrations/003_document_cleanup_claims.ts +23 -0
- package/src/server/db/migrations/004_document_sharing.ts +82 -0
- package/src/server/db/migrations/005_document_collaboration_epoch.ts +13 -0
- package/src/server/db/migrations/006_invitation_continuation.ts +27 -0
- package/src/server/db/migrations/007_collaboration_state.ts +25 -0
- package/src/server/db/migrations/008_storage_reservations.ts +37 -0
- package/src/server/db/migrations/009_workspace_entitlements.ts +22 -0
- package/src/server/db/migrations/010_upload_finalization.ts +22 -0
- package/src/server/db/migrations/011_upload_finalization_lease.ts +12 -0
- package/src/server/db/migrations/012_transactional_email.ts +48 -0
- package/src/server/db/migrations/013_admin_enrollment.ts +54 -0
- package/src/server/db/migrations/014_enrollment_email_kinds.ts +30 -0
- package/src/server/db/migrations/015_cloud_rate_limit.ts +22 -0
- package/src/server/db/migrations/016_auth_schema.ts +16 -0
- package/src/server/db/migrations/017_authentication_email_kinds.ts +32 -0
- package/src/server/db/migrations/018_authentication_mfa.ts +78 -0
- package/src/server/db/migrations/019_better_auth_account_issuer.ts +42 -0
- package/src/server/db/migrations/020_workspace_invitations.ts +57 -0
- package/src/server/db/migrations/021_document_versions.ts +66 -0
- package/src/server/db/migrations/022_entitlement_external_version.ts +17 -0
- package/src/server/db/migrations/023_document_images.ts +61 -0
- package/src/server/db/migrations/024_account_activity.ts +66 -0
- package/src/server/db/migrations/025_table_names.ts +58 -0
- package/src/server/db/migrations/026_user_picture.ts +30 -0
- package/src/server/db/migrations/027_document_kind.ts +19 -0
- package/src/server/db/migrations/helpers.ts +78 -0
- package/src/server/db/tables.ts +394 -0
- package/src/server/documents/access.ts +103 -0
- package/src/server/documents/errors.ts +16 -0
- package/src/server/documents/images.ts +407 -0
- package/src/server/documents/index.ts +14 -0
- package/src/server/documents/limits.ts +57 -0
- package/src/server/documents/repository.ts +141 -0
- package/src/server/documents/routes.ts +239 -0
- package/src/server/documents/service.ts +597 -0
- package/src/server/documents/summary.ts +37 -0
- package/src/server/documents/types.ts +14 -0
- package/src/server/documents/versions/checkpoint.ts +98 -0
- package/src/server/documents/versions/history.ts +25 -0
- package/src/server/documents/versions/index.ts +4 -0
- package/src/server/documents/versions/routes.ts +112 -0
- package/src/server/documents/versions/service.ts +397 -0
- package/src/server/email/crypto.ts +57 -0
- package/src/server/email/index.ts +18 -0
- package/src/server/email/invitations.ts +30 -0
- package/src/server/email/service.ts +245 -0
- package/src/server/email/types.ts +56 -0
- package/src/server/email/worker.ts +33 -0
- package/src/server/index.ts +279 -0
- package/src/server/internal/index.ts +8 -0
- package/src/server/internal/routes.ts +41 -0
- package/src/server/internal/schema.ts +10 -0
- package/src/server/internal/service.ts +44 -0
- package/src/server/invitations/index.ts +6 -0
- package/src/server/invitations/types.ts +30 -0
- package/src/server/objects/index.ts +16 -0
- package/src/server/objects/types.ts +81 -0
- package/src/server/pictures/index.ts +9 -0
- package/src/server/pictures/provider.ts +61 -0
- package/src/server/pictures/routes.ts +21 -0
- package/src/server/pictures/service.ts +235 -0
- package/src/server/policy/configured.ts +23 -0
- package/src/server/policy/database.ts +108 -0
- package/src/server/policy/entitlements.ts +29 -0
- package/src/server/policy/index.ts +17 -0
- package/src/server/policy/keys.ts +23 -0
- package/src/server/policy/policy.ts +117 -0
- package/src/server/policy/provider.ts +67 -0
- package/src/server/policy/schema.ts +69 -0
- package/src/server/policy/service.ts +85 -0
- package/src/server/policy/static.ts +62 -0
- package/src/server/quota/index.ts +7 -0
- package/src/server/quota/reconcile.ts +61 -0
- package/src/server/quota/storage.ts +165 -0
- package/src/server/rate-limit/cleanup.ts +16 -0
- package/src/server/rate-limit/index.ts +12 -0
- package/src/server/rate-limit/keys.ts +38 -0
- package/src/server/rate-limit/middleware.ts +137 -0
- package/src/server/rate-limit/postgres.ts +79 -0
- package/src/server/sharing/access.ts +29 -0
- package/src/server/sharing/actor.ts +12 -0
- package/src/server/sharing/capabilities/service.ts +262 -0
- package/src/server/sharing/continuation.ts +85 -0
- package/src/server/sharing/contracts.ts +80 -0
- package/src/server/sharing/crypto.ts +48 -0
- package/src/server/sharing/document-routes.ts +41 -0
- package/src/server/sharing/errors.ts +12 -0
- package/src/server/sharing/grants/service.ts +79 -0
- package/src/server/sharing/http.ts +41 -0
- package/src/server/sharing/index.ts +39 -0
- package/src/server/sharing/invitations/service.ts +315 -0
- package/src/server/sharing/policy.ts +44 -0
- package/src/server/sharing/routes.ts +251 -0
- package/src/server/sharing/service.ts +117 -0
- package/src/server/validation.ts +24 -0
- package/src/server/worker/interval.ts +23 -0
- package/src/server/worker/periodic.ts +42 -0
- package/src/server/workspaces/index.ts +16 -0
- package/src/server/workspaces/members.ts +502 -0
- package/src/server/workspaces/repository.ts +91 -0
- package/src/server/workspaces/routes.ts +198 -0
- package/src/server/workspaces/service.ts +84 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1755 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import * as Y from "yjs";
|
|
3
|
+
//#region src/contract/account.d.ts
|
|
4
|
+
declare const cloudAccountStateSchema: v.PicklistSchema<["active", "pending", "rejected", "revoked"], undefined>;
|
|
5
|
+
declare const cloudIdentitySchema: v.ObjectSchema<{
|
|
6
|
+
readonly userId: v.StringSchema<undefined>;
|
|
7
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
8
|
+
readonly name: v.StringSchema<undefined>;
|
|
9
|
+
/** The account's picture, such as one a social provider gave it. */
|
|
10
|
+
readonly image: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
11
|
+
readonly deploymentRole: v.OptionalSchema<v.PicklistSchema<["user", "admin"], undefined>, undefined>;
|
|
12
|
+
}, undefined>;
|
|
13
|
+
declare const cloudAccountStatusResponseSchema: v.ObjectSchema<{
|
|
14
|
+
readonly user: v.ObjectSchema<{
|
|
15
|
+
readonly userId: v.StringSchema<undefined>;
|
|
16
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
17
|
+
readonly name: v.StringSchema<undefined>;
|
|
18
|
+
/** The account's picture, such as one a social provider gave it. */
|
|
19
|
+
readonly image: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
20
|
+
readonly deploymentRole: v.OptionalSchema<v.PicklistSchema<["user", "admin"], undefined>, undefined>;
|
|
21
|
+
}, undefined>;
|
|
22
|
+
readonly state: v.PicklistSchema<["active", "pending", "rejected", "revoked"], undefined>;
|
|
23
|
+
}, undefined>;
|
|
24
|
+
declare const cloudAuthenticationProviderSchema: v.PicklistSchema<["credential", "google", "apple"], undefined>;
|
|
25
|
+
declare const cloudAuthenticationMethodSchema: v.ObjectSchema<{
|
|
26
|
+
readonly id: v.StringSchema<undefined>;
|
|
27
|
+
readonly provider: v.PicklistSchema<["credential", "google", "apple"], undefined>;
|
|
28
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
29
|
+
readonly canUnlink: v.BooleanSchema<undefined>;
|
|
30
|
+
}, undefined>;
|
|
31
|
+
declare const cloudAuthenticationMethodsResponseSchema: v.ObjectSchema<{
|
|
32
|
+
readonly methods: v.ArraySchema<v.ObjectSchema<{
|
|
33
|
+
readonly id: v.StringSchema<undefined>;
|
|
34
|
+
readonly provider: v.PicklistSchema<["credential", "google", "apple"], undefined>;
|
|
35
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
36
|
+
readonly canUnlink: v.BooleanSchema<undefined>;
|
|
37
|
+
}, undefined>, undefined>;
|
|
38
|
+
readonly availableSocialProviders: v.ArraySchema<v.PicklistSchema<["google", "apple"], undefined>, undefined>;
|
|
39
|
+
}, undefined>;
|
|
40
|
+
declare const cloudPasswordChangeSchema: v.ObjectSchema<{
|
|
41
|
+
readonly currentPassword: v.StringSchema<undefined>;
|
|
42
|
+
readonly newPassword: v.StringSchema<undefined>;
|
|
43
|
+
}, undefined>;
|
|
44
|
+
declare const cloudSocialLinkSchema: v.ObjectSchema<{
|
|
45
|
+
readonly provider: v.PicklistSchema<["google", "apple"], undefined>;
|
|
46
|
+
readonly callbackURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
47
|
+
}, undefined>;
|
|
48
|
+
declare const cloudSocialLinkResponseSchema: v.ObjectSchema<{
|
|
49
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
50
|
+
}, undefined>;
|
|
51
|
+
declare const cloudUnlinkAuthenticationMethodSchema: v.ObjectSchema<{
|
|
52
|
+
readonly methodId: v.StringSchema<undefined>;
|
|
53
|
+
}, undefined>;
|
|
54
|
+
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>;
|
|
55
|
+
declare const accountSecurityErrorResponseSchema: v.ObjectSchema<{
|
|
56
|
+
readonly error: v.ObjectSchema<{
|
|
57
|
+
readonly code: 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>;
|
|
58
|
+
}, undefined>;
|
|
59
|
+
}, undefined>;
|
|
60
|
+
declare const cloudMFAStatusSchema: v.ObjectSchema<{
|
|
61
|
+
readonly required: v.BooleanSchema<undefined>;
|
|
62
|
+
readonly enabled: v.BooleanSchema<undefined>;
|
|
63
|
+
readonly totpEnabled: v.BooleanSchema<undefined>;
|
|
64
|
+
readonly assured: v.BooleanSchema<undefined>;
|
|
65
|
+
readonly totpAvailable: v.BooleanSchema<undefined>;
|
|
66
|
+
readonly passkeysAvailable: v.BooleanSchema<undefined>;
|
|
67
|
+
readonly recoveryCodesAvailable: v.BooleanSchema<undefined>;
|
|
68
|
+
}, undefined>;
|
|
69
|
+
declare const cloudMFAStatusResponseSchema: v.ObjectSchema<{
|
|
70
|
+
readonly mfa: v.ObjectSchema<{
|
|
71
|
+
readonly required: v.BooleanSchema<undefined>;
|
|
72
|
+
readonly enabled: v.BooleanSchema<undefined>;
|
|
73
|
+
readonly totpEnabled: v.BooleanSchema<undefined>;
|
|
74
|
+
readonly assured: v.BooleanSchema<undefined>;
|
|
75
|
+
readonly totpAvailable: v.BooleanSchema<undefined>;
|
|
76
|
+
readonly passkeysAvailable: v.BooleanSchema<undefined>;
|
|
77
|
+
readonly recoveryCodesAvailable: v.BooleanSchema<undefined>;
|
|
78
|
+
}, undefined>;
|
|
79
|
+
}, undefined>;
|
|
80
|
+
declare const cloudMFAEnableSchema: v.ObjectSchema<{
|
|
81
|
+
readonly password: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
82
|
+
}, undefined>;
|
|
83
|
+
declare const cloudMFAEnableResponseSchema: v.ObjectSchema<{
|
|
84
|
+
readonly totpURI: v.StringSchema<undefined>;
|
|
85
|
+
readonly backupCodes: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
86
|
+
}, undefined>;
|
|
87
|
+
declare const cloudMFAVerifySchema: v.ObjectSchema<{
|
|
88
|
+
readonly code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
89
|
+
}, undefined>;
|
|
90
|
+
declare const cloudMFAVerifyResponseSchema: v.ObjectSchema<{
|
|
91
|
+
readonly ok: v.LiteralSchema<true, undefined>;
|
|
92
|
+
}, undefined>;
|
|
93
|
+
declare const cloudMFARecoveryCodesResponseSchema: v.ObjectSchema<{
|
|
94
|
+
readonly backupCodes: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
95
|
+
}, undefined>;
|
|
96
|
+
declare const cloudPasskeySchema: v.ObjectSchema<{
|
|
97
|
+
readonly id: v.StringSchema<undefined>;
|
|
98
|
+
readonly name: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
99
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
100
|
+
}, undefined>;
|
|
101
|
+
declare const cloudPasskeysResponseSchema: v.ObjectSchema<{
|
|
102
|
+
readonly passkeys: v.ArraySchema<v.ObjectSchema<{
|
|
103
|
+
readonly id: v.StringSchema<undefined>;
|
|
104
|
+
readonly name: v.NullishSchema<v.StringSchema<undefined>, undefined>;
|
|
105
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
106
|
+
}, undefined>, undefined>;
|
|
107
|
+
}, undefined>;
|
|
108
|
+
declare const cloudPasskeyDeleteSchema: v.ObjectSchema<{
|
|
109
|
+
readonly id: v.StringSchema<undefined>;
|
|
110
|
+
}, undefined>;
|
|
111
|
+
declare function parseCloudMFAEnable(input: unknown): {
|
|
112
|
+
password?: string | undefined;
|
|
113
|
+
};
|
|
114
|
+
declare function parseCloudMFAVerify(input: unknown): {
|
|
115
|
+
code: string;
|
|
116
|
+
};
|
|
117
|
+
declare function parseCloudPasskeyDelete(input: unknown): {
|
|
118
|
+
id: string;
|
|
119
|
+
};
|
|
120
|
+
declare function parseCloudPasswordChange(input: unknown): {
|
|
121
|
+
currentPassword: string;
|
|
122
|
+
newPassword: string;
|
|
123
|
+
};
|
|
124
|
+
declare function parseCloudSocialLink(input: unknown): {
|
|
125
|
+
provider: "google" | "apple";
|
|
126
|
+
callbackURL: string;
|
|
127
|
+
};
|
|
128
|
+
declare function parseCloudUnlinkAuthenticationMethod(input: unknown): {
|
|
129
|
+
methodId: string;
|
|
130
|
+
};
|
|
131
|
+
declare const cloudAccountMutationResponseSchema: v.ObjectSchema<{
|
|
132
|
+
readonly ok: v.LiteralSchema<true, undefined>;
|
|
133
|
+
}, undefined>;
|
|
134
|
+
/** Who an account belongs to, as the portal shows it. */
|
|
135
|
+
declare const cloudPersonSchema: v.ObjectSchema<{
|
|
136
|
+
readonly id: v.StringSchema<undefined>;
|
|
137
|
+
readonly name: v.StringSchema<undefined>;
|
|
138
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
139
|
+
/** The address of the account's picture, which the server serves; null shows initials. */
|
|
140
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
141
|
+
}, undefined>;
|
|
142
|
+
/** What a person can see and change about themselves. */
|
|
143
|
+
declare const cloudProfileSchema: v.ObjectSchema<{
|
|
144
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
145
|
+
/** Whether the server can send the verification a new email address needs. */
|
|
146
|
+
readonly emailChangeAvailable: v.BooleanSchema<undefined>;
|
|
147
|
+
readonly id: v.StringSchema<undefined>;
|
|
148
|
+
readonly name: v.StringSchema<undefined>;
|
|
149
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
150
|
+
/** The address of the account's picture, which the server serves; null shows initials. */
|
|
151
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
152
|
+
}, undefined>;
|
|
153
|
+
declare const cloudProfileResponseSchema: v.ObjectSchema<{
|
|
154
|
+
readonly profile: v.ObjectSchema<{
|
|
155
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
156
|
+
/** Whether the server can send the verification a new email address needs. */
|
|
157
|
+
readonly emailChangeAvailable: v.BooleanSchema<undefined>;
|
|
158
|
+
readonly id: v.StringSchema<undefined>;
|
|
159
|
+
readonly name: v.StringSchema<undefined>;
|
|
160
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
161
|
+
/** The address of the account's picture, which the server serves; null shows initials. */
|
|
162
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
163
|
+
}, undefined>;
|
|
164
|
+
}, undefined>;
|
|
165
|
+
declare const cloudProfileUpdateSchema: v.ObjectSchema<{
|
|
166
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
167
|
+
}, undefined>;
|
|
168
|
+
/** The largest picture an account may upload, once the page has cropped and shrunk it. */
|
|
169
|
+
declare const CLOUD_PICTURE_MAX_BYTES: number;
|
|
170
|
+
/** The width and height a page shrinks a picture to before it uploads it. */
|
|
171
|
+
declare const CLOUD_PICTURE_SIZE = 256;
|
|
172
|
+
declare const cloudPictureUploadSchema: v.ObjectSchema<{
|
|
173
|
+
/** The picture's PNG or JPEG bytes, in Base64. */
|
|
174
|
+
readonly data: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>, v.CheckAction<string, undefined>]>;
|
|
175
|
+
}, undefined>;
|
|
176
|
+
/** The address the account's picture is now served from. */
|
|
177
|
+
declare const cloudPictureResponseSchema: v.ObjectSchema<{
|
|
178
|
+
readonly image: v.StringSchema<undefined>;
|
|
179
|
+
}, undefined>;
|
|
180
|
+
declare const cloudEmailChangeSchema: v.ObjectSchema<{
|
|
181
|
+
readonly newEmail: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
|
|
182
|
+
readonly callbackURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
183
|
+
}, undefined>;
|
|
184
|
+
/** How a sign-in was made: the method it used, or the desktop app's approved code. */
|
|
185
|
+
declare const cloudSignInMethodSchema: v.PicklistSchema<["password", "google", "apple", "passkey", "two-step", "email-link", "desktop", "other"], undefined>;
|
|
186
|
+
declare const cloudAccountSessionSchema: v.ObjectSchema<{
|
|
187
|
+
readonly id: v.StringSchema<undefined>;
|
|
188
|
+
/** The session this request was made with. */
|
|
189
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
190
|
+
readonly method: v.NullableSchema<v.PicklistSchema<["password", "google", "apple", "passkey", "two-step", "email-link", "desktop", "other"], undefined>, undefined>;
|
|
191
|
+
readonly ipAddress: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
192
|
+
/** The browser and system the server read from the client's user agent, such as `Chrome 141`. */
|
|
193
|
+
readonly browser: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
194
|
+
readonly system: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
195
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
196
|
+
readonly lastActiveAt: v.StringSchema<undefined>;
|
|
197
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
198
|
+
}, undefined>;
|
|
199
|
+
declare const cloudAccountSessionsResponseSchema: v.ObjectSchema<{
|
|
200
|
+
readonly sessions: v.ArraySchema<v.ObjectSchema<{
|
|
201
|
+
readonly id: v.StringSchema<undefined>;
|
|
202
|
+
/** The session this request was made with. */
|
|
203
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
204
|
+
readonly method: v.NullableSchema<v.PicklistSchema<["password", "google", "apple", "passkey", "two-step", "email-link", "desktop", "other"], undefined>, undefined>;
|
|
205
|
+
readonly ipAddress: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
206
|
+
/** The browser and system the server read from the client's user agent, such as `Chrome 141`. */
|
|
207
|
+
readonly browser: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
208
|
+
readonly system: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
209
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
210
|
+
readonly lastActiveAt: v.StringSchema<undefined>;
|
|
211
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
212
|
+
}, undefined>, undefined>;
|
|
213
|
+
}, undefined>;
|
|
214
|
+
declare const cloudSessionRevokeSchema: v.ObjectSchema<{
|
|
215
|
+
readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
216
|
+
}, undefined>;
|
|
217
|
+
declare const cloudSignInSchema: v.ObjectSchema<{
|
|
218
|
+
readonly id: v.StringSchema<undefined>;
|
|
219
|
+
readonly method: v.PicklistSchema<["password", "google", "apple", "passkey", "two-step", "email-link", "desktop", "other"], undefined>;
|
|
220
|
+
readonly ipAddress: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
221
|
+
/** The browser and system the server read from the client's user agent, such as `Chrome 141`. */
|
|
222
|
+
readonly browser: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
223
|
+
readonly system: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
224
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
225
|
+
}, undefined>;
|
|
226
|
+
declare const cloudSignInsResponseSchema: v.ObjectSchema<{
|
|
227
|
+
readonly signIns: v.ArraySchema<v.ObjectSchema<{
|
|
228
|
+
readonly id: v.StringSchema<undefined>;
|
|
229
|
+
readonly method: v.PicklistSchema<["password", "google", "apple", "passkey", "two-step", "email-link", "desktop", "other"], undefined>;
|
|
230
|
+
readonly ipAddress: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
231
|
+
/** The browser and system the server read from the client's user agent, such as `Chrome 141`. */
|
|
232
|
+
readonly browser: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
233
|
+
readonly system: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
234
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
235
|
+
}, undefined>, undefined>;
|
|
236
|
+
}, undefined>;
|
|
237
|
+
declare function parseCloudProfileUpdate(input: unknown): {
|
|
238
|
+
name: string;
|
|
239
|
+
};
|
|
240
|
+
declare function parseCloudPictureUpload(input: unknown): {
|
|
241
|
+
data: string;
|
|
242
|
+
};
|
|
243
|
+
declare function parseCloudEmailChange(input: unknown): {
|
|
244
|
+
newEmail: string;
|
|
245
|
+
callbackURL: string;
|
|
246
|
+
};
|
|
247
|
+
declare function parseCloudSessionRevoke(input: unknown): {
|
|
248
|
+
sessionId: string;
|
|
249
|
+
};
|
|
250
|
+
type AccountSecurityErrorCode = v.InferOutput<typeof accountSecurityErrorCodeSchema>;
|
|
251
|
+
type CloudAuthenticationProvider = v.InferOutput<typeof cloudAuthenticationProviderSchema>;
|
|
252
|
+
type CloudAuthenticationMethod = v.InferOutput<typeof cloudAuthenticationMethodSchema>;
|
|
253
|
+
type CloudAuthenticationMethods = v.InferOutput<typeof cloudAuthenticationMethodsResponseSchema>;
|
|
254
|
+
type CloudAccountStatus = v.InferOutput<typeof cloudAccountStatusResponseSchema>;
|
|
255
|
+
type CloudProfile = v.InferOutput<typeof cloudProfileSchema>;
|
|
256
|
+
type CloudSignInMethod = v.InferOutput<typeof cloudSignInMethodSchema>;
|
|
257
|
+
type CloudAccountSession = v.InferOutput<typeof cloudAccountSessionSchema>;
|
|
258
|
+
type CloudSignIn = v.InferOutput<typeof cloudSignInSchema>;
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/contract/ai.d.ts
|
|
261
|
+
/**
|
|
262
|
+
* The contract between editors, Cloud, and an AI service. Cloud only advertises the service and
|
|
263
|
+
* signs short-lived tokens for it; the service, official or self-hosted, proxies models and keeps
|
|
264
|
+
* the credit wallet. It is versioned apart from the Cloud protocol so a service can change without
|
|
265
|
+
* a Cloud release.
|
|
266
|
+
*/
|
|
267
|
+
declare const CLOUD_AI_CONTRACT_VERSION: "1";
|
|
268
|
+
/** The `aud` of every token Cloud signs for an AI service. */
|
|
269
|
+
declare const CLOUD_AI_TOKEN_AUDIENCE: "openpencil-ai";
|
|
270
|
+
/** Where Cloud publishes the public keys an AI service verifies its tokens with. */
|
|
271
|
+
declare const CLOUD_AI_JWKS_PATH: "/.well-known/jwks.json";
|
|
272
|
+
/**
|
|
273
|
+
* Where a service answers, below the discovered `endpoint`. Model requests follow the OpenAI chat
|
|
274
|
+
* completions API, so an OpenAI-compatible client takes `${endpoint}${base}` as its base URL.
|
|
275
|
+
*/
|
|
276
|
+
declare const CLOUD_AI_API_PATHS: {
|
|
277
|
+
readonly base: "/v1";
|
|
278
|
+
readonly chatCompletions: "/v1/chat/completions";
|
|
279
|
+
readonly catalog: "/v1/catalog";
|
|
280
|
+
readonly wallet: "/v1/wallet";
|
|
281
|
+
readonly usage: "/v1/usage";
|
|
282
|
+
};
|
|
283
|
+
declare const cloudAIDiscoverySchema: v.ObjectSchema<{
|
|
284
|
+
readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
285
|
+
readonly contractVersion: v.LiteralSchema<"1", undefined>;
|
|
286
|
+
}, undefined>;
|
|
287
|
+
type CloudAIDiscovery = v.InferOutput<typeof cloudAIDiscoverySchema>;
|
|
288
|
+
declare const cloudBillingDiscoverySchema: v.ObjectSchema<{
|
|
289
|
+
readonly portalURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
290
|
+
}, undefined>;
|
|
291
|
+
type CloudBillingDiscovery = v.InferOutput<typeof cloudBillingDiscoverySchema>;
|
|
292
|
+
declare const createAITokenSchema: v.ObjectSchema<{
|
|
293
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
294
|
+
}, undefined>;
|
|
295
|
+
type CreateAITokenInput = v.InferOutput<typeof createAITokenSchema>;
|
|
296
|
+
declare function parseCreateAIToken(input: unknown): CreateAITokenInput;
|
|
297
|
+
declare const aiTokenSchema: v.ObjectSchema<{
|
|
298
|
+
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
299
|
+
readonly expiresAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
300
|
+
}, undefined>;
|
|
301
|
+
type AIToken = v.InferOutput<typeof aiTokenSchema>;
|
|
302
|
+
/** What an AI service may rely on once a token's signature, issuer, audience, and expiry check. */
|
|
303
|
+
declare const aiTokenClaimsSchema: v.ObjectSchema<{
|
|
304
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
305
|
+
readonly aud: v.LiteralSchema<"openpencil-ai", undefined>;
|
|
306
|
+
readonly sub: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
307
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
308
|
+
/** Credits the workspace's plan grants each month; `null` when Cloud sets no allowance. */
|
|
309
|
+
readonly monthlyCreditAllowance: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
310
|
+
readonly iat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
311
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
312
|
+
}, undefined>;
|
|
313
|
+
type AITokenClaims = v.InferOutput<typeof aiTokenClaimsSchema>;
|
|
314
|
+
declare const aiModelSchema: v.ObjectSchema<{
|
|
315
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
316
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
317
|
+
/** Credits per million input and output tokens. */
|
|
318
|
+
readonly creditsPerMillionInputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
319
|
+
readonly creditsPerMillionOutputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
320
|
+
readonly contextTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
321
|
+
readonly capabilities: v.ObjectSchema<{
|
|
322
|
+
readonly reasoning: v.BooleanSchema<undefined>;
|
|
323
|
+
readonly vision: v.BooleanSchema<undefined>;
|
|
324
|
+
readonly tools: v.BooleanSchema<undefined>;
|
|
325
|
+
}, undefined>;
|
|
326
|
+
}, undefined>;
|
|
327
|
+
type AIModel = v.InferOutput<typeof aiModelSchema>;
|
|
328
|
+
declare const aiCatalogSchema: v.ObjectSchema<{
|
|
329
|
+
readonly models: v.ArraySchema<v.ObjectSchema<{
|
|
330
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
331
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
332
|
+
/** Credits per million input and output tokens. */
|
|
333
|
+
readonly creditsPerMillionInputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
334
|
+
readonly creditsPerMillionOutputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
335
|
+
readonly contextTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
336
|
+
readonly capabilities: v.ObjectSchema<{
|
|
337
|
+
readonly reasoning: v.BooleanSchema<undefined>;
|
|
338
|
+
readonly vision: v.BooleanSchema<undefined>;
|
|
339
|
+
readonly tools: v.BooleanSchema<undefined>;
|
|
340
|
+
}, undefined>;
|
|
341
|
+
}, undefined>, undefined>;
|
|
342
|
+
readonly defaultModelID: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
343
|
+
}, undefined>;
|
|
344
|
+
type AICatalog = v.InferOutput<typeof aiCatalogSchema>;
|
|
345
|
+
declare const aiCreditBucketSchema: v.ObjectSchema<{
|
|
346
|
+
readonly kind: v.PicklistSchema<["allowance", "purchased", "grant"], undefined>;
|
|
347
|
+
readonly remaining: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
348
|
+
readonly expiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
349
|
+
}, undefined>;
|
|
350
|
+
type AICreditBucket = v.InferOutput<typeof aiCreditBucketSchema>;
|
|
351
|
+
/**
|
|
352
|
+
* A service records a request's charge before the request's answer ends, so a wallet read after
|
|
353
|
+
* an answer includes what it cost.
|
|
354
|
+
*/
|
|
355
|
+
declare const aiWalletSchema: v.ObjectSchema<{
|
|
356
|
+
/** Credits left to spend; `null` when the service sets no limit. */
|
|
357
|
+
readonly balance: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
358
|
+
/** Spent first to last. */
|
|
359
|
+
readonly buckets: v.ArraySchema<v.ObjectSchema<{
|
|
360
|
+
readonly kind: v.PicklistSchema<["allowance", "purchased", "grant"], undefined>;
|
|
361
|
+
readonly remaining: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
362
|
+
readonly expiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
363
|
+
}, undefined>, undefined>;
|
|
364
|
+
}, undefined>;
|
|
365
|
+
type AIWallet = v.InferOutput<typeof aiWalletSchema>;
|
|
366
|
+
declare const aiUsageEntrySchema: v.ObjectSchema<{
|
|
367
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
368
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
369
|
+
readonly kind: v.PicklistSchema<["model", "image", "search"], undefined>;
|
|
370
|
+
readonly modelID: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
371
|
+
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
372
|
+
readonly credits: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
373
|
+
}, undefined>;
|
|
374
|
+
type AIUsageEntry = v.InferOutput<typeof aiUsageEntrySchema>;
|
|
375
|
+
declare const aiUsageQuerySchema: v.ObjectSchema<{
|
|
376
|
+
readonly cursor: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
377
|
+
}, undefined>;
|
|
378
|
+
type AIUsageQuery = v.InferOutput<typeof aiUsageQuerySchema>;
|
|
379
|
+
declare function parseAIUsageQuery(input: unknown): AIUsageQuery;
|
|
380
|
+
declare const aiUsagePageSchema: v.ObjectSchema<{
|
|
381
|
+
readonly entries: v.ArraySchema<v.ObjectSchema<{
|
|
382
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
383
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
384
|
+
readonly kind: v.PicklistSchema<["model", "image", "search"], undefined>;
|
|
385
|
+
readonly modelID: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
386
|
+
readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
387
|
+
readonly credits: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
388
|
+
}, undefined>, undefined>;
|
|
389
|
+
readonly next: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
390
|
+
}, undefined>;
|
|
391
|
+
type AIUsagePage = v.InferOutput<typeof aiUsagePageSchema>;
|
|
392
|
+
/** Errors an AI service answers with, beside the upstream model's own. */
|
|
393
|
+
declare const aiErrorCodeSchema: v.PicklistSchema<["unauthorized", "insufficient_credits", "model_not_allowed", "rate_limited"], undefined>;
|
|
394
|
+
type AIErrorCode = v.InferOutput<typeof aiErrorCodeSchema>;
|
|
395
|
+
declare const aiErrorSchema: v.ObjectSchema<{
|
|
396
|
+
readonly error: v.ObjectSchema<{
|
|
397
|
+
readonly code: v.PicklistSchema<["unauthorized", "insufficient_credits", "model_not_allowed", "rate_limited"], undefined>;
|
|
398
|
+
readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
399
|
+
/** With `insufficient_credits`: when the workspace's allowance renews, if the service knows. */
|
|
400
|
+
readonly resetsAt: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
401
|
+
}, undefined>;
|
|
402
|
+
}, undefined>;
|
|
403
|
+
type AIError = v.InferOutput<typeof aiErrorSchema>;
|
|
404
|
+
declare const AI_ERROR_STATUS: {
|
|
405
|
+
readonly unauthorized: 401;
|
|
406
|
+
readonly insufficient_credits: 402;
|
|
407
|
+
readonly model_not_allowed: 403;
|
|
408
|
+
readonly rate_limited: 429;
|
|
409
|
+
};
|
|
410
|
+
//#endregion
|
|
411
|
+
//#region src/contract/admin/index.d.ts
|
|
412
|
+
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>;
|
|
413
|
+
declare const adminErrorResponseSchema: v.ObjectSchema<{
|
|
414
|
+
readonly error: v.ObjectSchema<{
|
|
415
|
+
readonly code: 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>;
|
|
416
|
+
}, undefined>;
|
|
417
|
+
}, undefined>;
|
|
418
|
+
declare const enrollmentStatusSchema: v.PicklistSchema<["pending", "approved", "rejected", "revoked"], undefined>;
|
|
419
|
+
declare const enrollmentSchema: v.ObjectSchema<{
|
|
420
|
+
readonly id: v.StringSchema<undefined>;
|
|
421
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
422
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
423
|
+
readonly reason: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
424
|
+
readonly status: v.PicklistSchema<["pending", "approved", "rejected", "revoked"], undefined>;
|
|
425
|
+
readonly requestedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
426
|
+
readonly reviewedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
427
|
+
readonly reviewedBy: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
428
|
+
/** The reviewer's name, in lists, while the server still knows them. */
|
|
429
|
+
readonly reviewerName: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
430
|
+
readonly reviewNote: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
431
|
+
readonly approvedUserId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
432
|
+
readonly requestRevision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
433
|
+
}, undefined>;
|
|
434
|
+
declare const enrollmentsResponseSchema: v.ObjectSchema<{
|
|
435
|
+
readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
436
|
+
readonly counts: v.ObjectSchema<Record<"pending" | "rejected" | "revoked" | "approved", v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>, undefined>;
|
|
437
|
+
readonly enrollments: v.ArraySchema<v.ObjectSchema<{
|
|
438
|
+
readonly id: v.StringSchema<undefined>;
|
|
439
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
440
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
441
|
+
readonly reason: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
442
|
+
readonly status: v.PicklistSchema<["pending", "approved", "rejected", "revoked"], undefined>;
|
|
443
|
+
readonly requestedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
444
|
+
readonly reviewedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
445
|
+
readonly reviewedBy: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
446
|
+
/** The reviewer's name, in lists, while the server still knows them. */
|
|
447
|
+
readonly reviewerName: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
448
|
+
readonly reviewNote: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
449
|
+
readonly approvedUserId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
450
|
+
readonly requestRevision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
451
|
+
}, undefined>, undefined>;
|
|
452
|
+
}, undefined>;
|
|
453
|
+
declare const enrollmentReviewResponseSchema: v.ObjectSchema<{
|
|
454
|
+
readonly enrollment: v.ObjectSchema<{
|
|
455
|
+
readonly id: v.StringSchema<undefined>;
|
|
456
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
457
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
458
|
+
readonly reason: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
459
|
+
readonly status: v.PicklistSchema<["pending", "approved", "rejected", "revoked"], undefined>;
|
|
460
|
+
readonly requestedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
461
|
+
readonly reviewedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
462
|
+
readonly reviewedBy: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
463
|
+
/** The reviewer's name, in lists, while the server still knows them. */
|
|
464
|
+
readonly reviewerName: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
465
|
+
readonly reviewNote: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
466
|
+
readonly approvedUserId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
467
|
+
readonly requestRevision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
468
|
+
}, undefined>;
|
|
469
|
+
}, undefined>;
|
|
470
|
+
declare const cloudAdminSessionResponseSchema: v.ObjectSchema<{
|
|
471
|
+
readonly user: v.ObjectSchema<{
|
|
472
|
+
readonly userId: v.StringSchema<undefined>;
|
|
473
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
474
|
+
readonly name: v.StringSchema<undefined>;
|
|
475
|
+
readonly image: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
476
|
+
readonly deploymentRole: v.OptionalSchema<v.PicklistSchema<["user", "admin"], undefined>, undefined>;
|
|
477
|
+
}, undefined>;
|
|
478
|
+
}, undefined>;
|
|
479
|
+
declare const cloudAdminUserSchema: v.ObjectSchema<{
|
|
480
|
+
readonly role: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
481
|
+
readonly banned: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
482
|
+
readonly banReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
483
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
484
|
+
/** An authenticator app or a passkey confirms this account's sign-ins. */
|
|
485
|
+
readonly twoStep: v.BooleanSchema<undefined>;
|
|
486
|
+
/** When one of the account's sessions was last used, or null when none is left. */
|
|
487
|
+
readonly lastActiveAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
488
|
+
readonly workspaceCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
489
|
+
readonly id: v.StringSchema<undefined>;
|
|
490
|
+
readonly name: v.StringSchema<undefined>;
|
|
491
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
492
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
493
|
+
}, undefined>;
|
|
494
|
+
/** Which accounts a list of people shows. */
|
|
495
|
+
declare const cloudAdminUserFilterSchema: v.PicklistSchema<["all", "administrators", "suspended", "without-two-step"], undefined>;
|
|
496
|
+
declare const cloudAdminUsersResponseSchema: v.ObjectSchema<{
|
|
497
|
+
readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
498
|
+
readonly counts: v.ObjectSchema<Record<"all" | "administrators" | "suspended" | "without-two-step", v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>, undefined>;
|
|
499
|
+
readonly users: v.ArraySchema<v.ObjectSchema<{
|
|
500
|
+
readonly role: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
501
|
+
readonly banned: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
502
|
+
readonly banReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
503
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
504
|
+
/** An authenticator app or a passkey confirms this account's sign-ins. */
|
|
505
|
+
readonly twoStep: v.BooleanSchema<undefined>;
|
|
506
|
+
/** When one of the account's sessions was last used, or null when none is left. */
|
|
507
|
+
readonly lastActiveAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
508
|
+
readonly workspaceCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
509
|
+
readonly id: v.StringSchema<undefined>;
|
|
510
|
+
readonly name: v.StringSchema<undefined>;
|
|
511
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
512
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
513
|
+
}, undefined>, undefined>;
|
|
514
|
+
}, undefined>;
|
|
515
|
+
declare const cloudAdminUserDetailSchema: v.ObjectSchema<{
|
|
516
|
+
readonly user: v.ObjectSchema<{
|
|
517
|
+
readonly emailVerified: v.BooleanSchema<undefined>;
|
|
518
|
+
readonly role: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
519
|
+
readonly banned: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
|
|
520
|
+
readonly banReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
521
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
522
|
+
/** An authenticator app or a passkey confirms this account's sign-ins. */
|
|
523
|
+
readonly twoStep: v.BooleanSchema<undefined>;
|
|
524
|
+
/** When one of the account's sessions was last used, or null when none is left. */
|
|
525
|
+
readonly lastActiveAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
526
|
+
readonly workspaceCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
527
|
+
readonly id: v.StringSchema<undefined>;
|
|
528
|
+
readonly name: v.StringSchema<undefined>;
|
|
529
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
530
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
531
|
+
}, undefined>;
|
|
532
|
+
readonly methods: v.ArraySchema<v.ObjectSchema<{
|
|
533
|
+
readonly provider: v.StringSchema<undefined>;
|
|
534
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
535
|
+
}, undefined>, undefined>;
|
|
536
|
+
readonly authenticator: v.BooleanSchema<undefined>;
|
|
537
|
+
readonly passkeyCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
538
|
+
readonly sessions: v.ArraySchema<v.ObjectSchema<{
|
|
539
|
+
readonly id: v.StringSchema<undefined>;
|
|
540
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
541
|
+
readonly method: v.NullableSchema<v.PicklistSchema<["password", "google", "apple", "passkey", "two-step", "email-link", "desktop", "other"], undefined>, undefined>;
|
|
542
|
+
readonly ipAddress: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
543
|
+
readonly browser: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
544
|
+
readonly system: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
545
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
546
|
+
readonly lastActiveAt: v.StringSchema<undefined>;
|
|
547
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
548
|
+
}, undefined>, undefined>;
|
|
549
|
+
readonly signIns: v.ArraySchema<v.ObjectSchema<{
|
|
550
|
+
readonly id: v.StringSchema<undefined>;
|
|
551
|
+
readonly method: v.PicklistSchema<["password", "google", "apple", "passkey", "two-step", "email-link", "desktop", "other"], undefined>;
|
|
552
|
+
readonly ipAddress: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
553
|
+
readonly browser: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
554
|
+
readonly system: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
555
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
556
|
+
}, undefined>, undefined>;
|
|
557
|
+
readonly workspaces: v.ArraySchema<v.ObjectSchema<{
|
|
558
|
+
readonly id: v.StringSchema<undefined>;
|
|
559
|
+
readonly name: v.StringSchema<undefined>;
|
|
560
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
561
|
+
readonly memberCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
562
|
+
readonly joinedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
563
|
+
}, undefined>, undefined>;
|
|
564
|
+
}, undefined>;
|
|
565
|
+
declare const adminMutationResponseSchema: v.ObjectSchema<{
|
|
566
|
+
readonly ok: v.LiteralSchema<true, undefined>;
|
|
567
|
+
}, undefined>;
|
|
568
|
+
declare const transactionalEmailAdminSchema: v.ObjectSchema<{
|
|
569
|
+
readonly id: v.StringSchema<undefined>;
|
|
570
|
+
readonly kind: v.StringSchema<undefined>;
|
|
571
|
+
readonly recipientEmailNormalized: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
572
|
+
readonly status: v.StringSchema<undefined>;
|
|
573
|
+
readonly attemptCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
574
|
+
readonly nextAttemptAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
575
|
+
readonly transport: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
576
|
+
readonly transportMessageId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
577
|
+
readonly lastErrorCode: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
578
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
579
|
+
readonly acceptedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
580
|
+
readonly regeneratable: v.BooleanSchema<undefined>;
|
|
581
|
+
}, undefined>;
|
|
582
|
+
/** Which messages a list of email shows, by how their delivery went. */
|
|
583
|
+
declare const cloudAdminEmailFilterSchema: v.PicklistSchema<["all", "sent", "waiting", "failed"], undefined>;
|
|
584
|
+
declare const adminEmailResponseSchema: v.ObjectSchema<{
|
|
585
|
+
readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
586
|
+
readonly counts: v.ObjectSchema<Record<"all" | "sent" | "waiting" | "failed", v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>, undefined>;
|
|
587
|
+
readonly messages: v.ArraySchema<v.ObjectSchema<{
|
|
588
|
+
readonly id: v.StringSchema<undefined>;
|
|
589
|
+
readonly kind: v.StringSchema<undefined>;
|
|
590
|
+
readonly recipientEmailNormalized: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
591
|
+
readonly status: v.StringSchema<undefined>;
|
|
592
|
+
readonly attemptCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
593
|
+
readonly nextAttemptAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
594
|
+
readonly transport: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
595
|
+
readonly transportMessageId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
596
|
+
readonly lastErrorCode: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
597
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
598
|
+
readonly acceptedAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
599
|
+
readonly regeneratable: v.BooleanSchema<undefined>;
|
|
600
|
+
}, undefined>, undefined>;
|
|
601
|
+
}, undefined>;
|
|
602
|
+
declare const adminAuditEventSchema: v.ObjectSchema<{
|
|
603
|
+
readonly id: v.StringSchema<undefined>;
|
|
604
|
+
readonly actor: v.ObjectSchema<{
|
|
605
|
+
readonly id: v.StringSchema<undefined>;
|
|
606
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
607
|
+
}, undefined>;
|
|
608
|
+
readonly action: v.StringSchema<undefined>;
|
|
609
|
+
/** What the event is about: an account, an access request, or an email. */
|
|
610
|
+
readonly subject: v.ObjectSchema<{
|
|
611
|
+
readonly type: v.StringSchema<undefined>;
|
|
612
|
+
readonly id: v.StringSchema<undefined>;
|
|
613
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
614
|
+
}, undefined>;
|
|
615
|
+
readonly metadata: v.UnknownSchema;
|
|
616
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
617
|
+
}, undefined>;
|
|
618
|
+
/** Which events a list of activity shows, by what they are about. */
|
|
619
|
+
declare const cloudAdminAuditFilterSchema: v.PicklistSchema<["all", "accounts", "requests", "email"], undefined>;
|
|
620
|
+
declare const adminAuditResponseSchema: v.ObjectSchema<{
|
|
621
|
+
readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
622
|
+
readonly counts: v.ObjectSchema<Record<"email" | "all" | "accounts" | "requests", v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>, undefined>;
|
|
623
|
+
readonly events: v.ArraySchema<v.ObjectSchema<{
|
|
624
|
+
readonly id: v.StringSchema<undefined>;
|
|
625
|
+
readonly actor: v.ObjectSchema<{
|
|
626
|
+
readonly id: v.StringSchema<undefined>;
|
|
627
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
628
|
+
}, undefined>;
|
|
629
|
+
readonly action: v.StringSchema<undefined>;
|
|
630
|
+
/** What the event is about: an account, an access request, or an email. */
|
|
631
|
+
readonly subject: v.ObjectSchema<{
|
|
632
|
+
readonly type: v.StringSchema<undefined>;
|
|
633
|
+
readonly id: v.StringSchema<undefined>;
|
|
634
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
635
|
+
}, undefined>;
|
|
636
|
+
readonly metadata: v.UnknownSchema;
|
|
637
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
638
|
+
}, undefined>, undefined>;
|
|
639
|
+
}, undefined>;
|
|
640
|
+
declare const adminOperationsResponseSchema: v.ObjectSchema<{
|
|
641
|
+
readonly deployment: v.PicklistSchema<["official", "self-hosted"], undefined>;
|
|
642
|
+
readonly enrollmentMode: v.PicklistSchema<["open", "approval", "closed"], undefined>;
|
|
643
|
+
readonly emailTransport: v.PicklistSchema<["none", "smtp", "cloudflare"], undefined>;
|
|
644
|
+
readonly pendingEnrollment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
645
|
+
readonly pendingEmail: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
646
|
+
readonly failedEmail: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
647
|
+
readonly accounts: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
648
|
+
readonly workspaces: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
649
|
+
readonly documents: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
650
|
+
readonly storedBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
651
|
+
}, undefined>;
|
|
652
|
+
type AdminErrorCode = v.InferOutput<typeof adminErrorCodeSchema>;
|
|
653
|
+
type Enrollment = v.InferOutput<typeof enrollmentSchema>;
|
|
654
|
+
type CloudAdminSessionResponse = v.InferOutput<typeof cloudAdminSessionResponseSchema>;
|
|
655
|
+
type CloudAdminUser = v.InferOutput<typeof cloudAdminUserSchema>;
|
|
656
|
+
type CloudAdminUserFilter = v.InferOutput<typeof cloudAdminUserFilterSchema>;
|
|
657
|
+
type CloudAdminEmailFilter = v.InferOutput<typeof cloudAdminEmailFilterSchema>;
|
|
658
|
+
type CloudAdminAuditFilter = v.InferOutput<typeof cloudAdminAuditFilterSchema>;
|
|
659
|
+
type EnrollmentStatus = v.InferOutput<typeof enrollmentStatusSchema>;
|
|
660
|
+
type CloudAdminUsers = v.InferOutput<typeof cloudAdminUsersResponseSchema>;
|
|
661
|
+
type CloudAdminUserDetail = v.InferOutput<typeof cloudAdminUserDetailSchema>;
|
|
662
|
+
type TransactionalEmailAdmin = v.InferOutput<typeof transactionalEmailAdminSchema>;
|
|
663
|
+
type AdminAuditEvent = v.InferOutput<typeof adminAuditEventSchema>;
|
|
664
|
+
type AdminOperations = v.InferOutput<typeof adminOperationsResponseSchema>;
|
|
665
|
+
//#endregion
|
|
666
|
+
//#region src/contract/collaboration.d.ts
|
|
667
|
+
declare const collaborationPrincipalSchema: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
668
|
+
readonly kind: v.LiteralSchema<"user", undefined>;
|
|
669
|
+
readonly userId: v.StringSchema<undefined>;
|
|
670
|
+
readonly name: v.StringSchema<undefined>;
|
|
671
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
672
|
+
}, undefined>, v.ObjectSchema<{
|
|
673
|
+
readonly kind: v.LiteralSchema<"guest", undefined>;
|
|
674
|
+
readonly guestId: v.StringSchema<undefined>;
|
|
675
|
+
readonly name: v.StringSchema<undefined>;
|
|
676
|
+
}, undefined>], undefined>;
|
|
677
|
+
type CollaborationPrincipal = v.InferOutput<typeof collaborationPrincipalSchema>;
|
|
678
|
+
/**
|
|
679
|
+
* Who the relay verified a peer to be, as it writes into that peer's presence under `cloud`, so
|
|
680
|
+
* other peers can trust it over what the peer says of itself.
|
|
681
|
+
*/
|
|
682
|
+
declare const cloudPresenceSchema: v.ObjectSchema<{
|
|
683
|
+
readonly kind: v.PicklistSchema<["user", "guest"], undefined>;
|
|
684
|
+
readonly id: v.StringSchema<undefined>;
|
|
685
|
+
readonly name: v.StringSchema<undefined>;
|
|
686
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
687
|
+
}, undefined>;
|
|
688
|
+
type CloudPresence = v.InferOutput<typeof cloudPresenceSchema>;
|
|
689
|
+
declare const collaborationTicketSchema: v.ObjectSchema<{
|
|
690
|
+
readonly token: v.StringSchema<undefined>;
|
|
691
|
+
readonly provider: v.OptionalSchema<v.PicklistSchema<["trystero", "relay"], undefined>, undefined>;
|
|
692
|
+
readonly serverURL: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
|
|
693
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
694
|
+
readonly roomId: v.StringSchema<undefined>;
|
|
695
|
+
readonly roomKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 43, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
696
|
+
readonly principal: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
697
|
+
readonly kind: v.LiteralSchema<"user", undefined>;
|
|
698
|
+
readonly userId: v.StringSchema<undefined>;
|
|
699
|
+
readonly name: v.StringSchema<undefined>;
|
|
700
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
701
|
+
}, undefined>, v.ObjectSchema<{
|
|
702
|
+
readonly kind: v.LiteralSchema<"guest", undefined>;
|
|
703
|
+
readonly guestId: v.StringSchema<undefined>;
|
|
704
|
+
readonly name: v.StringSchema<undefined>;
|
|
705
|
+
}, undefined>], undefined>;
|
|
706
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
707
|
+
readonly roomEpoch: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
708
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
709
|
+
readonly serverEnforcedWrites: v.BooleanSchema<undefined>;
|
|
710
|
+
}, undefined>;
|
|
711
|
+
type CollaborationTicket = v.InferOutput<typeof collaborationTicketSchema>;
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/contract/relay.d.ts
|
|
714
|
+
/** Where the relay accepts WebSocket upgrades, under the Cloud API origin. */
|
|
715
|
+
declare const RELAY_PATH = "/api/collaboration/relay";
|
|
716
|
+
/**
|
|
717
|
+
* The relay URL's query parameter naming the ticket's document, so a runtime that keeps each
|
|
718
|
+
* document's room in its own place can route the socket there before the ticket arrives.
|
|
719
|
+
*/
|
|
720
|
+
declare const RELAY_DOCUMENT_PARAM = "document";
|
|
721
|
+
/** The relay's public URL on the same origin as the API, unless the deployment names another. */
|
|
722
|
+
declare function defaultRelayURL(publicURL: string): string;
|
|
723
|
+
/**
|
|
724
|
+
* The room messages collaboration sends. The relay reads the document ones to keep its copy,
|
|
725
|
+
* persist it, and drop writes from viewers; it forwards the rest unread.
|
|
726
|
+
*/
|
|
727
|
+
declare const COLLAB_ACTIONS: {
|
|
728
|
+
readonly yjsUpdate: "yjs-update";
|
|
729
|
+
readonly syncStep1: "sync-step1";
|
|
730
|
+
readonly syncReply: "sync-reply";
|
|
731
|
+
readonly awareness: "awareness";
|
|
732
|
+
readonly agentPreview: "agent-preview";
|
|
733
|
+
readonly upload: "upload";
|
|
734
|
+
/** From the server only: the document's version history changed, so open lists load it again. */
|
|
735
|
+
readonly versions: "versions";
|
|
736
|
+
};
|
|
737
|
+
/**
|
|
738
|
+
* The most a room message may decode to, compressed or not. A peer's update past it is dropped
|
|
739
|
+
* before it is decoded, so a small compressed reply cannot expand without bound.
|
|
740
|
+
*/
|
|
741
|
+
declare const MAX_COLLAB_MESSAGE_BYTES: number;
|
|
742
|
+
/**
|
|
743
|
+
* What a peer joining needs is the whole document, which repeats the same field names across
|
|
744
|
+
* every layer, so the reply to its state vector travels compressed; Yjs's V2 encoding already
|
|
745
|
+
* groups that repetition, and together they make a room's first sync about a twelfth the size.
|
|
746
|
+
* Edits travel as V2 updates uncompressed: they are small, and arrive in a stream.
|
|
747
|
+
*/
|
|
748
|
+
declare function encodeSyncReply(document: Y.Doc, stateVector: Uint8Array): Uint8Array;
|
|
749
|
+
/**
|
|
750
|
+
* The V2 update a peer sent, inflated first when `compressed`, as a sync reply is; null once it
|
|
751
|
+
* would decode past `limit` bytes. Throws on data that does not inflate.
|
|
752
|
+
*/
|
|
753
|
+
declare function decodeRoomUpdate(data: Uint8Array, { limit, compressed }: {
|
|
754
|
+
limit: number;
|
|
755
|
+
compressed?: boolean;
|
|
756
|
+
}): Uint8Array | null;
|
|
757
|
+
/** The peer ID the relay itself uses: it holds the room's document and answers sync requests. */
|
|
758
|
+
declare const RELAY_SERVER_PEER = "server";
|
|
759
|
+
/** The longest name a peer's presence may carry; peers drop presence with a longer one. */
|
|
760
|
+
declare const MAX_PRESENCE_NAME_LENGTH = 40;
|
|
761
|
+
/** A name as presence carries it: trimmed and cut to what every peer accepts. */
|
|
762
|
+
declare function presenceName(name: string): string;
|
|
763
|
+
/**
|
|
764
|
+
* Close codes in the WebSocket application range. A client reconnects with a fresh ticket after
|
|
765
|
+
* `expired`, and gives up on the others.
|
|
766
|
+
*/
|
|
767
|
+
declare const RELAY_CLOSE: {
|
|
768
|
+
readonly unauthorized: 4401;
|
|
769
|
+
readonly expired: 4403;
|
|
770
|
+
readonly roomFull: 4409;
|
|
771
|
+
readonly messageTooLarge: 4413;
|
|
772
|
+
readonly protocol: 4400;
|
|
773
|
+
/** The document was restored to a version, so its room started over under a new ID. */
|
|
774
|
+
readonly restored: 4410;
|
|
775
|
+
};
|
|
776
|
+
/**
|
|
777
|
+
* The most one WebSocket message carries. A frame past it travels as fragments of this size that
|
|
778
|
+
* the receiver joins again, so a large paste or a room's first sync fits under any host's message
|
|
779
|
+
* cap, such as the 32 MiB of Cloudflare Workers, and the relay can turn away a viewer's or an
|
|
780
|
+
* unadmitted peer's large frame before holding it whole.
|
|
781
|
+
*/
|
|
782
|
+
declare const RELAY_FRAGMENT_BYTES: number;
|
|
783
|
+
/** The smallest per-message limit a relay may set: one fragment and its few bytes of framing. */
|
|
784
|
+
declare const RELAY_MINIMUM_MESSAGE_BYTES: number;
|
|
785
|
+
/**
|
|
786
|
+
* What the relay adds to a frame it forwards: the frame type, the sender's peer ID, and lengths.
|
|
787
|
+
* A client reads frames this much past the relay's own limit, so a forwarded edit at that limit
|
|
788
|
+
* still arrives.
|
|
789
|
+
*/
|
|
790
|
+
declare const RELAY_FORWARDING_BYTES: number;
|
|
791
|
+
/** Frames a client sends: its ticket first, again to refresh it, then room messages. */
|
|
792
|
+
type RelayClientFrame = {
|
|
793
|
+
type: 'auth';
|
|
794
|
+
token: string;
|
|
795
|
+
} | {
|
|
796
|
+
type: 'message';
|
|
797
|
+
namespace: string;
|
|
798
|
+
target: string | null;
|
|
799
|
+
payload: Uint8Array;
|
|
800
|
+
};
|
|
801
|
+
/** Frames the relay sends: who is in the room, arrivals and departures, and forwarded messages. */
|
|
802
|
+
type RelayServerFrame = {
|
|
803
|
+
type: 'welcome';
|
|
804
|
+
peerId: string;
|
|
805
|
+
peers: string[];
|
|
806
|
+
} | {
|
|
807
|
+
type: 'join';
|
|
808
|
+
peerId: string;
|
|
809
|
+
} | {
|
|
810
|
+
type: 'leave';
|
|
811
|
+
peerId: string;
|
|
812
|
+
} | {
|
|
813
|
+
type: 'message';
|
|
814
|
+
namespace: string;
|
|
815
|
+
from: string;
|
|
816
|
+
payload: Uint8Array;
|
|
817
|
+
};
|
|
818
|
+
declare function encodeRelayClientFrame(frame: RelayClientFrame): Uint8Array<ArrayBuffer>;
|
|
819
|
+
declare function encodeRelayServerFrame(frame: RelayServerFrame): Uint8Array<ArrayBuffer>;
|
|
820
|
+
/** A client frame as the socket messages that carry it, in order. */
|
|
821
|
+
declare function relayClientMessages(frame: RelayClientFrame): Uint8Array<ArrayBuffer>[];
|
|
822
|
+
/** A server frame as the socket messages that carry it, in order. */
|
|
823
|
+
declare function relayServerMessages(frame: RelayServerFrame): Uint8Array<ArrayBuffer>[];
|
|
824
|
+
/** What one socket message gave: a whole frame, part of one, or a reason to close. */
|
|
825
|
+
type RelayAssembly = {
|
|
826
|
+
type: 'frame';
|
|
827
|
+
data: Uint8Array;
|
|
828
|
+
} | {
|
|
829
|
+
type: 'partial';
|
|
830
|
+
} | {
|
|
831
|
+
type: 'too-large';
|
|
832
|
+
} | {
|
|
833
|
+
type: 'malformed';
|
|
834
|
+
};
|
|
835
|
+
/** Joins the fragments a client sends; the relay holds one per socket. */
|
|
836
|
+
declare function createRelayClientAssembler(limit: () => number): {
|
|
837
|
+
push(data: Uint8Array): RelayAssembly;
|
|
838
|
+
};
|
|
839
|
+
/** Joins the fragments the relay sends; a client holds one per socket. */
|
|
840
|
+
declare function createRelayServerAssembler(limit: () => number): {
|
|
841
|
+
push(data: Uint8Array): RelayAssembly;
|
|
842
|
+
};
|
|
843
|
+
/** Returns null for a frame that is malformed or of an unknown type. */
|
|
844
|
+
declare function decodeRelayClientFrame(data: Uint8Array): RelayClientFrame | null;
|
|
845
|
+
/** Returns null for a frame that is malformed or of an unknown type. */
|
|
846
|
+
declare function decodeRelayServerFrame(data: Uint8Array): RelayServerFrame | null;
|
|
847
|
+
//#endregion
|
|
848
|
+
//#region src/contract/entitlements.d.ts
|
|
849
|
+
declare const workspaceEntitlementsSchema: v.ObjectSchema<{
|
|
850
|
+
readonly features: v.ObjectSchema<{
|
|
851
|
+
readonly links: v.BooleanSchema<undefined>;
|
|
852
|
+
readonly guestView: v.BooleanSchema<undefined>;
|
|
853
|
+
readonly guestEdit: v.BooleanSchema<undefined>;
|
|
854
|
+
readonly guestPresence: v.BooleanSchema<undefined>;
|
|
855
|
+
readonly collaboration: v.BooleanSchema<undefined>;
|
|
856
|
+
readonly revisionHistory: v.BooleanSchema<undefined>;
|
|
857
|
+
readonly cloudAI: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
858
|
+
}, undefined>;
|
|
859
|
+
readonly limits: v.ObjectSchema<{
|
|
860
|
+
readonly maximumFileBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
861
|
+
readonly maximumStorageBytes: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
862
|
+
readonly maximumParticipants: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
863
|
+
readonly monthlyCreditAllowance: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, null>;
|
|
864
|
+
}, undefined>;
|
|
865
|
+
readonly usage: v.ObjectSchema<{
|
|
866
|
+
readonly committedStorageBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
867
|
+
readonly reservedStorageBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
868
|
+
}, undefined>;
|
|
869
|
+
}, undefined>;
|
|
870
|
+
type WorkspaceEntitlements = v.InferOutput<typeof workspaceEntitlementsSchema>;
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region src/contract/discovery.d.ts
|
|
873
|
+
declare const CLOUD_PROTOCOL_VERSION: "1";
|
|
874
|
+
declare const CLOUD_DISCOVERY_PATH: "/.well-known/openpencil";
|
|
875
|
+
declare const cloudDeploymentSchema: v.PicklistSchema<["official", "self-hosted"], undefined>;
|
|
876
|
+
type CloudDeployment = v.InferOutput<typeof cloudDeploymentSchema>;
|
|
877
|
+
declare const cloudAuthenticationSchema: v.ObjectSchema<{
|
|
878
|
+
readonly emailPassword: v.OptionalSchema<v.ObjectSchema<{
|
|
879
|
+
readonly signIn: v.BooleanSchema<undefined>;
|
|
880
|
+
readonly signUp: v.BooleanSchema<undefined>;
|
|
881
|
+
readonly minimumPasswordLength: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 8, undefined>]>;
|
|
882
|
+
readonly captcha: v.OptionalSchema<v.ObjectSchema<{
|
|
883
|
+
readonly provider: v.LiteralSchema<"cloudflare-turnstile", undefined>;
|
|
884
|
+
readonly siteKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
885
|
+
}, undefined>, undefined>;
|
|
886
|
+
}, undefined>, undefined>;
|
|
887
|
+
readonly socialProviders: v.ArraySchema<v.PicklistSchema<["apple", "google"], undefined>, undefined>;
|
|
888
|
+
readonly enterpriseSSO: v.BooleanSchema<undefined>;
|
|
889
|
+
readonly enrollmentMode: v.OptionalSchema<v.PicklistSchema<["open", "approval", "closed"], undefined>, "open">;
|
|
890
|
+
readonly mfa: v.OptionalSchema<v.ObjectSchema<{
|
|
891
|
+
readonly deploymentAdminRequired: v.BooleanSchema<undefined>;
|
|
892
|
+
readonly totp: v.BooleanSchema<undefined>;
|
|
893
|
+
readonly passkeys: v.BooleanSchema<undefined>;
|
|
894
|
+
readonly recoveryCodes: v.BooleanSchema<undefined>;
|
|
895
|
+
}, undefined>, undefined>;
|
|
896
|
+
}, undefined>;
|
|
897
|
+
type CloudAuthentication = v.InferOutput<typeof cloudAuthenticationSchema>;
|
|
898
|
+
declare const cloudCapabilitiesSchema: v.ObjectSchema<{
|
|
899
|
+
readonly documents: v.BooleanSchema<undefined>;
|
|
900
|
+
readonly workspaces: v.BooleanSchema<undefined>;
|
|
901
|
+
readonly collaboration: v.BooleanSchema<undefined>;
|
|
902
|
+
}, undefined>;
|
|
903
|
+
type CloudCapabilities = v.InferOutput<typeof cloudCapabilitiesSchema>;
|
|
904
|
+
/** A released editor version, `major.minor.patch`. */
|
|
905
|
+
declare const cloudEditorVersionSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
906
|
+
/**
|
|
907
|
+
* Whether editors offer this server to everyone, and from which editor version on. Only the
|
|
908
|
+
* official server's listing is read: it turns the Cloud entry points on without an editor release,
|
|
909
|
+
* and an editor older than the minimum keeps them hidden.
|
|
910
|
+
*/
|
|
911
|
+
declare const cloudListingSchema: v.ObjectSchema<{
|
|
912
|
+
readonly minimumEditorVersion: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
913
|
+
}, undefined>;
|
|
914
|
+
type CloudListing = v.InferOutput<typeof cloudListingSchema>;
|
|
915
|
+
declare const cloudDiscoverySchema: v.ObjectSchema<{
|
|
916
|
+
readonly protocolVersion: v.LiteralSchema<"1", undefined>;
|
|
917
|
+
readonly deployment: v.PicklistSchema<["official", "self-hosted"], undefined>;
|
|
918
|
+
readonly apiURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
919
|
+
readonly authURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
920
|
+
/** Whether the server's own editor works with files on this device without signing in. */
|
|
921
|
+
readonly localEditor: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
922
|
+
readonly authentication: v.ObjectSchema<{
|
|
923
|
+
readonly emailPassword: v.OptionalSchema<v.ObjectSchema<{
|
|
924
|
+
readonly signIn: v.BooleanSchema<undefined>;
|
|
925
|
+
readonly signUp: v.BooleanSchema<undefined>;
|
|
926
|
+
readonly minimumPasswordLength: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 8, undefined>]>;
|
|
927
|
+
readonly captcha: v.OptionalSchema<v.ObjectSchema<{
|
|
928
|
+
readonly provider: v.LiteralSchema<"cloudflare-turnstile", undefined>;
|
|
929
|
+
readonly siteKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
930
|
+
}, undefined>, undefined>;
|
|
931
|
+
}, undefined>, undefined>;
|
|
932
|
+
readonly socialProviders: v.ArraySchema<v.PicklistSchema<["apple", "google"], undefined>, undefined>;
|
|
933
|
+
readonly enterpriseSSO: v.BooleanSchema<undefined>;
|
|
934
|
+
readonly enrollmentMode: v.OptionalSchema<v.PicklistSchema<["open", "approval", "closed"], undefined>, "open">;
|
|
935
|
+
readonly mfa: v.OptionalSchema<v.ObjectSchema<{
|
|
936
|
+
readonly deploymentAdminRequired: v.BooleanSchema<undefined>;
|
|
937
|
+
readonly totp: v.BooleanSchema<undefined>;
|
|
938
|
+
readonly passkeys: v.BooleanSchema<undefined>;
|
|
939
|
+
readonly recoveryCodes: v.BooleanSchema<undefined>;
|
|
940
|
+
}, undefined>, undefined>;
|
|
941
|
+
}, undefined>;
|
|
942
|
+
readonly capabilities: v.ObjectSchema<{
|
|
943
|
+
readonly documents: v.BooleanSchema<undefined>;
|
|
944
|
+
readonly workspaces: v.BooleanSchema<undefined>;
|
|
945
|
+
readonly collaboration: v.BooleanSchema<undefined>;
|
|
946
|
+
}, undefined>;
|
|
947
|
+
readonly listing: v.OptionalSchema<v.ObjectSchema<{
|
|
948
|
+
readonly minimumEditorVersion: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
949
|
+
}, undefined>, undefined>;
|
|
950
|
+
/** The AI service editors reach with Cloud-signed tokens; absent when the deployment has none. */
|
|
951
|
+
readonly ai: v.OptionalSchema<v.ObjectSchema<{
|
|
952
|
+
readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
953
|
+
readonly contractVersion: v.LiteralSchema<"1", undefined>;
|
|
954
|
+
}, undefined>, undefined>;
|
|
955
|
+
/** Where people manage their plan and buy credits; absent when the deployment does not bill. */
|
|
956
|
+
readonly billing: v.OptionalSchema<v.ObjectSchema<{
|
|
957
|
+
readonly portalURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
958
|
+
}, undefined>, undefined>;
|
|
959
|
+
}, undefined>;
|
|
960
|
+
type CloudDiscovery = v.InferOutput<typeof cloudDiscoverySchema>;
|
|
961
|
+
/** The server's own address, where its editor and pages are, from its auth API's. */
|
|
962
|
+
declare function cloudServerOrigin(discovery: CloudDiscovery): string;
|
|
963
|
+
declare function parseCloudDiscovery(input: unknown): CloudDiscovery;
|
|
964
|
+
//#endregion
|
|
965
|
+
//#region src/contract/documents.d.ts
|
|
966
|
+
declare const CLOUD_PROTOCOL_MAX_UPLOAD_BYTES: number;
|
|
967
|
+
/** Whether a value is a SHA-256 checksum as the server names stored objects, base64 encoded. */
|
|
968
|
+
declare function isCloudChecksum(value: string): boolean;
|
|
969
|
+
/** The most images one revision, or one request for image uploads, may name. */
|
|
970
|
+
declare const CLOUD_MAX_DOCUMENT_IMAGES = 10000;
|
|
971
|
+
/**
|
|
972
|
+
* An image's name inside a `.fig` file that Cloud stores apart from it: the SHA-1 Figma names it
|
|
973
|
+
* by, or an older plain name. A client leaves images under other names inside the file.
|
|
974
|
+
*/
|
|
975
|
+
declare const CLOUD_IMAGE_NAME_PATTERN: RegExp;
|
|
976
|
+
/** An image a stored revision uses, where to download it, and what to check it against. */
|
|
977
|
+
declare const documentImageDownloadSchema: v.ObjectSchema<{
|
|
978
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
979
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
980
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
981
|
+
readonly download: v.ObjectSchema<{
|
|
982
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
983
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
984
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
985
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
986
|
+
}, undefined>;
|
|
987
|
+
}, undefined>;
|
|
988
|
+
type DocumentImageDownload = v.InferOutput<typeof documentImageDownloadSchema>;
|
|
989
|
+
/** Where to download an image a document uses, found by its checksum. */
|
|
990
|
+
declare const documentImageLinkSchema: v.ObjectSchema<{
|
|
991
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
992
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
993
|
+
readonly download: v.ObjectSchema<{
|
|
994
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
995
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
996
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
997
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
998
|
+
}, undefined>;
|
|
999
|
+
}, undefined>;
|
|
1000
|
+
type DocumentImageLink = v.InferOutput<typeof documentImageLinkSchema>;
|
|
1001
|
+
/** The images a live room names, by checksum, that a peer needs links for. */
|
|
1002
|
+
declare const requestImageLinksSchema: v.ObjectSchema<{
|
|
1003
|
+
readonly checksums: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], 10000, undefined>]>;
|
|
1004
|
+
}, undefined>;
|
|
1005
|
+
type RequestImageLinksInput = v.InferOutput<typeof requestImageLinksSchema>;
|
|
1006
|
+
declare const documentPermissionSchema: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1007
|
+
type DocumentPermission = v.InferOutput<typeof documentPermissionSchema>;
|
|
1008
|
+
declare const documentAccessSourceSchema: v.PicklistSchema<["owner", "workspace", "direct-grant"], undefined>;
|
|
1009
|
+
type DocumentAccessSource = v.InferOutput<typeof documentAccessSourceSchema>;
|
|
1010
|
+
declare const documentAccessSchema: v.ObjectSchema<{
|
|
1011
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1012
|
+
readonly canManageSharing: v.BooleanSchema<undefined>;
|
|
1013
|
+
readonly sources: v.ArraySchema<v.PicklistSchema<["owner", "workspace", "direct-grant"], undefined>, undefined>;
|
|
1014
|
+
}, undefined>;
|
|
1015
|
+
type DocumentAccess = v.InferOutput<typeof documentAccessSchema>;
|
|
1016
|
+
declare const documentSummarySchema: v.ObjectSchema<{
|
|
1017
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1018
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1019
|
+
readonly name: v.StringSchema<undefined>;
|
|
1020
|
+
/** A design unless said otherwise; servers from before boards list no kind. */
|
|
1021
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
1022
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1023
|
+
readonly version: v.NumberSchema<undefined>;
|
|
1024
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1025
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1026
|
+
}, undefined>;
|
|
1027
|
+
type DocumentSummary = v.InferOutput<typeof documentSummarySchema>;
|
|
1028
|
+
/** A document someone granted the person directly, in a workspace they are not a member of. */
|
|
1029
|
+
declare const sharedDocumentSchema: v.ObjectSchema<{
|
|
1030
|
+
readonly workspaceName: v.StringSchema<undefined>;
|
|
1031
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1032
|
+
readonly sharedBy: v.NullableSchema<v.ObjectSchema<{
|
|
1033
|
+
readonly name: v.StringSchema<undefined>;
|
|
1034
|
+
}, undefined>, undefined>;
|
|
1035
|
+
readonly sharedAt: v.StringSchema<undefined>;
|
|
1036
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1037
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1038
|
+
readonly name: v.StringSchema<undefined>;
|
|
1039
|
+
/** A design unless said otherwise; servers from before boards list no kind. */
|
|
1040
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
1041
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1042
|
+
readonly version: v.NumberSchema<undefined>;
|
|
1043
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1044
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1045
|
+
}, undefined>;
|
|
1046
|
+
type SharedDocument = v.InferOutput<typeof sharedDocumentSchema>;
|
|
1047
|
+
declare const documentDownloadSchema: v.ObjectSchema<{
|
|
1048
|
+
readonly document: v.ObjectSchema<{
|
|
1049
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1050
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1051
|
+
readonly name: v.StringSchema<undefined>;
|
|
1052
|
+
/** A design unless said otherwise; servers from before boards list no kind. */
|
|
1053
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
1054
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1055
|
+
readonly version: v.NumberSchema<undefined>;
|
|
1056
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1057
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1058
|
+
}, undefined>;
|
|
1059
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1060
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1061
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1062
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
1063
|
+
readonly download: v.ObjectSchema<{
|
|
1064
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1065
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
1066
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1067
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1068
|
+
}, undefined>;
|
|
1069
|
+
/** The images the stored file leaves out, which a client puts back under their names. */
|
|
1070
|
+
readonly images: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1071
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1072
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1073
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1074
|
+
readonly download: v.ObjectSchema<{
|
|
1075
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1076
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
1077
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1078
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1079
|
+
}, undefined>;
|
|
1080
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1081
|
+
name: string;
|
|
1082
|
+
checksum: string;
|
|
1083
|
+
byteSize: number;
|
|
1084
|
+
download: {
|
|
1085
|
+
url: string;
|
|
1086
|
+
method: "GET";
|
|
1087
|
+
headers: {
|
|
1088
|
+
[x: string]: string;
|
|
1089
|
+
};
|
|
1090
|
+
expiresAt: string;
|
|
1091
|
+
};
|
|
1092
|
+
}[], 10000, undefined>]>;
|
|
1093
|
+
}, undefined>;
|
|
1094
|
+
type DocumentDownload = v.InferOutput<typeof documentDownloadSchema>;
|
|
1095
|
+
declare const cloudActorSchema: v.ObjectSchema<{
|
|
1096
|
+
readonly userId: v.StringSchema<undefined>;
|
|
1097
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
1098
|
+
readonly name: v.StringSchema<undefined>;
|
|
1099
|
+
}, undefined>;
|
|
1100
|
+
type CloudActorContract = v.InferOutput<typeof cloudActorSchema>;
|
|
1101
|
+
declare const cloudSessionSchema: v.ObjectSchema<{
|
|
1102
|
+
readonly user: v.ObjectSchema<{
|
|
1103
|
+
readonly userId: v.StringSchema<undefined>;
|
|
1104
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
1105
|
+
readonly name: v.StringSchema<undefined>;
|
|
1106
|
+
}, undefined>;
|
|
1107
|
+
}, undefined>;
|
|
1108
|
+
type CloudSession = v.InferOutput<typeof cloudSessionSchema>;
|
|
1109
|
+
declare const workspaceUsageSchema: v.ObjectSchema<{
|
|
1110
|
+
readonly bytesUsed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1111
|
+
readonly objectCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1112
|
+
readonly documentCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1113
|
+
}, undefined>;
|
|
1114
|
+
type WorkspaceUsage = v.InferOutput<typeof workspaceUsageSchema>;
|
|
1115
|
+
declare const CLOUD_DOCUMENT_NAME_MAX_LENGTH = 255;
|
|
1116
|
+
declare const createDocumentSchema: v.ObjectSchema<{
|
|
1117
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1118
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
1119
|
+
/** A design unless said otherwise; older clients create only designs. */
|
|
1120
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
1121
|
+
}, undefined>;
|
|
1122
|
+
type CreateDocumentInput = v.InferOutput<typeof createDocumentSchema>;
|
|
1123
|
+
/** A new document as a client sends it, which may leave out its kind to make a design. */
|
|
1124
|
+
type CreateDocumentRequest = v.InferInput<typeof createDocumentSchema>;
|
|
1125
|
+
declare const createUploadSchema: v.ObjectSchema<{
|
|
1126
|
+
readonly baseRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1127
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
|
|
1128
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1129
|
+
readonly contentType: v.LiteralSchema<"application/octet-stream", undefined>;
|
|
1130
|
+
}, undefined>;
|
|
1131
|
+
type CreateUploadInput = v.InferOutput<typeof createUploadSchema>;
|
|
1132
|
+
/** Where a client puts an object: one presigned PUT, or the parts of a multipart upload. */
|
|
1133
|
+
declare const objectUploadSchema: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
1134
|
+
readonly kind: v.LiteralSchema<"single", undefined>;
|
|
1135
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1136
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
1137
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1138
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1139
|
+
}, undefined>, v.ObjectSchema<{
|
|
1140
|
+
readonly kind: v.LiteralSchema<"multipart", undefined>;
|
|
1141
|
+
readonly uploadId: v.StringSchema<undefined>;
|
|
1142
|
+
readonly partSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1143
|
+
readonly parts: v.ArraySchema<v.ObjectSchema<{
|
|
1144
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1145
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1146
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
1147
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1148
|
+
}, undefined>, undefined>;
|
|
1149
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1150
|
+
}, undefined>], undefined>;
|
|
1151
|
+
type ObjectUploadTarget = v.InferOutput<typeof objectUploadSchema>;
|
|
1152
|
+
/** An upload the server offers for an image the workspace lacks. */
|
|
1153
|
+
declare const imageUploadOfferSchema: v.ObjectSchema<{
|
|
1154
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1155
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1156
|
+
readonly upload: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
1157
|
+
readonly kind: v.LiteralSchema<"single", undefined>;
|
|
1158
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1159
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
1160
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1161
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1162
|
+
}, undefined>, v.ObjectSchema<{
|
|
1163
|
+
readonly kind: v.LiteralSchema<"multipart", undefined>;
|
|
1164
|
+
readonly uploadId: v.StringSchema<undefined>;
|
|
1165
|
+
readonly partSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1166
|
+
readonly parts: v.ArraySchema<v.ObjectSchema<{
|
|
1167
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1168
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1169
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
1170
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1171
|
+
}, undefined>, undefined>;
|
|
1172
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1173
|
+
}, undefined>], undefined>;
|
|
1174
|
+
}, undefined>;
|
|
1175
|
+
type ImageUploadOffer = v.InferOutput<typeof imageUploadOfferSchema>;
|
|
1176
|
+
/** The images a save will refer to; the server answers with uploads for those it lacks. */
|
|
1177
|
+
declare const requestImageUploadsSchema: v.ObjectSchema<{
|
|
1178
|
+
readonly images: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1179
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1180
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
|
|
1181
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
1182
|
+
checksum: string;
|
|
1183
|
+
byteSize: number;
|
|
1184
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
1185
|
+
checksum: string;
|
|
1186
|
+
byteSize: number;
|
|
1187
|
+
}[], 10000, undefined>]>;
|
|
1188
|
+
}, undefined>;
|
|
1189
|
+
type RequestImageUploadsInput = v.InferOutput<typeof requestImageUploadsSchema>;
|
|
1190
|
+
declare const commitUploadSchema: v.ObjectSchema<{
|
|
1191
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1192
|
+
/** The document title captured with this revision; omitted by older clients. */
|
|
1193
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
1194
|
+
/** What the uploaded file is, which the document takes; omitted by older clients. */
|
|
1195
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, undefined>;
|
|
1196
|
+
readonly multipart: v.OptionalSchema<v.ObjectSchema<{
|
|
1197
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1198
|
+
readonly parts: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1199
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
1200
|
+
readonly etag: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
1201
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
1202
|
+
partNumber: number;
|
|
1203
|
+
etag: string;
|
|
1204
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
1205
|
+
partNumber: number;
|
|
1206
|
+
etag: string;
|
|
1207
|
+
}[], 10000, undefined>]>;
|
|
1208
|
+
}, undefined>, undefined>;
|
|
1209
|
+
/** The images the uploaded file leaves out, each stored in the workspace or uploaded before. */
|
|
1210
|
+
readonly images: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1211
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1212
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1213
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1214
|
+
name: string;
|
|
1215
|
+
checksum: string;
|
|
1216
|
+
}[], 10000, undefined>]>, readonly []>;
|
|
1217
|
+
}, undefined>;
|
|
1218
|
+
type CommitUploadInput = v.InferOutput<typeof commitUploadSchema>;
|
|
1219
|
+
/** The image uploads a save asked for, committed together once their bytes are in place. */
|
|
1220
|
+
declare const commitImageUploadsSchema: v.ObjectSchema<{
|
|
1221
|
+
readonly uploads: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1222
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1223
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1224
|
+
readonly multipart: v.OptionalSchema<v.ObjectSchema<{
|
|
1225
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1226
|
+
readonly parts: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1227
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
1228
|
+
readonly etag: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
1229
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
1230
|
+
partNumber: number;
|
|
1231
|
+
etag: string;
|
|
1232
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
1233
|
+
partNumber: number;
|
|
1234
|
+
etag: string;
|
|
1235
|
+
}[], 10000, undefined>]>;
|
|
1236
|
+
}, undefined>, undefined>;
|
|
1237
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
1238
|
+
uploadId: string;
|
|
1239
|
+
checksum: string;
|
|
1240
|
+
multipart?: {
|
|
1241
|
+
uploadId: string;
|
|
1242
|
+
parts: {
|
|
1243
|
+
partNumber: number;
|
|
1244
|
+
etag: string;
|
|
1245
|
+
}[];
|
|
1246
|
+
} | undefined;
|
|
1247
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
1248
|
+
uploadId: string;
|
|
1249
|
+
checksum: string;
|
|
1250
|
+
multipart?: {
|
|
1251
|
+
uploadId: string;
|
|
1252
|
+
parts: {
|
|
1253
|
+
partNumber: number;
|
|
1254
|
+
etag: string;
|
|
1255
|
+
}[];
|
|
1256
|
+
} | undefined;
|
|
1257
|
+
}[], 10000, undefined>]>;
|
|
1258
|
+
}, undefined>;
|
|
1259
|
+
type CommitImageUploadsInput = v.InferOutput<typeof commitImageUploadsSchema>;
|
|
1260
|
+
/** A commit as a client sends it, which may leave out the images a whole file holds itself. */
|
|
1261
|
+
type CommitUploadRequest = v.InferInput<typeof commitUploadSchema>;
|
|
1262
|
+
declare function parseCreateDocument(input: unknown): CreateDocumentInput;
|
|
1263
|
+
declare function parseCreateUpload(input: unknown): CreateUploadInput;
|
|
1264
|
+
declare function parseRequestImageUploads(input: unknown): RequestImageUploadsInput;
|
|
1265
|
+
declare function parseCommitImageUploads(input: unknown): CommitImageUploadsInput;
|
|
1266
|
+
declare function parseRequestImageLinks(input: unknown): RequestImageLinksInput;
|
|
1267
|
+
declare function parseCommitUpload(input: unknown): CommitUploadInput;
|
|
1268
|
+
//#endregion
|
|
1269
|
+
//#region src/contract/sharing.d.ts
|
|
1270
|
+
declare const documentShareSchema: v.ObjectSchema<{
|
|
1271
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1272
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1273
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1274
|
+
readonly roomEpoch: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1275
|
+
readonly createdBy: v.StringSchema<undefined>;
|
|
1276
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1277
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1278
|
+
readonly expiresAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1279
|
+
readonly revokedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1280
|
+
readonly lastUsedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1281
|
+
}, undefined>;
|
|
1282
|
+
type DocumentShare = v.InferOutput<typeof documentShareSchema>;
|
|
1283
|
+
declare const createDocumentShareSchema: v.ObjectSchema<{
|
|
1284
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1285
|
+
readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
|
|
1286
|
+
}, undefined>;
|
|
1287
|
+
type CreateDocumentShareInput = v.InferOutput<typeof createDocumentShareSchema>;
|
|
1288
|
+
declare const updateDocumentShareSchema: v.ObjectSchema<{
|
|
1289
|
+
readonly permission: v.OptionalSchema<v.PicklistSchema<["view", "edit"], undefined>, undefined>;
|
|
1290
|
+
readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
|
|
1291
|
+
}, undefined>;
|
|
1292
|
+
type UpdateDocumentShareInput = v.InferOutput<typeof updateDocumentShareSchema>;
|
|
1293
|
+
declare const resolveDocumentShareSchema: v.ObjectSchema<{
|
|
1294
|
+
readonly secret: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
1295
|
+
readonly guestName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, undefined>;
|
|
1296
|
+
readonly guestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
|
|
1297
|
+
}, undefined>;
|
|
1298
|
+
type ResolveDocumentShareInput = v.InferOutput<typeof resolveDocumentShareSchema>;
|
|
1299
|
+
/** A guest's request for the links of images a shared document's live room names. */
|
|
1300
|
+
declare const requestSharedImageLinksSchema: v.ObjectSchema<{
|
|
1301
|
+
readonly checksums: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], 10000, undefined>]>;
|
|
1302
|
+
readonly secret: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
1303
|
+
readonly guestName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, undefined>;
|
|
1304
|
+
readonly guestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
|
|
1305
|
+
}, undefined>;
|
|
1306
|
+
type RequestSharedImageLinksInput = v.InferOutput<typeof requestSharedImageLinksSchema>;
|
|
1307
|
+
declare function parseRequestSharedImageLinks(input: unknown): RequestSharedImageLinksInput;
|
|
1308
|
+
declare const resolvedDocumentShareSchema: v.ObjectSchema<{
|
|
1309
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1310
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1311
|
+
readonly principal: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
1312
|
+
readonly kind: v.LiteralSchema<"user", undefined>;
|
|
1313
|
+
readonly userId: v.StringSchema<undefined>;
|
|
1314
|
+
readonly name: v.StringSchema<undefined>;
|
|
1315
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
1316
|
+
}, undefined>, v.ObjectSchema<{
|
|
1317
|
+
readonly kind: v.LiteralSchema<"guest", undefined>;
|
|
1318
|
+
readonly guestId: v.StringSchema<undefined>;
|
|
1319
|
+
readonly name: v.StringSchema<undefined>;
|
|
1320
|
+
}, undefined>], undefined>;
|
|
1321
|
+
readonly roomEpoch: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1322
|
+
}, undefined>;
|
|
1323
|
+
type ResolvedDocumentShare = v.InferOutput<typeof resolvedDocumentShareSchema>;
|
|
1324
|
+
declare const cloudUserProfileSchema: v.ObjectSchema<{
|
|
1325
|
+
readonly id: v.StringSchema<undefined>;
|
|
1326
|
+
readonly name: v.StringSchema<undefined>;
|
|
1327
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
1328
|
+
readonly image: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
|
|
1329
|
+
}, undefined>;
|
|
1330
|
+
type CloudUserProfile = v.InferOutput<typeof cloudUserProfileSchema>;
|
|
1331
|
+
declare const documentGrantSchema: v.ObjectSchema<{
|
|
1332
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1333
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1334
|
+
readonly userId: v.StringSchema<undefined>;
|
|
1335
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1336
|
+
readonly createdBy: v.StringSchema<undefined>;
|
|
1337
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1338
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1339
|
+
}, undefined>;
|
|
1340
|
+
type DocumentGrant = v.InferOutput<typeof documentGrantSchema>;
|
|
1341
|
+
/** What accepting an invitation gave: access to a document, or a place in a workspace. */
|
|
1342
|
+
declare const acceptedInvitationSchema: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
1343
|
+
readonly kind: v.LiteralSchema<"document", undefined>;
|
|
1344
|
+
readonly grant: v.ObjectSchema<{
|
|
1345
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1346
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1347
|
+
readonly userId: v.StringSchema<undefined>;
|
|
1348
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1349
|
+
readonly createdBy: v.StringSchema<undefined>;
|
|
1350
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1351
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1352
|
+
}, undefined>;
|
|
1353
|
+
}, undefined>, v.ObjectSchema<{
|
|
1354
|
+
readonly kind: v.LiteralSchema<"workspace", undefined>;
|
|
1355
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1356
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1357
|
+
}, undefined>], undefined>;
|
|
1358
|
+
type AcceptedInvitation = v.InferOutput<typeof acceptedInvitationSchema>;
|
|
1359
|
+
declare const lookupCloudUserSchema: v.ObjectSchema<{
|
|
1360
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
|
|
1361
|
+
}, undefined>;
|
|
1362
|
+
type LookupCloudUserInput = v.InferOutput<typeof lookupCloudUserSchema>;
|
|
1363
|
+
declare const putDocumentGrantSchema: v.ObjectSchema<{
|
|
1364
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1365
|
+
}, undefined>;
|
|
1366
|
+
type PutDocumentGrantInput = v.InferOutput<typeof putDocumentGrantSchema>;
|
|
1367
|
+
declare const createDocumentInvitationSchema: v.ObjectSchema<{
|
|
1368
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
|
|
1369
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1370
|
+
}, undefined>;
|
|
1371
|
+
type CreateDocumentInvitationInput = v.InferOutput<typeof createDocumentInvitationSchema>;
|
|
1372
|
+
declare const acceptDocumentInvitationSchema: v.ObjectSchema<{
|
|
1373
|
+
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
1374
|
+
}, undefined>;
|
|
1375
|
+
type AcceptDocumentInvitationInput = v.InferOutput<typeof acceptDocumentInvitationSchema>;
|
|
1376
|
+
declare const createInvitationContinuationSchema: v.ObjectSchema<{
|
|
1377
|
+
readonly invitationId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1378
|
+
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
1379
|
+
}, undefined>;
|
|
1380
|
+
type CreateInvitationContinuationInput = v.InferOutput<typeof createInvitationContinuationSchema>;
|
|
1381
|
+
declare const invitationContinuationSchema: v.ObjectSchema<{
|
|
1382
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
1383
|
+
}, undefined>;
|
|
1384
|
+
type InvitationContinuation = v.InferOutput<typeof invitationContinuationSchema>;
|
|
1385
|
+
/** What an invitation link opens: one document, or a whole workspace. */
|
|
1386
|
+
declare const invitationPreviewSchema: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
1387
|
+
readonly inviterName: v.StringSchema<undefined>;
|
|
1388
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1389
|
+
readonly recipientHint: v.StringSchema<undefined>;
|
|
1390
|
+
readonly kind: v.LiteralSchema<"document", undefined>;
|
|
1391
|
+
readonly documentName: v.StringSchema<undefined>;
|
|
1392
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1393
|
+
}, undefined>, v.ObjectSchema<{
|
|
1394
|
+
readonly inviterName: v.StringSchema<undefined>;
|
|
1395
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1396
|
+
readonly recipientHint: v.StringSchema<undefined>;
|
|
1397
|
+
readonly kind: v.LiteralSchema<"workspace", undefined>;
|
|
1398
|
+
readonly workspaceName: v.StringSchema<undefined>;
|
|
1399
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1400
|
+
}, undefined>], undefined>;
|
|
1401
|
+
type InvitationPreview = v.InferOutput<typeof invitationPreviewSchema>;
|
|
1402
|
+
declare const documentInvitationSchema: v.ObjectSchema<{
|
|
1403
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1404
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1405
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
1406
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
1407
|
+
readonly invitedBy: v.StringSchema<undefined>;
|
|
1408
|
+
readonly invitedAt: v.StringSchema<undefined>;
|
|
1409
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1410
|
+
readonly acceptedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1411
|
+
}, undefined>;
|
|
1412
|
+
type DocumentInvitation = v.InferOutput<typeof documentInvitationSchema>;
|
|
1413
|
+
declare function parseCreateInvitationContinuation(input: unknown): CreateInvitationContinuationInput;
|
|
1414
|
+
declare function parseLookupCloudUser(input: unknown): LookupCloudUserInput;
|
|
1415
|
+
declare function parseCreateDocumentShare(input: unknown): CreateDocumentShareInput;
|
|
1416
|
+
declare function parseUpdateDocumentShare(input: unknown): UpdateDocumentShareInput;
|
|
1417
|
+
declare function parseResolveDocumentShare(input: unknown): ResolveDocumentShareInput;
|
|
1418
|
+
declare function parsePutDocumentGrant(input: unknown): PutDocumentGrantInput;
|
|
1419
|
+
declare function parseCreateDocumentInvitation(input: unknown): CreateDocumentInvitationInput;
|
|
1420
|
+
declare function parseAcceptDocumentInvitation(input: unknown): AcceptDocumentInvitationInput;
|
|
1421
|
+
//#endregion
|
|
1422
|
+
//#region src/contract/workspaces.d.ts
|
|
1423
|
+
declare const workspaceRoleSchema: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1424
|
+
type WorkspaceRole = v.InferOutput<typeof workspaceRoleSchema>;
|
|
1425
|
+
declare const workspaceSummarySchema: v.ObjectSchema<{
|
|
1426
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1427
|
+
readonly name: v.StringSchema<undefined>;
|
|
1428
|
+
readonly slug: v.StringSchema<undefined>;
|
|
1429
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1430
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1431
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1432
|
+
}, undefined>;
|
|
1433
|
+
type WorkspaceSummary = v.InferOutput<typeof workspaceSummarySchema>;
|
|
1434
|
+
declare const createWorkspaceSchema: v.ObjectSchema<{
|
|
1435
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
1436
|
+
readonly slug: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 63, undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
1437
|
+
}, undefined>;
|
|
1438
|
+
type CreateWorkspaceInput = v.InferOutput<typeof createWorkspaceSchema>;
|
|
1439
|
+
declare const workspaceListSchema: v.ObjectSchema<{
|
|
1440
|
+
readonly workspaces: v.ArraySchema<v.ObjectSchema<{
|
|
1441
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1442
|
+
readonly name: v.StringSchema<undefined>;
|
|
1443
|
+
readonly slug: v.StringSchema<undefined>;
|
|
1444
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1445
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1446
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1447
|
+
}, undefined>, undefined>;
|
|
1448
|
+
}, undefined>;
|
|
1449
|
+
type WorkspaceList = v.InferOutput<typeof workspaceListSchema>;
|
|
1450
|
+
declare const updateWorkspaceSchema: v.ObjectSchema<{
|
|
1451
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
1452
|
+
}, undefined>;
|
|
1453
|
+
type UpdateWorkspaceInput = v.InferOutput<typeof updateWorkspaceSchema>;
|
|
1454
|
+
/** Someone who belongs to a workspace, and what they may do in it. */
|
|
1455
|
+
declare const workspaceMemberSchema: v.ObjectSchema<{
|
|
1456
|
+
readonly userId: v.StringSchema<undefined>;
|
|
1457
|
+
readonly name: v.StringSchema<undefined>;
|
|
1458
|
+
readonly email: v.StringSchema<undefined>;
|
|
1459
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1460
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1461
|
+
readonly joinedAt: v.StringSchema<undefined>;
|
|
1462
|
+
}, undefined>;
|
|
1463
|
+
type WorkspaceMember = v.InferOutput<typeof workspaceMemberSchema>;
|
|
1464
|
+
/** An invitation to join a workspace that has not been accepted yet. */
|
|
1465
|
+
declare const workspaceInvitationSchema: v.ObjectSchema<{
|
|
1466
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1467
|
+
readonly email: v.StringSchema<undefined>;
|
|
1468
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1469
|
+
/** Who sent it; the name is null once their account is gone. */
|
|
1470
|
+
readonly invitedBy: v.ObjectSchema<{
|
|
1471
|
+
readonly id: v.StringSchema<undefined>;
|
|
1472
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1473
|
+
}, undefined>;
|
|
1474
|
+
readonly invitedAt: v.StringSchema<undefined>;
|
|
1475
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1476
|
+
}, undefined>;
|
|
1477
|
+
type WorkspaceInvitation = v.InferOutput<typeof workspaceInvitationSchema>;
|
|
1478
|
+
declare const workspaceMembersSchema: v.ObjectSchema<{
|
|
1479
|
+
readonly members: v.ArraySchema<v.ObjectSchema<{
|
|
1480
|
+
readonly userId: v.StringSchema<undefined>;
|
|
1481
|
+
readonly name: v.StringSchema<undefined>;
|
|
1482
|
+
readonly email: v.StringSchema<undefined>;
|
|
1483
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1484
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1485
|
+
readonly joinedAt: v.StringSchema<undefined>;
|
|
1486
|
+
}, undefined>, undefined>;
|
|
1487
|
+
/** Only administrators see pending invitations. */
|
|
1488
|
+
readonly invitations: v.ArraySchema<v.ObjectSchema<{
|
|
1489
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1490
|
+
readonly email: v.StringSchema<undefined>;
|
|
1491
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1492
|
+
/** Who sent it; the name is null once their account is gone. */
|
|
1493
|
+
readonly invitedBy: v.ObjectSchema<{
|
|
1494
|
+
readonly id: v.StringSchema<undefined>;
|
|
1495
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1496
|
+
}, undefined>;
|
|
1497
|
+
readonly invitedAt: v.StringSchema<undefined>;
|
|
1498
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1499
|
+
}, undefined>, undefined>;
|
|
1500
|
+
}, undefined>;
|
|
1501
|
+
type WorkspaceMembers = v.InferOutput<typeof workspaceMembersSchema>;
|
|
1502
|
+
declare const createWorkspaceInvitationSchema: v.ObjectSchema<{
|
|
1503
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
|
|
1504
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1505
|
+
}, undefined>;
|
|
1506
|
+
type CreateWorkspaceInvitationInput = v.InferOutput<typeof createWorkspaceInvitationSchema>;
|
|
1507
|
+
/** A new invitation and its link, for an administrator to pass on when email is off. */
|
|
1508
|
+
declare const createdWorkspaceInvitationSchema: v.ObjectSchema<{
|
|
1509
|
+
readonly invitation: v.ObjectSchema<{
|
|
1510
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1511
|
+
readonly email: v.StringSchema<undefined>;
|
|
1512
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1513
|
+
/** Who sent it; the name is null once their account is gone. */
|
|
1514
|
+
readonly invitedBy: v.ObjectSchema<{
|
|
1515
|
+
readonly id: v.StringSchema<undefined>;
|
|
1516
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1517
|
+
}, undefined>;
|
|
1518
|
+
readonly invitedAt: v.StringSchema<undefined>;
|
|
1519
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1520
|
+
}, undefined>;
|
|
1521
|
+
readonly acceptanceURL: v.StringSchema<undefined>;
|
|
1522
|
+
}, undefined>;
|
|
1523
|
+
type CreatedWorkspaceInvitation = v.InferOutput<typeof createdWorkspaceInvitationSchema>;
|
|
1524
|
+
declare const updateWorkspaceMemberSchema: v.ObjectSchema<{
|
|
1525
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
1526
|
+
}, undefined>;
|
|
1527
|
+
type UpdateWorkspaceMemberInput = v.InferOutput<typeof updateWorkspaceMemberSchema>;
|
|
1528
|
+
declare function parseCreateWorkspace(input: unknown): CreateWorkspaceInput;
|
|
1529
|
+
declare function parseUpdateWorkspace(input: unknown): UpdateWorkspaceInput;
|
|
1530
|
+
declare function parseCreateWorkspaceInvitation(input: unknown): CreateWorkspaceInvitationInput;
|
|
1531
|
+
declare function parseUpdateWorkspaceMember(input: unknown): UpdateWorkspaceMemberInput;
|
|
1532
|
+
//#endregion
|
|
1533
|
+
//#region src/contract/links.d.ts
|
|
1534
|
+
/** The two kinds of Cloud link that carry a secret: invitations and documents shared by link. */
|
|
1535
|
+
type CloudLinkKind = 'invitations' | 'share';
|
|
1536
|
+
/** Every kind of Cloud link: those that carry a secret, and a document's address for members. */
|
|
1537
|
+
type CloudLinkPathKind = CloudLinkKind | 'documents';
|
|
1538
|
+
/** An invitation to a document or a workspace, `/invitations/:id#token`. */
|
|
1539
|
+
declare function cloudInvitationURL(serverURL: string, invitationId: string, token: string): string;
|
|
1540
|
+
/** A document shared by link, `/share/:id#secret`. */
|
|
1541
|
+
declare function cloudShareURL(serverURL: string, shareId: string, secret: string): string;
|
|
1542
|
+
/**
|
|
1543
|
+
* A document's address for its members, `/documents/:id`, or one of its versions with
|
|
1544
|
+
* `?version=…`. It carries no secret: whoever opens it signs in, and the server decides.
|
|
1545
|
+
*/
|
|
1546
|
+
declare function cloudDocumentURL(serverURL: string, documentId: string, versionId?: string | null): string;
|
|
1547
|
+
declare function cloudDocumentPath(documentId: string): string;
|
|
1548
|
+
/**
|
|
1549
|
+
* The kind and ID of a Cloud link's path, or null for any other path. The ID is decoded; a broken
|
|
1550
|
+
* escape such as `%E0` is no link.
|
|
1551
|
+
*/
|
|
1552
|
+
declare function parseCloudLinkPath(pathname: string): {
|
|
1553
|
+
kind: CloudLinkPathKind;
|
|
1554
|
+
id: string;
|
|
1555
|
+
} | null;
|
|
1556
|
+
/**
|
|
1557
|
+
* The desktop app's form of a Cloud link, `openpencil://cloud?url=<link>#secret`: the web link,
|
|
1558
|
+
* whose address names the server, with its secret kept in the fragment.
|
|
1559
|
+
* `desktop/src/launch/links.rs` validates it before the editor sees it.
|
|
1560
|
+
*/
|
|
1561
|
+
declare function cloudDesktopLinkURL(kind: CloudLinkKind, id: string, serverURL: string, secret: string): string;
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region src/contract/portal.d.ts
|
|
1564
|
+
/**
|
|
1565
|
+
* The pages a Cloud server shows on its own address, apart from the editor: the welcome page for
|
|
1566
|
+
* visitors who are not signed in, sign-in and desktop sign-in approval, account settings, and the
|
|
1567
|
+
* administration console. Every runtime serves the portal's `cloud.html` at and below these
|
|
1568
|
+
* paths, and the editor's `index.html` at the root and at any other page the API does not answer.
|
|
1569
|
+
*/
|
|
1570
|
+
declare const CLOUD_PORTAL_PAGE_ROOTS: readonly ["/welcome", "/auth", "/account", "/admin"];
|
|
1571
|
+
declare function isCloudPortalPage(path: string): boolean;
|
|
1572
|
+
//#endregion
|
|
1573
|
+
//#region src/contract/versions.d.ts
|
|
1574
|
+
/** How long a version's name may be; the history list shows the start of longer ones. */
|
|
1575
|
+
declare const DOCUMENT_VERSION_NAME_MAX_LENGTH = 100;
|
|
1576
|
+
declare const DOCUMENT_VERSION_DESCRIPTION_MAX_LENGTH = 1000;
|
|
1577
|
+
/** A checkpoint the server kept on its own, or a version someone named. */
|
|
1578
|
+
declare const documentVersionKindSchema: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
1579
|
+
type DocumentVersionKind = v.InferOutput<typeof documentVersionKindSchema>;
|
|
1580
|
+
declare const documentVersionSchema: v.ObjectSchema<{
|
|
1581
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1582
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1583
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
1584
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1585
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1586
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1587
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
1588
|
+
readonly createdBy: v.ObjectSchema<{
|
|
1589
|
+
readonly id: v.StringSchema<undefined>;
|
|
1590
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1591
|
+
}, undefined>;
|
|
1592
|
+
/** The version this one restored, while that version is still in the history. */
|
|
1593
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1594
|
+
/** Whether the document holds this version now. */
|
|
1595
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
1596
|
+
}, undefined>;
|
|
1597
|
+
type DocumentVersion = v.InferOutput<typeof documentVersionSchema>;
|
|
1598
|
+
declare const documentVersionsSchema: v.ObjectSchema<{
|
|
1599
|
+
readonly versions: v.ArraySchema<v.ObjectSchema<{
|
|
1600
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1601
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1602
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
1603
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1604
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1605
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1606
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
1607
|
+
readonly createdBy: v.ObjectSchema<{
|
|
1608
|
+
readonly id: v.StringSchema<undefined>;
|
|
1609
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1610
|
+
}, undefined>;
|
|
1611
|
+
/** The version this one restored, while that version is still in the history. */
|
|
1612
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1613
|
+
/** Whether the document holds this version now. */
|
|
1614
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
1615
|
+
}, undefined>, undefined>;
|
|
1616
|
+
/** Pass as `before` for the next, older page; null on the last one. */
|
|
1617
|
+
readonly nextCursor: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1618
|
+
}, undefined>;
|
|
1619
|
+
type DocumentVersions = v.InferOutput<typeof documentVersionsSchema>;
|
|
1620
|
+
/** Names the document as it is now, like Save to version history. */
|
|
1621
|
+
declare const saveDocumentVersionSchema: v.ObjectSchema<{
|
|
1622
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
1623
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 1000, undefined>]>, "">;
|
|
1624
|
+
}, undefined>;
|
|
1625
|
+
type SaveDocumentVersionInput = v.InferOutput<typeof saveDocumentVersionSchema>;
|
|
1626
|
+
/** Names a version or changes its name; a null name deletes its info and leaves a checkpoint. */
|
|
1627
|
+
declare const updateDocumentVersionSchema: v.ObjectSchema<{
|
|
1628
|
+
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>;
|
|
1629
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 1000, undefined>]>, "">;
|
|
1630
|
+
}, undefined>;
|
|
1631
|
+
type UpdateDocumentVersionInput = v.InferOutput<typeof updateDocumentVersionSchema>;
|
|
1632
|
+
declare const duplicateDocumentVersionSchema: v.ObjectSchema<{
|
|
1633
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
1634
|
+
}, undefined>;
|
|
1635
|
+
type DuplicateDocumentVersionInput = v.InferOutput<typeof duplicateDocumentVersionSchema>;
|
|
1636
|
+
declare const documentVersionResponseSchema: v.ObjectSchema<{
|
|
1637
|
+
readonly version: v.ObjectSchema<{
|
|
1638
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1639
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1640
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
1641
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1642
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1643
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1644
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
1645
|
+
readonly createdBy: v.ObjectSchema<{
|
|
1646
|
+
readonly id: v.StringSchema<undefined>;
|
|
1647
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1648
|
+
}, undefined>;
|
|
1649
|
+
/** The version this one restored, while that version is still in the history. */
|
|
1650
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1651
|
+
/** Whether the document holds this version now. */
|
|
1652
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
1653
|
+
}, undefined>;
|
|
1654
|
+
}, undefined>;
|
|
1655
|
+
/** A version with where to download it, so a link to it can show it without the history. */
|
|
1656
|
+
declare const documentVersionDownloadSchema: v.ObjectSchema<{
|
|
1657
|
+
readonly document: v.ObjectSchema<{
|
|
1658
|
+
readonly document: v.ObjectSchema<{
|
|
1659
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1660
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1661
|
+
readonly name: v.StringSchema<undefined>;
|
|
1662
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
1663
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1664
|
+
readonly version: v.NumberSchema<undefined>;
|
|
1665
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1666
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1667
|
+
}, undefined>;
|
|
1668
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1669
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1670
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1671
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
1672
|
+
readonly download: v.ObjectSchema<{
|
|
1673
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1674
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
1675
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1676
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1677
|
+
}, undefined>;
|
|
1678
|
+
readonly images: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1679
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1680
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1681
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1682
|
+
readonly download: v.ObjectSchema<{
|
|
1683
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1684
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
1685
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
1686
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
1687
|
+
}, undefined>;
|
|
1688
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1689
|
+
name: string;
|
|
1690
|
+
checksum: string;
|
|
1691
|
+
byteSize: number;
|
|
1692
|
+
download: {
|
|
1693
|
+
url: string;
|
|
1694
|
+
method: "GET";
|
|
1695
|
+
headers: {
|
|
1696
|
+
[x: string]: string;
|
|
1697
|
+
};
|
|
1698
|
+
expiresAt: string;
|
|
1699
|
+
};
|
|
1700
|
+
}[], 10000, undefined>]>;
|
|
1701
|
+
}, undefined>;
|
|
1702
|
+
readonly version: v.ObjectSchema<{
|
|
1703
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1704
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1705
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
1706
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1707
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1708
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1709
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
1710
|
+
readonly createdBy: v.ObjectSchema<{
|
|
1711
|
+
readonly id: v.StringSchema<undefined>;
|
|
1712
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1713
|
+
}, undefined>;
|
|
1714
|
+
/** The version this one restored, while that version is still in the history. */
|
|
1715
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1716
|
+
/** Whether the document holds this version now. */
|
|
1717
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
1718
|
+
}, undefined>;
|
|
1719
|
+
}, undefined>;
|
|
1720
|
+
type DocumentVersionDownload = v.InferOutput<typeof documentVersionDownloadSchema>;
|
|
1721
|
+
declare const restoredDocumentSchema: v.ObjectSchema<{
|
|
1722
|
+
readonly document: v.ObjectSchema<{
|
|
1723
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1724
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1725
|
+
readonly name: v.StringSchema<undefined>;
|
|
1726
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
1727
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1728
|
+
readonly version: v.NumberSchema<undefined>;
|
|
1729
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1730
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
1731
|
+
}, undefined>;
|
|
1732
|
+
readonly version: v.ObjectSchema<{
|
|
1733
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1734
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1735
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
1736
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1737
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1738
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
1739
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
1740
|
+
readonly createdBy: v.ObjectSchema<{
|
|
1741
|
+
readonly id: v.StringSchema<undefined>;
|
|
1742
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1743
|
+
}, undefined>;
|
|
1744
|
+
/** The version this one restored, while that version is still in the history. */
|
|
1745
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1746
|
+
/** Whether the document holds this version now. */
|
|
1747
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
1748
|
+
}, undefined>;
|
|
1749
|
+
}, undefined>;
|
|
1750
|
+
declare function parseSaveDocumentVersion(input: unknown): SaveDocumentVersionInput;
|
|
1751
|
+
declare function parseUpdateDocumentVersion(input: unknown): UpdateDocumentVersionInput;
|
|
1752
|
+
declare function parseDuplicateDocumentVersion(input: unknown): DuplicateDocumentVersionInput;
|
|
1753
|
+
//#endregion
|
|
1754
|
+
export { AICatalog, AICreditBucket, AIError, AIErrorCode, AIModel, AIToken, AITokenClaims, AIUsageEntry, AIUsagePage, AIUsageQuery, AIWallet, AI_ERROR_STATUS, AcceptDocumentInvitationInput, AcceptedInvitation, AccountSecurityErrorCode, AdminAuditEvent, AdminErrorCode, AdminOperations, CLOUD_AI_API_PATHS, CLOUD_AI_CONTRACT_VERSION, CLOUD_AI_JWKS_PATH, CLOUD_AI_TOKEN_AUDIENCE, CLOUD_DISCOVERY_PATH, CLOUD_DOCUMENT_NAME_MAX_LENGTH, CLOUD_IMAGE_NAME_PATTERN, CLOUD_MAX_DOCUMENT_IMAGES, CLOUD_PICTURE_MAX_BYTES, CLOUD_PICTURE_SIZE, CLOUD_PORTAL_PAGE_ROOTS, CLOUD_PROTOCOL_MAX_UPLOAD_BYTES, CLOUD_PROTOCOL_VERSION, COLLAB_ACTIONS, CloudAIDiscovery, CloudAccountSession, CloudAccountStatus, CloudActorContract, CloudAdminAuditFilter, CloudAdminEmailFilter, CloudAdminSessionResponse, CloudAdminUser, CloudAdminUserDetail, CloudAdminUserFilter, CloudAdminUsers, CloudAuthentication, CloudAuthenticationMethod, CloudAuthenticationMethods, CloudAuthenticationProvider, CloudBillingDiscovery, CloudCapabilities, CloudDeployment, CloudDiscovery, CloudLinkKind, CloudLinkPathKind, CloudListing, CloudPresence, CloudProfile, CloudSession, CloudSignIn, CloudSignInMethod, CloudUserProfile, CollaborationPrincipal, CollaborationTicket, CommitImageUploadsInput, CommitUploadInput, CommitUploadRequest, CreateAITokenInput, CreateDocumentInput, CreateDocumentInvitationInput, CreateDocumentRequest, CreateDocumentShareInput, CreateInvitationContinuationInput, CreateUploadInput, CreateWorkspaceInput, CreateWorkspaceInvitationInput, CreatedWorkspaceInvitation, DOCUMENT_VERSION_DESCRIPTION_MAX_LENGTH, DOCUMENT_VERSION_NAME_MAX_LENGTH, DocumentAccess, DocumentAccessSource, DocumentDownload, DocumentGrant, DocumentImageDownload, DocumentImageLink, DocumentInvitation, DocumentPermission, DocumentShare, DocumentSummary, DocumentVersion, DocumentVersionDownload, DocumentVersionKind, DocumentVersions, DuplicateDocumentVersionInput, Enrollment, EnrollmentStatus, ImageUploadOffer, InvitationContinuation, InvitationPreview, LookupCloudUserInput, MAX_COLLAB_MESSAGE_BYTES, MAX_PRESENCE_NAME_LENGTH, ObjectUploadTarget, PutDocumentGrantInput, RELAY_CLOSE, RELAY_DOCUMENT_PARAM, RELAY_FORWARDING_BYTES, RELAY_FRAGMENT_BYTES, RELAY_MINIMUM_MESSAGE_BYTES, RELAY_PATH, RELAY_SERVER_PEER, RelayAssembly, RelayClientFrame, RelayServerFrame, RequestImageLinksInput, RequestImageUploadsInput, RequestSharedImageLinksInput, ResolveDocumentShareInput, ResolvedDocumentShare, SaveDocumentVersionInput, SharedDocument, TransactionalEmailAdmin, UpdateDocumentShareInput, UpdateDocumentVersionInput, UpdateWorkspaceInput, UpdateWorkspaceMemberInput, WorkspaceEntitlements, WorkspaceInvitation, WorkspaceList, WorkspaceMember, WorkspaceMembers, WorkspaceRole, WorkspaceSummary, WorkspaceUsage, acceptDocumentInvitationSchema, acceptedInvitationSchema, accountSecurityErrorCodeSchema, accountSecurityErrorResponseSchema, adminAuditEventSchema, adminAuditResponseSchema, adminEmailResponseSchema, adminErrorCodeSchema, adminErrorResponseSchema, adminMutationResponseSchema, adminOperationsResponseSchema, aiCatalogSchema, aiCreditBucketSchema, aiErrorCodeSchema, aiErrorSchema, aiModelSchema, aiTokenClaimsSchema, aiTokenSchema, aiUsageEntrySchema, aiUsagePageSchema, aiUsageQuerySchema, aiWalletSchema, cloudAIDiscoverySchema, cloudAccountMutationResponseSchema, cloudAccountSessionSchema, cloudAccountSessionsResponseSchema, cloudAccountStateSchema, cloudAccountStatusResponseSchema, cloudActorSchema, cloudAdminAuditFilterSchema, cloudAdminEmailFilterSchema, cloudAdminSessionResponseSchema, cloudAdminUserDetailSchema, cloudAdminUserFilterSchema, cloudAdminUserSchema, cloudAdminUsersResponseSchema, cloudAuthenticationMethodSchema, cloudAuthenticationMethodsResponseSchema, cloudAuthenticationProviderSchema, cloudAuthenticationSchema, cloudBillingDiscoverySchema, cloudCapabilitiesSchema, cloudDeploymentSchema, cloudDesktopLinkURL, cloudDiscoverySchema, cloudDocumentPath, cloudDocumentURL, cloudEditorVersionSchema, cloudEmailChangeSchema, cloudIdentitySchema, cloudInvitationURL, cloudListingSchema, cloudMFAEnableResponseSchema, cloudMFAEnableSchema, cloudMFARecoveryCodesResponseSchema, cloudMFAStatusResponseSchema, cloudMFAStatusSchema, cloudMFAVerifyResponseSchema, cloudMFAVerifySchema, cloudPasskeyDeleteSchema, cloudPasskeySchema, cloudPasskeysResponseSchema, cloudPasswordChangeSchema, cloudPersonSchema, cloudPictureResponseSchema, cloudPictureUploadSchema, cloudPresenceSchema, cloudProfileResponseSchema, cloudProfileSchema, cloudProfileUpdateSchema, cloudServerOrigin, cloudSessionRevokeSchema, cloudSessionSchema, cloudShareURL, cloudSignInMethodSchema, cloudSignInSchema, cloudSignInsResponseSchema, cloudSocialLinkResponseSchema, cloudSocialLinkSchema, cloudUnlinkAuthenticationMethodSchema, cloudUserProfileSchema, collaborationPrincipalSchema, collaborationTicketSchema, commitImageUploadsSchema, commitUploadSchema, createAITokenSchema, createDocumentInvitationSchema, createDocumentSchema, createDocumentShareSchema, createInvitationContinuationSchema, createRelayClientAssembler, createRelayServerAssembler, createUploadSchema, createWorkspaceInvitationSchema, createWorkspaceSchema, createdWorkspaceInvitationSchema, decodeRelayClientFrame, decodeRelayServerFrame, decodeRoomUpdate, defaultRelayURL, documentAccessSchema, documentAccessSourceSchema, documentDownloadSchema, documentGrantSchema, documentImageDownloadSchema, documentImageLinkSchema, documentInvitationSchema, documentPermissionSchema, documentShareSchema, documentSummarySchema, documentVersionDownloadSchema, documentVersionKindSchema, documentVersionResponseSchema, documentVersionSchema, documentVersionsSchema, duplicateDocumentVersionSchema, encodeRelayClientFrame, encodeRelayServerFrame, encodeSyncReply, enrollmentReviewResponseSchema, enrollmentSchema, enrollmentStatusSchema, enrollmentsResponseSchema, imageUploadOfferSchema, invitationContinuationSchema, invitationPreviewSchema, isCloudChecksum, isCloudPortalPage, lookupCloudUserSchema, objectUploadSchema, parseAIUsageQuery, parseAcceptDocumentInvitation, parseCloudDiscovery, parseCloudEmailChange, parseCloudLinkPath, parseCloudMFAEnable, parseCloudMFAVerify, parseCloudPasskeyDelete, parseCloudPasswordChange, parseCloudPictureUpload, parseCloudProfileUpdate, parseCloudSessionRevoke, parseCloudSocialLink, parseCloudUnlinkAuthenticationMethod, parseCommitImageUploads, parseCommitUpload, parseCreateAIToken, parseCreateDocument, parseCreateDocumentInvitation, parseCreateDocumentShare, parseCreateInvitationContinuation, parseCreateUpload, parseCreateWorkspace, parseCreateWorkspaceInvitation, parseDuplicateDocumentVersion, parseLookupCloudUser, parsePutDocumentGrant, parseRequestImageLinks, parseRequestImageUploads, parseRequestSharedImageLinks, parseResolveDocumentShare, parseSaveDocumentVersion, parseUpdateDocumentShare, parseUpdateDocumentVersion, parseUpdateWorkspace, parseUpdateWorkspaceMember, presenceName, putDocumentGrantSchema, relayClientMessages, relayServerMessages, requestImageLinksSchema, requestImageUploadsSchema, requestSharedImageLinksSchema, resolveDocumentShareSchema, resolvedDocumentShareSchema, restoredDocumentSchema, saveDocumentVersionSchema, sharedDocumentSchema, transactionalEmailAdminSchema, updateDocumentShareSchema, updateDocumentVersionSchema, updateWorkspaceMemberSchema, updateWorkspaceSchema, workspaceEntitlementsSchema, workspaceInvitationSchema, workspaceListSchema, workspaceMemberSchema, workspaceMembersSchema, workspaceRoleSchema, workspaceSummarySchema, workspaceUsageSchema };
|
|
1755
|
+
//# sourceMappingURL=index.d.ts.map
|