Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f236b725b0 | |||
| 771f20b061 | |||
| 12fa0be194 | |||
| 7e8f13b4e6 | |||
| 6a61612f93 | |||
| e5fc7ccac7 | |||
| 898dd8c2a1 | |||
| 39a7ba7bbd | |||
| a3d4efa112 | |||
| 3ee6b4b169 | |||
| 68ccf88d4e | |||
| d321d78c4b | |||
| b4363a79ae | |||
| 962fd91d75 | |||
| 4be2423559 | |||
| 95cf02468e | |||
| 4dfce941f1 | |||
| 6e48b0cfed | |||
| c24983bf08 |
+7
-44
@@ -1,13 +1,6 @@
|
|||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": ["jest", "@typescript-eslint"],
|
||||||
"jest",
|
"extends": ["plugin:github/recommended"],
|
||||||
"@typescript-eslint",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"extends": [
|
|
||||||
"plugin:github/recommended",
|
|
||||||
"plugin:prettier/recommended"
|
|
||||||
],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 9,
|
"ecmaVersion": 9,
|
||||||
@@ -15,33 +8,14 @@
|
|||||||
"project": "./tsconfig.eslint.json"
|
"project": "./tsconfig.eslint.json"
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"prettier/prettier": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"endOfLine": "auto"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"eslint-comments/no-use": "off",
|
"eslint-comments/no-use": "off",
|
||||||
"no-constant-condition": ["error", { "checkLoops": false }],
|
|
||||||
"github/no-then": "off",
|
"github/no-then": "off",
|
||||||
"import/no-namespace": "off",
|
"import/no-namespace": "off",
|
||||||
"no-shadow": "off",
|
"no-shadow": "off",
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"i18n-text/no-en": "off",
|
|
||||||
"filenames/match-regex": "off",
|
|
||||||
"import/no-commonjs": "off",
|
|
||||||
"import/named": "off",
|
|
||||||
"no-sequences": "off",
|
|
||||||
"import/no-unresolved": "off",
|
|
||||||
"no-undef": "off",
|
"no-undef": "off",
|
||||||
"no-only-tests/no-only-tests": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
"@typescript-eslint/no-unused-vars": "error",
|
||||||
"@typescript-eslint/explicit-member-accessibility": [
|
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"accessibility": "no-public"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-require-imports": "error",
|
"@typescript-eslint/no-require-imports": "error",
|
||||||
"@typescript-eslint/array-type": "error",
|
"@typescript-eslint/array-type": "error",
|
||||||
"@typescript-eslint/await-thenable": "error",
|
"@typescript-eslint/await-thenable": "error",
|
||||||
@@ -49,16 +23,8 @@
|
|||||||
"camelcase": "off",
|
"camelcase": "off",
|
||||||
"@typescript-eslint/camelcase": "off",
|
"@typescript-eslint/camelcase": "off",
|
||||||
"@typescript-eslint/consistent-type-assertions": "off",
|
"@typescript-eslint/consistent-type-assertions": "off",
|
||||||
"@typescript-eslint/explicit-function-return-type": [
|
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
|
||||||
"error",
|
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
||||||
{
|
|
||||||
"allowExpressions": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/func-call-spacing": [
|
|
||||||
"error",
|
|
||||||
"never"
|
|
||||||
],
|
|
||||||
"@typescript-eslint/naming-convention": [
|
"@typescript-eslint/naming-convention": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
@@ -90,15 +56,12 @@
|
|||||||
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
||||||
"@typescript-eslint/promise-function-async": "error",
|
"@typescript-eslint/promise-function-async": "error",
|
||||||
"@typescript-eslint/require-array-sort-compare": "error",
|
"@typescript-eslint/require-array-sort-compare": "error",
|
||||||
|
"@typescript-eslint/restrict-plus-operands": "error",
|
||||||
"semi": "off",
|
"semi": "off",
|
||||||
"@typescript-eslint/semi": [
|
"@typescript-eslint/semi": ["error", "never"],
|
||||||
"error",
|
|
||||||
"never"
|
|
||||||
],
|
|
||||||
"@typescript-eslint/type-annotation-spacing": "error",
|
"@typescript-eslint/type-annotation-spacing": "error",
|
||||||
"@typescript-eslint/unbound-method": "error"
|
"@typescript-eslint/unbound-method": "error"
|
||||||
},
|
},
|
||||||
"ignorePatterns": "packages/glob/__tests__/_temp/**/",
|
|
||||||
"env": {
|
"env": {
|
||||||
"node": true,
|
"node": true,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Note that before a PR will be accepted, you must ensure:
|
|||||||
|
|
||||||
### Useful Scripts
|
### Useful Scripts
|
||||||
|
|
||||||
- `npm run bootstrap` This runs `lerna exec -- npm install` which will install dependencies in this repository's packages and cross-link packages where necessary.
|
- `npm run bootstrap` This runs `lerna bootstrap` which will install dependencies in this repository's packages and cross-link packages where necessary.
|
||||||
- `npm run build` This compiles TypeScript code in each package (this is especially important if one package relies on changes in another when you're running tests). This is just an alias for `lerna run tsc`.
|
- `npm run build` This compiles TypeScript code in each package (this is especially important if one package relies on changes in another when you're running tests). This is just an alias for `lerna run tsc`.
|
||||||
- `npm run format` This checks that formatting has been applied with Prettier.
|
- `npm run format` This checks that formatting has been applied with Prettier.
|
||||||
- `npm test` This runs all Jest tests in all packages in this repository.
|
- `npm test` This runs all Jest tests in all packages in this repository.
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# Temporarily disabled while v2.0.0 of @actions/artifact is under development
|
|
||||||
|
|
||||||
name: artifact-unit-tests
|
name: artifact-unit-tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
rm "C:\Program Files\Git\usr\bin\tar.exe"
|
rm "C:\Program Files\Git\usr\bin\tar.exe"
|
||||||
|
|
||||||
- name: Set Node.js 16.x
|
- name: Set Node.js 12.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 12.x
|
||||||
|
|
||||||
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
|
||||||
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
# node context. This runs a local action that gets and sets the necessary env variables that are needed
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
packages/*/node_modules/
|
packages/*/node_modules/
|
||||||
packages/*/lib/
|
packages/*/lib/
|
||||||
packages/glob/__tests__/_temp/**/
|
|
||||||
+1
-2
@@ -7,6 +7,5 @@
|
|||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"bracketSpacing": false,
|
"bracketSpacing": false,
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "avoid",
|
||||||
"parser": "typescript",
|
"parser": "typescript"
|
||||||
"endOfLine": "auto"
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/**/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"version": "independent"
|
"version": "independent"
|
||||||
}
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"tasksRunnerOptions": {
|
|
||||||
"default": {
|
|
||||||
"runner": "nx/tasks-runners/default",
|
|
||||||
"options": {
|
|
||||||
"cacheableOperations": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"affected": {
|
|
||||||
"defaultBase": "master"
|
|
||||||
},
|
|
||||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
|
||||||
"namedInputs": {
|
|
||||||
"default": [
|
|
||||||
"{projectRoot}/**/*",
|
|
||||||
"sharedGlobals"
|
|
||||||
],
|
|
||||||
"sharedGlobals": [],
|
|
||||||
"production": [
|
|
||||||
"default"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
+22765
-6109
File diff suppressed because it is too large
Load Diff
+7
-11
@@ -3,10 +3,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"audit-all": "lerna run audit-moderate",
|
"audit-all": "lerna run audit-moderate",
|
||||||
"bootstrap": "lerna exec -- npm install",
|
"bootstrap": "lerna bootstrap",
|
||||||
"build": "lerna run tsc",
|
"build": "lerna run tsc",
|
||||||
"clean": "lerna clean",
|
|
||||||
"repair": "lerna repair",
|
|
||||||
"check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:test\" \"npm:build -- -- --noEmit\"",
|
"check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:test\" \"npm:build -- -- --noEmit\"",
|
||||||
"format": "prettier --write packages/**/*.ts",
|
"format": "prettier --write packages/**/*.ts",
|
||||||
"format-check": "prettier --check packages/**/*.ts",
|
"format-check": "prettier --check packages/**/*.ts",
|
||||||
@@ -19,17 +17,15 @@
|
|||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
"@types/node": "^16.18.1",
|
"@types/node": "^16.18.1",
|
||||||
"@types/signale": "^1.4.1",
|
"@types/signale": "^1.4.1",
|
||||||
|
"@typescript-eslint/parser": "^4.0.0",
|
||||||
"concurrently": "^6.1.0",
|
"concurrently": "^6.1.0",
|
||||||
"eslint": "^8.0.1",
|
"eslint": "^7.23.0",
|
||||||
"eslint-config-prettier": "^8.9.0",
|
"eslint-plugin-github": "^4.1.3",
|
||||||
"eslint-plugin-github": "^4.9.2",
|
"eslint-plugin-jest": "^22.21.0",
|
||||||
"eslint-plugin-jest": "^27.2.3",
|
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
|
||||||
"flow-bin": "^0.115.0",
|
"flow-bin": "^0.115.0",
|
||||||
"jest": "^27.2.5",
|
"jest": "^27.2.5",
|
||||||
"lerna": "^7.1.4",
|
"lerna": "^5.4.0",
|
||||||
"nx": "16.6.0",
|
"prettier": "^1.19.1",
|
||||||
"prettier": "^3.0.0",
|
|
||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^3.9.9"
|
"typescript": "^3.9.9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,94 @@
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
You can use this package to interact with the Actions artifacts.
|
You can use this package to interact with the actions artifacts.
|
||||||
|
- [Upload an Artifact](#Upload-an-Artifact)
|
||||||
|
- [Download a Single Artifact](#Download-a-Single-Artifact)
|
||||||
|
- [Download All Artifacts](#Download-all-Artifacts)
|
||||||
|
- [Additional Documentation](#Additional-Documentation)
|
||||||
|
- [Contributions](#Contributions)
|
||||||
|
|
||||||
This most recently published version of this package (`1.1.1`) can be found [here](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.1/packages/artifact)
|
Relative paths and absolute paths are both allowed. Relative paths are rooted against the current working directory.
|
||||||
|
|
||||||
## 🚧 Under construction 🚧
|
## Upload an Artifact
|
||||||
|
|
||||||
This package is currently undergoing a major overhaul in preparation for `v4` versions of `upload-artifact` and `download-artifact` (these Actions will use a new `2.0.0` version of `@actions/artifact` that will soon be released). The upcoming version of `@actions/artifact` will take advantage of a major re-architecture with entirely new APIs.
|
Method Name: `uploadArtifact`
|
||||||
|
|
||||||
The upcoming `2.0.0` package and `v4` artifact Actions aim to solve some of the major pain-points that have made artifact usage difficult up until now.
|
#### Inputs
|
||||||
|
- `name`
|
||||||
|
- The name of the artifact that is being uploaded
|
||||||
|
- Required
|
||||||
|
- `files`
|
||||||
|
- A list of file paths that describe what should be uploaded as part of the artifact
|
||||||
|
- If a path is provided that does not exist, an error will be thrown
|
||||||
|
- Can be absolute or relative. Internally everything is normalized and resolved
|
||||||
|
- Required
|
||||||
|
- `rootDirectory`
|
||||||
|
- A file path that denotes the root directory of the files being uploaded. This path is used to strip the paths provided in `files` to control how they are uploaded and structured
|
||||||
|
- If a file specified in `files` is not in the `rootDirectory`, an error will be thrown
|
||||||
|
- Required
|
||||||
|
- `options`
|
||||||
|
- Extra options that allow for the customization of the upload behavior
|
||||||
|
- Optional
|
||||||
|
|
||||||
|
#### Available Options
|
||||||
|
|
||||||
|
- `retentionDays`
|
||||||
|
- Duration after which artifact will expire in days
|
||||||
|
- Minimum value: 1
|
||||||
|
- Maximum value: 90 unless changed by repository setting
|
||||||
|
- If this is set to a greater value than the retention settings allowed, the retention on artifacts will be reduced to match the max value allowed on the server, and the upload process will continue. An input of 0 assumes default retention value.
|
||||||
|
|
||||||
|
#### Example using Absolute File Paths
|
||||||
|
|
||||||
|
```js
|
||||||
|
const artifact = require('@actions/artifact');
|
||||||
|
const artifactClient = artifact.create()
|
||||||
|
const artifactName = 'my-artifact';
|
||||||
|
const files = [
|
||||||
|
'/home/user/files/plz-upload/file1.txt',
|
||||||
|
'/home/user/files/plz-upload/file2.txt',
|
||||||
|
'/home/user/files/plz-upload/dir/file3.txt'
|
||||||
|
]
|
||||||
|
const rootDirectory = '/home/user/files/plz-upload'
|
||||||
|
const options = {
|
||||||
|
continueOnError: true
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadResult = await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Example using Relative File Paths
|
||||||
|
```js
|
||||||
|
// Assuming the current working directory is /home/user/files/plz-upload
|
||||||
|
const artifact = require('@actions/artifact');
|
||||||
|
const artifactClient = artifact.create()
|
||||||
|
const artifactName = 'my-artifact';
|
||||||
|
const files = [
|
||||||
|
'file1.txt',
|
||||||
|
'file2.txt',
|
||||||
|
'dir/file3.txt'
|
||||||
|
]
|
||||||
|
|
||||||
|
const rootDirectory = '.' // Also possible to use __dirname
|
||||||
|
const options = {
|
||||||
|
continueOnError: false
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadResponse = await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Upload Result
|
||||||
|
|
||||||
|
The returned `UploadResponse` will contain the following information
|
||||||
|
|
||||||
|
- `artifactName`
|
||||||
|
- The name of the artifact that was uploaded
|
||||||
|
- `size`
|
||||||
|
- Total size of the artifact that was uploaded in bytes
|
||||||
|
|
||||||
|
## Contributions
|
||||||
|
|
||||||
|
See [contributor guidelines](https://github.com/actions/toolkit/blob/main/.github/CONTRIBUTING.md) for general guidelines and information about toolkit contributions.
|
||||||
|
|
||||||
|
For contributions related to this package, see [artifact contributions](CONTRIBUTIONS.md) for more information.
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
name: 'Set env variables'
|
||||||
|
description: 'Sets certain env variables so that e2e artifact upload and download can be tested in a shell'
|
||||||
|
runs:
|
||||||
|
using: 'node12'
|
||||||
|
main: 'index.js'
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// Certain env variables are not set by default in a shell context and are only available in a node context from a running action
|
||||||
|
// In order to be able to upload and download artifacts e2e in a shell when running CI tests, we need these env variables set
|
||||||
|
const fs = require('fs');
|
||||||
|
const os = require('os');
|
||||||
|
const filePath = process.env[`GITHUB_ENV`]
|
||||||
|
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_URL=${process.env.ACTIONS_RUNTIME_URL}${os.EOL}`, {
|
||||||
|
encoding: 'utf8'
|
||||||
|
})
|
||||||
|
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_TOKEN=${process.env.ACTIONS_RUNTIME_TOKEN}${os.EOL}`, {
|
||||||
|
encoding: 'utf8'
|
||||||
|
})
|
||||||
|
fs.appendFileSync(filePath, `GITHUB_RUN_ID=${process.env.GITHUB_RUN_ID}${os.EOL}`, {
|
||||||
|
encoding: 'utf8'
|
||||||
|
})
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
import {
|
|
||||||
validateArtifactName,
|
|
||||||
validateFilePath
|
|
||||||
} from '../src/internal/upload/path-and-artifact-name-validation'
|
|
||||||
|
|
||||||
import * as core from '@actions/core'
|
|
||||||
|
|
||||||
describe('Path and artifact name validation', () => {
|
|
||||||
beforeAll(() => {
|
|
||||||
// mock all output so that there is less noise when running tests
|
|
||||||
jest.spyOn(console, 'log').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'debug').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'info').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Check Artifact Name for any invalid characters', () => {
|
|
||||||
const invalidNames = [
|
|
||||||
'my\\artifact',
|
|
||||||
'my/artifact',
|
|
||||||
'my"artifact',
|
|
||||||
'my:artifact',
|
|
||||||
'my<artifact',
|
|
||||||
'my>artifact',
|
|
||||||
'my|artifact',
|
|
||||||
'my*artifact',
|
|
||||||
'my?artifact',
|
|
||||||
''
|
|
||||||
]
|
|
||||||
for (const invalidName of invalidNames) {
|
|
||||||
expect(() => {
|
|
||||||
validateArtifactName(invalidName)
|
|
||||||
}).toThrow()
|
|
||||||
}
|
|
||||||
|
|
||||||
const validNames = [
|
|
||||||
'my-normal-artifact',
|
|
||||||
'myNormalArtifact',
|
|
||||||
'm¥ñðrmålÄr†ï£å¢†'
|
|
||||||
]
|
|
||||||
for (const validName of validNames) {
|
|
||||||
expect(() => {
|
|
||||||
validateArtifactName(validName)
|
|
||||||
}).not.toThrow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Check Artifact File Path for any invalid characters', () => {
|
|
||||||
const invalidNames = [
|
|
||||||
'some/invalid"artifact/path',
|
|
||||||
'some/invalid:artifact/path',
|
|
||||||
'some/invalid<artifact/path',
|
|
||||||
'some/invalid>artifact/path',
|
|
||||||
'some/invalid|artifact/path',
|
|
||||||
'some/invalid*artifact/path',
|
|
||||||
'some/invalid?artifact/path',
|
|
||||||
'some/invalid\rartifact/path',
|
|
||||||
'some/invalid\nartifact/path',
|
|
||||||
'some/invalid\r\nartifact/path',
|
|
||||||
''
|
|
||||||
]
|
|
||||||
for (const invalidName of invalidNames) {
|
|
||||||
expect(() => {
|
|
||||||
validateFilePath(invalidName)
|
|
||||||
}).toThrow()
|
|
||||||
}
|
|
||||||
|
|
||||||
const validNames = [
|
|
||||||
'my/perfectly-normal/artifact-path',
|
|
||||||
'my/perfectly\\Normal/Artifact-path',
|
|
||||||
'm¥/ñðrmål/Är†ï£å¢†'
|
|
||||||
]
|
|
||||||
for (const validName of validNames) {
|
|
||||||
expect(() => {
|
|
||||||
validateFilePath(validName)
|
|
||||||
}).not.toThrow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
path="$1"
|
||||||
|
expectedContent="$2"
|
||||||
|
|
||||||
|
if [ "$path" == "" ]; then
|
||||||
|
echo "File path not provided"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$expectedContent" == "" ]; then
|
||||||
|
echo "Expected file contents not provided"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$path" ]; then
|
||||||
|
echo "Expected file $path does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
actualContent=$(cat "$path")
|
||||||
|
if [ "$expectedContent" == "_EMPTY_" ] && [ ! -s "$path" ]; then
|
||||||
|
exit 0
|
||||||
|
elif [ "$actualContent" != "$expectedContent" ]; then
|
||||||
|
echo "File contents are not correct, expected $expectedContent, received $actualContent"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -1,312 +0,0 @@
|
|||||||
import * as io from '../../io/src/io'
|
|
||||||
import * as path from 'path'
|
|
||||||
import {promises as fs} from 'fs'
|
|
||||||
import * as core from '@actions/core'
|
|
||||||
import {
|
|
||||||
getUploadZipSpecification,
|
|
||||||
validateRootDirectory
|
|
||||||
} from '../src/internal/upload/upload-zip-specification'
|
|
||||||
|
|
||||||
const root = path.join(__dirname, '_temp', 'upload-specification')
|
|
||||||
const goodItem1Path = path.join(
|
|
||||||
root,
|
|
||||||
'folder-a',
|
|
||||||
'folder-b',
|
|
||||||
'folder-c',
|
|
||||||
'good-item1.txt'
|
|
||||||
)
|
|
||||||
const goodItem2Path = path.join(root, 'folder-d', 'good-item2.txt')
|
|
||||||
const goodItem3Path = path.join(root, 'folder-d', 'good-item3.txt')
|
|
||||||
const goodItem4Path = path.join(root, 'folder-d', 'good-item4.txt')
|
|
||||||
const goodItem5Path = path.join(root, 'good-item5.txt')
|
|
||||||
const badItem1Path = path.join(
|
|
||||||
root,
|
|
||||||
'folder-a',
|
|
||||||
'folder-b',
|
|
||||||
'folder-c',
|
|
||||||
'bad-item1.txt'
|
|
||||||
)
|
|
||||||
const badItem2Path = path.join(root, 'folder-d', 'bad-item2.txt')
|
|
||||||
const badItem3Path = path.join(root, 'folder-f', 'bad-item3.txt')
|
|
||||||
const badItem4Path = path.join(root, 'folder-h', 'folder-i', 'bad-item4.txt')
|
|
||||||
const badItem5Path = path.join(root, 'folder-h', 'folder-i', 'bad-item5.txt')
|
|
||||||
const extraFileInFolderCPath = path.join(
|
|
||||||
root,
|
|
||||||
'folder-a',
|
|
||||||
'folder-b',
|
|
||||||
'folder-c',
|
|
||||||
'extra-file-in-folder-c.txt'
|
|
||||||
)
|
|
||||||
const amazingFileInFolderHPath = path.join(root, 'folder-h', 'amazing-item.txt')
|
|
||||||
|
|
||||||
const artifactFilesToUpload = [
|
|
||||||
goodItem1Path,
|
|
||||||
goodItem2Path,
|
|
||||||
goodItem3Path,
|
|
||||||
goodItem4Path,
|
|
||||||
goodItem5Path,
|
|
||||||
extraFileInFolderCPath,
|
|
||||||
amazingFileInFolderHPath
|
|
||||||
]
|
|
||||||
|
|
||||||
describe('Search', () => {
|
|
||||||
beforeAll(async () => {
|
|
||||||
// mock all output so that there is less noise when running tests
|
|
||||||
jest.spyOn(console, 'log').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'debug').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'info').mockImplementation(() => {})
|
|
||||||
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
|
||||||
|
|
||||||
// clear temp directory
|
|
||||||
await io.rmRF(root)
|
|
||||||
await fs.mkdir(path.join(root, 'folder-a', 'folder-b', 'folder-c'), {
|
|
||||||
recursive: true
|
|
||||||
})
|
|
||||||
await fs.mkdir(path.join(root, 'folder-a', 'folder-b', 'folder-e'), {
|
|
||||||
recursive: true
|
|
||||||
})
|
|
||||||
await fs.mkdir(path.join(root, 'folder-d'), {
|
|
||||||
recursive: true
|
|
||||||
})
|
|
||||||
await fs.mkdir(path.join(root, 'folder-f'), {
|
|
||||||
recursive: true
|
|
||||||
})
|
|
||||||
await fs.mkdir(path.join(root, 'folder-g'), {
|
|
||||||
recursive: true
|
|
||||||
})
|
|
||||||
await fs.mkdir(path.join(root, 'folder-h', 'folder-i'), {
|
|
||||||
recursive: true
|
|
||||||
})
|
|
||||||
|
|
||||||
await fs.writeFile(goodItem1Path, 'good item1 file')
|
|
||||||
await fs.writeFile(goodItem2Path, 'good item2 file')
|
|
||||||
await fs.writeFile(goodItem3Path, 'good item3 file')
|
|
||||||
await fs.writeFile(goodItem4Path, 'good item4 file')
|
|
||||||
await fs.writeFile(goodItem5Path, 'good item5 file')
|
|
||||||
|
|
||||||
await fs.writeFile(badItem1Path, 'bad item1 file')
|
|
||||||
await fs.writeFile(badItem2Path, 'bad item2 file')
|
|
||||||
await fs.writeFile(badItem3Path, 'bad item3 file')
|
|
||||||
await fs.writeFile(badItem4Path, 'bad item4 file')
|
|
||||||
await fs.writeFile(badItem5Path, 'bad item5 file')
|
|
||||||
|
|
||||||
await fs.writeFile(extraFileInFolderCPath, 'extra file')
|
|
||||||
|
|
||||||
await fs.writeFile(amazingFileInFolderHPath, 'amazing file')
|
|
||||||
/*
|
|
||||||
Directory structure of files that get created:
|
|
||||||
root/
|
|
||||||
folder-a/
|
|
||||||
folder-b/
|
|
||||||
folder-c/
|
|
||||||
good-item1.txt
|
|
||||||
bad-item1.txt
|
|
||||||
extra-file-in-folder-c.txt
|
|
||||||
folder-e/
|
|
||||||
folder-d/
|
|
||||||
good-item2.txt
|
|
||||||
good-item3.txt
|
|
||||||
good-item4.txt
|
|
||||||
bad-item2.txt
|
|
||||||
folder-f/
|
|
||||||
bad-item3.txt
|
|
||||||
folder-g/
|
|
||||||
folder-h/
|
|
||||||
amazing-item.txt
|
|
||||||
folder-i/
|
|
||||||
bad-item4.txt
|
|
||||||
bad-item5.txt
|
|
||||||
good-item5.txt
|
|
||||||
*/
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Upload Specification - Fail non-existent rootDirectory', async () => {
|
|
||||||
const invalidRootDirectory = path.join(
|
|
||||||
__dirname,
|
|
||||||
'_temp',
|
|
||||||
'upload-specification-invalid'
|
|
||||||
)
|
|
||||||
expect(() => {
|
|
||||||
validateRootDirectory(invalidRootDirectory)
|
|
||||||
}).toThrow(
|
|
||||||
`The provided rootDirectory ${invalidRootDirectory} does not exist`
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Upload Specification - Fail invalid rootDirectory', async () => {
|
|
||||||
expect(() => {
|
|
||||||
validateRootDirectory(goodItem1Path)
|
|
||||||
}).toThrow(
|
|
||||||
`The provided rootDirectory ${goodItem1Path} is not a valid directory`
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Upload Specification - File does not exist', async () => {
|
|
||||||
const fakeFilePath = path.join(
|
|
||||||
'folder-a',
|
|
||||||
'folder-b',
|
|
||||||
'non-existent-file.txt'
|
|
||||||
)
|
|
||||||
expect(() => {
|
|
||||||
getUploadZipSpecification([fakeFilePath], root)
|
|
||||||
}).toThrow(`File ${fakeFilePath} does not exist`)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Upload Specification - Non parent directory', async () => {
|
|
||||||
const folderADirectory = path.join(root, 'folder-a')
|
|
||||||
const artifactFiles = [
|
|
||||||
goodItem1Path,
|
|
||||||
badItem1Path,
|
|
||||||
extraFileInFolderCPath,
|
|
||||||
goodItem5Path
|
|
||||||
]
|
|
||||||
expect(() => {
|
|
||||||
getUploadZipSpecification(artifactFiles, folderADirectory)
|
|
||||||
}).toThrow(
|
|
||||||
`The rootDirectory: ${folderADirectory} is not a parent directory of the file: ${goodItem5Path}`
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Upload Specification - Success', async () => {
|
|
||||||
const specifications = getUploadZipSpecification(
|
|
||||||
artifactFilesToUpload,
|
|
||||||
root
|
|
||||||
)
|
|
||||||
expect(specifications.length).toEqual(7)
|
|
||||||
|
|
||||||
const absolutePaths = specifications.map(item => item.sourcePath)
|
|
||||||
expect(absolutePaths).toContain(goodItem1Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem2Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem3Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem4Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem5Path)
|
|
||||||
expect(absolutePaths).toContain(extraFileInFolderCPath)
|
|
||||||
expect(absolutePaths).toContain(amazingFileInFolderHPath)
|
|
||||||
|
|
||||||
for (const specification of specifications) {
|
|
||||||
if (specification.sourcePath === goodItem1Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-a', 'folder-b', 'folder-c', 'good-item1.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem2Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-d', 'good-item2.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem3Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-d', 'good-item3.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem4Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-d', 'good-item4.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem5Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/good-item5.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === extraFileInFolderCPath) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join(
|
|
||||||
'/folder-a',
|
|
||||||
'folder-b',
|
|
||||||
'folder-c',
|
|
||||||
'extra-file-in-folder-c.txt'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === amazingFileInFolderHPath) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-h', 'amazing-item.txt')
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
throw new Error(
|
|
||||||
'Invalid specification found. This should never be reached'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Upload Specification - Success with extra slash', async () => {
|
|
||||||
const rootWithSlash = `${root}/`
|
|
||||||
const specifications = getUploadZipSpecification(
|
|
||||||
artifactFilesToUpload,
|
|
||||||
rootWithSlash
|
|
||||||
)
|
|
||||||
expect(specifications.length).toEqual(7)
|
|
||||||
|
|
||||||
const absolutePaths = specifications.map(item => item.sourcePath)
|
|
||||||
expect(absolutePaths).toContain(goodItem1Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem2Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem3Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem4Path)
|
|
||||||
expect(absolutePaths).toContain(goodItem5Path)
|
|
||||||
expect(absolutePaths).toContain(extraFileInFolderCPath)
|
|
||||||
expect(absolutePaths).toContain(amazingFileInFolderHPath)
|
|
||||||
|
|
||||||
for (const specification of specifications) {
|
|
||||||
if (specification.sourcePath === goodItem1Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-a', 'folder-b', 'folder-c', 'good-item1.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem2Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-d', 'good-item2.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem3Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-d', 'good-item3.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem4Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-d', 'good-item4.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === goodItem5Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/good-item5.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === extraFileInFolderCPath) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join(
|
|
||||||
'/folder-a',
|
|
||||||
'folder-b',
|
|
||||||
'folder-c',
|
|
||||||
'extra-file-in-folder-c.txt'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === amazingFileInFolderHPath) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-h', 'amazing-item.txt')
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
throw new Error(
|
|
||||||
'Invalid specification found. This should never be reached'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Upload Specification - Empty Directories are included', async () => {
|
|
||||||
const folderEPath = path.join(root, 'folder-a', 'folder-b', 'folder-e')
|
|
||||||
const filesWithDirectory = [goodItem1Path, folderEPath]
|
|
||||||
const specifications = getUploadZipSpecification(filesWithDirectory, root)
|
|
||||||
expect(specifications.length).toEqual(2)
|
|
||||||
const absolutePaths = specifications.map(item => item.sourcePath)
|
|
||||||
expect(absolutePaths).toContain(goodItem1Path)
|
|
||||||
expect(absolutePaths).toContain(null)
|
|
||||||
|
|
||||||
for (const specification of specifications) {
|
|
||||||
if (specification.sourcePath === goodItem1Path) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-a', 'folder-b', 'folder-c', 'good-item1.txt')
|
|
||||||
)
|
|
||||||
} else if (specification.sourcePath === null) {
|
|
||||||
expect(specification.destinationPath).toEqual(
|
|
||||||
path.join('/folder-a', 'folder-b', 'folder-e')
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
throw new Error(
|
|
||||||
'Invalid specification found. This should never be reached'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Docs will be added here once development of version `2.0.0` has finished
|
|
||||||
Generated
+1819
-13
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/artifact",
|
"name": "@actions/artifact",
|
||||||
"version": "2.0.0",
|
"version": "1.1.1",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions artifact lib",
|
"description": "Actions artifact lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
],
|
],
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/main/packages/artifact",
|
"homepage": "https://github.com/actions/toolkit/tree/main/packages/artifact",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "lib/artifact-client.js",
|
"main": "lib/artifact.js",
|
||||||
"types": "lib/artifact-client.d.ts",
|
"types": "lib/artifact.d.ts",
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "lib",
|
"lib": "lib",
|
||||||
"test": "__tests__"
|
"test": "__tests__"
|
||||||
@@ -31,19 +31,22 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"bootstrap": "cd ../../ && npm run bootstrap",
|
"tsc": "tsc"
|
||||||
"tsc-run": "tsc",
|
|
||||||
"tsc": "npm run bootstrap && npm run tsc-run"
|
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/http-client": "^2.1.0"
|
"@actions/http-client": "^2.1.0",
|
||||||
|
"@azure/storage-blob": "^12.15.0",
|
||||||
|
"@types/node": "^20.4.5",
|
||||||
|
"archiver": "^5.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/tmp": "^0.2.1",
|
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
|
||||||
"typescript": "^4.3.0"
|
"@types/archiver": "^5.3.2",
|
||||||
|
"twirp-ts": "^2.5.0",
|
||||||
|
"typescript": "^3.9.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
import {ArtifactClient, Client} from './internal/client'
|
import { ArtifactClient, Client} from './internal/client'
|
||||||
import {UploadOptions} from './internal/upload/upload-options'
|
import { UploadOptions } from './internal/upload/upload-options'
|
||||||
import {UploadResponse} from './internal/upload/upload-response'
|
import { UploadResponse } from './internal/upload/upload-response'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exported functionality that we want to expose for any users of @actions/artifact
|
* Exported functionality that we want to expose for any users of @actions/artifact
|
||||||
*/
|
*/
|
||||||
export {ArtifactClient, UploadOptions, UploadResponse}
|
export {
|
||||||
|
ArtifactClient,
|
||||||
|
UploadOptions,
|
||||||
|
UploadResponse,
|
||||||
|
}
|
||||||
|
|
||||||
export function create(): ArtifactClient {
|
export function create(): ArtifactClient {
|
||||||
return Client.create()
|
return Client.create()
|
||||||
|
|||||||
@@ -0,0 +1,277 @@
|
|||||||
|
// @generated by protobuf-ts 2.9.1 with parameter client_none,generate_dependencies
|
||||||
|
// @generated from protobuf file "google/protobuf/timestamp.proto" (package "google.protobuf", syntax proto3)
|
||||||
|
// tslint:disable
|
||||||
|
//
|
||||||
|
// Protocol Buffers - Google's data interchange format
|
||||||
|
// Copyright 2008 Google Inc. All rights reserved.
|
||||||
|
// https://developers.google.com/protocol-buffers/
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||||
|
import { WireType } from "@protobuf-ts/runtime";
|
||||||
|
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||||
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||||
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||||
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
|
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
||||||
|
import { typeofJsonValue } from "@protobuf-ts/runtime";
|
||||||
|
import type { JsonValue } from "@protobuf-ts/runtime";
|
||||||
|
import type { JsonReadOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { JsonWriteOptions } from "@protobuf-ts/runtime";
|
||||||
|
import { PbLong } from "@protobuf-ts/runtime";
|
||||||
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
|
/**
|
||||||
|
* A Timestamp represents a point in time independent of any time zone
|
||||||
|
* or calendar, represented as seconds and fractions of seconds at
|
||||||
|
* nanosecond resolution in UTC Epoch time. It is encoded using the
|
||||||
|
* Proleptic Gregorian Calendar which extends the Gregorian calendar
|
||||||
|
* backwards to year one. It is encoded assuming all minutes are 60
|
||||||
|
* seconds long, i.e. leap seconds are "smeared" so that no leap second
|
||||||
|
* table is needed for interpretation. Range is from
|
||||||
|
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
|
||||||
|
* By restricting to that range, we ensure that we can convert to
|
||||||
|
* and from RFC 3339 date strings.
|
||||||
|
* See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
|
||||||
|
*
|
||||||
|
* # Examples
|
||||||
|
*
|
||||||
|
* Example 1: Compute Timestamp from POSIX `time()`.
|
||||||
|
*
|
||||||
|
* Timestamp timestamp;
|
||||||
|
* timestamp.set_seconds(time(NULL));
|
||||||
|
* timestamp.set_nanos(0);
|
||||||
|
*
|
||||||
|
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||||
|
*
|
||||||
|
* struct timeval tv;
|
||||||
|
* gettimeofday(&tv, NULL);
|
||||||
|
*
|
||||||
|
* Timestamp timestamp;
|
||||||
|
* timestamp.set_seconds(tv.tv_sec);
|
||||||
|
* timestamp.set_nanos(tv.tv_usec * 1000);
|
||||||
|
*
|
||||||
|
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||||
|
*
|
||||||
|
* FILETIME ft;
|
||||||
|
* GetSystemTimeAsFileTime(&ft);
|
||||||
|
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||||
|
*
|
||||||
|
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||||
|
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||||
|
* Timestamp timestamp;
|
||||||
|
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||||
|
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||||
|
*
|
||||||
|
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||||
|
*
|
||||||
|
* long millis = System.currentTimeMillis();
|
||||||
|
*
|
||||||
|
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||||
|
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Example 5: Compute Timestamp from current time in Python.
|
||||||
|
*
|
||||||
|
* timestamp = Timestamp()
|
||||||
|
* timestamp.GetCurrentTime()
|
||||||
|
*
|
||||||
|
* # JSON Mapping
|
||||||
|
*
|
||||||
|
* In JSON format, the Timestamp type is encoded as a string in the
|
||||||
|
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
||||||
|
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
||||||
|
* where {year} is always expressed using four digits while {month}, {day},
|
||||||
|
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||||
|
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||||
|
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||||
|
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||||
|
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||||
|
* able to accept both UTC and other timezones (as indicated by an offset).
|
||||||
|
*
|
||||||
|
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||||
|
* 01:30 UTC on January 15, 2017.
|
||||||
|
*
|
||||||
|
* In JavaScript, one can convert a Date object to this format using the
|
||||||
|
* standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
|
||||||
|
* method. In Python, a standard `datetime.datetime` object can be converted
|
||||||
|
* to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
||||||
|
* with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||||
|
* can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||||
|
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
|
||||||
|
* ) to obtain a formatter capable of generating timestamps in this format.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.Timestamp
|
||||||
|
*/
|
||||||
|
export interface Timestamp {
|
||||||
|
/**
|
||||||
|
* Represents seconds of UTC time since Unix epoch
|
||||||
|
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||||
|
* 9999-12-31T23:59:59Z inclusive.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: int64 seconds = 1;
|
||||||
|
*/
|
||||||
|
seconds: bigint;
|
||||||
|
/**
|
||||||
|
* Non-negative fractions of a second at nanosecond resolution. Negative
|
||||||
|
* second values with fractions must still have non-negative nanos values
|
||||||
|
* that count forward in time. Must be from 0 to 999,999,999
|
||||||
|
* inclusive.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: int32 nanos = 2;
|
||||||
|
*/
|
||||||
|
nanos: number;
|
||||||
|
}
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class Timestamp$Type extends MessageType<Timestamp> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.Timestamp", [
|
||||||
|
{ no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
||||||
|
{ no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates a new `Timestamp` for the current time.
|
||||||
|
*/
|
||||||
|
now(): Timestamp {
|
||||||
|
const msg = this.create();
|
||||||
|
const ms = Date.now();
|
||||||
|
msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
|
||||||
|
msg.nanos = (ms % 1000) * 1000000;
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Converts a `Timestamp` to a JavaScript Date.
|
||||||
|
*/
|
||||||
|
toDate(message: Timestamp): Date {
|
||||||
|
return new Date(PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Converts a JavaScript Date to a `Timestamp`.
|
||||||
|
*/
|
||||||
|
fromDate(date: Date): Timestamp {
|
||||||
|
const msg = this.create();
|
||||||
|
const ms = date.getTime();
|
||||||
|
msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
|
||||||
|
msg.nanos = (ms % 1000) * 1000000;
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* In JSON format, the `Timestamp` type is encoded as a string
|
||||||
|
* in the RFC 3339 format.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: Timestamp, options: JsonWriteOptions): JsonValue {
|
||||||
|
let ms = PbLong.from(message.seconds).toNumber() * 1000;
|
||||||
|
if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
|
||||||
|
throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
|
||||||
|
if (message.nanos < 0)
|
||||||
|
throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");
|
||||||
|
let z = "Z";
|
||||||
|
if (message.nanos > 0) {
|
||||||
|
let nanosStr = (message.nanos + 1000000000).toString().substring(1);
|
||||||
|
if (nanosStr.substring(3) === "000000")
|
||||||
|
z = "." + nanosStr.substring(0, 3) + "Z";
|
||||||
|
else if (nanosStr.substring(6) === "000")
|
||||||
|
z = "." + nanosStr.substring(0, 6) + "Z";
|
||||||
|
else
|
||||||
|
z = "." + nanosStr + "Z";
|
||||||
|
}
|
||||||
|
return new Date(ms).toISOString().replace(".000Z", z);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* In JSON format, the `Timestamp` type is encoded as a string
|
||||||
|
* in the RFC 3339 format.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Timestamp): Timestamp {
|
||||||
|
if (typeof json !== "string")
|
||||||
|
throw new Error("Unable to parse Timestamp from JSON " + typeofJsonValue(json) + ".");
|
||||||
|
let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
|
||||||
|
if (!matches)
|
||||||
|
throw new Error("Unable to parse Timestamp from JSON. Invalid format.");
|
||||||
|
let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z"));
|
||||||
|
if (Number.isNaN(ms))
|
||||||
|
throw new Error("Unable to parse Timestamp from JSON. Invalid value.");
|
||||||
|
if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
|
||||||
|
throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.seconds = PbLong.from(ms / 1000).toBigInt();
|
||||||
|
target.nanos = 0;
|
||||||
|
if (matches[7])
|
||||||
|
target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<Timestamp>): Timestamp {
|
||||||
|
const message = { seconds: 0n, nanos: 0 };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<Timestamp>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Timestamp): Timestamp {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* int64 seconds */ 1:
|
||||||
|
message.seconds = reader.int64().toBigInt();
|
||||||
|
break;
|
||||||
|
case /* int32 nanos */ 2:
|
||||||
|
message.nanos = reader.int32();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: Timestamp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* int64 seconds = 1; */
|
||||||
|
if (message.seconds !== 0n)
|
||||||
|
writer.tag(1, WireType.Varint).int64(message.seconds);
|
||||||
|
/* int32 nanos = 2; */
|
||||||
|
if (message.nanos !== 0)
|
||||||
|
writer.tag(2, WireType.Varint).int32(message.nanos);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.Timestamp
|
||||||
|
*/
|
||||||
|
export const Timestamp = new Timestamp$Type();
|
||||||
@@ -0,0 +1,748 @@
|
|||||||
|
// @generated by protobuf-ts 2.9.1 with parameter client_none,generate_dependencies
|
||||||
|
// @generated from protobuf file "google/protobuf/wrappers.proto" (package "google.protobuf", syntax proto3)
|
||||||
|
// tslint:disable
|
||||||
|
//
|
||||||
|
// Protocol Buffers - Google's data interchange format
|
||||||
|
// Copyright 2008 Google Inc. All rights reserved.
|
||||||
|
// https://developers.google.com/protocol-buffers/
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Wrappers for primitive (non-message) types. These types are useful
|
||||||
|
// for embedding primitives in the `google.protobuf.Any` type and for places
|
||||||
|
// where we need to distinguish between the absence of a primitive
|
||||||
|
// typed field and its default value.
|
||||||
|
//
|
||||||
|
import { ScalarType } from "@protobuf-ts/runtime";
|
||||||
|
import { LongType } from "@protobuf-ts/runtime";
|
||||||
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||||
|
import { WireType } from "@protobuf-ts/runtime";
|
||||||
|
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||||
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||||
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||||
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
|
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
||||||
|
import type { JsonValue } from "@protobuf-ts/runtime";
|
||||||
|
import type { JsonReadOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { JsonWriteOptions } from "@protobuf-ts/runtime";
|
||||||
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
|
/**
|
||||||
|
* Wrapper message for `double`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `DoubleValue` is JSON number.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.DoubleValue
|
||||||
|
*/
|
||||||
|
export interface DoubleValue {
|
||||||
|
/**
|
||||||
|
* The double value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: double value = 1;
|
||||||
|
*/
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `float`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `FloatValue` is JSON number.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.FloatValue
|
||||||
|
*/
|
||||||
|
export interface FloatValue {
|
||||||
|
/**
|
||||||
|
* The float value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: float value = 1;
|
||||||
|
*/
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `int64`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `Int64Value` is JSON string.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.Int64Value
|
||||||
|
*/
|
||||||
|
export interface Int64Value {
|
||||||
|
/**
|
||||||
|
* The int64 value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: int64 value = 1;
|
||||||
|
*/
|
||||||
|
value: bigint;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `uint64`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `UInt64Value` is JSON string.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.UInt64Value
|
||||||
|
*/
|
||||||
|
export interface UInt64Value {
|
||||||
|
/**
|
||||||
|
* The uint64 value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: uint64 value = 1;
|
||||||
|
*/
|
||||||
|
value: bigint;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `int32`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `Int32Value` is JSON number.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.Int32Value
|
||||||
|
*/
|
||||||
|
export interface Int32Value {
|
||||||
|
/**
|
||||||
|
* The int32 value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: int32 value = 1;
|
||||||
|
*/
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `uint32`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `UInt32Value` is JSON number.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.UInt32Value
|
||||||
|
*/
|
||||||
|
export interface UInt32Value {
|
||||||
|
/**
|
||||||
|
* The uint32 value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: uint32 value = 1;
|
||||||
|
*/
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `bool`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `BoolValue` is JSON `true` and `false`.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.BoolValue
|
||||||
|
*/
|
||||||
|
export interface BoolValue {
|
||||||
|
/**
|
||||||
|
* The bool value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: bool value = 1;
|
||||||
|
*/
|
||||||
|
value: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `string`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `StringValue` is JSON string.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.StringValue
|
||||||
|
*/
|
||||||
|
export interface StringValue {
|
||||||
|
/**
|
||||||
|
* The string value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: string value = 1;
|
||||||
|
*/
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Wrapper message for `bytes`.
|
||||||
|
*
|
||||||
|
* The JSON representation for `BytesValue` is JSON string.
|
||||||
|
*
|
||||||
|
* @generated from protobuf message google.protobuf.BytesValue
|
||||||
|
*/
|
||||||
|
export interface BytesValue {
|
||||||
|
/**
|
||||||
|
* The bytes value.
|
||||||
|
*
|
||||||
|
* @generated from protobuf field: bytes value = 1;
|
||||||
|
*/
|
||||||
|
value: Uint8Array;
|
||||||
|
}
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class DoubleValue$Type extends MessageType<DoubleValue> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.DoubleValue", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `DoubleValue` to JSON number.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: DoubleValue, options: JsonWriteOptions): JsonValue {
|
||||||
|
return this.refJsonWriter.scalar(2, message.value, "value", false, true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `DoubleValue` from JSON number.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: DoubleValue): DoubleValue {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, 1, undefined, "value") as number;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<DoubleValue>): DoubleValue {
|
||||||
|
const message = { value: 0 };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<DoubleValue>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DoubleValue): DoubleValue {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* double value */ 1:
|
||||||
|
message.value = reader.double();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: DoubleValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* double value = 1; */
|
||||||
|
if (message.value !== 0)
|
||||||
|
writer.tag(1, WireType.Bit64).double(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.DoubleValue
|
||||||
|
*/
|
||||||
|
export const DoubleValue = new DoubleValue$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class FloatValue$Type extends MessageType<FloatValue> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.FloatValue", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `FloatValue` to JSON number.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: FloatValue, options: JsonWriteOptions): JsonValue {
|
||||||
|
return this.refJsonWriter.scalar(1, message.value, "value", false, true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `FloatValue` from JSON number.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: FloatValue): FloatValue {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, 1, undefined, "value") as number;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<FloatValue>): FloatValue {
|
||||||
|
const message = { value: 0 };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<FloatValue>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FloatValue): FloatValue {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* float value */ 1:
|
||||||
|
message.value = reader.float();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: FloatValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* float value = 1; */
|
||||||
|
if (message.value !== 0)
|
||||||
|
writer.tag(1, WireType.Bit32).float(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.FloatValue
|
||||||
|
*/
|
||||||
|
export const FloatValue = new FloatValue$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class Int64Value$Type extends MessageType<Int64Value> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.Int64Value", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `Int64Value` to JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: Int64Value, options: JsonWriteOptions): JsonValue {
|
||||||
|
return this.refJsonWriter.scalar(ScalarType.INT64, message.value, "value", false, true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `Int64Value` from JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Int64Value): Int64Value {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, ScalarType.INT64, LongType.BIGINT, "value") as any;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<Int64Value>): Int64Value {
|
||||||
|
const message = { value: 0n };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<Int64Value>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int64Value): Int64Value {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* int64 value */ 1:
|
||||||
|
message.value = reader.int64().toBigInt();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: Int64Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* int64 value = 1; */
|
||||||
|
if (message.value !== 0n)
|
||||||
|
writer.tag(1, WireType.Varint).int64(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.Int64Value
|
||||||
|
*/
|
||||||
|
export const Int64Value = new Int64Value$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class UInt64Value$Type extends MessageType<UInt64Value> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.UInt64Value", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `UInt64Value` to JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: UInt64Value, options: JsonWriteOptions): JsonValue {
|
||||||
|
return this.refJsonWriter.scalar(ScalarType.UINT64, message.value, "value", false, true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `UInt64Value` from JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: UInt64Value): UInt64Value {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, ScalarType.UINT64, LongType.BIGINT, "value") as any;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<UInt64Value>): UInt64Value {
|
||||||
|
const message = { value: 0n };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<UInt64Value>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt64Value): UInt64Value {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* uint64 value */ 1:
|
||||||
|
message.value = reader.uint64().toBigInt();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: UInt64Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* uint64 value = 1; */
|
||||||
|
if (message.value !== 0n)
|
||||||
|
writer.tag(1, WireType.Varint).uint64(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.UInt64Value
|
||||||
|
*/
|
||||||
|
export const UInt64Value = new UInt64Value$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class Int32Value$Type extends MessageType<Int32Value> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.Int32Value", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `Int32Value` to JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: Int32Value, options: JsonWriteOptions): JsonValue {
|
||||||
|
return this.refJsonWriter.scalar(5, message.value, "value", false, true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `Int32Value` from JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Int32Value): Int32Value {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, 5, undefined, "value") as number;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<Int32Value>): Int32Value {
|
||||||
|
const message = { value: 0 };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<Int32Value>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int32Value): Int32Value {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* int32 value */ 1:
|
||||||
|
message.value = reader.int32();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: Int32Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* int32 value = 1; */
|
||||||
|
if (message.value !== 0)
|
||||||
|
writer.tag(1, WireType.Varint).int32(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.Int32Value
|
||||||
|
*/
|
||||||
|
export const Int32Value = new Int32Value$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class UInt32Value$Type extends MessageType<UInt32Value> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.UInt32Value", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `UInt32Value` to JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: UInt32Value, options: JsonWriteOptions): JsonValue {
|
||||||
|
return this.refJsonWriter.scalar(13, message.value, "value", false, true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `UInt32Value` from JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: UInt32Value): UInt32Value {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, 13, undefined, "value") as number;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<UInt32Value>): UInt32Value {
|
||||||
|
const message = { value: 0 };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<UInt32Value>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt32Value): UInt32Value {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* uint32 value */ 1:
|
||||||
|
message.value = reader.uint32();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: UInt32Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* uint32 value = 1; */
|
||||||
|
if (message.value !== 0)
|
||||||
|
writer.tag(1, WireType.Varint).uint32(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.UInt32Value
|
||||||
|
*/
|
||||||
|
export const UInt32Value = new UInt32Value$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class BoolValue$Type extends MessageType<BoolValue> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.BoolValue", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `BoolValue` to JSON bool.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: BoolValue, options: JsonWriteOptions): JsonValue {
|
||||||
|
return message.value;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `BoolValue` from JSON bool.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: BoolValue): BoolValue {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, 8, undefined, "value") as boolean;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<BoolValue>): BoolValue {
|
||||||
|
const message = { value: false };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<BoolValue>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BoolValue): BoolValue {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* bool value */ 1:
|
||||||
|
message.value = reader.bool();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: BoolValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* bool value = 1; */
|
||||||
|
if (message.value !== false)
|
||||||
|
writer.tag(1, WireType.Varint).bool(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.BoolValue
|
||||||
|
*/
|
||||||
|
export const BoolValue = new BoolValue$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class StringValue$Type extends MessageType<StringValue> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.StringValue", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `StringValue` to JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: StringValue, options: JsonWriteOptions): JsonValue {
|
||||||
|
return message.value;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `StringValue` from JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: StringValue): StringValue {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, 9, undefined, "value") as string;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<StringValue>): StringValue {
|
||||||
|
const message = { value: "" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<StringValue>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringValue): StringValue {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* string value */ 1:
|
||||||
|
message.value = reader.string();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: StringValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* string value = 1; */
|
||||||
|
if (message.value !== "")
|
||||||
|
writer.tag(1, WireType.LengthDelimited).string(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.StringValue
|
||||||
|
*/
|
||||||
|
export const StringValue = new StringValue$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class BytesValue$Type extends MessageType<BytesValue> {
|
||||||
|
constructor() {
|
||||||
|
super("google.protobuf.BytesValue", [
|
||||||
|
{ no: 1, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encode `BytesValue` to JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonWrite(message: BytesValue, options: JsonWriteOptions): JsonValue {
|
||||||
|
return this.refJsonWriter.scalar(12, message.value, "value", false, true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Decode `BytesValue` from JSON string.
|
||||||
|
*/
|
||||||
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: BytesValue): BytesValue {
|
||||||
|
if (!target)
|
||||||
|
target = this.create();
|
||||||
|
target.value = this.refJsonReader.scalar(json, 12, undefined, "value") as Uint8Array;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<BytesValue>): BytesValue {
|
||||||
|
const message = { value: new Uint8Array(0) };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<BytesValue>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BytesValue): BytesValue {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* bytes value */ 1:
|
||||||
|
message.value = reader.bytes();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: BytesValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* bytes value = 1; */
|
||||||
|
if (message.value.length)
|
||||||
|
writer.tag(1, WireType.LengthDelimited).bytes(message.value);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message google.protobuf.BytesValue
|
||||||
|
*/
|
||||||
|
export const BytesValue = new BytesValue$Type();
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export * from "../generated/google/protobuf/timestamp";
|
||||||
|
export * from "../generated/google/protobuf/wrappers";
|
||||||
|
export * from "../generated/results/api/v1/artifact";
|
||||||
|
export * from "../generated/results/api/v1/artifact.twirp";
|
||||||
@@ -0,0 +1,346 @@
|
|||||||
|
// @generated by protobuf-ts 2.9.1 with parameter client_none,generate_dependencies
|
||||||
|
// @generated from protobuf file "results/api/v1/artifact.proto" (package "github.actions.results.api.v1", syntax proto3)
|
||||||
|
// tslint:disable
|
||||||
|
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
||||||
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
||||||
|
import { WireType } from "@protobuf-ts/runtime";
|
||||||
|
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
||||||
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
||||||
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
||||||
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||||
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||||
|
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
||||||
|
import { MessageType } from "@protobuf-ts/runtime";
|
||||||
|
import { StringValue } from "../../../google/protobuf/wrappers";
|
||||||
|
import { Timestamp } from "../../../google/protobuf/timestamp";
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.CreateArtifactRequest
|
||||||
|
*/
|
||||||
|
export interface CreateArtifactRequest {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_run_backend_id = 1;
|
||||||
|
*/
|
||||||
|
workflowRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_job_run_backend_id = 2;
|
||||||
|
*/
|
||||||
|
workflowJobRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string name = 3;
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: google.protobuf.Timestamp expires_at = 4;
|
||||||
|
*/
|
||||||
|
expiresAt?: Timestamp;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: int32 version = 5;
|
||||||
|
*/
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.CreateArtifactResponse
|
||||||
|
*/
|
||||||
|
export interface CreateArtifactResponse {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: bool ok = 1;
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string signed_upload_url = 2;
|
||||||
|
*/
|
||||||
|
signedUploadUrl: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.FinalizeArtifactRequest
|
||||||
|
*/
|
||||||
|
export interface FinalizeArtifactRequest {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_run_backend_id = 1;
|
||||||
|
*/
|
||||||
|
workflowRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string workflow_job_run_backend_id = 2;
|
||||||
|
*/
|
||||||
|
workflowJobRunBackendId: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: string name = 3;
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: int64 size = 4;
|
||||||
|
*/
|
||||||
|
size: bigint;
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: google.protobuf.StringValue hash = 5;
|
||||||
|
*/
|
||||||
|
hash?: StringValue; // optional
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated from protobuf message github.actions.results.api.v1.FinalizeArtifactResponse
|
||||||
|
*/
|
||||||
|
export interface FinalizeArtifactResponse {
|
||||||
|
/**
|
||||||
|
* @generated from protobuf field: bool ok = 1;
|
||||||
|
*/
|
||||||
|
ok: boolean;
|
||||||
|
}
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class CreateArtifactRequest$Type extends MessageType<CreateArtifactRequest> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.CreateArtifactRequest", [
|
||||||
|
{ no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 4, name: "expires_at", kind: "message", T: () => Timestamp },
|
||||||
|
{ no: 5, name: "version", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<CreateArtifactRequest>): CreateArtifactRequest {
|
||||||
|
const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", version: 0 };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<CreateArtifactRequest>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateArtifactRequest): CreateArtifactRequest {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* string workflow_run_backend_id */ 1:
|
||||||
|
message.workflowRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string workflow_job_run_backend_id */ 2:
|
||||||
|
message.workflowJobRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string name */ 3:
|
||||||
|
message.name = reader.string();
|
||||||
|
break;
|
||||||
|
case /* google.protobuf.Timestamp expires_at */ 4:
|
||||||
|
message.expiresAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expiresAt);
|
||||||
|
break;
|
||||||
|
case /* int32 version */ 5:
|
||||||
|
message.version = reader.int32();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: CreateArtifactRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* string workflow_run_backend_id = 1; */
|
||||||
|
if (message.workflowRunBackendId !== "")
|
||||||
|
writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId);
|
||||||
|
/* string workflow_job_run_backend_id = 2; */
|
||||||
|
if (message.workflowJobRunBackendId !== "")
|
||||||
|
writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId);
|
||||||
|
/* string name = 3; */
|
||||||
|
if (message.name !== "")
|
||||||
|
writer.tag(3, WireType.LengthDelimited).string(message.name);
|
||||||
|
/* google.protobuf.Timestamp expires_at = 4; */
|
||||||
|
if (message.expiresAt)
|
||||||
|
Timestamp.internalBinaryWrite(message.expiresAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
|
||||||
|
/* int32 version = 5; */
|
||||||
|
if (message.version !== 0)
|
||||||
|
writer.tag(5, WireType.Varint).int32(message.version);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.CreateArtifactRequest
|
||||||
|
*/
|
||||||
|
export const CreateArtifactRequest = new CreateArtifactRequest$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class CreateArtifactResponse$Type extends MessageType<CreateArtifactResponse> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.CreateArtifactResponse", [
|
||||||
|
{ no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
||||||
|
{ no: 2, name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<CreateArtifactResponse>): CreateArtifactResponse {
|
||||||
|
const message = { ok: false, signedUploadUrl: "" };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<CreateArtifactResponse>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateArtifactResponse): CreateArtifactResponse {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* bool ok */ 1:
|
||||||
|
message.ok = reader.bool();
|
||||||
|
break;
|
||||||
|
case /* string signed_upload_url */ 2:
|
||||||
|
message.signedUploadUrl = reader.string();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: CreateArtifactResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* bool ok = 1; */
|
||||||
|
if (message.ok !== false)
|
||||||
|
writer.tag(1, WireType.Varint).bool(message.ok);
|
||||||
|
/* string signed_upload_url = 2; */
|
||||||
|
if (message.signedUploadUrl !== "")
|
||||||
|
writer.tag(2, WireType.LengthDelimited).string(message.signedUploadUrl);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.CreateArtifactResponse
|
||||||
|
*/
|
||||||
|
export const CreateArtifactResponse = new CreateArtifactResponse$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class FinalizeArtifactRequest$Type extends MessageType<FinalizeArtifactRequest> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.FinalizeArtifactRequest", [
|
||||||
|
{ no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
||||||
|
{ no: 4, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
||||||
|
{ no: 5, name: "hash", kind: "message", T: () => StringValue }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<FinalizeArtifactRequest>): FinalizeArtifactRequest {
|
||||||
|
const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", size: 0n };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<FinalizeArtifactRequest>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalizeArtifactRequest): FinalizeArtifactRequest {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* string workflow_run_backend_id */ 1:
|
||||||
|
message.workflowRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string workflow_job_run_backend_id */ 2:
|
||||||
|
message.workflowJobRunBackendId = reader.string();
|
||||||
|
break;
|
||||||
|
case /* string name */ 3:
|
||||||
|
message.name = reader.string();
|
||||||
|
break;
|
||||||
|
case /* int64 size */ 4:
|
||||||
|
message.size = reader.int64().toBigInt();
|
||||||
|
break;
|
||||||
|
case /* google.protobuf.StringValue hash */ 5:
|
||||||
|
message.hash = StringValue.internalBinaryRead(reader, reader.uint32(), options, message.hash);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: FinalizeArtifactRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* string workflow_run_backend_id = 1; */
|
||||||
|
if (message.workflowRunBackendId !== "")
|
||||||
|
writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId);
|
||||||
|
/* string workflow_job_run_backend_id = 2; */
|
||||||
|
if (message.workflowJobRunBackendId !== "")
|
||||||
|
writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId);
|
||||||
|
/* string name = 3; */
|
||||||
|
if (message.name !== "")
|
||||||
|
writer.tag(3, WireType.LengthDelimited).string(message.name);
|
||||||
|
/* int64 size = 4; */
|
||||||
|
if (message.size !== 0n)
|
||||||
|
writer.tag(4, WireType.Varint).int64(message.size);
|
||||||
|
/* google.protobuf.StringValue hash = 5; */
|
||||||
|
if (message.hash)
|
||||||
|
StringValue.internalBinaryWrite(message.hash, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.FinalizeArtifactRequest
|
||||||
|
*/
|
||||||
|
export const FinalizeArtifactRequest = new FinalizeArtifactRequest$Type();
|
||||||
|
// @generated message type with reflection information, may provide speed optimized methods
|
||||||
|
class FinalizeArtifactResponse$Type extends MessageType<FinalizeArtifactResponse> {
|
||||||
|
constructor() {
|
||||||
|
super("github.actions.results.api.v1.FinalizeArtifactResponse", [
|
||||||
|
{ no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
create(value?: PartialMessage<FinalizeArtifactResponse>): FinalizeArtifactResponse {
|
||||||
|
const message = { ok: false };
|
||||||
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
||||||
|
if (value !== undefined)
|
||||||
|
reflectionMergePartial<FinalizeArtifactResponse>(this, message, value);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalizeArtifactResponse): FinalizeArtifactResponse {
|
||||||
|
let message = target ?? this.create(), end = reader.pos + length;
|
||||||
|
while (reader.pos < end) {
|
||||||
|
let [fieldNo, wireType] = reader.tag();
|
||||||
|
switch (fieldNo) {
|
||||||
|
case /* bool ok */ 1:
|
||||||
|
message.ok = reader.bool();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
let u = options.readUnknownField;
|
||||||
|
if (u === "throw")
|
||||||
|
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||||
|
let d = reader.skip(wireType);
|
||||||
|
if (u !== false)
|
||||||
|
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
internalBinaryWrite(message: FinalizeArtifactResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||||
|
/* bool ok = 1; */
|
||||||
|
if (message.ok !== false)
|
||||||
|
writer.tag(1, WireType.Varint).bool(message.ok);
|
||||||
|
let u = options.writeUnknownFields;
|
||||||
|
if (u !== false)
|
||||||
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @generated MessageType for protobuf message github.actions.results.api.v1.FinalizeArtifactResponse
|
||||||
|
*/
|
||||||
|
export const FinalizeArtifactResponse = new FinalizeArtifactResponse$Type();
|
||||||
|
/**
|
||||||
|
* @generated ServiceType for protobuf service github.actions.results.api.v1.ArtifactService
|
||||||
|
*/
|
||||||
|
export const ArtifactService = new ServiceType("github.actions.results.api.v1.ArtifactService", [
|
||||||
|
{ name: "CreateArtifact", options: {}, I: CreateArtifactRequest, O: CreateArtifactResponse },
|
||||||
|
{ name: "FinalizeArtifact", options: {}, I: FinalizeArtifactRequest, O: FinalizeArtifactResponse }
|
||||||
|
]);
|
||||||
@@ -0,0 +1,437 @@
|
|||||||
|
import {
|
||||||
|
TwirpContext,
|
||||||
|
TwirpServer,
|
||||||
|
RouterEvents,
|
||||||
|
TwirpError,
|
||||||
|
TwirpErrorCode,
|
||||||
|
Interceptor,
|
||||||
|
TwirpContentType,
|
||||||
|
chainInterceptors
|
||||||
|
} from 'twirp-ts'
|
||||||
|
import {
|
||||||
|
CreateArtifactRequest,
|
||||||
|
CreateArtifactResponse,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse
|
||||||
|
} from './artifact'
|
||||||
|
|
||||||
|
//==================================//
|
||||||
|
// Client Code //
|
||||||
|
//==================================//
|
||||||
|
|
||||||
|
interface Rpc {
|
||||||
|
request(
|
||||||
|
service: string,
|
||||||
|
method: string,
|
||||||
|
contentType: 'application/json' | 'application/protobuf',
|
||||||
|
data: object | Uint8Array
|
||||||
|
): Promise<object | Uint8Array>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ArtifactServiceClient {
|
||||||
|
CreateArtifact(
|
||||||
|
request: CreateArtifactRequest
|
||||||
|
): Promise<CreateArtifactResponse>
|
||||||
|
FinalizeArtifact(
|
||||||
|
request: FinalizeArtifactRequest
|
||||||
|
): Promise<FinalizeArtifactResponse>
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ArtifactServiceClientJSON implements ArtifactServiceClient {
|
||||||
|
private readonly rpc: Rpc
|
||||||
|
constructor(rpc: Rpc) {
|
||||||
|
this.rpc = rpc
|
||||||
|
this.CreateArtifact.bind(this)
|
||||||
|
this.FinalizeArtifact.bind(this)
|
||||||
|
}
|
||||||
|
CreateArtifact(
|
||||||
|
request: CreateArtifactRequest
|
||||||
|
): Promise<CreateArtifactResponse> {
|
||||||
|
const data = CreateArtifactRequest.toJson(request, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false
|
||||||
|
})
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
'github.actions.results.api.v1.ArtifactService',
|
||||||
|
'CreateArtifact',
|
||||||
|
'application/json',
|
||||||
|
data as object
|
||||||
|
)
|
||||||
|
return promise.then(data =>
|
||||||
|
CreateArtifactResponse.fromJson(data as any, {ignoreUnknownFields: true})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
FinalizeArtifact(
|
||||||
|
request: FinalizeArtifactRequest
|
||||||
|
): Promise<FinalizeArtifactResponse> {
|
||||||
|
const data = FinalizeArtifactRequest.toJson(request, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false
|
||||||
|
})
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
'github.actions.results.api.v1.ArtifactService',
|
||||||
|
'FinalizeArtifact',
|
||||||
|
'application/json',
|
||||||
|
data as object
|
||||||
|
)
|
||||||
|
return promise.then(data =>
|
||||||
|
FinalizeArtifactResponse.fromJson(data as any, {
|
||||||
|
ignoreUnknownFields: true
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ArtifactServiceClientProtobuf implements ArtifactServiceClient {
|
||||||
|
private readonly rpc: Rpc
|
||||||
|
constructor(rpc: Rpc) {
|
||||||
|
this.rpc = rpc
|
||||||
|
this.CreateArtifact.bind(this)
|
||||||
|
this.FinalizeArtifact.bind(this)
|
||||||
|
}
|
||||||
|
CreateArtifact(
|
||||||
|
request: CreateArtifactRequest
|
||||||
|
): Promise<CreateArtifactResponse> {
|
||||||
|
const data = CreateArtifactRequest.toBinary(request)
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
'github.actions.results.api.v1.ArtifactService',
|
||||||
|
'CreateArtifact',
|
||||||
|
'application/protobuf',
|
||||||
|
data
|
||||||
|
)
|
||||||
|
return promise.then(data =>
|
||||||
|
CreateArtifactResponse.fromBinary(data as Uint8Array)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
FinalizeArtifact(
|
||||||
|
request: FinalizeArtifactRequest
|
||||||
|
): Promise<FinalizeArtifactResponse> {
|
||||||
|
const data = FinalizeArtifactRequest.toBinary(request)
|
||||||
|
const promise = this.rpc.request(
|
||||||
|
'github.actions.results.api.v1.ArtifactService',
|
||||||
|
'FinalizeArtifact',
|
||||||
|
'application/protobuf',
|
||||||
|
data
|
||||||
|
)
|
||||||
|
return promise.then(data =>
|
||||||
|
FinalizeArtifactResponse.fromBinary(data as Uint8Array)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//==================================//
|
||||||
|
// Server Code //
|
||||||
|
//==================================//
|
||||||
|
|
||||||
|
export interface ArtifactServiceTwirp<T extends TwirpContext = TwirpContext> {
|
||||||
|
CreateArtifact(
|
||||||
|
ctx: T,
|
||||||
|
request: CreateArtifactRequest
|
||||||
|
): Promise<CreateArtifactResponse>
|
||||||
|
FinalizeArtifact(
|
||||||
|
ctx: T,
|
||||||
|
request: FinalizeArtifactRequest
|
||||||
|
): Promise<FinalizeArtifactResponse>
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ArtifactServiceMethod {
|
||||||
|
CreateArtifact = 'CreateArtifact',
|
||||||
|
FinalizeArtifact = 'FinalizeArtifact'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ArtifactServiceMethodList = [
|
||||||
|
ArtifactServiceMethod.CreateArtifact,
|
||||||
|
ArtifactServiceMethod.FinalizeArtifact
|
||||||
|
]
|
||||||
|
|
||||||
|
export function createArtifactServiceServer<
|
||||||
|
T extends TwirpContext = TwirpContext
|
||||||
|
>(service: ArtifactServiceTwirp<T>) {
|
||||||
|
return new TwirpServer<ArtifactServiceTwirp, T>({
|
||||||
|
service,
|
||||||
|
packageName: 'github.actions.results.api.v1',
|
||||||
|
serviceName: 'ArtifactService',
|
||||||
|
methodList: ArtifactServiceMethodList,
|
||||||
|
matchRoute: matchArtifactServiceRoute
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function matchArtifactServiceRoute<T extends TwirpContext = TwirpContext>(
|
||||||
|
method: string,
|
||||||
|
events: RouterEvents<T>
|
||||||
|
) {
|
||||||
|
switch (method) {
|
||||||
|
case 'CreateArtifact':
|
||||||
|
return async (
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<
|
||||||
|
T,
|
||||||
|
CreateArtifactRequest,
|
||||||
|
CreateArtifactResponse
|
||||||
|
>[]
|
||||||
|
) => {
|
||||||
|
ctx = {...ctx, methodName: 'CreateArtifact'}
|
||||||
|
await events.onMatch(ctx)
|
||||||
|
return handleArtifactServiceCreateArtifactRequest(
|
||||||
|
ctx,
|
||||||
|
service,
|
||||||
|
data,
|
||||||
|
interceptors
|
||||||
|
)
|
||||||
|
}
|
||||||
|
case 'FinalizeArtifact':
|
||||||
|
return async (
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<
|
||||||
|
T,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse
|
||||||
|
>[]
|
||||||
|
) => {
|
||||||
|
ctx = {...ctx, methodName: 'FinalizeArtifact'}
|
||||||
|
await events.onMatch(ctx)
|
||||||
|
return handleArtifactServiceFinalizeArtifactRequest(
|
||||||
|
ctx,
|
||||||
|
service,
|
||||||
|
data,
|
||||||
|
interceptors
|
||||||
|
)
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
events.onNotFound()
|
||||||
|
const msg = `no handler found`
|
||||||
|
throw new TwirpError(TwirpErrorCode.BadRoute, msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleArtifactServiceCreateArtifactRequest<
|
||||||
|
T extends TwirpContext = TwirpContext
|
||||||
|
>(
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<T, CreateArtifactRequest, CreateArtifactResponse>[]
|
||||||
|
): Promise<string | Uint8Array> {
|
||||||
|
switch (ctx.contentType) {
|
||||||
|
case TwirpContentType.JSON:
|
||||||
|
return handleArtifactServiceCreateArtifactJSON<T>(
|
||||||
|
ctx,
|
||||||
|
service,
|
||||||
|
data,
|
||||||
|
interceptors
|
||||||
|
)
|
||||||
|
case TwirpContentType.Protobuf:
|
||||||
|
return handleArtifactServiceCreateArtifactProtobuf<T>(
|
||||||
|
ctx,
|
||||||
|
service,
|
||||||
|
data,
|
||||||
|
interceptors
|
||||||
|
)
|
||||||
|
default:
|
||||||
|
const msg = 'unexpected Content-Type'
|
||||||
|
throw new TwirpError(TwirpErrorCode.BadRoute, msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleArtifactServiceFinalizeArtifactRequest<
|
||||||
|
T extends TwirpContext = TwirpContext
|
||||||
|
>(
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<
|
||||||
|
T,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse
|
||||||
|
>[]
|
||||||
|
): Promise<string | Uint8Array> {
|
||||||
|
switch (ctx.contentType) {
|
||||||
|
case TwirpContentType.JSON:
|
||||||
|
return handleArtifactServiceFinalizeArtifactJSON<T>(
|
||||||
|
ctx,
|
||||||
|
service,
|
||||||
|
data,
|
||||||
|
interceptors
|
||||||
|
)
|
||||||
|
case TwirpContentType.Protobuf:
|
||||||
|
return handleArtifactServiceFinalizeArtifactProtobuf<T>(
|
||||||
|
ctx,
|
||||||
|
service,
|
||||||
|
data,
|
||||||
|
interceptors
|
||||||
|
)
|
||||||
|
default:
|
||||||
|
const msg = 'unexpected Content-Type'
|
||||||
|
throw new TwirpError(TwirpErrorCode.BadRoute, msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function handleArtifactServiceCreateArtifactJSON<
|
||||||
|
T extends TwirpContext = TwirpContext
|
||||||
|
>(
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<T, CreateArtifactRequest, CreateArtifactResponse>[]
|
||||||
|
) {
|
||||||
|
let request: CreateArtifactRequest
|
||||||
|
let response: CreateArtifactResponse
|
||||||
|
|
||||||
|
try {
|
||||||
|
const body = JSON.parse(data.toString() || '{}')
|
||||||
|
request = CreateArtifactRequest.fromJson(body, {ignoreUnknownFields: true})
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
const msg = 'the json request could not be decoded'
|
||||||
|
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interceptors && interceptors.length > 0) {
|
||||||
|
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
||||||
|
T,
|
||||||
|
CreateArtifactRequest,
|
||||||
|
CreateArtifactResponse
|
||||||
|
>
|
||||||
|
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
||||||
|
return service.CreateArtifact(ctx, inputReq)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
response = await service.CreateArtifact(ctx, request!)
|
||||||
|
}
|
||||||
|
|
||||||
|
return JSON.stringify(
|
||||||
|
CreateArtifactResponse.toJson(response, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false
|
||||||
|
}) as string
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleArtifactServiceFinalizeArtifactJSON<
|
||||||
|
T extends TwirpContext = TwirpContext
|
||||||
|
>(
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<
|
||||||
|
T,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse
|
||||||
|
>[]
|
||||||
|
) {
|
||||||
|
let request: FinalizeArtifactRequest
|
||||||
|
let response: FinalizeArtifactResponse
|
||||||
|
|
||||||
|
try {
|
||||||
|
const body = JSON.parse(data.toString() || '{}')
|
||||||
|
request = FinalizeArtifactRequest.fromJson(body, {
|
||||||
|
ignoreUnknownFields: true
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
const msg = 'the json request could not be decoded'
|
||||||
|
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interceptors && interceptors.length > 0) {
|
||||||
|
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
||||||
|
T,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse
|
||||||
|
>
|
||||||
|
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
||||||
|
return service.FinalizeArtifact(ctx, inputReq)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
response = await service.FinalizeArtifact(ctx, request!)
|
||||||
|
}
|
||||||
|
|
||||||
|
return JSON.stringify(
|
||||||
|
FinalizeArtifactResponse.toJson(response, {
|
||||||
|
useProtoFieldName: true,
|
||||||
|
emitDefaultValues: false
|
||||||
|
}) as string
|
||||||
|
)
|
||||||
|
}
|
||||||
|
async function handleArtifactServiceCreateArtifactProtobuf<
|
||||||
|
T extends TwirpContext = TwirpContext
|
||||||
|
>(
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<T, CreateArtifactRequest, CreateArtifactResponse>[]
|
||||||
|
) {
|
||||||
|
let request: CreateArtifactRequest
|
||||||
|
let response: CreateArtifactResponse
|
||||||
|
|
||||||
|
try {
|
||||||
|
request = CreateArtifactRequest.fromBinary(data)
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
const msg = 'the protobuf request could not be decoded'
|
||||||
|
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interceptors && interceptors.length > 0) {
|
||||||
|
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
||||||
|
T,
|
||||||
|
CreateArtifactRequest,
|
||||||
|
CreateArtifactResponse
|
||||||
|
>
|
||||||
|
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
||||||
|
return service.CreateArtifact(ctx, inputReq)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
response = await service.CreateArtifact(ctx, request!)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Buffer.from(CreateArtifactResponse.toBinary(response))
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleArtifactServiceFinalizeArtifactProtobuf<
|
||||||
|
T extends TwirpContext = TwirpContext
|
||||||
|
>(
|
||||||
|
ctx: T,
|
||||||
|
service: ArtifactServiceTwirp,
|
||||||
|
data: Buffer,
|
||||||
|
interceptors?: Interceptor<
|
||||||
|
T,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse
|
||||||
|
>[]
|
||||||
|
) {
|
||||||
|
let request: FinalizeArtifactRequest
|
||||||
|
let response: FinalizeArtifactResponse
|
||||||
|
|
||||||
|
try {
|
||||||
|
request = FinalizeArtifactRequest.fromBinary(data)
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
const msg = 'the protobuf request could not be decoded'
|
||||||
|
throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interceptors && interceptors.length > 0) {
|
||||||
|
const interceptor = chainInterceptors(...interceptors) as Interceptor<
|
||||||
|
T,
|
||||||
|
FinalizeArtifactRequest,
|
||||||
|
FinalizeArtifactResponse
|
||||||
|
>
|
||||||
|
response = await interceptor(ctx, request!, (ctx, inputReq) => {
|
||||||
|
return service.FinalizeArtifact(ctx, inputReq)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
response = await service.FinalizeArtifact(ctx, request!)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Buffer.from(FinalizeArtifactResponse.toBinary(response))
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
import { HttpCodes, HttpClient, HttpClientResponse } from '@actions/http-client'
|
||||||
|
import { BearerCredentialHandler } from '@actions/http-client/lib/auth'
|
||||||
|
import { info } from '@actions/core'
|
||||||
|
import { getRuntimeToken, getResultsServiceUrl, getRetryMultiplier, getInitialRetryIntervalInMilliseconds, getRetryLimit } from './config'
|
||||||
|
|
||||||
|
interface Rpc { request(
|
||||||
|
service: string,
|
||||||
|
method: string,
|
||||||
|
contentType: "application/json" | "application/protobuf",
|
||||||
|
data: object | Uint8Array
|
||||||
|
): Promise<object | Uint8Array>
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ArtifactHttpClient implements Rpc {
|
||||||
|
private httpClient: HttpClient
|
||||||
|
private baseUrl: string
|
||||||
|
|
||||||
|
constructor(userAgent: string) {
|
||||||
|
const token = getRuntimeToken()
|
||||||
|
this.httpClient = new HttpClient(userAgent, [
|
||||||
|
new BearerCredentialHandler(token)
|
||||||
|
])
|
||||||
|
this.baseUrl = getResultsServiceUrl()
|
||||||
|
}
|
||||||
|
|
||||||
|
async request(service: string, method: string, contentType: "application/json" | "application/protobuf", data: object | Uint8Array): Promise<object | Uint8Array> {
|
||||||
|
let url = `${this.baseUrl}/twirp/${service}/${method}`
|
||||||
|
let headers = {
|
||||||
|
"Content-Type": contentType
|
||||||
|
}
|
||||||
|
|
||||||
|
const resp = await this.retry(
|
||||||
|
`${method}`,
|
||||||
|
this.httpClient.post(url, JSON.stringify(data), headers),
|
||||||
|
)
|
||||||
|
const body = await resp.readBody()
|
||||||
|
return JSON.parse(body)
|
||||||
|
}
|
||||||
|
|
||||||
|
async retry(name: string, operation: Promise<HttpClientResponse>): Promise<HttpClientResponse> {
|
||||||
|
let response: HttpClientResponse | undefined = undefined
|
||||||
|
let statusCode: number | undefined = undefined
|
||||||
|
let isRetryable = false
|
||||||
|
let errorMessage = ''
|
||||||
|
let attempt = 1
|
||||||
|
const maxAttempts = getRetryLimit()
|
||||||
|
|
||||||
|
while (attempt <= maxAttempts) {
|
||||||
|
try {
|
||||||
|
response = await operation
|
||||||
|
statusCode = response.message.statusCode
|
||||||
|
|
||||||
|
if (this.isSuccessStatusCode(statusCode)) {
|
||||||
|
return response
|
||||||
|
}
|
||||||
|
|
||||||
|
isRetryable = this.isRetryableStatusCode(statusCode)
|
||||||
|
errorMessage = `Artifact service responded with ${statusCode}`
|
||||||
|
} catch (error: any) {
|
||||||
|
isRetryable = true
|
||||||
|
errorMessage = error.message
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isRetryable) {
|
||||||
|
info(`${name} - Error is not retryable`)
|
||||||
|
if (response) {
|
||||||
|
this.displayHttpDiagnostics(response)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
info(
|
||||||
|
`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`
|
||||||
|
)
|
||||||
|
|
||||||
|
await this.sleep(this.getExponentialRetryTimeInMilliseconds(attempt))
|
||||||
|
attempt++
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response) {
|
||||||
|
this.displayHttpDiagnostics(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
throw Error(`${name} failed: ${errorMessage}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
isSuccessStatusCode(statusCode?: number): boolean {
|
||||||
|
if (!statusCode) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return statusCode >= 200 && statusCode < 300
|
||||||
|
}
|
||||||
|
|
||||||
|
isRetryableStatusCode(statusCode: number | undefined): boolean {
|
||||||
|
if (!statusCode) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
const retryableStatusCodes = [
|
||||||
|
HttpCodes.BadGateway,
|
||||||
|
HttpCodes.GatewayTimeout,
|
||||||
|
HttpCodes.InternalServerError,
|
||||||
|
HttpCodes.ServiceUnavailable,
|
||||||
|
HttpCodes.TooManyRequests,
|
||||||
|
413 // Payload Too Large
|
||||||
|
]
|
||||||
|
return retryableStatusCodes.includes(statusCode)
|
||||||
|
}
|
||||||
|
|
||||||
|
displayHttpDiagnostics(response: HttpClientResponse): void {
|
||||||
|
info(
|
||||||
|
`##### Begin Diagnostic HTTP information #####
|
||||||
|
Status Code: ${response.message.statusCode}
|
||||||
|
Status Message: ${response.message.statusMessage}
|
||||||
|
Header Information: ${JSON.stringify(response.message.headers, undefined, 2)}
|
||||||
|
###### End Diagnostic HTTP information ######`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
getExponentialRetryTimeInMilliseconds(
|
||||||
|
retryCount: number
|
||||||
|
): number {
|
||||||
|
if (retryCount < 0) {
|
||||||
|
throw new Error('RetryCount should not be negative')
|
||||||
|
} else if (retryCount === 0) {
|
||||||
|
return getInitialRetryIntervalInMilliseconds()
|
||||||
|
}
|
||||||
|
|
||||||
|
const minTime =
|
||||||
|
getInitialRetryIntervalInMilliseconds() * getRetryMultiplier() * retryCount
|
||||||
|
const maxTime = minTime * getRetryMultiplier()
|
||||||
|
|
||||||
|
// returns a random number between the minTime (inclusive) and the maxTime (exclusive)
|
||||||
|
return Math.trunc(Math.random() * (maxTime - minTime) + minTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
async sleep(milliseconds: number): Promise<void> {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, milliseconds))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import {UploadOptions} from './upload/upload-options'
|
import { UploadOptions } from './upload/upload-options'
|
||||||
import {UploadResponse} from './upload/upload-response'
|
import { UploadResponse } from './upload/upload-response'
|
||||||
import {uploadArtifact} from './upload/upload-artifact'
|
import { uploadArtifact } from './upload/upload-artifact'
|
||||||
|
|
||||||
export interface ArtifactClient {
|
export interface ArtifactClient {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
export function getRuntimeToken(): string {
|
||||||
|
const token = process.env['ACTIONS_RUNTIME_TOKEN']
|
||||||
|
if (!token) {
|
||||||
|
throw new Error('Unable to get the ACTIONS_RUNTIME_TOKEN environment variable which is required')
|
||||||
|
}
|
||||||
|
return token
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getResultsServiceUrl(): string {
|
||||||
|
const resultsUrl = process.env['ACTIONS_RESULTS_URL']
|
||||||
|
if (!resultsUrl) {
|
||||||
|
throw new Error('Unable to get the ACTIONS_RESULTS_URL environment variable which is required')
|
||||||
|
}
|
||||||
|
return resultsUrl
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkFlowRunId(): string {
|
||||||
|
const workFlowRunId = process.env['GITHUB_RUN_ID']
|
||||||
|
if (!workFlowRunId) {
|
||||||
|
throw new Error('Unable to get the GITHUB_RUN_ID environment variable which is required')
|
||||||
|
}
|
||||||
|
return workFlowRunId
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkSpaceDirectory(): string {
|
||||||
|
const workspaceDirectory = process.env['GITHUB_WORKSPACE']
|
||||||
|
if (!workspaceDirectory) {
|
||||||
|
throw new Error('Unable to get the GITHUB_WORKSPACE environment variable which is required')
|
||||||
|
}
|
||||||
|
return workspaceDirectory
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRetentionDays(): string | undefined {
|
||||||
|
return process.env['GITHUB_RETENTION_DAYS']
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getInitialRetryIntervalInMilliseconds(): number {
|
||||||
|
return 3000
|
||||||
|
}
|
||||||
|
|
||||||
|
// With exponential backoff, the larger the retry count, the larger the wait time before another attempt
|
||||||
|
// The retry multiplier controls by how much the backOff time increases depending on the number of retries
|
||||||
|
export function getRetryMultiplier(): number {
|
||||||
|
return 1.5
|
||||||
|
}
|
||||||
|
|
||||||
|
// The maximum number of retries that can be attempted before an upload or download fails
|
||||||
|
export function getRetryLimit(): number {
|
||||||
|
return 5
|
||||||
|
}
|
||||||
@@ -27,11 +27,11 @@ const invalidArtifactNameCharacters = new Map<string, string>([
|
|||||||
])
|
])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the name of the artifact to check to make sure there are no illegal characters
|
* Scans the name of the artifact to make sure there are no illegal characters
|
||||||
*/
|
*/
|
||||||
export function validateArtifactName(name: string): void {
|
export function checkArtifactName(name: string): void {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
throw new Error(`Provided artifact name input during validation is empty`)
|
throw new Error(`Artifact name: ${name}, is incorrectly provided`)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [
|
for (const [
|
||||||
@@ -40,7 +40,7 @@ export function validateArtifactName(name: string): void {
|
|||||||
] of invalidArtifactNameCharacters) {
|
] of invalidArtifactNameCharacters) {
|
||||||
if (name.includes(invalidCharacterKey)) {
|
if (name.includes(invalidCharacterKey)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The artifact name is not valid: ${name}. Contains the following character: ${errorMessageForCharacter}
|
`Artifact name is not valid: ${name}. Contains the following character: ${errorMessageForCharacter}
|
||||||
|
|
||||||
Invalid characters include: ${Array.from(
|
Invalid characters include: ${Array.from(
|
||||||
invalidArtifactNameCharacters.values()
|
invalidArtifactNameCharacters.values()
|
||||||
@@ -55,11 +55,11 @@ These characters are not allowed in the artifact name due to limitations with ce
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates file paths to check for any illegal characters that can cause problems on different file systems
|
* Scans the name of the filePath used to make sure there are no illegal characters
|
||||||
*/
|
*/
|
||||||
export function validateFilePath(path: string): void {
|
export function checkArtifactFilePath(path: string): void {
|
||||||
if (!path) {
|
if (!path) {
|
||||||
throw new Error(`Provided file path input during validation is empty`)
|
throw new Error(`Artifact path: ${path}, is incorrectly provided`)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [
|
for (const [
|
||||||
@@ -68,7 +68,7 @@ export function validateFilePath(path: string): void {
|
|||||||
] of invalidArtifactFilePathCharacters) {
|
] of invalidArtifactFilePathCharacters) {
|
||||||
if (path.includes(invalidCharacterKey)) {
|
if (path.includes(invalidCharacterKey)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The path for one of the files in artifact is not valid: ${path}. Contains the following character: ${errorMessageForCharacter}
|
`Artifact path is not valid: ${path}. Contains the following character: ${errorMessageForCharacter}
|
||||||
|
|
||||||
Invalid characters include: ${Array.from(
|
Invalid characters include: ${Array.from(
|
||||||
invalidArtifactFilePathCharacters.values()
|
invalidArtifactFilePathCharacters.values()
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
hello there! This is from a.txt
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
This is from b.txt
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
import {BlobClient, BlockBlobUploadStreamOptions} from '@azure/storage-blob'
|
||||||
|
import { TransferProgressEvent } from '@azure/core-http';
|
||||||
|
import * as a from 'archiver'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
import * as stream from 'stream'
|
||||||
|
|
||||||
|
const bufferSize = 1024 * 1024 * 8 // 8 MB
|
||||||
|
|
||||||
|
// Custom stream transformer so we can set the highWaterMark property
|
||||||
|
// See https://github.com/nodejs/node/issues/8855
|
||||||
|
export class ZipUploadStream extends stream.Transform {
|
||||||
|
constructor(bufferSize: number) {
|
||||||
|
super({
|
||||||
|
highWaterMark: bufferSize
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_transform(chunk:any, enc:any, cb:any) {
|
||||||
|
cb(null, chunk)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// for local testing, run this using ts-node testing.ts
|
||||||
|
export async function test(){
|
||||||
|
let sasURL = "paste here"
|
||||||
|
sasURL = sasURL.replace("http://devstoreaccount1.blob.codedev.localhost", "http://127.0.0.1:11000/devstoreaccount1")
|
||||||
|
|
||||||
|
const blobClient = new BlobClient(sasURL);
|
||||||
|
const zip = a.create('zip', {
|
||||||
|
zlib: { level: 9 } // Sets the compression level.
|
||||||
|
// Available options are 0-9
|
||||||
|
// 0 => no compression
|
||||||
|
// 1 => fastest with low compression
|
||||||
|
// 9 => highest compression ratio but the slowest
|
||||||
|
});
|
||||||
|
|
||||||
|
// append files that are going to be part of the final zip
|
||||||
|
zip.append('this is file 1', { name: 'file1.txt' });
|
||||||
|
zip.append('this is file 2', { name: 'file2.txt' });
|
||||||
|
zip.append('this is file 1 in a directory', { name: 'dir/file1.txt' });
|
||||||
|
zip.append('this is file 2 in a directory', { name: 'dir/file2.txt' });
|
||||||
|
zip.append('this is a live demo!!!', { name: 'dir/alive.txt' });
|
||||||
|
zip.append(fs.createReadStream('a.txt'), { name: 'dir2/a.txt' })
|
||||||
|
zip.append(fs.createReadStream('b.txt'), { name: 'dir2/b.txt' })
|
||||||
|
|
||||||
|
const zipUploadStream = new ZipUploadStream(bufferSize)
|
||||||
|
zip.pipe(zipUploadStream)
|
||||||
|
zip.finalize();
|
||||||
|
|
||||||
|
console.log("Write high watermark value " + zipUploadStream.writableHighWaterMark)
|
||||||
|
console.log("Read high watermark value " + zipUploadStream.readableHighWaterMark)
|
||||||
|
|
||||||
|
// good practice to catch warnings (ie stat failures and other non-blocking errors)
|
||||||
|
zip.on('warning', function(err) {
|
||||||
|
if (err.code === 'ENOENT') {
|
||||||
|
console.log("zip error ENOENT")
|
||||||
|
} else {
|
||||||
|
console.log("some other warning ")
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// good practice to catch this error explicitly
|
||||||
|
zip.on('error', function(err) {
|
||||||
|
console.log("some error with zip ")
|
||||||
|
console.log(err)
|
||||||
|
});
|
||||||
|
|
||||||
|
zip.on("progress", function(progress: a.ProgressData) {
|
||||||
|
console.log(progress)
|
||||||
|
|
||||||
|
/* This outputs data like this, we could potentially do something with this for even more logging to show the status of the zip creation
|
||||||
|
{
|
||||||
|
entries: { total: 7, processed: 1 },
|
||||||
|
fs: { totalBytes: 0, processedBytes: 0 }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
entries: { total: 7, processed: 2 },
|
||||||
|
fs: { totalBytes: 0, processedBytes: 0 }
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// We can add these to debug logging
|
||||||
|
zip.on('end', function() {
|
||||||
|
console.log("zip ending")
|
||||||
|
});
|
||||||
|
zip.on('finish', function() {
|
||||||
|
console.log("zip finished")
|
||||||
|
});
|
||||||
|
|
||||||
|
// Upload options
|
||||||
|
const maxBuffers = 5
|
||||||
|
const blockBlobClient = blobClient.getBlockBlobClient()
|
||||||
|
|
||||||
|
let uploadByteCount = 0
|
||||||
|
var myCallback = function(progress: TransferProgressEvent) {
|
||||||
|
console.log("Byte upload count " + progress.loadedBytes)
|
||||||
|
uploadByteCount = progress.loadedBytes
|
||||||
|
};
|
||||||
|
|
||||||
|
const options: BlockBlobUploadStreamOptions = {
|
||||||
|
blobHTTPHeaders: { "blobContentType": "zip" },
|
||||||
|
onProgress: myCallback
|
||||||
|
}
|
||||||
|
|
||||||
|
// Upload!
|
||||||
|
try {
|
||||||
|
const aa = await blockBlobClient.uploadStream(
|
||||||
|
zipUploadStream,
|
||||||
|
bufferSize,
|
||||||
|
maxBuffers,
|
||||||
|
options
|
||||||
|
);
|
||||||
|
} catch (error){
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
console.log("final upload size in bytes is " + uploadByteCount)
|
||||||
|
}
|
||||||
|
|
||||||
|
test()
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { ArtifactHttpClient } from '../../artifact-http-client'
|
||||||
|
import { ArtifactServiceClientJSON } from '../../../generated/results/api/v1/artifact.twirp'
|
||||||
|
|
||||||
|
export async function twirpTest(){
|
||||||
|
const artifactClient = new ArtifactHttpClient('@actions/artifact-upload')
|
||||||
|
const jsonClient = new ArtifactServiceClientJSON(artifactClient)
|
||||||
|
|
||||||
|
try {
|
||||||
|
const createResp = await jsonClient.CreateArtifact({workflowRunBackendId: "ce7f54c7-61c7-4aae-887f-30da475f5f1a", workflowJobRunBackendId: "ca395085-040a-526b-2ce8-bdc85f692774", name: Math.random().toString(), version: 4})
|
||||||
|
|
||||||
|
if (!createResp.ok) {
|
||||||
|
console.log("CreateArtifact failed")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(createResp.signedUploadUrl)
|
||||||
|
|
||||||
|
const finalizeResp = await jsonClient.FinalizeArtifact({workflowRunBackendId: "ce7f54c7-61c7-4aae-887f-30da475f5f1a", workflowJobRunBackendId: "ca395085-040a-526b-2ce8-bdc85f692774", name: Math.random().toString(), size: BigInt(5)})
|
||||||
|
|
||||||
|
if (!finalizeResp.ok) {
|
||||||
|
console.log("FinalizeArtifact failed")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("FinalizeArtifact succeeded")
|
||||||
|
}
|
||||||
|
|
||||||
|
twirpTest()
|
||||||
@@ -1,39 +1,189 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
|
import {checkArtifactName} from './path-and-artifact-name-validation'
|
||||||
import {UploadOptions} from './upload-options'
|
import {UploadOptions} from './upload-options'
|
||||||
import {UploadResponse} from './upload-response'
|
import {UploadResponse} from './upload-response'
|
||||||
import {validateArtifactName} from './path-and-artifact-name-validation'
|
import { UploadSpecification, getUploadSpecification } from './upload-specification'
|
||||||
import {
|
import { ArtifactHttpClient } from '../artifact-http-client'
|
||||||
UploadZipSpecification,
|
import { ArtifactServiceClientJSON } from '../../generated/results/api/v1/artifact.twirp'
|
||||||
getUploadZipSpecification,
|
|
||||||
validateRootDirectory
|
import {BlobClient, BlockBlobUploadStreamOptions} from '@azure/storage-blob'
|
||||||
} from './upload-zip-specification'
|
import { TransferProgressEvent } from '@azure/core-http';
|
||||||
|
import * as a from 'archiver'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
import * as stream from 'stream'
|
||||||
|
|
||||||
|
import {getBackendIds, BackendIds} from '../util'
|
||||||
|
|
||||||
|
const bufferSize = 1024 * 1024 * 8 // 8 MB
|
||||||
|
|
||||||
|
// Custom stream transformer so we can set the highWaterMark property
|
||||||
|
// See https://github.com/nodejs/node/issues/8855
|
||||||
|
export class ZipUploadStream extends stream.Transform {
|
||||||
|
constructor(bufferSize: number) {
|
||||||
|
super({
|
||||||
|
highWaterMark: bufferSize
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_transform(chunk:any, enc:any, cb:any) {
|
||||||
|
cb(null, chunk)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export async function uploadArtifact(
|
export async function uploadArtifact(
|
||||||
name: string,
|
name: string,
|
||||||
files: string[],
|
files: string[],
|
||||||
rootDirectory: string,
|
rootDirectory: string,
|
||||||
options?: UploadOptions | undefined // eslint-disable-line @typescript-eslint/no-unused-vars
|
options?: UploadOptions | undefined
|
||||||
): Promise<UploadResponse> {
|
): Promise<UploadResponse> {
|
||||||
validateArtifactName(name)
|
|
||||||
validateRootDirectory(rootDirectory)
|
|
||||||
|
|
||||||
const zipSpecification: UploadZipSpecification[] = getUploadZipSpecification(
|
let uploadByteCount = 0
|
||||||
files,
|
|
||||||
rootDirectory
|
// Need to keep checking the artifact name
|
||||||
|
checkArtifactName(name)
|
||||||
|
|
||||||
|
// Get specification for the files being uploaded
|
||||||
|
const uploadSpecification: UploadSpecification[] = getUploadSpecification(
|
||||||
|
name,
|
||||||
|
rootDirectory,
|
||||||
|
files
|
||||||
)
|
)
|
||||||
if (zipSpecification.length === 0) {
|
|
||||||
core.warning(`No files were found to upload`)
|
if (uploadSpecification.length === 0) {
|
||||||
return {
|
core.warning(`No files found that can be uploaded`)
|
||||||
success: false
|
} else {
|
||||||
}
|
const artifactClient = new ArtifactHttpClient('@actions/artifact-upload')
|
||||||
|
const jsonClient = new ArtifactServiceClientJSON(artifactClient)
|
||||||
|
|
||||||
|
const backendIDs: BackendIds = getBackendIds()
|
||||||
|
|
||||||
|
console.log("workflow Run Backend ID " + backendIDs.workflowRunBackendId)
|
||||||
|
console.log("workflow Job Run Backend ID " + backendIDs.workflowJobRunBackendId)
|
||||||
|
|
||||||
|
console.log("hello Rob!!")
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const createResp = await jsonClient.CreateArtifact({workflowRunBackendId: backendIDs.workflowRunBackendId, workflowJobRunBackendId: backendIDs.workflowJobRunBackendId, name: name, version: 4})
|
||||||
|
|
||||||
|
if (!createResp.ok) {
|
||||||
|
core.error("CreateArtifact failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO - Implement upload functionality
|
console.log(createResp.signedUploadUrl)
|
||||||
|
|
||||||
|
// Blob upload start
|
||||||
|
|
||||||
|
const blobClient = new BlobClient(createResp.signedUploadUrl);
|
||||||
|
const zip = a.create('zip', {
|
||||||
|
zlib: { level: 9 } // Sets the compression level.
|
||||||
|
// Available options are 0-9
|
||||||
|
// 0 => no compression
|
||||||
|
// 1 => fastest with low compression
|
||||||
|
// 9 => highest compression ratio but the slowest
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("file specification")
|
||||||
|
for (const file of uploadSpecification) {
|
||||||
|
console.log("uploadPath:" + file.uploadFilePath + " absolute:" + file.absoluteFilePath)
|
||||||
|
zip.append(fs.createReadStream(file.absoluteFilePath), {name: file.uploadFilePath})
|
||||||
|
}
|
||||||
|
|
||||||
|
const zipUploadStream = new ZipUploadStream(bufferSize)
|
||||||
|
zip.pipe(zipUploadStream)
|
||||||
|
zip.finalize();
|
||||||
|
|
||||||
|
console.log("Write high watermark value " + zipUploadStream.writableHighWaterMark)
|
||||||
|
console.log("Read high watermark value " + zipUploadStream.readableHighWaterMark)
|
||||||
|
|
||||||
|
// good practice to catch warnings (ie stat failures and other non-blocking errors)
|
||||||
|
zip.on('warning', function(err) {
|
||||||
|
if (err.code === 'ENOENT') {
|
||||||
|
console.log("zip error ENOENT")
|
||||||
|
} else {
|
||||||
|
console.log("some other warning ")
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// good practice to catch this error explicitly
|
||||||
|
zip.on('error', function(err) {
|
||||||
|
console.log("some error with zip ")
|
||||||
|
console.log(err)
|
||||||
|
});
|
||||||
|
|
||||||
|
zip.on("progress", function(progress: a.ProgressData) {
|
||||||
|
console.log(progress)
|
||||||
|
|
||||||
|
/* This outputs data like this, we could potentially do something with this for even more logging to show the status of the zip creation
|
||||||
|
{
|
||||||
|
entries: { total: 7, processed: 1 },
|
||||||
|
fs: { totalBytes: 0, processedBytes: 0 }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
entries: { total: 7, processed: 2 },
|
||||||
|
fs: { totalBytes: 0, processedBytes: 0 }
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// We can add these to debug logging
|
||||||
|
zip.on('end', function() {
|
||||||
|
console.log("zip ending")
|
||||||
|
});
|
||||||
|
zip.on('finish', function() {
|
||||||
|
console.log("zip finished")
|
||||||
|
});
|
||||||
|
|
||||||
|
// Upload options
|
||||||
|
const maxBuffers = 5
|
||||||
|
const blockBlobClient = blobClient.getBlockBlobClient()
|
||||||
|
|
||||||
|
var myCallback = function(progress: TransferProgressEvent) {
|
||||||
|
console.log("Byte upload count " + progress.loadedBytes)
|
||||||
|
uploadByteCount = progress.loadedBytes
|
||||||
|
};
|
||||||
|
|
||||||
|
const options: BlockBlobUploadStreamOptions = {
|
||||||
|
blobHTTPHeaders: { "blobContentType": "zip" },
|
||||||
|
onProgress: myCallback
|
||||||
|
}
|
||||||
|
|
||||||
|
// Upload!
|
||||||
|
try {
|
||||||
|
await blockBlobClient.uploadStream(
|
||||||
|
zipUploadStream,
|
||||||
|
bufferSize,
|
||||||
|
maxBuffers,
|
||||||
|
options
|
||||||
|
);
|
||||||
|
} catch (error){
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
console.log("final upload size in bytes is " + uploadByteCount)
|
||||||
|
|
||||||
|
console.log("we are done with the blob upload!")
|
||||||
|
// Blob upload end
|
||||||
|
|
||||||
|
const finalizeResp = await jsonClient.FinalizeArtifact({workflowRunBackendId: backendIDs.workflowRunBackendId, workflowJobRunBackendId: backendIDs.workflowJobRunBackendId, name: name, size: BigInt(5)})
|
||||||
|
|
||||||
|
if (!finalizeResp.ok) {
|
||||||
|
core.error("FinalizeArtifact failed")
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("FinalizeArtifact succeeded")
|
||||||
|
}
|
||||||
|
|
||||||
const uploadResponse: UploadResponse = {
|
const uploadResponse: UploadResponse = {
|
||||||
success: true,
|
artifactName: name,
|
||||||
size: 0,
|
size: uploadByteCount
|
||||||
id: 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return uploadResponse
|
return uploadResponse
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ export interface UploadOptions {
|
|||||||
* input of 0 assumes default retention setting.
|
* input of 0 assumes default retention setting.
|
||||||
*/
|
*/
|
||||||
retentionDays?: number
|
retentionDays?: number
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,11 @@
|
|||||||
export interface UploadResponse {
|
export interface UploadResponse {
|
||||||
/**
|
/**
|
||||||
* Denotes if an artifact was successfully uploaded
|
* The name of the artifact that was uploaded
|
||||||
*/
|
*/
|
||||||
success: boolean
|
artifactName: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Total size of the artifact in bytes. Not provided if no artifact was uploaded
|
* Total size of the artifact that was uploaded in bytes
|
||||||
*/
|
*/
|
||||||
size?: number
|
size: number
|
||||||
|
}
|
||||||
/**
|
|
||||||
* The id of the artifact that was created. Not provided if no artifact was uploaded
|
|
||||||
* This ID can be used as input to other APIs to download, delete or get more information about an artifact: https://docs.github.com/en/rest/actions/artifacts
|
|
||||||
*/
|
|
||||||
id?: number
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import * as fs from 'fs'
|
||||||
|
import {debug} from '@actions/core'
|
||||||
|
import {join, normalize, resolve} from 'path'
|
||||||
|
import {checkArtifactFilePath} from './path-and-artifact-name-validation'
|
||||||
|
|
||||||
|
export interface UploadSpecification {
|
||||||
|
absoluteFilePath: string
|
||||||
|
uploadFilePath: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a specification that describes how each file that is part of the artifact will be uploaded
|
||||||
|
* @param artifactName the name of the artifact being uploaded. Used during upload to denote where the artifact is stored on the server
|
||||||
|
* @param rootDirectory an absolute file path that denotes the path that should be removed from the beginning of each artifact file
|
||||||
|
* @param artifactFiles a list of absolute file paths that denote what should be uploaded as part of the artifact
|
||||||
|
*/
|
||||||
|
export function getUploadSpecification(
|
||||||
|
artifactName: string,
|
||||||
|
rootDirectory: string,
|
||||||
|
artifactFiles: string[]
|
||||||
|
): UploadSpecification[] {
|
||||||
|
// artifact name was checked earlier on, no need to check again
|
||||||
|
const specifications: UploadSpecification[] = []
|
||||||
|
|
||||||
|
if (!fs.existsSync(rootDirectory)) {
|
||||||
|
throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`)
|
||||||
|
}
|
||||||
|
if (!fs.statSync(rootDirectory).isDirectory()) {
|
||||||
|
throw new Error(
|
||||||
|
`Provided rootDirectory ${rootDirectory} is not a valid directory`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// Normalize and resolve, this allows for either absolute or relative paths to be used
|
||||||
|
rootDirectory = normalize(rootDirectory)
|
||||||
|
rootDirectory = resolve(rootDirectory)
|
||||||
|
|
||||||
|
/*
|
||||||
|
Example to demonstrate behavior
|
||||||
|
|
||||||
|
Input:
|
||||||
|
artifactName: my-artifact
|
||||||
|
rootDirectory: '/home/user/files/plz-upload'
|
||||||
|
artifactFiles: [
|
||||||
|
'/home/user/files/plz-upload/file1.txt',
|
||||||
|
'/home/user/files/plz-upload/file2.txt',
|
||||||
|
'/home/user/files/plz-upload/dir/file3.txt'
|
||||||
|
]
|
||||||
|
|
||||||
|
Output:
|
||||||
|
specifications: [
|
||||||
|
['/home/user/files/plz-upload/file1.txt', 'my-artifact/file1.txt'],
|
||||||
|
['/home/user/files/plz-upload/file1.txt', 'my-artifact/file2.txt'],
|
||||||
|
['/home/user/files/plz-upload/file1.txt', 'my-artifact/dir/file3.txt']
|
||||||
|
]
|
||||||
|
*/
|
||||||
|
for (let file of artifactFiles) {
|
||||||
|
if (!fs.existsSync(file)) {
|
||||||
|
throw new Error(`File ${file} does not exist`)
|
||||||
|
}
|
||||||
|
if (!fs.statSync(file).isDirectory()) {
|
||||||
|
// Normalize and resolve, this allows for either absolute or relative paths to be used
|
||||||
|
file = normalize(file)
|
||||||
|
file = resolve(file)
|
||||||
|
if (!file.startsWith(rootDirectory)) {
|
||||||
|
throw new Error(
|
||||||
|
`The rootDirectory: ${rootDirectory} is not a parent directory of the file: ${file}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for forbidden characters in file paths that will be rejected during upload
|
||||||
|
const uploadPath = file.replace(rootDirectory, '')
|
||||||
|
checkArtifactFilePath(uploadPath)
|
||||||
|
|
||||||
|
/*
|
||||||
|
uploadFilePath denotes where the file will be uploaded in the file container on the server. During a run, if multiple artifacts are uploaded, they will all
|
||||||
|
be saved in the same container. The artifact name is used as the root directory in the container to separate and distinguish uploaded artifacts
|
||||||
|
|
||||||
|
path.join handles all the following cases and would return 'artifact-name/file-to-upload.txt
|
||||||
|
join('artifact-name/', 'file-to-upload.txt')
|
||||||
|
join('artifact-name/', '/file-to-upload.txt')
|
||||||
|
join('artifact-name', 'file-to-upload.txt')
|
||||||
|
join('artifact-name', '/file-to-upload.txt')
|
||||||
|
*/
|
||||||
|
specifications.push({
|
||||||
|
absoluteFilePath: file,
|
||||||
|
uploadFilePath: join(artifactName, uploadPath)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// Directories are rejected by the server during upload
|
||||||
|
debug(`Removing ${file} from rawSearchResults because it is a directory`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return specifications
|
||||||
|
}
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
import * as fs from 'fs'
|
|
||||||
import {info} from '@actions/core'
|
|
||||||
import {normalize, resolve} from 'path'
|
|
||||||
import {validateFilePath} from './path-and-artifact-name-validation'
|
|
||||||
|
|
||||||
export interface UploadZipSpecification {
|
|
||||||
/**
|
|
||||||
* An absolute source path that points to a file that will be added to a zip. Null if creating a new directory
|
|
||||||
*/
|
|
||||||
sourcePath: string | null
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The destination path in a zip for a file
|
|
||||||
*/
|
|
||||||
destinationPath: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if a root directory exists and is valid
|
|
||||||
* @param rootDirectory an absolute root directory path common to all input files that that will be trimmed from the final zip structure
|
|
||||||
*/
|
|
||||||
export function validateRootDirectory(rootDirectory: string): void {
|
|
||||||
if (!fs.existsSync(rootDirectory)) {
|
|
||||||
throw new Error(
|
|
||||||
`The provided rootDirectory ${rootDirectory} does not exist`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (!fs.statSync(rootDirectory).isDirectory()) {
|
|
||||||
throw new Error(
|
|
||||||
`The provided rootDirectory ${rootDirectory} is not a valid directory`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
info(`Root directory input is valid!`)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a specification that describes how a zip file will be created for a set of input files
|
|
||||||
* @param filesToZip a list of file that should be included in the zip
|
|
||||||
* @param rootDirectory an absolute root directory path common to all input files that that will be trimmed from the final zip structure
|
|
||||||
*/
|
|
||||||
export function getUploadZipSpecification(
|
|
||||||
filesToZip: string[],
|
|
||||||
rootDirectory: string
|
|
||||||
): UploadZipSpecification[] {
|
|
||||||
const specification: UploadZipSpecification[] = []
|
|
||||||
|
|
||||||
// Normalize and resolve, this allows for either absolute or relative paths to be used
|
|
||||||
rootDirectory = normalize(rootDirectory)
|
|
||||||
rootDirectory = resolve(rootDirectory)
|
|
||||||
|
|
||||||
/*
|
|
||||||
Example
|
|
||||||
|
|
||||||
Input:
|
|
||||||
rootDirectory: '/home/user/files/plz-upload'
|
|
||||||
artifactFiles: [
|
|
||||||
'/home/user/files/plz-upload/file1.txt',
|
|
||||||
'/home/user/files/plz-upload/file2.txt',
|
|
||||||
'/home/user/files/plz-upload/dir/file3.txt'
|
|
||||||
]
|
|
||||||
|
|
||||||
Output:
|
|
||||||
specifications: [
|
|
||||||
['/home/user/files/plz-upload/file1.txt', '/file1.txt'],
|
|
||||||
['/home/user/files/plz-upload/file1.txt', '/file2.txt'],
|
|
||||||
['/home/user/files/plz-upload/file1.txt', '/dir/file3.txt']
|
|
||||||
]
|
|
||||||
|
|
||||||
The final zip that is later uploaded will look like this:
|
|
||||||
|
|
||||||
my-artifact.zip
|
|
||||||
- file.txt
|
|
||||||
- file2.txt
|
|
||||||
- dir/
|
|
||||||
- file3.txt
|
|
||||||
*/
|
|
||||||
for (let file of filesToZip) {
|
|
||||||
if (!fs.existsSync(file)) {
|
|
||||||
throw new Error(`File ${file} does not exist`)
|
|
||||||
}
|
|
||||||
if (!fs.statSync(file).isDirectory()) {
|
|
||||||
// Normalize and resolve, this allows for either absolute or relative paths to be used
|
|
||||||
file = normalize(file)
|
|
||||||
file = resolve(file)
|
|
||||||
if (!file.startsWith(rootDirectory)) {
|
|
||||||
throw new Error(
|
|
||||||
`The rootDirectory: ${rootDirectory} is not a parent directory of the file: ${file}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for forbidden characters in file paths that may cause ambiguous behavior if downloaded on different file systems
|
|
||||||
const uploadPath = file.replace(rootDirectory, '')
|
|
||||||
validateFilePath(uploadPath)
|
|
||||||
|
|
||||||
specification.push({
|
|
||||||
sourcePath: file,
|
|
||||||
destinationPath: uploadPath
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// Empty directory
|
|
||||||
const directoryPath = file.replace(rootDirectory, '')
|
|
||||||
validateFilePath(directoryPath)
|
|
||||||
|
|
||||||
specification.push({
|
|
||||||
sourcePath: null,
|
|
||||||
destinationPath: directoryPath
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return specification
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import { getRuntimeToken } from './config';
|
||||||
|
|
||||||
|
export interface BackendIds {
|
||||||
|
workflowRunBackendId: string;
|
||||||
|
workflowJobRunBackendId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getBackendIds(): BackendIds {
|
||||||
|
const token = getRuntimeToken();
|
||||||
|
const parsedToken = JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString())
|
||||||
|
if (!parsedToken["scp"]) {
|
||||||
|
throw new Error('Unable to get scp from token')
|
||||||
|
}
|
||||||
|
|
||||||
|
const scp = parsedToken["scp"]
|
||||||
|
const scpParts = scp.split(' ')
|
||||||
|
if (scpParts.length == 0) {
|
||||||
|
throw new Error('No scp parts found')
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const part of scpParts) {
|
||||||
|
const partParts = part.split(':')
|
||||||
|
if(partParts.length == 0) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (partParts[0] == "Actions.Results") {
|
||||||
|
if (partParts.length == 3) {
|
||||||
|
return {workflowRunBackendId: partParts[1], workflowJobRunBackendId: partParts[2]}
|
||||||
|
}
|
||||||
|
throw new Error('Unable to parse Actions.Results scp part')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('Unable to find ids')
|
||||||
|
}
|
||||||
@@ -4,15 +4,11 @@
|
|||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"paths": {
|
"lib": [
|
||||||
"@actions/core": [
|
"es2020"
|
||||||
"../core"
|
|
||||||
],
|
],
|
||||||
"@actions/http-client": [
|
"module": "commonjs",
|
||||||
"../http-client"
|
"target": "es2020"
|
||||||
]
|
|
||||||
},
|
|
||||||
"useUnknownInCatchVariables": false
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./src"
|
"./src"
|
||||||
|
|||||||
Vendored
-4
@@ -160,7 +160,3 @@
|
|||||||
### 3.2.1
|
### 3.2.1
|
||||||
|
|
||||||
- Updated @azure/storage-blob to `v12.13.0`
|
- Updated @azure/storage-blob to `v12.13.0`
|
||||||
|
|
||||||
### 3.2.2
|
|
||||||
|
|
||||||
- Add new default cache download method to improve performance and reduce hangs [#1484](https://github.com/actions/toolkit/pull/1484)
|
|
||||||
|
|||||||
+6
-21
@@ -84,24 +84,18 @@ test('downloadCache uses storage SDK for Azure storage URLs', async () => {
|
|||||||
'downloadCacheStorageSDK'
|
'downloadCacheStorageSDK'
|
||||||
)
|
)
|
||||||
|
|
||||||
const downloadCacheHttpClientConcurrentMock = jest.spyOn(
|
|
||||||
downloadUtils,
|
|
||||||
'downloadCacheHttpClientConcurrent'
|
|
||||||
)
|
|
||||||
|
|
||||||
const archiveLocation = 'http://foo.blob.core.windows.net/bar/baz'
|
const archiveLocation = 'http://foo.blob.core.windows.net/bar/baz'
|
||||||
const archivePath = '/foo/bar'
|
const archivePath = '/foo/bar'
|
||||||
|
|
||||||
await downloadCache(archiveLocation, archivePath)
|
await downloadCache(archiveLocation, archivePath)
|
||||||
|
|
||||||
expect(downloadCacheHttpClientConcurrentMock).toHaveBeenCalledTimes(1)
|
expect(downloadCacheStorageSDKMock).toHaveBeenCalledTimes(1)
|
||||||
expect(downloadCacheHttpClientConcurrentMock).toHaveBeenCalledWith(
|
expect(downloadCacheStorageSDKMock).toHaveBeenCalledWith(
|
||||||
archiveLocation,
|
archiveLocation,
|
||||||
archivePath,
|
archivePath,
|
||||||
getDownloadOptions()
|
getDownloadOptions()
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(downloadCacheStorageSDKMock).toHaveBeenCalledTimes(0)
|
|
||||||
expect(downloadCacheHttpClientMock).toHaveBeenCalledTimes(0)
|
expect(downloadCacheHttpClientMock).toHaveBeenCalledTimes(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -115,26 +109,20 @@ test('downloadCache passes options to download methods', async () => {
|
|||||||
'downloadCacheStorageSDK'
|
'downloadCacheStorageSDK'
|
||||||
)
|
)
|
||||||
|
|
||||||
const downloadCacheHttpClientConcurrentMock = jest.spyOn(
|
|
||||||
downloadUtils,
|
|
||||||
'downloadCacheHttpClientConcurrent'
|
|
||||||
)
|
|
||||||
|
|
||||||
const archiveLocation = 'http://foo.blob.core.windows.net/bar/baz'
|
const archiveLocation = 'http://foo.blob.core.windows.net/bar/baz'
|
||||||
const archivePath = '/foo/bar'
|
const archivePath = '/foo/bar'
|
||||||
const options: DownloadOptions = {downloadConcurrency: 4}
|
const options: DownloadOptions = {downloadConcurrency: 4}
|
||||||
|
|
||||||
await downloadCache(archiveLocation, archivePath, options)
|
await downloadCache(archiveLocation, archivePath, options)
|
||||||
|
|
||||||
expect(downloadCacheHttpClientConcurrentMock).toHaveBeenCalledTimes(1)
|
expect(downloadCacheStorageSDKMock).toHaveBeenCalledTimes(1)
|
||||||
expect(downloadCacheHttpClientConcurrentMock).toHaveBeenCalled()
|
expect(downloadCacheStorageSDKMock).toHaveBeenCalled()
|
||||||
expect(downloadCacheHttpClientConcurrentMock).toHaveBeenCalledWith(
|
expect(downloadCacheStorageSDKMock).toHaveBeenCalledWith(
|
||||||
archiveLocation,
|
archiveLocation,
|
||||||
archivePath,
|
archivePath,
|
||||||
getDownloadOptions(options)
|
getDownloadOptions(options)
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(downloadCacheStorageSDKMock).toHaveBeenCalledTimes(0)
|
|
||||||
expect(downloadCacheHttpClientMock).toHaveBeenCalledTimes(0)
|
expect(downloadCacheHttpClientMock).toHaveBeenCalledTimes(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -150,10 +138,7 @@ test('downloadCache uses http-client when overridden', async () => {
|
|||||||
|
|
||||||
const archiveLocation = 'http://foo.blob.core.windows.net/bar/baz'
|
const archiveLocation = 'http://foo.blob.core.windows.net/bar/baz'
|
||||||
const archivePath = '/foo/bar'
|
const archivePath = '/foo/bar'
|
||||||
const options: DownloadOptions = {
|
const options: DownloadOptions = {useAzureSdk: false}
|
||||||
useAzureSdk: false,
|
|
||||||
concurrentBlobDownloads: false
|
|
||||||
}
|
|
||||||
|
|
||||||
await downloadCache(archiveLocation, archivePath, options)
|
await downloadCache(archiveLocation, archivePath, options)
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -5,8 +5,7 @@ import {
|
|||||||
getUploadOptions
|
getUploadOptions
|
||||||
} from '../src/options'
|
} from '../src/options'
|
||||||
|
|
||||||
const useAzureSdk = false
|
const useAzureSdk = true
|
||||||
const concurrentBlobDownloads = true
|
|
||||||
const downloadConcurrency = 8
|
const downloadConcurrency = 8
|
||||||
const timeoutInMs = 30000
|
const timeoutInMs = 30000
|
||||||
const segmentTimeoutInMs = 600000
|
const segmentTimeoutInMs = 600000
|
||||||
@@ -19,7 +18,6 @@ test('getDownloadOptions sets defaults', async () => {
|
|||||||
|
|
||||||
expect(actualOptions).toEqual({
|
expect(actualOptions).toEqual({
|
||||||
useAzureSdk,
|
useAzureSdk,
|
||||||
concurrentBlobDownloads,
|
|
||||||
downloadConcurrency,
|
downloadConcurrency,
|
||||||
timeoutInMs,
|
timeoutInMs,
|
||||||
segmentTimeoutInMs,
|
segmentTimeoutInMs,
|
||||||
@@ -29,8 +27,7 @@ test('getDownloadOptions sets defaults', async () => {
|
|||||||
|
|
||||||
test('getDownloadOptions overrides all settings', async () => {
|
test('getDownloadOptions overrides all settings', async () => {
|
||||||
const expectedOptions: DownloadOptions = {
|
const expectedOptions: DownloadOptions = {
|
||||||
useAzureSdk: true,
|
useAzureSdk: false,
|
||||||
concurrentBlobDownloads: false,
|
|
||||||
downloadConcurrency: 14,
|
downloadConcurrency: 14,
|
||||||
timeoutInMs: 20000,
|
timeoutInMs: 20000,
|
||||||
segmentTimeoutInMs: 3600000,
|
segmentTimeoutInMs: 3600000,
|
||||||
|
|||||||
+341
-172
@@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.2.2",
|
"version": "3.2.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.2.2",
|
"version": "3.2.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
"@actions/glob": "^0.1.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@actions/http-client": "^2.1.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/io": "^1.0.1",
|
"@actions/io": "^1.0.1",
|
||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
@@ -52,26 +52,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/glob": {
|
"node_modules/@actions/glob": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.0.tgz",
|
||||||
"integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==",
|
"integrity": "sha512-lx8SzyQ2FE9+UUvjqY1f28QbTJv+w8qP7kHHbfQRhphrlcx0Mdmm1tZdGJzfxv1jxREa/sLW4Oy8CbGQKCJySA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.0",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
"node_modules/@actions/http-client": {
|
||||||
"version": "2.1.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/io": {
|
"node_modules/@actions/io": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.2.tgz",
|
||||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
||||||
},
|
},
|
||||||
"node_modules/@azure/abort-controller": {
|
"node_modules/@azure/abort-controller": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
@@ -84,10 +84,20 @@
|
|||||||
"node": ">=12.0.0"
|
"node": ">=12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/abort-controller/node_modules/tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
},
|
||||||
|
"node_modules/@azure/core-asynciterator-polyfill": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg=="
|
||||||
|
},
|
||||||
"node_modules/@azure/core-auth": {
|
"node_modules/@azure/core-auth": {
|
||||||
"version": "1.4.0",
|
"version": "1.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz",
|
||||||
"integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==",
|
"integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
@@ -96,10 +106,15 @@
|
|||||||
"node": ">=12.0.0"
|
"node": ">=12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/core-auth/node_modules/tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
},
|
||||||
"node_modules/@azure/core-http": {
|
"node_modules/@azure/core-http": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.1.tgz",
|
||||||
"integrity": "sha512-o1wR9JrmoM0xEAa0Ue7Sp8j+uJvmqYaGoHOCT5qaVYmvgmnZDC0OvQimPA/JR3u77Sz6D1y3Xmk1y69cDU9q9A==",
|
"integrity": "sha512-A3x+um3cAPgQe42Lu7Iv/x8/fNjhL/nIoEfqFxfn30EyxK6zC13n+OUxzZBRC0IzQqssqIbt4INf5YG7lYYFtw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"@azure/core-auth": "^1.3.0",
|
"@azure/core-auth": "^1.3.0",
|
||||||
@@ -133,6 +148,11 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/core-http/node_modules/tslib": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||||
|
},
|
||||||
"node_modules/@azure/core-http/node_modules/uuid": {
|
"node_modules/@azure/core-http/node_modules/uuid": {
|
||||||
"version": "8.3.2",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
@@ -142,30 +162,41 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azure/core-lro": {
|
"node_modules/@azure/core-lro": {
|
||||||
"version": "2.5.4",
|
"version": "2.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.3.tgz",
|
||||||
"integrity": "sha512-3GJiMVH7/10bulzOKGrrLeG/uCBH/9VtxqaMcB9lIqAeamI/xYQSHJL/KcsLDuH+yTjYpro/u6D/MuRe4dN70Q==",
|
"integrity": "sha512-UMdlR9NsqDCLTba3EUbRjfMF4gDmWvld196JmUjbz9WWhJ2XT00OR5MXeWiR+vmGT+ETiO4hHFCi2/eGO5YVtg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"@azure/core-util": "^1.2.0",
|
"@azure/core-tracing": "1.0.0-preview.13",
|
||||||
"@azure/logger": "^1.0.0",
|
"@azure/logger": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/core-lro/node_modules/tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
},
|
||||||
"node_modules/@azure/core-paging": {
|
"node_modules/@azure/core-paging": {
|
||||||
"version": "1.5.0",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.1.tgz",
|
||||||
"integrity": "sha512-zqWdVIt+2Z+3wqxEOGzR5hXFZ8MGKK52x4vFLw8n58pR6ZfKRx3EXYTxTaYxYHc/PexPUTyimcTWFJbji9Z6Iw==",
|
"integrity": "sha512-UtH5iMlYsvg+nQYIl4UHlvvSrsBjOlRF4fs0j7mxd3rWdAStrKYrh2durOpHs5C9yZbVhsVDaisoyaf/lL1EVA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@azure/core-asynciterator-polyfill": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/core-paging/node_modules/tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
},
|
||||||
"node_modules/@azure/core-tracing": {
|
"node_modules/@azure/core-tracing": {
|
||||||
"version": "1.0.0-preview.13",
|
"version": "1.0.0-preview.13",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz",
|
||||||
@@ -178,10 +209,15 @@
|
|||||||
"node": ">=12.0.0"
|
"node": ">=12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/core-tracing/node_modules/tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
},
|
||||||
"node_modules/@azure/core-util": {
|
"node_modules/@azure/core-util": {
|
||||||
"version": "1.3.2",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.2.0.tgz",
|
||||||
"integrity": "sha512-2bECOUh88RvL1pMZTcc6OzfobBeWDBf5oBbhjIhT1MV9otMVWCzpOJkkiKtrnO88y5GGBelgY8At73KGAdbkeQ==",
|
"integrity": "sha512-ffGIw+Qs8bNKNLxz5UPkz4/VBM/EZY07mPve1ZYFqYUdPwFqRj0RPk0U7LZMOfT7GCck9YjuT1Rfp1PApNl1ng==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
@@ -190,37 +226,43 @@
|
|||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/core-util/node_modules/tslib": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||||
|
},
|
||||||
"node_modules/@azure/logger": {
|
"node_modules/@azure/logger": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz",
|
||||||
"integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==",
|
"integrity": "sha512-aK4s3Xxjrx3daZr3VylxejK3vG5ExXck5WOHDJ8in/k9AqlfIyFMMT1uG7u8mNjX+QRILTIn0/Xgschfh/dQ9g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/logger/node_modules/tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
},
|
||||||
"node_modules/@azure/ms-rest-js": {
|
"node_modules/@azure/ms-rest-js": {
|
||||||
"version": "2.7.0",
|
"version": "2.6.6",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz",
|
||||||
"integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==",
|
"integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/core-auth": "^1.1.4",
|
"@azure/core-auth": "^1.1.4",
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
"form-data": "^2.5.0",
|
"form-data": "^2.5.0",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
|
"tough-cookie": "^3.0.1",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"tunnel": "0.0.6",
|
"tunnel": "0.0.6",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"xml2js": "^0.5.0"
|
"xml2js": "^0.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azure/ms-rest-js/node_modules/tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
},
|
|
||||||
"node_modules/@azure/ms-rest-js/node_modules/uuid": {
|
"node_modules/@azure/ms-rest-js/node_modules/uuid": {
|
||||||
"version": "8.3.2",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
@@ -230,9 +272,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azure/storage-blob": {
|
"node_modules/@azure/storage-blob": {
|
||||||
"version": "12.15.0",
|
"version": "12.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.13.0.tgz",
|
||||||
"integrity": "sha512-e7JBKLOFi0QVJqqLzrjx1eL3je3/Ug2IQj24cTM9b85CsnnFjLGeGjJVIjbGGZaytewiCEG7r3lRwQX7fKj0/w==",
|
"integrity": "sha512-t3Q2lvBMJucgTjQcP5+hvEJMAsJSk0qmAnjDLie2td017IiduZbbC9BOcFfmwzR6y6cJdZOuewLCNFmEx9IrXA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"@azure/core-http": "^3.0.0",
|
"@azure/core-http": "^3.0.0",
|
||||||
@@ -247,23 +289,28 @@
|
|||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@azure/storage-blob/node_modules/tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
},
|
||||||
"node_modules/@opentelemetry/api": {
|
"node_modules/@opentelemetry/api": {
|
||||||
"version": "1.4.1",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.4.tgz",
|
||||||
"integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==",
|
"integrity": "sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.0.0"
|
"node": ">=8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.4.6",
|
"version": "18.14.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.6.tgz",
|
||||||
"integrity": "sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA=="
|
"integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/node-fetch": {
|
"node_modules/@types/node-fetch": {
|
||||||
"version": "2.6.4",
|
"version": "2.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||||
"integrity": "sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==",
|
"integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"form-data": "^3.0.0"
|
"form-data": "^3.0.0"
|
||||||
@@ -283,9 +330,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/semver": {
|
"node_modules/@types/semver": {
|
||||||
"version": "6.2.3",
|
"version": "6.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.1.tgz",
|
||||||
"integrity": "sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==",
|
"integrity": "sha512-+beqKQOh9PYxuHvijhVl+tIHvT6tuwOrE9m14zd+MT2A38KoKZhh7pYJ0SNleLtwDsiIxHDsIk9bv01oOxvSvA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/tunnel": {
|
"node_modules/@types/tunnel": {
|
||||||
@@ -297,9 +344,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/uuid": {
|
"node_modules/@types/uuid": {
|
||||||
"version": "3.4.10",
|
"version": "3.4.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.9.tgz",
|
||||||
"integrity": "sha512-BgeaZuElf7DEYZhWYDTc/XcLZXdVgFkVSTa13BqKvbnmUrxr3TJFKofUxCtDO9UQOdhnV+HPOESdHiHKZOJV1A==",
|
"integrity": "sha512-XDwyIlt/47l2kWLTzw/mtrpLdB+GPSskR2n/PIcPn+VYhVO77rGhRncIR5GPU0KRzXuqkDO+J5qqrG0Y8P6jzQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/abort-controller": {
|
"node_modules/abort-controller": {
|
||||||
@@ -316,12 +363,12 @@
|
|||||||
"node_modules/asynckit": {
|
"node_modules/asynckit": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
},
|
},
|
||||||
"node_modules/brace-expansion": {
|
"node_modules/brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
@@ -346,12 +393,12 @@
|
|||||||
"node_modules/concat-map": {
|
"node_modules/concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
},
|
},
|
||||||
"node_modules/delayed-stream": {
|
"node_modules/delayed-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
@@ -385,20 +432,28 @@
|
|||||||
"node": ">= 0.12"
|
"node": ">= 0.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ip-regex": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/mime-db": {
|
"node_modules/mime-db": {
|
||||||
"version": "1.52.0",
|
"version": "1.51.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mime-types": {
|
"node_modules/mime-types": {
|
||||||
"version": "2.1.35",
|
"version": "2.1.34",
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mime-db": "1.52.0"
|
"mime-db": "1.51.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
@@ -416,9 +471,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
"node_modules/node-fetch": {
|
||||||
"version": "2.6.12",
|
"version": "2.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||||
"integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==",
|
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"whatwg-url": "^5.0.0"
|
"whatwg-url": "^5.0.0"
|
||||||
},
|
},
|
||||||
@@ -442,28 +497,54 @@
|
|||||||
"node": ">= 0.6.0"
|
"node": ">= 0.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/psl": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
|
||||||
|
"integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
|
||||||
|
},
|
||||||
|
"node_modules/punycode": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/sax": {
|
"node_modules/sax": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "6.3.1",
|
"version": "6.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"semver": "bin/semver.js"
|
"semver": "bin/semver.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tough-cookie": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==",
|
||||||
|
"dependencies": {
|
||||||
|
"ip-regex": "^2.1.0",
|
||||||
|
"psl": "^1.1.28",
|
||||||
|
"punycode": "^2.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tr46": {
|
"node_modules/tr46": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||||
},
|
},
|
||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
"version": "2.6.1",
|
"version": "1.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||||
"integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig=="
|
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||||
},
|
},
|
||||||
"node_modules/tunnel": {
|
"node_modules/tunnel": {
|
||||||
"version": "0.0.6",
|
"version": "0.0.6",
|
||||||
@@ -474,9 +555,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.9.5",
|
"version": "4.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
@@ -498,12 +579,12 @@
|
|||||||
"node_modules/webidl-conversions": {
|
"node_modules/webidl-conversions": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||||
},
|
},
|
||||||
"node_modules/whatwg-url": {
|
"node_modules/whatwg-url": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tr46": "~0.0.3",
|
"tr46": "~0.0.3",
|
||||||
"webidl-conversions": "^3.0.0"
|
"webidl-conversions": "^3.0.0"
|
||||||
@@ -556,26 +637,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/glob": {
|
"@actions/glob": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.0.tgz",
|
||||||
"integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==",
|
"integrity": "sha512-lx8SzyQ2FE9+UUvjqY1f28QbTJv+w8qP7kHHbfQRhphrlcx0Mdmm1tZdGJzfxv1jxREa/sLW4Oy8CbGQKCJySA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.0",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
"version": "2.1.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/io": {
|
"@actions/io": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.2.tgz",
|
||||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
||||||
},
|
},
|
||||||
"@azure/abort-controller": {
|
"@azure/abort-controller": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
@@ -583,21 +664,40 @@
|
|||||||
"integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==",
|
"integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@azure/core-asynciterator-polyfill": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg=="
|
||||||
|
},
|
||||||
"@azure/core-auth": {
|
"@azure/core-auth": {
|
||||||
"version": "1.4.0",
|
"version": "1.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz",
|
||||||
"integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==",
|
"integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/core-http": {
|
"@azure/core-http": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.1.tgz",
|
||||||
"integrity": "sha512-o1wR9JrmoM0xEAa0Ue7Sp8j+uJvmqYaGoHOCT5qaVYmvgmnZDC0OvQimPA/JR3u77Sz6D1y3Xmk1y69cDU9q9A==",
|
"integrity": "sha512-A3x+um3cAPgQe42Lu7Iv/x8/fNjhL/nIoEfqFxfn30EyxK6zC13n+OUxzZBRC0IzQqssqIbt4INf5YG7lYYFtw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"@azure/core-auth": "^1.3.0",
|
"@azure/core-auth": "^1.3.0",
|
||||||
@@ -625,6 +725,11 @@
|
|||||||
"mime-types": "^2.1.12"
|
"mime-types": "^2.1.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||||
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "8.3.2",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
@@ -633,22 +738,37 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/core-lro": {
|
"@azure/core-lro": {
|
||||||
"version": "2.5.4",
|
"version": "2.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.3.tgz",
|
||||||
"integrity": "sha512-3GJiMVH7/10bulzOKGrrLeG/uCBH/9VtxqaMcB9lIqAeamI/xYQSHJL/KcsLDuH+yTjYpro/u6D/MuRe4dN70Q==",
|
"integrity": "sha512-UMdlR9NsqDCLTba3EUbRjfMF4gDmWvld196JmUjbz9WWhJ2XT00OR5MXeWiR+vmGT+ETiO4hHFCi2/eGO5YVtg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"@azure/core-util": "^1.2.0",
|
"@azure/core-tracing": "1.0.0-preview.13",
|
||||||
"@azure/logger": "^1.0.0",
|
"@azure/logger": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/core-paging": {
|
"@azure/core-paging": {
|
||||||
"version": "1.5.0",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.1.tgz",
|
||||||
"integrity": "sha512-zqWdVIt+2Z+3wqxEOGzR5hXFZ8MGKK52x4vFLw8n58pR6ZfKRx3EXYTxTaYxYHc/PexPUTyimcTWFJbji9Z6Iw==",
|
"integrity": "sha512-UtH5iMlYsvg+nQYIl4UHlvvSrsBjOlRF4fs0j7mxd3rWdAStrKYrh2durOpHs5C9yZbVhsVDaisoyaf/lL1EVA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@azure/core-asynciterator-polyfill": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/core-tracing": {
|
"@azure/core-tracing": {
|
||||||
@@ -658,45 +778,62 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"@opentelemetry/api": "^1.0.1",
|
"@opentelemetry/api": "^1.0.1",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/core-util": {
|
"@azure/core-util": {
|
||||||
"version": "1.3.2",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.2.0.tgz",
|
||||||
"integrity": "sha512-2bECOUh88RvL1pMZTcc6OzfobBeWDBf5oBbhjIhT1MV9otMVWCzpOJkkiKtrnO88y5GGBelgY8At73KGAdbkeQ==",
|
"integrity": "sha512-ffGIw+Qs8bNKNLxz5UPkz4/VBM/EZY07mPve1ZYFqYUdPwFqRj0RPk0U7LZMOfT7GCck9YjuT1Rfp1PApNl1ng==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/logger": {
|
"@azure/logger": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz",
|
||||||
"integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==",
|
"integrity": "sha512-aK4s3Xxjrx3daZr3VylxejK3vG5ExXck5WOHDJ8in/k9AqlfIyFMMT1uG7u8mNjX+QRILTIn0/Xgschfh/dQ9g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/ms-rest-js": {
|
"@azure/ms-rest-js": {
|
||||||
"version": "2.7.0",
|
"version": "2.6.6",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz",
|
||||||
"integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==",
|
"integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@azure/core-auth": "^1.1.4",
|
"@azure/core-auth": "^1.1.4",
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
"form-data": "^2.5.0",
|
"form-data": "^2.5.0",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
|
"tough-cookie": "^3.0.1",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"tunnel": "0.0.6",
|
"tunnel": "0.0.6",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"xml2js": "^0.5.0"
|
"xml2js": "^0.5.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tslib": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
|
||||||
},
|
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "8.3.2",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
@@ -705,9 +842,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@azure/storage-blob": {
|
"@azure/storage-blob": {
|
||||||
"version": "12.15.0",
|
"version": "12.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.13.0.tgz",
|
||||||
"integrity": "sha512-e7JBKLOFi0QVJqqLzrjx1eL3je3/Ug2IQj24cTM9b85CsnnFjLGeGjJVIjbGGZaytewiCEG7r3lRwQX7fKj0/w==",
|
"integrity": "sha512-t3Q2lvBMJucgTjQcP5+hvEJMAsJSk0qmAnjDLie2td017IiduZbbC9BOcFfmwzR6y6cJdZOuewLCNFmEx9IrXA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@azure/abort-controller": "^1.0.0",
|
"@azure/abort-controller": "^1.0.0",
|
||||||
"@azure/core-http": "^3.0.0",
|
"@azure/core-http": "^3.0.0",
|
||||||
@@ -717,22 +854,29 @@
|
|||||||
"@azure/logger": "^1.0.0",
|
"@azure/logger": "^1.0.0",
|
||||||
"events": "^3.0.0",
|
"events": "^3.0.0",
|
||||||
"tslib": "^2.2.0"
|
"tslib": "^2.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@opentelemetry/api": {
|
"@opentelemetry/api": {
|
||||||
"version": "1.4.1",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.4.tgz",
|
||||||
"integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA=="
|
"integrity": "sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "20.4.6",
|
"version": "18.14.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.6.tgz",
|
||||||
"integrity": "sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA=="
|
"integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA=="
|
||||||
},
|
},
|
||||||
"@types/node-fetch": {
|
"@types/node-fetch": {
|
||||||
"version": "2.6.4",
|
"version": "2.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||||
"integrity": "sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==",
|
"integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"form-data": "^3.0.0"
|
"form-data": "^3.0.0"
|
||||||
@@ -751,9 +895,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/semver": {
|
"@types/semver": {
|
||||||
"version": "6.2.3",
|
"version": "6.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.1.tgz",
|
||||||
"integrity": "sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==",
|
"integrity": "sha512-+beqKQOh9PYxuHvijhVl+tIHvT6tuwOrE9m14zd+MT2A38KoKZhh7pYJ0SNleLtwDsiIxHDsIk9bv01oOxvSvA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/tunnel": {
|
"@types/tunnel": {
|
||||||
@@ -765,9 +909,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/uuid": {
|
"@types/uuid": {
|
||||||
"version": "3.4.10",
|
"version": "3.4.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.9.tgz",
|
||||||
"integrity": "sha512-BgeaZuElf7DEYZhWYDTc/XcLZXdVgFkVSTa13BqKvbnmUrxr3TJFKofUxCtDO9UQOdhnV+HPOESdHiHKZOJV1A==",
|
"integrity": "sha512-XDwyIlt/47l2kWLTzw/mtrpLdB+GPSskR2n/PIcPn+VYhVO77rGhRncIR5GPU0KRzXuqkDO+J5qqrG0Y8P6jzQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"abort-controller": {
|
"abort-controller": {
|
||||||
@@ -781,12 +925,12 @@
|
|||||||
"asynckit": {
|
"asynckit": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
@@ -808,12 +952,12 @@
|
|||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
},
|
},
|
||||||
"delayed-stream": {
|
"delayed-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
|
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||||
},
|
},
|
||||||
"event-target-shim": {
|
"event-target-shim": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
@@ -835,17 +979,22 @@
|
|||||||
"mime-types": "^2.1.12"
|
"mime-types": "^2.1.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ip-regex": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk="
|
||||||
|
},
|
||||||
"mime-db": {
|
"mime-db": {
|
||||||
"version": "1.52.0",
|
"version": "1.51.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g=="
|
||||||
},
|
},
|
||||||
"mime-types": {
|
"mime-types": {
|
||||||
"version": "2.1.35",
|
"version": "2.1.34",
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"mime-db": "1.52.0"
|
"mime-db": "1.51.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
@@ -857,9 +1006,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.12",
|
"version": "2.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||||
"integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==",
|
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"whatwg-url": "^5.0.0"
|
"whatwg-url": "^5.0.0"
|
||||||
}
|
}
|
||||||
@@ -869,25 +1018,45 @@
|
|||||||
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
||||||
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="
|
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="
|
||||||
},
|
},
|
||||||
|
"psl": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
|
||||||
|
"integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
|
||||||
|
},
|
||||||
|
"punycode": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
||||||
|
},
|
||||||
"sax": {
|
"sax": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "6.3.1",
|
"version": "6.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||||
|
},
|
||||||
|
"tough-cookie": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==",
|
||||||
|
"requires": {
|
||||||
|
"ip-regex": "^2.1.0",
|
||||||
|
"psl": "^1.1.28",
|
||||||
|
"punycode": "^2.1.1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"tr46": {
|
"tr46": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||||
},
|
},
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "2.6.1",
|
"version": "1.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||||
"integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig=="
|
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||||
},
|
},
|
||||||
"tunnel": {
|
"tunnel": {
|
||||||
"version": "0.0.6",
|
"version": "0.0.6",
|
||||||
@@ -895,9 +1064,9 @@
|
|||||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.9.5",
|
"version": "4.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
@@ -908,12 +1077,12 @@
|
|||||||
"webidl-conversions": {
|
"webidl-conversions": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||||
},
|
},
|
||||||
"whatwg-url": {
|
"whatwg-url": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tr46": "~0.0.3",
|
"tr46": "~0.0.3",
|
||||||
"webidl-conversions": "^3.0.0"
|
"webidl-conversions": "^3.0.0"
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.2.2",
|
"version": "3.2.1",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"description": "Actions cache lib",
|
"description": "Actions cache lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
"@actions/glob": "^0.1.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@actions/http-client": "^2.1.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/io": "^1.0.1",
|
"@actions/io": "^1.0.1",
|
||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
|
|||||||
+13
-26
@@ -20,11 +20,7 @@ import {
|
|||||||
ITypedResponseWithError,
|
ITypedResponseWithError,
|
||||||
ArtifactCacheList
|
ArtifactCacheList
|
||||||
} from './contracts'
|
} from './contracts'
|
||||||
import {
|
import {downloadCacheHttpClient, downloadCacheStorageSDK} from './downloadUtils'
|
||||||
downloadCacheHttpClient,
|
|
||||||
downloadCacheHttpClientConcurrent,
|
|
||||||
downloadCacheStorageSDK
|
|
||||||
} from './downloadUtils'
|
|
||||||
import {
|
import {
|
||||||
DownloadOptions,
|
DownloadOptions,
|
||||||
UploadOptions,
|
UploadOptions,
|
||||||
@@ -96,7 +92,10 @@ export function getCacheVersion(
|
|||||||
// Add salt to cache version to support breaking changes in cache entry
|
// Add salt to cache version to support breaking changes in cache entry
|
||||||
components.push(versionSalt)
|
components.push(versionSalt)
|
||||||
|
|
||||||
return crypto.createHash('sha256').update(components.join('|')).digest('hex')
|
return crypto
|
||||||
|
.createHash('sha256')
|
||||||
|
.update(components.join('|'))
|
||||||
|
.digest('hex')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getCacheEntry(
|
export async function getCacheEntry(
|
||||||
@@ -175,28 +174,16 @@ export async function downloadCache(
|
|||||||
const archiveUrl = new URL(archiveLocation)
|
const archiveUrl = new URL(archiveLocation)
|
||||||
const downloadOptions = getDownloadOptions(options)
|
const downloadOptions = getDownloadOptions(options)
|
||||||
|
|
||||||
if (archiveUrl.hostname.endsWith('.blob.core.windows.net')) {
|
if (
|
||||||
if (downloadOptions.useAzureSdk) {
|
downloadOptions.useAzureSdk &&
|
||||||
|
archiveUrl.hostname.endsWith('.blob.core.windows.net')
|
||||||
|
) {
|
||||||
// Use Azure storage SDK to download caches hosted on Azure to improve speed and reliability.
|
// Use Azure storage SDK to download caches hosted on Azure to improve speed and reliability.
|
||||||
await downloadCacheStorageSDK(
|
await downloadCacheStorageSDK(archiveLocation, archivePath, downloadOptions)
|
||||||
archiveLocation,
|
|
||||||
archivePath,
|
|
||||||
downloadOptions
|
|
||||||
)
|
|
||||||
} else if (downloadOptions.concurrentBlobDownloads) {
|
|
||||||
// Use concurrent implementation with HttpClient to work around blob SDK issue
|
|
||||||
await downloadCacheHttpClientConcurrent(
|
|
||||||
archiveLocation,
|
|
||||||
archivePath,
|
|
||||||
downloadOptions
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, download using the Actions http-client.
|
// Otherwise, download using the Actions http-client.
|
||||||
await downloadCacheHttpClient(archiveLocation, archivePath)
|
await downloadCacheHttpClient(archiveLocation, archivePath)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
await downloadCacheHttpClient(archiveLocation, archivePath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reserve Cache
|
// Reserve Cache
|
||||||
@@ -243,9 +230,9 @@ async function uploadChunk(
|
|||||||
end: number
|
end: number
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
core.debug(
|
core.debug(
|
||||||
`Uploading chunk of size ${
|
`Uploading chunk of size ${end -
|
||||||
end - start + 1
|
start +
|
||||||
} bytes at offset ${start} with content range: ${getContentRange(
|
1} bytes at offset ${start} with content range: ${getContentRange(
|
||||||
start,
|
start,
|
||||||
end
|
end
|
||||||
)}`
|
)}`
|
||||||
|
|||||||
+4
-164
@@ -203,166 +203,6 @@ export async function downloadCacheHttpClient(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Download the cache using the Actions toolkit http-client concurrently
|
|
||||||
*
|
|
||||||
* @param archiveLocation the URL for the cache
|
|
||||||
* @param archivePath the local path where the cache is saved
|
|
||||||
*/
|
|
||||||
export async function downloadCacheHttpClientConcurrent(
|
|
||||||
archiveLocation: string,
|
|
||||||
archivePath: fs.PathLike,
|
|
||||||
options: DownloadOptions
|
|
||||||
): Promise<void> {
|
|
||||||
const archiveDescriptor = await fs.promises.open(archivePath, 'w')
|
|
||||||
const httpClient = new HttpClient('actions/cache', undefined, {
|
|
||||||
socketTimeout: options.timeoutInMs,
|
|
||||||
keepAlive: true
|
|
||||||
})
|
|
||||||
try {
|
|
||||||
const res = await retryHttpClientResponse(
|
|
||||||
'downloadCacheMetadata',
|
|
||||||
async () => await httpClient.request('HEAD', archiveLocation, null, {})
|
|
||||||
)
|
|
||||||
|
|
||||||
const lengthHeader = res.message.headers['content-length']
|
|
||||||
if (lengthHeader === undefined || lengthHeader === null) {
|
|
||||||
throw new Error('Content-Length not found on blob response')
|
|
||||||
}
|
|
||||||
|
|
||||||
const length = parseInt(lengthHeader)
|
|
||||||
if (Number.isNaN(length)) {
|
|
||||||
throw new Error(`Could not interpret Content-Length: ${length}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const downloads: {
|
|
||||||
offset: number
|
|
||||||
promiseGetter: () => Promise<DownloadSegment>
|
|
||||||
}[] = []
|
|
||||||
const blockSize = 4 * 1024 * 1024
|
|
||||||
|
|
||||||
for (let offset = 0; offset < length; offset += blockSize) {
|
|
||||||
const count = Math.min(blockSize, length - offset)
|
|
||||||
downloads.push({
|
|
||||||
offset,
|
|
||||||
promiseGetter: async () => {
|
|
||||||
return await downloadSegmentRetry(
|
|
||||||
httpClient,
|
|
||||||
archiveLocation,
|
|
||||||
offset,
|
|
||||||
count
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// reverse to use .pop instead of .shift
|
|
||||||
downloads.reverse()
|
|
||||||
let actives = 0
|
|
||||||
let bytesDownloaded = 0
|
|
||||||
const progress = new DownloadProgress(length)
|
|
||||||
progress.startDisplayTimer()
|
|
||||||
const progressFn = progress.onProgress()
|
|
||||||
|
|
||||||
const activeDownloads: {[offset: number]: Promise<DownloadSegment>} = []
|
|
||||||
let nextDownload:
|
|
||||||
| {offset: number; promiseGetter: () => Promise<DownloadSegment>}
|
|
||||||
| undefined
|
|
||||||
|
|
||||||
const waitAndWrite: () => Promise<void> = async () => {
|
|
||||||
const segment = await Promise.race(Object.values(activeDownloads))
|
|
||||||
await archiveDescriptor.write(
|
|
||||||
segment.buffer,
|
|
||||||
0,
|
|
||||||
segment.count,
|
|
||||||
segment.offset
|
|
||||||
)
|
|
||||||
actives--
|
|
||||||
delete activeDownloads[segment.offset]
|
|
||||||
bytesDownloaded += segment.count
|
|
||||||
progressFn({loadedBytes: bytesDownloaded})
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((nextDownload = downloads.pop())) {
|
|
||||||
activeDownloads[nextDownload.offset] = nextDownload.promiseGetter()
|
|
||||||
actives++
|
|
||||||
|
|
||||||
if (actives >= (options.downloadConcurrency ?? 10)) {
|
|
||||||
await waitAndWrite()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (actives > 0) {
|
|
||||||
await waitAndWrite()
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
httpClient.dispose()
|
|
||||||
await archiveDescriptor.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadSegmentRetry(
|
|
||||||
httpClient: HttpClient,
|
|
||||||
archiveLocation: string,
|
|
||||||
offset: number,
|
|
||||||
count: number
|
|
||||||
): Promise<DownloadSegment> {
|
|
||||||
const retries = 5
|
|
||||||
let failures = 0
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
try {
|
|
||||||
const timeout = 30000
|
|
||||||
const result = await promiseWithTimeout(
|
|
||||||
timeout,
|
|
||||||
downloadSegment(httpClient, archiveLocation, offset, count)
|
|
||||||
)
|
|
||||||
if (typeof result === 'string') {
|
|
||||||
throw new Error('downloadSegmentRetry failed due to timeout')
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
} catch (err) {
|
|
||||||
if (failures >= retries) {
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
|
|
||||||
failures++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadSegment(
|
|
||||||
httpClient: HttpClient,
|
|
||||||
archiveLocation: string,
|
|
||||||
offset: number,
|
|
||||||
count: number
|
|
||||||
): Promise<DownloadSegment> {
|
|
||||||
const partRes = await retryHttpClientResponse(
|
|
||||||
'downloadCachePart',
|
|
||||||
async () =>
|
|
||||||
await httpClient.get(archiveLocation, {
|
|
||||||
Range: `bytes=${offset}-${offset + count - 1}`
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!partRes.readBodyBuffer) {
|
|
||||||
throw new Error('Expected HttpClientResponse to implement readBodyBuffer')
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
offset,
|
|
||||||
count,
|
|
||||||
buffer: await partRes.readBodyBuffer()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
declare class DownloadSegment {
|
|
||||||
offset: number
|
|
||||||
count: number
|
|
||||||
buffer: Buffer
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download the cache using the Azure Storage SDK. Only call this method if the
|
* Download the cache using the Azure Storage SDK. Only call this method if the
|
||||||
* URL points to an Azure Storage endpoint.
|
* URL points to an Azure Storage endpoint.
|
||||||
@@ -447,12 +287,12 @@ export async function downloadCacheStorageSDK(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const promiseWithTimeout = async <T>(
|
const promiseWithTimeout = async (
|
||||||
timeoutMs: number,
|
timeoutMs: number,
|
||||||
promise: Promise<T>
|
promise: Promise<Buffer>
|
||||||
): Promise<T | string> => {
|
): Promise<unknown> => {
|
||||||
let timeoutHandle: NodeJS.Timeout
|
let timeoutHandle: NodeJS.Timeout
|
||||||
const timeoutPromise = new Promise<string>(resolve => {
|
const timeoutPromise = new Promise(resolve => {
|
||||||
timeoutHandle = setTimeout(() => resolve('timeout'), timeoutMs)
|
timeoutHandle = setTimeout(() => resolve('timeout'), timeoutMs)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-12
@@ -39,12 +39,6 @@ export interface DownloadOptions {
|
|||||||
*/
|
*/
|
||||||
downloadConcurrency?: number
|
downloadConcurrency?: number
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether to use Actions HttpClient with concurrency
|
|
||||||
* for Azure Blob Storage
|
|
||||||
*/
|
|
||||||
concurrentBlobDownloads?: boolean
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum time for each download request, in milliseconds (this
|
* Maximum time for each download request, in milliseconds (this
|
||||||
* option only applies when using the Azure SDK)
|
* option only applies when using the Azure SDK)
|
||||||
@@ -104,8 +98,7 @@ export function getUploadOptions(copy?: UploadOptions): UploadOptions {
|
|||||||
*/
|
*/
|
||||||
export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
|
export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
|
||||||
const result: DownloadOptions = {
|
const result: DownloadOptions = {
|
||||||
useAzureSdk: false,
|
useAzureSdk: true,
|
||||||
concurrentBlobDownloads: true,
|
|
||||||
downloadConcurrency: 8,
|
downloadConcurrency: 8,
|
||||||
timeoutInMs: 30000,
|
timeoutInMs: 30000,
|
||||||
segmentTimeoutInMs: 600000,
|
segmentTimeoutInMs: 600000,
|
||||||
@@ -117,10 +110,6 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions {
|
|||||||
result.useAzureSdk = copy.useAzureSdk
|
result.useAzureSdk = copy.useAzureSdk
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof copy.concurrentBlobDownloads === 'boolean') {
|
|
||||||
result.concurrentBlobDownloads = copy.concurrentBlobDownloads
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof copy.downloadConcurrency === 'number') {
|
if (typeof copy.downloadConcurrency === 'number') {
|
||||||
result.downloadConcurrency = copy.downloadConcurrency
|
result.downloadConcurrency = copy.downloadConcurrency
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-4
@@ -4,10 +4,7 @@
|
|||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"lib": [
|
"lib": ["es6", "dom"],
|
||||||
"es6",
|
|
||||||
"dom"
|
|
||||||
],
|
|
||||||
"useUnknownInCatchVariables": false
|
"useUnknownInCatchVariables": false
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ describe('@actions/core/src/command', () => {
|
|||||||
afterEach(() => {})
|
afterEach(() => {})
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
process.stdout.write = originalWriteFunction as unknown as (
|
process.stdout.write = (originalWriteFunction as unknown) as (
|
||||||
str: string
|
str: string
|
||||||
) => boolean
|
) => boolean
|
||||||
})
|
})
|
||||||
@@ -51,7 +51,8 @@ describe('@actions/core/src/command', () => {
|
|||||||
command.issueCommand(
|
command.issueCommand(
|
||||||
'some-command',
|
'some-command',
|
||||||
{
|
{
|
||||||
name: 'percent % percent % cr \r cr \r lf \n lf \n colon : colon : comma , comma ,'
|
name:
|
||||||
|
'percent % percent % cr \r cr \r lf \n lf \n colon : colon : comma , comma ,'
|
||||||
},
|
},
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
@@ -116,11 +117,11 @@ describe('@actions/core/src/command', () => {
|
|||||||
command.issueCommand(
|
command.issueCommand(
|
||||||
'some-command',
|
'some-command',
|
||||||
{
|
{
|
||||||
prop1: {test: 'object'} as unknown as string,
|
prop1: ({test: 'object'} as unknown) as string,
|
||||||
prop2: 123 as unknown as string,
|
prop2: (123 as unknown) as string,
|
||||||
prop3: true as unknown as string
|
prop3: (true as unknown) as string
|
||||||
},
|
},
|
||||||
{test: 'object'} as unknown as string
|
({test: 'object'} as unknown) as string
|
||||||
)
|
)
|
||||||
assertWriteCalls([
|
assertWriteCalls([
|
||||||
`::some-command prop1={"test"%3A"object"},prop2=123,prop3=true::{"test":"object"}${os.EOL}`
|
`::some-command prop1={"test"%3A"object"},prop2=123,prop3=true::{"test":"object"}${os.EOL}`
|
||||||
|
|||||||
@@ -150,7 +150,10 @@ describe('@actions/core/src/summary', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('adds EOL', async () => {
|
it('adds EOL', async () => {
|
||||||
await summary.addRaw(fixtures.text).addEOL().write()
|
await summary
|
||||||
|
.addRaw(fixtures.text)
|
||||||
|
.addEOL()
|
||||||
|
.write()
|
||||||
await assertSummary(fixtures.text + os.EOL)
|
await assertSummary(fixtures.text + os.EOL)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Generated
+6
-6
@@ -18,9 +18,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
"node_modules/@actions/http-client": {
|
||||||
"version": "2.1.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
@@ -56,9 +56,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
"version": "2.1.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
"audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"tsc": "tsc -p tsconfig.json"
|
"tsc": "tsc"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"declaration": true,
|
|
||||||
"rootDir": "./src"
|
"rootDir": "./src"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ describe('@actions/exec', () => {
|
|||||||
expect(exitCode).toBe(0)
|
expect(exitCode).toBe(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Handles child process holding streams open', async function () {
|
it('Handles child process holding streams open', async function() {
|
||||||
const semaphorePath = path.join(
|
const semaphorePath = path.join(
|
||||||
getTestTemp(),
|
getTestTemp(),
|
||||||
'child-process-semaphore.txt'
|
'child-process-semaphore.txt'
|
||||||
@@ -403,7 +403,7 @@ describe('@actions/exec', () => {
|
|||||||
fs.unlinkSync(semaphorePath)
|
fs.unlinkSync(semaphorePath)
|
||||||
}, 10000) // this was timing out on some slower hosted macOS runs at default 5s
|
}, 10000) // this was timing out on some slower hosted macOS runs at default 5s
|
||||||
|
|
||||||
it('Handles child process holding streams open and non-zero exit code', async function () {
|
it('Handles child process holding streams open and non-zero exit code', async function() {
|
||||||
const semaphorePath = path.join(
|
const semaphorePath = path.join(
|
||||||
getTestTemp(),
|
getTestTemp(),
|
||||||
'child-process-semaphore.txt'
|
'child-process-semaphore.txt'
|
||||||
@@ -457,7 +457,7 @@ describe('@actions/exec', () => {
|
|||||||
fs.unlinkSync(semaphorePath)
|
fs.unlinkSync(semaphorePath)
|
||||||
}, 10000) // this was timing out on some slower hosted macOS runs at default 5s
|
}, 10000) // this was timing out on some slower hosted macOS runs at default 5s
|
||||||
|
|
||||||
it('Handles child process holding streams open and stderr', async function () {
|
it('Handles child process holding streams open and stderr', async function() {
|
||||||
const semaphorePath = path.join(
|
const semaphorePath = path.join(
|
||||||
getTestTemp(),
|
getTestTemp(),
|
||||||
'child-process-semaphore.txt'
|
'child-process-semaphore.txt'
|
||||||
|
|||||||
@@ -267,7 +267,10 @@ export class ToolRunner extends events.EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reverse += '"'
|
reverse += '"'
|
||||||
return reverse.split('').reverse().join('')
|
return reverse
|
||||||
|
.split('')
|
||||||
|
.reverse()
|
||||||
|
.join('')
|
||||||
}
|
}
|
||||||
|
|
||||||
private _uvQuoteCmdArg(arg: string): string {
|
private _uvQuoteCmdArg(arg: string): string {
|
||||||
@@ -347,7 +350,10 @@ export class ToolRunner extends events.EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reverse += '"'
|
reverse += '"'
|
||||||
return reverse.split('').reverse().join('')
|
return reverse
|
||||||
|
.split('')
|
||||||
|
.reverse()
|
||||||
|
.join('')
|
||||||
}
|
}
|
||||||
|
|
||||||
private _cloneExecOptions(options?: im.ExecOptions): im.ExecOptions {
|
private _cloneExecOptions(options?: im.ExecOptions): im.ExecOptions {
|
||||||
@@ -685,9 +691,8 @@ class ExecState extends events.EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!state.processClosed && state.processExited) {
|
if (!state.processClosed && state.processExited) {
|
||||||
const message = `The STDIO streams did not close within ${
|
const message = `The STDIO streams did not close within ${state.delay /
|
||||||
state.delay / 1000
|
1000} seconds of the exit event from process '${
|
||||||
} seconds of the exit event from process '${
|
|
||||||
state.toolPath
|
state.toolPath
|
||||||
}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`
|
}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`
|
||||||
state._debug(message)
|
state._debug(message)
|
||||||
|
|||||||
Generated
+6
-6
@@ -19,9 +19,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
"node_modules/@actions/http-client": {
|
||||||
"version": "2.1.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
@@ -361,9 +361,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
"version": "2.1.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,6 @@ describe('globber', () => {
|
|||||||
'file-under-a'
|
'file-under-a'
|
||||||
)
|
)
|
||||||
])
|
])
|
||||||
await unlinkSymlinkDir(itemPaths)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('detects cycle starting from symlink when followSymbolicLinks=true', async () => {
|
it('detects cycle starting from symlink when followSymbolicLinks=true', async () => {
|
||||||
@@ -862,14 +861,6 @@ async function createHiddenFile(file: string, content: string): Promise<void> {
|
|||||||
function getTestTemp(): string {
|
function getTestTemp(): string {
|
||||||
return path.join(__dirname, '_temp', 'glob')
|
return path.join(__dirname, '_temp', 'glob')
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Deletes a symlink directory
|
|
||||||
*/
|
|
||||||
async function unlinkSymlinkDir(links: string[]): Promise<void> {
|
|
||||||
for (const link of links) {
|
|
||||||
await fs.rm(link, {recursive: true, force: true})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a symlink directory on OSX/Linux, and a junction point directory on Windows.
|
* Creates a symlink directory on OSX/Linux, and a junction point directory on Windows.
|
||||||
|
|||||||
Generated
-25
@@ -30,21 +30,12 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
|
||||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
|
||||||
"dependencies": {
|
|
||||||
"tunnel": "^0.0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
@@ -74,22 +65,6 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"node_modules/tunnel": {
|
|
||||||
"version": "0.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
|
||||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/uuid": {
|
|
||||||
"version": "8.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
|
||||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
|
||||||
"bin": {
|
|
||||||
"uuid": "dist/bin/uuid"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
## Releases
|
## Releases
|
||||||
|
|
||||||
## 2.1.1
|
|
||||||
- Add `HttpClientResponse.readBodyBuffer` method to read from a response stream and return a buffer [#1475](https://github.com/actions/toolkit/pull/1475)
|
|
||||||
|
|
||||||
## 2.1.0
|
## 2.1.0
|
||||||
- Add support for `*` and subdomains in `no_proxy` [#1355](https://github.com/actions/toolkit/pull/1355) [#1223](https://github.com/actions/toolkit/pull/1223)
|
- Add support for `*` and subdomains in `no_proxy` [#1355](https://github.com/actions/toolkit/pull/1355) [#1223](https://github.com/actions/toolkit/pull/1223)
|
||||||
- Bypass proxy for loopback IP adresses [#1360](https://github.com/actions/toolkit/pull/1360))
|
- Bypass proxy for loopback IP adresses [#1360](https://github.com/actions/toolkit/pull/1360))
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ describe('auth', () => {
|
|||||||
|
|
||||||
it('does basic http get request with pat token auth', async () => {
|
it('does basic http get request with pat token auth', async () => {
|
||||||
const token = 'scbfb44vxzku5l4xgc3qfazn3lpk4awflfryc76esaiq7aypcbhs'
|
const token = 'scbfb44vxzku5l4xgc3qfazn3lpk4awflfryc76esaiq7aypcbhs'
|
||||||
const ph: am.PersonalAccessTokenCredentialHandler =
|
const ph: am.PersonalAccessTokenCredentialHandler = new am.PersonalAccessTokenCredentialHandler(
|
||||||
new am.PersonalAccessTokenCredentialHandler(token)
|
token
|
||||||
|
)
|
||||||
|
|
||||||
const http: httpm.HttpClient = new httpm.HttpClient('http-client-tests', [
|
const http: httpm.HttpClient = new httpm.HttpClient('http-client-tests', [
|
||||||
ph
|
ph
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.1.1",
|
"version": "2.0.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.1.1",
|
"version": "2.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/http-client",
|
"name": "@actions/http-client",
|
||||||
"version": "2.1.1",
|
"version": "2.1.0",
|
||||||
"description": "Actions Http Client",
|
"description": "Actions Http Client",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
|
|||||||
@@ -57,8 +57,7 @@ export class BearerCredentialHandler implements ifm.RequestHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class PersonalAccessTokenCredentialHandler
|
export class PersonalAccessTokenCredentialHandler
|
||||||
implements ifm.RequestHandler
|
implements ifm.RequestHandler {
|
||||||
{
|
|
||||||
token: string
|
token: string
|
||||||
|
|
||||||
constructor(token: string) {
|
constructor(token: string) {
|
||||||
|
|||||||
@@ -102,20 +102,6 @@ export class HttpClientResponse {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async readBodyBuffer?(): Promise<Buffer> {
|
|
||||||
return new Promise<Buffer>(async resolve => {
|
|
||||||
const chunks: Buffer[] = []
|
|
||||||
|
|
||||||
this.message.on('data', (chunk: Buffer) => {
|
|
||||||
chunks.push(chunk)
|
|
||||||
})
|
|
||||||
|
|
||||||
this.message.on('end', () => {
|
|
||||||
resolve(Buffer.concat(chunks))
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isHttps(requestUrl: string): boolean {
|
export function isHttps(requestUrl: string): boolean {
|
||||||
@@ -533,7 +519,7 @@ export class HttpClient {
|
|||||||
handleResult(new Error(`Request timeout: ${info.options.path}`))
|
handleResult(new Error(`Request timeout: ${info.options.path}`))
|
||||||
})
|
})
|
||||||
|
|
||||||
req.on('error', function (err) {
|
req.on('error', function(err) {
|
||||||
// err has statusCode property
|
// err has statusCode property
|
||||||
// res should have headers
|
// res should have headers
|
||||||
handleResult(err)
|
handleResult(err)
|
||||||
@@ -544,7 +530,7 @@ export class HttpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data && typeof data !== 'string') {
|
if (data && typeof data !== 'string') {
|
||||||
data.on('close', function () {
|
data.on('close', function() {
|
||||||
req.end()
|
req.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node"
|
||||||
"declaration": true,
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./src"
|
"./src"
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ describe('retry-helper tests', () => {
|
|||||||
|
|
||||||
it('all attempts fail', async () => {
|
it('all attempts fail', async () => {
|
||||||
let attempts = 0
|
let attempts = 0
|
||||||
let error: Error = null as unknown as Error
|
let error: Error = (null as unknown) as Error
|
||||||
try {
|
try {
|
||||||
await retryHelper.execute(() => {
|
await retryHelper.execute(() => {
|
||||||
throw new Error(`some error ${++attempts}`)
|
throw new Error(`some error ${++attempts}`)
|
||||||
@@ -87,7 +87,7 @@ describe('retry-helper tests', () => {
|
|||||||
|
|
||||||
it('checks retryable after first attempt', async () => {
|
it('checks retryable after first attempt', async () => {
|
||||||
let attempts = 0
|
let attempts = 0
|
||||||
let error: Error = null as unknown as Error
|
let error: Error = (null as unknown) as Error
|
||||||
try {
|
try {
|
||||||
await retryHelper.execute(
|
await retryHelper.execute(
|
||||||
async () => {
|
async () => {
|
||||||
@@ -105,7 +105,7 @@ describe('retry-helper tests', () => {
|
|||||||
|
|
||||||
it('checks retryable after second attempt', async () => {
|
it('checks retryable after second attempt', async () => {
|
||||||
let attempts = 0
|
let attempts = 0
|
||||||
let error: Error = null as unknown as Error
|
let error: Error = (null as unknown) as Error
|
||||||
try {
|
try {
|
||||||
await retryHelper.execute(
|
await retryHelper.execute(
|
||||||
async () => {
|
async () => {
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ import * as tc from '../src/tool-cache'
|
|||||||
const IS_WINDOWS = process.platform === 'win32'
|
const IS_WINDOWS = process.platform === 'win32'
|
||||||
const IS_MAC = process.platform === 'darwin'
|
const IS_MAC = process.platform === 'darwin'
|
||||||
|
|
||||||
describe('@actions/tool-cache', function () {
|
describe('@actions/tool-cache', function() {
|
||||||
beforeAll(function () {
|
beforeAll(function() {
|
||||||
nock('http://example.com').persist().get('/bytes/35').reply(200, {
|
nock('http://example.com')
|
||||||
|
.persist()
|
||||||
|
.get('/bytes/35')
|
||||||
|
.reply(200, {
|
||||||
username: 'abc',
|
username: 'abc',
|
||||||
password: 'def'
|
password: 'def'
|
||||||
})
|
})
|
||||||
@@ -27,18 +30,18 @@ describe('@actions/tool-cache', function () {
|
|||||||
setGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 0)
|
setGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function() {
|
||||||
await io.rmRF(cachePath)
|
await io.rmRF(cachePath)
|
||||||
await io.rmRF(tempPath)
|
await io.rmRF(tempPath)
|
||||||
await io.mkdirP(cachePath)
|
await io.mkdirP(cachePath)
|
||||||
await io.mkdirP(tempPath)
|
await io.mkdirP(tempPath)
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function() {
|
||||||
setResponseMessageFactory(undefined)
|
setResponseMessageFactory(undefined)
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async function () {
|
afterAll(async function() {
|
||||||
await io.rmRF(tempPath)
|
await io.rmRF(tempPath)
|
||||||
await io.rmRF(cachePath)
|
await io.rmRF(cachePath)
|
||||||
setGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', undefined)
|
setGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', undefined)
|
||||||
@@ -174,7 +177,10 @@ describe('@actions/tool-cache', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('has status code in exception dictionary for HTTP error code responses', async () => {
|
it('has status code in exception dictionary for HTTP error code responses', async () => {
|
||||||
nock('http://example.com').persist().get('/bytes/bad').reply(400, {
|
nock('http://example.com')
|
||||||
|
.persist()
|
||||||
|
.get('/bytes/bad')
|
||||||
|
.reply(400, {
|
||||||
username: 'bad',
|
username: 'bad',
|
||||||
password: 'file'
|
password: 'file'
|
||||||
})
|
})
|
||||||
@@ -190,7 +196,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('works with redirect code 302', async function () {
|
it('works with redirect code 302', async function() {
|
||||||
nock('http://example.com')
|
nock('http://example.com')
|
||||||
.persist()
|
.persist()
|
||||||
.get('/redirect-to')
|
.get('/redirect-to')
|
||||||
@@ -289,7 +295,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('extract 7z using custom 7z tool', async function () {
|
it('extract 7z using custom 7z tool', async function() {
|
||||||
const tempDir = path.join(
|
const tempDir = path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
'test-extract-7z-using-custom-7z-tool'
|
'test-extract-7z-using-custom-7z-tool'
|
||||||
@@ -637,7 +643,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
it('installs a zip and extracts it to specified directory', async function () {
|
it('installs a zip and extracts it to specified directory', async function() {
|
||||||
const tempDir = path.join(__dirname, 'test-install-zip')
|
const tempDir = path.join(__dirname, 'test-install-zip')
|
||||||
try {
|
try {
|
||||||
await io.mkdirP(tempDir)
|
await io.mkdirP(tempDir)
|
||||||
@@ -700,7 +706,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('extract zip to a directory that does not exist', async function () {
|
it('extract zip to a directory that does not exist', async function() {
|
||||||
const tempDir = path.join(__dirname, 'test-install-zip')
|
const tempDir = path.join(__dirname, 'test-install-zip')
|
||||||
try {
|
try {
|
||||||
await io.mkdirP(tempDir)
|
await io.mkdirP(tempDir)
|
||||||
@@ -756,16 +762,24 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('works with a 502 temporary failure', async function () {
|
it('works with a 502 temporary failure', async function() {
|
||||||
nock('http://example.com').get('/temp502').twice().reply(502, undefined)
|
nock('http://example.com')
|
||||||
nock('http://example.com').get('/temp502').reply(200, undefined)
|
.get('/temp502')
|
||||||
|
.twice()
|
||||||
|
.reply(502, undefined)
|
||||||
|
nock('http://example.com')
|
||||||
|
.get('/temp502')
|
||||||
|
.reply(200, undefined)
|
||||||
|
|
||||||
const statusCodeUrl = 'http://example.com/temp502'
|
const statusCodeUrl = 'http://example.com/temp502'
|
||||||
await tc.downloadTool(statusCodeUrl)
|
await tc.downloadTool(statusCodeUrl)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("doesn't retry 502s more than 3 times", async function () {
|
it("doesn't retry 502s more than 3 times", async function() {
|
||||||
nock('http://example.com').get('/perm502').times(3).reply(502, undefined)
|
nock('http://example.com')
|
||||||
|
.get('/perm502')
|
||||||
|
.times(3)
|
||||||
|
.reply(502, undefined)
|
||||||
|
|
||||||
expect.assertions(1)
|
expect.assertions(1)
|
||||||
|
|
||||||
@@ -777,7 +791,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('retries 429s', async function () {
|
it('retries 429s', async function() {
|
||||||
nock('http://example.com')
|
nock('http://example.com')
|
||||||
.get('/too-many-requests-429')
|
.get('/too-many-requests-429')
|
||||||
.times(2)
|
.times(2)
|
||||||
@@ -794,9 +808,13 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it("doesn't retry 404", async function () {
|
it("doesn't retry 404", async function() {
|
||||||
nock('http://example.com').get('/not-found-404').reply(404, undefined)
|
nock('http://example.com')
|
||||||
nock('http://example.com').get('/not-found-404').reply(500, undefined)
|
.get('/not-found-404')
|
||||||
|
.reply(404, undefined)
|
||||||
|
nock('http://example.com')
|
||||||
|
.get('/not-found-404')
|
||||||
|
.reply(500, undefined)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const statusCodeUrl = 'http://example.com/not-found-404'
|
const statusCodeUrl = 'http://example.com/not-found-404'
|
||||||
@@ -806,7 +824,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('supports authorization headers', async function () {
|
it('supports authorization headers', async function() {
|
||||||
nock('http://example.com', {
|
nock('http://example.com', {
|
||||||
reqheaders: {
|
reqheaders: {
|
||||||
authorization: 'token abc123'
|
authorization: 'token abc123'
|
||||||
@@ -822,7 +840,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('supports custom headers', async function () {
|
it('supports custom headers', async function() {
|
||||||
nock('http://example.com', {
|
nock('http://example.com', {
|
||||||
reqheaders: {
|
reqheaders: {
|
||||||
accept: 'application/octet-stream'
|
accept: 'application/octet-stream'
|
||||||
@@ -841,7 +859,7 @@ describe('@actions/tool-cache', function () {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('supports authorization and custom headers', async function () {
|
it('supports authorization and custom headers', async function() {
|
||||||
nock('http://example.com', {
|
nock('http://example.com', {
|
||||||
reqheaders: {
|
reqheaders: {
|
||||||
accept: 'application/octet-stream',
|
accept: 'application/octet-stream',
|
||||||
|
|||||||
Generated
+24
-24
@@ -24,9 +24,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.10.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
@@ -49,17 +49,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/http-client": {
|
"node_modules/@actions/http-client": {
|
||||||
"version": "2.1.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/io": {
|
"node_modules/@actions/io": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.2.tgz",
|
||||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/nock": {
|
"node_modules/@types/nock": {
|
||||||
"version": "11.1.0",
|
"version": "11.1.0",
|
||||||
@@ -145,9 +145,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "6.3.1",
|
"version": "6.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"semver": "bin/semver.js"
|
"semver": "bin/semver.js"
|
||||||
}
|
}
|
||||||
@@ -172,9 +172,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.10.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
@@ -196,17 +196,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
"version": "2.1.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tunnel": "^0.0.6"
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/io": {
|
"@actions/io": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.2.tgz",
|
||||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
|
||||||
},
|
},
|
||||||
"@types/nock": {
|
"@types/nock": {
|
||||||
"version": "11.1.0",
|
"version": "11.1.0",
|
||||||
@@ -284,9 +284,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "6.3.1",
|
"version": "6.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||||
},
|
},
|
||||||
"tunnel": {
|
"tunnel": {
|
||||||
"version": "0.0.6",
|
"version": "0.0.6",
|
||||||
|
|||||||
@@ -140,7 +140,10 @@ export function _getOsVersion(): string {
|
|||||||
(parts[0].trim() === 'VERSION_ID' ||
|
(parts[0].trim() === 'VERSION_ID' ||
|
||||||
parts[0].trim() === 'DISTRIB_RELEASE')
|
parts[0].trim() === 'DISTRIB_RELEASE')
|
||||||
) {
|
) {
|
||||||
version = parts[1].trim().replace(/^"/, '').replace(/"$/, '')
|
version = parts[1]
|
||||||
|
.trim()
|
||||||
|
.replace(/^"/, '')
|
||||||
|
.replace(/"$/, '')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-11
@@ -5,17 +5,7 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"sourceMap": true,
|
"sourceMap": true
|
||||||
"noImplicitAny": false,
|
|
||||||
"baseUrl": "./",
|
|
||||||
"paths": {
|
|
||||||
"@actions/core": [
|
|
||||||
"packages/core"
|
|
||||||
],
|
|
||||||
"@actions/http-client": [
|
|
||||||
"packages/http-client"
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|||||||
Reference in New Issue
Block a user