@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export {
|
|
2
|
+
createTransactionalEmailService,
|
|
3
|
+
TransactionalEmailTransportError,
|
|
4
|
+
type TransactionalEmailTransportErrorKind
|
|
5
|
+
} from './service'
|
|
6
|
+
export { createInvitationOutbox } from './invitations'
|
|
7
|
+
export { startTransactionalEmailWorker } from './worker'
|
|
8
|
+
export { decryptTransactionalEmailPayload, encryptTransactionalEmailPayload } from './crypto'
|
|
9
|
+
export type {
|
|
10
|
+
EnqueueTransactionalEmailInput,
|
|
11
|
+
TransactionalEmailDeliveryOptions,
|
|
12
|
+
TransactionalEmailDeliveryResult,
|
|
13
|
+
TransactionalEmailEnvelope,
|
|
14
|
+
TransactionalEmailSendResult,
|
|
15
|
+
TransactionalEmailService,
|
|
16
|
+
TransactionalEmailTransport
|
|
17
|
+
} from './types'
|
|
18
|
+
export type { TransactionalEmailWorker, TransactionalEmailWorkerOptions } from './worker'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CloudDatabase } from '#cloud/server/db'
|
|
2
|
+
import type { DocumentInvitationMessage, InvitationOutbox } from '#cloud/server/invitations'
|
|
3
|
+
import type { Transaction } from 'kysely'
|
|
4
|
+
|
|
5
|
+
import type { TransactionalEmailService } from './types'
|
|
6
|
+
|
|
7
|
+
export function createInvitationOutbox(email: TransactionalEmailService): InvitationOutbox {
|
|
8
|
+
return {
|
|
9
|
+
enqueueDocumentInvitation(
|
|
10
|
+
message: DocumentInvitationMessage,
|
|
11
|
+
transaction?: Transaction<CloudDatabase>
|
|
12
|
+
): Promise<string> {
|
|
13
|
+
return email.enqueue(
|
|
14
|
+
{
|
|
15
|
+
idempotencyKey: `document-invitation/${message.deliveryId}`,
|
|
16
|
+
kind: 'document-invitation',
|
|
17
|
+
recipientEmail: message.recipientEmail,
|
|
18
|
+
payload: {
|
|
19
|
+
inviterName: message.inviterName,
|
|
20
|
+
documentName: message.documentName,
|
|
21
|
+
permission: message.permission,
|
|
22
|
+
expiresAt: message.expiresAt,
|
|
23
|
+
acceptanceURL: message.acceptanceURL
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
transaction
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { renderTransactionalEmail } from '#cloud/email'
|
|
2
|
+
import type { TransactionalEmailKind } from '#cloud/email'
|
|
3
|
+
import type { CloudDatabase, TransactionalEmailStatus } from '#cloud/server/db'
|
|
4
|
+
import type { Kysely, Transaction } from 'kysely'
|
|
5
|
+
|
|
6
|
+
import { decryptTransactionalEmailPayload, encryptTransactionalEmailPayload } from './crypto'
|
|
7
|
+
import type {
|
|
8
|
+
EnqueueTransactionalEmailInput,
|
|
9
|
+
TransactionalEmailDeliveryOptions,
|
|
10
|
+
TransactionalEmailDeliveryResult,
|
|
11
|
+
TransactionalEmailService,
|
|
12
|
+
TransactionalEmailTransport
|
|
13
|
+
} from './types'
|
|
14
|
+
|
|
15
|
+
const DEFAULT_MAXIMUM_ATTEMPTS = 5
|
|
16
|
+
const MAXIMUM_RETRY_DELAY_MS = 60 * 60_000
|
|
17
|
+
|
|
18
|
+
export type TransactionalEmailTransportErrorKind =
|
|
19
|
+
| 'configuration'
|
|
20
|
+
| 'suppressed'
|
|
21
|
+
| 'permanent'
|
|
22
|
+
| 'rate-limited'
|
|
23
|
+
| 'transient'
|
|
24
|
+
|
|
25
|
+
export class TransactionalEmailTransportError extends Error {
|
|
26
|
+
override readonly name = 'TransactionalEmailTransportError'
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
readonly kind: TransactionalEmailTransportErrorKind,
|
|
30
|
+
readonly code: string,
|
|
31
|
+
message: string,
|
|
32
|
+
options?: ErrorOptions
|
|
33
|
+
) {
|
|
34
|
+
super(message, options)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type ClaimedTransactionalEmail = {
|
|
39
|
+
id: string
|
|
40
|
+
kind: TransactionalEmailKind
|
|
41
|
+
recipientEmailNormalized: string
|
|
42
|
+
payloadEncrypted: string
|
|
43
|
+
attemptCount: number
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function normalizedEmail(value: string): string {
|
|
47
|
+
return value.trim().toLowerCase()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function retryDelayMilliseconds(attemptCount: number): number {
|
|
51
|
+
return Math.min(MAXIMUM_RETRY_DELAY_MS, 2 ** Math.max(0, attemptCount - 1) * 30_000)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function transportFailure(error: unknown): TransactionalEmailTransportError {
|
|
55
|
+
return error instanceof TransactionalEmailTransportError
|
|
56
|
+
? error
|
|
57
|
+
: new TransactionalEmailTransportError(
|
|
58
|
+
'transient',
|
|
59
|
+
'transport_error',
|
|
60
|
+
'Transactional email transport failed',
|
|
61
|
+
{ cause: error }
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function failureStatus(
|
|
66
|
+
error: TransactionalEmailTransportError,
|
|
67
|
+
attemptCount: number,
|
|
68
|
+
maximumAttempts: number
|
|
69
|
+
): TransactionalEmailStatus {
|
|
70
|
+
if (error.kind === 'suppressed') return 'suppressed'
|
|
71
|
+
if (error.kind === 'configuration' || error.kind === 'permanent') return 'failed'
|
|
72
|
+
return attemptCount >= maximumAttempts ? 'failed' : 'pending'
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function createTransactionalEmailService(
|
|
76
|
+
database: Kysely<CloudDatabase>,
|
|
77
|
+
options: {
|
|
78
|
+
encryptionSecret: string
|
|
79
|
+
from: string
|
|
80
|
+
transport?: TransactionalEmailTransport
|
|
81
|
+
}
|
|
82
|
+
): TransactionalEmailService {
|
|
83
|
+
return {
|
|
84
|
+
async enqueue<Kind extends TransactionalEmailKind>(
|
|
85
|
+
input: EnqueueTransactionalEmailInput<Kind>,
|
|
86
|
+
transaction: Transaction<CloudDatabase> | undefined
|
|
87
|
+
): Promise<string> {
|
|
88
|
+
const id = crypto.randomUUID()
|
|
89
|
+
const payloadEncrypted = await encryptTransactionalEmailPayload(
|
|
90
|
+
options.encryptionSecret,
|
|
91
|
+
id,
|
|
92
|
+
input.kind,
|
|
93
|
+
input.payload
|
|
94
|
+
)
|
|
95
|
+
const executor = transaction ?? database
|
|
96
|
+
const row = await executor
|
|
97
|
+
.insertInto('transactionalEmail')
|
|
98
|
+
.values({
|
|
99
|
+
id,
|
|
100
|
+
idempotencyKey: input.idempotencyKey,
|
|
101
|
+
kind: input.kind,
|
|
102
|
+
recipientEmailNormalized: normalizedEmail(input.recipientEmail),
|
|
103
|
+
payloadEncrypted,
|
|
104
|
+
status: 'pending',
|
|
105
|
+
nextAttemptAt: new Date(),
|
|
106
|
+
claimId: null,
|
|
107
|
+
claimedAt: null,
|
|
108
|
+
transport: null,
|
|
109
|
+
transportMessageId: null,
|
|
110
|
+
lastErrorCode: null,
|
|
111
|
+
acceptedAt: null
|
|
112
|
+
})
|
|
113
|
+
.onConflict((conflict) => conflict.column('idempotencyKey').doNothing())
|
|
114
|
+
.returning('id')
|
|
115
|
+
.executeTakeFirst()
|
|
116
|
+
if (row) return row.id
|
|
117
|
+
return (
|
|
118
|
+
await executor
|
|
119
|
+
.selectFrom('transactionalEmail')
|
|
120
|
+
.select('id')
|
|
121
|
+
.where('idempotencyKey', '=', input.idempotencyKey)
|
|
122
|
+
.executeTakeFirstOrThrow()
|
|
123
|
+
).id
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
async deliverPending(
|
|
127
|
+
deliveryOptions: TransactionalEmailDeliveryOptions
|
|
128
|
+
): Promise<TransactionalEmailDeliveryResult> {
|
|
129
|
+
if (!options.transport) {
|
|
130
|
+
return { claimed: 0, accepted: 0, retrying: 0, failed: 0, suppressed: 0 }
|
|
131
|
+
}
|
|
132
|
+
const now = deliveryOptions.now ?? new Date()
|
|
133
|
+
const maximumAttempts = deliveryOptions.maximumAttempts ?? DEFAULT_MAXIMUM_ATTEMPTS
|
|
134
|
+
const staleBefore = new Date(now.getTime() - deliveryOptions.leaseDurationMs)
|
|
135
|
+
const claimId = crypto.randomUUID()
|
|
136
|
+
const claimed = await database.transaction().execute(async (transaction) => {
|
|
137
|
+
const candidates = await transaction
|
|
138
|
+
.selectFrom('transactionalEmail')
|
|
139
|
+
.select(['id', 'kind', 'recipientEmailNormalized', 'payloadEncrypted', 'attemptCount'])
|
|
140
|
+
.where('payloadEncrypted', 'is not', null)
|
|
141
|
+
.where((expression) =>
|
|
142
|
+
expression.or([
|
|
143
|
+
expression.and([
|
|
144
|
+
expression('status', '=', 'pending'),
|
|
145
|
+
expression('nextAttemptAt', '<=', now)
|
|
146
|
+
]),
|
|
147
|
+
expression.and([
|
|
148
|
+
expression('status', '=', 'sending'),
|
|
149
|
+
expression('claimedAt', '<=', staleBefore)
|
|
150
|
+
])
|
|
151
|
+
])
|
|
152
|
+
)
|
|
153
|
+
.orderBy('nextAttemptAt')
|
|
154
|
+
.limit(deliveryOptions.batchSize)
|
|
155
|
+
.forUpdate()
|
|
156
|
+
.skipLocked()
|
|
157
|
+
.execute()
|
|
158
|
+
if (candidates.length === 0) return []
|
|
159
|
+
await transaction
|
|
160
|
+
.updateTable('transactionalEmail')
|
|
161
|
+
.set({ status: 'sending', claimId, claimedAt: now, updatedAt: now })
|
|
162
|
+
.where(
|
|
163
|
+
'id',
|
|
164
|
+
'in',
|
|
165
|
+
candidates.map((candidate) => candidate.id)
|
|
166
|
+
)
|
|
167
|
+
.execute()
|
|
168
|
+
return candidates.filter(
|
|
169
|
+
(candidate): candidate is ClaimedTransactionalEmail => candidate.payloadEncrypted !== null
|
|
170
|
+
)
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
const result: TransactionalEmailDeliveryResult = {
|
|
174
|
+
claimed: claimed.length,
|
|
175
|
+
accepted: 0,
|
|
176
|
+
retrying: 0,
|
|
177
|
+
failed: 0,
|
|
178
|
+
suppressed: 0
|
|
179
|
+
}
|
|
180
|
+
for (const message of claimed) {
|
|
181
|
+
const attemptCount = message.attemptCount + 1
|
|
182
|
+
try {
|
|
183
|
+
const content = await decryptTransactionalEmailPayload(
|
|
184
|
+
options.encryptionSecret,
|
|
185
|
+
message.id,
|
|
186
|
+
message.kind,
|
|
187
|
+
message.payloadEncrypted
|
|
188
|
+
)
|
|
189
|
+
const rendered = await renderTransactionalEmail(content)
|
|
190
|
+
const sent = await options.transport.send({
|
|
191
|
+
deliveryId: message.id,
|
|
192
|
+
from: options.from,
|
|
193
|
+
to: message.recipientEmailNormalized,
|
|
194
|
+
subject: rendered.subject,
|
|
195
|
+
html: rendered.html,
|
|
196
|
+
text: rendered.text,
|
|
197
|
+
headers: { 'X-OpenPencil-Delivery-ID': message.id }
|
|
198
|
+
})
|
|
199
|
+
await database
|
|
200
|
+
.updateTable('transactionalEmail')
|
|
201
|
+
.set({
|
|
202
|
+
payloadEncrypted: null,
|
|
203
|
+
status: 'accepted',
|
|
204
|
+
attemptCount,
|
|
205
|
+
transport: options.transport.id,
|
|
206
|
+
transportMessageId: sent.transportMessageId,
|
|
207
|
+
lastErrorCode: null,
|
|
208
|
+
acceptedAt: new Date(sent.acceptedAt),
|
|
209
|
+
claimId: null,
|
|
210
|
+
claimedAt: null,
|
|
211
|
+
updatedAt: now
|
|
212
|
+
})
|
|
213
|
+
.where('id', '=', message.id)
|
|
214
|
+
.where('claimId', '=', claimId)
|
|
215
|
+
.execute()
|
|
216
|
+
result.accepted++
|
|
217
|
+
} catch (unknownError) {
|
|
218
|
+
const error = transportFailure(unknownError)
|
|
219
|
+
const status = failureStatus(error, attemptCount, maximumAttempts)
|
|
220
|
+
const terminal = status === 'failed' || status === 'suppressed'
|
|
221
|
+
await database
|
|
222
|
+
.updateTable('transactionalEmail')
|
|
223
|
+
.set({
|
|
224
|
+
payloadEncrypted: terminal ? null : message.payloadEncrypted,
|
|
225
|
+
status,
|
|
226
|
+
attemptCount,
|
|
227
|
+
nextAttemptAt: new Date(now.getTime() + retryDelayMilliseconds(attemptCount)),
|
|
228
|
+
transport: options.transport.id,
|
|
229
|
+
lastErrorCode: error.code,
|
|
230
|
+
claimId: null,
|
|
231
|
+
claimedAt: null,
|
|
232
|
+
updatedAt: now
|
|
233
|
+
})
|
|
234
|
+
.where('id', '=', message.id)
|
|
235
|
+
.where('claimId', '=', claimId)
|
|
236
|
+
.execute()
|
|
237
|
+
if (status === 'suppressed') result.suppressed++
|
|
238
|
+
else if (status === 'failed') result.failed++
|
|
239
|
+
else result.retrying++
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return result
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
RenderedTransactionalEmail,
|
|
3
|
+
TransactionalEmailKind,
|
|
4
|
+
TransactionalEmailPayloadByKind
|
|
5
|
+
} from '#cloud/email'
|
|
6
|
+
import type { CloudDatabase } from '#cloud/server/db'
|
|
7
|
+
import type { Transaction } from 'kysely'
|
|
8
|
+
|
|
9
|
+
export type TransactionalEmailEnvelope = RenderedTransactionalEmail & {
|
|
10
|
+
deliveryId: string
|
|
11
|
+
from: string
|
|
12
|
+
to: string
|
|
13
|
+
headers: Record<string, string>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type TransactionalEmailSendResult = {
|
|
17
|
+
transportMessageId: string
|
|
18
|
+
acceptedAt: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type TransactionalEmailTransport = {
|
|
22
|
+
id: string
|
|
23
|
+
send(envelope: TransactionalEmailEnvelope): Promise<TransactionalEmailSendResult>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type EnqueueTransactionalEmailInput<Kind extends TransactionalEmailKind> = {
|
|
27
|
+
idempotencyKey: string
|
|
28
|
+
kind: Kind
|
|
29
|
+
recipientEmail: string
|
|
30
|
+
payload: TransactionalEmailPayloadByKind[Kind]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type TransactionalEmailDeliveryOptions = {
|
|
34
|
+
batchSize: number
|
|
35
|
+
leaseDurationMs: number
|
|
36
|
+
maximumAttempts?: number
|
|
37
|
+
now?: Date
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type TransactionalEmailDeliveryResult = {
|
|
41
|
+
claimed: number
|
|
42
|
+
accepted: number
|
|
43
|
+
retrying: number
|
|
44
|
+
failed: number
|
|
45
|
+
suppressed: number
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type TransactionalEmailService = {
|
|
49
|
+
enqueue<Kind extends TransactionalEmailKind>(
|
|
50
|
+
input: EnqueueTransactionalEmailInput<Kind>,
|
|
51
|
+
transaction?: Transaction<CloudDatabase>
|
|
52
|
+
): Promise<string>
|
|
53
|
+
deliverPending(
|
|
54
|
+
options: TransactionalEmailDeliveryOptions
|
|
55
|
+
): Promise<TransactionalEmailDeliveryResult>
|
|
56
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { startPeriodicWorker } from '../worker/periodic'
|
|
2
|
+
import type { TransactionalEmailDeliveryResult, TransactionalEmailService } from './types'
|
|
3
|
+
|
|
4
|
+
export type TransactionalEmailWorkerOptions = {
|
|
5
|
+
batchSize: number
|
|
6
|
+
intervalMs: number
|
|
7
|
+
leaseDurationMs: number
|
|
8
|
+
maximumAttempts: number
|
|
9
|
+
signal?: AbortSignal
|
|
10
|
+
onError?: (error: unknown) => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type TransactionalEmailWorker = {
|
|
14
|
+
runOnce(): Promise<TransactionalEmailDeliveryResult>
|
|
15
|
+
stop(): Promise<void>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function startTransactionalEmailWorker(
|
|
19
|
+
email: TransactionalEmailService,
|
|
20
|
+
options: TransactionalEmailWorkerOptions
|
|
21
|
+
): TransactionalEmailWorker {
|
|
22
|
+
return startPeriodicWorker({
|
|
23
|
+
intervalMs: options.intervalMs,
|
|
24
|
+
signal: options.signal,
|
|
25
|
+
onError: options.onError,
|
|
26
|
+
run: () =>
|
|
27
|
+
email.deliverPending({
|
|
28
|
+
batchSize: options.batchSize,
|
|
29
|
+
leaseDurationMs: options.leaseDurationMs,
|
|
30
|
+
maximumAttempts: options.maximumAttempts
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
export {
|
|
2
|
+
adminErrorStatus,
|
|
3
|
+
AdminDomainError,
|
|
4
|
+
createAdminAuditService,
|
|
5
|
+
createAdminEmailService,
|
|
6
|
+
createAdminOperationsService,
|
|
7
|
+
createAdminUserService,
|
|
8
|
+
createCloudAdminRoutes,
|
|
9
|
+
createEnrollmentService,
|
|
10
|
+
normalizeEnrollmentEmail,
|
|
11
|
+
type AdminAuditService,
|
|
12
|
+
type AdminErrorCode,
|
|
13
|
+
type AdminEmailService,
|
|
14
|
+
type AdminOperationsService,
|
|
15
|
+
type AdminUserService,
|
|
16
|
+
type CloudAdminServices,
|
|
17
|
+
type EnrollmentMode,
|
|
18
|
+
type EnrollmentRecord,
|
|
19
|
+
type EnrollmentService,
|
|
20
|
+
type EnrollmentStatus
|
|
21
|
+
} from '#cloud/admin'
|
|
22
|
+
export {
|
|
23
|
+
AINotEntitledError,
|
|
24
|
+
createAIRoutes,
|
|
25
|
+
createAITokenService,
|
|
26
|
+
importAISigningKey,
|
|
27
|
+
loadAISigningKey,
|
|
28
|
+
type AIRouteEnvironment,
|
|
29
|
+
type AISigningKey,
|
|
30
|
+
type AITokenService,
|
|
31
|
+
type AITokenServiceOptions
|
|
32
|
+
} from './ai'
|
|
33
|
+
export {
|
|
34
|
+
createAuthenticationEmailService,
|
|
35
|
+
createAccountAuthenticationService,
|
|
36
|
+
createCloudAuthenticationRuntime,
|
|
37
|
+
createBetterAuthAdapter,
|
|
38
|
+
createCloudIdentityResolver,
|
|
39
|
+
createCloudSessionResolver,
|
|
40
|
+
type CloudActor,
|
|
41
|
+
type CloudAuthAdapter,
|
|
42
|
+
type CloudAuthRuntimeOptions,
|
|
43
|
+
type CloudIdentity,
|
|
44
|
+
type CloudIdentityResolver,
|
|
45
|
+
type CloudSessionResolver,
|
|
46
|
+
type AccountAuthenticationService,
|
|
47
|
+
type AuthenticationEmailService,
|
|
48
|
+
workspaceAccessControl,
|
|
49
|
+
workspaceRoles,
|
|
50
|
+
workspaceStatements
|
|
51
|
+
} from './auth'
|
|
52
|
+
export {
|
|
53
|
+
createCloudAPIRouter,
|
|
54
|
+
createPublicCloudAPIRouter,
|
|
55
|
+
type CloudAPI,
|
|
56
|
+
type CloudAPIEnvironment,
|
|
57
|
+
type CloudAPIServices,
|
|
58
|
+
type PublicCloudAPI
|
|
59
|
+
} from './api'
|
|
60
|
+
export {
|
|
61
|
+
createCloudApp,
|
|
62
|
+
shouldPreventIndexing,
|
|
63
|
+
withIndexingPolicy,
|
|
64
|
+
type CloudApp,
|
|
65
|
+
type CloudServices
|
|
66
|
+
} from './app'
|
|
67
|
+
export {
|
|
68
|
+
cleanupPassOptions,
|
|
69
|
+
createCleanupServices,
|
|
70
|
+
createDocumentCleanupService,
|
|
71
|
+
createRevisionCompactionService,
|
|
72
|
+
createUploadCleanupService,
|
|
73
|
+
REVISION_COMPACTION_GRACE_MS,
|
|
74
|
+
runCleanup,
|
|
75
|
+
startCleanupWorker,
|
|
76
|
+
type CleanupPassOptions,
|
|
77
|
+
type CleanupResult,
|
|
78
|
+
type CleanupServices,
|
|
79
|
+
type CleanupWorker,
|
|
80
|
+
type CleanupWorkerOptions,
|
|
81
|
+
type DocumentCleanupOptions,
|
|
82
|
+
type DocumentCleanupResult,
|
|
83
|
+
type DocumentCleanupService,
|
|
84
|
+
type UploadCleanupOptions,
|
|
85
|
+
type UploadCleanupResult,
|
|
86
|
+
type UploadCleanupService
|
|
87
|
+
} from './cleanup'
|
|
88
|
+
export {
|
|
89
|
+
authorizeRelayTicket,
|
|
90
|
+
createCollaborationRelay,
|
|
91
|
+
createCollaborationStateStore,
|
|
92
|
+
relayDocumentLookups,
|
|
93
|
+
stampAwareness,
|
|
94
|
+
type CollaborationRelay,
|
|
95
|
+
type CollaborationRelayOptions,
|
|
96
|
+
type CollaborationRoomIdentity,
|
|
97
|
+
type CollaborationStateStore,
|
|
98
|
+
type RelayAuthorization,
|
|
99
|
+
type RelayConnection,
|
|
100
|
+
type RelaySocket,
|
|
101
|
+
createCollaborationRoutes,
|
|
102
|
+
createCollaborationTicketService,
|
|
103
|
+
signCollaborationTicket,
|
|
104
|
+
type CollaborationTicketClaims,
|
|
105
|
+
createPublicCollaborationRoutes,
|
|
106
|
+
type CollaborationRouteEnvironment,
|
|
107
|
+
type CollaborationTicketService
|
|
108
|
+
} from './collaboration'
|
|
109
|
+
export {
|
|
110
|
+
CloudConfigError,
|
|
111
|
+
cloudDeploymentConfigSchema,
|
|
112
|
+
cloudDiscoveryFromConfig,
|
|
113
|
+
configuredSocialProviders,
|
|
114
|
+
parseCloudDeploymentConfig,
|
|
115
|
+
parseCloudDeploymentSource,
|
|
116
|
+
parseCloudDeploymentTOML,
|
|
117
|
+
parseCloudServerConfig,
|
|
118
|
+
CLOUD_DEFAULT_MAX_COLLABORATION_MESSAGE_BYTES,
|
|
119
|
+
CLOUD_DEFAULT_MAX_CONNECTIONS_PER_ROOM,
|
|
120
|
+
type CloudDeploymentConfig,
|
|
121
|
+
type CloudDeploymentInput,
|
|
122
|
+
type CloudEnvironment,
|
|
123
|
+
type CloudSecretReference,
|
|
124
|
+
type CloudServerConfig,
|
|
125
|
+
type CloudTechnicalLimits
|
|
126
|
+
} from './config'
|
|
127
|
+
export {
|
|
128
|
+
createCloudDatabase,
|
|
129
|
+
migrateCloudDatabase,
|
|
130
|
+
type CloudDatabase,
|
|
131
|
+
type CloudDatabaseOptions,
|
|
132
|
+
type Document,
|
|
133
|
+
type DocumentRevision,
|
|
134
|
+
type NewDocument,
|
|
135
|
+
type NewDocumentRevision,
|
|
136
|
+
type NewStorageObject,
|
|
137
|
+
type NewTransactionalEmail,
|
|
138
|
+
type NewUpload,
|
|
139
|
+
type NewWorkspace,
|
|
140
|
+
type StorageObject,
|
|
141
|
+
type TransactionalEmail,
|
|
142
|
+
type TransactionalEmailStatus,
|
|
143
|
+
type Upload,
|
|
144
|
+
type UploadStatus,
|
|
145
|
+
type Workspace,
|
|
146
|
+
type WorkspaceUpdate
|
|
147
|
+
} from './db'
|
|
148
|
+
export {
|
|
149
|
+
canEditDocument,
|
|
150
|
+
createDocumentRoutes,
|
|
151
|
+
createDocumentService,
|
|
152
|
+
DocumentConflictError,
|
|
153
|
+
DocumentForbiddenError,
|
|
154
|
+
DocumentNotFoundError,
|
|
155
|
+
resolveDocumentAccess,
|
|
156
|
+
UploadInvalidError,
|
|
157
|
+
type AccessDatabase,
|
|
158
|
+
type DocumentRouteEnvironment,
|
|
159
|
+
type DocumentService
|
|
160
|
+
} from './documents'
|
|
161
|
+
export {
|
|
162
|
+
CHECKPOINT_INTERVAL_MS,
|
|
163
|
+
createDocumentVersionRoutes,
|
|
164
|
+
createDocumentVersionService,
|
|
165
|
+
LIMITED_HISTORY_DAYS,
|
|
166
|
+
type DocumentVersionService
|
|
167
|
+
} from './documents/versions'
|
|
168
|
+
export {
|
|
169
|
+
createInvitationOutbox,
|
|
170
|
+
createTransactionalEmailService,
|
|
171
|
+
startTransactionalEmailWorker,
|
|
172
|
+
decryptTransactionalEmailPayload,
|
|
173
|
+
encryptTransactionalEmailPayload,
|
|
174
|
+
TransactionalEmailTransportError,
|
|
175
|
+
type EnqueueTransactionalEmailInput,
|
|
176
|
+
type TransactionalEmailDeliveryOptions,
|
|
177
|
+
type TransactionalEmailDeliveryResult,
|
|
178
|
+
type TransactionalEmailEnvelope,
|
|
179
|
+
type TransactionalEmailSendResult,
|
|
180
|
+
type TransactionalEmailService,
|
|
181
|
+
type TransactionalEmailTransport,
|
|
182
|
+
type TransactionalEmailWorker,
|
|
183
|
+
type TransactionalEmailWorkerOptions
|
|
184
|
+
} from './email'
|
|
185
|
+
export {
|
|
186
|
+
createInternalRoutes,
|
|
187
|
+
createInternalService,
|
|
188
|
+
parseSetWorkspaceEntitlements,
|
|
189
|
+
setWorkspaceEntitlementsSchema,
|
|
190
|
+
type InternalService,
|
|
191
|
+
type SetWorkspaceEntitlementsInput
|
|
192
|
+
} from './internal'
|
|
193
|
+
export {
|
|
194
|
+
noOpInvitationDelivery,
|
|
195
|
+
type DocumentInvitationMessage,
|
|
196
|
+
type InvitationDelivery,
|
|
197
|
+
type InvitationOutbox
|
|
198
|
+
} from './invitations'
|
|
199
|
+
export type {
|
|
200
|
+
AbortObjectUploadInput,
|
|
201
|
+
CompletedObjectPart,
|
|
202
|
+
CompleteObjectUploadInput,
|
|
203
|
+
CreateObjectDownloadInput,
|
|
204
|
+
CreateObjectUploadInput,
|
|
205
|
+
ObjectDownload,
|
|
206
|
+
ObjectMultipartUpload,
|
|
207
|
+
ObjectSingleUpload,
|
|
208
|
+
ObjectStore,
|
|
209
|
+
ObjectStoreCapabilities,
|
|
210
|
+
ObjectStoreReadiness,
|
|
211
|
+
ObjectUpload,
|
|
212
|
+
ObjectUploadPart,
|
|
213
|
+
StoredObject
|
|
214
|
+
} from './objects'
|
|
215
|
+
export {
|
|
216
|
+
capabilityHashMatches,
|
|
217
|
+
createDocumentSharingRoutes,
|
|
218
|
+
createDocumentSharingService,
|
|
219
|
+
createPublicDocumentRoutes,
|
|
220
|
+
createPublicSharingRoutes,
|
|
221
|
+
decryptContinuationToken,
|
|
222
|
+
DocumentShareInvalidError,
|
|
223
|
+
DocumentShareSignInRequiredError,
|
|
224
|
+
encryptContinuationToken,
|
|
225
|
+
hashCapability,
|
|
226
|
+
type DocumentShareCapability,
|
|
227
|
+
type DocumentSharingService,
|
|
228
|
+
type ResolvedDocumentShare,
|
|
229
|
+
type ResolvedSharePrincipal,
|
|
230
|
+
type SharingRouteEnvironment
|
|
231
|
+
} from './sharing'
|
|
232
|
+
export {
|
|
233
|
+
CLOUD_FEATURE_KEYS,
|
|
234
|
+
CloudPolicy,
|
|
235
|
+
createConfiguredCloudPolicy,
|
|
236
|
+
createWorkspaceEntitlementRepository,
|
|
237
|
+
DatabaseEntitlementSource,
|
|
238
|
+
EntitlementOpenFeatureProvider,
|
|
239
|
+
createDefaultCloudPolicy,
|
|
240
|
+
createEntitlementService,
|
|
241
|
+
StaticEntitlementSource,
|
|
242
|
+
parseStaticEntitlementsTOML,
|
|
243
|
+
staticEntitlementValues,
|
|
244
|
+
staticEntitlementsSchema,
|
|
245
|
+
type CloudPolicyContext,
|
|
246
|
+
type EntitlementSource,
|
|
247
|
+
type EntitlementService,
|
|
248
|
+
type EntitlementSubject,
|
|
249
|
+
type StaticEntitlements,
|
|
250
|
+
type StaticEntitlementsInput
|
|
251
|
+
} from './policy'
|
|
252
|
+
export {
|
|
253
|
+
createStorageQuotaService,
|
|
254
|
+
createStorageReconciliationService,
|
|
255
|
+
StorageQuotaExceededError,
|
|
256
|
+
type StorageQuotaService,
|
|
257
|
+
type StorageQuotaSnapshot,
|
|
258
|
+
type StorageReconciliation
|
|
259
|
+
} from './quota'
|
|
260
|
+
export {
|
|
261
|
+
CLOUD_RATE_LIMITS,
|
|
262
|
+
createActorRateLimiter,
|
|
263
|
+
createCloudRateLimiter,
|
|
264
|
+
createRateLimitCleanupService,
|
|
265
|
+
createTrustedIPRateLimiter,
|
|
266
|
+
PostgresRateLimitStore,
|
|
267
|
+
rateLimitKey,
|
|
268
|
+
trustedClientIP,
|
|
269
|
+
type ClientIdentityOptions,
|
|
270
|
+
type RateLimitCleanupService,
|
|
271
|
+
type RateLimitPolicy
|
|
272
|
+
} from './rate-limit'
|
|
273
|
+
export {
|
|
274
|
+
createWorkspaceRoutes,
|
|
275
|
+
createWorkspaceService,
|
|
276
|
+
WorkspaceSlugConflictError,
|
|
277
|
+
type WorkspaceRouteEnvironment,
|
|
278
|
+
type WorkspaceService
|
|
279
|
+
} from './workspaces'
|