@taskcluster/client-web 91.1.1 → 92.0.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 +3 -3
- package/src/clients/Queue.js +36 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taskcluster/client-web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "92.0.1",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"author": "Eli Perelman <eli@eliperelman.com>",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"test": "NODE_OPTIONS=--openssl-legacy-provider karma start --single-run"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@babel/core": "^7.28.
|
|
16
|
+
"@babel/core": "^7.28.5",
|
|
17
17
|
"chai": "^4.3.10",
|
|
18
18
|
"chai-as-promised": "^8.0.2",
|
|
19
19
|
"crypto-js": "^4.2.0",
|
|
20
20
|
"dotenv": "^16.5.0",
|
|
21
|
-
"eslint": "^9.
|
|
21
|
+
"eslint": "^9.39.0",
|
|
22
22
|
"karma": "^6.4.4",
|
|
23
23
|
"karma-cli": "^2.0.0",
|
|
24
24
|
"karma-coverage": "^2.2.1",
|
package/src/clients/Queue.js
CHANGED
|
@@ -458,13 +458,44 @@ export default class Queue extends Client {
|
|
|
458
458
|
// browser, without using Taskcluster credentials, include a scope in the
|
|
459
459
|
// `anonymous` role. The convention is to include
|
|
460
460
|
// `queue:get-artifact:public/*`.
|
|
461
|
-
// **
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
// use
|
|
461
|
+
// **Response**: the HTTP response to this method is a 303 redirect to the
|
|
462
|
+
// URL from which the artifact can be downloaded. The body of that response
|
|
463
|
+
// contains the data described in the output schema, contianing the same URL.
|
|
464
|
+
// Callers are encouraged to use whichever method of gathering the URL is
|
|
465
|
+
// most convenient. Standard HTTP clients will follow the redirect, while
|
|
466
|
+
// API client libraries will return the JSON body.
|
|
467
|
+
// In order to download an artifact the following must be done:
|
|
468
|
+
// 1. Obtain queue url. Building a signed url with a taskcluster client is
|
|
469
|
+
// recommended
|
|
470
|
+
// 1. Make a GET request which does not follow redirects
|
|
471
|
+
// 1. In all cases, if specified, the
|
|
472
|
+
// x-taskcluster-location-{content,transfer}-{sha256,length} values must be
|
|
473
|
+
// validated to be equal to the Content-Length and Sha256 checksum of the
|
|
474
|
+
// final artifact downloaded. as well as any intermediate redirects
|
|
475
|
+
// 1. If this response is a 500-series error, retry using an exponential
|
|
476
|
+
// backoff. No more than 5 retries should be attempted
|
|
477
|
+
// 1. If this response is a 400-series error, treat it appropriately for
|
|
478
|
+
// your context. This might be an error in responding to this request or
|
|
479
|
+
// an Error storage type body. This request should not be retried.
|
|
480
|
+
// 1. If this response is a 200-series response, the response body is the artifact.
|
|
481
|
+
// If the x-taskcluster-location-{content,transfer}-{sha256,length} and
|
|
482
|
+
// x-taskcluster-location-content-encoding are specified, they should match
|
|
483
|
+
// this response body
|
|
484
|
+
// 1. If the response type is a 300-series redirect, the artifact will be at the
|
|
485
|
+
// location specified by the `Location` header. There are multiple artifact storage
|
|
486
|
+
// types which use a 300-series redirect.
|
|
487
|
+
// 1. For all redirects followed, the user must verify that the content-sha256, content-length,
|
|
488
|
+
// transfer-sha256, transfer-length and content-encoding match every further request. The final
|
|
489
|
+
// artifact must also be validated against the values specified in the original queue response
|
|
490
|
+
// 1. Caching of requests with an x-taskcluster-artifact-storage-type value of `reference`
|
|
491
|
+
// must not occur
|
|
492
|
+
// **Headers**
|
|
493
|
+
// The following important headers are set on the response to this method:
|
|
494
|
+
// * location: the url of the artifact if a redirect is to be performed
|
|
495
|
+
// * x-taskcluster-artifact-storage-type: the storage type. Example: s3
|
|
465
496
|
// **Remark**, this end-point is slightly slower than
|
|
466
497
|
// `queue.getArtifact`, so consider that if you already know the `runId` of
|
|
467
|
-
// the latest run. Otherwise, just
|
|
498
|
+
// the latest run. Otherwise, just use the most convenient API end-point.
|
|
468
499
|
/* eslint-enable max-len */
|
|
469
500
|
getLatestArtifact(...args) {
|
|
470
501
|
this.validate(this.getLatestArtifact.entry, args);
|