idea-aws 3.16.4 → 3.16.6
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.
|
@@ -26,6 +26,7 @@ export declare abstract class ResourceController extends GenericController {
|
|
|
26
26
|
protected resourceId: string;
|
|
27
27
|
protected clientVersion: string;
|
|
28
28
|
protected clientPlatform: string;
|
|
29
|
+
protected clientBundle: string;
|
|
29
30
|
protected returnStatusCode?: number;
|
|
30
31
|
protected logRequestsWithKey: string;
|
|
31
32
|
protected metrics: CloudWatchMetrics;
|
|
@@ -19,6 +19,7 @@ class ResourceController extends genericController_1.GenericController {
|
|
|
19
19
|
this.resource = process?.env?.RESOURCE;
|
|
20
20
|
this.clientVersion = '?';
|
|
21
21
|
this.clientPlatform = '?';
|
|
22
|
+
this.clientBundle = null;
|
|
22
23
|
this.templateMatcher = /{{\s?([^{}\s]*)\s?}}/g;
|
|
23
24
|
///
|
|
24
25
|
/// REQUEST HANDLERS
|
|
@@ -107,6 +108,10 @@ class ResourceController extends genericController_1.GenericController {
|
|
|
107
108
|
this.clientPlatform = this.queryParams['_p'];
|
|
108
109
|
delete this.queryParams['_p'];
|
|
109
110
|
}
|
|
111
|
+
if (this.queryParams['_b']) {
|
|
112
|
+
this.clientBundle = this.queryParams['_b'];
|
|
113
|
+
delete this.queryParams['_b'];
|
|
114
|
+
}
|
|
110
115
|
if (options.useMetrics)
|
|
111
116
|
this.prepareMetrics();
|
|
112
117
|
// print the initial log
|
|
@@ -115,7 +120,8 @@ class ResourceController extends genericController_1.GenericController {
|
|
|
115
120
|
queryParams: this.queryParams,
|
|
116
121
|
body: this.body,
|
|
117
122
|
version: this.clientVersion,
|
|
118
|
-
platform: this.clientPlatform
|
|
123
|
+
platform: this.clientPlatform,
|
|
124
|
+
bundle: this.clientBundle
|
|
119
125
|
};
|
|
120
126
|
this.logger.info(`START: ${this.httpMethod} ${this.path}`, info);
|
|
121
127
|
}
|
|
@@ -337,6 +343,7 @@ class ResourceController extends genericController_1.GenericController {
|
|
|
337
343
|
this.metrics.addDimension('userId', this.principalId);
|
|
338
344
|
this.metrics.addDimension('clientVersion', this.clientVersion);
|
|
339
345
|
this.metrics.addDimension('clientPlatform', this.clientPlatform);
|
|
346
|
+
this.metrics.addDimension('clientBundle', this.clientBundle ?? '-');
|
|
340
347
|
this.metrics.addMetadata('resourceId', this.resourceId);
|
|
341
348
|
}
|
|
342
349
|
/**
|
package/dist/src/s3.js
CHANGED
|
@@ -21,7 +21,7 @@ class S3 {
|
|
|
21
21
|
* Create a download link of a piece of data (through S3).
|
|
22
22
|
* *Practically*, it uploads the file on an S3 bucket, generating and returning a url to it.
|
|
23
23
|
*/
|
|
24
|
-
async createDownloadURLFromData(data, options) {
|
|
24
|
+
async createDownloadURLFromData(data, options = {}) {
|
|
25
25
|
// if needed, randomly generates the key
|
|
26
26
|
if (!options.key)
|
|
27
27
|
options.key = new Date().getTime().toString().concat(Math.random().toString(36).slice(2));
|