@twin.org/blob-storage-models 0.0.1-next.9 → 0.0.2-next.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 (38) hide show
  1. package/dist/cjs/index.cjs +188 -0
  2. package/dist/esm/index.mjs +185 -1
  3. package/dist/types/dataTypes/blobStorageDataTypes.d.ts +9 -0
  4. package/dist/types/index.d.ts +8 -0
  5. package/dist/types/models/IBlobStorageComponent.d.ts +42 -17
  6. package/dist/types/models/IBlobStorageEntry.d.ts +65 -0
  7. package/dist/types/models/IBlobStorageEntryList.d.ts +30 -0
  8. package/dist/types/models/api/IBlobStorageCreateRequest.d.ts +17 -2
  9. package/dist/types/models/api/IBlobStorageGetContentRequest.d.ts +11 -1
  10. package/dist/types/models/api/IBlobStorageGetRequest.d.ts +18 -1
  11. package/dist/types/models/api/IBlobStorageGetResponse.d.ts +9 -19
  12. package/dist/types/models/api/IBlobStorageListRequest.d.ts +39 -0
  13. package/dist/types/models/api/IBlobStorageListResponse.d.ts +17 -0
  14. package/dist/types/models/api/IBlobStorageUpdateRequest.d.ts +2 -2
  15. package/dist/types/models/blobStorageCompressionType.d.ts +17 -0
  16. package/dist/types/models/blobStorageContexts.d.ts +17 -0
  17. package/dist/types/models/blobStorageTypes.d.ts +17 -0
  18. package/docs/changelog.md +91 -1
  19. package/docs/reference/classes/BlobStorageDataTypes.md +25 -0
  20. package/docs/reference/index.md +17 -0
  21. package/docs/reference/interfaces/IBlobStorageComponent.md +146 -43
  22. package/docs/reference/interfaces/IBlobStorageConnector.md +11 -5
  23. package/docs/reference/interfaces/IBlobStorageCreateRequest.md +34 -4
  24. package/docs/reference/interfaces/IBlobStorageEntry.md +107 -0
  25. package/docs/reference/interfaces/IBlobStorageEntryList.md +35 -0
  26. package/docs/reference/interfaces/IBlobStorageGetContentRequest.md +25 -1
  27. package/docs/reference/interfaces/IBlobStorageGetRequest.md +37 -1
  28. package/docs/reference/interfaces/IBlobStorageGetResponse.md +9 -21
  29. package/docs/reference/interfaces/IBlobStorageListRequest.md +53 -0
  30. package/docs/reference/interfaces/IBlobStorageListResponse.md +23 -0
  31. package/docs/reference/interfaces/IBlobStorageUpdateRequest.md +4 -4
  32. package/docs/reference/type-aliases/BlobStorageCompressionType.md +5 -0
  33. package/docs/reference/type-aliases/BlobStorageContexts.md +5 -0
  34. package/docs/reference/type-aliases/BlobStorageTypes.md +5 -0
  35. package/docs/reference/variables/BlobStorageCompressionType.md +19 -0
  36. package/docs/reference/variables/BlobStorageContexts.md +19 -0
  37. package/docs/reference/variables/BlobStorageTypes.md +19 -0
  38. package/package.json +9 -5
@@ -16,7 +16,9 @@ Set the blob.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **blob**: `Uint8Array`
19
+ ##### blob
20
+
21
+ `Uint8Array`
20
22
 
21
23
  The data for the blob.
22
24
 
@@ -30,19 +32,21 @@ The id of the stored blob in urn format.
30
32
 
31
33
  ### get()
32
34
 
33
- > **get**(`id`): `Promise`\<`undefined` \| `Uint8Array`\>
35
+ > **get**(`id`): `Promise`\<`undefined` \| `Uint8Array`\<`ArrayBufferLike`\>\>
34
36
 
35
37
  Get the blob.
36
38
 
37
39
  #### Parameters
38
40
 
39
- **id**: `string`
41
+ ##### id
42
+
43
+ `string`
40
44
 
41
45
  The id of the blob to get in urn format.
42
46
 
43
47
  #### Returns
44
48
 
45
- `Promise`\<`undefined` \| `Uint8Array`\>
49
+ `Promise`\<`undefined` \| `Uint8Array`\<`ArrayBufferLike`\>\>
46
50
 
47
51
  The data for the blob if it can be found or undefined.
48
52
 
@@ -56,7 +60,9 @@ Remove the blob.
56
60
 
57
61
  #### Parameters
58
62
 
59
- **id**: `string`
63
+ ##### id
64
+
65
+ `string`
60
66
 
61
67
  The id of the blob to remove in urn format.
62
68
 
@@ -16,15 +16,15 @@ The body parameters.
16
16
 
17
17
  The data to store in base64 encoding.
18
18
 
19
- #### mimeType?
19
+ #### encodingFormat?
20
20
 
21
- > `optional` **mimeType**: `string`
21
+ > `optional` **encodingFormat**: `string`
22
22
 
23
23
  The mime type of the blob, will be detected if left undefined.
24
24
 
25
- #### extension?
25
+ #### fileExtension?
26
26
 
27
- > `optional` **extension**: `string`
27
+ > `optional` **fileExtension**: `string`
28
28
 
29
29
  The extension of the blob, will be detected if left undefined.
30
30
 
@@ -34,6 +34,36 @@ The extension of the blob, will be detected if left undefined.
34
34
 
35
35
  Custom metadata to associate with the blob as JSON-LD.
36
36
 
37
+ #### disableEncryption?
38
+
39
+ > `optional` **disableEncryption**: `boolean`
40
+
41
+ Disables encryption if enabled by default.
42
+
43
+ ##### Default
44
+
45
+ ```ts
46
+ false
47
+ ```
48
+
49
+ #### compress?
50
+
51
+ > `optional` **compress**: [`BlobStorageCompressionType`](../type-aliases/BlobStorageCompressionType.md)
52
+
53
+ Optional compression type to use for the blob, defaults to no compression.
54
+
55
+ #### overrideVaultKeyId?
56
+
57
+ > `optional` **overrideVaultKeyId**: `string`
58
+
59
+ Use a different vault key id for encryption, if not provided the default vault key id will be used.
60
+
61
+ ##### Default
62
+
63
+ ```ts
64
+ undefined
65
+ ```
66
+
37
67
  #### namespace?
38
68
 
39
69
  > `optional` **namespace**: `string`
@@ -0,0 +1,107 @@
1
+ # Interface: IBlobStorageEntry
2
+
3
+ Interface describing a blob storage entry.
4
+
5
+ ## Properties
6
+
7
+ ### @context
8
+
9
+ > **@context**: \[`"https://schema.twindev.org/blob-storage/"`, `"https://schema.twindev.org/common/"`, `...IJsonLdContextDefinitionElement[]`\]
10
+
11
+ JSON-LD Context.
12
+
13
+ ***
14
+
15
+ ### type
16
+
17
+ > **type**: `"BlobStorageEntry"`
18
+
19
+ JSON-LD Type.
20
+
21
+ ***
22
+
23
+ ### id
24
+
25
+ > **id**: `string`
26
+
27
+ The id for the blob.
28
+
29
+ ***
30
+
31
+ ### dateCreated
32
+
33
+ > **dateCreated**: `string`
34
+
35
+ The date/time when the entry was created.
36
+
37
+ ***
38
+
39
+ ### dateModified?
40
+
41
+ > `optional` **dateModified**: `string`
42
+
43
+ The date/time when the entry was modified.
44
+
45
+ ***
46
+
47
+ ### blobSize
48
+
49
+ > **blobSize**: `number`
50
+
51
+ The size of the data in the blob.
52
+
53
+ ***
54
+
55
+ ### blobHash
56
+
57
+ > **blobHash**: `string`
58
+
59
+ The hash of the data in the blob.
60
+
61
+ ***
62
+
63
+ ### encodingFormat?
64
+
65
+ > `optional` **encodingFormat**: `string`
66
+
67
+ The mime type for the blob.
68
+
69
+ ***
70
+
71
+ ### isEncrypted?
72
+
73
+ > `optional` **isEncrypted**: `boolean`
74
+
75
+ Indicates if the blob is encrypted.
76
+
77
+ ***
78
+
79
+ ### compression?
80
+
81
+ > `optional` **compression**: [`BlobStorageCompressionType`](../type-aliases/BlobStorageCompressionType.md)
82
+
83
+ The type of compression used for the blob, if not set it is not stored with compression.
84
+
85
+ ***
86
+
87
+ ### fileExtension?
88
+
89
+ > `optional` **fileExtension**: `string`
90
+
91
+ The extension.
92
+
93
+ ***
94
+
95
+ ### metadata?
96
+
97
+ > `optional` **metadata**: `IJsonLdNodeObject`
98
+
99
+ The metadata for the blob as JSON-LD.
100
+
101
+ ***
102
+
103
+ ### blob?
104
+
105
+ > `optional` **blob**: `string`
106
+
107
+ The blob in base64 format, included if the includeContent flag was set in the request.
@@ -0,0 +1,35 @@
1
+ # Interface: IBlobStorageEntryList
2
+
3
+ Interface describing an blob storage entry list.
4
+
5
+ ## Properties
6
+
7
+ ### @context
8
+
9
+ > **@context**: \[`"https://schema.org"`, `"https://schema.twindev.org/blob-storage/"`, `"https://schema.twindev.org/common/"`, `...IJsonLdContextDefinitionElement[]`\]
10
+
11
+ JSON-LD Context.
12
+
13
+ ***
14
+
15
+ ### type
16
+
17
+ > **type**: `"ItemList"`
18
+
19
+ JSON-LD Type.
20
+
21
+ ***
22
+
23
+ ### itemListElement
24
+
25
+ > **itemListElement**: [`IBlobStorageEntry`](IBlobStorageEntry.md)[]
26
+
27
+ The list of entries.
28
+
29
+ ***
30
+
31
+ ### nextItem?
32
+
33
+ > `optional` **nextItem**: `string`
34
+
35
+ The cursor to get the next chunk of entries.
@@ -24,9 +24,33 @@ The id of the blob to get in urn format.
24
24
 
25
25
  The query parameters.
26
26
 
27
+ #### decompress?
28
+
29
+ > `optional` **decompress**: `string` \| `boolean`
30
+
31
+ If the content should be decompressed, if it was compressed when stored, defaults to true.
32
+
33
+ ##### Default
34
+
35
+ ```ts
36
+ true
37
+ ```
38
+
39
+ #### overrideVaultKeyId?
40
+
41
+ > `optional` **overrideVaultKeyId**: `string`
42
+
43
+ Use a different vault key id for decryption, if not provided the default vault key id will be used.
44
+
45
+ ##### Default
46
+
47
+ ```ts
48
+ undefined
49
+ ```
50
+
27
51
  #### download?
28
52
 
29
- > `optional` **download**: `boolean`
53
+ > `optional` **download**: `string` \| `boolean`
30
54
 
31
55
  Set the download flag which should prompt the browser to save the file.
32
56
  Otherwise the browser should show the content inside the page.
@@ -4,6 +4,18 @@ Request to get an entry from blob storage.
4
4
 
5
5
  ## Properties
6
6
 
7
+ ### headers?
8
+
9
+ > `optional` **headers**: `object`
10
+
11
+ The headers which can be used to determine the response data type.
12
+
13
+ #### accept
14
+
15
+ > **accept**: `"application/json"` \| `"application/ld+json"`
16
+
17
+ ***
18
+
7
19
  ### pathParams
8
20
 
9
21
  > **pathParams**: `object`
@@ -26,7 +38,7 @@ The query parameters.
26
38
 
27
39
  #### includeContent?
28
40
 
29
- > `optional` **includeContent**: `boolean`
41
+ > `optional` **includeContent**: `string` \| `boolean`
30
42
 
31
43
  Include the content in the response, otherwise only metadata is returned.
32
44
 
@@ -35,3 +47,27 @@ Include the content in the response, otherwise only metadata is returned.
35
47
  ```ts
36
48
  false
37
49
  ```
50
+
51
+ #### decompress?
52
+
53
+ > `optional` **decompress**: `string` \| `boolean`
54
+
55
+ If the content should be decompressed, if it was compressed when stored, defaults to true.
56
+
57
+ ##### Default
58
+
59
+ ```ts
60
+ true
61
+ ```
62
+
63
+ #### overrideVaultKeyId?
64
+
65
+ > `optional` **overrideVaultKeyId**: `string`
66
+
67
+ Use a different vault key id for decryption, if not provided the default vault key id will be used.
68
+
69
+ ##### Default
70
+
71
+ ```ts
72
+ undefined
73
+ ```
@@ -4,32 +4,20 @@ Response to get an entry from blob storage.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### body
8
-
9
- > **body**: `object`
10
-
11
- The body parameters.
12
-
13
- #### mimeType?
7
+ ### headers?
14
8
 
15
- > `optional` **mimeType**: `string`
9
+ > `optional` **headers**: `object`
16
10
 
17
- The mime type of the blob.
11
+ The headers which can be used to determine the response data type.
18
12
 
19
- #### extension?
13
+ #### content-type
20
14
 
21
- > `optional` **extension**: `string`
15
+ > **content-type**: `"application/json"` \| `"application/ld+json"`
22
16
 
23
- The extension of the blob.
17
+ ***
24
18
 
25
- #### metadata?
26
-
27
- > `optional` **metadata**: `IJsonLdNodeObject`
28
-
29
- Custom metadata to associate with the blob as JSON-LD.
30
-
31
- #### blob?
19
+ ### body
32
20
 
33
- > `optional` **blob**: `string`
21
+ > **body**: [`IBlobStorageEntry`](IBlobStorageEntry.md)
34
22
 
35
- The blob in base64 format, if the includeContent flag was set in the request.
23
+ The body parameters.
@@ -0,0 +1,53 @@
1
+ # Interface: IBlobStorageListRequest
2
+
3
+ Query the entries from blob storage.
4
+
5
+ ## Properties
6
+
7
+ ### headers?
8
+
9
+ > `optional` **headers**: `object`
10
+
11
+ The headers which can be used to determine the response data type.
12
+
13
+ #### accept
14
+
15
+ > **accept**: `"application/json"` \| `"application/ld+json"`
16
+
17
+ ***
18
+
19
+ ### query?
20
+
21
+ > `optional` **query**: `object`
22
+
23
+ The parameters from the query.
24
+
25
+ #### conditions?
26
+
27
+ > `optional` **conditions**: `string`
28
+
29
+ The condition for the query as JSON version of EntityCondition type.
30
+
31
+ #### orderBy?
32
+
33
+ > `optional` **orderBy**: `"dateCreated"` \| `"dateModified"`
34
+
35
+ The order for the results, default to created.
36
+
37
+ #### orderByDirection?
38
+
39
+ > `optional` **orderByDirection**: `SortDirection`
40
+
41
+ The direction for the order, defaults to desc.
42
+
43
+ #### pageSize?
44
+
45
+ > `optional` **pageSize**: `string` \| `number`
46
+
47
+ The number of entries to return per page.
48
+
49
+ #### cursor?
50
+
51
+ > `optional` **cursor**: `string`
52
+
53
+ The cursor to get next chunk of data, returned in previous response.
@@ -0,0 +1,23 @@
1
+ # Interface: IBlobStorageListResponse
2
+
3
+ Response to getting the list of entries from a query.
4
+
5
+ ## Properties
6
+
7
+ ### headers?
8
+
9
+ > `optional` **headers**: `object`
10
+
11
+ The headers which can be used to determine the response data type.
12
+
13
+ #### content-type
14
+
15
+ > **content-type**: `"application/json"` \| `"application/ld+json"`
16
+
17
+ ***
18
+
19
+ ### body
20
+
21
+ > **body**: [`IBlobStorageEntryList`](IBlobStorageEntryList.md)
22
+
23
+ The list of entries from the query.
@@ -24,15 +24,15 @@ The id of the blob to get in urn format.
24
24
 
25
25
  The body parameters.
26
26
 
27
- #### mimeType?
27
+ #### encodingFormat?
28
28
 
29
- > `optional` **mimeType**: `string`
29
+ > `optional` **encodingFormat**: `string`
30
30
 
31
31
  The mime type of the blob, will be detected if left undefined.
32
32
 
33
- #### extension?
33
+ #### fileExtension?
34
34
 
35
- > `optional` **extension**: `string`
35
+ > `optional` **fileExtension**: `string`
36
36
 
37
37
  The extension of the blob, will be detected if left undefined.
38
38
 
@@ -0,0 +1,5 @@
1
+ # Type Alias: BlobStorageCompressionType
2
+
3
+ > **BlobStorageCompressionType** = *typeof* [`BlobStorageCompressionType`](../variables/BlobStorageCompressionType.md)\[keyof *typeof* [`BlobStorageCompressionType`](../variables/BlobStorageCompressionType.md)\]
4
+
5
+ The types of compression for blob storage data.
@@ -0,0 +1,5 @@
1
+ # Type Alias: BlobStorageContexts
2
+
3
+ > **BlobStorageContexts** = *typeof* [`BlobStorageContexts`](../variables/BlobStorageContexts.md)\[keyof *typeof* [`BlobStorageContexts`](../variables/BlobStorageContexts.md)\]
4
+
5
+ The contexts of blob storage data.
@@ -0,0 +1,5 @@
1
+ # Type Alias: BlobStorageTypes
2
+
3
+ > **BlobStorageTypes** = *typeof* [`BlobStorageTypes`](../variables/BlobStorageTypes.md)\[keyof *typeof* [`BlobStorageTypes`](../variables/BlobStorageTypes.md)\]
4
+
5
+ The types of blob storage data.
@@ -0,0 +1,19 @@
1
+ # Variable: BlobStorageCompressionType
2
+
3
+ > `const` **BlobStorageCompressionType**: `object`
4
+
5
+ The types of compression for blob storage data.
6
+
7
+ ## Type declaration
8
+
9
+ ### Gzip
10
+
11
+ > `readonly` **Gzip**: `"gzip"` = `"gzip"`
12
+
13
+ Gzip.
14
+
15
+ ### Deflate
16
+
17
+ > `readonly` **Deflate**: `"deflate"` = `"deflate"`
18
+
19
+ Deflate.
@@ -0,0 +1,19 @@
1
+ # Variable: BlobStorageContexts
2
+
3
+ > `const` **BlobStorageContexts**: `object`
4
+
5
+ The contexts of blob storage data.
6
+
7
+ ## Type declaration
8
+
9
+ ### ContextRoot
10
+
11
+ > `readonly` **ContextRoot**: `"https://schema.twindev.org/blob-storage/"` = `"https://schema.twindev.org/blob-storage/"`
12
+
13
+ The context root for the blob storage types.
14
+
15
+ ### ContextRootCommon
16
+
17
+ > `readonly` **ContextRootCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
18
+
19
+ The context root for the common types.
@@ -0,0 +1,19 @@
1
+ # Variable: BlobStorageTypes
2
+
3
+ > `const` **BlobStorageTypes**: `object`
4
+
5
+ The types of blob storage data.
6
+
7
+ ## Type declaration
8
+
9
+ ### Entry
10
+
11
+ > `readonly` **Entry**: `"BlobStorageEntry"` = `"BlobStorageEntry"`
12
+
13
+ Represents blob storage entry.
14
+
15
+ ### CompressionType
16
+
17
+ > `readonly` **CompressionType**: `"BlobStorageCompressionType"` = `"BlobStorageCompressionType"`
18
+
19
+ Represents blob storage entry compression.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/blob-storage-models",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.1",
4
4
  "description": "Models which define the structure of the blob storage contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,19 +15,23 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
+ "@twin.org/data-core": "next",
18
19
  "@twin.org/data-json-ld": "next",
19
- "@twin.org/nameof": "next"
20
+ "@twin.org/entity": "next",
21
+ "@twin.org/nameof": "next",
22
+ "@twin.org/standards-schema-org": "next",
23
+ "@twin.org/web": "next"
20
24
  },
21
25
  "main": "./dist/cjs/index.cjs",
22
26
  "module": "./dist/esm/index.mjs",
23
27
  "types": "./dist/types/index.d.ts",
24
28
  "exports": {
25
29
  ".": {
30
+ "types": "./dist/types/index.d.ts",
26
31
  "require": "./dist/cjs/index.cjs",
27
- "import": "./dist/esm/index.mjs",
28
- "types": "./dist/types/index.d.ts"
32
+ "import": "./dist/esm/index.mjs"
29
33
  },
30
- "./locales": "./locales"
34
+ "./locales/*.json": "./locales/*.json"
31
35
  },
32
36
  "files": [
33
37
  "dist/cjs",