@olympeio/runtime-node 9.9.0 → 9.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olympeio/runtime-node",
3
- "version": "9.9.0",
3
+ "version": "9.9.1",
4
4
  "description": "Olympe Node Runtime Environment",
5
5
  "types": "types/index.d.ts",
6
6
  "dependencies": {
package/types/cloud.d.ts CHANGED
@@ -169,28 +169,58 @@ export class File extends CloudObject {
169
169
  static createFromURL(transaction: Transaction, name: string, url: string, mimeType?: string, source?: Source, tag?: string): string;
170
170
 
171
171
  /**
172
- * Retrieve content from this file asynchronously
172
+ * Gets the file content as an ArrayBuffer.
173
173
  *
174
- * @param onSuccess callback to execute when byte content has been retrieved successfully
175
- * @param onFailure callback to execute when content retrieval has failed
174
+ * @deprecated consider using the new `getContentAsBinary` method returning a Promise instead
175
+ * @param onSuccess (deprecated) callback to execute when byte content has been retrieved successfully
176
+ * @param onFailure (deprecated) callback to execute when content retrieval has failed
176
177
  */
177
- getContentAsBinary(onSuccess: (content: ArrayBuffer) => void, onFailure?: (errMsg: string) => void): void;
178
+ getContentAsBinary(onSuccess: (content: ArrayBuffer) => void, onFailure?: (errMsg: string) => void);
178
179
 
179
180
  /**
180
- * Retrieve string content from this file asynchronously
181
+ * Gets the file content as an ArrayBuffer.
181
182
  *
182
- * @param onSuccess callback to execute when string content has been retrieved successfully
183
- * @param onFailure callback to execute when content retrieval has failed
183
+ * @return promise resolving with the content as a byte array
184
184
  */
185
- getContentAsString(onSuccess: (content: string) => void, onFailure?: (errMsg: string) => void): void;
185
+ getContentAsBinary():Promise<ArrayBuffer>;
186
186
 
187
187
  /**
188
- * Retrieve string content from URL asynchronously
188
+ * Get the content of this file and returns it as an UTF-8 string.
189
+ * **Note:** this method should be used only when the file is a text file.
189
190
  *
190
- * @param onSuccess callback to execute when content has been retrieved successfully
191
- * @param onFailure callback to execute when content retrieval has failed
191
+ * @deprecated consider using the new `getContentAsString` method returning a Promise instead
192
+ * @param onSuccess (deprecated) callback to execute when string content has been retrieved successfully
193
+ * @param onFailure (deprecated) callback to execute when content retrieval has failed
192
194
  */
193
- getContentUrl(onSuccess: (content: string) => void, onFailure?: () => void): void;
195
+ getContentAsString(onSuccess: (content: string) => void, onFailure?: (errMsg: string) => void);
196
+
197
+ /**
198
+ * Get the content of this file and returns it as an UTF-8 string.
199
+ * **Note:** this method should be used only when the file is a text file.
200
+ *
201
+ * @return promise resolving with the content as a string
202
+ */
203
+ getContentAsString(): Promise<string>;
204
+
205
+ /**
206
+ * Gets the URL that gives direct access to the file content:
207
+ * - For files that are external to Olympe, gives the normal URL
208
+ * - For the files stored by Olympe, provides a dataURL, with the content embedded in Base64
209
+ *
210
+ * @deprecated consider using the new `getContentUrl` method returning a Promise instead
211
+ * @param onSuccess (deprecated) callback to execute when content has been retrieved successfully
212
+ * @param onFailure (deprecated) callback to execute when content retrieval has failed
213
+ */
214
+ getContentUrl(onSuccess: (content: string) => void, onFailure?: () => void);
215
+
216
+ /**
217
+ * Gets the URL that gives direct access to the file content:
218
+ * - For files that are external to Olympe, gives the normal URL
219
+ * - For the files stored by Olympe, provides a dataURL, with the content embedded in Base64
220
+ *
221
+ * @return promise resolving with the content as a string
222
+ */
223
+ getContentUrl(): Promise<string>;
194
224
 
195
225
  /**
196
226
  * Save this file with specified name