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