@twin.org/blob-storage-service 0.0.1-next.8 → 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 (28) hide show
  1. package/dist/cjs/index.cjs +643 -114
  2. package/dist/esm/index.mjs +645 -117
  3. package/dist/types/blobStorageRoutes.d.ts +17 -3
  4. package/dist/types/blobStorageService.d.ts +55 -31
  5. package/dist/types/entities/blobStorageEntry.d.ts +55 -0
  6. package/dist/types/index.d.ts +2 -1
  7. package/dist/types/models/IBlobStorageServiceConfig.d.ts +9 -2
  8. package/dist/types/models/IBlobStorageServiceConstructorOptions.d.ts +19 -0
  9. package/dist/types/restEntryPoints.d.ts +5 -0
  10. package/docs/changelog.md +161 -1
  11. package/docs/open-api/spec.json +1230 -1853
  12. package/docs/reference/classes/BlobStorageEntry.md +109 -0
  13. package/docs/reference/classes/BlobStorageService.md +188 -49
  14. package/docs/reference/functions/blobStorageCreate.md +9 -3
  15. package/docs/reference/functions/blobStorageGet.md +9 -3
  16. package/docs/reference/functions/blobStorageGetContent.md +9 -3
  17. package/docs/reference/functions/blobStorageList.md +31 -0
  18. package/docs/reference/functions/blobStorageRemove.md +9 -3
  19. package/docs/reference/functions/blobStorageUpdate.md +9 -3
  20. package/docs/reference/functions/generateRestRoutesBlobStorage.md +24 -4
  21. package/docs/reference/index.md +3 -1
  22. package/docs/reference/interfaces/IBlobStorageServiceConfig.md +17 -7
  23. package/docs/reference/interfaces/IBlobStorageServiceConstructorOptions.md +33 -0
  24. package/docs/reference/variables/restEntryPoints.md +4 -0
  25. package/locales/en.json +2 -1
  26. package/package.json +15 -13
  27. package/dist/types/entities/blobMetadata.d.ts +0 -22
  28. package/docs/reference/classes/BlobMetadata.md +0 -45
@@ -8,13 +8,7 @@ Configuration for the blob storage service.
8
8
 
9
9
  > `optional` **vaultKeyId**: `string`
10
10
 
11
- The name of the vault key to use for encryption if the service has a vault connector configured.
12
-
13
- #### Default
14
-
15
- ```ts
16
- blob-storage.
17
- ```
11
+ The name of the vault key to use for encryption, if not configured no encryption will happen.
18
12
 
19
13
  ***
20
14
 
@@ -24,3 +18,19 @@ blob-storage.
24
18
 
25
19
  The namespace of the default storage connector to use.
26
20
  Defaults to the first entry in the factory if not provided.
21
+
22
+ ***
23
+
24
+ ### includeNodeIdentity?
25
+
26
+ > `optional` **includeNodeIdentity**: `boolean`
27
+
28
+ Include the node identity when performing storage operations, defaults to true.
29
+
30
+ ***
31
+
32
+ ### includeUserIdentity?
33
+
34
+ > `optional` **includeUserIdentity**: `boolean`
35
+
36
+ Include the user identity when performing storage operations, defaults to true.
@@ -0,0 +1,33 @@
1
+ # Interface: IBlobStorageServiceConstructorOptions
2
+
3
+ Options for the Blob Storage Service constructor.
4
+
5
+ ## Properties
6
+
7
+ ### entryEntityStorageType?
8
+
9
+ > `optional` **entryEntityStorageType**: `string`
10
+
11
+ The type of the storage connector for the metadata.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ blob-storage-entry
17
+ ```
18
+
19
+ ***
20
+
21
+ ### vaultConnectorType?
22
+
23
+ > `optional` **vaultConnectorType**: `string`
24
+
25
+ The type of the vault connector for encryption.
26
+
27
+ ***
28
+
29
+ ### config?
30
+
31
+ > `optional` **config**: [`IBlobStorageServiceConfig`](IBlobStorageServiceConfig.md)
32
+
33
+ The configuration for the service.
@@ -1,3 +1,7 @@
1
1
  # Variable: restEntryPoints
2
2
 
3
3
  > `const` **restEntryPoints**: `IRestRouteEntryPoint`[]
4
+
5
+ These are dummy entry points for the blob storage service.
6
+ In reality your application would create its own entry points based on the
7
+ blob types it wants to store, using a custom defaultBaseRoute.
package/locales/en.json CHANGED
@@ -6,7 +6,8 @@
6
6
  "getFailed": "There was a problem getting the blob",
7
7
  "updateFailed": "There was a problem updating the blob",
8
8
  "removeFailed": "There was a problem removing the blob",
9
- "namespaceMismatch": "The namespace in the urn \"{id}\" does not match the namespace of the blob storage service \"{namespace}\""
9
+ "namespaceMismatch": "The namespace in the urn \"{id}\" does not match the namespace of the blob storage service \"{namespace}\"",
10
+ "vaultConnectorNotConfigured": "The vault connector is not configured, but encryption/decryption was requested."
10
11
  }
11
12
  }
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/blob-storage-service",
3
- "version": "0.0.1-next.8",
3
+ "version": "0.0.1",
4
4
  "description": "Blob storage contract implementation and REST endpoint definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,26 +14,28 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-models": "next",
18
- "@twin.org/blob-storage-models": "0.0.1-next.8",
19
- "@twin.org/core": "next",
20
- "@twin.org/data-json-ld": "next",
21
- "@twin.org/entity": "next",
22
- "@twin.org/entity-storage-models": "next",
23
- "@twin.org/nameof": "next",
24
- "@twin.org/vault-models": "next",
25
- "@twin.org/web": "next"
17
+ "@twin.org/api-models": "^0.0.1",
18
+ "@twin.org/blob-storage-models": "^0.0.1",
19
+ "@twin.org/core": "^0.0.1",
20
+ "@twin.org/crypto": "^0.0.1",
21
+ "@twin.org/data-json-ld": "^0.0.1",
22
+ "@twin.org/entity": "^0.0.1",
23
+ "@twin.org/entity-storage-models": "^0.0.1",
24
+ "@twin.org/nameof": "^0.0.1",
25
+ "@twin.org/standards-schema-org": "^0.0.1",
26
+ "@twin.org/vault-models": "^0.0.1",
27
+ "@twin.org/web": "^0.0.1"
26
28
  },
27
29
  "main": "./dist/cjs/index.cjs",
28
30
  "module": "./dist/esm/index.mjs",
29
31
  "types": "./dist/types/index.d.ts",
30
32
  "exports": {
31
33
  ".": {
34
+ "types": "./dist/types/index.d.ts",
32
35
  "require": "./dist/cjs/index.cjs",
33
- "import": "./dist/esm/index.mjs",
34
- "types": "./dist/types/index.d.ts"
36
+ "import": "./dist/esm/index.mjs"
35
37
  },
36
- "./locales": "./locales"
38
+ "./locales/*.json": "./locales/*.json"
37
39
  },
38
40
  "files": [
39
41
  "dist/cjs",
@@ -1,22 +0,0 @@
1
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
- /**
3
- * Class representing metadata for the blob storage.
4
- */
5
- export declare class BlobMetadata {
6
- /**
7
- * The id for the blob.
8
- */
9
- id: string;
10
- /**
11
- * The mime type for the blob.
12
- */
13
- mimeType?: string;
14
- /**
15
- * The extension.
16
- */
17
- extension?: string;
18
- /**
19
- * The metadata for the blob as JSON-LD.
20
- */
21
- metadata?: IJsonLdNodeObject;
22
- }
@@ -1,45 +0,0 @@
1
- # Class: BlobMetadata
2
-
3
- Class representing metadata for the blob storage.
4
-
5
- ## Constructors
6
-
7
- ### new BlobMetadata()
8
-
9
- > **new BlobMetadata**(): [`BlobMetadata`](BlobMetadata.md)
10
-
11
- #### Returns
12
-
13
- [`BlobMetadata`](BlobMetadata.md)
14
-
15
- ## Properties
16
-
17
- ### id
18
-
19
- > **id**: `string`
20
-
21
- The id for the blob.
22
-
23
- ***
24
-
25
- ### mimeType?
26
-
27
- > `optional` **mimeType**: `string`
28
-
29
- The mime type for the blob.
30
-
31
- ***
32
-
33
- ### extension?
34
-
35
- > `optional` **extension**: `string`
36
-
37
- The extension.
38
-
39
- ***
40
-
41
- ### metadata?
42
-
43
- > `optional` **metadata**: `IJsonLdNodeObject`
44
-
45
- The metadata for the blob as JSON-LD.