75 Commits

Author SHA1 Message Date
dependabot[bot] a1af4e6f55 build(deps-dev): bump prettier from 3.1.1 to 3.2.5 (#326)
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.1...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:59:21 +00:00
dependabot[bot] 995440a946 build(deps-dev): bump eslint-plugin-vitest from 0.3.20 to 0.3.22 (#330)
Bumps [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) from 0.3.20 to 0.3.22.
- [Release notes](https://github.com/veritem/eslint-plugin-vitest/releases)
- [Commits](https://github.com/veritem/eslint-plugin-vitest/compare/v0.3.20...v0.3.22)

---
updated-dependencies:
- dependency-name: eslint-plugin-vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:54:45 +00:00
dependabot[bot] 9b50b2faf5 build(deps-dev): bump @typescript-eslint/eslint-plugin (#331)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.18.1 to 6.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.21.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:52:51 +00:00
dependabot[bot] 602e130744 build(deps-dev): bump vitest from 1.1.3 to 1.2.2 (#324)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.1.3 to 1.2.2.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.2.2/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:52:23 +00:00
dependabot[bot] 8e9bba721b build(deps-dev): bump msw from 2.0.13 to 2.1.7 (#328)
Bumps [msw](https://github.com/mswjs/msw) from 2.0.13 to 2.1.7.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.0.13...v2.1.7)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:51:38 +00:00
dependabot[bot] a6fa212802 build(deps-dev): bump @vitest/coverage-istanbul from 1.1.3 to 1.2.2 (#325)
Bumps [@vitest/coverage-istanbul](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-istanbul) from 1.1.3 to 1.2.2.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.2.2/packages/coverage-istanbul)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-istanbul"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:30:55 +00:00
dependabot[bot] 123b4541e1 build(deps): bump pre-commit/action from 3.0.0 to 3.0.1 (#329)
Bumps [pre-commit/action](https://github.com/pre-commit/action) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/pre-commit/action/releases)
- [Commits](https://github.com/pre-commit/action/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: pre-commit/action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:30:26 +00:00
dependabot[bot] 12eedfd2ca build(deps-dev): bump eslint-plugin-prettier from 5.1.2 to 5.1.3 (#308)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.1.2 to 5.1.3.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.1.2...v5.1.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:30:03 +00:00
dependabot[bot] bf56ede87f build(deps): bump actions/cache from 3 to 4 (#315)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:29:38 +00:00
dependabot[bot] 5e5d66a8f4 build(deps-dev): bump vite from 5.0.11 to 5.0.12 (#320)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.11 to 5.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:29:14 +00:00
Iain Sproat ff56aeb1c1 chore(error): improve error handling to include message from cause of error (#307)
* Refresh yarn.lock and node_modules to fix yarn test --coverage
- based on https://github.com/vitest-dev/vitest/issues/4668#issuecomment-1840998029

* HttpError message included in the Error message
2024-01-09 19:58:53 +00:00
Iain Sproat c5d080d60d Refresh yarn.lock and node_modules to fix yarn test --coverage (#306)
- based on https://github.com/vitest-dev/vitest/issues/4668#issuecomment-1840998029
2024-01-09 16:12:14 +00:00
Iain Sproat d5c4844583 docs(README): adds descriptions for all inputs (#305) 2024-01-09 16:00:45 +00:00
dependabot[bot] 2a971c6f16 build(deps-dev): bump eslint-plugin-import from 2.29.0 to 2.29.1 (#294)
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.29.0 to 2.29.1.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.29.0...v2.29.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:31:27 +00:00
dependabot[bot] 67d44ba23f build(deps-dev): bump @typescript-eslint/eslint-plugin (#304)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.14.0 to 6.18.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.18.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:30:58 +00:00
dependabot[bot] 7fdec8e7fc build(deps-dev): bump eslint from 8.55.0 to 8.56.0 (#296)
Bumps [eslint](https://github.com/eslint/eslint) from 8.55.0 to 8.56.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:23:24 +00:00
dependabot[bot] 5493d6f271 build(deps-dev): bump eslint-plugin-vitest from 0.3.17 to 0.3.20 (#299)
Bumps [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) from 0.3.17 to 0.3.20.
- [Release notes](https://github.com/veritem/eslint-plugin-vitest/releases)
- [Commits](https://github.com/veritem/eslint-plugin-vitest/compare/v0.3.17...v0.3.20)

---
updated-dependencies:
- dependency-name: eslint-plugin-vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:22:51 +00:00
dependabot[bot] 775a02139f build(deps-dev): bump vite from 5.0.9 to 5.0.11 (#302)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.9 to 5.0.11.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.11/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:21:47 +00:00
dependabot[bot] e68d24406e build(deps-dev): bump @types/node from 18.19.2 to 18.19.3 (#291)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.2 to 18.19.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 17:46:44 +00:00
dependabot[bot] e87630d731 build(deps-dev): bump vite from 5.0.8 to 5.0.9 (#293)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.8 to 5.0.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 17:46:15 +00:00
dependabot[bot] 5c55ca7ea8 build(deps-dev): bump eslint-plugin-vitest from 0.3.9 to 0.3.17 (#292)
Bumps [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) from 0.3.9 to 0.3.17.
- [Release notes](https://github.com/veritem/eslint-plugin-vitest/releases)
- [Commits](https://github.com/veritem/eslint-plugin-vitest/compare/v0.3.9...v0.3.17)

---
updated-dependencies:
- dependency-name: eslint-plugin-vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 17:45:56 +00:00
dependabot[bot] 970e0f066b build(deps-dev): bump vite from 4.5.1 to 5.0.8 (#287)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 5.0.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 17:36:38 +00:00
dependabot[bot] df92d9c409 build(deps-dev): bump @vercel/ncc from 0.36.1 to 0.38.1 (#267)
* build(deps-dev): bump @vercel/ncc from 0.36.1 to 0.38.1

Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.36.1 to 0.38.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.36.1...0.38.1)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(package): repackage using new version of ncc

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-12-12 17:36:16 +00:00
dependabot[bot] f2adde5085 build(deps-dev): bump @typescript-eslint/eslint-plugin (#286)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.10.0 to 6.14.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:55:40 +00:00
dependabot[bot] 8ea1a1bc8e build(deps-dev): bump vitest from 0.34.6 to 1.0.4 (#289)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.34.6 to 1.0.4.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.0.4/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:55:11 +00:00
dependabot[bot] a13b1e49e5 build(deps-dev): bump @typescript-eslint/parser from 6.10.0 to 6.14.0 (#285)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.10.0 to 6.14.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:46:18 +00:00
dependabot[bot] 6b66e1479d build(deps-dev): bump msw from 2.0.10 to 2.0.11 (#288)
Bumps [msw](https://github.com/mswjs/msw) from 2.0.10 to 2.0.11.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.0.10...v2.0.11)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:45:54 +00:00
dependabot[bot] ade5dbf5cd build(deps-dev): bump eslint from 8.53.0 to 8.55.0 (#284)
Bumps [eslint](https://github.com/eslint/eslint) from 8.53.0 to 8.55.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.53.0...v8.55.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:39:11 +00:00
dependabot[bot] 0a39db82dc build(deps-dev): bump prettier from 3.0.3 to 3.1.1 (#282)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 17:02:02 +00:00
dependabot[bot] be8fb87593 build(deps-dev): bump @vitest/coverage-istanbul from 0.34.6 to 1.0.4 (#283)
Bumps [@vitest/coverage-istanbul](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-istanbul) from 0.34.6 to 1.0.4.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.0.4/packages/coverage-istanbul)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-istanbul"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 16:59:56 +00:00
dependabot[bot] e4a948b322 build(deps-dev): bump @types/js-yaml from 4.0.5 to 4.0.9 (#265)
Bumps [@types/js-yaml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-yaml) from 4.0.5 to 4.0.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-yaml)

---
updated-dependencies:
- dependency-name: "@types/js-yaml"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 16:55:30 +00:00
dependabot[bot] 5eefa5a400 build(deps-dev): bump msw from 2.0.5 to 2.0.10 (#278)
Bumps [msw](https://github.com/mswjs/msw) from 2.0.5 to 2.0.10.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.0.5...v2.0.10)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 16:54:50 +00:00
dependabot[bot] 374d08671f build(deps-dev): bump @types/node from 18.18.8 to 18.19.2 (#277)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.18.8 to 18.19.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-06 17:04:30 +00:00
dependabot[bot] 45de2b5144 build(deps-dev): bump vite from 4.5.0 to 4.5.1 (#279)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.1/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-06 17:03:56 +00:00
Iain Sproat 94cd180e64 Update README to match actual intent of release tag (#262) 2023-11-12 17:31:54 +00:00
Iain Sproat 0e00242543 Align with API and update documentation (#261) 2023-11-12 17:17:56 +00:00
dependabot[bot] 9463df7516 build(deps-dev): bump typescript from 5.1.6 to 5.2.2 (#253)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.1.6 to 5.2.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.1.6...v5.2.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-10 23:00:15 +00:00
dependabot[bot] 45fab3f079 build(deps): bump @actions/core from 1.10.0 to 1.10.1 (#256)
* build(deps): bump @actions/core from 1.10.0 to 1.10.1

Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.0 to 1.10.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Build dist package

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-11-10 22:58:34 +00:00
dependabot[bot] d597b772e2 build(deps-dev): bump eslint-plugin-github from 4.9.2 to 4.10.1 (#254)
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.9.2 to 4.10.1.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.9.2...v4.10.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-github
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-10 22:55:35 +00:00
dependabot[bot] 7abc703dbb build(deps-dev): bump @typescript-eslint/parser from 6.9.1 to 6.10.0 (#257)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.9.1 to 6.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.10.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-10 22:52:01 +00:00
dependabot[bot] f9f94ecffd build(deps-dev): bump msw from 1.3.2 to 2.0.5 (#259)
* build(deps-dev): bump msw from 1.3.2 to 2.0.5

Bumps [msw](https://github.com/mswjs/msw) from 1.3.2 to 2.0.5.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v1.3.2...v2.0.5)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Migrate to msw 2.x

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-11-10 22:51:49 +00:00
Iain Sproat c5002c79a5 Allow recommended CPU and memory to be NaN values and not error (#260) 2023-11-10 22:35:56 +00:00
dependabot[bot] 1c720bfd18 build(deps-dev): bump eslint-plugin-prettier from 5.0.0 to 5.0.1 (#251)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 17:34:06 +00:00
dependabot[bot] e55790a197 build(deps-dev): bump eslint-plugin-import from 2.28.0 to 2.29.0 (#245)
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.28.0...v2.29.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 17:33:47 +00:00
dependabot[bot] a46e606ed0 build(deps-dev): bump vitest from 0.34.1 to 0.34.6 (#246)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.34.1 to 0.34.6.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.34.6/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 17:33:27 +00:00
dependabot[bot] b6f5d3ea9f build(deps-dev): bump @typescript-eslint/eslint-plugin (#252)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.3.0 to 6.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.10.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 17:33:00 +00:00
dependabot[bot] d909647537 build(deps-dev): bump vite from 4.4.9 to 4.5.0 (#247)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.9 to 4.5.0.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.0/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 17:18:35 +00:00
dependabot[bot] a13fa85dcd build(deps-dev): bump @vitest/coverage-istanbul from 0.34.1 to 0.34.6 (#248)
Bumps [@vitest/coverage-istanbul](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-istanbul) from 0.34.1 to 0.34.6.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.34.6/packages/coverage-istanbul)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-istanbul"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 17:08:37 +00:00
dependabot[bot] 7fbd2d120a build(deps-dev): bump eslint-plugin-vitest from 0.2.8 to 0.3.9 (#249)
Bumps [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) from 0.2.8 to 0.3.9.
- [Release notes](https://github.com/veritem/eslint-plugin-vitest/releases)
- [Commits](https://github.com/veritem/eslint-plugin-vitest/compare/v0.2.8...v0.3.9)

---
updated-dependencies:
- dependency-name: eslint-plugin-vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 17:08:09 +00:00
dependabot[bot] 9ac8c2a48e build(deps-dev): bump eslint-import-resolver-typescript (#218)
Bumps [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript) from 3.5.5 to 3.6.1.
- [Release notes](https://github.com/import-js/eslint-import-resolver-typescript/releases)
- [Changelog](https://github.com/import-js/eslint-import-resolver-typescript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-import-resolver-typescript/compare/v3.5.5...v3.6.1)

---
updated-dependencies:
- dependency-name: eslint-import-resolver-typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 14:02:13 +00:00
dependabot[bot] e0fc982ae5 build(deps-dev): bump @typescript-eslint/parser from 6.3.0 to 6.9.1 (#241)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.3.0 to 6.9.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 14:00:15 +00:00
dependabot[bot] c3736a0955 build(deps): bump actions/setup-node from 3 to 4 (#237)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 13:57:14 +00:00
dependabot[bot] 05d621a883 build(deps): bump actions/checkout from 3 to 4 (#209)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 13:56:58 +00:00
dependabot[bot] 7927a80e63 build(deps-dev): bump prettier from 3.0.1 to 3.0.3 (#206)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.1 to 3.0.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.1...3.0.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 13:56:32 +00:00
dependabot[bot] 6d02be04f7 build(deps-dev): bump eslint from 8.46.0 to 8.53.0 (#244)
Bumps [eslint](https://github.com/eslint/eslint) from 8.46.0 to 8.53.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.46.0...v8.53.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 13:55:21 +00:00
dependabot[bot] e27eec824f build(deps): bump @babel/traverse from 7.22.8 to 7.23.2 (#235)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.8 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 13:52:59 +00:00
dependabot[bot] 01def5d074 build(deps-dev): bump @types/node from 18.17.4 to 18.18.8 (#242)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.17.4 to 18.18.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 13:52:33 +00:00
Iain Sproat 2f4e3cf8e3 feat(compute resources): suggest recommended limits to CPU and Memory for a Function (#243)
* feat(compute resources): suggest recommended limits to CPU and Memory for a Function

* Adds documentation
2023-11-06 14:48:11 +01:00
Iain Sproat 2cf7d93b74 Add tests and refactor (#231)
- generally improves tests which were not working, and adds them to CI pipeline
- refactors to catch errors
- Rename github action to match current usage
- Informing GitHub of failure is done at the top-level method
- Add tests for network and http errors
- reduce coverage thresholds
2023-10-19 15:45:58 +01:00
dependabot[bot] bcc6ed5ca1 build(deps): bump zod from 3.21.4 to 3.22.3 (#233)
* build(deps): bump zod from 3.21.4 to 3.22.3

Bumps [zod](https://github.com/colinhacks/zod) from 3.21.4 to 3.22.3.
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Changelog](https://github.com/colinhacks/zod/blob/master/CHANGELOG.md)
- [Commits](https://github.com/colinhacks/zod/compare/v3.21.4...v3.22.3)

---
updated-dependencies:
- dependency-name: zod
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update dist

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-10-16 11:31:13 +01:00
dependabot[bot] 0c51cac769 build(deps): bump postcss from 8.4.25 to 8.4.31 (#227)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.25 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.25...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-16 11:11:19 +01:00
dependabot[bot] 47b660068e build(deps): bump get-func-name from 2.0.0 to 2.0.2 (#223)
Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2.
- [Release notes](https://github.com/chaijs/get-func-name/releases)
- [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2)

---
updated-dependencies:
- dependency-name: get-func-name
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-16 11:10:38 +01:00
Gergő Jedlicska 342c0fb72d update action variables 2023-09-22 12:17:32 +02:00
Gergő Jedlicska 5462de9d2d functionReleaseTag as an input 2023-09-22 11:35:15 +02:00
Gergő Jedlicska ea219ded92 feat: use shorthened git commit id, change output variable to version tag 2023-09-18 17:26:12 +02:00
Gergő Jedlicska 4599eff830 explicitly read from the home directory 2023-08-11 16:04:42 +02:00
Gergő Jedlicska 352365220a move to a file based function input 2023-08-10 17:03:40 +02:00
Gergő Jedlicska c3d711f76d update dist 2023-08-10 16:26:47 +02:00
Gergő Jedlicska ae84132685 Merge branch 'main' of github.com:specklesystems/speckle-automate-github-action 2023-08-10 16:06:40 +02:00
Gergő Jedlicska 937dd88b55 merge error raising 2023-08-10 16:06:11 +02:00
dependabot[bot] c05a324919 build(deps-dev): bump @typescript-eslint/eslint-plugin (#190)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.2.1 to 6.3.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.3.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 09:47:11 +02:00
dependabot[bot] 2f49a4a2c3 build(deps-dev): bump vite from 4.4.8 to 4.4.9 (#188)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.8 to 4.4.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.4.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 09:43:24 +02:00
dependabot[bot] 62fe5d2d6e build(deps-dev): bump @typescript-eslint/parser from 6.2.1 to 6.3.0 (#191)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.2.1 to 6.3.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.3.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 09:43:00 +02:00
dependabot[bot] 0715b5030c build(deps-dev): bump @types/node from 18.17.1 to 18.17.4 (#192)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.17.1 to 18.17.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 09:41:39 +02:00
Gergő Jedlicska 0b374bbe38 gergo/simplify (#189)
* refactor to a lean implementation

* update gitignore

* rework retry errors

* add main test example

* remove integration tests

* prettier fix
2023-08-09 09:39:37 +02:00
55 changed files with 27043 additions and 124587 deletions
+12 -28
View File
@@ -7,46 +7,30 @@ on: # rebuild any PRs and main branch changes
- 'releases/*'
jobs:
integration-test: # make sure the action works on a clean machine without building
pre-commit-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.4.0
- uses: actions/checkout@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Yarn Install
run: yarn install
- uses: actions/cache/save@v3
id: cache-save
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- run: |
yarn run run:mockserver & # run mockserver in background, will be killed when test finishes
- uses: ./
with:
speckle_automate_url: 'http://127.0.0.1:3000'
speckle_token: 'lolzSuperSecretzToken'
speckle_function_id: 'functionid'
speckle_function_path: 'examples/minimal'
speckle_function_command: 'echo'
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@v3
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v4
with:
node-version: '18.17.1'
cache: 'yarn'
- name: Yarn Install
run: yarn install
- uses: actions/cache/save@v3
- uses: actions/cache/save@v4
id: cache-save
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- uses: pre-commit/action@v3.0.0
- uses: pre-commit/action@v3.0.1
- name: Tests
run: yarn test
continue-on-error: true # ignore test failures for now
+1
View File
@@ -34,6 +34,7 @@ node_modules
# dotenv environment variables file
.env
.env.test
.envrc
# Ignore built ts files
lib
-16
View File
@@ -5,7 +5,6 @@ repos:
- id: check-yaml
args:
- --allow-multiple-documents
exclude: deploy/helm
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
@@ -49,21 +48,6 @@ repos:
types:
- ts
language: system
- id: build-mockserver
name: build mockserver package
entry: yarn run package:mockserver
pass_filenames: false
types:
- ts
language: system
- id: unit tests
name: unit tests
entry: yarn run test
pass_filenames: false
language: system
types:
- ts
exclude: ^dist/
- repo: https://github.com/specklesystems/pre-commit
rev: '0.2.0'
+46 -21
View File
@@ -13,7 +13,6 @@ It is a GitHub Action that publishes a Speckle Automate Function definition to S
> This is a low level building block action.
> As a Speckle Automate Function developer you probably want to use our [composite action](https://github.com/specklesystems/speckle-automate-github-composite-action)
### Inputs
#### `speckle_automate_url`
@@ -32,19 +31,41 @@ If you believe your token has been compromised, please revoke it immediately on
Please note that this is not a Speckle Account token, but a **Speckle Automate API** token. You can create one by logging into the [Speckle Automate Server](https://automate.speckle.dev) and going to the [API Tokens](https://automate.speckle.dev/tokens) page.
#### `speckle_function_path`
The path to the Speckle Automate Function to publish. This path is relative to the root of the repository. If you provide a path to a directory, your Speckle Automate Function must be in a file named `specklefunction.yaml` within that directory.
#### `speckle_function_id`
*Optional.* If you have already registered a Speckle Function, you can use the ID of that Speckle Function to ensure that any changes are associated with it.
If you do not provide a Function Id, we will attempt to determine the Function ID based on the GitHub server, GitHub repository, Reference (branch), and the Speckle Function Path.
Providing a Speckle Function ID allows you to change one of those values, and update the original Function instead of creating a new one.
Associates this new version with the given ID of a Speckle Function.
Your Speckle Token must have write permissions for the Speckle Function with this ID, otherwise the publish will fail.
#### `speckle_function_input_schema_file_path`
*Optional.* The path to the JSON Schema file that describes the input schema for this version of the Speckle Function. This file is used to define the input form that will be presented to users when they compose an Automation based on this Function. If not provided, no input form will be presented to users.
#### `speckle_function_command`
The command to run when this version of the Speckle Function is invoked. This command must be a valid command for the Docker image that contains the Speckle Function. This command must be a single string.
#### `speckle_function_release_tag`
The release tag for this version of the Speckle Function. This is intended to provide a more human understandable name for this version, and we recommend using the Git SHA of the commit used to generate this function version. The name must conform to the following:
- A minimum of 1 character is required.
- A maximum of 128 characters are permitted.
- The first character must be alphanumeric (of lower or upper case) or an underscor.
- Subsequent characters, if any, must be either alphanumeric (lower or upper case), underscore, hyphen, or a period.
#### `speckle_function_recommended_cpu_m`
*Optional.* The recommended maximum CPU in millicores for the function. If the Function exceeds this limit, it will be throttled to run within the limit.
1000 millicores = 1 CPU core. Defaults to 1000 millicores (1 CPU core).
#### `speckle_function_recommended_memory_mi`
*Optional.* The recommended maximum memory in mebibytes for the function. If the Function exceeds this limit, it will be **terminated**.
1024 mebibytes = 1 gibibyte. Defaults to 100 mebibytes.
### Outputs
#### `version_id`
@@ -67,9 +88,9 @@ with:
# speckle_automate_url is optional and defaults to https://automate.speckle.dev
# The speckle_token is a secret and must be stored in GitHub as an encrypted secret
# https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
speckle_token: ${{ secrets.SPECKLE_TOKEN }}
# speckle_function_path is optional and defaults to ./specklefunction.yaml
# speckle_function_id is optional and will be auto-generated if not provided
speckle_token: "${{ secrets.SPECKLE_TOKEN }}"
speckle_function_id: "abcdefghij"
speckle_function_release_tag: "1.0.0"
```
#### Publish a function to a self-hosted server
@@ -81,8 +102,8 @@ with:
speckle_automate_url: https://example.org
# https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
speckle_token: ${{ secrets.SPECKLE_TOKEN }}
# speckle_function_path is optional and defaults to ./specklefunction.yaml
# speckle_function_id is optional and will be auto-generated if not provided
speckle_function_id: "abcdefghij"
speckle_function_release_tag: "1.0.0"
```
### Example usage within an entire GitHub Actions Workflow
@@ -113,12 +134,6 @@ jobs:
# but Speckle Automate does
name: Checkout
uses: actions/checkout@v3
-
id: speckle
name: Register Speckle Function
uses: actions/speckle-automate-github-action@0.1.0
with:
speckle_token: ${{ secrets.SPECKLE_TOKEN }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
@@ -143,7 +158,17 @@ jobs:
# ## platforms must match the platforms that you have registered with Speckle Automate, which also defaults to linux/amd64.
# platforms: linux/amd64
push: true
tags: ${{ steps.speckle.outputs.image_name }}
# The name of the image to build and push.
# This must be the automate url host, followed by the function id, followed by the release tag.
tags: automate.speckle.dev/abcdefghij:1.0.0
-
id: speckle
name: Register Speckle Function
uses: actions/speckle-automate-github-action@0.1.0
with:
speckle_token: ${{ secrets.SPECKLE_TOKEN }}
speckle_function_id: "abcdefghij"
speckle_function_release_tag: "1.0.0"
```
## Developing & Debugging
+13 -6
View File
@@ -15,17 +15,24 @@ inputs:
speckle_function_id:
description: 'The unique identifier of the function. Go to automate to generate one.'
required: true
speckle_function_input_schema:
description: 'JSON Schema of the parameters object required by the function.'
speckle_function_input_schema_file_path:
description: 'File path containing JSON Schema of the parameters object required by the function.'
required: false
speckle_function_command:
description: 'The command to run to execute the function in a runtime environment.'
required: true
speckle_function_release_tag:
description: 'User defined tag for the function release'
required: true
speckle_function_recommended_cpu_m:
description: 'The recommended maximum CPU in millicores for the function. 1000 millicores = 1 CPU core. Defaults to 1000 millicores (1 CPU core). If the Function exceeds this limit, it will be throttled to run within the limit.'
required: false
speckle_function_recommended_memory_mi:
description: 'The recommended maximum memory in mebibytes for the function. 1024 mebibytes = 1 gibibyte. Defaults to 100 mebibytes. If the Function exceeds this limit, it will be terminated.'
required: false
outputs:
version_id:
description: 'The unique identifier of the function version.'
speckle_automate_host:
description: 'The host component of the Speckle Automate Server URL.'
speckle_automate_function_release_id:
description: 'The unique identifier of the function release.'
runs:
using: 'node16' #FIXME bump to node18 when available
main: 'dist/action/index.js'
Generated Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "toFormData": () => (/* binding */ toFormData)
/* harmony export */ });
/* harmony import */ var fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2777);
/* harmony import */ var fetch_blob_from_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2185);
/* harmony import */ var formdata_polyfill_esm_min_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8010);
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+24728 -8497
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
-457
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-28552
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-1087
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-1929
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-6131
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-28541
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-3872
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-2900
View File
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
-38030
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
-833
View File
@@ -1,833 +0,0 @@
@parcel/watcher-wasm
MIT
arch
MIT
The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
braces
MIT
The MIT License (MIT)
Copyright (c) 2014-2018, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
clipboardy
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
consola
MIT
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Prompt support is based on https://github.com/natemoo-re/clack
MIT License
Copyright (c) Nate Moore
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
Color support is based on https://github.com/jorgebucaran/colorette
Copyright © Jorge Bucaran <https://jorgebucaran.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cross-spawn
MIT
The MIT License (MIT)
Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
execa
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
fill-range
MIT
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
get-stream
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
h3
MIT
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
human-signals
Apache-2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019 ehmicky <ehmicky@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
is-docker
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
is-extglob
MIT
The MIT License (MIT)
Copyright (c) 2014-2016, Jon Schlinkert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
is-glob
MIT
The MIT License (MIT)
Copyright (c) 2014-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
is-number
MIT
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
is-stream
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
is-wsl
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
isexe
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
jiti
MIT
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
listhen
MIT
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
merge-stream
MIT
The MIT License (MIT)
Copyright (c) Stephen Sugden <me@stephensugden.com> (stephensugden.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
micromatch
MIT
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
mimic-fn
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
npm-run-path
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
onetime
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
path-key
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
picomatch
MIT
The MIT License (MIT)
Copyright (c) 2017-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
shebang-command
MIT
MIT License
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
shebang-regex
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
signal-exit
ISC
The ISC License
Copyright (c) 2015, Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice
appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
strip-final-newline
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
to-regex-range
MIT
The MIT License (MIT)
Copyright (c) 2015-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
which
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-3
View File
@@ -1,3 +0,0 @@
{
"type": "module"
}
File diff suppressed because one or more lines are too long
BIN
View File
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
apiVersion: speckle.systems/v1alpha1
kind: SpeckleFunction
metadata:
name: minimal
annotations:
'speckle.systems/v1alpha1/publishing/status': 'draft'
spec: {}
+21 -30
View File
@@ -8,56 +8,47 @@
"main": "lib/main.js",
"type": "module",
"scripts": {
"all": "yarn run build && yarn run prettier:check && yarn run lint && yarn run package && yarn run package:mockserver && yarn run test",
"all": "yarn run build && yarn run prettier:check && yarn run lint && yarn run package",
"build": "tsc -p tsconfig.json",
"build:image": "docker build -t speckle/speckle-automate-github-action:local .",
"lint": "eslint src/**/*.ts",
"package": "ncc build --target es2020 --source-map --license licenses.txt -o dist/action src/main.ts",
"package:mockserver": "ncc build --target es2020 --source-map --license licenses.txt -o dist/testing/mockserver src/tests/mock-server.ts",
"precommit": "pre-commit run --all-files",
"prettier:check": "prettier --check '**/*.ts'",
"prettier:fix": "prettier --write '**/*.ts'",
"run:mockserver": "node dist/testing/mockserver/index.js",
"test": "vitest --run --coverage",
"test": "vitest --run --coverage",
"test:watch": "vitest"
},
"engines": {
"node": "^16.19.1"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/core": "^1.10.1",
"@lifeomic/attempt": "^3.0.3",
"node-fetch": "^3.3.2",
"zod": "^3.21.4",
"zod-validation-error": "^1.3.1"
"zod": "^3.22.3"
},
"devDependencies": {
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.17.1",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"@vercel/ncc": "^0.36.1",
"@vitest/coverage-istanbul": "^0.34.1",
"eslint": "^8.46.0",
"eslint-import-resolver-typescript": "^3.5.5",
"@types/js-yaml": "^4.0.9",
"@types/node": "^18.19.3",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.14.0",
"@vercel/ncc": "^0.38.1",
"@vitest/coverage-istanbul": "^1.2.2",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "latest",
"eslint-plugin-github": "^4.9.2",
"eslint-plugin-github": "^4.10.1",
"eslint-plugin-i18n-text": "^1.0.1",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vitest": "^0.2.8",
"get-port-please": "^3.0.1",
"h3": "^1.7.1",
"js-yaml": "^4.1.0",
"listhen": "^1.2.2",
"msw": "^1.2.3",
"pino": "^8.14.2",
"pino-pretty": "^10.2.0",
"prettier": "^3.0.1",
"typescript": "^5.1.6",
"vite": "^4.4.8",
"vitest": "^0.34.1"
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vitest": "^0.3.22",
"msw": "^2.1.7",
"prettier": "^3.2.5",
"typescript": "^5.2.2",
"vite": "^5.0.12",
"vitest": "^1.2.2"
}
}
-275
View File
@@ -1,275 +0,0 @@
import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest'
import { setupServer } from 'msw/node'
import { rest } from 'msw'
import { getMinimalSpeckleFunctionExample } from '../schema/specklefunction.spec.js'
import httpClient, {
defaultClientErrorHandler,
throwErrorOnClientErrorStatusCode,
NonRetryableError,
RetryableError
} from './client.js'
import { getLogger } from '../tests/logger.js'
import { ValidationError } from 'zod-validation-error'
import { AttemptContext } from '@lifeomic/attempt'
import fetch, { AbortError, FetchError } from 'node-fetch'
import { Readable } from 'stream'
describe('client', () => {
const server = setupServer()
beforeAll(() => {
server.listen({ onUnhandledRequest: 'error' })
})
afterAll(() => {
server.close()
})
afterEach(() => {
server.resetHandlers()
})
function createFakeContext(): AttemptContext {
return {
attemptNum: 0,
attemptsRemaining: 0,
aborted: false,
abort() {
this.aborted = true
}
}
}
function fakeErrorHandler(error: unknown, context: AttemptContext) {
const fakeContext = createFakeContext()
defaultClientErrorHandler(error, createFakeContext())
context.aborted = fakeContext.aborted
}
describe('postManifest', () => {
describe('valid input', () => {
it('should respond to client with image name, function id, and version id', async () => {
server.use(
rest.post(
'https://success.automate.speckle.example.org/api/v1/functions/functionid/versions',
async (req, res, ctx) => {
expect(await req.json()).toStrictEqual({
versionTag: 'main',
commitId: '1234567890',
command: [],
inputSchema: {},
annotations: getMinimalSpeckleFunctionExample().metadata?.annotations
})
expect(req.headers.get('Authorization')).toBe('Bearer supersecret')
const response = await res(
ctx.status(201),
ctx.json({
versionId: 'minimalversionid'
})
)
return response
}
)
)
const test = httpClient.postManifest(
'https://success.automate.speckle.example.org',
'supersecret',
'functionid',
{
versionTag: 'main',
commitId: '1234567890',
inputSchema: {},
command: [],
annotations: getMinimalSpeckleFunctionExample()?.metadata?.annotations
},
getLogger(),
fetch,
fakeErrorHandler
)
await expect(test).resolves.toStrictEqual({
versionId: 'minimalversionid'
})
})
})
describe('server responds with a 500 HTTP Status Code', () => {
it('should throw an error', async () => {
server.use(
rest.post(
'https://failure.automate.speckle.example.org/api/v1/functions/functionid/versions',
async (req, res, ctx) => {
const response = await res(ctx.status(500))
return response
}
)
)
await expect(
httpClient.postManifest(
'https://failure.automate.speckle.example.org',
'sometoken',
'functionid',
{
versionTag: '',
commitId: '',
command: [],
inputSchema: {},
annotations: getMinimalSpeckleFunctionExample()?.metadata?.annotations
},
getLogger(),
fetch,
fakeErrorHandler
)
).rejects.toThrow()
})
})
describe('server responds with an unexpected response body', () => {
it('should throw an error', async () => {
server.use(
rest.post(
'https://unexpectedresponse.automate.speckle.example.org/api/v1/functions/functionid/versions',
async (req, res, ctx) => {
const response = await res(
ctx.status(201),
ctx.json({
unexpected: 'unexpected'
})
)
return response
}
)
)
await expect(
httpClient.postManifest(
'https://unexpectedresponse.automate.speckle.example.org',
'sometoken',
'functionid',
{
versionTag: '',
commitId: '',
command: [],
inputSchema: {},
annotations: getMinimalSpeckleFunctionExample()?.metadata?.annotations
},
getLogger(),
fetch,
fakeErrorHandler
)
).rejects.toThrow(ValidationError)
})
})
describe('invalid input', () => {
describe('empty url', () => {
it('should throw an error', async () => {
await expect(
httpClient.postManifest(
'',
'supersecret',
'functionid',
{
versionTag: 'main',
commitId: '1234567890',
command: [],
inputSchema: {},
annotations: getMinimalSpeckleFunctionExample()?.metadata?.annotations
},
getLogger(),
fetch,
fakeErrorHandler
)
).rejects.toThrow(Error)
})
})
describe('empty token', () => {
it('should throw an error', async () => {
await expect(
httpClient.postManifest(
'https://example.org',
'',
'functionid',
{
versionTag: 'main',
commitId: '1234567890',
inputSchema: {},
command: [],
annotations: getMinimalSpeckleFunctionExample()?.metadata?.annotations
},
getLogger(),
fetch,
fakeErrorHandler
)
).rejects.toThrow(Error)
})
})
})
})
describe('defaultClientErrorHandler', () => {
it('aborts unknown errors', () => {
const context = createFakeContext()
expect(context.aborted).toBeFalsy()
defaultClientErrorHandler('🚨', context)
expect(context.aborted).toBeTruthy()
})
it('aborts when the error is a fetch abort error', () => {
const context = createFakeContext()
expect(context.aborted).toBeFalsy()
defaultClientErrorHandler(new AbortError('aborting'), context)
expect(context.aborted).toBeTruthy()
})
it('aborts when the error is a fetch error', () => {
const context = createFakeContext()
expect(context.aborted).toBeFalsy()
defaultClientErrorHandler(new FetchError('not found', 'ENOTFOUND'), context)
expect(context.aborted).toBeTruthy()
})
it('does not abort when the error is a retryable error', () => {
const context = createFakeContext()
expect(context.aborted).toBeFalsy()
defaultClientErrorHandler(new RetryableError('retryable'), context)
expect(context.aborted).toBeFalsy()
})
})
describe('throwErrorOnClientErrorStatusCode', () => {
it('does not throw an error on 2xx', async () => {
const result = await throwErrorOnClientErrorStatusCode(async () => {
return { body: Readable.from(''), status: 200 }
})()
expect(result.status).toBe(200)
})
it('does not throw an error on 3xx', async () => {
const result = await throwErrorOnClientErrorStatusCode(async () => {
return { body: Readable.from(''), status: 300 }
})()
expect(result.status).toBe(300)
})
it('throws an error on 4xx', async () => {
const result = throwErrorOnClientErrorStatusCode(async () => {
return { body: Readable.from(''), status: 400 }
})()
await expect(result).rejects.toThrow(NonRetryableError)
})
it('throws an error on 5xx', async () => {
const result = throwErrorOnClientErrorStatusCode(async () => {
return { body: Readable.from(''), status: 500 }
})()
await expect(result).rejects.toThrow(RetryableError)
})
it('fetch errors are passed through', async () => {
const result = throwErrorOnClientErrorStatusCode(async () => {
throw new FetchError('not found', 'ENOTFOUND')
})()
await expect(result).rejects.toThrow(FetchError)
})
it('abort errors are passed through', async () => {
const result = throwErrorOnClientErrorStatusCode(async () => {
throw new AbortError('aborting error')
})()
await expect(result).rejects.toThrow(AbortError)
})
it('unknown errors are passed through', async () => {
const result = throwErrorOnClientErrorStatusCode(async () => {
throw new Error('unknown error')
})()
await expect(result).rejects.toThrow(Error)
})
})
})
-122
View File
@@ -1,122 +0,0 @@
import {
SpeckleFunctionPostResponseBody,
SpeckleFunctionPostResponseBodySchema,
FunctionVersionRequest
} from './schema.js'
import { URL } from 'url'
import { handleZodError } from '../schema/errors.js'
import { Logger } from '../logging/logger.js'
import fetch, { Response } from 'node-fetch'
import { AttemptContext, HandleError, retry } from '@lifeomic/attempt'
export default {
postManifest: async (
url: string,
token: string,
functionId: string,
body: FunctionVersionRequest,
logger: Logger,
_fetch: typeof fetch = fetch,
errorHandler = defaultClientErrorHandler
): Promise<SpeckleFunctionPostResponseBody> => {
if (!url) throw new Error('Speckle Server URL is required')
if (!token) throw new Error('Speckle Token is required')
const endpointUrl = new URL(`/api/v1/functions/${functionId}/versions`, url)
let responseBodyStream: NodeJS.ReadableStream | null
try {
responseBodyStream = await retryAPIRequest(
throwErrorOnClientErrorStatusCode(async () =>
_fetch(endpointUrl.href, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
},
body: JSON.stringify(body)
})
),
errorHandler
)
} catch (err) {
throw new Error(`Failed to register Speckle Function: ${err}`, { cause: err }) //FIXME use a more specific error type
}
const response = new Response(responseBodyStream)
let responseBody: SpeckleFunctionPostResponseBody
try {
responseBody = SpeckleFunctionPostResponseBodySchema.parse(await response.json())
} catch (err) {
throw handleZodError(err, logger)
}
return responseBody
}
}
export function defaultClientErrorHandler(
error: unknown,
context: AttemptContext
): void {
if (isNonRetryableError(error)) {
context.abort()
}
}
function isNonRetryableError(error: unknown) {
return !(error instanceof RetryableError)
}
export function throwErrorOnClientErrorStatusCode<
T extends NodeJS.ReadableStream | null
>(
apiRequest: () => Promise<{ body: T; status: number }>
): () => Promise<{ body: T; status: number }> {
return async () => {
const response = await apiRequest()
// do not retry our failures
if (response.status >= 400 && response.status < 500)
throw new NonRetryableError(
`Status code indicates a client error. Not retrying. (status: "${
response.status
}"; body: "${await new Response(response.body).text()}")`
)
if (response.status >= 500)
throw new RetryableError(
`Status code indicates a server error. Retrying. (status: "${
response.status
}"; body: "${await new Response(response.body).text()}")`
)
return response
}
}
export async function retryAPIRequest<T>(
apiRequest: () => Promise<{ body: T; status: number }>,
errorHandler: HandleError<{ body: T; status: number }>
): Promise<T> {
const { body } = await retry(apiRequest, {
delay: 200,
factor: 2,
maxAttempts: 5,
minDelay: 100,
maxDelay: 500,
jitter: true,
handleError: errorHandler
})
return body
}
export class RetryableError extends Error {
constructor(message: string) {
super(message)
this.name = 'RetryableError'
}
}
export class NonRetryableError extends Error {
constructor(message: string) {
super(message)
this.name = 'NonRetryableError'
}
}
-51
View File
@@ -1,51 +0,0 @@
import { beforeEach, describe, expect, it } from 'vitest'
import { ZodError } from 'zod'
import {
getMinimalSpeckleFunctionExample,
NonConformantSpeckleFunction
} from '../schema/specklefunction.spec.js'
import { FunctionVersionRequestSchema } from './schema.js'
type NonConformanSpeckleFunctionPostRequestBody = {
versionTag: string | undefined
commitId: string | undefined
steps: []
inputSchema: object
manifest: NonConformantSpeckleFunction | undefined
}
function getMinimumRequestBody(): NonConformanSpeckleFunctionPostRequestBody {
return {
versionTag: 'main',
commitId: 'sha123',
steps: [],
inputSchema: {},
manifest: getMinimalSpeckleFunctionExample()
}
}
describe('schema', () => {
let minimal: NonConformanSpeckleFunctionPostRequestBody
beforeEach(() => {
minimal = getMinimumRequestBody()
})
describe('Speckle Function Post Request Body Schema', () => {
it('cannot be empty', async () => {
expect(() => FunctionVersionRequestSchema.parse('')).toThrow(ZodError)
})
describe('versionTag', () => {
it('cannot be empty', () => {
minimal.versionTag = ''
expect(() => FunctionVersionRequestSchema.parse(minimal)).toThrow(ZodError)
})
})
describe('commitId', () => {
it('cannot be empty', () => {
minimal.commitId = ''
expect(() => FunctionVersionRequestSchema.parse(minimal)).toThrow(ZodError)
})
})
})
})
-21
View File
@@ -1,21 +0,0 @@
import { z } from 'zod'
import { SpeckleFunctionAnnotationsSchema } from '../schema/specklefunction.js'
import { CommitIdSchema, VersionTagSchema } from '../schema/inputs.js'
export const FunctionVersionRequestSchema = z.object({
commitId: CommitIdSchema,
versionTag: VersionTagSchema, // TODO: this should be a valid semver...
inputSchema: z.record(z.string(), z.unknown()),
command: z.array(z.string().nonempty()),
annotations: SpeckleFunctionAnnotationsSchema
})
export type FunctionVersionRequest = z.infer<typeof FunctionVersionRequestSchema>
export const SpeckleFunctionPostResponseBodySchema = z.object({
versionId: z.string().nonempty()
})
export type SpeckleFunctionPostResponseBody = z.infer<
typeof SpeckleFunctionPostResponseBodySchema
>
-15
View File
@@ -1,15 +0,0 @@
'use strict'
import { promises as fsPromises } from 'fs'
import yaml from 'js-yaml'
export type FileSystem = {
loadYaml: (filePath: string) => Promise<unknown>
}
const fileUtil = {
loadYaml: async (filePath: string) => {
return yaml.load(await fsPromises.readFile(filePath, 'utf8'))
}
}
export default fileUtil
-64
View File
@@ -1,64 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { getMinimalSpeckleFunctionExample } from '../schema/specklefunction.spec.js'
import { getLogger } from '../tests/logger.js'
import { findAndParseManifest } from './parser.js'
import { ValidationError } from 'zod-validation-error'
describe('filesystem/parser', () => {
afterEach(async () => {
vi.restoreAllMocks()
})
describe('No Yaml file', () => {
it('should throw', async () => {
await expect(async () =>
findAndParseManifest('doesNotExist', {
logger: getLogger(),
fileSystem: {
loadYaml: async () => {
throw new Error('File does not exist')
}
}
})
).rejects.toThrow(Error)
})
})
})
describe('Minimal yaml file', () => {
it('should parse', async () => {
const speckleFunction = await findAndParseManifest('examples/minimal', {
logger: getLogger(),
fileSystem: { loadYaml: async () => getMinimalSpeckleFunctionExample() }
})
expect(speckleFunction).toBeDefined()
expect(speckleFunction.metadata.name).toBe('minimal')
})
describe('with filename in path', () => {
it('should parse', async () => {
const speckleFunction = await findAndParseManifest(
'examples/minimal/specklefunction.yaml',
{
logger: getLogger(),
fileSystem: {
loadYaml: async () => getMinimalSpeckleFunctionExample()
}
}
)
expect(speckleFunction).toBeDefined()
expect(speckleFunction.metadata.name).toBe('minimal')
})
})
describe('Invalid yaml file', () => {
it('should throw', async () => {
await expect(async () =>
findAndParseManifest('src/tests/data/invalid', {
logger: getLogger(),
fileSystem: {
loadYaml: async () => {
return 'invalid: yaml'
}
}
})
).rejects.toThrow(ValidationError)
})
})
})
-32
View File
@@ -1,32 +0,0 @@
import { FileSystem } from './files.js'
import { SpeckleFunction, SpeckleFunctionSchema } from '../schema/specklefunction.js'
import * as path from 'path'
import { Logger } from '../logging/logger.js'
import { handleZodError } from '../schema/errors.js'
export type ParserOptions = {
logger: Logger
fileSystem: FileSystem
}
export async function findAndParseManifest(
pathToSpeckleFunctionFile: string,
opts: ParserOptions
): Promise<SpeckleFunction> {
if (!pathToSpeckleFunctionFile.toLocaleLowerCase().endsWith('specklefunction.yaml')) {
pathToSpeckleFunctionFile = path.join(
pathToSpeckleFunctionFile,
'specklefunction.yaml'
)
}
const speckleFunctionRaw = await opts.fileSystem.loadYaml(pathToSpeckleFunctionFile)
let speckleFunction: SpeckleFunction
try {
speckleFunction = await SpeckleFunctionSchema.parseAsync(speckleFunctionRaw)
} catch (err) {
throw handleZodError(err, opts.logger)
}
return speckleFunction
}
-5
View File
@@ -1,5 +0,0 @@
export interface Logger {
error: (message: string | Error) => void
info: (message: string) => void
debug: (message: string) => void
}
+244 -35
View File
@@ -1,42 +1,251 @@
import * as core from '@actions/core'
import { registerSpeckleFunction } from './registerspecklefunction.js'
import fileUtil from './filesystem/files.js'
import { ZodError, z } from 'zod'
import fetch from 'node-fetch'
import { retry } from '@lifeomic/attempt'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
async function run(): Promise<void> {
const InputVariablesSchema = z.object({
speckleAutomateUrl: z.string().url().min(1),
speckleToken: z.string().min(1),
speckleFunctionId: z.string().min(1),
speckleFunctionInputSchema: z.record(z.string().min(1), z.unknown()).nullable(),
speckleFunctionCommand: z.array(z.string().min(1)),
speckleFunctionReleaseTag: z
.string()
.regex(
new RegExp('^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$'),
'A maximum of 128 characters are permitted. The first character must be alphanumeric (of lower or upper case) or an underscore, the subsequent characters may be alphanumeric (or lower or upper case), underscore, hyphen, or period.'
),
speckleFunctionRecommendedCPUm: z
.number()
.int()
.finite()
.gte(100)
.lte(16000)
.optional(),
speckleFunctionRecommendedMemoryMi: z
.number()
.int()
.finite()
.gte(1)
.lte(8000)
.optional()
})
type InputVariables = z.infer<typeof InputVariablesSchema>
const parseInputs = (): InputVariables => {
const speckleTokenRaw = core.getInput('speckle_token', { required: true })
core.setSecret(speckleTokenRaw)
const rawInputSchemaPath = core.getInput('speckle_function_input_schema_file_path')
const homeDir = process.env['HOME']
if (!homeDir)
throw new Error('The home directory is not defined, cannot load inputSchema')
let speckleFunctionInputSchema: Record<string, unknown> | null = null
if (rawInputSchemaPath) {
const rawInputSchema = readFileSync(join(homeDir, rawInputSchemaPath), 'utf-8')
speckleFunctionInputSchema = JSON.parse(rawInputSchema)
}
const rawInputs: InputVariables = {
speckleAutomateUrl: core.getInput('speckle_automate_url', { required: true }),
speckleToken: speckleTokenRaw,
speckleFunctionId: core.getInput('speckle_function_id', { required: true }),
speckleFunctionInputSchema,
speckleFunctionCommand: core
.getInput('speckle_function_command', { required: true })
.split(' '),
speckleFunctionReleaseTag: core.getInput('speckle_function_release_tag', {
required: true
}),
speckleFunctionRecommendedCPUm:
parseInt(
core.getInput('speckle_function_recommended_cpu_m', {
required: false
})
) || undefined,
speckleFunctionRecommendedMemoryMi:
parseInt(
core.getInput('speckle_function_recommended_memory_mi', { required: false })
) || undefined
}
const inputParseResult = InputVariablesSchema.safeParse(rawInputs)
if (inputParseResult.success) return inputParseResult.data
throw inputParseResult.error
}
const RequiredEnvVarsSchema = z.object({
gitCommitSha: z.string().nonempty()
})
type RequiredEnvVars = z.infer<typeof RequiredEnvVarsSchema>
const parseEnvVars = (): RequiredEnvVars => {
const parseResult = RequiredEnvVarsSchema.safeParse({
gitCommitSha: process.env.GITHUB_SHA
} as RequiredEnvVars)
if (parseResult.success) return parseResult.data
throw parseResult.error
}
type FunctionVersionRequestBody = {
commitId: string
versionTag: string
command: string[]
inputSchema: Record<string, unknown> | null
recommendedCPUm?: number
recommendedMemoryMi?: number
}
const FunctionVersionResponseBodySchema = z.object({
versionId: z.string().nonempty()
})
type FunctionVersionResponseBody = z.infer<typeof FunctionVersionResponseBodySchema>
const registerNewVersionForTheSpeckleAutomateFunction = async (
{
speckleAutomateUrl,
speckleFunctionCommand,
speckleFunctionId,
speckleFunctionInputSchema,
speckleToken,
speckleFunctionReleaseTag,
speckleFunctionRecommendedCPUm,
speckleFunctionRecommendedMemoryMi
}: InputVariables,
commitId: string
// { gitCommitSha, gitRefName, gitRefType }: RequiredEnvVars
): Promise<FunctionVersionResponseBody> => {
try {
const speckleAutomateUrlRaw = core.getInput('speckle_automate_url')
const speckleTokenRaw = core.getInput('speckle_token')
core.setSecret(speckleTokenRaw)
const speckleFunctionIdRaw = core.getInput('speckle_function_id')
const speckleFunctionInputSchema = core.getInput('speckle_function_input_schema')
const speckleFunctionCommand = core.getInput('speckle_function_command')
const gitRefName = process.env.GITHUB_REF_NAME
const gitRefType = process.env.GITHUB_REF_TYPE
const gitCommitShaRaw = process.env.GITHUB_SHA
if (!gitCommitShaRaw) throw new Error('GITHUB_REF_NAME is not defined')
if (!gitRefName) throw new Error('GITHUB_REF_NAME is not defined')
if (!gitRefType) throw new Error('GITHUB_REF_TYPE is not defined')
const speckleAutomateHost = new URL(speckleAutomateUrlRaw).host
const { versionId } = await registerSpeckleFunction({
speckleServerUrl: speckleAutomateUrlRaw,
speckleToken: speckleTokenRaw,
speckleFunctionId: speckleFunctionIdRaw,
speckleFunctionInputSchema,
speckleFunctionCommand,
versionTag: gitRefType === 'tag' ? gitRefName : gitCommitShaRaw,
commitId: gitCommitShaRaw,
logger: core,
fileSystem: fileUtil
})
core.setOutput('version_id', versionId)
core.setOutput('speckle_automate_host', speckleAutomateHost)
} catch (error) {
if (error instanceof Error) core.setFailed(error.message)
const requestBody: FunctionVersionRequestBody = {
commitId,
versionTag: speckleFunctionReleaseTag,
command: speckleFunctionCommand,
inputSchema: speckleFunctionInputSchema,
recommendedCPUm: speckleFunctionRecommendedCPUm,
recommendedMemoryMi: speckleFunctionRecommendedMemoryMi
}
const versionRegisterUrl = new URL(
`/api/v1/functions/${speckleFunctionId}/versions`,
speckleAutomateUrl
)
const retryFlag = 'RETRY THIS'
const response = await retry(
async () => {
const res = await fetch(versionRegisterUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
authorization: `Bearer ${speckleToken}`
},
body: JSON.stringify(requestBody)
})
if (res.ok) return await res.json()
if (res.status >= 500) {
core.warning(
`RETRYING Version creation request since it failed with: ${await res.text()}`
)
throw retryFlag
}
throw Error(
`Request failed with status ${res.status}. Reason: ${await res.text()} `
)
},
{
delay: 200,
factor: 2,
maxAttempts: 5,
minDelay: 100,
maxDelay: 500,
jitter: true,
handleError: (err, context) => {
if (err !== retryFlag) {
context.abort()
throw err
}
}
}
)
const parsedResult = FunctionVersionResponseBodySchema.safeParse(response)
if (parsedResult.success) return parsedResult.data
throw parsedResult.error
} catch (err) {
if (err instanceof Error) {
throw Error(
`Failed to register new function version to the automate server. ${err.message}`,
{
cause: err
}
)
}
throw Error(
`Failed to register new function version to the automate server. ${err}`,
{
cause: err
}
)
}
}
const failAndReject = async (
e: unknown,
errorMessageForUnknownObjectType: string
): Promise<never> => {
if (e instanceof ZodError || e instanceof Error) {
core.setFailed(e.message)
return Promise.reject(e.message)
}
core.setFailed(errorMessageForUnknownObjectType)
return Promise.reject(e)
}
export async function run(): Promise<void> {
core.info('Start registering a new version on the automate instance')
let inputVariables: InputVariables = {} as InputVariables
try {
inputVariables = parseInputs()
} catch (e: unknown) {
return failAndReject(e, 'Failed to parse the input variables')
}
core.info(`Parsed input variables to: ${JSON.stringify(inputVariables)}`)
let requiredEnvVars: RequiredEnvVars = {} as RequiredEnvVars
try {
requiredEnvVars = parseEnvVars()
} catch (e: unknown) {
return failAndReject(e, 'Failed to parse the required environment variables')
}
const { gitCommitSha } = requiredEnvVars
core.info(
`Parsed required environment variables to: ${JSON.stringify(requiredEnvVars)}`
)
const { speckleAutomateUrl, speckleFunctionId } = inputVariables
core.setOutput('speckle_automate_host', new URL(speckleAutomateUrl).host)
core.info(
`Sending a new function version definition for function ${speckleFunctionId} to the automate server: ${speckleAutomateUrl}`
)
// github uses 7 chars to identify commits
const commitId = gitCommitSha.substring(0, 7)
let versionId = ''
try {
const registrationResponse = await registerNewVersionForTheSpeckleAutomateFunction(
inputVariables,
commitId
)
versionId = registrationResponse.versionId
} catch (e: unknown) {
return failAndReject(e, 'Failed to register the new function version')
}
core.info(
`Registered function version tagged as ${inputVariables.speckleFunctionReleaseTag} with new id: ${versionId}. Recommended CPU: ${inputVariables.speckleFunctionRecommendedCPUm}m, recommended memory: ${inputVariables.speckleFunctionRecommendedMemoryMi}Mi.`
)
core.setOutput('speckle_automate_function_release_id', versionId)
}
run()
-85
View File
@@ -1,85 +0,0 @@
import client from './client/client.js'
import { Logger } from './logging/logger.js'
import {
SpeckleServerUrlSchema,
SpeckleTokenSchema,
SpeckleFunctionIdSchema,
SpeckleFunctionInputSchema,
VersionTagSchema,
CommitIdSchema
} from './schema/inputs.js'
import { handleZodError } from './schema/errors.js'
import { FunctionVersionRequest } from './client/schema.js'
// import { findAndParseManifest } from './filesystem/parser.js'
import { FileSystem } from './filesystem/files.js'
type ProcessOptions = {
speckleServerUrl: string | undefined
speckleToken: string
versionTag: string
commitId: string
speckleFunctionId: string
speckleFunctionCommand: string
speckleFunctionInputSchema?: string | undefined
logger: Logger
fileSystem: FileSystem
}
type ProcessResult = {
versionId: string
}
export async function registerSpeckleFunction(
opts: ProcessOptions
): Promise<ProcessResult> {
let speckleServerUrl: string
let speckleToken: string
let speckleFunctionId: string
let speckleFunctionCommand: string[]
let speckleFunctionInputSchema: Record<string, unknown>
let versionTag: string
let commitId: string
try {
speckleServerUrl = SpeckleServerUrlSchema.parse(opts.speckleServerUrl)
speckleToken = SpeckleTokenSchema.parse(opts.speckleToken)
speckleFunctionId = SpeckleFunctionIdSchema.parse(opts.speckleFunctionId)
versionTag = VersionTagSchema.parse(opts.versionTag)
commitId = CommitIdSchema.parse(opts.commitId)
speckleFunctionInputSchema = opts.speckleFunctionInputSchema
? SpeckleFunctionInputSchema.parse(JSON.parse(opts.speckleFunctionInputSchema))
: {}
speckleFunctionCommand = opts.speckleFunctionCommand.split(' ')
} catch (err) {
throw handleZodError(err, opts.logger)
}
opts.logger.info(`Speckle Server URL: '${speckleServerUrl}'`)
//token is masked in the logs, so no need to print it here.
opts.logger.info(`Speckle Function ID: '${speckleFunctionId}'`)
// const manifest = await findAndParseManifest(speckleFunctionPath, {
// logger: opts.logger,
// fileSystem: opts.fileSystem
// })
const body: FunctionVersionRequest = {
commitId,
versionTag,
command: speckleFunctionCommand,
inputSchema: speckleFunctionInputSchema
}
const response = await client.postManifest(
speckleServerUrl,
speckleToken,
speckleFunctionId,
body,
opts.logger
)
opts.logger.info(
`Successfully registered version ${response.versionId} of Speckle Function ${speckleFunctionId}`
)
return response
}
-23
View File
@@ -1,23 +0,0 @@
import { describe, expect, it, vi } from 'vitest'
import { handleZodError } from './errors.js'
import { ZodError } from 'zod'
import { ValidationError } from 'zod-validation-error'
describe('errors', () => {
describe('with ZodError', () => {
it('logs and throws', async () => {
const errorFn = vi.fn()
const logger = { error: errorFn, info: vi.fn(), warn: vi.fn(), debug: vi.fn() }
expect(() => handleZodError(new ZodError([]), logger)).toThrow(ValidationError)
expect(errorFn).toHaveBeenCalledTimes(1)
})
})
describe('with unknown error', () => {
it('throws', async () => {
const errorFn = vi.fn()
const logger = { error: errorFn, info: vi.fn(), warn: vi.fn(), debug: vi.fn() }
expect(() => handleZodError(new Error('unknown'), logger)).toThrow(Error)
expect(errorFn).toHaveBeenCalledTimes(0)
})
})
})
-12
View File
@@ -1,12 +0,0 @@
import { Logger } from '../logging/logger.js'
import { fromZodError } from 'zod-validation-error'
import { ZodError } from 'zod'
export function handleZodError(err: unknown, logger: Logger): void {
if (err instanceof ZodError) {
const validationError = fromZodError(err)
logger.error(validationError)
throw validationError
}
throw err
}
-55
View File
@@ -1,55 +0,0 @@
import { describe, expect, it } from 'vitest'
import {
SpeckleFunctionPathSchema,
SpeckleServerUrlSchema,
SpeckleTokenSchema,
SpeckleFunctionInputSchema
} from './inputs.js'
import { ZodError } from 'zod'
describe('schema', () => {
describe('Speckle Server URL', () => {
it('cannot be empty', async () => {
expect(() => SpeckleServerUrlSchema.parse('')).toThrow(ZodError)
})
})
describe('Speckle Token', () => {
it('cannot be empty', async () => {
expect(() => SpeckleTokenSchema.parse('')).toThrow(ZodError)
})
})
describe('Speckle Function Path', () => {
it('cannot be empty', async () => {
expect(() => SpeckleFunctionPathSchema.parse('')).toThrow(ZodError)
})
it('cannot be an absolute path', async () => {
expect(() => SpeckleFunctionPathSchema.parse('/')).toThrow(ZodError)
})
it('can be a nested relative path', async () => {
expect(SpeckleFunctionPathSchema.parse('src/main.ts')).toBe('src/main.ts')
})
it('can have a leading dot slash', async () => {
expect(SpeckleFunctionPathSchema.parse('./src/main.ts')).toBe('./src/main.ts')
})
it('can be at the current directory', async () => {
expect(SpeckleFunctionPathSchema.parse('.')).toBe('.')
})
})
describe('Speckle Function Input Schema', () => {
it('can parse objects', () => {
const inputSchema = { foo: 'bar' }
expect(SpeckleFunctionInputSchema.parse(inputSchema)).toStrictEqual(inputSchema)
})
it('works for empty objects', () => {
const inputSchema = {}
expect(SpeckleFunctionInputSchema.parse(inputSchema)).toStrictEqual(inputSchema)
})
it('fails for not object types', () => {
const inputSchema = '{ "foo": "bar" }'
expect(SpeckleFunctionInputSchema.safeParse(inputSchema).success).toBeFalsy()
})
})
})
-15
View File
@@ -1,15 +0,0 @@
import { z } from 'zod'
export const SpeckleServerUrlSchema = z.string().url().nonempty()
export const SpeckleTokenSchema = z.string().nonempty()
export const SpeckleFunctionRepositorySchema = z.string().nonempty() //TODO validate this as a git+https, https, or ssh url
export const SpeckleFunctionPathSchema = z
.string()
.nonempty()
.refine((value: string) => !value.startsWith('/'), {
message: 'Must not be an absolute path.'
})
export const SpeckleFunctionIdSchema = z.string().nonempty()
export const VersionTagSchema = z.string().nonempty()
export const CommitIdSchema = z.string().nonempty()
export const SpeckleFunctionInputSchema = z.record(z.string(), z.unknown())
-90
View File
@@ -1,90 +0,0 @@
import { beforeEach, describe, expect, it } from 'vitest'
import { SpeckleFunctionAnnotations, SpeckleFunctionSchema } from './specklefunction.js'
import { ZodError } from 'zod'
export type NonConformantSpeckleFunction = {
apiVersion: string | undefined
kind: string | undefined
metadata:
| {
name: string | undefined
annotations: SpeckleFunctionAnnotations | undefined
}
| undefined
spec: object | undefined
}
export function getMinimalSpeckleFunctionExample(): NonConformantSpeckleFunction {
return {
apiVersion: 'speckle.systems/v1alpha1',
kind: 'SpeckleFunction',
metadata: {
name: 'minimal',
annotations: {
'speckle.systems/v1alpha1/publishing/status': 'draft'
}
},
spec: {}
}
}
describe('speckle function schema', () => {
let minimal: NonConformantSpeckleFunction
beforeEach(() => {
minimal = getMinimalSpeckleFunctionExample()
})
describe('Speckle Function', () => {
it('cannot be empty', async () => {
expect(() => SpeckleFunctionSchema.parse({})).toThrow(ZodError)
})
describe('apiVersion', () => {
it('cannot be missing-', async () => {
minimal.apiVersion = ''
expect(() => SpeckleFunctionSchema.parse('{}')).toThrow(ZodError)
})
it('cannot be invalid', async () => {
minimal.apiVersion = 'invalid'
expect(() => SpeckleFunctionSchema.parse(minimal)).toThrow(ZodError)
})
})
describe('kind', () => {
it('cannot be missing', async () => {
minimal.kind = ''
expect(() => SpeckleFunctionSchema.parse('/')).toThrow(ZodError)
})
it('cannot be invalid', async () => {
minimal.kind = 'invalid'
expect(() => SpeckleFunctionSchema.parse(minimal)).toThrow(ZodError)
})
})
describe('metadata', () => {
it('cannot be missing a metadata', async () => {
minimal.metadata = undefined
expect(() => SpeckleFunctionSchema.parse(minimal)).toThrow(ZodError)
})
describe('name', () => {
it('cannot be missing', async () => {
if (minimal.metadata === undefined) throw new Error('metadata is undefined') // for typescript
minimal.metadata.name = ''
expect(() => SpeckleFunctionSchema.parse(minimal)).toThrow(ZodError)
})
})
})
describe('spec', () => {
it('cannot be missing', async () => {
minimal.spec = undefined
expect(() => SpeckleFunctionSchema.parse(minimal)).toThrow(ZodError)
})
})
it('can be minimal', async () => {
expect(SpeckleFunctionSchema.parse(minimal)).toStrictEqual(minimal)
})
})
})
-61
View File
@@ -1,61 +0,0 @@
import { z } from 'zod'
export type SpeckleFunctionKind = 'SpeckleFunction'
export const SpeckleFunctionKind: SpeckleFunctionKind = 'SpeckleFunction'
export type SpeckleFunctionApiVersion = 'speckle.systems/v1alpha1'
export const SpeckleFunctionApiVersionV1Alpha1: SpeckleFunctionApiVersion =
'speckle.systems/v1alpha1'
export type SpeckleFunctionAnnotations = z.infer<
typeof SpeckleFunctionAnnotationsSchema
>
export const SpeckleFunctionAnnotationsSchema = z
.object({
'speckle.systems/v1alpha1/publishing/status': z
.enum(['publish', 'draft', 'archive'])
.default('draft'), //description('Whether this Function is published (and should appear in the library), a draft, or archived.'),
'speckle.systems/v1alpha1/author': z.string().optional(), //.description('The name of the authoring organisation or individual of this Function.'),
'speckle.systems/v1alpha1/license': z
.enum(['MIT', 'BSD', 'Apache-2.0', 'MPL', 'CC0', 'Unlicense'])
.optional(), //.description('The license under under which this Function is made available. This must match the license in the source code repository.'), //TODO match the specification for license names
'speckle.systems/v1alpha1/website': z.string().url().optional(), //.description('The marketing website for this Function or its authors.'),
'speckle.systems/v1alpha1/documentation': z.string().url().optional(), //.description('The documentation website for this function. For example, this could be a url to the README in the source code repository.'),
'speckle.systems/v1alpha1/keywords': z.string().optional(), //.description('Comma separated list of keywords used for categorising this function.'),
'speckle.systems/v1alpha1/description': z.string().optional()
})
.optional()
export type SpeckleFunction = z.infer<typeof SpeckleFunctionSchema>
export const SpeckleFunctionSchema = z.object({
kind: z.literal(SpeckleFunctionKind),
apiVersion: z.enum([SpeckleFunctionApiVersionV1Alpha1]),
metadata: z.object({
name: z.string().nonempty(),
annotations: SpeckleFunctionAnnotationsSchema
}),
spec: z.object({
inputs: z
.array(
z.object({
//TODO
})
)
.optional(),
results: z
.array(
z.object({
//TODO
})
)
.optional(),
requirements: z
.object({
os: z.enum(['windows', 'linux']).default('linux'),
architecture: z.enum(['amd64']).default('amd64'),
infrastructure: z.array(z.enum(['gpu'])).optional()
})
.optional()
})
})
-86
View File
@@ -1,86 +0,0 @@
import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest'
import { setupServer } from 'msw/node'
import { rest } from 'msw'
import { registerSpeckleFunction } from '../registerspecklefunction.js'
import { getLogger } from './logger.js'
import { getMinimalSpeckleFunctionExample } from '../schema/specklefunction.spec.js'
import { ValidationError } from 'zod-validation-error'
describe('integration', () => {
const server = setupServer()
beforeAll(() => {
server.listen({ onUnhandledRequest: 'error' })
})
afterAll(() => {
server.close()
})
afterEach(() => {
server.resetHandlers()
})
describe('Load from ./examples directory', () => {
describe('registerSpeckleAutomate', () => {
describe('valid input', () => {
it('should respond with the version id', async () => {
server.use(
rest.post(
'https://integration1.automate.speckle.example.org/api/v1/functions/functionid/versions',
async (req, res, ctx) => {
const requestData = await req.json()
expect(requestData).toStrictEqual({
versionTag: 'main',
commitId: '1234567890',
command: ['echo', 'Hello', 'world'],
inputSchema: {}
// annotations: getMinimalSpeckleFunctionExample().metadata?.annotations
})
expect(req.headers.get('Authorization')).toBe('Bearer supersecret')
const response = await res(
ctx.status(201),
ctx.json({
versionId: 'minimalversionid'
})
)
return response
}
)
)
const result = registerSpeckleFunction({
speckleFunctionId: 'functionid',
speckleServerUrl: 'https://integration1.automate.speckle.example.org',
speckleToken: 'supersecret',
speckleFunctionCommand: 'echo Hello world',
versionTag: 'main',
commitId: '1234567890',
logger: getLogger(),
fileSystem: {
loadYaml: async () => getMinimalSpeckleFunctionExample()
}
})
await expect(result).resolves.toStrictEqual({
versionId: 'minimalversionid'
})
})
})
describe('invalid input', () => {
it('should throw an error', async () => {
await expect(async () =>
registerSpeckleFunction({
speckleFunctionId: 'functionid',
speckleServerUrl: 'https://integration1.automate.speckle.example.org',
speckleToken: '',
speckleFunctionCommand: 'echo Hello world',
versionTag: '',
commitId: '',
logger: getLogger(),
fileSystem: {
loadYaml: async () => getMinimalSpeckleFunctionExample()
}
})
).rejects.toThrow(ValidationError)
})
})
})
})
})
-27
View File
@@ -1,27 +0,0 @@
import { pino, LoggerOptions, stdTimeFunctions } from 'pino'
export function getLogger(): pino.Logger<LoggerOptions> {
const pinoOptions: LoggerOptions = {
base: undefined, // Set to undefined to avoid adding pid, hostname properties to each log.
formatters: {
level: (label: string) => {
return { level: label }
}
},
level: 'debug',
timestamp: stdTimeFunctions.isoTime
}
pinoOptions.transport = {
target: 'pino-pretty',
options: {
colorize: true,
destination: 2, //stderr
ignore: 'time',
levelFirst: true,
singleLine: true
}
}
return pino(pinoOptions)
}
-103
View File
@@ -1,103 +0,0 @@
import {
eventHandler,
createApp,
createRouter,
H3Event,
toNodeListener,
readBody,
sendError,
createError
} from 'h3'
import { listen } from 'listhen'
import { getPort } from 'get-port-please'
import { z } from 'zod'
import { SpeckleFunctionPostResponseBody } from '../client/schema.js'
async function run() {
const hostname = '127.0.0.1'
const app = createApp({ debug: false })
const router = createRouter().post(
'/api/v1/functions/functionid/versions',
eventHandler(async (event: H3Event): Promise<SpeckleFunctionPostResponseBody> => {
try {
const body = await readBody(event)
FunctionVersionRequestSchema.parse(body) // throw error if invalid
event.node.res.statusCode = 201
event.node.res.statusMessage = 'Created'
event.node.res.setHeader('Content-Type', 'application/json')
} catch (err) {
sendError(
event,
createError({
status: 422,
statusText: `Unprocessable Entity. ${
err instanceof Error ? err.message : JSON.stringify(err)
}`
})
)
}
return {
versionId: 'minimalversionid'
}
})
)
app.use(router)
const port = await getPort(3000)
listen(toNodeListener(app), {
hostname,
port
})
}
run()
// copied as of commit 2e04a81dea7f9ee079d17617d4e5fed6b2192211
export const FunctionVersionRequestSchema = z.object({
commitId: z.string(),
versionTag: z.string(),
inputSchema: z.record(z.string(), z.unknown()),
command: z.array(z.string().nonempty()),
annotations: z
.object({
'speckle.systems/v1alpha1/publishing/status': z
.enum(['publish', 'draft', 'archive'], {
description:
'Whether this Function is published (and should appear in the library), a draft, or archived.'
})
.default('draft'),
'speckle.systems/v1alpha1/author': z
.string({
description:
'The name of the authoring organization or individual of this Function.'
})
.optional(),
'speckle.systems/v1alpha1/license': z
.enum(['MIT', 'BSD', 'Apache-2.0', 'MPL', 'CC0', 'Unlicense'], {
description:
'The license under under which this Function is made available. This must match the license in the source code repository.'
})
.optional(), //TODO match the specification for license names
'speckle.systems/v1alpha1/website': z
.string({
description: 'The marketing website for this Function or its authors.'
})
.url()
.optional(),
'speckle.systems/v1alpha1/documentation': z
.string({
description:
'The documentation website for this function. For example, this could be a url to the README in the source code repository.'
})
.url()
.optional(),
'speckle.systems/v1alpha1/keywords': z
.string({
description:
'Comma separated list of keywords used for categorizing this function.'
})
.optional(),
'speckle.systems/v1alpha1/description': z.string().optional()
})
.optional()
})
+292
View File
@@ -0,0 +1,292 @@
import { run } from '../src/main.js'
import {
describe,
it,
vi,
afterEach,
beforeEach,
expect,
beforeAll,
afterAll
} from 'vitest'
import { mkdtempSync, writeFileSync, rmdirSync, rmSync } from 'node:fs'
import { join } from 'node:path'
import { tmpdir } from 'node:os'
import { setupServer } from 'msw/node'
import { http, HttpResponse } from 'msw'
import { z } from 'zod'
describe('Register new version', () => {
let tmpDir: string
let countHappyPath = 0
let count500Errors = 0
let count422Errors = 0
const error422 = {
type: 'H3Error',
message: 'Body parsing failed',
stack: `Error: Body parsing failed
at createError...`,
statusCode: 422,
fatal: false,
unhandled: false,
statusMessage: 'Body parsing failed',
data: {
type: 'ZodError',
message:
'[\n {\n "code": "custom",\n "message": "Invalid JSON schema: strict mode: unknown keyword: \\"IAmInvalid\\"",\n "path": [\n "inputSchema"\n ]\n }\n]',
stack: {
ZodError: [
{
code: 'custom',
message: 'Invalid JSON schema: strict mode: unknown keyword: "IAmInvalid"',
path: ['inputSchema']
}
]
},
aggregateErrors: [
{
type: 'Object',
message: 'Invalid JSON schema: strict mode: unknown keyword: "IAmInvalid"',
stack: {},
code: 'custom',
path: ['inputSchema']
}
],
issues: [
{
code: 'custom',
message: 'Invalid JSON schema: strict mode: unknown keyword: "IAmInvalid"',
path: ['inputSchema']
}
],
name: 'ZodError'
}
}
const server = setupServer(
http.post(
'http://myfakeautomate.speckle.internal/api/v1/functions/fake_function_id/versions',
async ({ request }) => {
const parseResult = FunctionVersionRequestSchema.safeParse(await request.json())
expect(parseResult.success).to.be.true
countHappyPath++
return new HttpResponse(JSON.stringify({ versionId: 'fake_version_id' }), {
status: 201,
headers: {
'Content-Type': 'application/json'
}
})
}
),
http.post(
'http://myfakeautomate.speckle.internal/api/v1/functions/network_error/versions',
async ({ request }) => {
const parseResult = FunctionVersionRequestSchema.safeParse(await request.json())
expect(parseResult.success).to.be.true
return HttpResponse.error() // simulates a network error
}
),
http.post(
'http://myfakeautomate.speckle.internal/api/v1/functions/422_response/versions',
async ({ request }) => {
const parseResult = FunctionVersionRequestSchema.safeParse(await request.json())
expect(parseResult.success).to.be.true
count422Errors++
return HttpResponse.json(error422, {
status: 422
})
}
),
http.post(
'http://myfakeautomate.speckle.internal/api/v1/functions/500_response/versions',
async ({ request }) => {
const parseResult = FunctionVersionRequestSchema.safeParse(await request.json())
expect(parseResult.success).to.be.true
count500Errors++
return HttpResponse.json(
{},
{
status: 500
}
)
}
)
)
beforeAll(() => server.listen({ onUnhandledRequest: 'error' }))
afterAll(() => server.close())
beforeEach(() => {
tmpDir = mkdtempSync(join(tmpdir(), 'speckle-automate-github-action-test-'))
})
afterEach(() => {
rmSync(tmpDir, { recursive: true })
vi.unstubAllEnvs()
server.resetHandlers()
})
it('sends the request', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', 'fake_function_id')
vi.stubEnv('INPUT_SPECKLE_TOKEN', '{token}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_COMMAND', 'echo "hello automate"')
vi.stubEnv('HOME', tmpDir) // the input schema file path is assumed to be relative to the home directory
vi.stubEnv('INPUT_SPECKLE_FUNCTION_INPUT_SCHEMA_FILE_PATH', './schema.json')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RELEASE_TAG', 'v1.0.0')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RECOMMENDED_CPU_M', '1000')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RECOMMENDED_MEMORY_MI', '500')
vi.stubEnv('INPUT_SPECKLE_AUTOMATE_URL', 'http://myfakeautomate.speckle.internal')
vi.stubEnv('GITHUB_SHA', 'commitSha')
vi.stubEnv('GITHUB_REF_TYPE', 'commit')
vi.stubEnv('GITHUB_REF_NAME', 'version')
await expect(run()).resolves.not.toThrow()
expect(countHappyPath).to.equal(1)
countHappyPath = 0
})
it('handles network errors', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', 'network_error')
vi.stubEnv('INPUT_SPECKLE_TOKEN', '{token}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_COMMAND', 'echo "hello automate"')
vi.stubEnv('HOME', tmpDir) // the input schema file path is assumed to be relative to the home directory
vi.stubEnv('INPUT_SPECKLE_FUNCTION_INPUT_SCHEMA_FILE_PATH', './schema.json')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RELEASE_TAG', 'v1.0.0')
vi.stubEnv('INPUT_SPECKLE_AUTOMATE_URL', 'http://myfakeautomate.speckle.internal')
vi.stubEnv('GITHUB_SHA', 'commitSha')
vi.stubEnv('GITHUB_REF_TYPE', 'commit')
vi.stubEnv('GITHUB_REF_NAME', 'version')
await expect(run()).rejects.toThrow(
'Failed to register new function version to the automate server'
)
})
it('handles 500 responses', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', '500_response')
vi.stubEnv('INPUT_SPECKLE_TOKEN', '{token}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_COMMAND', 'echo "hello automate"')
vi.stubEnv('HOME', tmpDir) // the input schema file path is assumed to be relative to the home directory
vi.stubEnv('INPUT_SPECKLE_FUNCTION_INPUT_SCHEMA_FILE_PATH', './schema.json')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RELEASE_TAG', 'v1.0.0')
vi.stubEnv('INPUT_SPECKLE_AUTOMATE_URL', 'http://myfakeautomate.speckle.internal')
vi.stubEnv('GITHUB_SHA', 'commitSha')
vi.stubEnv('GITHUB_REF_TYPE', 'commit')
vi.stubEnv('GITHUB_REF_NAME', 'version')
await expect(run()).rejects.toThrow(
'Failed to register new function version to the automate server'
)
expect(count500Errors).to.toBeGreaterThan(1) // we expect the action to retry the request
count500Errors = 0
})
it('handles 422 responses', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', '422_response')
vi.stubEnv('INPUT_SPECKLE_TOKEN', '{token}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_COMMAND', 'echo "hello automate"')
vi.stubEnv('HOME', tmpDir) // the input schema file path is assumed to be relative to the home directory
vi.stubEnv('INPUT_SPECKLE_FUNCTION_INPUT_SCHEMA_FILE_PATH', './schema.json')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RELEASE_TAG', 'v1.0.0')
vi.stubEnv('INPUT_SPECKLE_AUTOMATE_URL', 'http://myfakeautomate.speckle.internal')
vi.stubEnv('GITHUB_SHA', 'commitSha')
vi.stubEnv('GITHUB_REF_TYPE', 'commit')
vi.stubEnv('GITHUB_REF_NAME', 'version')
await expect(run()).rejects.toThrow(
'Failed to register new function version to the automate server'
)
expect(count422Errors).to.eq(1) // we expect the action not to retry the request
count422Errors = 0 // reset the count after the test
})
it('errors if the token is empty', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', 'fake_function_id')
vi.stubEnv('INPUT_SPECKLE_TOKEN', '')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_COMMAND', 'echo "hello automate"')
vi.stubEnv('HOME', tmpDir) // the input schema file path is assumed to be relative to the home directory
vi.stubEnv('INPUT_SPECKLE_FUNCTION_INPUT_SCHEMA_FILE_PATH', './schema.json')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RELEASE_TAG', 'v1.0.0')
vi.stubEnv('INPUT_SPECKLE_AUTOMATE_URL', 'http://myfakeautomate.speckle.internal')
vi.stubEnv('GITHUB_SHA', 'commitSha')
vi.stubEnv('GITHUB_REF_TYPE', 'commit')
vi.stubEnv('GITHUB_REF_NAME', 'version')
await expect(run()).rejects.toThrow(
'Input required and not supplied: speckle_token'
)
})
it('errors if the environment variable is empty', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', 'fake_function_id')
vi.stubEnv('INPUT_SPECKLE_TOKEN', '{token}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_COMMAND', 'echo "hello automate"')
vi.stubEnv('HOME', tmpDir) // the input schema file path is assumed to be relative to the home directory
vi.stubEnv('INPUT_SPECKLE_FUNCTION_INPUT_SCHEMA_FILE_PATH', './schema.json')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RELEASE_TAG', 'v1.0.0')
vi.stubEnv('INPUT_SPECKLE_AUTOMATE_URL', 'http://myfakeautomate.speckle.internal')
vi.stubEnv('GITHUB_SHA', '')
vi.stubEnv('GITHUB_REF_TYPE', 'commit')
vi.stubEnv('GITHUB_REF_NAME', 'version')
await expect(run()).rejects.toThrow('gitCommitSha')
})
})
//This must be updated to align with the schema in speckle automate
const FunctionVersionRequestSchema = z.object({
commitId: z
.string()
.trim()
.min(6)
.transform((arg: string) => arg.substring(0, 10)),
versionTag: z
.string()
.regex(
new RegExp('^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$'),
'A maximum of 128 characters are permitted. The first character must be alphanumeric (of lower or upper case) or an underscore, the subsequent characters may be alphanumeric (or lower or upper case), underscore, hyphen, or period.'
), // regex as per OCI distribution spec https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests
inputSchema: z.record(z.string(), z.unknown()).nullable(), // TODO: we need to validate the jsonschema somehow
command: z.array(z.string().nonempty()),
annotations: z
.object({
'speckle.systems/v1alpha1/publishing/status': z
.enum(['publish', 'draft', 'archive'], {
description:
'Whether this Function is published (and should appear in the library), a draft, or archived.'
})
.default('draft'),
'speckle.systems/v1alpha1/author': z
.string({
description:
'The name of the authoring organization or individual of this Function.'
})
.optional(),
'speckle.systems/v1alpha1/license': z
.enum(['MIT', 'BSD', 'Apache-2.0', 'MPL', 'CC0', 'Unlicense'], {
description:
'The license under under which this Function is made available. This must match the license in the source code repository.'
})
.optional(), //TODO match the specification for license names
'speckle.systems/v1alpha1/website': z
.string({
description: 'The marketing website for this Function or its authors.'
})
.url()
.optional(),
'speckle.systems/v1alpha1/documentation': z
.string({
description:
'The documentation website for this function. For example, this could be a url to the README in the source code repository.'
})
.url()
.optional(),
'speckle.systems/v1alpha1/keywords': z
.string({
description:
'Comma separated list of keywords used for categorizing this function.'
})
.optional(),
'speckle.systems/v1alpha1/description': z.string().optional()
})
.optional(),
recommendedCPUm: z.number().gte(100).lte(16000).finite().optional().default(1000),
recommendedMemoryMi: z.number().gte(1).lte(8000).finite().optional().default(100)
})
+4 -4
View File
@@ -20,10 +20,10 @@ export default defineConfig({
'**/*.mjs',
'**/*.js'
],
lines: 95,
functions: 95,
branches: 95,
statements: 95,
lines: 90,
functions: 90,
branches: 70,
statements: 90,
resolve: {
alias: {
'@': path.resolve(__dirname, './src/')
+1679 -2453
View File
File diff suppressed because it is too large Load Diff