@twin.org/blob-storage-rest-client 0.0.1-next.22 → 0.0.1-next.23

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.
@@ -28,32 +28,32 @@ class BlobStorageClient extends apiCore.BaseRestClient {
28
28
  super(BlobStorageClient._CLASS_NAME, config, "blob");
29
29
  }
30
30
  /**
31
- * Create the blob with some metadata.
31
+ * Create the blob with some annotation.
32
32
  * @param blob The data for the blob in base64 format.
33
33
  * @param encodingFormat Mime type for the blob, will be detected if left undefined.
34
34
  * @param fileExtension Extension for the blob, will be detected if left undefined.
35
- * @param metadata Data for the custom metadata as JSON-LD.
35
+ * @param annotationObject Data for the custom annotation as JSON-LD.
36
36
  * @param namespace The namespace to use for storing, defaults to component configured namespace.
37
37
  * @returns The id of the stored blob in urn format.
38
38
  */
39
- async create(blob, encodingFormat, fileExtension, metadata, namespace) {
39
+ async create(blob, encodingFormat, fileExtension, annotationObject, namespace) {
40
40
  core.Guards.stringBase64(this.CLASS_NAME, "blob", blob);
41
41
  const response = await this.fetch("/", "POST", {
42
42
  body: {
43
43
  blob,
44
44
  encodingFormat,
45
45
  fileExtension,
46
- metadata,
46
+ annotationObject,
47
47
  namespace
48
48
  }
49
49
  });
50
50
  return response.headers[web.HeaderTypes.Location];
51
51
  }
52
52
  /**
53
- * Get the blob and metadata.
53
+ * Get the blob and annotation.
54
54
  * @param id The id of the blob to get in urn format.
55
- * @param includeContent Include the content, or just get the metadata.
56
- * @returns The metadata and data for the blob if it can be found.
55
+ * @param includeContent Include the content, or just get the annotation.
56
+ * @returns The annotation and data for the blob if it can be found.
57
57
  * @throws Not found error if the blob cannot be found.
58
58
  */
59
59
  async get(id, includeContent) {
@@ -72,15 +72,15 @@ class BlobStorageClient extends apiCore.BaseRestClient {
72
72
  return response.body;
73
73
  }
74
74
  /**
75
- * Update the blob with metadata.
76
- * @param id The id of the blob metadata to update.
75
+ * Update the blob with annotation.
76
+ * @param id The id of the blob annotation to update.
77
77
  * @param encodingFormat Mime type for the blob, will be detected if left undefined.
78
78
  * @param fileExtension Extension for the blob, will be detected if left undefined.
79
- * @param metadata Data for the custom metadata as JSON-LD.
79
+ * @param annotationObject Data for the custom annotation as JSON-LD.
80
80
  * @returns Nothing.
81
81
  * @throws Not found error if the blob cannot be found.
82
82
  */
83
- async update(id, encodingFormat, fileExtension, metadata) {
83
+ async update(id, encodingFormat, fileExtension, annotationObject) {
84
84
  core.Urn.guard(this.CLASS_NAME, "id", id);
85
85
  await this.fetch("/:id", "PUT", {
86
86
  pathParams: {
@@ -89,7 +89,7 @@ class BlobStorageClient extends apiCore.BaseRestClient {
89
89
  body: {
90
90
  encodingFormat,
91
91
  fileExtension,
92
- metadata
92
+ annotationObject
93
93
  }
94
94
  });
95
95
  }
@@ -26,32 +26,32 @@ class BlobStorageClient extends BaseRestClient {
26
26
  super(BlobStorageClient._CLASS_NAME, config, "blob");
27
27
  }
28
28
  /**
29
- * Create the blob with some metadata.
29
+ * Create the blob with some annotation.
30
30
  * @param blob The data for the blob in base64 format.
31
31
  * @param encodingFormat Mime type for the blob, will be detected if left undefined.
32
32
  * @param fileExtension Extension for the blob, will be detected if left undefined.
33
- * @param metadata Data for the custom metadata as JSON-LD.
33
+ * @param annotationObject Data for the custom annotation as JSON-LD.
34
34
  * @param namespace The namespace to use for storing, defaults to component configured namespace.
35
35
  * @returns The id of the stored blob in urn format.
36
36
  */
37
- async create(blob, encodingFormat, fileExtension, metadata, namespace) {
37
+ async create(blob, encodingFormat, fileExtension, annotationObject, namespace) {
38
38
  Guards.stringBase64(this.CLASS_NAME, "blob", blob);
39
39
  const response = await this.fetch("/", "POST", {
40
40
  body: {
41
41
  blob,
42
42
  encodingFormat,
43
43
  fileExtension,
44
- metadata,
44
+ annotationObject,
45
45
  namespace
46
46
  }
47
47
  });
48
48
  return response.headers[HeaderTypes.Location];
49
49
  }
50
50
  /**
51
- * Get the blob and metadata.
51
+ * Get the blob and annotation.
52
52
  * @param id The id of the blob to get in urn format.
53
- * @param includeContent Include the content, or just get the metadata.
54
- * @returns The metadata and data for the blob if it can be found.
53
+ * @param includeContent Include the content, or just get the annotation.
54
+ * @returns The annotation and data for the blob if it can be found.
55
55
  * @throws Not found error if the blob cannot be found.
56
56
  */
57
57
  async get(id, includeContent) {
@@ -70,15 +70,15 @@ class BlobStorageClient extends BaseRestClient {
70
70
  return response.body;
71
71
  }
72
72
  /**
73
- * Update the blob with metadata.
74
- * @param id The id of the blob metadata to update.
73
+ * Update the blob with annotation.
74
+ * @param id The id of the blob annotation to update.
75
75
  * @param encodingFormat Mime type for the blob, will be detected if left undefined.
76
76
  * @param fileExtension Extension for the blob, will be detected if left undefined.
77
- * @param metadata Data for the custom metadata as JSON-LD.
77
+ * @param annotationObject Data for the custom annotation as JSON-LD.
78
78
  * @returns Nothing.
79
79
  * @throws Not found error if the blob cannot be found.
80
80
  */
81
- async update(id, encodingFormat, fileExtension, metadata) {
81
+ async update(id, encodingFormat, fileExtension, annotationObject) {
82
82
  Urn.guard(this.CLASS_NAME, "id", id);
83
83
  await this.fetch("/:id", "PUT", {
84
84
  pathParams: {
@@ -87,7 +87,7 @@ class BlobStorageClient extends BaseRestClient {
87
87
  body: {
88
88
  encodingFormat,
89
89
  fileExtension,
90
- metadata
90
+ annotationObject
91
91
  }
92
92
  });
93
93
  }
@@ -17,33 +17,33 @@ export declare class BlobStorageClient extends BaseRestClient implements IBlobSt
17
17
  */
18
18
  constructor(config: IBaseRestClientConfig);
19
19
  /**
20
- * Create the blob with some metadata.
20
+ * Create the blob with some annotation.
21
21
  * @param blob The data for the blob in base64 format.
22
22
  * @param encodingFormat Mime type for the blob, will be detected if left undefined.
23
23
  * @param fileExtension Extension for the blob, will be detected if left undefined.
24
- * @param metadata Data for the custom metadata as JSON-LD.
24
+ * @param annotationObject Data for the custom annotation as JSON-LD.
25
25
  * @param namespace The namespace to use for storing, defaults to component configured namespace.
26
26
  * @returns The id of the stored blob in urn format.
27
27
  */
28
- create(blob: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject, namespace?: string): Promise<string>;
28
+ create(blob: string, encodingFormat?: string, fileExtension?: string, annotationObject?: IJsonLdNodeObject, namespace?: string): Promise<string>;
29
29
  /**
30
- * Get the blob and metadata.
30
+ * Get the blob and annotation.
31
31
  * @param id The id of the blob to get in urn format.
32
- * @param includeContent Include the content, or just get the metadata.
33
- * @returns The metadata and data for the blob if it can be found.
32
+ * @param includeContent Include the content, or just get the annotation.
33
+ * @returns The annotation and data for the blob if it can be found.
34
34
  * @throws Not found error if the blob cannot be found.
35
35
  */
36
36
  get(id: string, includeContent: boolean): Promise<IBlobStorageEntry>;
37
37
  /**
38
- * Update the blob with metadata.
39
- * @param id The id of the blob metadata to update.
38
+ * Update the blob with annotation.
39
+ * @param id The id of the blob annotation to update.
40
40
  * @param encodingFormat Mime type for the blob, will be detected if left undefined.
41
41
  * @param fileExtension Extension for the blob, will be detected if left undefined.
42
- * @param metadata Data for the custom metadata as JSON-LD.
42
+ * @param annotationObject Data for the custom annotation as JSON-LD.
43
43
  * @returns Nothing.
44
44
  * @throws Not found error if the blob cannot be found.
45
45
  */
46
- update(id: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject): Promise<void>;
46
+ update(id: string, encodingFormat?: string, fileExtension?: string, annotationObject?: IJsonLdNodeObject): Promise<void>;
47
47
  /**
48
48
  * Remove the blob.
49
49
  * @param id The id of the blob to remove in urn format.
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/blob-storage-rest-client - Changelog
2
2
 
3
- ## v0.0.1-next.22
3
+ ## v0.0.1-next.23
4
4
 
5
5
  - Initial Release
@@ -50,9 +50,9 @@ Runtime name for the class.
50
50
 
51
51
  ### create()
52
52
 
53
- > **create**(`blob`, `encodingFormat`?, `fileExtension`?, `metadata`?, `namespace`?): `Promise`\<`string`\>
53
+ > **create**(`blob`, `encodingFormat`?, `fileExtension`?, `annotationObject`?, `namespace`?): `Promise`\<`string`\>
54
54
 
55
- Create the blob with some metadata.
55
+ Create the blob with some annotation.
56
56
 
57
57
  #### Parameters
58
58
 
@@ -74,11 +74,11 @@ Mime type for the blob, will be detected if left undefined.
74
74
 
75
75
  Extension for the blob, will be detected if left undefined.
76
76
 
77
- ##### metadata?
77
+ ##### annotationObject?
78
78
 
79
79
  `IJsonLdNodeObject`
80
80
 
81
- Data for the custom metadata as JSON-LD.
81
+ Data for the custom annotation as JSON-LD.
82
82
 
83
83
  ##### namespace?
84
84
 
@@ -102,7 +102,7 @@ The id of the stored blob in urn format.
102
102
 
103
103
  > **get**(`id`, `includeContent`): `Promise`\<`IBlobStorageEntry`\>
104
104
 
105
- Get the blob and metadata.
105
+ Get the blob and annotation.
106
106
 
107
107
  #### Parameters
108
108
 
@@ -116,13 +116,13 @@ The id of the blob to get in urn format.
116
116
 
117
117
  `boolean`
118
118
 
119
- Include the content, or just get the metadata.
119
+ Include the content, or just get the annotation.
120
120
 
121
121
  #### Returns
122
122
 
123
123
  `Promise`\<`IBlobStorageEntry`\>
124
124
 
125
- The metadata and data for the blob if it can be found.
125
+ The annotation and data for the blob if it can be found.
126
126
 
127
127
  #### Throws
128
128
 
@@ -136,9 +136,9 @@ Not found error if the blob cannot be found.
136
136
 
137
137
  ### update()
138
138
 
139
- > **update**(`id`, `encodingFormat`?, `fileExtension`?, `metadata`?): `Promise`\<`void`\>
139
+ > **update**(`id`, `encodingFormat`?, `fileExtension`?, `annotationObject`?): `Promise`\<`void`\>
140
140
 
141
- Update the blob with metadata.
141
+ Update the blob with annotation.
142
142
 
143
143
  #### Parameters
144
144
 
@@ -146,7 +146,7 @@ Update the blob with metadata.
146
146
 
147
147
  `string`
148
148
 
149
- The id of the blob metadata to update.
149
+ The id of the blob annotation to update.
150
150
 
151
151
  ##### encodingFormat?
152
152
 
@@ -160,11 +160,11 @@ Mime type for the blob, will be detected if left undefined.
160
160
 
161
161
  Extension for the blob, will be detected if left undefined.
162
162
 
163
- ##### metadata?
163
+ ##### annotationObject?
164
164
 
165
165
  `IJsonLdNodeObject`
166
166
 
167
- Data for the custom metadata as JSON-LD.
167
+ Data for the custom annotation as JSON-LD.
168
168
 
169
169
  #### Returns
170
170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/blob-storage-rest-client",
3
- "version": "0.0.1-next.22",
3
+ "version": "0.0.1-next.23",
4
4
  "description": "Blob storage implementation which can connect to REST endpoints",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@twin.org/api-core": "next",
18
18
  "@twin.org/api-models": "next",
19
- "@twin.org/blob-storage-models": "0.0.1-next.22",
19
+ "@twin.org/blob-storage-models": "0.0.1-next.23",
20
20
  "@twin.org/core": "next",
21
21
  "@twin.org/data-json-ld": "next",
22
22
  "@twin.org/entity": "next",