@toa.io/extensions.storages 1.0.0-alpha.272 → 1.0.0-alpha.273
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/CHANGELOG.md +11 -0
- package/package.json +10 -14
- package/readme.md +18 -12
- package/schemas/annotation.cos.yaml +2 -2
- package/schemas/cloudinary.cos.yaml +4 -3
- package/schemas/fs.cos.yaml +3 -1
- package/schemas/s3.cos.yaml +3 -3
- package/schemas/spaces.cos.yaml +16 -0
- package/schemas/test.cos.yaml +3 -1
- package/schemas/tmp.cos.yaml +3 -1
- package/source/Factory.ts +1 -2
- package/source/Scanner.ts +11 -4
- package/source/deployment.ts +1 -2
- package/source/errors.ts +3 -3
- package/source/providers/Declaration.ts +2 -0
- package/source/providers/S3.ts +1 -4
- package/source/providers/Spaces.ts +24 -0
- package/source/providers/index.ts +4 -1
- package/source/providers/readme.md +13 -11
- package/source/schemas.test.ts +6 -4
- package/source/schemas.ts +1 -1
- package/source/test/.env.example +4 -0
- package/source/test/util.ts +14 -1
- package/transpiled/Factory.js +1 -2
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Scanner.js +9 -4
- package/transpiled/Scanner.js.map +1 -1
- package/transpiled/deployment.js +1 -2
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/errors.d.ts +7 -2
- package/transpiled/errors.js +3 -2
- package/transpiled/errors.js.map +1 -1
- package/transpiled/providers/Declaration.d.ts +3 -0
- package/transpiled/providers/S3.d.ts +0 -1
- package/transpiled/providers/S3.js +1 -3
- package/transpiled/providers/S3.js.map +1 -1
- package/transpiled/providers/Spaces.d.ts +12 -0
- package/transpiled/providers/Spaces.js +19 -0
- package/transpiled/providers/Spaces.js.map +1 -0
- package/transpiled/providers/index.d.ts +4 -1
- package/transpiled/providers/index.js +2 -0
- package/transpiled/providers/index.js.map +1 -1
- package/transpiled/schemas.d.ts +1 -1
- package/transpiled/schemas.js +2 -2
- package/transpiled/schemas.js.map +1 -1
- package/transpiled/test/util.d.ts +25 -2
- package/transpiled/test/util.js +12 -0
- package/transpiled/test/util.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/schemas/mem.cos.yaml +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.273](https://github.com/toa-io/toa/compare/v1.0.0-alpha.272...v1.0.0-alpha.273) (2026-09-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **storages:** provider for DigitalOcean Spaces ([44ed14b](https://github.com/toa-io/toa/commit/44ed14b0bd796a35c9a7f9beef54ca4d5f8e8e07))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.0.0-alpha.272](https://github.com/toa-io/toa/compare/v1.0.0-alpha.271...v1.0.0-alpha.272) (2026-09-01)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @toa.io/extensions.storages
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.storages",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.273",
|
|
4
4
|
"description": "Toa Storages",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -24,20 +24,16 @@
|
|
|
24
24
|
"test": "jest",
|
|
25
25
|
"transpile": "npx tsc"
|
|
26
26
|
},
|
|
27
|
-
"
|
|
28
|
-
"dotenv": "
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"dotenv": "17.4.2"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aws-sdk/client-s3": "3.
|
|
32
|
-
"@aws-sdk/lib-storage": "3.
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"error-value": "0.4.1",
|
|
38
|
-
"negotiator": "0.6.3",
|
|
39
|
-
"openspan": "1.0.0-alpha.272",
|
|
40
|
-
"smithy-node-native-fetch": "1.2.1"
|
|
31
|
+
"@aws-sdk/client-s3": "3.1123.0",
|
|
32
|
+
"@aws-sdk/lib-storage": "3.1123.0",
|
|
33
|
+
"@toa.io/schemas": "1.0.0-alpha.273",
|
|
34
|
+
"cloudinary": "2.11.0",
|
|
35
|
+
"negotiator": "1.1.0",
|
|
36
|
+
"openspan": "1.0.0-alpha.272"
|
|
41
37
|
},
|
|
42
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "ad3284850ece95ffd5325fd0995707fc144c9c3d"
|
|
43
39
|
}
|
package/readme.md
CHANGED
|
@@ -131,6 +131,24 @@ and [`toa env`](/runtime/cli/readme.md#env)
|
|
|
131
131
|
for local environment.
|
|
132
132
|
`endpoint` parameter is optional.
|
|
133
133
|
|
|
134
|
+
### DigitalOcean Spaces
|
|
135
|
+
|
|
136
|
+
Annotation format is:
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
storages:
|
|
140
|
+
photos:
|
|
141
|
+
provider: spaces
|
|
142
|
+
space: my-space
|
|
143
|
+
region: fra1
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`region` is the datacenter slug, the endpoint is derived from it.
|
|
147
|
+
|
|
148
|
+
Secrets `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY` are required.
|
|
149
|
+
Keys are created in the DigitalOcean control panel,
|
|
150
|
+
under Spaces Object Storage, on the Access Keys tab.
|
|
151
|
+
|
|
134
152
|
### Cloudinary
|
|
135
153
|
|
|
136
154
|
[Cloudinary](https://cloudinary.com) provider is used to store and transform media files.
|
|
@@ -223,18 +241,6 @@ storages:
|
|
|
223
241
|
directory: my-app-tmp
|
|
224
242
|
```
|
|
225
243
|
|
|
226
|
-
### Memory
|
|
227
|
-
|
|
228
|
-
In-memory non-persistent storage.
|
|
229
|
-
|
|
230
|
-
Annotation value format is:
|
|
231
|
-
|
|
232
|
-
```yaml
|
|
233
|
-
storages:
|
|
234
|
-
photos@dev:
|
|
235
|
-
provider: mem
|
|
236
|
-
```
|
|
237
|
-
|
|
238
244
|
## Deduplication
|
|
239
245
|
|
|
240
246
|
BLOBs are stored in the underlying storage with their checksum as the key, ensuring that identical
|
|
@@ -12,7 +12,7 @@ properties:
|
|
|
12
12
|
type: string
|
|
13
13
|
eager:
|
|
14
14
|
type: array
|
|
15
|
-
items:
|
|
15
|
+
items:
|
|
16
16
|
type: object
|
|
17
17
|
transformations:
|
|
18
18
|
type: array
|
|
@@ -23,9 +23,10 @@ properties:
|
|
|
23
23
|
type: string
|
|
24
24
|
transformation:
|
|
25
25
|
anyOf:
|
|
26
|
-
-
|
|
26
|
+
- type: object
|
|
27
27
|
- type: array
|
|
28
|
-
items:
|
|
28
|
+
items:
|
|
29
|
+
type: object
|
|
29
30
|
optional:
|
|
30
31
|
type: boolean
|
|
31
32
|
required:
|
package/schemas/fs.cos.yaml
CHANGED
package/schemas/s3.cos.yaml
CHANGED
package/schemas/test.cos.yaml
CHANGED
package/schemas/tmp.cos.yaml
CHANGED
package/source/Factory.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert'
|
|
2
2
|
import { console } from 'openspan'
|
|
3
|
-
import { decode } from '@toa.io/generic'
|
|
4
3
|
import { providers } from './providers'
|
|
5
4
|
import { Storage, type Storages } from './Storage'
|
|
6
5
|
import { Aspect } from './Aspect'
|
|
@@ -19,7 +18,7 @@ export class Factory {
|
|
|
19
18
|
|
|
20
19
|
assert.ok(env !== undefined, `${ENV_PREFIX} is not defined`)
|
|
21
20
|
|
|
22
|
-
this.annotation =
|
|
21
|
+
this.annotation = JSON.parse(env)
|
|
23
22
|
|
|
24
23
|
validateAnnotation(this.annotation)
|
|
25
24
|
}
|
package/source/Scanner.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PassThrough, type TransformCallback } from 'node:stream'
|
|
2
2
|
import { createHash } from 'node:crypto'
|
|
3
|
-
import { Err } from 'error-value'
|
|
4
3
|
import Negotiator from 'negotiator'
|
|
5
4
|
|
|
6
5
|
export class Scanner extends PassThrough {
|
|
@@ -147,9 +146,17 @@ const HEADER_SIZE = SIGNATURES
|
|
|
147
146
|
|
|
148
147
|
const KNOWN_TYPES = new Set(SIGNATURES.map(({ type }) => type))
|
|
149
148
|
|
|
150
|
-
const ERR_TYPE_MISMATCH = new
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
const ERR_TYPE_MISMATCH = new (class TypeMismatchError extends Error {
|
|
150
|
+
public readonly code = 'TYPE_MISMATCH'
|
|
151
|
+
})()
|
|
152
|
+
|
|
153
|
+
const ERR_NOT_ACCEPTABLE = new (class NotAcceptableError extends Error {
|
|
154
|
+
public readonly code = 'NOT_ACCEPTABLE'
|
|
155
|
+
})()
|
|
156
|
+
|
|
157
|
+
const ERR_LIMIT_EXCEEDED = new (class LimitExceededError extends Error {
|
|
158
|
+
public readonly code = 'LIMIT_EXCEEDED'
|
|
159
|
+
})()
|
|
153
160
|
|
|
154
161
|
export interface ScanOptions {
|
|
155
162
|
claim?: string
|
package/source/deployment.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as assert from 'node:assert'
|
|
2
|
-
import { encode } from '@toa.io/generic'
|
|
3
2
|
import { providers } from './providers'
|
|
4
3
|
import { validateAnnotation } from './Annotation'
|
|
5
4
|
import type { Annotation } from './Annotation'
|
|
@@ -11,7 +10,7 @@ export const ENV_PREFIX = 'TOA_STORAGES'
|
|
|
11
10
|
export function deployment (instances: Instance[], annotation: unknown): Dependency {
|
|
12
11
|
validate(instances, annotation)
|
|
13
12
|
|
|
14
|
-
const value =
|
|
13
|
+
const value = JSON.stringify(annotation)
|
|
15
14
|
const pointer: Variable = { name: ENV_PREFIX, value }
|
|
16
15
|
const secrets = getSecrets(annotation)
|
|
17
16
|
const mounts = getMounts(instances, annotation)
|
package/source/errors.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export const ERR_NOT_FOUND = new (class NotFoundError extends Error {
|
|
2
|
+
public readonly code = 'NOT_FOUND'
|
|
3
|
+
})()
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { S3Options } from './S3'
|
|
2
|
+
import type { SpacesOptions } from './Spaces'
|
|
2
3
|
import type { CloudinaryOptions } from './Cloudinary'
|
|
3
4
|
import type { FileSystemOptions } from './FileSystem'
|
|
4
5
|
import type { TemporaryOptions } from './Temporary'
|
|
5
6
|
|
|
6
7
|
export type Declaration =
|
|
7
8
|
({ provider: 's3' } & S3Options)
|
|
9
|
+
| ({ provider: 'spaces' } & SpacesOptions)
|
|
8
10
|
| ({ provider: 'cloudinary' } & CloudinaryOptions)
|
|
9
11
|
| ({ provider: 'fs' } & FileSystemOptions)
|
|
10
12
|
| ({ provider: 'tmp' } & TemporaryOptions)
|
package/source/providers/S3.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { join } from 'node:path/posix'
|
|
|
4
4
|
import assert from 'node:assert'
|
|
5
5
|
import { Upload } from '@aws-sdk/lib-storage'
|
|
6
6
|
import * as s3 from '@aws-sdk/client-s3'
|
|
7
|
-
import * as nodeNativeFetch from 'smithy-node-native-fetch'
|
|
8
7
|
import { console } from 'openspan'
|
|
9
8
|
import { Provider } from '../Provider'
|
|
10
9
|
import { ERR_NOT_FOUND } from '../errors'
|
|
@@ -16,7 +15,6 @@ import type { Secret, Secrets } from '../Secrets'
|
|
|
16
15
|
export interface S3Options {
|
|
17
16
|
bucket: string
|
|
18
17
|
region?: string
|
|
19
|
-
prefix?: string
|
|
20
18
|
endpoint?: string
|
|
21
19
|
}
|
|
22
20
|
|
|
@@ -37,8 +35,7 @@ export class S3 extends Provider<S3Options> {
|
|
|
37
35
|
this.bucket = options.bucket
|
|
38
36
|
|
|
39
37
|
const s3Config: s3.S3ClientConfigType = {
|
|
40
|
-
retryMode: 'adaptive'
|
|
41
|
-
...nodeNativeFetch
|
|
38
|
+
retryMode: 'adaptive'
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
if (options.endpoint !== undefined) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { S3 } from './S3'
|
|
2
|
+
import type { Secret, Secrets } from '../Secrets'
|
|
3
|
+
|
|
4
|
+
export interface SpacesOptions {
|
|
5
|
+
space: string
|
|
6
|
+
region: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type SpacesSecrets = Secrets<'ACCESS_KEY_ID' | 'SECRET_ACCESS_KEY'>
|
|
10
|
+
|
|
11
|
+
export class Spaces extends S3 {
|
|
12
|
+
public static override readonly SECRETS: readonly Secret[] = [
|
|
13
|
+
{ name: 'ACCESS_KEY_ID' },
|
|
14
|
+
{ name: 'SECRET_ACCESS_KEY' }
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
public constructor (options: SpacesOptions, secrets?: SpacesSecrets) {
|
|
18
|
+
super({
|
|
19
|
+
bucket: options.space,
|
|
20
|
+
region: options.region,
|
|
21
|
+
endpoint: `https://${options.region}.digitaloceanspaces.com`
|
|
22
|
+
}, secrets)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileSystem } from './FileSystem'
|
|
2
2
|
import { S3 } from './S3'
|
|
3
|
+
import { Spaces } from './Spaces'
|
|
3
4
|
import { Cloudinary } from './Cloudinary'
|
|
4
5
|
import { Temporary } from './Temporary'
|
|
5
6
|
import { Test } from './Test'
|
|
@@ -7,6 +8,7 @@ import type { Constructor } from '../Provider'
|
|
|
7
8
|
|
|
8
9
|
export const providers = {
|
|
9
10
|
s3: S3,
|
|
11
|
+
spaces: Spaces,
|
|
10
12
|
cloudinary: Cloudinary,
|
|
11
13
|
fs: FileSystem,
|
|
12
14
|
tmp: Temporary,
|
|
@@ -16,7 +18,8 @@ export const providers = {
|
|
|
16
18
|
export type { Declaration } from './Declaration'
|
|
17
19
|
|
|
18
20
|
export type { S3Options } from './S3'
|
|
21
|
+
export type { SpacesOptions } from './Spaces'
|
|
19
22
|
export type { CloudinaryOptions } from './Cloudinary'
|
|
20
23
|
export type { FileSystemOptions } from './FileSystem'
|
|
21
24
|
export type { TemporaryOptions } from './Temporary'
|
|
22
|
-
export type { FileSystem, S3, Cloudinary, Temporary }
|
|
25
|
+
export type { FileSystem, S3, Spaces, Cloudinary, Temporary }
|
|
@@ -2,24 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
1. Add an implementation of the [Provider](../Provider.ts) interface under this directory.
|
|
4
4
|
2. Add an entry to the provider map in [`index.ts`](./index.ts).
|
|
5
|
-
3. Add a
|
|
6
|
-
4.
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
3. Add a variant to [`Declaration.ts`](./Declaration.ts).
|
|
6
|
+
4. Add a schema to [`schemas`](../../schemas), reference it from `annotation.cos.yaml`, and export it
|
|
7
|
+
from [`schemas.ts`](../schemas.ts).
|
|
8
|
+
5. Add a suite to `suites` in [`util.ts`](../test/util.ts).
|
|
9
|
+
6. Run `$ npm test` in the [`storages` directory](../..).
|
|
9
10
|
|
|
10
11
|
Provider's constructor must have the following signature:
|
|
11
|
-
`constructor(
|
|
12
|
+
`constructor(options: Options, secrets?: Secrets)`
|
|
12
13
|
|
|
13
14
|
## Secrets
|
|
14
15
|
|
|
15
|
-
Provider class may have static `SECRETS` property of type `
|
|
16
|
-
requires.
|
|
16
|
+
Provider class may have a static `SECRETS` property of type `readonly Secret[]` that lists the
|
|
17
|
+
secrets it requires. An entry with `optional: true` may be absent.
|
|
17
18
|
The secrets are passed to the constructor as the second argument.
|
|
18
19
|
|
|
19
|
-
`constructor(url: URL, secrets: Record<string, string>)`
|
|
20
|
-
|
|
21
20
|
See [`Test` provider](./Test.ts) for an example.
|
|
22
21
|
|
|
23
|
-
## Testing
|
|
22
|
+
## Testing against a live service
|
|
23
|
+
|
|
24
|
+
The `s3`, `spaces` and `cloudinary` suites are skipped unless their `RUN_*` variable is set.
|
|
25
|
+
Copy [`.env.example`](../test/.env.example) to `.env` and fill it in.
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
`s3` runs against localstack: `docker compose up localstack` in the [root](../../../../).
|
package/source/schemas.test.ts
CHANGED
|
@@ -13,8 +13,10 @@ const ok = {
|
|
|
13
13
|
provider: 's3',
|
|
14
14
|
bucket: 'my-bucket'
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
provider: '
|
|
16
|
+
e: {
|
|
17
|
+
provider: 'spaces',
|
|
18
|
+
space: 'my-space',
|
|
19
|
+
region: 'nyc3'
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -43,8 +45,8 @@ const oh = [
|
|
|
43
45
|
},
|
|
44
46
|
{
|
|
45
47
|
whatever: {
|
|
46
|
-
provider: '
|
|
47
|
-
|
|
48
|
+
provider: 'spaces',
|
|
49
|
+
space: 'my-space'
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
]
|
package/source/schemas.ts
CHANGED
|
@@ -9,8 +9,8 @@ const ns = namespace(path)
|
|
|
9
9
|
|
|
10
10
|
export const annotation: Schema<Annotation> = ns.schema<Annotation>('annotation')
|
|
11
11
|
export const s3: Schema<Declaration> = ns.schema<Declaration>('s3')
|
|
12
|
+
export const spaces: Schema<Declaration> = ns.schema<Declaration>('spaces')
|
|
12
13
|
export const cloudinary: Schema<Declaration> = ns.schema<Declaration>('cloudinary')
|
|
13
14
|
export const fs: Schema<Declaration> = ns.schema<Declaration>('fs')
|
|
14
|
-
export const mem: Schema<Declaration> = ns.schema<Declaration>('mem')
|
|
15
15
|
export const tmp: Schema<Declaration> = ns.schema<Declaration>('tmp')
|
|
16
16
|
export const test: Schema<Declaration> = ns.schema<Declaration>('test')
|
package/source/test/.env.example
CHANGED
package/source/test/util.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Secrets } from '../Secrets'
|
|
|
4
4
|
import type {
|
|
5
5
|
providers,
|
|
6
6
|
S3Options,
|
|
7
|
+
SpacesOptions,
|
|
7
8
|
CloudinaryOptions,
|
|
8
9
|
FileSystemOptions,
|
|
9
10
|
TemporaryOptions
|
|
@@ -32,6 +33,18 @@ export const suites = [
|
|
|
32
33
|
SECRET_ACCESS_KEY: 'secret'
|
|
33
34
|
}
|
|
34
35
|
},
|
|
36
|
+
{
|
|
37
|
+
run: process.env.RUN_SPACES === '1',
|
|
38
|
+
provider: 'spaces',
|
|
39
|
+
options: {
|
|
40
|
+
space: 'ants',
|
|
41
|
+
region: 'fra1'
|
|
42
|
+
},
|
|
43
|
+
secrets: {
|
|
44
|
+
ACCESS_KEY_ID: process.env.SPACES_KEY_ID ?? '',
|
|
45
|
+
SECRET_ACCESS_KEY: process.env.SPACES_ACCESS_KEY ?? ''
|
|
46
|
+
}
|
|
47
|
+
},
|
|
35
48
|
{
|
|
36
49
|
run: process.env.RUN_CLOUDINARY === '1',
|
|
37
50
|
provider: 'cloudinary',
|
|
@@ -90,6 +103,6 @@ export const suites = [
|
|
|
90
103
|
export interface Suite {
|
|
91
104
|
run: boolean
|
|
92
105
|
provider: keyof typeof providers
|
|
93
|
-
options?: S3Options | CloudinaryOptions | FileSystemOptions | TemporaryOptions
|
|
106
|
+
options?: S3Options | SpacesOptions | CloudinaryOptions | FileSystemOptions | TemporaryOptions
|
|
94
107
|
secrets?: Secrets
|
|
95
108
|
}
|
package/transpiled/Factory.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Factory = void 0;
|
|
7
7
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
8
|
const openspan_1 = require("openspan");
|
|
9
|
-
const generic_1 = require("@toa.io/generic");
|
|
10
9
|
const providers_1 = require("./providers");
|
|
11
10
|
const Storage_1 = require("./Storage");
|
|
12
11
|
const Aspect_1 = require("./Aspect");
|
|
@@ -17,7 +16,7 @@ class Factory {
|
|
|
17
16
|
constructor() {
|
|
18
17
|
const env = process.env[deployment_1.ENV_PREFIX];
|
|
19
18
|
node_assert_1.default.ok(env !== undefined, `${deployment_1.ENV_PREFIX} is not defined`);
|
|
20
|
-
this.annotation =
|
|
19
|
+
this.annotation = JSON.parse(env);
|
|
21
20
|
(0, Annotation_1.validateAnnotation)(this.annotation);
|
|
22
21
|
}
|
|
23
22
|
aspect() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAChC,uCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAChC,uCAAkC;AAClC,2CAAuC;AACvC,uCAAkD;AAClD,qCAAiC;AACjC,6CAAyC;AACzC,6CAAiD;AAMjD,MAAa,OAAO;IACD,UAAU,CAAY;IAEvC;QACE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAU,CAAC,CAAA;QAEnC,qBAAM,CAAC,EAAE,CAAC,GAAG,KAAK,SAAS,EAAE,GAAG,uBAAU,iBAAiB,CAAC,CAAA;QAE5D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEjC,IAAA,+BAAkB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACrC,CAAC;IAEM,MAAM;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAEtC,OAAO,IAAI,eAAM,CAAC,QAAQ,CAAC,CAAA;IAC7B,CAAC;IAEO,cAAc;QACpB,MAAM,QAAQ,GAAa,EAAE,CAAA;QAE7B,KAAK,MAAM,CAAC,IAAI,EAAE,WAAW,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AAC,QAAQ,CAAC,CAAA;YAEnC,qBAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EACvD,IAAI,QAAQ,kBAAkB,CAAC,CAAA;YAEjC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;QAC9B,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA7DD,0BA6DC"}
|
package/transpiled/Scanner.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Scanner = void 0;
|
|
7
7
|
const node_stream_1 = require("node:stream");
|
|
8
8
|
const node_crypto_1 = require("node:crypto");
|
|
9
|
-
const error_value_1 = require("error-value");
|
|
10
9
|
const negotiator_1 = __importDefault(require("negotiator"));
|
|
11
10
|
class Scanner extends node_stream_1.PassThrough {
|
|
12
11
|
size = 0;
|
|
@@ -119,7 +118,13 @@ const SIGNATURES = [
|
|
|
119
118
|
const HEADER_SIZE = SIGNATURES
|
|
120
119
|
.reduce((max, { off, hex }) => Math.max(max, off + hex.length), 0) / 2;
|
|
121
120
|
const KNOWN_TYPES = new Set(SIGNATURES.map(({ type }) => type));
|
|
122
|
-
const ERR_TYPE_MISMATCH = new
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
const ERR_TYPE_MISMATCH = new (class TypeMismatchError extends Error {
|
|
122
|
+
code = 'TYPE_MISMATCH';
|
|
123
|
+
})();
|
|
124
|
+
const ERR_NOT_ACCEPTABLE = new (class NotAcceptableError extends Error {
|
|
125
|
+
code = 'NOT_ACCEPTABLE';
|
|
126
|
+
})();
|
|
127
|
+
const ERR_LIMIT_EXCEEDED = new (class LimitExceededError extends Error {
|
|
128
|
+
code = 'LIMIT_EXCEEDED';
|
|
129
|
+
})();
|
|
125
130
|
//# sourceMappingURL=Scanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scanner.js","sourceRoot":"","sources":["../source/Scanner.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAiE;AACjE,6CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"Scanner.js","sourceRoot":"","sources":["../source/Scanner.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAiE;AACjE,6CAAwC;AACxC,4DAAmC;AAEnC,MAAa,OAAQ,SAAQ,yBAAW;IAC/B,IAAI,GAAG,CAAC,CAAA;IACR,IAAI,GAAG,0BAA0B,CAAA;IACjC,KAAK,CAAQ;IAEH,IAAI,GAAG,IAAA,wBAAU,EAAC,KAAK,CAAC,CAAA;IACxB,KAAK,CAAS;IACd,MAAM,CAAS;IACf,KAAK,CAAS;IACvB,QAAQ,GAAG,CAAC,CAAA;IACZ,SAAS,GAAG,KAAK,CAAA;IACR,MAAM,GAAa,EAAE,CAAA;IAEtC,YAAoB,OAAqB;QACvC,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,CAAA;QAC7B,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,CAAA;IAC7B,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC;IAEe,UAAU,CAAE,MAAc,EAAE,QAAwB,EAAE,QAA2B;QAC/F,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAE5C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACtB,CAAC;IAEgB,OAAO,GAAG,CAAC,MAAc,EAAQ,EAAE;QAClD,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,CAAA;QAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAExB,IAAI,IAAI,CAAC,SAAS;YAChB,OAAM;QAER,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C,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,yBAAyB,EACnE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,SAAS,CAAC,MAAM,GAAG,CAAC,CAAA;QAEpD,SAAS,CAAC,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;IACpD,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,UAAU;KAC3B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;AAExE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;AAE/D,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,iBAAkB,SAAQ,KAAK;IAClD,IAAI,GAAG,eAAe,CAAA;CACvC,CAAC,EAAE,CAAA;AAEJ,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,kBAAmB,SAAQ,KAAK;IACpD,IAAI,GAAG,gBAAgB,CAAA;CACxC,CAAC,EAAE,CAAA;AAEJ,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,kBAAmB,SAAQ,KAAK;IACpD,IAAI,GAAG,gBAAgB,CAAA;CACxC,CAAC,EAAE,CAAA"}
|
package/transpiled/deployment.js
CHANGED
|
@@ -25,13 +25,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.deployment = exports.ENV_PREFIX = void 0;
|
|
27
27
|
const assert = __importStar(require("node:assert"));
|
|
28
|
-
const generic_1 = require("@toa.io/generic");
|
|
29
28
|
const providers_1 = require("./providers");
|
|
30
29
|
const Annotation_1 = require("./Annotation");
|
|
31
30
|
exports.ENV_PREFIX = 'TOA_STORAGES';
|
|
32
31
|
function deployment(instances, annotation) {
|
|
33
32
|
validate(instances, annotation);
|
|
34
|
-
const value =
|
|
33
|
+
const value = JSON.stringify(annotation);
|
|
35
34
|
const pointer = { name: exports.ENV_PREFIX, value };
|
|
36
35
|
const secrets = getSecrets(annotation);
|
|
37
36
|
const mounts = getMounts(instances, annotation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../source/deployment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../source/deployment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AACrC,2CAAuC;AACvC,6CAAiD;AAKpC,QAAA,UAAU,GAAG,cAAc,CAAA;AAExC,SAAgB,UAAU,CAAE,SAAqB,EAAE,UAAmB;IACpE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IAE/B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;IACxC,MAAM,OAAO,GAAa,EAAE,IAAI,EAAE,kBAAU,EAAE,KAAK,EAAE,CAAA;IACrD,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IAE/C,MAAM,UAAU,GAAe,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,CAAA;IAE/E,IAAI,MAAM,KAAK,IAAI;QACjB,UAAU,CAAC,MAA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AC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAS,SAAS,CAAE,SAAqB,EAAE,UAAsB;IAC/D,IAAI,MAAM,GAAkB,IAAI,CAAA;IAEhC,KAAK,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,SAAS;QAC3C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;YAEpC,qCAAqC;YACrC,IAAI,WAAW,CAAC,QAAQ,KAAK,IAAI;gBAC/B,SAAQ;YAEV,qCAAqC;YACrC,IAAI,WAAW,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBACpC,MAAM,KAAK,EAAE,CAAA;gBACb,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;gBAE5B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;oBACzB,IAAI;oBACJ,IAAI,EAAE,WAAW,CAAC,IAAI;oBACtB,KAAK,EAAE,WAAW,CAAC,KAAK;iBACzB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IAEH,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/transpiled/errors.d.ts
CHANGED
package/transpiled/errors.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ERR_NOT_FOUND = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
exports.ERR_NOT_FOUND = new (class NotFoundError extends Error {
|
|
5
|
+
code = 'NOT_FOUND';
|
|
6
|
+
})();
|
|
6
7
|
//# sourceMappingURL=errors.js.map
|
package/transpiled/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../source/errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../source/errors.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,IAAI,CAAC,MAAM,aAAc,SAAQ,KAAK;IACjD,IAAI,GAAG,WAAW,CAAA;CACnC,CAAC,EAAE,CAAA"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { S3Options } from './S3';
|
|
2
|
+
import type { SpacesOptions } from './Spaces';
|
|
2
3
|
import type { CloudinaryOptions } from './Cloudinary';
|
|
3
4
|
import type { FileSystemOptions } from './FileSystem';
|
|
4
5
|
import type { TemporaryOptions } from './Temporary';
|
|
5
6
|
export type Declaration = ({
|
|
6
7
|
provider: 's3';
|
|
7
8
|
} & S3Options) | ({
|
|
9
|
+
provider: 'spaces';
|
|
10
|
+
} & SpacesOptions) | ({
|
|
8
11
|
provider: 'cloudinary';
|
|
9
12
|
} & CloudinaryOptions) | ({
|
|
10
13
|
provider: 'fs';
|