Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | 28x 28x 40x 37x 34x 29x 36x 28x 28x 39x 28x 35x 40x 28x 28x 28x 28x 37x 37x 40x 28x 28x 40x 28x 28x 28x 30x 28x 28x 28x 28x 197x 36x 36x 29x 36x | /**
* Public API of the Cloudflare adapters.
*
* @remarks
* The package's main published surface. `package.json#exports` points here and
* TypeDoc documents from here, so a symbol is API when it appears below and
* internal when it does not.
*
* The Hono middleware is not here. It sits behind the
* [`./middlewares`](./middlewares/index.ts) subpath so `hono` stays an optional peer
* dependency; that module explains why.
*
* ## What belongs here
*
* The platform side of the seam `@bayudwiyansatria/core` defines. The kernel
* says what an application needs — a cache, relational storage, a queue — and
* this package says what Cloudflare provides for it:
*
* - [`core/bindings/`](./core/bindings/index.ts) — one accessor per binding,
* over {@link Binding}. An accessor holds the binding's *name*, not the
* binding, and resolves it from the `Env` passed to each call, which is what
* makes one module-scope instance safe across requests.
* - [`core/services/`](./core/services/index.ts) — one capability service per
* accessor. {@link KVService} is a `CacheStore`, {@link D1Service} a
* `DataStore`, so business logic depends on the capability and never names
* Cloudflare.
* - [`constants/`](./constants/index.ts) — {@link cloudflareDefaults}, the
* binding-backed half of the configuration surface.
* - [`core/observability/`](./core/observability/index.ts) —
* {@link RequestCorrelation}, the header that carries one request id across a
* Service Binding hop, and — from `constants/` — {@link events}, the names
* the cross-cutting log lines are filed under. Everything else about
* observability is Cloudflare's own and is not reimplemented here.
* - {@link CloudflareEnv} — the environment contract a consuming Worker extends.
*
* ## Quick start
*
* ```ts
* import { configure, systemDefaults } from '@bayudwiyansatria/core'
* import { cloudflareDefaults, KVService } from '@bayudwiyansatria/cloudflare'
*
* // Once, at startup, before any accessor reads a setting.
* configure({ ...systemDefaults, ...cloudflareDefaults })
*
* const cache = new KVService()
* const hit = await cache.get(env, 'article:1')
* ```
*
* ## Exports
*
* | Category | Exports |
* | ------------- | --------------------------------------------------- |
* | Bindings | `Binding` and the eighteen accessors over it |
* | Services | The ten capability services |
* | Config | `cloudflareDefaults` and the twenty settings shapes |
* | Observability | `events`, `RequestCorrelation` |
* | Platform | `CloudflareEnv`, `CloudflareRequestMetadata` |
* | Errors | `MissingBindingError` |
*
* @module
* @author Bayu Dwiyan Satria
* @version 1.3.0
* @since 1.0.0
*/
/**
* Bindings
*/
export {
AIBinding,
AiSearchBinding,
AiSearchNamespaceBinding,
AnalyticsBinding,
Binding,
BrowserBinding,
D1Binding,
DurableObjectBinding,
FlagshipBinding,
HyperdriveBinding,
KVBinding,
PipelineBinding,
QueueBinding,
R2Binding,
RateLimitBinding,
VectorizeBinding,
VpcNetworkBinding,
VpcServiceBinding,
WorkflowBinding
} from '@/core/bindings'
/**
* Services
*/
export {
AIService,
AnalyticsService,
D1Service,
DurableObjectService,
HyperdriveService,
KVService,
QueueService,
R2Service,
RateLimitService,
VectorizeService
} from '@/core/services'
/**
* Configuration
*/
export { cloudflareDefaults } from '@/constants'
/**
* Observability
*/
export { events } from '@/constants'
export { RequestCorrelation } from '@/core/observability'
/**
* Platform
*/
export { CloudflareRequestMetadata } from '@/core/services/CloudflareRequestMetadata'
/**
* Errors
*/
export { MissingBindingError } from '@/exceptions/MissingBindingError'
/**
* Types
*/
export type { CloudflareEnv } from '@/types/CloudflareEnv'
export type { HyperdriveCredentials } from '@/types/hyperdrive/HyperdriveCredentials'
export type { D1Statement } from '@/types/d1/D1Statement'
export type { D1WriteResult } from '@/types/d1/D1WriteResult'
export type {
AISettings,
AiSearchNamespaceSettings,
AiSearchSettings,
AnalyticsSettings,
BindingSettings,
BrowserSettings,
CloudflareConfiguration,
D1Settings,
DurableObjectSettings,
FlagshipSettings,
HyperdriveSettings,
KVSettings,
PipelineSettings,
QueueSettings,
R2Settings,
RateLimitSettings,
VectorizeSettings,
VpcNetwork,
VpcNetworkSettings,
VpcServiceSettings,
WorkflowSettings
} from '@/types'
|