pika-shared 1.4.3 → 1.4.4
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.
|
@@ -280,6 +280,28 @@ interface IChatAppState {
|
|
|
280
280
|
* ```
|
|
281
281
|
*/
|
|
282
282
|
getWidgetMetadataAPI(scope: string, tag: string, instanceId: string, renderingContext: WidgetRenderingContextType): IWidgetMetadataAPI;
|
|
283
|
+
/**
|
|
284
|
+
* Retrieve text content from an S3 file stored in the Pika S3 bucket.
|
|
285
|
+
* This is a secure helper that allows web components to access files without
|
|
286
|
+
* needing to manage AWS credentials or know the bucket name.
|
|
287
|
+
*
|
|
288
|
+
* @param s3Key - The S3 key (path) to the file in the Pika S3 bucket
|
|
289
|
+
* @returns Promise that resolves to the file content as a string
|
|
290
|
+
* @throws Error if the file doesn't exist or cannot be accessed
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```js
|
|
294
|
+
* const context = await getPikaContext($host());
|
|
295
|
+
* try {
|
|
296
|
+
* const content = await context.chatAppState.getS3TextFileContent('data/config.json');
|
|
297
|
+
* const config = JSON.parse(content);
|
|
298
|
+
* console.log('Config loaded:', config);
|
|
299
|
+
* } catch (error) {
|
|
300
|
+
* console.error('Failed to load config:', error);
|
|
301
|
+
* }
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
getS3TextFileContent(s3Key: string): Promise<string>;
|
|
283
305
|
}
|
|
284
306
|
interface IUserPrefsState {
|
|
285
307
|
readonly initialized: boolean;
|
|
@@ -280,6 +280,28 @@ interface IChatAppState {
|
|
|
280
280
|
* ```
|
|
281
281
|
*/
|
|
282
282
|
getWidgetMetadataAPI(scope: string, tag: string, instanceId: string, renderingContext: WidgetRenderingContextType): IWidgetMetadataAPI;
|
|
283
|
+
/**
|
|
284
|
+
* Retrieve text content from an S3 file stored in the Pika S3 bucket.
|
|
285
|
+
* This is a secure helper that allows web components to access files without
|
|
286
|
+
* needing to manage AWS credentials or know the bucket name.
|
|
287
|
+
*
|
|
288
|
+
* @param s3Key - The S3 key (path) to the file in the Pika S3 bucket
|
|
289
|
+
* @returns Promise that resolves to the file content as a string
|
|
290
|
+
* @throws Error if the file doesn't exist or cannot be accessed
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```js
|
|
294
|
+
* const context = await getPikaContext($host());
|
|
295
|
+
* try {
|
|
296
|
+
* const content = await context.chatAppState.getS3TextFileContent('data/config.json');
|
|
297
|
+
* const config = JSON.parse(content);
|
|
298
|
+
* console.log('Config loaded:', config);
|
|
299
|
+
* } catch (error) {
|
|
300
|
+
* console.error('Failed to load config:', error);
|
|
301
|
+
* }
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
getS3TextFileContent(s3Key: string): Promise<string>;
|
|
283
305
|
}
|
|
284
306
|
interface IUserPrefsState {
|
|
285
307
|
readonly initialized: boolean;
|