@hamur/blob 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +51 -2
  3. package/dist/src/client/index.js +158 -0
  4. package/dist/src/index.js +220 -0
  5. package/dist/src/server/index.js +498 -0
  6. package/dist/types/src/build/setup.d.ts +7 -0
  7. package/dist/types/src/client/index.d.ts +28 -0
  8. package/dist/types/src/drivers/cloudflare-r2.d.ts +75 -0
  9. package/dist/types/src/drivers/fs.d.ts +14 -0
  10. package/dist/types/src/drivers/s3.d.ts +12 -0
  11. package/dist/types/src/drivers/suite.d.ts +9 -0
  12. package/dist/types/src/index.d.ts +2 -0
  13. package/dist/types/src/module.d.ts +3 -0
  14. package/dist/types/src/options.d.ts +19 -0
  15. package/dist/types/src/runtime/choose.d.ts +3 -0
  16. package/dist/types/src/runtime/driver.d.ts +29 -0
  17. package/dist/types/src/runtime/mime.d.ts +6 -0
  18. package/dist/types/src/runtime/multipart.d.ts +34 -0
  19. package/dist/types/src/runtime/store.d.ts +10 -0
  20. package/dist/types/src/server/blob.d.ts +3 -0
  21. package/dist/types/src/server/ensure.d.ts +22 -0
  22. package/dist/types/src/server/index.d.ts +12 -0
  23. package/dist/types/src/types.d.ts +152 -0
  24. package/package.json +32 -4
  25. package/src/build/setup.ts +137 -0
  26. package/src/client/index.ts +206 -0
  27. package/src/drivers/cloudflare-r2.ts +232 -0
  28. package/src/drivers/fs.ts +398 -0
  29. package/src/drivers/s3.ts +311 -0
  30. package/src/drivers/suite.ts +314 -0
  31. package/src/env.d.ts +16 -0
  32. package/src/index.ts +10 -0
  33. package/src/module.ts +11 -0
  34. package/src/options.ts +102 -0
  35. package/src/runtime/choose.ts +18 -0
  36. package/src/runtime/driver.ts +82 -0
  37. package/src/runtime/mime.ts +18 -0
  38. package/src/runtime/multipart.ts +319 -0
  39. package/src/runtime/store.ts +190 -0
  40. package/src/server/blob.ts +26 -0
  41. package/src/server/ensure.ts +52 -0
  42. package/src/server/index.ts +20 -0
  43. package/src/types.ts +155 -0
@@ -0,0 +1,190 @@
1
+ import { createError, type HamurEvent } from "hamur/server"
2
+ import { contentType as defaultContentType, matchesETag, parseRange } from "hamur/server/http"
3
+ import type { BlobBody, BlobDriver, BlobListOptions, BlobPutOptions, BlobServeOptions, BlobStore } from "../types.ts"
4
+ import { invalidPathname } from "./driver.ts"
5
+ import { parseContentType } from "./mime.ts"
6
+
7
+ const MAX_PATHNAME_BYTES = 1024
8
+ const METADATA_KEY = /^[a-z0-9-]+$/
9
+ const METADATA_VALUE = /^(?:[\x21-\x7e](?:[\x20-\x7e]*[\x21-\x7e])?)?$/
10
+ /** S3's limit on user metadata: the UTF-8 bytes of every key and value together. */
11
+ const METADATA_BYTES = 2048
12
+ const SANDBOX = "default-src 'none'; style-src 'unsafe-inline'; sandbox"
13
+ const CACHE_CONTROL = "private, no-cache"
14
+ /** Reads of a pathname that a put replaces between the headers and the bytes are tried again this many times. */
15
+ const READ_TRIES = 3
16
+ const encoder = new TextEncoder()
17
+
18
+ /** `/`-separated, a leading `/` dropped, at most 1024 bytes; an empty segment, `.`, `..`, `\`, NUL or a lone surrogate is refused. */
19
+ export function checkPathname(pathname: string): string {
20
+ const path = typeof pathname === "string" ? pathname.replace(/^\//, "") : ""
21
+ const valid =
22
+ path !== "" &&
23
+ path.isWellFormed() &&
24
+ encoder.encode(path).length <= MAX_PATHNAME_BYTES &&
25
+ !/[\\\0]/.test(path) &&
26
+ path.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..")
27
+ if (!valid) throw invalidPathname(pathname)
28
+ return path
29
+ }
30
+
31
+ function checkPrefix(prefix: string | undefined): string {
32
+ if (prefix === undefined || prefix === "" || prefix === "/") return ""
33
+ const path = prefix.replace(/^\//, "")
34
+ checkPathname(path.endsWith("/") ? path.slice(0, -1) : path)
35
+ return path
36
+ }
37
+
38
+ export function checkMetadata(metadata: Record<string, string> | undefined): Record<string, string> {
39
+ const checked: Record<string, string> = {}
40
+ let bytes = 0
41
+ for (const [key, value] of Object.entries(metadata ?? {})) {
42
+ if (!METADATA_KEY.test(key))
43
+ throw new TypeError(`Invalid customMetadata key ${JSON.stringify(key)}: use a-z, 0-9 and "-"`)
44
+ if (typeof value !== "string" || !METADATA_VALUE.test(value)) {
45
+ throw new TypeError(
46
+ `Invalid customMetadata value for ${JSON.stringify(key)}: use printable ASCII with no leading or trailing space`,
47
+ )
48
+ }
49
+ bytes += key.length + value.length
50
+ checked[key] = value
51
+ }
52
+ if (bytes > METADATA_BYTES)
53
+ throw new TypeError(
54
+ `customMetadata is ${bytes} bytes; keys and values together may hold at most ${METADATA_BYTES} (S3's limit)`,
55
+ )
56
+ return checked
57
+ }
58
+
59
+ /** One `type/subtype` with optional parameters, canonical; anything else throws. */
60
+ export function checkContentType(type: string): string {
61
+ const parsed = parseContentType(type)
62
+ if (!parsed)
63
+ throw new TypeError(
64
+ `Invalid blob content type ${JSON.stringify(type)}: use one type/subtype with optional ; parameters`,
65
+ )
66
+ return parsed
67
+ }
68
+
69
+ function randomSuffix(): string {
70
+ const bytes = crypto.getRandomValues(new Uint8Array(8))
71
+ return Array.from(bytes, (byte) => (byte % 36).toString(36)).join("")
72
+ }
73
+
74
+ /** `a/photo.jpg` → `a/photo-k3j9x0q2.jpg`: the suffix goes before the last segment's extension. */
75
+ export function withRandomSuffix(pathname: string): string {
76
+ const slash = pathname.lastIndexOf("/")
77
+ const dot = pathname.lastIndexOf(".")
78
+ const at = dot > slash + 1 ? dot : pathname.length
79
+ return `${pathname.slice(0, at)}-${randomSuffix()}${pathname.slice(at)}`
80
+ }
81
+
82
+ function normalizeBody(body: BlobBody): Uint8Array | Blob | ReadableStream<Uint8Array> {
83
+ if (typeof body === "string") return encoder.encode(body)
84
+ if (body instanceof ArrayBuffer) return new Uint8Array(body)
85
+ if (body instanceof Uint8Array || body instanceof Blob || body instanceof ReadableStream) return body
86
+ throw new TypeError("blob put takes a string, ArrayBuffer, Uint8Array, Blob or ReadableStream body")
87
+ }
88
+
89
+ /** The pathname rules, the defaults of `put` and `serve` over a driver opened at first use. */
90
+ export function createBlobStore(driver: () => Promise<BlobDriver>): BlobStore {
91
+ async function serve(event: HamurEvent, pathname: string, options: BlobServeOptions = {}): Promise<Response> {
92
+ const path = checkPathname(pathname)
93
+ const backend = await driver()
94
+ const request = event.request
95
+ for (let attempt = 1; ; attempt++) {
96
+ const object = await backend.head(path)
97
+ if (!object) throw createError({ status: 404, message: "Blob not found" })
98
+ const headers = new Headers({
99
+ "content-type": object.contentType,
100
+ etag: object.etag,
101
+ "last-modified": object.uploadedAt.toUTCString(),
102
+ "accept-ranges": "bytes",
103
+ "cache-control": options.cacheControl ?? CACHE_CONTROL,
104
+ "content-security-policy": SANDBOX,
105
+ "x-content-type-options": "nosniff",
106
+ })
107
+ const ifNoneMatch = request.headers.get("if-none-match")
108
+ const ifModifiedSince =
109
+ ifNoneMatch === null ? Date.parse(request.headers.get("if-modified-since") ?? "") : Number.NaN
110
+ if (
111
+ matchesETag(ifNoneMatch, object.etag) ||
112
+ Math.floor(object.uploadedAt.getTime() / 1000) <= Math.floor(ifModifiedSince / 1000)
113
+ ) {
114
+ headers.delete("content-type")
115
+ return new Response(null, { status: 304, headers })
116
+ }
117
+ const range = request.headers.has("if-range") ? undefined : parseRange(request.headers.get("range"), object.size)
118
+ if (range === "unsatisfiable") {
119
+ headers.delete("content-type")
120
+ headers.set("content-range", `bytes */${object.size}`)
121
+ return new Response(null, { status: 416, headers })
122
+ }
123
+ if (range) {
124
+ headers.set("content-range", `bytes ${range.start}-${range.end}/${object.size}`)
125
+ headers.set("content-length", String(range.end - range.start + 1))
126
+ } else {
127
+ headers.set("content-length", String(object.size))
128
+ }
129
+ const status = range ? 206 : 200
130
+ if (request.method === "HEAD") return new Response(null, { status, headers })
131
+ const body = await backend.open(path, object.etag, range)
132
+ if (body === undefined) throw createError({ status: 404, message: "Blob not found" })
133
+ if (body !== "changed") return new Response(body, { status, headers })
134
+ if (attempt === READ_TRIES) throw createError({ status: 503, message: "Blob changed while it was read" })
135
+ }
136
+ }
137
+
138
+ return {
139
+ async put(pathname, body, options: BlobPutOptions = {}) {
140
+ let path = checkPathname(pathname)
141
+ if (options.addRandomSuffix) path = checkPathname(withRandomSuffix(path))
142
+ const value = normalizeBody(body)
143
+ const given = options.contentType || (value instanceof Blob && value.type) || ""
144
+ const type = given ? checkContentType(given) : defaultContentType(path)
145
+ return (await driver()).put(path, value, {
146
+ contentType: type,
147
+ customMetadata: checkMetadata(options.customMetadata),
148
+ })
149
+ },
150
+ async get(pathname) {
151
+ return (await driver()).get(checkPathname(pathname))
152
+ },
153
+ async head(pathname) {
154
+ return (await driver()).head(checkPathname(pathname))
155
+ },
156
+ async list(options: BlobListOptions = {}) {
157
+ const limit = options.limit ?? 1000
158
+ if (!Number.isInteger(limit) || limit < 1 || limit > 1000)
159
+ throw new TypeError(`blob list limit must be an integer from 1 to 1000 (got ${limit})`)
160
+ return (await driver()).list({
161
+ prefix: checkPrefix(options.prefix),
162
+ limit,
163
+ folded: options.folded === true,
164
+ ...(options.cursor ? { cursor: options.cursor } : {}),
165
+ })
166
+ },
167
+ async delete(pathnames) {
168
+ const paths = (Array.isArray(pathnames) ? pathnames : [pathnames]).map(checkPathname)
169
+ if (paths.length) await (await driver()).delete(paths)
170
+ },
171
+ serve,
172
+ async presign(pathname, options) {
173
+ const path = checkPathname(pathname)
174
+ const { method, expiresIn = 3600, contentType } = options
175
+ if (method !== "GET" && method !== "PUT")
176
+ throw new TypeError(`presign method must be "GET" or "PUT" (got ${JSON.stringify(method)})`)
177
+ if (method === "GET") {
178
+ if (contentType !== undefined)
179
+ throw new TypeError("presign contentType is signed on a PUT only: a GET sends no body")
180
+ return (await driver()).presign(path, { method, expiresIn })
181
+ }
182
+ if (contentType !== undefined && checkContentType(contentType) !== contentType) {
183
+ throw new TypeError(
184
+ `Invalid presign content type ${JSON.stringify(contentType)}: pass ${JSON.stringify(checkContentType(contentType))}, the form that is signed`,
185
+ )
186
+ }
187
+ return (await driver()).presign(path, { method, expiresIn, contentType: contentType ?? defaultContentType(path) })
188
+ },
189
+ }
190
+ }
@@ -0,0 +1,26 @@
1
+ /// <reference path="../env.d.ts" />
2
+ import { bodyLimit, config, drivers, preset, prerender } from "#hamur/blob/config"
3
+ import { readSecret } from "hamur/server/internal"
4
+ import { chooseDriver } from "../runtime/choose.ts"
5
+ import { createMultipartUpload } from "../runtime/multipart.ts"
6
+ import { createBlobStore } from "../runtime/store.ts"
7
+ import type { BlobDriver, BlobStore, ReadSecret } from "../types.ts"
8
+
9
+ const secret: ReadSecret = (option, value) => (value === undefined ? undefined : readSecret(value, `blob.${option}`))
10
+
11
+ let opened: Promise<BlobDriver> | undefined
12
+
13
+ function openDriver(): Promise<BlobDriver> {
14
+ return (opened ??= (async () => {
15
+ const chosen = chooseDriver(import.meta.prerender === true, config, prerender)
16
+ const { default: open } = await drivers[chosen.driver]!()
17
+ return open(chosen, secret)
18
+ })().catch((error: unknown) => {
19
+ opened = undefined
20
+ throw error
21
+ }))
22
+ }
23
+
24
+ export const store: BlobStore = createBlobStore(openDriver)
25
+
26
+ export const multipartUpload = createMultipartUpload(openDriver, { preset, bodyLimit })
@@ -0,0 +1,52 @@
1
+ import { createError } from "hamur/server"
2
+ import { parseContentType } from "../runtime/mime.ts"
3
+ import type { BlobObject } from "../types.ts"
4
+
5
+ export type BlobSize = number | `${number}${"B" | "KB" | "MB" | "GB"}`
6
+
7
+ const UNITS = { B: 1, KB: 1024, MB: 1024 ** 2, GB: 1024 ** 3 } as const
8
+
9
+ export function parseSize(size: BlobSize): { bytes: number; unit: keyof typeof UNITS; shown: string } {
10
+ if (typeof size === "number" && Number.isFinite(size) && size >= 0)
11
+ return { bytes: size, unit: "B", shown: `${size}B` }
12
+ const match = typeof size === "string" ? /^(\d+(?:\.\d+)?)(B|KB|MB|GB)$/.exec(size) : null
13
+ if (!match)
14
+ throw new TypeError(
15
+ `ensureBlob maxSize must be a number of bytes or a size such as "8MB" (got ${JSON.stringify(size)})`,
16
+ )
17
+ const unit = match[2] as keyof typeof UNITS
18
+ return { bytes: Number(match[1]) * UNITS[unit], unit, shown: size as string }
19
+ }
20
+
21
+ const shownSize = (bytes: number, unit: keyof typeof UNITS) =>
22
+ unit === "B" ? `${bytes}B` : `${(bytes / UNITS[unit]).toFixed(1)}${unit}`
23
+
24
+ /**
25
+ * Throws a 400 when `blob` (a `Blob`, or the `BlobObject` of `head`) is over `maxSize` or its type is not in
26
+ * `types` (a MIME type or a top-level type such as `image`). The type is the one the client sent; `serve` sandboxes active types whatever this check said.
27
+ */
28
+ export function ensureBlob(blob: Blob | BlobObject, options: { maxSize?: BlobSize; types?: string[] }): void {
29
+ if (options?.maxSize === undefined && options?.types === undefined)
30
+ throw new TypeError("ensureBlob needs maxSize or types")
31
+ if (options.maxSize !== undefined) {
32
+ const max = parseSize(options.maxSize)
33
+ if (blob.size > max.bytes)
34
+ throw createError({ status: 400, message: `File size ${shownSize(blob.size, max.unit)} is over ${max.shown}` })
35
+ }
36
+ if (options.types !== undefined) {
37
+ const given = "contentType" in blob ? blob.contentType : blob.type
38
+ const parsed = given ? parseContentType(given) : "application/octet-stream"
39
+ const type = parsed?.split(";")[0]
40
+ const allowed =
41
+ type !== undefined &&
42
+ options.types.some((entry) => {
43
+ const wanted = entry.toLowerCase()
44
+ return wanted.includes("/") ? type === wanted : type.split("/")[0] === wanted
45
+ })
46
+ if (!allowed)
47
+ throw createError({
48
+ status: 400,
49
+ message: `File type ${type ?? given} is not allowed (allowed: ${options.types.join(", ")})`,
50
+ })
51
+ }
52
+ }
@@ -0,0 +1,20 @@
1
+ import type { HamurEvent } from "hamur/server"
2
+ import type { MultipartUploadOptions } from "../runtime/multipart.ts"
3
+ import type { BlobStore } from "../types.ts"
4
+ import { multipartUpload, store } from "./blob.ts"
5
+
6
+ export { ensureBlob } from "./ensure.ts"
7
+ export type { MultipartUploadOptions } from "../runtime/multipart.ts"
8
+
9
+ /** The app's blob store, on the driver the build chose (`blob.dev` under `hamur dev` and the prerender). */
10
+ export function useBlob(): BlobStore {
11
+ return store
12
+ }
13
+
14
+ /**
15
+ * One step of a multipart upload (`create`, `upload`, `complete`, `abort`) in a raw handler on
16
+ * `/<path>/:action`; with `direct: true` on the `s3` driver each part goes from the browser to storage on a presigned URL.
17
+ */
18
+ export function handleMultipartUpload(event: HamurEvent, options: MultipartUploadOptions): Promise<Response> {
19
+ return multipartUpload(event, options)
20
+ }
package/src/types.ts ADDED
@@ -0,0 +1,155 @@
1
+ // The augmentation alone does not load "hamur" under TS 7.
2
+ import type {} from "hamur"
3
+ import type { HamurEvent, Secret } from "hamur/server"
4
+
5
+ export type { Secret }
6
+
7
+ export type BlobDriverConfig =
8
+ | { driver: "fs"; base?: string }
9
+ | {
10
+ driver: "s3"
11
+ bucket?: Secret
12
+ region?: Secret
13
+ endpoint?: Secret
14
+ accessKeyId?: Secret
15
+ secretAccessKey?: Secret
16
+ sessionToken?: Secret
17
+ virtualHostedStyle?: boolean
18
+ base?: string
19
+ }
20
+ | { driver: "cloudflare-r2"; binding?: string; base?: string }
21
+
22
+ export type BlobConfig = BlobDriverConfig & { dev?: BlobConfig }
23
+
24
+ /** One driver config as the build resolved it: defaults filled, no `dev`. */
25
+ export type ResolvedBlobDriver =
26
+ | { driver: "fs"; base: string }
27
+ | ({ driver: "s3"; base: string } & Partial<
28
+ Record<"bucket" | "region" | "endpoint" | "accessKeyId" | "secretAccessKey" | "sessionToken", Secret>
29
+ > & { virtualHostedStyle?: boolean })
30
+ | { driver: "cloudflare-r2"; binding: string; base: string }
31
+
32
+ export interface BlobPutOptions {
33
+ contentType?: string
34
+ addRandomSuffix?: boolean
35
+ customMetadata?: Record<string, string>
36
+ }
37
+
38
+ export interface BlobObject {
39
+ pathname: string
40
+ contentType: string
41
+ size: number
42
+ /** Quoted, the HTTP form. */
43
+ etag: string
44
+ uploadedAt: Date
45
+ customMetadata: Record<string, string>
46
+ }
47
+
48
+ /** One entry of a listing: what every backend's listing gives without reading each object (`head` gives the rest). */
49
+ export interface BlobListItem {
50
+ pathname: string
51
+ size: number
52
+ etag: string
53
+ uploadedAt: Date
54
+ }
55
+
56
+ export interface BlobList {
57
+ blobs: BlobListItem[]
58
+ cursor?: string
59
+ hasMore: boolean
60
+ folders?: string[]
61
+ }
62
+
63
+ export interface BlobListOptions {
64
+ prefix?: string
65
+ limit?: number
66
+ cursor?: string
67
+ folded?: boolean
68
+ }
69
+
70
+ export type BlobBody = string | ArrayBuffer | Uint8Array | Blob | ReadableStream<Uint8Array>
71
+
72
+ export interface BlobStore {
73
+ put(pathname: string, body: BlobBody, options?: BlobPutOptions): Promise<BlobObject>
74
+ get(pathname: string): Promise<Blob | undefined>
75
+ head(pathname: string): Promise<BlobObject | undefined>
76
+ list(options?: BlobListOptions): Promise<BlobList>
77
+ delete(pathnames: string | string[]): Promise<void>
78
+ serve(event: HamurEvent, pathname: string, options?: BlobServeOptions): Promise<Response>
79
+ presign(
80
+ pathname: string,
81
+ options: { method: "GET" | "PUT"; expiresIn?: number; contentType?: string },
82
+ ): Promise<string>
83
+ }
84
+
85
+ export interface BlobServeOptions {
86
+ /** Default `private, no-cache`: a shared cache keeps nothing and a browser revalidates with the ETag. */
87
+ cacheControl?: string
88
+ }
89
+
90
+ /** What a driver stores: the store has checked the pathname, filled `contentType` and checked `customMetadata`. */
91
+ export interface BlobWrite {
92
+ contentType: string
93
+ customMetadata: Record<string, string>
94
+ }
95
+
96
+ /** The backend of a `BlobStore`; keys are checked pathnames, the driver adds its `base`. */
97
+ export interface BlobDriver {
98
+ readonly name: ResolvedBlobDriver["driver"]
99
+ put(pathname: string, body: Uint8Array | Blob | ReadableStream<Uint8Array>, write: BlobWrite): Promise<BlobObject>
100
+ get(pathname: string): Promise<Blob | undefined>
101
+ head(pathname: string): Promise<BlobObject | undefined>
102
+ /** `limit` is 1 – 1000 and `prefix` a checked prefix. */
103
+ list(options: { prefix: string; limit: number; cursor?: string; folded: boolean }): Promise<BlobList>
104
+ delete(pathnames: string[]): Promise<void>
105
+ /**
106
+ * The bytes of the version whose ETag is `etag`, or the inclusive range of them, as a stream; `"changed"` when the
107
+ * pathname now holds another version, undefined when it holds none.
108
+ */
109
+ open(
110
+ pathname: string,
111
+ etag: string,
112
+ range?: { start: number; end: number },
113
+ ): Promise<ReadableStream<Uint8Array> | "changed" | undefined>
114
+ /** A URL signed for one request on the backend itself; a driver that cannot sign one throws. */
115
+ presign(pathname: string, request: BlobPresignRequest): Promise<string>
116
+ /** The steps of a multipart upload whose parts the caller sends one by one. */
117
+ multipart: BlobMultipartDriver
118
+ }
119
+
120
+ /** One stored part of a multipart upload, as `complete` lists it. */
121
+ export interface BlobUploadedPart {
122
+ partNumber: number
123
+ etag: string
124
+ }
125
+
126
+ /**
127
+ * The backend's native multipart upload; `uploadId` is the backend's. A step on an upload that does not exist, or that
128
+ * belongs to another pathname, throws a 404 `Upload not found`; `abort` of one does nothing.
129
+ */
130
+ export interface BlobMultipartDriver {
131
+ create(pathname: string, write: BlobWrite): Promise<string>
132
+ /** Stores part `partNumber` (1 – 10000) and returns its ETag. */
133
+ uploadPart(pathname: string, uploadId: string, partNumber: number, body: Uint8Array): Promise<string>
134
+ /** Joins the listed parts, in `partNumber` order, into the object at `pathname`. */
135
+ complete(pathname: string, uploadId: string, parts: BlobUploadedPart[]): Promise<BlobObject>
136
+ abort(pathname: string, uploadId: string): Promise<void>
137
+ }
138
+
139
+ /** What `presignS3` signs besides the key; `contentLength` and `query` sign an `UploadPart` URL. */
140
+ export interface BlobPresignRequest {
141
+ method: "GET" | "PUT"
142
+ expiresIn: number
143
+ contentType?: string
144
+ contentLength?: number
145
+ query?: Record<string, string>
146
+ }
147
+
148
+ /** Resolves an `env("NAME")` option to its value at run time; `option` names it in the error. */
149
+ export type ReadSecret = (option: string, value: Secret | undefined) => string | undefined
150
+
151
+ declare module "hamur" {
152
+ interface HamurModuleOptions {
153
+ blob?: BlobConfig
154
+ }
155
+ }