@actions/artifact 0.5.0 → 0.6.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.
Files changed (47) hide show
  1. package/LICENSE.md +8 -8
  2. package/README.md +213 -213
  3. package/lib/artifact-client.d.ts +10 -10
  4. package/lib/artifact-client.js +10 -10
  5. package/lib/internal/artifact-client.d.ts +41 -41
  6. package/lib/internal/artifact-client.js +164 -148
  7. package/lib/internal/artifact-client.js.map +1 -1
  8. package/lib/internal/config-variables.d.ts +11 -11
  9. package/lib/internal/config-variables.js +70 -70
  10. package/lib/internal/contracts.d.ts +67 -57
  11. package/lib/internal/contracts.js +2 -2
  12. package/lib/internal/download-http-client.d.ts +39 -39
  13. package/lib/internal/download-http-client.js +271 -274
  14. package/lib/internal/download-http-client.js.map +1 -1
  15. package/lib/internal/download-options.d.ts +7 -7
  16. package/lib/internal/download-options.js +2 -2
  17. package/lib/internal/download-response.d.ts +10 -10
  18. package/lib/internal/download-response.js +2 -2
  19. package/lib/internal/download-specification.d.ts +19 -19
  20. package/lib/internal/download-specification.js +60 -60
  21. package/lib/internal/http-manager.d.ts +12 -12
  22. package/lib/internal/http-manager.js +30 -30
  23. package/lib/internal/path-and-artifact-name-validation.d.ts +8 -0
  24. package/lib/internal/path-and-artifact-name-validation.js +66 -0
  25. package/lib/internal/path-and-artifact-name-validation.js.map +1 -0
  26. package/lib/internal/requestUtils.d.ts +3 -3
  27. package/lib/internal/requestUtils.js +74 -74
  28. package/lib/internal/status-reporter.d.ts +21 -22
  29. package/lib/internal/status-reporter.js +50 -63
  30. package/lib/internal/status-reporter.js.map +1 -1
  31. package/lib/internal/upload-gzip.d.ts +14 -14
  32. package/lib/internal/upload-gzip.js +107 -88
  33. package/lib/internal/upload-gzip.js.map +1 -1
  34. package/lib/internal/upload-http-client.d.ts +48 -48
  35. package/lib/internal/upload-http-client.js +393 -378
  36. package/lib/internal/upload-http-client.js.map +1 -1
  37. package/lib/internal/upload-options.d.ts +34 -34
  38. package/lib/internal/upload-options.js +2 -2
  39. package/lib/internal/upload-response.d.ts +19 -19
  40. package/lib/internal/upload-response.js +2 -2
  41. package/lib/internal/upload-specification.d.ts +11 -11
  42. package/lib/internal/upload-specification.js +87 -87
  43. package/lib/internal/upload-specification.js.map +1 -1
  44. package/lib/internal/utils.d.ts +66 -74
  45. package/lib/internal/utils.js +262 -303
  46. package/lib/internal/utils.js.map +1 -1
  47. package/package.json +49 -49
@@ -1,304 +1,263 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const core_1 = require("@actions/core");
13
- const fs_1 = require("fs");
14
- const http_client_1 = require("@actions/http-client");
15
- const auth_1 = require("@actions/http-client/auth");
16
- const config_variables_1 = require("./config-variables");
17
- /**
18
- * Returns a retry time in milliseconds that exponentially gets larger
19
- * depending on the amount of retries that have been attempted
20
- */
21
- function getExponentialRetryTimeInMilliseconds(retryCount) {
22
- if (retryCount < 0) {
23
- throw new Error('RetryCount should not be negative');
24
- }
25
- else if (retryCount === 0) {
26
- return config_variables_1.getInitialRetryIntervalInMilliseconds();
27
- }
28
- const minTime = config_variables_1.getInitialRetryIntervalInMilliseconds() * config_variables_1.getRetryMultiplier() * retryCount;
29
- const maxTime = minTime * config_variables_1.getRetryMultiplier();
30
- // returns a random number between the minTime (inclusive) and the maxTime (exclusive)
31
- return Math.random() * (maxTime - minTime) + minTime;
32
- }
33
- exports.getExponentialRetryTimeInMilliseconds = getExponentialRetryTimeInMilliseconds;
34
- /**
35
- * Parses a env variable that is a number
36
- */
37
- function parseEnvNumber(key) {
38
- const value = Number(process.env[key]);
39
- if (Number.isNaN(value) || value < 0) {
40
- return undefined;
41
- }
42
- return value;
43
- }
44
- exports.parseEnvNumber = parseEnvNumber;
45
- /**
46
- * Various utility functions to help with the necessary API calls
47
- */
48
- function getApiVersion() {
49
- return '6.0-preview';
50
- }
51
- exports.getApiVersion = getApiVersion;
52
- function isSuccessStatusCode(statusCode) {
53
- if (!statusCode) {
54
- return false;
55
- }
56
- return statusCode >= 200 && statusCode < 300;
57
- }
58
- exports.isSuccessStatusCode = isSuccessStatusCode;
59
- function isForbiddenStatusCode(statusCode) {
60
- if (!statusCode) {
61
- return false;
62
- }
63
- return statusCode === http_client_1.HttpCodes.Forbidden;
64
- }
65
- exports.isForbiddenStatusCode = isForbiddenStatusCode;
66
- function isRetryableStatusCode(statusCode) {
67
- if (!statusCode) {
68
- return false;
69
- }
70
- const retryableStatusCodes = [
71
- http_client_1.HttpCodes.BadGateway,
72
- http_client_1.HttpCodes.ServiceUnavailable,
73
- http_client_1.HttpCodes.GatewayTimeout,
74
- http_client_1.HttpCodes.TooManyRequests,
75
- 413 // Payload Too Large
76
- ];
77
- return retryableStatusCodes.includes(statusCode);
78
- }
79
- exports.isRetryableStatusCode = isRetryableStatusCode;
80
- function isThrottledStatusCode(statusCode) {
81
- if (!statusCode) {
82
- return false;
83
- }
84
- return statusCode === http_client_1.HttpCodes.TooManyRequests;
85
- }
86
- exports.isThrottledStatusCode = isThrottledStatusCode;
87
- /**
88
- * Attempts to get the retry-after value from a set of http headers. The retry time
89
- * is originally denoted in seconds, so if present, it is converted to milliseconds
90
- * @param headers all the headers received when making an http call
91
- */
92
- function tryGetRetryAfterValueTimeInMilliseconds(headers) {
93
- if (headers['retry-after']) {
94
- const retryTime = Number(headers['retry-after']);
95
- if (!isNaN(retryTime)) {
96
- core_1.info(`Retry-After header is present with a value of ${retryTime}`);
97
- return retryTime * 1000;
98
- }
99
- core_1.info(`Returned retry-after header value: ${retryTime} is non-numeric and cannot be used`);
100
- return undefined;
101
- }
102
- core_1.info(`No retry-after header was found. Dumping all headers for diagnostic purposes`);
103
- // eslint-disable-next-line no-console
104
- console.log(headers);
105
- return undefined;
106
- }
107
- exports.tryGetRetryAfterValueTimeInMilliseconds = tryGetRetryAfterValueTimeInMilliseconds;
108
- function getContentRange(start, end, total) {
109
- // Format: `bytes start-end/fileSize
110
- // start and end are inclusive
111
- // For a 200 byte chunk starting at byte 0:
112
- // Content-Range: bytes 0-199/200
113
- return `bytes ${start}-${end}/${total}`;
114
- }
115
- exports.getContentRange = getContentRange;
116
- /**
117
- * Sets all the necessary headers when downloading an artifact
118
- * @param {string} contentType the type of content being uploaded
119
- * @param {boolean} isKeepAlive is the same connection being used to make multiple calls
120
- * @param {boolean} acceptGzip can we accept a gzip encoded response
121
- * @param {string} acceptType the type of content that we can accept
122
- * @returns appropriate headers to make a specific http call during artifact download
123
- */
124
- function getDownloadHeaders(contentType, isKeepAlive, acceptGzip) {
125
- const requestOptions = {};
126
- if (contentType) {
127
- requestOptions['Content-Type'] = contentType;
128
- }
129
- if (isKeepAlive) {
130
- requestOptions['Connection'] = 'Keep-Alive';
131
- // keep alive for at least 10 seconds before closing the connection
132
- requestOptions['Keep-Alive'] = '10';
133
- }
134
- if (acceptGzip) {
135
- // if we are expecting a response with gzip encoding, it should be using an octet-stream in the accept header
136
- requestOptions['Accept-Encoding'] = 'gzip';
137
- requestOptions['Accept'] = `application/octet-stream;api-version=${getApiVersion()}`;
138
- }
139
- else {
140
- // default to application/json if we are not working with gzip content
141
- requestOptions['Accept'] = `application/json;api-version=${getApiVersion()}`;
142
- }
143
- return requestOptions;
144
- }
145
- exports.getDownloadHeaders = getDownloadHeaders;
146
- /**
147
- * Sets all the necessary headers when uploading an artifact
148
- * @param {string} contentType the type of content being uploaded
149
- * @param {boolean} isKeepAlive is the same connection being used to make multiple calls
150
- * @param {boolean} isGzip is the connection being used to upload GZip compressed content
151
- * @param {number} uncompressedLength the original size of the content if something is being uploaded that has been compressed
152
- * @param {number} contentLength the length of the content that is being uploaded
153
- * @param {string} contentRange the range of the content that is being uploaded
154
- * @returns appropriate headers to make a specific http call during artifact upload
155
- */
156
- function getUploadHeaders(contentType, isKeepAlive, isGzip, uncompressedLength, contentLength, contentRange) {
157
- const requestOptions = {};
158
- requestOptions['Accept'] = `application/json;api-version=${getApiVersion()}`;
159
- if (contentType) {
160
- requestOptions['Content-Type'] = contentType;
161
- }
162
- if (isKeepAlive) {
163
- requestOptions['Connection'] = 'Keep-Alive';
164
- // keep alive for at least 10 seconds before closing the connection
165
- requestOptions['Keep-Alive'] = '10';
166
- }
167
- if (isGzip) {
168
- requestOptions['Content-Encoding'] = 'gzip';
169
- requestOptions['x-tfs-filelength'] = uncompressedLength;
170
- }
171
- if (contentLength) {
172
- requestOptions['Content-Length'] = contentLength;
173
- }
174
- if (contentRange) {
175
- requestOptions['Content-Range'] = contentRange;
176
- }
177
- return requestOptions;
178
- }
179
- exports.getUploadHeaders = getUploadHeaders;
180
- function createHttpClient(userAgent) {
181
- return new http_client_1.HttpClient(userAgent, [
182
- new auth_1.BearerCredentialHandler(config_variables_1.getRuntimeToken())
183
- ]);
184
- }
185
- exports.createHttpClient = createHttpClient;
186
- function getArtifactUrl() {
187
- const artifactUrl = `${config_variables_1.getRuntimeUrl()}_apis/pipelines/workflows/${config_variables_1.getWorkFlowRunId()}/artifacts?api-version=${getApiVersion()}`;
188
- core_1.debug(`Artifact Url: ${artifactUrl}`);
189
- return artifactUrl;
190
- }
191
- exports.getArtifactUrl = getArtifactUrl;
192
- /**
193
- * Uh oh! Something might have gone wrong during either upload or download. The IHtttpClientResponse object contains information
194
- * about the http call that was made by the actions http client. This information might be useful to display for diagnostic purposes, but
195
- * this entire object is really big and most of the information is not really useful. This function takes the response object and displays only
196
- * the information that we want.
197
- *
198
- * Certain information such as the TLSSocket and the Readable state are not really useful for diagnostic purposes so they can be avoided.
199
- * Other information such as the headers, the response code and message might be useful, so this is displayed.
200
- */
201
- function displayHttpDiagnostics(response) {
202
- core_1.info(`##### Begin Diagnostic HTTP information #####
203
- Status Code: ${response.message.statusCode}
204
- Status Message: ${response.message.statusMessage}
205
- Header Information: ${JSON.stringify(response.message.headers, undefined, 2)}
206
- ###### End Diagnostic HTTP information ######`);
207
- }
208
- exports.displayHttpDiagnostics = displayHttpDiagnostics;
209
- /**
210
- * Invalid characters that cannot be in the artifact name or an uploaded file. Will be rejected
211
- * from the server if attempted to be sent over. These characters are not allowed due to limitations with certain
212
- * file systems such as NTFS. To maintain platform-agnostic behavior, all characters that are not supported by an
213
- * individual filesystem/platform will not be supported on all fileSystems/platforms
214
- *
215
- * FilePaths can include characters such as \ and / which are not permitted in the artifact name alone
216
- */
217
- const invalidArtifactFilePathCharacters = ['"', ':', '<', '>', '|', '*', '?'];
218
- const invalidArtifactNameCharacters = [
219
- ...invalidArtifactFilePathCharacters,
220
- '\\',
221
- '/'
222
- ];
223
- /**
224
- * Scans the name of the artifact to make sure there are no illegal characters
225
- */
226
- function checkArtifactName(name) {
227
- if (!name) {
228
- throw new Error(`Artifact name: ${name}, is incorrectly provided`);
229
- }
230
- for (const invalidChar of invalidArtifactNameCharacters) {
231
- if (name.includes(invalidChar)) {
232
- throw new Error(`Artifact name is not valid: ${name}. Contains character: "${invalidChar}". Invalid artifact name characters include: ${invalidArtifactNameCharacters.toString()}.`);
233
- }
234
- }
235
- }
236
- exports.checkArtifactName = checkArtifactName;
237
- /**
238
- * Scans the name of the filePath used to make sure there are no illegal characters
239
- */
240
- function checkArtifactFilePath(path) {
241
- if (!path) {
242
- throw new Error(`Artifact path: ${path}, is incorrectly provided`);
243
- }
244
- for (const invalidChar of invalidArtifactFilePathCharacters) {
245
- if (path.includes(invalidChar)) {
246
- throw new Error(`Artifact path is not valid: ${path}. Contains character: "${invalidChar}". Invalid characters include: ${invalidArtifactFilePathCharacters.toString()}.`);
247
- }
248
- }
249
- }
250
- exports.checkArtifactFilePath = checkArtifactFilePath;
251
- function createDirectoriesForArtifact(directories) {
252
- return __awaiter(this, void 0, void 0, function* () {
253
- for (const directory of directories) {
254
- yield fs_1.promises.mkdir(directory, {
255
- recursive: true
256
- });
257
- }
258
- });
259
- }
260
- exports.createDirectoriesForArtifact = createDirectoriesForArtifact;
261
- function createEmptyFilesForArtifact(emptyFilesToCreate) {
262
- return __awaiter(this, void 0, void 0, function* () {
263
- for (const filePath of emptyFilesToCreate) {
264
- yield (yield fs_1.promises.open(filePath, 'w')).close();
265
- }
266
- });
267
- }
268
- exports.createEmptyFilesForArtifact = createEmptyFilesForArtifact;
269
- function getFileSize(filePath) {
270
- return __awaiter(this, void 0, void 0, function* () {
271
- const stats = yield fs_1.promises.stat(filePath);
272
- core_1.debug(`${filePath} size:(${stats.size}) blksize:(${stats.blksize}) blocks:(${stats.blocks})`);
273
- return stats.size;
274
- });
275
- }
276
- exports.getFileSize = getFileSize;
277
- function rmFile(filePath) {
278
- return __awaiter(this, void 0, void 0, function* () {
279
- yield fs_1.promises.unlink(filePath);
280
- });
281
- }
282
- exports.rmFile = rmFile;
283
- function getProperRetention(retentionInput, retentionSetting) {
284
- if (retentionInput < 0) {
285
- throw new Error('Invalid retention, minimum value is 1.');
286
- }
287
- let retention = retentionInput;
288
- if (retentionSetting) {
289
- const maxRetention = parseInt(retentionSetting);
290
- if (!isNaN(maxRetention) && maxRetention < retention) {
291
- core_1.warning(`Retention days is greater than the max value allowed by the repository setting, reduce retention to ${maxRetention} days`);
292
- retention = maxRetention;
293
- }
294
- }
295
- return retention;
296
- }
297
- exports.getProperRetention = getProperRetention;
298
- function sleep(milliseconds) {
299
- return __awaiter(this, void 0, void 0, function* () {
300
- return new Promise(resolve => setTimeout(resolve, milliseconds));
301
- });
302
- }
303
- exports.sleep = sleep;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const core_1 = require("@actions/core");
13
+ const fs_1 = require("fs");
14
+ const http_client_1 = require("@actions/http-client");
15
+ const auth_1 = require("@actions/http-client/auth");
16
+ const config_variables_1 = require("./config-variables");
17
+ /**
18
+ * Returns a retry time in milliseconds that exponentially gets larger
19
+ * depending on the amount of retries that have been attempted
20
+ */
21
+ function getExponentialRetryTimeInMilliseconds(retryCount) {
22
+ if (retryCount < 0) {
23
+ throw new Error('RetryCount should not be negative');
24
+ }
25
+ else if (retryCount === 0) {
26
+ return config_variables_1.getInitialRetryIntervalInMilliseconds();
27
+ }
28
+ const minTime = config_variables_1.getInitialRetryIntervalInMilliseconds() * config_variables_1.getRetryMultiplier() * retryCount;
29
+ const maxTime = minTime * config_variables_1.getRetryMultiplier();
30
+ // returns a random number between the minTime (inclusive) and the maxTime (exclusive)
31
+ return Math.trunc(Math.random() * (maxTime - minTime) + minTime);
32
+ }
33
+ exports.getExponentialRetryTimeInMilliseconds = getExponentialRetryTimeInMilliseconds;
34
+ /**
35
+ * Parses a env variable that is a number
36
+ */
37
+ function parseEnvNumber(key) {
38
+ const value = Number(process.env[key]);
39
+ if (Number.isNaN(value) || value < 0) {
40
+ return undefined;
41
+ }
42
+ return value;
43
+ }
44
+ exports.parseEnvNumber = parseEnvNumber;
45
+ /**
46
+ * Various utility functions to help with the necessary API calls
47
+ */
48
+ function getApiVersion() {
49
+ return '6.0-preview';
50
+ }
51
+ exports.getApiVersion = getApiVersion;
52
+ function isSuccessStatusCode(statusCode) {
53
+ if (!statusCode) {
54
+ return false;
55
+ }
56
+ return statusCode >= 200 && statusCode < 300;
57
+ }
58
+ exports.isSuccessStatusCode = isSuccessStatusCode;
59
+ function isForbiddenStatusCode(statusCode) {
60
+ if (!statusCode) {
61
+ return false;
62
+ }
63
+ return statusCode === http_client_1.HttpCodes.Forbidden;
64
+ }
65
+ exports.isForbiddenStatusCode = isForbiddenStatusCode;
66
+ function isRetryableStatusCode(statusCode) {
67
+ if (!statusCode) {
68
+ return false;
69
+ }
70
+ const retryableStatusCodes = [
71
+ http_client_1.HttpCodes.BadGateway,
72
+ http_client_1.HttpCodes.GatewayTimeout,
73
+ http_client_1.HttpCodes.InternalServerError,
74
+ http_client_1.HttpCodes.ServiceUnavailable,
75
+ http_client_1.HttpCodes.TooManyRequests,
76
+ 413 // Payload Too Large
77
+ ];
78
+ return retryableStatusCodes.includes(statusCode);
79
+ }
80
+ exports.isRetryableStatusCode = isRetryableStatusCode;
81
+ function isThrottledStatusCode(statusCode) {
82
+ if (!statusCode) {
83
+ return false;
84
+ }
85
+ return statusCode === http_client_1.HttpCodes.TooManyRequests;
86
+ }
87
+ exports.isThrottledStatusCode = isThrottledStatusCode;
88
+ /**
89
+ * Attempts to get the retry-after value from a set of http headers. The retry time
90
+ * is originally denoted in seconds, so if present, it is converted to milliseconds
91
+ * @param headers all the headers received when making an http call
92
+ */
93
+ function tryGetRetryAfterValueTimeInMilliseconds(headers) {
94
+ if (headers['retry-after']) {
95
+ const retryTime = Number(headers['retry-after']);
96
+ if (!isNaN(retryTime)) {
97
+ core_1.info(`Retry-After header is present with a value of ${retryTime}`);
98
+ return retryTime * 1000;
99
+ }
100
+ core_1.info(`Returned retry-after header value: ${retryTime} is non-numeric and cannot be used`);
101
+ return undefined;
102
+ }
103
+ core_1.info(`No retry-after header was found. Dumping all headers for diagnostic purposes`);
104
+ // eslint-disable-next-line no-console
105
+ console.log(headers);
106
+ return undefined;
107
+ }
108
+ exports.tryGetRetryAfterValueTimeInMilliseconds = tryGetRetryAfterValueTimeInMilliseconds;
109
+ function getContentRange(start, end, total) {
110
+ // Format: `bytes start-end/fileSize
111
+ // start and end are inclusive
112
+ // For a 200 byte chunk starting at byte 0:
113
+ // Content-Range: bytes 0-199/200
114
+ return `bytes ${start}-${end}/${total}`;
115
+ }
116
+ exports.getContentRange = getContentRange;
117
+ /**
118
+ * Sets all the necessary headers when downloading an artifact
119
+ * @param {string} contentType the type of content being uploaded
120
+ * @param {boolean} isKeepAlive is the same connection being used to make multiple calls
121
+ * @param {boolean} acceptGzip can we accept a gzip encoded response
122
+ * @param {string} acceptType the type of content that we can accept
123
+ * @returns appropriate headers to make a specific http call during artifact download
124
+ */
125
+ function getDownloadHeaders(contentType, isKeepAlive, acceptGzip) {
126
+ const requestOptions = {};
127
+ if (contentType) {
128
+ requestOptions['Content-Type'] = contentType;
129
+ }
130
+ if (isKeepAlive) {
131
+ requestOptions['Connection'] = 'Keep-Alive';
132
+ // keep alive for at least 10 seconds before closing the connection
133
+ requestOptions['Keep-Alive'] = '10';
134
+ }
135
+ if (acceptGzip) {
136
+ // if we are expecting a response with gzip encoding, it should be using an octet-stream in the accept header
137
+ requestOptions['Accept-Encoding'] = 'gzip';
138
+ requestOptions['Accept'] = `application/octet-stream;api-version=${getApiVersion()}`;
139
+ }
140
+ else {
141
+ // default to application/json if we are not working with gzip content
142
+ requestOptions['Accept'] = `application/json;api-version=${getApiVersion()}`;
143
+ }
144
+ return requestOptions;
145
+ }
146
+ exports.getDownloadHeaders = getDownloadHeaders;
147
+ /**
148
+ * Sets all the necessary headers when uploading an artifact
149
+ * @param {string} contentType the type of content being uploaded
150
+ * @param {boolean} isKeepAlive is the same connection being used to make multiple calls
151
+ * @param {boolean} isGzip is the connection being used to upload GZip compressed content
152
+ * @param {number} uncompressedLength the original size of the content if something is being uploaded that has been compressed
153
+ * @param {number} contentLength the length of the content that is being uploaded
154
+ * @param {string} contentRange the range of the content that is being uploaded
155
+ * @returns appropriate headers to make a specific http call during artifact upload
156
+ */
157
+ function getUploadHeaders(contentType, isKeepAlive, isGzip, uncompressedLength, contentLength, contentRange) {
158
+ const requestOptions = {};
159
+ requestOptions['Accept'] = `application/json;api-version=${getApiVersion()}`;
160
+ if (contentType) {
161
+ requestOptions['Content-Type'] = contentType;
162
+ }
163
+ if (isKeepAlive) {
164
+ requestOptions['Connection'] = 'Keep-Alive';
165
+ // keep alive for at least 10 seconds before closing the connection
166
+ requestOptions['Keep-Alive'] = '10';
167
+ }
168
+ if (isGzip) {
169
+ requestOptions['Content-Encoding'] = 'gzip';
170
+ requestOptions['x-tfs-filelength'] = uncompressedLength;
171
+ }
172
+ if (contentLength) {
173
+ requestOptions['Content-Length'] = contentLength;
174
+ }
175
+ if (contentRange) {
176
+ requestOptions['Content-Range'] = contentRange;
177
+ }
178
+ return requestOptions;
179
+ }
180
+ exports.getUploadHeaders = getUploadHeaders;
181
+ function createHttpClient(userAgent) {
182
+ return new http_client_1.HttpClient(userAgent, [
183
+ new auth_1.BearerCredentialHandler(config_variables_1.getRuntimeToken())
184
+ ]);
185
+ }
186
+ exports.createHttpClient = createHttpClient;
187
+ function getArtifactUrl() {
188
+ const artifactUrl = `${config_variables_1.getRuntimeUrl()}_apis/pipelines/workflows/${config_variables_1.getWorkFlowRunId()}/artifacts?api-version=${getApiVersion()}`;
189
+ core_1.debug(`Artifact Url: ${artifactUrl}`);
190
+ return artifactUrl;
191
+ }
192
+ exports.getArtifactUrl = getArtifactUrl;
193
+ /**
194
+ * Uh oh! Something might have gone wrong during either upload or download. The IHtttpClientResponse object contains information
195
+ * about the http call that was made by the actions http client. This information might be useful to display for diagnostic purposes, but
196
+ * this entire object is really big and most of the information is not really useful. This function takes the response object and displays only
197
+ * the information that we want.
198
+ *
199
+ * Certain information such as the TLSSocket and the Readable state are not really useful for diagnostic purposes so they can be avoided.
200
+ * Other information such as the headers, the response code and message might be useful, so this is displayed.
201
+ */
202
+ function displayHttpDiagnostics(response) {
203
+ core_1.info(`##### Begin Diagnostic HTTP information #####
204
+ Status Code: ${response.message.statusCode}
205
+ Status Message: ${response.message.statusMessage}
206
+ Header Information: ${JSON.stringify(response.message.headers, undefined, 2)}
207
+ ###### End Diagnostic HTTP information ######`);
208
+ }
209
+ exports.displayHttpDiagnostics = displayHttpDiagnostics;
210
+ function createDirectoriesForArtifact(directories) {
211
+ return __awaiter(this, void 0, void 0, function* () {
212
+ for (const directory of directories) {
213
+ yield fs_1.promises.mkdir(directory, {
214
+ recursive: true
215
+ });
216
+ }
217
+ });
218
+ }
219
+ exports.createDirectoriesForArtifact = createDirectoriesForArtifact;
220
+ function createEmptyFilesForArtifact(emptyFilesToCreate) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ for (const filePath of emptyFilesToCreate) {
223
+ yield (yield fs_1.promises.open(filePath, 'w')).close();
224
+ }
225
+ });
226
+ }
227
+ exports.createEmptyFilesForArtifact = createEmptyFilesForArtifact;
228
+ function getFileSize(filePath) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ const stats = yield fs_1.promises.stat(filePath);
231
+ core_1.debug(`${filePath} size:(${stats.size}) blksize:(${stats.blksize}) blocks:(${stats.blocks})`);
232
+ return stats.size;
233
+ });
234
+ }
235
+ exports.getFileSize = getFileSize;
236
+ function rmFile(filePath) {
237
+ return __awaiter(this, void 0, void 0, function* () {
238
+ yield fs_1.promises.unlink(filePath);
239
+ });
240
+ }
241
+ exports.rmFile = rmFile;
242
+ function getProperRetention(retentionInput, retentionSetting) {
243
+ if (retentionInput < 0) {
244
+ throw new Error('Invalid retention, minimum value is 1.');
245
+ }
246
+ let retention = retentionInput;
247
+ if (retentionSetting) {
248
+ const maxRetention = parseInt(retentionSetting);
249
+ if (!isNaN(maxRetention) && maxRetention < retention) {
250
+ core_1.warning(`Retention days is greater than the max value allowed by the repository setting, reduce retention to ${maxRetention} days`);
251
+ retention = maxRetention;
252
+ }
253
+ }
254
+ return retention;
255
+ }
256
+ exports.getProperRetention = getProperRetention;
257
+ function sleep(milliseconds) {
258
+ return __awaiter(this, void 0, void 0, function* () {
259
+ return new Promise(resolve => setTimeout(resolve, milliseconds));
260
+ });
261
+ }
262
+ exports.sleep = sleep;
304
263
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAAkD;AAClD,2BAAiC;AACjC,sDAA0D;AAC1D,oDAAiE;AAGjE,yDAM2B;AAE3B;;;GAGG;AACH,SAAgB,qCAAqC,CACnD,UAAkB;IAElB,IAAI,UAAU,GAAG,CAAC,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;KACrD;SAAM,IAAI,UAAU,KAAK,CAAC,EAAE;QAC3B,OAAO,wDAAqC,EAAE,CAAA;KAC/C;IAED,MAAM,OAAO,GACX,wDAAqC,EAAE,GAAG,qCAAkB,EAAE,GAAG,UAAU,CAAA;IAC7E,MAAM,OAAO,GAAG,OAAO,GAAG,qCAAkB,EAAE,CAAA;IAE9C,sFAAsF;IACtF,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,OAAO,CAAA;AACtD,CAAC;AAfD,sFAeC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACtC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE;QACpC,OAAO,SAAS,CAAA;KACjB;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAND,wCAMC;AAED;;GAEG;AACH,SAAgB,aAAa;IAC3B,OAAO,aAAa,CAAA;AACtB,CAAC;AAFD,sCAEC;AAED,SAAgB,mBAAmB,CAAC,UAAmB;IACrD,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,KAAK,CAAA;KACb;IACD,OAAO,UAA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