@open-pencil/cloud 0.0.0-stage → 0.16.0
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/client.d.ts
ADDED
|
@@ -0,0 +1,1520 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { createAuthClient } from "better-auth/client";
|
|
3
|
+
//#region src/contract/account.d.ts
|
|
4
|
+
declare const accountSecurityErrorCodeSchema: v.PicklistSchema<["current_password_invalid", "password_too_short", "password_too_long", "last_authentication_method", "session_not_fresh", "authentication_method_failed", "email_unchanged", "email_change_unavailable", "current_session", "picture_invalid"], undefined>;
|
|
5
|
+
type AccountSecurityErrorCode = v.InferOutput<typeof accountSecurityErrorCodeSchema>;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/contract/ai.d.ts
|
|
8
|
+
declare const aiTokenSchema: v.ObjectSchema<{
|
|
9
|
+
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
10
|
+
readonly expiresAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
11
|
+
}, undefined>;
|
|
12
|
+
type AIToken = v.InferOutput<typeof aiTokenSchema>;
|
|
13
|
+
declare const aiCatalogSchema: v.ObjectSchema<{
|
|
14
|
+
readonly models: v.ArraySchema<v.ObjectSchema<{
|
|
15
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
16
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
17
|
+
/** Credits per million input and output tokens. */
|
|
18
|
+
readonly creditsPerMillionInputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
19
|
+
readonly creditsPerMillionOutputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
20
|
+
readonly contextTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
21
|
+
readonly capabilities: v.ObjectSchema<{
|
|
22
|
+
readonly reasoning: v.BooleanSchema<undefined>;
|
|
23
|
+
readonly vision: v.BooleanSchema<undefined>;
|
|
24
|
+
readonly tools: v.BooleanSchema<undefined>;
|
|
25
|
+
}, undefined>;
|
|
26
|
+
}, undefined>, undefined>;
|
|
27
|
+
readonly defaultModelID: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
28
|
+
}, undefined>;
|
|
29
|
+
type AICatalog = v.InferOutput<typeof aiCatalogSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* A service records a request's charge before the request's answer ends, so a wallet read after
|
|
32
|
+
* an answer includes what it cost.
|
|
33
|
+
*/
|
|
34
|
+
declare const aiWalletSchema: v.ObjectSchema<{
|
|
35
|
+
/** Credits left to spend; `null` when the service sets no limit. */
|
|
36
|
+
readonly balance: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
37
|
+
/** Spent first to last. */
|
|
38
|
+
readonly buckets: v.ArraySchema<v.ObjectSchema<{
|
|
39
|
+
readonly kind: v.PicklistSchema<["allowance", "purchased", "grant"], undefined>;
|
|
40
|
+
readonly remaining: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
41
|
+
readonly expiresAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
|
|
42
|
+
}, undefined>, undefined>;
|
|
43
|
+
}, undefined>;
|
|
44
|
+
type AIWallet = v.InferOutput<typeof aiWalletSchema>;
|
|
45
|
+
/** Errors an AI service answers with, beside the upstream model's own. */
|
|
46
|
+
declare const aiErrorCodeSchema: v.PicklistSchema<["unauthorized", "insufficient_credits", "model_not_allowed", "rate_limited"], undefined>;
|
|
47
|
+
type AIErrorCode = v.InferOutput<typeof aiErrorCodeSchema>;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/contract/admin/index.d.ts
|
|
50
|
+
declare const adminErrorCodeSchema: v.PicklistSchema<["bad_request", "unauthorized", "forbidden", "not_found", "rate_limited", "invalid_enrollment_transition", "last_admin_required", "self_admin_action_forbidden", "email_regeneration_unavailable", "mfa_required"], undefined>;
|
|
51
|
+
declare const enrollmentStatusSchema: v.PicklistSchema<["pending", "approved", "rejected", "revoked"], undefined>;
|
|
52
|
+
/** Which accounts a list of people shows. */
|
|
53
|
+
declare const cloudAdminUserFilterSchema: v.PicklistSchema<["all", "administrators", "suspended", "without-two-step"], undefined>;
|
|
54
|
+
/** Which messages a list of email shows, by how their delivery went. */
|
|
55
|
+
declare const cloudAdminEmailFilterSchema: v.PicklistSchema<["all", "sent", "waiting", "failed"], undefined>;
|
|
56
|
+
/** Which events a list of activity shows, by what they are about. */
|
|
57
|
+
declare const cloudAdminAuditFilterSchema: v.PicklistSchema<["all", "accounts", "requests", "email"], undefined>;
|
|
58
|
+
type AdminErrorCode = v.InferOutput<typeof adminErrorCodeSchema>;
|
|
59
|
+
type CloudAdminUserFilter = v.InferOutput<typeof cloudAdminUserFilterSchema>;
|
|
60
|
+
type CloudAdminEmailFilter = v.InferOutput<typeof cloudAdminEmailFilterSchema>;
|
|
61
|
+
type CloudAdminAuditFilter = v.InferOutput<typeof cloudAdminAuditFilterSchema>;
|
|
62
|
+
type EnrollmentStatus = v.InferOutput<typeof enrollmentStatusSchema>;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/contract/collaboration.d.ts
|
|
65
|
+
declare const collaborationTicketSchema: v.ObjectSchema<{
|
|
66
|
+
readonly token: v.StringSchema<undefined>;
|
|
67
|
+
readonly provider: v.OptionalSchema<v.PicklistSchema<["trystero", "relay"], undefined>, undefined>;
|
|
68
|
+
readonly serverURL: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
|
|
69
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
70
|
+
readonly roomId: v.StringSchema<undefined>;
|
|
71
|
+
readonly roomKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 43, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
72
|
+
readonly principal: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
73
|
+
readonly kind: v.LiteralSchema<"user", undefined>;
|
|
74
|
+
readonly userId: v.StringSchema<undefined>;
|
|
75
|
+
readonly name: v.StringSchema<undefined>;
|
|
76
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
77
|
+
}, undefined>, v.ObjectSchema<{
|
|
78
|
+
readonly kind: v.LiteralSchema<"guest", undefined>;
|
|
79
|
+
readonly guestId: v.StringSchema<undefined>;
|
|
80
|
+
readonly name: v.StringSchema<undefined>;
|
|
81
|
+
}, undefined>], undefined>;
|
|
82
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
83
|
+
readonly roomEpoch: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
84
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
85
|
+
readonly serverEnforcedWrites: v.BooleanSchema<undefined>;
|
|
86
|
+
}, undefined>;
|
|
87
|
+
type CollaborationTicket = v.InferOutput<typeof collaborationTicketSchema>;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/contract/entitlements.d.ts
|
|
90
|
+
declare const workspaceEntitlementsSchema: v.ObjectSchema<{
|
|
91
|
+
readonly features: v.ObjectSchema<{
|
|
92
|
+
readonly links: v.BooleanSchema<undefined>;
|
|
93
|
+
readonly guestView: v.BooleanSchema<undefined>;
|
|
94
|
+
readonly guestEdit: v.BooleanSchema<undefined>;
|
|
95
|
+
readonly guestPresence: v.BooleanSchema<undefined>;
|
|
96
|
+
readonly collaboration: v.BooleanSchema<undefined>;
|
|
97
|
+
readonly revisionHistory: v.BooleanSchema<undefined>;
|
|
98
|
+
readonly cloudAI: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
99
|
+
}, undefined>;
|
|
100
|
+
readonly limits: v.ObjectSchema<{
|
|
101
|
+
readonly maximumFileBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
102
|
+
readonly maximumStorageBytes: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
103
|
+
readonly maximumParticipants: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
104
|
+
readonly monthlyCreditAllowance: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, null>;
|
|
105
|
+
}, undefined>;
|
|
106
|
+
readonly usage: v.ObjectSchema<{
|
|
107
|
+
readonly committedStorageBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
108
|
+
readonly reservedStorageBytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
109
|
+
}, undefined>;
|
|
110
|
+
}, undefined>;
|
|
111
|
+
type WorkspaceEntitlements = v.InferOutput<typeof workspaceEntitlementsSchema>;
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/contract/discovery.d.ts
|
|
114
|
+
declare const cloudDiscoverySchema: v.ObjectSchema<{
|
|
115
|
+
readonly protocolVersion: v.LiteralSchema<"1", undefined>;
|
|
116
|
+
readonly deployment: v.PicklistSchema<["official", "self-hosted"], undefined>;
|
|
117
|
+
readonly apiURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
118
|
+
readonly authURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
119
|
+
/** Whether the server's own editor works with files on this device without signing in. */
|
|
120
|
+
readonly localEditor: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
121
|
+
readonly authentication: v.ObjectSchema<{
|
|
122
|
+
readonly emailPassword: v.OptionalSchema<v.ObjectSchema<{
|
|
123
|
+
readonly signIn: v.BooleanSchema<undefined>;
|
|
124
|
+
readonly signUp: v.BooleanSchema<undefined>;
|
|
125
|
+
readonly minimumPasswordLength: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 8, undefined>]>;
|
|
126
|
+
readonly captcha: v.OptionalSchema<v.ObjectSchema<{
|
|
127
|
+
readonly provider: v.LiteralSchema<"cloudflare-turnstile", undefined>;
|
|
128
|
+
readonly siteKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
129
|
+
}, undefined>, undefined>;
|
|
130
|
+
}, undefined>, undefined>;
|
|
131
|
+
readonly socialProviders: v.ArraySchema<v.PicklistSchema<["apple", "google"], undefined>, undefined>;
|
|
132
|
+
readonly enterpriseSSO: v.BooleanSchema<undefined>;
|
|
133
|
+
readonly enrollmentMode: v.OptionalSchema<v.PicklistSchema<["open", "approval", "closed"], undefined>, "open">;
|
|
134
|
+
readonly mfa: v.OptionalSchema<v.ObjectSchema<{
|
|
135
|
+
readonly deploymentAdminRequired: v.BooleanSchema<undefined>;
|
|
136
|
+
readonly totp: v.BooleanSchema<undefined>;
|
|
137
|
+
readonly passkeys: v.BooleanSchema<undefined>;
|
|
138
|
+
readonly recoveryCodes: v.BooleanSchema<undefined>;
|
|
139
|
+
}, undefined>, undefined>;
|
|
140
|
+
}, undefined>;
|
|
141
|
+
readonly capabilities: v.ObjectSchema<{
|
|
142
|
+
readonly documents: v.BooleanSchema<undefined>;
|
|
143
|
+
readonly workspaces: v.BooleanSchema<undefined>;
|
|
144
|
+
readonly collaboration: v.BooleanSchema<undefined>;
|
|
145
|
+
}, undefined>;
|
|
146
|
+
readonly listing: v.OptionalSchema<v.ObjectSchema<{
|
|
147
|
+
readonly minimumEditorVersion: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
148
|
+
}, undefined>, undefined>;
|
|
149
|
+
/** The AI service editors reach with Cloud-signed tokens; absent when the deployment has none. */
|
|
150
|
+
readonly ai: v.OptionalSchema<v.ObjectSchema<{
|
|
151
|
+
readonly endpoint: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
152
|
+
readonly contractVersion: v.LiteralSchema<"1", undefined>;
|
|
153
|
+
}, undefined>, undefined>;
|
|
154
|
+
/** Where people manage their plan and buy credits; absent when the deployment does not bill. */
|
|
155
|
+
readonly billing: v.OptionalSchema<v.ObjectSchema<{
|
|
156
|
+
readonly portalURL: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
157
|
+
}, undefined>, undefined>;
|
|
158
|
+
}, undefined>;
|
|
159
|
+
type CloudDiscovery = v.InferOutput<typeof cloudDiscoverySchema>;
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/contract/documents.d.ts
|
|
162
|
+
/** Where to download an image a document uses, found by its checksum. */
|
|
163
|
+
declare const documentImageLinkSchema: v.ObjectSchema<{
|
|
164
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
165
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
166
|
+
readonly download: v.ObjectSchema<{
|
|
167
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
168
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
169
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
170
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
171
|
+
}, undefined>;
|
|
172
|
+
}, undefined>;
|
|
173
|
+
type DocumentImageLink = v.InferOutput<typeof documentImageLinkSchema>;
|
|
174
|
+
declare const documentAccessSchema: v.ObjectSchema<{
|
|
175
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
176
|
+
readonly canManageSharing: v.BooleanSchema<undefined>;
|
|
177
|
+
readonly sources: v.ArraySchema<v.PicklistSchema<["owner", "workspace", "direct-grant"], undefined>, undefined>;
|
|
178
|
+
}, undefined>;
|
|
179
|
+
type DocumentAccess = v.InferOutput<typeof documentAccessSchema>;
|
|
180
|
+
declare const documentSummarySchema: v.ObjectSchema<{
|
|
181
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
182
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
183
|
+
readonly name: v.StringSchema<undefined>;
|
|
184
|
+
/** A design unless said otherwise; servers from before boards list no kind. */
|
|
185
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
186
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
187
|
+
readonly version: v.NumberSchema<undefined>;
|
|
188
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
189
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
190
|
+
}, undefined>;
|
|
191
|
+
type DocumentSummary = v.InferOutput<typeof documentSummarySchema>;
|
|
192
|
+
/** A document someone granted the person directly, in a workspace they are not a member of. */
|
|
193
|
+
declare const sharedDocumentSchema: v.ObjectSchema<{
|
|
194
|
+
readonly workspaceName: v.StringSchema<undefined>;
|
|
195
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
196
|
+
readonly sharedBy: v.NullableSchema<v.ObjectSchema<{
|
|
197
|
+
readonly name: v.StringSchema<undefined>;
|
|
198
|
+
}, undefined>, undefined>;
|
|
199
|
+
readonly sharedAt: v.StringSchema<undefined>;
|
|
200
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
201
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
202
|
+
readonly name: v.StringSchema<undefined>;
|
|
203
|
+
/** A design unless said otherwise; servers from before boards list no kind. */
|
|
204
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
205
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
206
|
+
readonly version: v.NumberSchema<undefined>;
|
|
207
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
208
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
209
|
+
}, undefined>;
|
|
210
|
+
type SharedDocument = v.InferOutput<typeof sharedDocumentSchema>;
|
|
211
|
+
declare const documentDownloadSchema: v.ObjectSchema<{
|
|
212
|
+
readonly document: v.ObjectSchema<{
|
|
213
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
214
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
215
|
+
readonly name: v.StringSchema<undefined>;
|
|
216
|
+
/** A design unless said otherwise; servers from before boards list no kind. */
|
|
217
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
218
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
219
|
+
readonly version: v.NumberSchema<undefined>;
|
|
220
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
221
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
222
|
+
}, undefined>;
|
|
223
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
224
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
225
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
226
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
227
|
+
readonly download: v.ObjectSchema<{
|
|
228
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
229
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
230
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
231
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
232
|
+
}, undefined>;
|
|
233
|
+
/** The images the stored file leaves out, which a client puts back under their names. */
|
|
234
|
+
readonly images: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
235
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
236
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
237
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
238
|
+
readonly download: v.ObjectSchema<{
|
|
239
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
240
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
241
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
242
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
243
|
+
}, undefined>;
|
|
244
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
245
|
+
name: string;
|
|
246
|
+
checksum: string;
|
|
247
|
+
byteSize: number;
|
|
248
|
+
download: {
|
|
249
|
+
url: string;
|
|
250
|
+
method: "GET";
|
|
251
|
+
headers: {
|
|
252
|
+
[x: string]: string;
|
|
253
|
+
};
|
|
254
|
+
expiresAt: string;
|
|
255
|
+
};
|
|
256
|
+
}[], 10000, undefined>]>;
|
|
257
|
+
}, undefined>;
|
|
258
|
+
type DocumentDownload = v.InferOutput<typeof documentDownloadSchema>;
|
|
259
|
+
declare const cloudSessionSchema: v.ObjectSchema<{
|
|
260
|
+
readonly user: v.ObjectSchema<{
|
|
261
|
+
readonly userId: v.StringSchema<undefined>;
|
|
262
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
263
|
+
readonly name: v.StringSchema<undefined>;
|
|
264
|
+
}, undefined>;
|
|
265
|
+
}, undefined>;
|
|
266
|
+
type CloudSession = v.InferOutput<typeof cloudSessionSchema>;
|
|
267
|
+
declare const workspaceUsageSchema: v.ObjectSchema<{
|
|
268
|
+
readonly bytesUsed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
269
|
+
readonly objectCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
270
|
+
readonly documentCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
271
|
+
}, undefined>;
|
|
272
|
+
type WorkspaceUsage = v.InferOutput<typeof workspaceUsageSchema>;
|
|
273
|
+
declare const createDocumentSchema: v.ObjectSchema<{
|
|
274
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
275
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
276
|
+
/** A design unless said otherwise; older clients create only designs. */
|
|
277
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
278
|
+
}, undefined>;
|
|
279
|
+
/** A new document as a client sends it, which may leave out its kind to make a design. */
|
|
280
|
+
type CreateDocumentRequest = v.InferInput<typeof createDocumentSchema>;
|
|
281
|
+
declare const createUploadSchema: v.ObjectSchema<{
|
|
282
|
+
readonly baseRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
283
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
|
|
284
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
285
|
+
readonly contentType: v.LiteralSchema<"application/octet-stream", undefined>;
|
|
286
|
+
}, undefined>;
|
|
287
|
+
type CreateUploadInput = v.InferOutput<typeof createUploadSchema>;
|
|
288
|
+
/** An upload the server offers for an image the workspace lacks. */
|
|
289
|
+
declare const imageUploadOfferSchema: v.ObjectSchema<{
|
|
290
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
291
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
292
|
+
readonly upload: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
293
|
+
readonly kind: v.LiteralSchema<"single", undefined>;
|
|
294
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
295
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
296
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
297
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
298
|
+
}, undefined>, v.ObjectSchema<{
|
|
299
|
+
readonly kind: v.LiteralSchema<"multipart", undefined>;
|
|
300
|
+
readonly uploadId: v.StringSchema<undefined>;
|
|
301
|
+
readonly partSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
302
|
+
readonly parts: v.ArraySchema<v.ObjectSchema<{
|
|
303
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
304
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
305
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
306
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
307
|
+
}, undefined>, undefined>;
|
|
308
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
309
|
+
}, undefined>], undefined>;
|
|
310
|
+
}, undefined>;
|
|
311
|
+
type ImageUploadOffer = v.InferOutput<typeof imageUploadOfferSchema>;
|
|
312
|
+
/** The images a save will refer to; the server answers with uploads for those it lacks. */
|
|
313
|
+
declare const requestImageUploadsSchema: v.ObjectSchema<{
|
|
314
|
+
readonly images: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
315
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
316
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>;
|
|
317
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
318
|
+
checksum: string;
|
|
319
|
+
byteSize: number;
|
|
320
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
321
|
+
checksum: string;
|
|
322
|
+
byteSize: number;
|
|
323
|
+
}[], 10000, undefined>]>;
|
|
324
|
+
}, undefined>;
|
|
325
|
+
type RequestImageUploadsInput = v.InferOutput<typeof requestImageUploadsSchema>;
|
|
326
|
+
declare const commitUploadSchema: v.ObjectSchema<{
|
|
327
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
328
|
+
/** The document title captured with this revision; omitted by older clients. */
|
|
329
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
330
|
+
/** What the uploaded file is, which the document takes; omitted by older clients. */
|
|
331
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, undefined>;
|
|
332
|
+
readonly multipart: v.OptionalSchema<v.ObjectSchema<{
|
|
333
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
334
|
+
readonly parts: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
335
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
336
|
+
readonly etag: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
337
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
338
|
+
partNumber: number;
|
|
339
|
+
etag: string;
|
|
340
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
341
|
+
partNumber: number;
|
|
342
|
+
etag: string;
|
|
343
|
+
}[], 10000, undefined>]>;
|
|
344
|
+
}, undefined>, undefined>;
|
|
345
|
+
/** The images the uploaded file leaves out, each stored in the workspace or uploaded before. */
|
|
346
|
+
readonly images: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
347
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
348
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
349
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
350
|
+
name: string;
|
|
351
|
+
checksum: string;
|
|
352
|
+
}[], 10000, undefined>]>, readonly []>;
|
|
353
|
+
}, undefined>;
|
|
354
|
+
/** The image uploads a save asked for, committed together once their bytes are in place. */
|
|
355
|
+
declare const commitImageUploadsSchema: v.ObjectSchema<{
|
|
356
|
+
readonly uploads: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
357
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
358
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
359
|
+
readonly multipart: v.OptionalSchema<v.ObjectSchema<{
|
|
360
|
+
readonly uploadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
361
|
+
readonly parts: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
362
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
363
|
+
readonly etag: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
364
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
365
|
+
partNumber: number;
|
|
366
|
+
etag: string;
|
|
367
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
368
|
+
partNumber: number;
|
|
369
|
+
etag: string;
|
|
370
|
+
}[], 10000, undefined>]>;
|
|
371
|
+
}, undefined>, undefined>;
|
|
372
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
373
|
+
uploadId: string;
|
|
374
|
+
checksum: string;
|
|
375
|
+
multipart?: {
|
|
376
|
+
uploadId: string;
|
|
377
|
+
parts: {
|
|
378
|
+
partNumber: number;
|
|
379
|
+
etag: string;
|
|
380
|
+
}[];
|
|
381
|
+
} | undefined;
|
|
382
|
+
}[], 1, undefined>, v.MaxLengthAction<{
|
|
383
|
+
uploadId: string;
|
|
384
|
+
checksum: string;
|
|
385
|
+
multipart?: {
|
|
386
|
+
uploadId: string;
|
|
387
|
+
parts: {
|
|
388
|
+
partNumber: number;
|
|
389
|
+
etag: string;
|
|
390
|
+
}[];
|
|
391
|
+
} | undefined;
|
|
392
|
+
}[], 10000, undefined>]>;
|
|
393
|
+
}, undefined>;
|
|
394
|
+
type CommitImageUploadsInput = v.InferOutput<typeof commitImageUploadsSchema>;
|
|
395
|
+
/** A commit as a client sends it, which may leave out the images a whole file holds itself. */
|
|
396
|
+
type CommitUploadRequest = v.InferInput<typeof commitUploadSchema>;
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/contract/sharing.d.ts
|
|
399
|
+
declare const documentShareSchema: v.ObjectSchema<{
|
|
400
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
401
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
402
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
403
|
+
readonly roomEpoch: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
404
|
+
readonly createdBy: v.StringSchema<undefined>;
|
|
405
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
406
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
407
|
+
readonly expiresAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
408
|
+
readonly revokedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
409
|
+
readonly lastUsedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
410
|
+
}, undefined>;
|
|
411
|
+
type DocumentShare = v.InferOutput<typeof documentShareSchema>;
|
|
412
|
+
declare const createDocumentShareSchema: v.ObjectSchema<{
|
|
413
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
414
|
+
readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
|
|
415
|
+
}, undefined>;
|
|
416
|
+
type CreateDocumentShareInput = v.InferOutput<typeof createDocumentShareSchema>;
|
|
417
|
+
declare const updateDocumentShareSchema: v.ObjectSchema<{
|
|
418
|
+
readonly permission: v.OptionalSchema<v.PicklistSchema<["view", "edit"], undefined>, undefined>;
|
|
419
|
+
readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
|
|
420
|
+
}, undefined>;
|
|
421
|
+
type UpdateDocumentShareInput = v.InferOutput<typeof updateDocumentShareSchema>;
|
|
422
|
+
declare const resolveDocumentShareSchema: v.ObjectSchema<{
|
|
423
|
+
readonly secret: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
424
|
+
readonly guestName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, undefined>;
|
|
425
|
+
readonly guestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
|
|
426
|
+
}, undefined>;
|
|
427
|
+
type ResolveDocumentShareInput = v.InferOutput<typeof resolveDocumentShareSchema>;
|
|
428
|
+
declare const cloudUserProfileSchema: v.ObjectSchema<{
|
|
429
|
+
readonly id: v.StringSchema<undefined>;
|
|
430
|
+
readonly name: v.StringSchema<undefined>;
|
|
431
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
432
|
+
readonly image: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
|
|
433
|
+
}, undefined>;
|
|
434
|
+
type CloudUserProfile = v.InferOutput<typeof cloudUserProfileSchema>;
|
|
435
|
+
declare const documentGrantSchema: v.ObjectSchema<{
|
|
436
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
437
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
438
|
+
readonly userId: v.StringSchema<undefined>;
|
|
439
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
440
|
+
readonly createdBy: v.StringSchema<undefined>;
|
|
441
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
442
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
443
|
+
}, undefined>;
|
|
444
|
+
type DocumentGrant = v.InferOutput<typeof documentGrantSchema>;
|
|
445
|
+
/** What accepting an invitation gave: access to a document, or a place in a workspace. */
|
|
446
|
+
declare const acceptedInvitationSchema: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
447
|
+
readonly kind: v.LiteralSchema<"document", undefined>;
|
|
448
|
+
readonly grant: v.ObjectSchema<{
|
|
449
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
450
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
451
|
+
readonly userId: v.StringSchema<undefined>;
|
|
452
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
453
|
+
readonly createdBy: v.StringSchema<undefined>;
|
|
454
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
455
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
456
|
+
}, undefined>;
|
|
457
|
+
}, undefined>, v.ObjectSchema<{
|
|
458
|
+
readonly kind: v.LiteralSchema<"workspace", undefined>;
|
|
459
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
460
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
461
|
+
}, undefined>], undefined>;
|
|
462
|
+
type AcceptedInvitation = v.InferOutput<typeof acceptedInvitationSchema>;
|
|
463
|
+
declare const lookupCloudUserSchema: v.ObjectSchema<{
|
|
464
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
|
|
465
|
+
}, undefined>;
|
|
466
|
+
type LookupCloudUserInput = v.InferOutput<typeof lookupCloudUserSchema>;
|
|
467
|
+
declare const putDocumentGrantSchema: v.ObjectSchema<{
|
|
468
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
469
|
+
}, undefined>;
|
|
470
|
+
type PutDocumentGrantInput = v.InferOutput<typeof putDocumentGrantSchema>;
|
|
471
|
+
declare const createDocumentInvitationSchema: v.ObjectSchema<{
|
|
472
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
|
|
473
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
474
|
+
}, undefined>;
|
|
475
|
+
type CreateDocumentInvitationInput = v.InferOutput<typeof createDocumentInvitationSchema>;
|
|
476
|
+
declare const acceptDocumentInvitationSchema: v.ObjectSchema<{
|
|
477
|
+
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
478
|
+
}, undefined>;
|
|
479
|
+
type AcceptDocumentInvitationInput = v.InferOutput<typeof acceptDocumentInvitationSchema>;
|
|
480
|
+
declare const createInvitationContinuationSchema: v.ObjectSchema<{
|
|
481
|
+
readonly invitationId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
482
|
+
readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 32, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
483
|
+
}, undefined>;
|
|
484
|
+
type CreateInvitationContinuationInput = v.InferOutput<typeof createInvitationContinuationSchema>;
|
|
485
|
+
declare const invitationContinuationSchema: v.ObjectSchema<{
|
|
486
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 16, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
487
|
+
}, undefined>;
|
|
488
|
+
type InvitationContinuation = v.InferOutput<typeof invitationContinuationSchema>;
|
|
489
|
+
/** What an invitation link opens: one document, or a whole workspace. */
|
|
490
|
+
declare const invitationPreviewSchema: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
491
|
+
readonly inviterName: v.StringSchema<undefined>;
|
|
492
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
493
|
+
readonly recipientHint: v.StringSchema<undefined>;
|
|
494
|
+
readonly kind: v.LiteralSchema<"document", undefined>;
|
|
495
|
+
readonly documentName: v.StringSchema<undefined>;
|
|
496
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
497
|
+
}, undefined>, v.ObjectSchema<{
|
|
498
|
+
readonly inviterName: v.StringSchema<undefined>;
|
|
499
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
500
|
+
readonly recipientHint: v.StringSchema<undefined>;
|
|
501
|
+
readonly kind: v.LiteralSchema<"workspace", undefined>;
|
|
502
|
+
readonly workspaceName: v.StringSchema<undefined>;
|
|
503
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
504
|
+
}, undefined>], undefined>;
|
|
505
|
+
type InvitationPreview = v.InferOutput<typeof invitationPreviewSchema>;
|
|
506
|
+
declare const documentInvitationSchema: v.ObjectSchema<{
|
|
507
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
508
|
+
readonly documentId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
509
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
510
|
+
readonly permission: v.PicklistSchema<["view", "edit"], undefined>;
|
|
511
|
+
readonly invitedBy: v.StringSchema<undefined>;
|
|
512
|
+
readonly invitedAt: v.StringSchema<undefined>;
|
|
513
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
514
|
+
readonly acceptedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
515
|
+
}, undefined>;
|
|
516
|
+
type DocumentInvitation = v.InferOutput<typeof documentInvitationSchema>;
|
|
517
|
+
//#endregion
|
|
518
|
+
//#region src/contract/workspaces.d.ts
|
|
519
|
+
declare const workspaceRoleSchema: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
520
|
+
type WorkspaceRole = v.InferOutput<typeof workspaceRoleSchema>;
|
|
521
|
+
declare const workspaceSummarySchema: v.ObjectSchema<{
|
|
522
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
523
|
+
readonly name: v.StringSchema<undefined>;
|
|
524
|
+
readonly slug: v.StringSchema<undefined>;
|
|
525
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
526
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
527
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
528
|
+
}, undefined>;
|
|
529
|
+
type WorkspaceSummary = v.InferOutput<typeof workspaceSummarySchema>;
|
|
530
|
+
declare const workspaceListSchema: v.ObjectSchema<{
|
|
531
|
+
readonly workspaces: v.ArraySchema<v.ObjectSchema<{
|
|
532
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
533
|
+
readonly name: v.StringSchema<undefined>;
|
|
534
|
+
readonly slug: v.StringSchema<undefined>;
|
|
535
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
536
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
537
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
538
|
+
}, undefined>, undefined>;
|
|
539
|
+
}, undefined>;
|
|
540
|
+
type WorkspaceList = v.InferOutput<typeof workspaceListSchema>;
|
|
541
|
+
declare const workspaceMembersSchema: v.ObjectSchema<{
|
|
542
|
+
readonly members: v.ArraySchema<v.ObjectSchema<{
|
|
543
|
+
readonly userId: v.StringSchema<undefined>;
|
|
544
|
+
readonly name: v.StringSchema<undefined>;
|
|
545
|
+
readonly email: v.StringSchema<undefined>;
|
|
546
|
+
readonly image: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
547
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
548
|
+
readonly joinedAt: v.StringSchema<undefined>;
|
|
549
|
+
}, undefined>, undefined>;
|
|
550
|
+
/** Only administrators see pending invitations. */
|
|
551
|
+
readonly invitations: v.ArraySchema<v.ObjectSchema<{
|
|
552
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
553
|
+
readonly email: v.StringSchema<undefined>;
|
|
554
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
555
|
+
/** Who sent it; the name is null once their account is gone. */
|
|
556
|
+
readonly invitedBy: v.ObjectSchema<{
|
|
557
|
+
readonly id: v.StringSchema<undefined>;
|
|
558
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
559
|
+
}, undefined>;
|
|
560
|
+
readonly invitedAt: v.StringSchema<undefined>;
|
|
561
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
562
|
+
}, undefined>, undefined>;
|
|
563
|
+
}, undefined>;
|
|
564
|
+
type WorkspaceMembers = v.InferOutput<typeof workspaceMembersSchema>;
|
|
565
|
+
declare const createWorkspaceInvitationSchema: v.ObjectSchema<{
|
|
566
|
+
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.EmailAction<string, undefined>]>;
|
|
567
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
568
|
+
}, undefined>;
|
|
569
|
+
type CreateWorkspaceInvitationInput = v.InferOutput<typeof createWorkspaceInvitationSchema>;
|
|
570
|
+
/** A new invitation and its link, for an administrator to pass on when email is off. */
|
|
571
|
+
declare const createdWorkspaceInvitationSchema: v.ObjectSchema<{
|
|
572
|
+
readonly invitation: v.ObjectSchema<{
|
|
573
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
574
|
+
readonly email: v.StringSchema<undefined>;
|
|
575
|
+
readonly role: v.PicklistSchema<["viewer", "editor", "admin"], undefined>;
|
|
576
|
+
/** Who sent it; the name is null once their account is gone. */
|
|
577
|
+
readonly invitedBy: v.ObjectSchema<{
|
|
578
|
+
readonly id: v.StringSchema<undefined>;
|
|
579
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
580
|
+
}, undefined>;
|
|
581
|
+
readonly invitedAt: v.StringSchema<undefined>;
|
|
582
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
583
|
+
}, undefined>;
|
|
584
|
+
readonly acceptanceURL: v.StringSchema<undefined>;
|
|
585
|
+
}, undefined>;
|
|
586
|
+
type CreatedWorkspaceInvitation = v.InferOutput<typeof createdWorkspaceInvitationSchema>;
|
|
587
|
+
//#endregion
|
|
588
|
+
//#region src/contract/versions.d.ts
|
|
589
|
+
declare const documentVersionSchema: v.ObjectSchema<{
|
|
590
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
591
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
592
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
593
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
594
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
595
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
596
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
597
|
+
readonly createdBy: v.ObjectSchema<{
|
|
598
|
+
readonly id: v.StringSchema<undefined>;
|
|
599
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
600
|
+
}, undefined>;
|
|
601
|
+
/** The version this one restored, while that version is still in the history. */
|
|
602
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
603
|
+
/** Whether the document holds this version now. */
|
|
604
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
605
|
+
}, undefined>;
|
|
606
|
+
type DocumentVersion = v.InferOutput<typeof documentVersionSchema>;
|
|
607
|
+
declare const documentVersionsSchema: v.ObjectSchema<{
|
|
608
|
+
readonly versions: v.ArraySchema<v.ObjectSchema<{
|
|
609
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
610
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
611
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
612
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
613
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
614
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
615
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
616
|
+
readonly createdBy: v.ObjectSchema<{
|
|
617
|
+
readonly id: v.StringSchema<undefined>;
|
|
618
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
619
|
+
}, undefined>;
|
|
620
|
+
/** The version this one restored, while that version is still in the history. */
|
|
621
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
622
|
+
/** Whether the document holds this version now. */
|
|
623
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
624
|
+
}, undefined>, undefined>;
|
|
625
|
+
/** Pass as `before` for the next, older page; null on the last one. */
|
|
626
|
+
readonly nextCursor: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
627
|
+
}, undefined>;
|
|
628
|
+
type DocumentVersions = v.InferOutput<typeof documentVersionsSchema>;
|
|
629
|
+
/** Names the document as it is now, like Save to version history. */
|
|
630
|
+
declare const saveDocumentVersionSchema: v.ObjectSchema<{
|
|
631
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>;
|
|
632
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 1000, undefined>]>, "">;
|
|
633
|
+
}, undefined>;
|
|
634
|
+
type SaveDocumentVersionInput = v.InferOutput<typeof saveDocumentVersionSchema>;
|
|
635
|
+
/** Names a version or changes its name; a null name deletes its info and leaves a checkpoint. */
|
|
636
|
+
declare const updateDocumentVersionSchema: v.ObjectSchema<{
|
|
637
|
+
readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 100, undefined>]>, undefined>;
|
|
638
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 1000, undefined>]>, "">;
|
|
639
|
+
}, undefined>;
|
|
640
|
+
type UpdateDocumentVersionInput = v.InferOutput<typeof updateDocumentVersionSchema>;
|
|
641
|
+
declare const duplicateDocumentVersionSchema: v.ObjectSchema<{
|
|
642
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
643
|
+
}, undefined>;
|
|
644
|
+
type DuplicateDocumentVersionInput = v.InferOutput<typeof duplicateDocumentVersionSchema>;
|
|
645
|
+
/** A version with where to download it, so a link to it can show it without the history. */
|
|
646
|
+
declare const documentVersionDownloadSchema: v.ObjectSchema<{
|
|
647
|
+
readonly document: v.ObjectSchema<{
|
|
648
|
+
readonly document: v.ObjectSchema<{
|
|
649
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
650
|
+
readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
651
|
+
readonly name: v.StringSchema<undefined>;
|
|
652
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["design", "board"], undefined>, "design">;
|
|
653
|
+
readonly currentRevisionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
654
|
+
readonly version: v.NumberSchema<undefined>;
|
|
655
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
656
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
657
|
+
}, undefined>;
|
|
658
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
659
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
660
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
661
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
662
|
+
readonly download: v.ObjectSchema<{
|
|
663
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
664
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
665
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
666
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
667
|
+
}, undefined>;
|
|
668
|
+
readonly images: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
669
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
670
|
+
readonly checksum: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
671
|
+
readonly byteSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
672
|
+
readonly download: v.ObjectSchema<{
|
|
673
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
674
|
+
readonly method: v.LiteralSchema<"GET", undefined>;
|
|
675
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
676
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
677
|
+
}, undefined>;
|
|
678
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
679
|
+
name: string;
|
|
680
|
+
checksum: string;
|
|
681
|
+
byteSize: number;
|
|
682
|
+
download: {
|
|
683
|
+
url: string;
|
|
684
|
+
method: "GET";
|
|
685
|
+
headers: {
|
|
686
|
+
[x: string]: string;
|
|
687
|
+
};
|
|
688
|
+
expiresAt: string;
|
|
689
|
+
};
|
|
690
|
+
}[], 10000, undefined>]>;
|
|
691
|
+
}, undefined>;
|
|
692
|
+
readonly version: v.ObjectSchema<{
|
|
693
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
694
|
+
readonly revisionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
695
|
+
readonly kind: v.PicklistSchema<["checkpoint", "named"], undefined>;
|
|
696
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
697
|
+
readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
698
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
699
|
+
/** Who made the version: the author of a checkpoint's save, or who named or restored it. */
|
|
700
|
+
readonly createdBy: v.ObjectSchema<{
|
|
701
|
+
readonly id: v.StringSchema<undefined>;
|
|
702
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
703
|
+
}, undefined>;
|
|
704
|
+
/** The version this one restored, while that version is still in the history. */
|
|
705
|
+
readonly restoredFromVersionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
706
|
+
/** Whether the document holds this version now. */
|
|
707
|
+
readonly current: v.BooleanSchema<undefined>;
|
|
708
|
+
}, undefined>;
|
|
709
|
+
}, undefined>;
|
|
710
|
+
type DocumentVersionDownload = v.InferOutput<typeof documentVersionDownloadSchema>;
|
|
711
|
+
//#endregion
|
|
712
|
+
//#region src/client/discovery.d.ts
|
|
713
|
+
type CloudFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
714
|
+
type DiscoverCloudOptions = {
|
|
715
|
+
fetch?: CloudFetch;
|
|
716
|
+
signal?: AbortSignal;
|
|
717
|
+
};
|
|
718
|
+
/**
|
|
719
|
+
* Why a server could not be used: the address is not a web address, nothing answered, something
|
|
720
|
+
* answered but not as OpenPencil Cloud, or it speaks another protocol version.
|
|
721
|
+
*/
|
|
722
|
+
type CloudDiscoveryFailure = 'invalid-address' | 'unreachable' | 'not-cloud' | 'outdated';
|
|
723
|
+
declare class CloudClientError extends Error {
|
|
724
|
+
readonly cause?: unknown | undefined;
|
|
725
|
+
readonly reason: CloudDiscoveryFailure;
|
|
726
|
+
constructor(message: string, cause?: unknown | undefined, reason?: CloudDiscoveryFailure);
|
|
727
|
+
}
|
|
728
|
+
declare function discoverCloud(serverURL: string, options?: DiscoverCloudOptions): Promise<CloudDiscovery>;
|
|
729
|
+
//#endregion
|
|
730
|
+
//#region src/client/ai.d.ts
|
|
731
|
+
/** Where a request gets the token it sends, and how it drops one the service refused. */
|
|
732
|
+
type CloudAITokenSource = {
|
|
733
|
+
token(): Promise<string>;
|
|
734
|
+
/** Forgets `token`, so the next call signs a new one. */
|
|
735
|
+
invalidate(token: string): void;
|
|
736
|
+
};
|
|
737
|
+
declare class CloudAIError extends Error {
|
|
738
|
+
readonly status: number;
|
|
739
|
+
readonly code?: AIErrorCode | undefined;
|
|
740
|
+
readonly name = "CloudAIError";
|
|
741
|
+
constructor(status: number, code?: AIErrorCode | undefined);
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Sends each request with a current token. A token the service refuses, for instance one signed
|
|
745
|
+
* by a key Cloud has since replaced, is dropped and a request that can be replayed is sent once
|
|
746
|
+
* more with a new one.
|
|
747
|
+
*/
|
|
748
|
+
declare function cloudAIFetch(tokens: CloudAITokenSource, fetch: CloudFetch): CloudFetch;
|
|
749
|
+
type CloudAIClientOptions = {
|
|
750
|
+
/** The service's endpoint, as Cloud's discovery names it. */
|
|
751
|
+
endpoint: string;
|
|
752
|
+
tokens: CloudAITokenSource;
|
|
753
|
+
fetch: CloudFetch;
|
|
754
|
+
};
|
|
755
|
+
/** The AI service a Cloud advertises: its model API base URL, catalog, and the wallet. */
|
|
756
|
+
declare function createCloudAIClient(options: CloudAIClientOptions): {
|
|
757
|
+
/** The base URL an OpenAI-compatible client sends chat completions below. */
|
|
758
|
+
modelBaseURL: string;
|
|
759
|
+
fetch: CloudFetch;
|
|
760
|
+
catalog(): Promise<AICatalog>;
|
|
761
|
+
wallet(): Promise<AIWallet>;
|
|
762
|
+
};
|
|
763
|
+
type CloudAIClient = ReturnType<typeof createCloudAIClient>;
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region src/client/auth/failure.d.ts
|
|
766
|
+
/** Why a sign-in step did not go through, in terms a page or dialog can explain. */
|
|
767
|
+
type CloudAuthFailure = 'invalid-credentials' | 'email-not-verified' | 'password-too-short' | 'password-too-long' | 'invalid-link' | 'invalid-code' | 'passkey-cancelled' | 'passkey-exists' | 'passkey-unavailable' | 'session-not-fresh' | 'rate-limited' | 'unavailable';
|
|
768
|
+
type CloudAuthResult<T = undefined> = {
|
|
769
|
+
ok: true;
|
|
770
|
+
value: T;
|
|
771
|
+
} | {
|
|
772
|
+
ok: false;
|
|
773
|
+
failure: CloudAuthFailure;
|
|
774
|
+
};
|
|
775
|
+
type BetterAuthError = {
|
|
776
|
+
code?: string;
|
|
777
|
+
status?: number;
|
|
778
|
+
} | null | undefined;
|
|
779
|
+
/** The failure a Better Auth error stands for; anything unknown can only be retried later. */
|
|
780
|
+
declare function cloudAuthFailure(error: BetterAuthError): {
|
|
781
|
+
ok: false;
|
|
782
|
+
failure: CloudAuthFailure;
|
|
783
|
+
};
|
|
784
|
+
//#endregion
|
|
785
|
+
//#region src/client/auth/client.d.ts
|
|
786
|
+
type CloudSocialProvider = CloudDiscovery['authentication']['socialProviders'][number];
|
|
787
|
+
type DeviceActionResult = Promise<{
|
|
788
|
+
data?: {
|
|
789
|
+
success: boolean;
|
|
790
|
+
};
|
|
791
|
+
error?: {
|
|
792
|
+
error_description: string;
|
|
793
|
+
};
|
|
794
|
+
}>;
|
|
795
|
+
type CloudAuthClient = Pick<ReturnType<typeof createAuthClient>, 'getSession' | 'signIn' | 'signOut' | 'signUp' | 'sendVerificationEmail' | 'requestPasswordReset' | 'resetPassword'> & {
|
|
796
|
+
signIn: ReturnType<typeof createAuthClient>['signIn'] & {
|
|
797
|
+
passkey(): Promise<{
|
|
798
|
+
data: unknown;
|
|
799
|
+
error: {
|
|
800
|
+
message?: string;
|
|
801
|
+
code?: string;
|
|
802
|
+
status: number;
|
|
803
|
+
} | null;
|
|
804
|
+
}>;
|
|
805
|
+
};
|
|
806
|
+
twoFactor: {
|
|
807
|
+
verifyTotp(input: {
|
|
808
|
+
code: string;
|
|
809
|
+
trustDevice?: boolean;
|
|
810
|
+
}): Promise<{
|
|
811
|
+
data: unknown;
|
|
812
|
+
error: {
|
|
813
|
+
message?: string;
|
|
814
|
+
code?: string;
|
|
815
|
+
status: number;
|
|
816
|
+
} | null;
|
|
817
|
+
}>;
|
|
818
|
+
verifyBackupCode(input: {
|
|
819
|
+
code: string;
|
|
820
|
+
trustDevice?: boolean;
|
|
821
|
+
}): Promise<{
|
|
822
|
+
data: unknown;
|
|
823
|
+
error: {
|
|
824
|
+
message?: string;
|
|
825
|
+
code?: string;
|
|
826
|
+
status: number;
|
|
827
|
+
} | null;
|
|
828
|
+
}>;
|
|
829
|
+
};
|
|
830
|
+
passkey: {
|
|
831
|
+
addPasskey(input?: {
|
|
832
|
+
name?: string;
|
|
833
|
+
}): Promise<{
|
|
834
|
+
data: unknown;
|
|
835
|
+
error: {
|
|
836
|
+
message?: string;
|
|
837
|
+
code?: string;
|
|
838
|
+
status: number;
|
|
839
|
+
} | null;
|
|
840
|
+
}>;
|
|
841
|
+
};
|
|
842
|
+
device: {
|
|
843
|
+
(input: {
|
|
844
|
+
query: {
|
|
845
|
+
user_code: string;
|
|
846
|
+
};
|
|
847
|
+
}): Promise<{
|
|
848
|
+
data?: {
|
|
849
|
+
user_code: string;
|
|
850
|
+
status: string;
|
|
851
|
+
};
|
|
852
|
+
error?: {
|
|
853
|
+
error_description: string;
|
|
854
|
+
};
|
|
855
|
+
}>;
|
|
856
|
+
approve(input: {
|
|
857
|
+
userCode: string;
|
|
858
|
+
}): DeviceActionResult;
|
|
859
|
+
deny(input: {
|
|
860
|
+
userCode: string;
|
|
861
|
+
}): DeviceActionResult;
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
type CloudAuthClientOptions = {
|
|
865
|
+
accessToken?: string;
|
|
866
|
+
captchaResponse?: string;
|
|
867
|
+
fetch?: CloudFetch;
|
|
868
|
+
};
|
|
869
|
+
declare function createCloudAuthClient(discovery: CloudDiscovery, options?: CloudAuthClientOptions): CloudAuthClient;
|
|
870
|
+
type CloudSignInOptions = {
|
|
871
|
+
callbackURL?: string;
|
|
872
|
+
fetch?: CloudFetch;
|
|
873
|
+
navigate?: (url: string) => void;
|
|
874
|
+
};
|
|
875
|
+
declare function signInToCloud(discovery: CloudDiscovery, provider: CloudSocialProvider, options?: CloudSignInOptions): Promise<void>;
|
|
876
|
+
declare function signOutFromCloud(discovery: CloudDiscovery, options?: Pick<CloudAuthClientOptions, 'fetch' | 'accessToken'>): Promise<void>;
|
|
877
|
+
/** An email sign-in that went through: the session's bearer token, or a second step to take. */
|
|
878
|
+
type CloudEmailSignIn = {
|
|
879
|
+
status: 'signed-in';
|
|
880
|
+
token: string;
|
|
881
|
+
} | {
|
|
882
|
+
status: 'two-step';
|
|
883
|
+
};
|
|
884
|
+
type CloudEmailAuthOptions = Pick<CloudAuthClientOptions, 'fetch' | 'captchaResponse'>;
|
|
885
|
+
/**
|
|
886
|
+
* Signs in with an email and password without leaving the app. The token goes on every later
|
|
887
|
+
* request, so no cookie has to cross from the server to the editor.
|
|
888
|
+
*/
|
|
889
|
+
declare function signInToCloudWithEmail(discovery: CloudDiscovery, input: {
|
|
890
|
+
email: string;
|
|
891
|
+
password: string;
|
|
892
|
+
}, options?: CloudEmailAuthOptions): Promise<CloudAuthResult<CloudEmailSignIn>>;
|
|
893
|
+
/** Creates an account; the server emails a link that opens `verifiedURL` once it is confirmed. */
|
|
894
|
+
declare function signUpToCloudWithEmail(discovery: CloudDiscovery, input: {
|
|
895
|
+
name: string;
|
|
896
|
+
email: string;
|
|
897
|
+
password: string;
|
|
898
|
+
verifiedURL: string;
|
|
899
|
+
}, options?: CloudEmailAuthOptions): Promise<CloudAuthResult>;
|
|
900
|
+
declare function resendCloudVerification(discovery: CloudDiscovery, input: {
|
|
901
|
+
email: string;
|
|
902
|
+
verifiedURL: string;
|
|
903
|
+
}, options?: CloudEmailAuthOptions): Promise<CloudAuthResult>;
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region src/client/auth/navigation.d.ts
|
|
906
|
+
/** The instance owns authentication; only its own editor may receive the return. */
|
|
907
|
+
declare function cloudEditorReturnURL(discovery: CloudDiscovery, value: string): string;
|
|
908
|
+
/**
|
|
909
|
+
* The server's sign-in page, coming back to `returnURL` on its editor afterwards. A `provider`
|
|
910
|
+
* starts that provider's sign-in at once, while the server's pages still handle two-step sign-in
|
|
911
|
+
* and approval before the return.
|
|
912
|
+
*/
|
|
913
|
+
declare function cloudSignInURL(discovery: CloudDiscovery, returnURL: string, provider?: CloudSocialProvider): string;
|
|
914
|
+
/** Accept only same-origin application paths for post-authentication navigation. */
|
|
915
|
+
declare function cloudRedirectPath(value: unknown, fallback?: string): string;
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region src/client/response.d.ts
|
|
918
|
+
type CloudClientDiagnostic = (message: string, error: unknown) => void;
|
|
919
|
+
declare class CloudAPIError extends Error {
|
|
920
|
+
readonly status: number;
|
|
921
|
+
readonly code?: string | undefined;
|
|
922
|
+
readonly name = "CloudAPIError";
|
|
923
|
+
constructor(message: string, status: number, code?: string | undefined);
|
|
924
|
+
}
|
|
925
|
+
//#endregion
|
|
926
|
+
//#region src/client/api.d.ts
|
|
927
|
+
declare const uploadResponseSchema: v.ObjectSchema<{
|
|
928
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
929
|
+
readonly upload: v.VariantSchema<"kind", [v.ObjectSchema<{
|
|
930
|
+
readonly kind: v.LiteralSchema<"single", undefined>;
|
|
931
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
932
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
933
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
934
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
935
|
+
}, undefined>, v.ObjectSchema<{
|
|
936
|
+
readonly kind: v.LiteralSchema<"multipart", undefined>;
|
|
937
|
+
readonly uploadId: v.StringSchema<undefined>;
|
|
938
|
+
readonly partSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
939
|
+
readonly parts: v.ArraySchema<v.ObjectSchema<{
|
|
940
|
+
readonly partNumber: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
941
|
+
readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
942
|
+
readonly method: v.LiteralSchema<"PUT", undefined>;
|
|
943
|
+
readonly headers: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
944
|
+
}, undefined>, undefined>;
|
|
945
|
+
readonly expiresAt: v.StringSchema<undefined>;
|
|
946
|
+
}, undefined>], undefined>;
|
|
947
|
+
}, undefined>;
|
|
948
|
+
type CloudRequestOptions = {
|
|
949
|
+
fetch?: CloudFetch;
|
|
950
|
+
signal?: AbortSignal;
|
|
951
|
+
accessToken?: string;
|
|
952
|
+
onDiagnostic?: CloudClientDiagnostic;
|
|
953
|
+
};
|
|
954
|
+
type CloudUpload = v.InferOutput<typeof uploadResponseSchema>;
|
|
955
|
+
declare function createCloudAPIClient(baseURL: string, options?: CloudRequestOptions): {
|
|
956
|
+
/** Documents shared with the person directly, outside their workspaces. */
|
|
957
|
+
listSharedDocuments(): Promise<SharedDocument[]>;
|
|
958
|
+
listDocuments(workspaceId: string): Promise<DocumentSummary[]>;
|
|
959
|
+
createDocument(workspaceId: string, input: CreateDocumentRequest): Promise<DocumentSummary>;
|
|
960
|
+
deleteDocument(documentId: string): Promise<void>;
|
|
961
|
+
getDocument(documentId: string): Promise<DocumentDownload>;
|
|
962
|
+
getDocumentAccess(documentId: string): Promise<DocumentAccess>;
|
|
963
|
+
listDocumentShares(documentId: string): Promise<DocumentShare[]>;
|
|
964
|
+
createDocumentShare(documentId: string, input: CreateDocumentShareInput): Promise<{
|
|
965
|
+
share: {
|
|
966
|
+
id: string;
|
|
967
|
+
documentId: string;
|
|
968
|
+
permission: "view" | "edit";
|
|
969
|
+
roomEpoch: number;
|
|
970
|
+
createdBy: string;
|
|
971
|
+
createdAt: string;
|
|
972
|
+
updatedAt: string;
|
|
973
|
+
expiresAt: string | null;
|
|
974
|
+
revokedAt: string | null;
|
|
975
|
+
lastUsedAt: string | null;
|
|
976
|
+
};
|
|
977
|
+
secret: string;
|
|
978
|
+
path: string;
|
|
979
|
+
}>;
|
|
980
|
+
updateDocumentShare(documentId: string, shareId: string, input: UpdateDocumentShareInput): Promise<DocumentShare>;
|
|
981
|
+
rotateDocumentShare(documentId: string, shareId: string): Promise<{
|
|
982
|
+
share: {
|
|
983
|
+
id: string;
|
|
984
|
+
documentId: string;
|
|
985
|
+
permission: "view" | "edit";
|
|
986
|
+
roomEpoch: number;
|
|
987
|
+
createdBy: string;
|
|
988
|
+
createdAt: string;
|
|
989
|
+
updatedAt: string;
|
|
990
|
+
expiresAt: string | null;
|
|
991
|
+
revokedAt: string | null;
|
|
992
|
+
lastUsedAt: string | null;
|
|
993
|
+
};
|
|
994
|
+
secret: string;
|
|
995
|
+
path: string;
|
|
996
|
+
}>;
|
|
997
|
+
revokeDocumentShare(documentId: string, shareId: string): Promise<void>;
|
|
998
|
+
listDocumentGrants(documentId: string): Promise<DocumentGrant[]>;
|
|
999
|
+
putDocumentGrant(documentId: string, userId: string, input: PutDocumentGrantInput): Promise<DocumentGrant>;
|
|
1000
|
+
revokeDocumentGrant(documentId: string, userId: string): Promise<void>;
|
|
1001
|
+
listDocumentInvitations(documentId: string): Promise<DocumentInvitation[]>;
|
|
1002
|
+
createDocumentInvitation(documentId: string, input: CreateDocumentInvitationInput): Promise<{
|
|
1003
|
+
invitation: {
|
|
1004
|
+
id: string;
|
|
1005
|
+
documentId: string;
|
|
1006
|
+
email: string;
|
|
1007
|
+
permission: "view" | "edit";
|
|
1008
|
+
invitedBy: string;
|
|
1009
|
+
invitedAt: string;
|
|
1010
|
+
expiresAt: string;
|
|
1011
|
+
acceptedAt: string | null;
|
|
1012
|
+
};
|
|
1013
|
+
token: string;
|
|
1014
|
+
}>;
|
|
1015
|
+
createInvitationContinuation(input: CreateInvitationContinuationInput): Promise<InvitationContinuation>;
|
|
1016
|
+
consumeInvitationContinuation(id: string): Promise<CreateInvitationContinuationInput>;
|
|
1017
|
+
previewInvitation(invitationId: string, input: AcceptDocumentInvitationInput): Promise<InvitationPreview>;
|
|
1018
|
+
/** Accepts a document or workspace invitation, and says which it was. */
|
|
1019
|
+
acceptInvitation(invitationId: string, input: AcceptDocumentInvitationInput): Promise<AcceptedInvitation>;
|
|
1020
|
+
revokeDocumentInvitation(documentId: string, invitationId: string): Promise<void>;
|
|
1021
|
+
resolveDocumentShare(shareId: string, input: ResolveDocumentShareInput): Promise<{
|
|
1022
|
+
documentId: string;
|
|
1023
|
+
permission: "view" | "edit";
|
|
1024
|
+
principal: {
|
|
1025
|
+
kind: "user";
|
|
1026
|
+
userId: string;
|
|
1027
|
+
name: string;
|
|
1028
|
+
email: string;
|
|
1029
|
+
} | {
|
|
1030
|
+
kind: "guest";
|
|
1031
|
+
guestId: string;
|
|
1032
|
+
name: string;
|
|
1033
|
+
};
|
|
1034
|
+
roomEpoch: number;
|
|
1035
|
+
}>;
|
|
1036
|
+
getSharedDocument(shareId: string, input: ResolveDocumentShareInput): Promise<{
|
|
1037
|
+
resolution: {
|
|
1038
|
+
documentId: string;
|
|
1039
|
+
permission: "view" | "edit";
|
|
1040
|
+
principal: {
|
|
1041
|
+
kind: "user";
|
|
1042
|
+
userId: string;
|
|
1043
|
+
name: string;
|
|
1044
|
+
email: string;
|
|
1045
|
+
} | {
|
|
1046
|
+
kind: "guest";
|
|
1047
|
+
guestId: string;
|
|
1048
|
+
name: string;
|
|
1049
|
+
};
|
|
1050
|
+
roomEpoch: number;
|
|
1051
|
+
};
|
|
1052
|
+
document: {
|
|
1053
|
+
document: {
|
|
1054
|
+
id: string;
|
|
1055
|
+
workspaceId: string;
|
|
1056
|
+
name: string;
|
|
1057
|
+
kind: "design" | "board";
|
|
1058
|
+
currentRevisionId: string | null;
|
|
1059
|
+
version: number;
|
|
1060
|
+
createdAt: string;
|
|
1061
|
+
updatedAt: string;
|
|
1062
|
+
};
|
|
1063
|
+
revisionId: string;
|
|
1064
|
+
byteSize: number;
|
|
1065
|
+
checksum: string;
|
|
1066
|
+
contentType: string;
|
|
1067
|
+
download: {
|
|
1068
|
+
url: string;
|
|
1069
|
+
method: "GET";
|
|
1070
|
+
headers: {
|
|
1071
|
+
[x: string]: string;
|
|
1072
|
+
};
|
|
1073
|
+
expiresAt: string;
|
|
1074
|
+
};
|
|
1075
|
+
images: {
|
|
1076
|
+
name: string;
|
|
1077
|
+
checksum: string;
|
|
1078
|
+
byteSize: number;
|
|
1079
|
+
download: {
|
|
1080
|
+
url: string;
|
|
1081
|
+
method: "GET";
|
|
1082
|
+
headers: {
|
|
1083
|
+
[x: string]: string;
|
|
1084
|
+
};
|
|
1085
|
+
expiresAt: string;
|
|
1086
|
+
};
|
|
1087
|
+
}[];
|
|
1088
|
+
};
|
|
1089
|
+
}>;
|
|
1090
|
+
getSharedCollaborationTicket(shareId: string, input: ResolveDocumentShareInput): Promise<CollaborationTicket>;
|
|
1091
|
+
getCollaborationTicket(documentId: string): Promise<CollaborationTicket>;
|
|
1092
|
+
createUpload(documentId: string, input: CreateUploadInput): Promise<CloudUpload>;
|
|
1093
|
+
commitUpload(uploadId: string, input: CommitUploadRequest): Promise<DocumentSummary>;
|
|
1094
|
+
/** A page of the document's version history, newest first. */
|
|
1095
|
+
listDocumentVersions(documentId: string, page?: {
|
|
1096
|
+
before?: string;
|
|
1097
|
+
limit?: number;
|
|
1098
|
+
}): Promise<DocumentVersions>;
|
|
1099
|
+
saveDocumentVersion(documentId: string, input: SaveDocumentVersionInput): Promise<DocumentVersion>;
|
|
1100
|
+
updateDocumentVersion(documentId: string, versionId: string, input: UpdateDocumentVersionInput): Promise<DocumentVersion>;
|
|
1101
|
+
getDocumentVersion(documentId: string, versionId: string): Promise<DocumentVersionDownload>;
|
|
1102
|
+
restoreDocumentVersion(documentId: string, versionId: string): Promise<{
|
|
1103
|
+
document: {
|
|
1104
|
+
id: string;
|
|
1105
|
+
workspaceId: string;
|
|
1106
|
+
name: string;
|
|
1107
|
+
kind: "design" | "board";
|
|
1108
|
+
currentRevisionId: string | null;
|
|
1109
|
+
version: number;
|
|
1110
|
+
createdAt: string;
|
|
1111
|
+
updatedAt: string;
|
|
1112
|
+
};
|
|
1113
|
+
version: {
|
|
1114
|
+
id: string;
|
|
1115
|
+
revisionId: string;
|
|
1116
|
+
kind: "checkpoint" | "named";
|
|
1117
|
+
name: string | null;
|
|
1118
|
+
description: string | null;
|
|
1119
|
+
createdAt: string;
|
|
1120
|
+
createdBy: {
|
|
1121
|
+
id: string;
|
|
1122
|
+
name: string | null;
|
|
1123
|
+
};
|
|
1124
|
+
restoredFromVersionId: string | null;
|
|
1125
|
+
current: boolean;
|
|
1126
|
+
};
|
|
1127
|
+
}>;
|
|
1128
|
+
duplicateDocumentVersion(documentId: string, versionId: string, input: DuplicateDocumentVersionInput): Promise<DocumentSummary>;
|
|
1129
|
+
requestImageUploads(documentId: string, input: RequestImageUploadsInput): Promise<ImageUploadOffer[]>;
|
|
1130
|
+
commitImageUploads(documentId: string, uploads: CommitImageUploadsInput["uploads"]): Promise<void>;
|
|
1131
|
+
getImageLinks(documentId: string, checksums: string[]): Promise<DocumentImageLink[]>;
|
|
1132
|
+
getSharedImageLinks(shareId: string, input: ResolveDocumentShareInput, checksums: string[]): Promise<DocumentImageLink[]>;
|
|
1133
|
+
listWorkspaces(): Promise<WorkspaceList>;
|
|
1134
|
+
createWorkspace(name: string): Promise<WorkspaceSummary>;
|
|
1135
|
+
renameWorkspace(workspaceId: string, name: string): Promise<WorkspaceSummary>;
|
|
1136
|
+
deleteWorkspace(workspaceId: string): Promise<void>;
|
|
1137
|
+
listWorkspaceMembers(workspaceId: string): Promise<WorkspaceMembers>;
|
|
1138
|
+
inviteToWorkspace(workspaceId: string, input: CreateWorkspaceInvitationInput): Promise<CreatedWorkspaceInvitation>;
|
|
1139
|
+
resendWorkspaceInvitation(workspaceId: string, invitationId: string): Promise<CreatedWorkspaceInvitation>;
|
|
1140
|
+
revokeWorkspaceInvitation(workspaceId: string, invitationId: string): Promise<void>;
|
|
1141
|
+
updateWorkspaceMember(workspaceId: string, userId: string, role: WorkspaceRole): Promise<void>;
|
|
1142
|
+
removeWorkspaceMember(workspaceId: string, userId: string): Promise<void>;
|
|
1143
|
+
getWorkspaceEntitlements(workspaceId: string): Promise<WorkspaceEntitlements>;
|
|
1144
|
+
getUsage(workspaceId: string): Promise<WorkspaceUsage>;
|
|
1145
|
+
getSession(): Promise<CloudSession | null>;
|
|
1146
|
+
/** A short-lived token for the deployment's AI service, on the workspace's behalf. */
|
|
1147
|
+
requestAIToken(workspaceId: string): Promise<AIToken>;
|
|
1148
|
+
lookupUser(documentId: string, input: LookupCloudUserInput): Promise<CloudUserProfile | null>;
|
|
1149
|
+
getUserProfile(documentId: string, userId: string): Promise<CloudUserProfile | null>;
|
|
1150
|
+
};
|
|
1151
|
+
type CloudAPIClient = ReturnType<typeof createCloudAPIClient>;
|
|
1152
|
+
//#endregion
|
|
1153
|
+
//#region src/client/device-authorization.d.ts
|
|
1154
|
+
declare const deviceCodeSchema: v.ObjectSchema<{
|
|
1155
|
+
readonly device_code: v.StringSchema<undefined>;
|
|
1156
|
+
readonly user_code: v.StringSchema<undefined>;
|
|
1157
|
+
readonly verification_uri: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1158
|
+
readonly verification_uri_complete: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
1159
|
+
readonly expires_in: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1160
|
+
readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1161
|
+
}, undefined>;
|
|
1162
|
+
declare const deviceTokenSchema: v.ObjectSchema<{
|
|
1163
|
+
readonly access_token: v.StringSchema<undefined>;
|
|
1164
|
+
readonly token_type: v.LiteralSchema<"Bearer", undefined>;
|
|
1165
|
+
readonly expires_in: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1166
|
+
readonly scope: v.StringSchema<undefined>;
|
|
1167
|
+
}, undefined>;
|
|
1168
|
+
type CloudDeviceErrorCode = 'denied' | 'expired' | 'unavailable';
|
|
1169
|
+
declare class CloudDeviceAuthorizationError extends Error {
|
|
1170
|
+
readonly code: CloudDeviceErrorCode;
|
|
1171
|
+
readonly name = "CloudDeviceAuthorizationError";
|
|
1172
|
+
constructor(code: CloudDeviceErrorCode);
|
|
1173
|
+
}
|
|
1174
|
+
type CloudDeviceAuthorization = v.InferOutput<typeof deviceCodeSchema>;
|
|
1175
|
+
type CloudDeviceToken = v.InferOutput<typeof deviceTokenSchema>;
|
|
1176
|
+
type CloudDevicePollingOptions = {
|
|
1177
|
+
signal?: AbortSignal;
|
|
1178
|
+
fetch?: CloudFetch;
|
|
1179
|
+
now?: () => number;
|
|
1180
|
+
sleep?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
|
|
1181
|
+
};
|
|
1182
|
+
type CloudDeviceAuthorizationOptions = {
|
|
1183
|
+
fetch?: CloudFetch;
|
|
1184
|
+
};
|
|
1185
|
+
declare function requestCloudDeviceAuthorization(discovery: CloudDiscovery, connectionId: string, options?: CloudDeviceAuthorizationOptions): Promise<CloudDeviceAuthorization>;
|
|
1186
|
+
declare function pollCloudDeviceToken(discovery: CloudDiscovery, connectionId: string, authorization: CloudDeviceAuthorization, options?: CloudDevicePollingOptions): Promise<CloudDeviceToken>;
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region src/client/portal/request.d.ts
|
|
1189
|
+
type CloudPortalAPIErrorKind = 'authentication-required' | 'authorization-required' | 'cancelled' | 'domain' | 'network' | 'protocol' | 'timeout';
|
|
1190
|
+
declare class CloudPortalAPIError extends Error {
|
|
1191
|
+
readonly kind: CloudPortalAPIErrorKind;
|
|
1192
|
+
readonly code?: (AdminErrorCode | AccountSecurityErrorCode) | undefined;
|
|
1193
|
+
readonly name = "CloudPortalAPIError";
|
|
1194
|
+
constructor(kind: CloudPortalAPIErrorKind, code?: (AdminErrorCode | AccountSecurityErrorCode) | undefined, options?: ErrorOptions);
|
|
1195
|
+
}
|
|
1196
|
+
type CloudPortalClientOptions = {
|
|
1197
|
+
baseURL?: string;
|
|
1198
|
+
fetch?: CloudFetch;
|
|
1199
|
+
timeoutMs?: number;
|
|
1200
|
+
};
|
|
1201
|
+
//#endregion
|
|
1202
|
+
//#region src/client/portal/administration.d.ts
|
|
1203
|
+
/** A page of an admin list: words to search for, one of its filters, and where the page starts. */
|
|
1204
|
+
type AdminListRequest<Filter extends string> = {
|
|
1205
|
+
search?: string;
|
|
1206
|
+
filter?: Filter;
|
|
1207
|
+
limit?: number;
|
|
1208
|
+
offset?: number;
|
|
1209
|
+
};
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/client/portal/client.d.ts
|
|
1212
|
+
/** The account and administration routes Cloud's own web pages use, validated against the contract. */
|
|
1213
|
+
declare function createCloudPortalClient(options?: CloudPortalClientOptions): {
|
|
1214
|
+
session(signal?: AbortSignal): Promise<{
|
|
1215
|
+
user: {
|
|
1216
|
+
userId: string;
|
|
1217
|
+
email: string;
|
|
1218
|
+
name: string;
|
|
1219
|
+
image?: string | null | undefined;
|
|
1220
|
+
deploymentRole?: "user" | "admin" | undefined;
|
|
1221
|
+
};
|
|
1222
|
+
}>;
|
|
1223
|
+
enrollments(request: AdminListRequest<EnrollmentStatus>, signal?: AbortSignal): Promise<{
|
|
1224
|
+
total: number;
|
|
1225
|
+
counts: {
|
|
1226
|
+
pending: number;
|
|
1227
|
+
approved: number;
|
|
1228
|
+
rejected: number;
|
|
1229
|
+
revoked: number;
|
|
1230
|
+
};
|
|
1231
|
+
enrollments: {
|
|
1232
|
+
id: string;
|
|
1233
|
+
email: string;
|
|
1234
|
+
name: string | null;
|
|
1235
|
+
reason: string | null;
|
|
1236
|
+
status: "pending" | "approved" | "rejected" | "revoked";
|
|
1237
|
+
requestedAt: string;
|
|
1238
|
+
reviewedAt: string | null;
|
|
1239
|
+
reviewedBy: string | null;
|
|
1240
|
+
reviewerName?: string | null | undefined;
|
|
1241
|
+
reviewNote: string | null;
|
|
1242
|
+
approvedUserId: string | null;
|
|
1243
|
+
requestRevision: number;
|
|
1244
|
+
}[];
|
|
1245
|
+
}>;
|
|
1246
|
+
reviewEnrollment(id: string, action: "approve" | "reject" | "revoke", note?: string, signal?: AbortSignal): Promise<{
|
|
1247
|
+
enrollment: {
|
|
1248
|
+
id: string;
|
|
1249
|
+
email: string;
|
|
1250
|
+
name: string | null;
|
|
1251
|
+
reason: string | null;
|
|
1252
|
+
status: "pending" | "approved" | "rejected" | "revoked";
|
|
1253
|
+
requestedAt: string;
|
|
1254
|
+
reviewedAt: string | null;
|
|
1255
|
+
reviewedBy: string | null;
|
|
1256
|
+
reviewerName?: string | null | undefined;
|
|
1257
|
+
reviewNote: string | null;
|
|
1258
|
+
approvedUserId: string | null;
|
|
1259
|
+
requestRevision: number;
|
|
1260
|
+
};
|
|
1261
|
+
}>;
|
|
1262
|
+
users(request: AdminListRequest<CloudAdminUserFilter>, signal?: AbortSignal): Promise<{
|
|
1263
|
+
total: number;
|
|
1264
|
+
counts: {
|
|
1265
|
+
all: number;
|
|
1266
|
+
administrators: number;
|
|
1267
|
+
suspended: number;
|
|
1268
|
+
"without-two-step": number;
|
|
1269
|
+
};
|
|
1270
|
+
users: {
|
|
1271
|
+
role?: string | undefined;
|
|
1272
|
+
banned: boolean | null;
|
|
1273
|
+
banReason?: string | null | undefined;
|
|
1274
|
+
createdAt: string;
|
|
1275
|
+
twoStep: boolean;
|
|
1276
|
+
lastActiveAt: string | null;
|
|
1277
|
+
workspaceCount: number;
|
|
1278
|
+
id: string;
|
|
1279
|
+
name: string;
|
|
1280
|
+
email: string;
|
|
1281
|
+
image: string | null;
|
|
1282
|
+
}[];
|
|
1283
|
+
}>;
|
|
1284
|
+
user(id: string, signal?: AbortSignal): Promise<{
|
|
1285
|
+
user: {
|
|
1286
|
+
emailVerified: boolean;
|
|
1287
|
+
role?: string | undefined;
|
|
1288
|
+
banned: boolean | null;
|
|
1289
|
+
banReason?: string | null | undefined;
|
|
1290
|
+
createdAt: string;
|
|
1291
|
+
twoStep: boolean;
|
|
1292
|
+
lastActiveAt: string | null;
|
|
1293
|
+
workspaceCount: number;
|
|
1294
|
+
id: string;
|
|
1295
|
+
name: string;
|
|
1296
|
+
email: string;
|
|
1297
|
+
image: string | null;
|
|
1298
|
+
};
|
|
1299
|
+
methods: {
|
|
1300
|
+
provider: string;
|
|
1301
|
+
createdAt: string;
|
|
1302
|
+
}[];
|
|
1303
|
+
authenticator: boolean;
|
|
1304
|
+
passkeyCount: number;
|
|
1305
|
+
sessions: {
|
|
1306
|
+
id: string;
|
|
1307
|
+
current: boolean;
|
|
1308
|
+
method: "password" | "google" | "apple" | "passkey" | "two-step" | "email-link" | "desktop" | "other" | null;
|
|
1309
|
+
ipAddress: string | null;
|
|
1310
|
+
browser: string | null;
|
|
1311
|
+
system: string | null;
|
|
1312
|
+
createdAt: string;
|
|
1313
|
+
lastActiveAt: string;
|
|
1314
|
+
expiresAt: string;
|
|
1315
|
+
}[];
|
|
1316
|
+
signIns: {
|
|
1317
|
+
id: string;
|
|
1318
|
+
method: "password" | "google" | "apple" | "passkey" | "two-step" | "email-link" | "desktop" | "other";
|
|
1319
|
+
ipAddress: string | null;
|
|
1320
|
+
browser: string | null;
|
|
1321
|
+
system: string | null;
|
|
1322
|
+
createdAt: string;
|
|
1323
|
+
}[];
|
|
1324
|
+
workspaces: {
|
|
1325
|
+
id: string;
|
|
1326
|
+
name: string;
|
|
1327
|
+
role: "admin" | "viewer" | "editor";
|
|
1328
|
+
memberCount: number;
|
|
1329
|
+
joinedAt: string;
|
|
1330
|
+
}[];
|
|
1331
|
+
}>;
|
|
1332
|
+
userAction(action: "ban" | "unban" | "revoke-sessions" | "reset-two-step" | "remove-picture", userId: string, reason?: string, signal?: AbortSignal): Promise<{
|
|
1333
|
+
ok: true;
|
|
1334
|
+
}>;
|
|
1335
|
+
setAdmin(userId: string, enabled: boolean, signal?: AbortSignal): Promise<{
|
|
1336
|
+
ok: true;
|
|
1337
|
+
}>;
|
|
1338
|
+
email(request: AdminListRequest<CloudAdminEmailFilter>, signal?: AbortSignal): Promise<{
|
|
1339
|
+
total: number;
|
|
1340
|
+
counts: {
|
|
1341
|
+
all: number;
|
|
1342
|
+
sent: number;
|
|
1343
|
+
waiting: number;
|
|
1344
|
+
failed: number;
|
|
1345
|
+
};
|
|
1346
|
+
messages: {
|
|
1347
|
+
id: string;
|
|
1348
|
+
kind: string;
|
|
1349
|
+
recipientEmailNormalized: string;
|
|
1350
|
+
status: string;
|
|
1351
|
+
attemptCount: number;
|
|
1352
|
+
nextAttemptAt: string;
|
|
1353
|
+
transport: string | null;
|
|
1354
|
+
transportMessageId: string | null;
|
|
1355
|
+
lastErrorCode: string | null;
|
|
1356
|
+
createdAt: string;
|
|
1357
|
+
acceptedAt: string | null;
|
|
1358
|
+
regeneratable: boolean;
|
|
1359
|
+
}[];
|
|
1360
|
+
}>;
|
|
1361
|
+
regenerateEmail(id: string, signal?: AbortSignal): Promise<{
|
|
1362
|
+
ok: true;
|
|
1363
|
+
}>;
|
|
1364
|
+
audit(request: AdminListRequest<CloudAdminAuditFilter>, signal?: AbortSignal): Promise<{
|
|
1365
|
+
total: number;
|
|
1366
|
+
counts: {
|
|
1367
|
+
email: number;
|
|
1368
|
+
all: number;
|
|
1369
|
+
accounts: number;
|
|
1370
|
+
requests: number;
|
|
1371
|
+
};
|
|
1372
|
+
events: {
|
|
1373
|
+
id: string;
|
|
1374
|
+
actor: {
|
|
1375
|
+
id: string;
|
|
1376
|
+
name: string | null;
|
|
1377
|
+
};
|
|
1378
|
+
action: string;
|
|
1379
|
+
subject: {
|
|
1380
|
+
type: string;
|
|
1381
|
+
id: string;
|
|
1382
|
+
name: string | null;
|
|
1383
|
+
};
|
|
1384
|
+
metadata: unknown;
|
|
1385
|
+
createdAt: string;
|
|
1386
|
+
}[];
|
|
1387
|
+
}>;
|
|
1388
|
+
operations(signal?: AbortSignal): Promise<{
|
|
1389
|
+
deployment: "official" | "self-hosted";
|
|
1390
|
+
enrollmentMode: "open" | "approval" | "closed";
|
|
1391
|
+
emailTransport: "none" | "smtp" | "cloudflare";
|
|
1392
|
+
pendingEnrollment: number;
|
|
1393
|
+
pendingEmail: number;
|
|
1394
|
+
failedEmail: number;
|
|
1395
|
+
accounts: number;
|
|
1396
|
+
workspaces: number;
|
|
1397
|
+
documents: number;
|
|
1398
|
+
storedBytes: number;
|
|
1399
|
+
}>;
|
|
1400
|
+
accountStatus(signal?: AbortSignal): Promise<{
|
|
1401
|
+
user: {
|
|
1402
|
+
userId: string;
|
|
1403
|
+
email: string;
|
|
1404
|
+
name: string;
|
|
1405
|
+
image?: string | null | undefined;
|
|
1406
|
+
deploymentRole?: "user" | "admin" | undefined;
|
|
1407
|
+
};
|
|
1408
|
+
state: "pending" | "rejected" | "revoked" | "active";
|
|
1409
|
+
}>;
|
|
1410
|
+
authenticationMethods(signal?: AbortSignal): Promise<{
|
|
1411
|
+
methods: {
|
|
1412
|
+
id: string;
|
|
1413
|
+
provider: "google" | "apple" | "credential";
|
|
1414
|
+
createdAt: string;
|
|
1415
|
+
canUnlink: boolean;
|
|
1416
|
+
}[];
|
|
1417
|
+
availableSocialProviders: ("google" | "apple")[];
|
|
1418
|
+
}>;
|
|
1419
|
+
mfaStatus(signal?: AbortSignal): Promise<{
|
|
1420
|
+
mfa: {
|
|
1421
|
+
required: boolean;
|
|
1422
|
+
enabled: boolean;
|
|
1423
|
+
totpEnabled: boolean;
|
|
1424
|
+
assured: boolean;
|
|
1425
|
+
totpAvailable: boolean;
|
|
1426
|
+
passkeysAvailable: boolean;
|
|
1427
|
+
recoveryCodesAvailable: boolean;
|
|
1428
|
+
};
|
|
1429
|
+
}>;
|
|
1430
|
+
enableTOTP(password?: string, signal?: AbortSignal): Promise<{
|
|
1431
|
+
totpURI: string;
|
|
1432
|
+
backupCodes: string[];
|
|
1433
|
+
}>;
|
|
1434
|
+
verifyTOTP(code: string, signal?: AbortSignal): Promise<{
|
|
1435
|
+
ok: true;
|
|
1436
|
+
}>;
|
|
1437
|
+
verifyRecoveryCode(code: string, signal?: AbortSignal): Promise<{
|
|
1438
|
+
ok: true;
|
|
1439
|
+
}>;
|
|
1440
|
+
regenerateRecoveryCodes(password?: string, signal?: AbortSignal): Promise<{
|
|
1441
|
+
backupCodes: string[];
|
|
1442
|
+
}>;
|
|
1443
|
+
disableTOTP(password?: string, signal?: AbortSignal): Promise<{
|
|
1444
|
+
ok: true;
|
|
1445
|
+
}>;
|
|
1446
|
+
passkeys(signal?: AbortSignal): Promise<{
|
|
1447
|
+
passkeys: {
|
|
1448
|
+
id: string;
|
|
1449
|
+
name?: string | null | undefined;
|
|
1450
|
+
createdAt: string;
|
|
1451
|
+
}[];
|
|
1452
|
+
}>;
|
|
1453
|
+
deletePasskey(id: string, signal?: AbortSignal): Promise<{
|
|
1454
|
+
ok: true;
|
|
1455
|
+
}>;
|
|
1456
|
+
changePassword(currentPassword: string, newPassword: string, signal?: AbortSignal): Promise<{
|
|
1457
|
+
ok: true;
|
|
1458
|
+
}>;
|
|
1459
|
+
linkSocial(provider: "google" | "apple", callbackURL: string, signal?: AbortSignal): Promise<{
|
|
1460
|
+
url: string;
|
|
1461
|
+
}>;
|
|
1462
|
+
profile(signal?: AbortSignal): Promise<{
|
|
1463
|
+
profile: {
|
|
1464
|
+
createdAt: string;
|
|
1465
|
+
emailChangeAvailable: boolean;
|
|
1466
|
+
id: string;
|
|
1467
|
+
name: string;
|
|
1468
|
+
email: string;
|
|
1469
|
+
image: string | null;
|
|
1470
|
+
};
|
|
1471
|
+
}>;
|
|
1472
|
+
updateProfile(name: string, signal?: AbortSignal): Promise<{
|
|
1473
|
+
ok: true;
|
|
1474
|
+
}>;
|
|
1475
|
+
uploadPicture(data: string, signal?: AbortSignal): Promise<{
|
|
1476
|
+
image: string;
|
|
1477
|
+
}>;
|
|
1478
|
+
removePicture(signal?: AbortSignal): Promise<{
|
|
1479
|
+
ok: true;
|
|
1480
|
+
}>;
|
|
1481
|
+
changeEmail(newEmail: string, callbackURL: string, signal?: AbortSignal): Promise<{
|
|
1482
|
+
ok: true;
|
|
1483
|
+
}>;
|
|
1484
|
+
sessions(signal?: AbortSignal): Promise<{
|
|
1485
|
+
sessions: {
|
|
1486
|
+
id: string;
|
|
1487
|
+
current: boolean;
|
|
1488
|
+
method: "password" | "google" | "apple" | "passkey" | "two-step" | "email-link" | "desktop" | "other" | null;
|
|
1489
|
+
ipAddress: string | null;
|
|
1490
|
+
browser: string | null;
|
|
1491
|
+
system: string | null;
|
|
1492
|
+
createdAt: string;
|
|
1493
|
+
lastActiveAt: string;
|
|
1494
|
+
expiresAt: string;
|
|
1495
|
+
}[];
|
|
1496
|
+
}>;
|
|
1497
|
+
revokeSession(sessionId: string, signal?: AbortSignal): Promise<{
|
|
1498
|
+
ok: true;
|
|
1499
|
+
}>;
|
|
1500
|
+
revokeOtherSessions(signal?: AbortSignal): Promise<{
|
|
1501
|
+
ok: true;
|
|
1502
|
+
}>;
|
|
1503
|
+
signIns(signal?: AbortSignal): Promise<{
|
|
1504
|
+
signIns: {
|
|
1505
|
+
id: string;
|
|
1506
|
+
method: "password" | "google" | "apple" | "passkey" | "two-step" | "email-link" | "desktop" | "other";
|
|
1507
|
+
ipAddress: string | null;
|
|
1508
|
+
browser: string | null;
|
|
1509
|
+
system: string | null;
|
|
1510
|
+
createdAt: string;
|
|
1511
|
+
}[];
|
|
1512
|
+
}>;
|
|
1513
|
+
unlinkAuthenticationMethod(methodId: string, signal?: AbortSignal): Promise<{
|
|
1514
|
+
ok: true;
|
|
1515
|
+
}>;
|
|
1516
|
+
};
|
|
1517
|
+
type CloudPortalClient = ReturnType<typeof createCloudPortalClient>;
|
|
1518
|
+
//#endregion
|
|
1519
|
+
export { type CloudAIClient, type CloudAIClientOptions, CloudAIError, type CloudAITokenSource, type CloudAPIClient, CloudAPIError, type CloudAuthClient, type CloudAuthClientOptions, type CloudAuthFailure, type CloudAuthResult, CloudClientError, type CloudDeviceAuthorization, CloudDeviceAuthorizationError, type CloudDeviceAuthorizationOptions, type CloudDeviceErrorCode, type CloudDeviceToken, type CloudDiscoveryFailure, type CloudEmailSignIn, type CloudFetch, CloudPortalAPIError, type CloudPortalAPIErrorKind, type CloudPortalClient, type CloudPortalClientOptions, type CloudRequestOptions, type CloudSignInOptions, type CloudSocialProvider, type CloudUpload, type DiscoverCloudOptions, cloudAIFetch, cloudAuthFailure, cloudEditorReturnURL, cloudRedirectPath, cloudSignInURL, createCloudAIClient, createCloudAPIClient, createCloudAuthClient, createCloudPortalClient, discoverCloud, pollCloudDeviceToken, requestCloudDeviceAuthorization, resendCloudVerification, signInToCloud, signInToCloudWithEmail, signOutFromCloud, signUpToCloudWithEmail };
|
|
1520
|
+
//# sourceMappingURL=client.d.ts.map
|