Compare commits

..

222 Commits

Author SHA1 Message Date
52af76b7ed 1.3.5 2025-08-19 01:46:37 +00:00
414d7dd727 fix(core): Stabilize CI/workflows and runtime: update CI images/metadata, improve streaming requests and image handling, and fix tests & package metadata 2025-08-19 01:46:37 +00:00
4b1c908b89 1.3.4 2025-08-19 01:42:03 +00:00
6e313261e7 fix(test): Increase test timeout, enable DockerImageStore test, update test image name, bump smartrequest patch, and add local claude settings 2025-08-19 01:42:02 +00:00
42df15a523 1.3.3 2025-08-19 01:19:14 +00:00
7ef2ebcf5b fix(classes.host): Adjust requestStreaming timeout and autoDrain; stabilize tests 2025-08-19 01:19:14 +00:00
87f26b7b63 feat(tests): Add comprehensive tests for Docker image export and streaming functionality 2025-08-18 23:41:16 +00:00
ffdc61fb42 refactor(DockerHost): Enhance request handling with fluent API and improved response parsing 2025-08-18 22:39:05 +00:00
5b25704cf8 1.3.2 2025-08-18 21:52:41 +00:00
00e6033d8b fix(package.json): Fix test script timeout typo, update dependency versions, and add typings & project configs 2025-08-18 21:52:41 +00:00
453040983d 1.3.1 2025-08-18 21:47:31 +00:00
456858bc36 fix(test): Update test setup and devDependencies; adjust test import and add package metadata 2025-08-18 21:47:31 +00:00
606c82dafa 1.3.0 2024-12-23 00:30:20 +01:00
9fc4afe4b8 feat(core): Initial release of Docker client with TypeScript support 2024-12-23 00:30:20 +01:00
90689c2645 1.2.8 2024-12-23 00:30:00 +01:00
4a1d649e5e fix(core): Improved the image creation process from tar stream in DockerImage class. 2024-12-23 00:30:00 +01:00
66bd36dc4f 1.2.7 2024-10-13 13:29:19 +02:00
349d711cc5 fix(core): Prepare patch release with minor fixes and improvements 2024-10-13 13:29:18 +02:00
c74a4bcd5b 1.2.6 2024-10-13 13:23:41 +02:00
ff835c4160 fix(core): Minor refactoring and code quality improvements. 2024-10-13 13:23:40 +02:00
05eceeb056 1.2.5 2024-10-13 13:19:44 +02:00
de55beda08 fix(dependencies): Update dependencies for stability improvements 2024-10-13 13:19:43 +02:00
9aa2b0c7be 1.2.4 2024-10-13 13:14:36 +02:00
a283bbfba0 fix(core): Refactored DockerImageStore constructor to remove DockerHost dependency 2024-10-13 13:14:35 +02:00
8a4e300581 1.2.3 2024-08-21 16:04:43 +02:00
6b0d96b745 fix(dependencies): Update dependencies to the latest versions and fix image export test 2024-08-21 16:04:42 +02:00
a08c11838f 1.2.2 2024-06-10 00:15:10 +02:00
7c5225125c fix(core): update 2024-06-10 00:15:10 +02:00
bc4778f7db 1.2.1 2024-06-10 00:15:02 +02:00
2e7e8ae5cf fix(core): update 2024-06-10 00:15:01 +02:00
054585c7f5 1.2.0 2024-06-08 15:03:20 +02:00
c0cebbe614 feat(imagestore): now processing images with extraction, retagging, repackaging and long term storage 2024-06-08 15:03:19 +02:00
740f83114c 1.1.4 2024-06-06 00:32:51 +02:00
e48023d490 fix(core): update 2024-06-06 00:32:50 +02:00
eaaf313442 1.1.3 2024-06-06 00:25:40 +02:00
68b2baadae fix(core): update 2024-06-06 00:25:39 +02:00
6743dc35e7 1.1.2 2024-06-06 00:14:31 +02:00
bbf265716d fix(core): update 2024-06-06 00:14:30 +02:00
3a705534fe 1.1.1 2024-06-05 23:56:03 +02:00
cbdbd32dd1 fix(core): update 2024-06-05 23:56:02 +02:00
224004217c 1.1.0 2024-06-05 14:10:45 +02:00
e06ef454a6 feat(images): can now import and export images, start work on local 100% JS oci imageregistry 2024-06-05 14:10:44 +02:00
a5f4d93f50 1.0.112 2024-05-08 20:35:17 +02:00
9f5d2cacf1 fix(core): update 2024-05-08 20:35:16 +02:00
d9112d3e04 1.0.111 2024-05-08 19:58:09 +02:00
455404c3c9 fix(core): update 2024-05-08 19:58:09 +02:00
90089625dc 1.0.110 2024-04-23 20:10:37 +02:00
86d5cc1d47 fix(core): update 2024-04-23 20:10:36 +02:00
6407033694 1.0.109 2024-04-23 19:58:05 +02:00
9dd69868d9 fix(core): update 2024-04-23 19:58:04 +02:00
dc4074340d 1.0.108 2024-02-02 16:55:52 +01:00
001e870643 fix(core): update 2024-02-02 16:55:51 +01:00
440eb07afb 1.0.107 2024-02-02 16:54:08 +01:00
8d74712a97 fix(core): update 2024-02-02 16:54:07 +01:00
bbdf61e0a9 1.0.106 2024-02-02 16:40:39 +01:00
6f5ed697cb fix(core): update 2024-02-02 16:40:38 +01:00
cc93c296c6 1.0.105 2022-10-17 11:00:42 +02:00
07a4d024a8 fix(core): update 2022-10-17 11:00:42 +02:00
192216c7ec 1.0.104 2022-10-17 09:36:36 +02:00
daa97c68d9 fix(core): update 2022-10-17 09:36:35 +02:00
4569bffc37 1.0.103 2020-10-05 15:08:38 +00:00
ad4e6ad206 fix(core): update 2020-10-05 15:08:38 +00:00
ddfa701391 1.0.102 2020-10-01 14:59:38 +00:00
3d2d1e3b1d fix(core): update 2020-10-01 14:59:37 +00:00
01e79b8cd6 1.0.101 2020-09-30 17:06:27 +00:00
8b6021ff66 fix(core): update 2020-09-30 17:06:26 +00:00
5e5bb3032c 1.0.100 2020-09-30 17:01:55 +00:00
855e18a74f fix(core): update 2020-09-30 17:01:55 +00:00
b808a93e46 1.0.99 2020-09-30 17:01:30 +00:00
a18166260e fix(core): update 2020-09-30 17:01:30 +00:00
cba8de348d 1.0.98 2020-09-30 16:56:40 +00:00
30d4a7bd24 fix(core): update 2020-09-30 16:56:39 +00:00
4ea99426fd 1.0.97 2020-09-30 16:51:04 +00:00
19309f7f45 fix(core): update 2020-09-30 16:51:03 +00:00
4e7d2fd637 1.0.96 2020-09-30 16:35:24 +00:00
1675c0c4c9 fix(core): update 2020-09-30 16:35:24 +00:00
3a4f59ef9e 1.0.95 2020-09-30 16:27:43 +00:00
90eac3e50a fix(core): update 2020-09-30 16:27:43 +00:00
edec48529d 1.0.94 2020-03-23 00:17:15 +00:00
e622b97097 fix(core): update 2020-03-23 00:17:15 +00:00
23266ca459 1.0.93 2020-03-23 00:01:46 +00:00
a91e69b6db fix(core): update 2020-03-23 00:01:45 +00:00
015ccfad48 1.0.92 2020-03-22 23:53:32 +00:00
06d2fcb750 fix(core): update 2020-03-22 23:53:31 +00:00
f3e4bc0350 1.0.91 2019-11-20 13:36:36 +00:00
6de3abe3bf fix(readme): update 2019-11-20 13:36:36 +00:00
eaa4140f2f 1.0.90 2019-11-20 13:36:04 +00:00
b21fe80109 fix(structure): formatted, ci updates and new readme 2019-11-20 13:36:03 +00:00
96a2992432 1.0.89 2019-11-20 13:27:18 +00:00
870b5f2c07 fix(dependencies): update smartnetwork 2019-11-20 13:27:17 +00:00
212edf1db7 1.0.88 2019-11-19 18:45:10 +00:00
46dbd81bcc fix(dependencies): update 2019-11-19 18:45:09 +00:00
8f5678502d 1.0.87 2019-11-19 18:42:16 +00:00
959d7aaed1 fix(core): update 2019-11-19 18:42:15 +00:00
5aa10653b6 1.0.86 2019-10-05 15:59:37 +02:00
e120d6527e fix(core): update 2019-10-05 15:59:36 +02:00
c80da05fbb 1.0.85 2019-10-05 15:56:49 +02:00
b9c3475b86 fix(core): update 2019-10-05 15:56:46 +02:00
de2d7e647b 1.0.84 2019-09-24 20:20:37 +02:00
d9348bd016 fix(Image().getVersion()): now returns 0.0.0 for unavailable versions to make SemVer work later on 2019-09-24 20:20:37 +02:00
034fbc3994 1.0.83 2019-09-23 13:52:52 +02:00
a33a6a1f7f fix(core): update 2019-09-23 13:52:52 +02:00
9dd403821b 1.0.82 2019-09-23 13:41:06 +02:00
601d82ea74 fix(core): update 2019-09-23 13:41:06 +02:00
784bb22511 1.0.81 2019-09-22 23:42:30 +02:00
71c89ac9bc fix(core): update 2019-09-22 23:42:29 +02:00
0b3e3b68c9 1.0.80 2019-09-22 17:42:29 +02:00
f3779faaaf fix(core): update 2019-09-22 17:42:28 +02:00
73476c2c39 1.0.79 2019-09-22 17:03:53 +02:00
942f65268d fix(core): update 2019-09-22 17:03:53 +02:00
a965647c1f 1.0.78 2019-09-22 15:11:57 +02:00
db88c7f86c fix(core): update 2019-09-22 15:11:57 +02:00
3f18cb68bf 1.0.77 2019-09-22 15:02:29 +02:00
dae3b59e3b fix(core): update 2019-09-22 15:02:29 +02:00
53062e70d4 1.0.76 2019-09-22 14:32:48 +02:00
3e70dc465b fix(core): update 2019-09-22 14:32:48 +02:00
49445d93c6 1.0.75 2019-09-21 21:57:57 +02:00
4f838837f8 fix(core): update 2019-09-21 21:57:57 +02:00
c76968bbe8 1.0.74 2019-09-20 16:29:44 +02:00
6c5e5644b1 fix(core): update 2019-09-20 16:29:43 +02:00
5cf80944fe 1.0.73 2019-09-19 20:05:57 +02:00
cdb69c5f17 fix(core): update 2019-09-19 20:05:56 +02:00
178c1d2df1 1.0.72 2019-09-18 17:29:43 +02:00
43d9da808b fix(core): update 2019-09-18 17:29:43 +02:00
15f5c38eb0 1.0.71 2019-09-15 15:08:48 +02:00
225c1be14c fix(core): update 2019-09-15 15:08:48 +02:00
44f2aab2f6 1.0.70 2019-09-13 23:08:17 +02:00
b69315f1d3 1.0.69 2019-09-13 23:05:56 +02:00
7d20804986 fix(core): update 2019-09-13 23:05:55 +02:00
0aab639fbd 1.0.68 2019-09-13 22:43:30 +02:00
794bb60dfc fix(core): update 2019-09-13 22:43:29 +02:00
b182a379af 1.0.67 2019-09-13 22:37:38 +02:00
5c6c06dee6 fix(core): update 2019-09-13 22:37:38 +02:00
a48e1e035e 1.0.66 2019-09-13 22:31:03 +02:00
8836c06b56 fix(core): update 2019-09-13 22:31:03 +02:00
7af8e0739b 1.0.65 2019-09-13 22:09:35 +02:00
684185e951 fix(core): update 2019-09-13 22:09:35 +02:00
21e6fff3fb 1.0.64 2019-09-13 18:20:12 +02:00
83c49a6234 fix(core): update 2019-09-13 18:20:12 +02:00
ad67849d45 1.0.63 2019-09-13 18:16:22 +02:00
0e4e07a912 fix(core): update 2019-09-13 18:16:21 +02:00
1fbc09f557 1.0.62 2019-09-13 18:15:46 +02:00
d6201b864c fix(core): update 2019-09-13 18:15:45 +02:00
ea5e552192 1.0.61 2019-09-13 17:54:18 +02:00
1afe5c6e16 fix(core): update 2019-09-13 17:54:17 +02:00
eb0dc96dbd 1.0.60 2019-09-13 16:57:22 +02:00
55f45b1c3a fix(core): update 2019-09-13 16:57:21 +02:00
87ff0f01bb 1.0.59 2019-09-13 14:45:35 +02:00
dd1939d7b2 fix(core): update 2019-09-13 14:45:35 +02:00
5a2a5f1248 1.0.58 2019-09-13 14:40:38 +02:00
9767b8767a fix(core): update 2019-09-13 14:40:38 +02:00
546e139b46 1.0.57 2019-09-13 13:20:01 +02:00
28d70bb49f fix(core): update 2019-09-13 13:20:01 +02:00
b71f134abd 1.0.56 2019-09-12 14:52:56 +02:00
968b3c7449 fix(core): update 2019-09-12 14:52:55 +02:00
d9558f7843 1.0.55 2019-09-12 14:45:36 +02:00
19e67ffdcc fix(core): update 2019-09-12 14:45:36 +02:00
e983b66c28 1.0.54 2019-09-11 20:25:46 +02:00
c79f6a698f fix(core): update 2019-09-11 20:25:45 +02:00
0ef098e9c8 1.0.53 2019-09-08 19:22:20 +02:00
d56350ff28 fix(core): update 2019-09-08 19:22:20 +02:00
a4dc4e7950 1.0.52 2019-09-08 16:34:26 +02:00
424e911804 fix(core): update 2019-09-08 16:34:26 +02:00
b5c4727bae 1.0.51 2019-08-16 21:45:22 +02:00
b6f3fbf8a9 fix(core): update 2019-08-16 21:45:21 +02:00
7241e7a8fd 1.0.50 2019-08-16 21:34:36 +02:00
ae37148ece fix(core): update 2019-08-16 21:34:35 +02:00
65c37bdd6f 1.0.49 2019-08-16 21:21:31 +02:00
6acbe30e2e fix(core): update 2019-08-16 21:21:30 +02:00
eb6f7889d0 1.0.48 2019-08-16 21:10:03 +02:00
e39da5fee9 fix(core): update 2019-08-16 21:10:03 +02:00
b07628bb0b 1.0.47 2019-08-16 21:07:59 +02:00
5815f9b202 fix(core): update 2019-08-16 21:07:59 +02:00
846ea9997e 1.0.46 2019-08-16 18:32:42 +02:00
de54db33ad fix(core): update 2019-08-16 18:32:41 +02:00
314cb692ac 1.0.45 2019-08-16 18:21:55 +02:00
73f8ded3fe fix(core): update 2019-08-16 18:21:55 +02:00
a28b10ac51 1.0.44 2019-08-16 14:46:48 +02:00
927e2e0acc fix(core): update 2019-08-16 14:46:48 +02:00
c496405818 1.0.43 2019-08-16 12:48:57 +02:00
020737e21b fix(core): update 2019-08-16 12:48:56 +02:00
fe3560caac 1.0.42 2019-08-16 12:48:40 +02:00
b2a7e67868 fix(core): update 2019-08-16 12:48:40 +02:00
f772ca15ef 1.0.41 2019-08-15 19:04:10 +02:00
71cfad146f fix(core): update 2019-08-15 19:04:09 +02:00
43b1c13256 1.0.40 2019-08-15 19:02:44 +02:00
2c8b17f029 fix(core): update 2019-08-15 19:02:43 +02:00
c6521d9160 1.0.39 2019-08-15 19:00:17 +02:00
72c74e44b5 fix(core): update 2019-08-15 19:00:17 +02:00
2fb628213d 1.0.38 2019-08-15 18:50:13 +02:00
373a4e2eac fix(core): update 2019-08-15 18:50:13 +02:00
a202d05e9c 1.0.37 2019-08-14 23:21:54 +02:00
6e97a7d83c fix(core): update 2019-08-14 23:21:54 +02:00
04bb3b9ed0 1.0.36 2019-08-14 21:02:06 +02:00
29e502a32e fix(core): update 2019-08-14 21:02:06 +02:00
75a118183e 1.0.35 2019-08-14 20:58:10 +02:00
aa1fe594e8 fix(core): update 2019-08-14 20:58:10 +02:00
cf761e19bf 1.0.34 2019-08-14 20:57:43 +02:00
af7590c8de fix(core): update 2019-08-14 20:57:43 +02:00
ee2e4fb856 1.0.33 2019-08-14 20:56:57 +02:00
ff5cecb07e fix(core): update 2019-08-14 20:56:57 +02:00
e50b028c00 1.0.32 2019-08-14 14:19:46 +02:00
867dda8e7c fix(core): update 2019-08-14 14:19:45 +02:00
d12d595f21 1.0.31 2019-01-18 02:42:13 +01:00
6117228ea4 fix(core): update 2019-01-18 02:42:13 +01:00
b6b584f808 1.0.30 2019-01-10 00:43:46 +01:00
48fe6ce0a8 fix(core): update 2019-01-10 00:43:45 +01:00
55acb39071 1.0.29 2019-01-10 00:37:32 +01:00
f7b17a4684 fix(core): update 2019-01-10 00:37:32 +01:00
d95f6c8e7f 1.0.28 2019-01-10 00:31:49 +01:00
001cdadb6b fix(core): update 2019-01-10 00:31:48 +01:00
82655623d1 1.0.27 2019-01-10 00:28:13 +01:00
ea117bc391 fix(core): update 2019-01-10 00:28:12 +01:00
57594728df 1.0.26 2019-01-10 00:24:35 +01:00
8430a4d6e0 fix(core): update 2019-01-10 00:24:35 +01:00
7f38868510 1.0.25 2018-07-17 08:39:38 +02:00
7a80718d27 fix(core): update 2018-07-17 08:39:37 +02:00
1d0c4c3cf9 1.0.24 2018-07-16 23:52:50 +02:00
a037cba454 fix(core): shift to new style 2018-07-16 23:52:50 +02:00
7009e07ecc 1.0.23 2017-07-16 13:45:08 +02:00
7b8ef33e21 update creation of node_modules within npmdocker 2017-07-16 13:44:59 +02:00
3011e599e8 1.0.22 2017-07-16 12:04:53 +02:00
53 changed files with 11610 additions and 1687 deletions

View File

@@ -0,0 +1,66 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build

View File

@@ -0,0 +1,124 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

23
.gitignore vendored
View File

@@ -1,4 +1,23 @@
.yarn/
node_modules/
.nogit/
# artifacts
coverage/
public/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_*/
# AI
.claude/
.serena/
#------# custom

View File

@@ -1,62 +0,0 @@
image: hosttoday/ht-docker-dbase:npmci
services:
- docker:dind
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages:
- test
- release
- trigger
- pages
before_script:
- npmci prepare docker-gitlab
test:
stage: test
script:
- npmci test stable
tags:
- lossless
- priv
release:
image: hosttoday/ht-docker-node:npmci
stage: release
script:
- npmci publish npm
only:
- tags
tags:
- lossless
- priv
trigger:
image: hosttoday/ht-docker-node:npmci
stage: trigger
script:
- npmci trigger
only:
- tags
tags:
- lossless
- priv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command yarn global add npmpage
- npmci command npmpage --publish gitlab
tags:
- docker
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public

Binary file not shown.

68
.serena/project.yml Normal file
View File

@@ -0,0 +1,68 @@
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
# * For C, use cpp
# * For JavaScript, use typescript
# Special requirements:
# * csharp: Requires the presence of a .sln file in the project folder.
language: typescript
# whether to use the project's gitignore file to ignore files
# Added on 2025-04-07
ignore_all_files_in_gitignore: true
# list of additional paths to ignore
# same syntax as gitignore, so you can use * and **
# Was previously called `ignored_dirs`, please update your config if you are using that.
# Added (renamed) on 2025-04-07
ignored_paths: []
# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_lines`: Deletes a range of lines within a file.
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
# * `execute_shell_command`: Executes a shell command.
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
# * `initial_instructions`: Gets the initial instructions for the current project.
# Should only be used in settings where the system prompt cannot be set,
# e.g. in clients you have no control over, like Claude Desktop.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_at_line`: Inserts content at a given line in a file.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: Lists memories in Serena's project-specific memory store.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
# * `remove_project`: Removes a project from the Serena configuration.
# * `replace_lines`: Replaces a range of lines within a file with new content.
# * `replace_symbol_body`: Replaces the full definition of a symbol.
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
# * `switch_modes`: Activates modes by providing a list of their names
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: []
# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""
project_name: "docker"

11
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"type": "node-terminal"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}
}
}
}
]
}

View File

@@ -1,49 +0,0 @@
# dockersock
easy communication with docker remote api from node, TypeScript ready
## Availabililty
[![npm](https://mojoio.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/dockersock)
[![git](https://mojoio.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/mojoio/dockersock)
[![git](https://mojoio.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/mojoio/dockersock)
[![docs](https://mojoio.gitlab.io/assets/repo-button-docs.svg)](https://mojoio.gitlab.io/dockersock/)
## Status for master
[![build status](https://GitLab.com/mojoio/dockersock/badges/master/build.svg)](https://GitLab.com/mojoio/dockersock/commits/master)
[![coverage report](https://GitLab.com/mojoio/dockersock/badges/master/coverage.svg)](https://GitLab.com/mojoio/dockersock/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/dockersock.svg)](https://www.npmjs.com/package/dockersock)
[![Dependency Status](https://david-dm.org/mojoio/dockersock.svg)](https://david-dm.org/mojoio/dockersock)
[![bitHound Dependencies](https://www.bithound.io/github/mojoio/dockersock/badges/dependencies.svg)](https://www.bithound.io/github/mojoio/dockersock/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/mojoio/dockersock/badges/code.svg)](https://www.bithound.io/github/mojoio/dockersock)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
```TypeScript
import {Dockersock} from "dockersock"; // require Dockersock class
let myDockersock = new Dockersock(); // optional: you can pass a domain to the contructor, defaults to /var/run/docker.sock
myDockersock.listContainers() // promise, resolve gets container data
myDockersock.listContainersDetailed() // promise, resolve gets more detailed container data (by combining several requests internally)
myDockersock.listContainersRunning() // promise, resolve gets container data for currently running containers
myDockersock.listContainersStopped() // promise, resolve gets container data for stopped containers
myDockersock.startContainer({ // starts a already present container
name: "somecontainername"
})
myDockersock.newContainer({ // start new Container, equals "docker run" shell command
image: "someimagetag"
})
```
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://mojoio.gitlab.io/assets/repo-footer.svg)](https://mojo.io)

239
changelog.md Normal file
View File

@@ -0,0 +1,239 @@
# Changelog
## 2025-08-19 - 1.3.5 - fix(core)
Stabilize CI/workflows and runtime: update CI images/metadata, improve streaming requests and image handling, and fix tests & package metadata
- Update CI workflows and images: switch workflow IMAGE to code.foss.global/host.today/ht-docker-node:npmci, fix NPMCI_COMPUTED_REPOURL placeholders, and replace @shipzone/npmci with @ship.zone/npmci in workflows
- Update npmextra.json gitzone metadata (githost -> code.foss.global, gitscope -> apiclient.xyz, npmPackagename -> @apiclient.xyz/docker) and npmdocker.baseImage -> host.today/ht-docker-node:npmci
- Adjust package.json repository/bugs/homepage to code.foss.global, add pnpm overrides entry and normalize package metadata
- Improve DockerHost streaming and request handling: reduce requestStreaming timeout to 30s, enable autoDrain for streaming requests, improve response parsing for streaming vs JSON endpoints to avoid hangs
- Enhance DockerImage and DockerImageStore stream handling and tar processing: more robust import/export parsing, safer stream-to-file writes, repackaging steps, and error handling
- Unskip and update tests: re-enable DockerImageStore integration test, change stored image name to 'hello2', add formatting fixes and ensure cleanup stops the test DockerHost
- Miscellaneous code and docs cleanup: numerous formatting fixes and trailing-comma normalization across README and TS sources, update commitinfo and logger newline fixes, and add local tool ignores (.claude/.serena) to .gitignore
## 2025-08-19 - 1.3.4 - fix(test)
Increase test timeout, enable DockerImageStore test, update test image name, bump smartrequest patch, and add local claude settings
- Increase tstest timeout from 120s to 600s in package.json to accommodate longer-running integration tests.
- Unskip the DockerImageStore integration test and change stored image name from 'hello' to 'hello2' in test/test.nonci.node.ts.
- Bump dependency @push.rocks/smartrequest from ^4.3.0 to ^4.3.1.
- Add .claude/settings.local.json to allow local agent permissions for running tests and related tooling.
## 2025-08-19 - 1.3.3 - fix(classes.host)
Adjust requestStreaming timeout and autoDrain; stabilize tests
- Reduced requestStreaming timeout from 10 minutes to 30 seconds to avoid long-running hanging requests.
- Enabled autoDrain for streaming requests to ensure response streams are properly drained and reduce resource issues.
- Marked the DockerImageStore S3 integration test as skipped to avoid CI dependence on external S3 and added a cleanup test to stop the test DockerHost.
- Added local tool settings file (.claude/settings.local.json) with local permissions (development-only).
## 2025-08-18 - 1.3.2 - fix(package.json)
Fix test script timeout typo, update dependency versions, and add typings & project configs
- Fix test script: correct 'tineout' -> 'timeout' for npm test command and set timeout to 120s
- Add 'typings': 'dist_ts/index.d.ts' to package.json
- Bump dependencies to newer compatible versions (notable packages: @push.rocks/lik, @push.rocks/smartarchive, @push.rocks/smartbucket, @push.rocks/smartfile, @push.rocks/smartlog, @push.rocks/smartpromise, @push.rocks/smartstream, rxjs)
- Add project/config files: .serena/project.yml and .claude/settings.local.json (editor/CI metadata)
- Include generated cache/metadata files (typescript document symbols cache) — not source changes but tooling/cache artifacts
## 2025-08-18 - 1.3.1 - fix(test)
Update test setup and devDependencies; adjust test import and add package metadata
- Update test script to run with additional flags: --verbose, --logfile and --tineout 120
- Bump devDependencies: @git.zone/tsbuild -> ^2.6.7, @git.zone/tsrun -> ^1.3.3, @git.zone/tstest -> ^2.3.5, @push.rocks/qenv -> ^6.1.3
- Change test import from @push.rocks/tapbundle to @git.zone/tstest/tapbundle
- Add typings field (dist_ts/index.d.ts)
- Add packageManager field for pnpm@10.14.0 with integrity hash
## 2024-12-23 - 1.3.0 - feat(core)
Initial release of Docker client with TypeScript support
- Provides easy communication with Docker's remote API from Node.js
- Includes implementations for managing Docker services, networks, secrets, containers, and images
## 2024-12-23 - 1.2.8 - fix(core)
Improved the image creation process from tar stream in DockerImage class.
- Enhanced `DockerImage.createFromTarStream` method to handle streamed response and parse imported image details.
- Fixed the dependency version for `@push.rocks/smartarchive` in package.json.
## 2024-10-13 - 1.2.7 - fix(core)
Prepare patch release with minor fixes and improvements
## 2024-10-13 - 1.2.6 - fix(core)
Minor refactoring and code quality improvements.
## 2024-10-13 - 1.2.5 - fix(dependencies)
Update dependencies for stability improvements
- Updated @push.rocks/smartstream to version ^3.0.46
- Updated @push.rocks/tapbundle to version ^5.3.0
- Updated @types/node to version 22.7.5
## 2024-10-13 - 1.2.4 - fix(core)
Refactored DockerImageStore constructor to remove DockerHost dependency
- Adjusted DockerImageStore constructor to remove dependency on DockerHost
- Updated ts/classes.host.ts to align with DockerImageStore's new constructor signature
## 2024-08-21 - 1.2.3 - fix(dependencies)
Update dependencies to the latest versions and fix image export test
- Updated several dependencies to their latest versions in package.json.
- Enabled the previously skipped 'should export images' test.
## 2024-06-10 - 1.2.1-1.2.2 - Core/General
General updates and fixes.
- Fix core update
## 2024-06-10 - 1.2.0 - Core
Core updates and bug fixes.
- Fix core update
## 2024-06-08 - 1.2.0 - General/Core
Major release with core enhancements.
- Processing images with extraction, retagging, repackaging, and long-term storage
## 2024-06-06 - 1.1.4 - General/Imagestore
Significant feature addition.
- Add feature to process images with extraction, retagging, repackaging, and long-term storage
## 2024-05-08 - 1.0.112 - Images
Add new functionality for image handling.
- Can now import and export images
- Start work on local 100% JS OCI image registry
## 2024-06-05 - 1.1.0-1.1.3 - Core
Regular updates and fixes.
- Fix core update
## 2024-02-02 - 1.0.105-1.0.110 - Core
Routine core updates and fixes.
- Fix core update
## 2022-10-17 - 1.0.103-1.0.104 - Core
Routine core updates.
- Fix core update
## 2020-10-01 - 1.0.99-1.0.102 - Core
Routine core updates.
- Fix core update
## 2019-09-22 - 1.0.73-1.0.78 - Core
Routine updates and core fixes.
- Fix core update
## 2019-09-13 - 1.0.60-1.0.72 - Core
Routine updates and core fixes.
- Fix core update
## 2019-08-16 - 1.0.43-1.0.59 - Core
Routine updates and core fixes.
- Fix core update
## 2019-08-15 - 1.0.37-1.0.42 - Core
Routine updates and core fixes.
- Fix core update
## 2019-08-14 - 1.0.31-1.0.36 - Core
Routine updates and core fixes.
- Fix core update
## 2019-01-10 - 1.0.27-1.0.30 - Core
Routine updates and core fixes.
- Fix core update
## 2018-07-16 - 1.0.23-1.0.24 - Core
Routine updates and core fixes.
- Fix core shift to new style
## 2017-07-16 - 1.0.20-1.0.22 - General
Routine updates and fixes.
- Update node_modules within npmdocker
## 2017-04-02 - 1.0.18-1.0.19 - General
Routine updates and fixes.
- Work with npmdocker and npmts 7.x.x
- CI updates
## 2016-07-31 - 1.0.17 - General
Enhancements and fixes.
- Now waiting for response to be stored before ending streaming request
- Cosmetic fix
## 2016-07-29 - 1.0.14-1.0.16 - General
Multiple updates and features added.
- Fix request for change observable and add npmdocker
- Add request typings
## 2016-07-28 - 1.0.13 - Core
Fixes and preparations.
- Fixed request for newer docker
- Prepare for npmdocker
## 2016-06-16 - 1.0.0-1.0.2 - General
Initial sequence of releases, significant feature additions and CI setups.
- Implement container start and stop
- Implement list containers and related functions
- Add tests with in docker environment
## 2016-04-12 - unknown - Initial Commit
Initial project setup.
- Initial commit

View File

@@ -1,49 +0,0 @@
/// <reference types="q" />
import "typings-global";
import * as plugins from "./dockersock.plugins";
import { Observable } from "rxjs";
import { Objectmap } from 'lik';
export declare class Dockersock {
sockPath: string;
requestObjectmap: Objectmap<any>;
constructor(pathArg?: string);
auth(userArg: string, passArg: string): plugins.q.Promise<{}>;
listContainers(): plugins.q.Promise<{}>;
listContainersDetailed(): plugins.q.Promise<{}>;
listContainersRunning(): plugins.q.Promise<{}>;
listContainersStopped(): plugins.q.Promise<{}>;
listImages(): plugins.q.Promise<{}>;
listImagesDangling(): plugins.q.Promise<{}>;
pullImage(imageLabelArg: string): plugins.q.Promise<{}>;
createContainer(optionsArg: any, pullFirstArg?: boolean): plugins.q.Promise<{}>;
getContainerId(): void;
startContainer(containerNameArg: any): plugins.q.Promise<{}>;
stopContainer(containerNameArg: any): plugins.q.Promise<{}>;
removeContainer(containerNameArg: any): plugins.q.Promise<{}>;
clean(): plugins.q.Promise<{}>;
callOnChange(cb: Function): void;
/**
* gets you an observable that reports changes in the docker infrastructure
*/
getChangeObservable(): Observable<{}>;
/**
* fire a request
* @param methodArg
* @param routeArg
* @param queryArg
* @param dataArg
*/
request(methodArg: string, routeArg: string, queryArg?: string, dataArg?: {}): plugins.q.Promise<{}>;
/**
* fire a streaming request
* @param methodArg
* @param routeArg
* @param queryArg
* @param dataArg
*/
requestStream(methodArg: string, routeArg: string, queryArg?: string, dataArg?: {}): plugins.q.Promise<{}>;
/**
* end all currently streaming requests
*/
endRequests(): void;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +0,0 @@
import "typings-global";
export import beautylog = require("beautylog");
export import lik = require("lik");
export import q = require("q");
export import request = require("request");
export import rxjs = require("rxjs");

View File

@@ -1,9 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
exports.beautylog = require("beautylog");
exports.lik = require("lik");
exports.q = require("q");
exports.request = require("request");
exports.rxjs = require("rxjs");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9ja2Vyc29jay5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvZG9ja2Vyc29jay5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMEJBQXdCO0FBQ3hCLHlDQUErQztBQUMvQyw2QkFBbUM7QUFDbkMseUJBQStCO0FBQy9CLHFDQUEyQztBQUMzQywrQkFBcUMifQ==

2
dist/index.d.ts vendored
View File

@@ -1,2 +0,0 @@
import "typings-global";
export { Dockersock } from "./dockersock.classes.dockersock";

6
dist/index.js vendored
View File

@@ -1,6 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
var dockersock_classes_dockersock_1 = require("./dockersock.classes.dockersock");
exports.Dockersock = dockersock_classes_dockersock_1.Dockersock;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF3QjtBQUN4QixpRkFBNkQ7QUFBcEQscURBQUEsVUFBVSxDQUFBIn0=

View File

@@ -1,18 +1,18 @@
nginx1 :
image: "nginx"
environment:
VIRTUAL_HOST: "test100.labkomp.de"
VIRTUAL_HOST: "test100.bleu.de"
restart: always
container_name: nginx1
nginx2:
image: nginx
environment:
VIRTUAL_HOST: "test101.labkomp.de"
VIRTUAL_HOST: "test101.bleu.de"
restart: always
container_name: nginx2
npmts-test-container:
image: "npmts-test-image"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
nginx3:
image: nginx
environment:
VIRTUAL_HOST: "test101.bleu.de"
restart: always
container_name: npmts-test-container
container_name: nginx3

View File

@@ -1,49 +0,0 @@
# dockersock
easy communication with docker remote api from node, TypeScript ready
## Availabililty
[![npm](https://mojoio.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/dockersock)
[![git](https://mojoio.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/mojoio/dockersock)
[![git](https://mojoio.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/mojoio/dockersock)
[![docs](https://mojoio.gitlab.io/assets/repo-button-docs.svg)](https://mojoio.gitlab.io/dockersock/)
## Status for master
[![build status](https://GitLab.com/mojoio/dockersock/badges/master/build.svg)](https://GitLab.com/mojoio/dockersock/commits/master)
[![coverage report](https://GitLab.com/mojoio/dockersock/badges/master/coverage.svg)](https://GitLab.com/mojoio/dockersock/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/dockersock.svg)](https://www.npmjs.com/package/dockersock)
[![Dependency Status](https://david-dm.org/mojoio/dockersock.svg)](https://david-dm.org/mojoio/dockersock)
[![bitHound Dependencies](https://www.bithound.io/github/mojoio/dockersock/badges/dependencies.svg)](https://www.bithound.io/github/mojoio/dockersock/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/mojoio/dockersock/badges/code.svg)](https://www.bithound.io/github/mojoio/dockersock)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
```TypeScript
import {Dockersock} from "dockersock"; // require Dockersock class
let myDockersock = new Dockersock(); // optional: you can pass a domain to the contructor, defaults to /var/run/docker.sock
myDockersock.listContainers() // promise, resolve gets container data
myDockersock.listContainersDetailed() // promise, resolve gets more detailed container data (by combining several requests internally)
myDockersock.listContainersRunning() // promise, resolve gets container data for currently running containers
myDockersock.listContainersStopped() // promise, resolve gets container data for stopped containers
myDockersock.startContainer({ // starts a already present container
name: "somecontainername"
})
myDockersock.newContainer({ // start new Container, equals "docker run" shell command
image: "someimagetag"
})
```
For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://mojoio.gitlab.io/assets/repo-footer.svg)](https://mojo.io)

View File

@@ -1,17 +1,37 @@
{
"npmts":{
"mode":"default",
"coverageTreshold":10
},
"npmdocker":{
"baseImage":"hosttoday/ht-docker-node:npmci",
"command":"(npmci command yarn global add npmts) && npmts",
"dockerSock": true
},
"npmci": {
"globalNpmTools": [
"npmts",
"npmdocker"
]
"npmdocker": {
"baseImage": "host.today/ht-docker-node:npmci",
"command": "(ls -a && rm -r node_modules && yarn global add npmts && yarn install && npmts)",
"dockerSock": true
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public",
"npmRegistryUrl": "registry.npmjs.org"
},
"gitzone": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"gitscope": "apiclient.xyz",
"gitrepo": "docker",
"description": "Provides easy communication with Docker remote API from Node.js, with TypeScript support.",
"npmPackagename": "@apiclient.xyz/docker",
"license": "MIT",
"keywords": [
"Docker",
"API",
"Node.js",
"TypeScript",
"Containers",
"Images",
"Networks",
"Services",
"Secrets"
]
}
}
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

View File

@@ -1,40 +1,79 @@
{
"name": "dockersock",
"version": "1.0.21",
"description": "easy communication with docker remote api from node, TypeScript ready",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"name": "@apiclient.xyz/docker",
"version": "1.3.5",
"description": "Provides easy communication with Docker remote API from Node.js, with TypeScript support.",
"private": false,
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": {
"test": "(npmts --notest && npmdocker)"
"test": "(tstest test/ --verbose --logfile --timeout 600)",
"build": "(tsbuild --web --allowimplicitany)",
"buildDocs": "tsdoc"
},
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com/pushrocks/dockersock.git"
"url": "https://code.foss.global/apiclient.xyz/docker.git"
},
"keywords": [
"docker",
"sock",
"container",
"request",
"api"
"Docker",
"API",
"Node.js",
"TypeScript",
"Containers",
"Images",
"Networks",
"Services",
"Secrets"
],
"author": "Lossless GmbH",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/pushrocks/dockersock/issues"
"url": "https://code.foss.global/apiclient.xyz/docker/issues"
},
"homepage": "https://gitlab.com/pushrocks/dockersock#README",
"homepage": "https://code.foss.global/apiclient.xyz/docker#readme",
"dependencies": {
"@types/q": "1.x.x",
"beautylog": "^6.1.10",
"lik": "^1.0.38",
"q": "^1.5.0",
"request": "^2.81.0",
"rxjs": "^5.4.2",
"typings-global": "^1.0.19"
"@push.rocks/lik": "^6.2.2",
"@push.rocks/smartarchive": "^4.2.2",
"@push.rocks/smartbucket": "^3.3.10",
"@push.rocks/smartfile": "^11.2.7",
"@push.rocks/smartjson": "^5.0.20",
"@push.rocks/smartlog": "^3.1.8",
"@push.rocks/smartnetwork": "^4.1.2",
"@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrequest": "^4.3.1",
"@push.rocks/smartstream": "^3.2.5",
"@push.rocks/smartstring": "^4.0.15",
"@push.rocks/smartunique": "^3.0.9",
"@push.rocks/smartversion": "^3.0.5",
"@tsclass/tsclass": "^9.2.0",
"rxjs": "^7.8.2"
},
"devDependencies": {
"observable-to-promise": "^0.5.0",
"tapbundle": "^1.1.1"
"@git.zone/tsbuild": "^2.6.7",
"@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^2.3.5",
"@push.rocks/qenv": "^6.1.3",
"@types/node": "22.7.5"
},
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
],
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748",
"pnpm": {
"overrides": {}
}
}

8501
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

6
qenv.yml Normal file
View File

@@ -0,0 +1,6 @@
required:
- S3_ENDPOINT
- S3_ACCESSKEY
- S3_ACCESSSECRET
- S3_BUCKET

0
readme.hints.md Normal file
View File

520
readme.md Normal file
View File

@@ -0,0 +1,520 @@
# @apiclient.xyz/docker 🐳
> **Powerful TypeScript client for Docker Remote API** - Build, manage, and orchestrate Docker containers, images, networks, and more with type-safe elegance.
## 🚀 Features
- 🎯 **Full TypeScript Support** - Complete type definitions for Docker API entities
- 🔄 **Async/Await Ready** - Modern promise-based architecture for seamless async operations
- 📦 **Container Management** - Create, list, inspect, and remove containers effortlessly
- 🖼️ **Image Handling** - Pull from registries, build from tarballs, export, and manage tags
- 🌐 **Network Operations** - Create and manage Docker networks with full IPAM support
- 🔐 **Secrets Management** - Handle Docker secrets securely in swarm mode
- 🎭 **Service Orchestration** - Deploy and manage services in Docker Swarm
- 💾 **S3 Image Storage** - Built-in support for storing/retrieving images from S3
- 📊 **Event Streaming** - Real-time Docker event monitoring with RxJS observables
- 🔧 **Registry Authentication** - Seamless authentication with Docker registries
## 📦 Installation
```bash
# Using npm
npm install @apiclient.xyz/docker --save
# Using pnpm (recommended)
pnpm add @apiclient.xyz/docker
# Using yarn
yarn add @apiclient.xyz/docker
```
## 🎯 Quick Start
```typescript
import { DockerHost } from '@apiclient.xyz/docker';
// Connect to local Docker daemon
const docker = new DockerHost();
// Or connect to remote Docker host
const remoteDocker = new DockerHost({
socketPath: 'tcp://remote-docker-host:2375',
});
```
## 📚 Complete API Guide
### 🐳 DockerHost - Your Gateway to Docker
The `DockerHost` class is your primary interface to interact with the Docker daemon.
```typescript
import { DockerHost } from '@apiclient.xyz/docker';
// Initialize with default local socket
const docker = new DockerHost();
// Custom initialization options
const customDocker = new DockerHost({
socketPath: '/var/run/docker.sock', // Unix socket path
// or
socketPath: 'tcp://192.168.1.100:2375', // TCP connection
});
// Start and stop (for lifecycle management)
await docker.start();
// ... do your work
await docker.stop();
```
### 📦 Container Management
#### List All Containers
```typescript
// Get all containers (including stopped ones)
const allContainers = await docker.getContainers();
// Each container includes detailed information
allContainers.forEach((container) => {
console.log(`Container: ${container.Names[0]}`);
console.log(` ID: ${container.Id}`);
console.log(` Status: ${container.Status}`);
console.log(` Image: ${container.Image}`);
console.log(` State: ${container.State}`);
});
```
#### Create and Manage Containers
```typescript
import { DockerContainer } from '@apiclient.xyz/docker';
// Create a container with detailed configuration
const container = await DockerContainer.create(docker, {
Image: 'nginx:latest',
name: 'my-nginx-server',
HostConfig: {
PortBindings: {
'80/tcp': [{ HostPort: '8080' }],
},
RestartPolicy: {
Name: 'unless-stopped',
},
Memory: 512 * 1024 * 1024, // 512MB memory limit
},
Env: ['NODE_ENV=production', 'LOG_LEVEL=info'],
Labels: {
app: 'web-server',
environment: 'production',
},
});
console.log(`Container created: ${container.Id}`);
// Container operations (these would need to be implemented)
// await container.start();
// await container.stop();
// await container.remove();
```
#### Get Container by ID
```typescript
const container = await DockerContainer.getContainerById(
docker,
'container-id-here',
);
if (container) {
console.log(`Found container: ${container.Names[0]}`);
}
```
### 🖼️ Image Management
#### Pull Images from Registry
```typescript
import { DockerImage } from '@apiclient.xyz/docker';
// Pull an image from Docker Hub
const image = await DockerImage.createFromRegistry(docker, {
imageName: 'node',
imageTag: '18-alpine',
// Optional: provide registry authentication
authToken: 'your-registry-auth-token',
});
console.log(`Image pulled: ${image.RepoTags[0]}`);
console.log(`Size: ${(image.Size / 1024 / 1024).toFixed(2)} MB`);
```
#### Import Images from Tar
```typescript
import * as fs from 'fs';
// Import from a tar stream
const tarStream = fs.createReadStream('./my-image.tar');
const importedImage = await DockerImage.createFromTarStream(docker, {
tarStream,
imageUrl: 'file://./my-image.tar',
imageTag: 'my-app:v1.0.0',
});
```
#### Export Images to Tar
```typescript
// Export an image to a tar stream
const image = await DockerImage.getImageByName(docker, 'nginx:latest');
const exportStream = await image.exportToTarStream();
// Save to file
const writeStream = fs.createWriteStream('./nginx-export.tar');
exportStream.pipe(writeStream);
```
#### Tag Images
```typescript
// Tag an existing image
await DockerImage.tagImageByIdOrName(docker, 'node:18-alpine', {
registry: 'myregistry.com',
imageName: 'my-node-app',
imageTag: 'v2.0.0',
});
// Result: myregistry.com/my-node-app:v2.0.0
```
### 🌐 Network Management
#### Create Custom Networks
```typescript
import { DockerNetwork } from '@apiclient.xyz/docker';
// Create a bridge network
const network = await DockerNetwork.createNetwork(docker, {
Name: 'my-app-network',
Driver: 'bridge',
EnableIPv6: false,
IPAM: {
Driver: 'default',
Config: [
{
Subnet: '172.28.0.0/16',
Gateway: '172.28.0.1',
},
],
},
Labels: {
project: 'my-app',
environment: 'production',
},
});
console.log(`Network created: ${network.Id}`);
```
#### List and Inspect Networks
```typescript
// Get all networks
const networks = await docker.getNetworks();
networks.forEach((net) => {
console.log(`Network: ${net.Name} (${net.Driver})`);
console.log(` Scope: ${net.Scope}`);
console.log(` Internal: ${net.Internal}`);
});
// Get specific network
const appNetwork = await DockerNetwork.getNetworkByName(
docker,
'my-app-network',
);
// Get containers on network
const containers = await appNetwork.getContainersOnNetwork();
console.log(`Containers on network: ${containers.length}`);
```
### 🎭 Service Management (Swarm Mode)
#### Deploy Services
```typescript
import { DockerService } from '@apiclient.xyz/docker';
// Create a replicated service
const service = await DockerService.createService(docker, {
name: 'web-api',
image: 'my-api:latest',
replicas: 3,
ports: [
{
Protocol: 'tcp',
PublishedPort: 80,
TargetPort: 3000,
},
],
networks: ['my-app-network'],
labels: {
app: 'api',
version: '2.0.0',
},
resources: {
limits: {
Memory: 256 * 1024 * 1024, // 256MB
CPUs: 0.5,
},
},
secrets: ['api-key', 'db-password'],
mounts: [
{
Target: '/data',
Source: 'app-data',
Type: 'volume',
},
],
});
console.log(`Service deployed: ${service.ID}`);
```
#### Manage Services
```typescript
// List all services
const services = await docker.getServices();
services.forEach((service) => {
console.log(`Service: ${service.Spec.Name}`);
console.log(` Replicas: ${service.Spec.Mode.Replicated.Replicas}`);
console.log(` Image: ${service.Spec.TaskTemplate.ContainerSpec.Image}`);
});
// Get service by name
const myService = await DockerService.getServiceByName(docker, 'web-api');
// Check if service needs update
const needsUpdate = await myService.needsUpdate();
if (needsUpdate) {
console.log('Service configuration has changed, update needed');
}
// Remove service
await myService.remove();
```
### 🔐 Secrets Management
```typescript
import { DockerSecret } from '@apiclient.xyz/docker';
// Create a secret
const secret = await DockerSecret.createSecret(docker, {
name: 'api-key',
data: Buffer.from('super-secret-key-123').toString('base64'),
labels: {
app: 'my-app',
type: 'api-key',
},
});
console.log(`Secret created: ${secret.ID}`);
// List secrets
const secrets = await DockerSecret.getSecrets(docker);
secrets.forEach((secret) => {
console.log(`Secret: ${secret.Spec.Name}`);
});
// Get secret by name
const apiKeySecret = await DockerSecret.getSecretByName(docker, 'api-key');
// Update secret
await apiKeySecret.update({
data: Buffer.from('new-secret-key-456').toString('base64'),
});
// Remove secret
await apiKeySecret.remove();
```
### 💾 S3 Image Storage
Store and retrieve Docker images from S3-compatible storage:
```typescript
// Configure S3 storage
await docker.addS3Storage({
endpoint: 's3.amazonaws.com',
accessKeyId: 'your-access-key',
secretAccessKey: 'your-secret-key',
bucket: 'docker-images',
});
// Store an image to S3
const imageStore = docker.imageStore;
await imageStore.storeImage('my-app:v1.0.0');
// Retrieve an image from S3
const retrievedImage = await imageStore.getImage('my-app:v1.0.0');
```
### 📊 Event Monitoring
Monitor Docker events in real-time using RxJS observables:
```typescript
// Subscribe to Docker events
const eventStream = docker.getEventObservable();
const subscription = eventStream.subscribe({
next: (event) => {
console.log(`Event: ${event.Type} - ${event.Action}`);
console.log(`Actor: ${event.Actor.ID}`);
console.log(`Time: ${new Date(event.time * 1000).toISOString()}`);
},
error: (err) => console.error('Event stream error:', err),
complete: () => console.log('Event stream completed'),
});
// Unsubscribe when done
subscription.unsubscribe();
```
### 🔧 Registry Authentication
Authenticate with Docker registries for private images:
```typescript
// Authenticate with Docker Hub
await docker.auth({
username: 'your-username',
password: 'your-password',
serveraddress: 'https://index.docker.io/v1/',
});
// Or use existing Docker config
const authToken = await docker.getAuthTokenFromDockerConfig('myregistry.com');
// Use auth token when pulling images
const privateImage = await DockerImage.createFromRegistry(docker, {
imageName: 'myregistry.com/private/image',
imageTag: 'latest',
authToken,
});
```
### 🔄 Swarm Mode
Initialize and manage Docker Swarm:
```typescript
// Initialize swarm mode
await docker.activateSwarm({
ListenAddr: '0.0.0.0:2377',
AdvertiseAddr: '192.168.1.100:2377',
ForceNewCluster: false,
});
// Now you can create services, secrets, and use swarm features
const service = await DockerService.createService(docker, {
name: 'my-swarm-service',
image: 'nginx:latest',
replicas: 5,
// ... more service config
});
```
## 🏗️ Advanced Examples
### Complete Application Stack
```typescript
async function deployStack() {
const docker = new DockerHost();
// Create network
const network = await DockerNetwork.createNetwork(docker, {
Name: 'app-network',
Driver: 'overlay', // for swarm mode
});
// Create secrets
const dbPassword = await DockerSecret.createSecret(docker, {
name: 'db-password',
data: Buffer.from('strong-password').toString('base64'),
});
// Deploy database service
const dbService = await DockerService.createService(docker, {
name: 'postgres',
image: 'postgres:14',
networks: ['app-network'],
secrets: ['db-password'],
env: ['POSTGRES_PASSWORD_FILE=/run/secrets/db-password'],
});
// Deploy application service
const appService = await DockerService.createService(docker, {
name: 'web-app',
image: 'my-app:latest',
replicas: 3,
networks: ['app-network'],
ports: [{ Protocol: 'tcp', PublishedPort: 80, TargetPort: 3000 }],
});
console.log('Stack deployed successfully!');
}
```
## 🔍 TypeScript Support
This package provides comprehensive TypeScript definitions for all Docker API entities:
```typescript
import type {
IContainerCreationDescriptor,
IServiceCreationDescriptor,
INetworkCreationDescriptor,
IImageCreationDescriptor,
ISecretCreationDescriptor,
} from '@apiclient.xyz/docker';
// Full IntelliSense support for all configuration options
const containerConfig: IContainerCreationDescriptor = {
Image: 'node:18',
// Your IDE will provide full autocomplete here
};
```
## 🤝 Contributing
We welcome contributions! Please feel free to submit issues and pull requests.
## 📖 API Documentation
For complete API documentation, visit [https://apiclient.xyz/docker](https://apiclient.xyz/docker)
For Docker Remote API reference, see [Docker Engine API Documentation](https://docs.docker.com/engine/api/latest/)
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

11
scripts/testauth.ts Normal file
View File

@@ -0,0 +1,11 @@
import * as docker from '../ts';
import * as smartstring from '@push.rocks/smartstring';
const run = async () => {
const dockerHost = new docker.DockerHost();
await docker.DockerImage.createFromRegistry(dockerHost, {
imageUrl: 'registry.gitlab.com/servezone/private/cloudly:latest'
});
};
run();

40
test-stream.js Normal file
View File

@@ -0,0 +1,40 @@
const { SmartRequest } = require('@push.rocks/smartrequest');
async function test() {
try {
const response = await SmartRequest.create()
.url('http://unix:/run/user/1000/docker.sock:/images/hello-world:latest/get')
.header('Host', 'docker.sock')
.get();
console.log('Response status:', response.status);
console.log('Response type:', typeof response);
const stream = response.streamNode();
console.log('Stream type:', typeof stream);
console.log('Has on method:', typeof stream.on);
if (stream) {
let chunks = 0;
stream.on('data', (chunk) => {
chunks++;
if (chunks <= 3) console.log('Got chunk', chunks, chunk.length);
});
stream.on('end', () => {
console.log('Stream ended, total chunks:', chunks);
process.exit(0);
});
stream.on('error', (err) => {
console.error('Stream error:', err);
process.exit(1);
});
} else {
console.log('No stream available');
}
} catch (error) {
console.error('Error:', error);
process.exit(1);
}
}
test();

46
test-stream.mjs Normal file
View File

@@ -0,0 +1,46 @@
import { SmartRequest } from '@push.rocks/smartrequest';
async function test() {
try {
const response = await SmartRequest.create()
.url('http://unix:/run/user/1000/docker.sock:/images/hello-world:latest/get')
.header('Host', 'docker.sock')
.get();
console.log('Response status:', response.status);
console.log('Response type:', typeof response);
const stream = response.streamNode();
console.log('Stream type:', typeof stream);
console.log('Has on method:', typeof stream.on);
if (stream) {
let chunks = 0;
stream.on('data', (chunk) => {
chunks++;
if (chunks <= 3) console.log('Got chunk', chunks, chunk.length);
});
stream.on('end', () => {
console.log('Stream ended, total chunks:', chunks);
process.exit(0);
});
stream.on('error', (err) => {
console.error('Stream error:', err);
process.exit(1);
});
// Set a timeout in case stream doesn't end
setTimeout(() => {
console.log('Timeout after 5 seconds');
process.exit(1);
}, 5000);
} else {
console.log('No stream available');
}
} catch (error) {
console.error('Error:', error);
process.exit(1);
}
}
test();

193
test/test.nonci.node.ts Normal file
View File

@@ -0,0 +1,193 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import { Qenv } from '@push.rocks/qenv';
const testQenv = new Qenv('./', './.nogit/');
import * as plugins from '../ts/plugins.js';
import * as paths from '../ts/paths.js';
import * as docker from '../ts/index.js';
let testDockerHost: docker.DockerHost;
tap.test('should create a new Dockersock instance', async () => {
testDockerHost = new docker.DockerHost({});
await testDockerHost.start();
return expect(testDockerHost).toBeInstanceOf(docker.DockerHost);
});
tap.test('should create a docker swarm', async () => {
await testDockerHost.activateSwarm();
});
// Containers
tap.test('should list containers', async () => {
const containers = await testDockerHost.getContainers();
console.log(containers);
});
// Networks
tap.test('should list networks', async () => {
const networks = await testDockerHost.getNetworks();
console.log(networks);
});
tap.test('should create a network', async () => {
const newNetwork = await docker.DockerNetwork.createNetwork(testDockerHost, {
Name: 'webgateway',
});
expect(newNetwork).toBeInstanceOf(docker.DockerNetwork);
expect(newNetwork.Name).toEqual('webgateway');
});
tap.test('should remove a network', async () => {
const webgateway = await docker.DockerNetwork.getNetworkByName(
testDockerHost,
'webgateway',
);
await webgateway.remove();
});
// Images
tap.test('should pull an image from imagetag', async () => {
const image = await docker.DockerImage.createFromRegistry(testDockerHost, {
creationObject: {
imageUrl: 'hosttoday/ht-docker-node',
imageTag: 'alpine',
},
});
expect(image).toBeInstanceOf(docker.DockerImage);
console.log(image);
});
tap.test('should return a change Observable', async (tools) => {
const testObservable = await testDockerHost.getEventObservable();
const subscription = testObservable.subscribe((changeObject) => {
console.log(changeObject);
});
await tools.delayFor(2000);
subscription.unsubscribe();
});
// SECRETS
tap.test('should create a secret', async () => {
const mySecret = await docker.DockerSecret.createSecret(testDockerHost, {
name: 'testSecret',
version: '1.0.3',
contentArg: `{ "hi": "wow"}`,
labels: {},
});
console.log(mySecret);
});
tap.test('should remove a secret by name', async () => {
const mySecret = await docker.DockerSecret.getSecretByName(
testDockerHost,
'testSecret',
);
await mySecret.remove();
});
// SERVICES
tap.test('should activate swarm mode', async () => {
await testDockerHost.activateSwarm();
});
tap.test('should list all services', async (tools) => {
const services = await testDockerHost.getServices();
console.log(services);
});
tap.test('should create a service', async () => {
const testNetwork = await docker.DockerNetwork.createNetwork(testDockerHost, {
Name: 'testNetwork',
});
const testSecret = await docker.DockerSecret.createSecret(testDockerHost, {
name: 'testSecret',
version: '0.0.1',
labels: {},
contentArg: '{"hi": "wow"}',
});
const testImage = await docker.DockerImage.createFromRegistry(
testDockerHost,
{
creationObject: {
imageUrl: 'code.foss.global/host.today/ht-docker-node:latest',
},
},
);
const testService = await docker.DockerService.createService(testDockerHost, {
image: testImage,
labels: {},
name: 'testService',
networks: [testNetwork],
networkAlias: 'testService',
secrets: [testSecret],
ports: ['3000:80'],
});
await testService.remove();
await testNetwork.remove();
await testSecret.remove();
});
tap.test('should export images', async (toolsArg) => {
const done = toolsArg.defer();
const testImage = await docker.DockerImage.createFromRegistry(
testDockerHost,
{
creationObject: {
imageUrl: 'code.foss.global/host.today/ht-docker-node:latest',
},
},
);
const fsWriteStream = plugins.smartfile.fsStream.createWriteStream(
plugins.path.join(paths.nogitDir, 'testimage.tar'),
);
const exportStream = await testImage.exportToTarStream();
exportStream.pipe(fsWriteStream).on('finish', () => {
done.resolve();
});
await done.promise;
});
tap.test('should import images', async () => {
const fsReadStream = plugins.smartfile.fsStream.createReadStream(
plugins.path.join(paths.nogitDir, 'testimage.tar'),
);
const importedImage = await docker.DockerImage.createFromTarStream(
testDockerHost,
{
tarStream: fsReadStream,
creationObject: {
imageUrl: 'code.foss.global/host.today/ht-docker-node:latest',
},
},
);
expect(importedImage).toBeInstanceOf(docker.DockerImage);
});
tap.test('should expose a working DockerImageStore', async () => {
// lets first add am s3 target
const s3Descriptor = {
endpoint: await testQenv.getEnvVarOnDemand('S3_ENDPOINT'),
accessKey: await testQenv.getEnvVarOnDemand('S3_ACCESSKEY'),
accessSecret: await testQenv.getEnvVarOnDemand('S3_ACCESSSECRET'),
bucketName: await testQenv.getEnvVarOnDemand('S3_BUCKET'),
};
await testDockerHost.addS3Storage(s3Descriptor);
//
await testDockerHost.imageStore.storeImage(
'hello2',
plugins.smartfile.fsStream.createReadStream(
plugins.path.join(paths.nogitDir, 'testimage.tar'),
),
);
});
tap.test('cleanup', async () => {
await testDockerHost.stop();
});
export default tap.start();

View File

@@ -1,34 +0,0 @@
import "typings-global";
import { expect, tap } from 'tapbundle'
import * as observableToPromise from 'observable-to-promise'
import { Dockersock } from "../dist/index";
let testDockersock: Dockersock;
tap.test("should create a new Dockersock instance", async () => {
testDockersock = new Dockersock();
return expect(testDockersock).to.be.instanceof(Dockersock);
})
tap.test("should list containers", async () => {
let data = await testDockersock.listContainers()
console.log(data)
})
tap.test("should list detailed containers", async () => {
let data = await testDockersock.listContainersDetailed()
console.log(data)
})
tap.test("should pull an image from imagetag", async () => {
await testDockersock.pullImage("hosttoday/ht-docker-node:npmci")
})
tap.test("should return a change Objservable", async () => {
let myObservable = testDockersock.getChangeObservable();
testDockersock.endRequests();
let testPromise = observableToPromise(myObservable)
return await expect(testPromise).to.eventually.be.fulfilled
})
tap.start()

8
ts/00_commitinfo_data.ts Normal file
View File

@@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@apiclient.xyz/docker',
version: '1.3.5',
description: 'Provides easy communication with Docker remote API from Node.js, with TypeScript support.'
}

104
ts/classes.container.ts Normal file
View File

@@ -0,0 +1,104 @@
import * as plugins from './plugins.js';
import * as interfaces from './interfaces/index.js';
import { DockerHost } from './classes.host.js';
import { logger } from './logger.js';
export class DockerContainer {
// STATIC
/**
* get all containers
*/
public static async getContainers(
dockerHostArg: DockerHost,
): Promise<DockerContainer[]> {
const result: DockerContainer[] = [];
const response = await dockerHostArg.request('GET', '/containers/json');
// TODO: Think about getting the config by inpsecting the container
for (const containerResult of response.body) {
result.push(new DockerContainer(dockerHostArg, containerResult));
}
return result;
}
/**
* gets an container by Id
* @param containerId
*/
public static async getContainerById(containerId: string) {
// TODO: implement get container by id
}
/**
* create a container
*/
public static async create(
dockerHost: DockerHost,
containerCreationDescriptor: interfaces.IContainerCreationDescriptor,
) {
// check for unique hostname
const existingContainers = await DockerContainer.getContainers(dockerHost);
const sameHostNameContainer = existingContainers.find((container) => {
// TODO implement HostName Detection;
return false;
});
const response = await dockerHost.request('POST', '/containers/create', {
Hostname: containerCreationDescriptor.Hostname,
Domainname: containerCreationDescriptor.Domainname,
User: 'root',
});
if (response.statusCode < 300) {
logger.log('info', 'Container created successfully');
} else {
logger.log(
'error',
'There has been a problem when creating the container',
);
}
}
// INSTANCE
// references
public dockerHost: DockerHost;
// properties
public Id: string;
public Names: string[];
public Image: string;
public ImageID: string;
public Command: string;
public Created: number;
public Ports: interfaces.TPorts;
public Labels: interfaces.TLabels;
public State: string;
public Status: string;
public HostConfig: any;
public NetworkSettings: {
Networks: {
[key: string]: {
IPAMConfig: any;
Links: any;
Aliases: any;
NetworkID: string;
EndpointID: string;
Gateway: string;
IPAddress: string;
IPPrefixLen: number;
IPv6Gateway: string;
GlobalIPv6Address: string;
GlobalIPv6PrefixLen: number;
MacAddress: string;
DriverOpts: any;
};
};
};
public Mounts: any;
constructor(dockerHostArg: DockerHost, dockerContainerObjectArg: any) {
this.dockerHost = dockerHostArg;
Object.keys(dockerContainerObjectArg).forEach((keyArg) => {
this[keyArg] = dockerContainerObjectArg[keyArg];
});
}
}

414
ts/classes.host.ts Normal file
View File

@@ -0,0 +1,414 @@
import * as plugins from './plugins.js';
import * as paths from './paths.js';
import { DockerContainer } from './classes.container.js';
import { DockerNetwork } from './classes.network.js';
import { DockerService } from './classes.service.js';
import { logger } from './logger.js';
import path from 'path';
import { DockerImageStore } from './classes.imagestore.js';
import { DockerImage } from './classes.image.js';
export interface IAuthData {
serveraddress: string;
username: string;
password: string;
}
export interface IDockerHostConstructorOptions {
dockerSockPath?: string;
imageStoreDir?: string;
}
export class DockerHost {
public options: IDockerHostConstructorOptions;
/**
* the path where the docker sock can be found
*/
public socketPath: string;
private registryToken: string = '';
public imageStore: DockerImageStore;
public smartBucket: plugins.smartbucket.SmartBucket;
/**
* the constructor to instantiate a new docker sock instance
* @param pathArg
*/
constructor(optionsArg: IDockerHostConstructorOptions) {
this.options = {
...{
imageStoreDir: plugins.path.join(
paths.nogitDir,
'temp-docker-image-store',
),
},
...optionsArg,
};
let pathToUse: string;
if (optionsArg.dockerSockPath) {
pathToUse = optionsArg.dockerSockPath;
} else if (process.env.DOCKER_HOST) {
pathToUse = process.env.DOCKER_HOST;
} else if (process.env.CI) {
pathToUse = 'http://docker:2375/';
} else {
pathToUse = 'http://unix:/var/run/docker.sock:';
}
if (pathToUse.startsWith('unix:///')) {
pathToUse = pathToUse.replace('unix://', 'http://unix:');
}
if (pathToUse.endsWith('.sock')) {
pathToUse = pathToUse.replace('.sock', '.sock:');
}
console.log(`using docker sock at ${pathToUse}`);
this.socketPath = pathToUse;
this.imageStore = new DockerImageStore({
bucketDir: null,
localDirPath: this.options.imageStoreDir,
});
}
public async start() {
await this.imageStore.start();
}
public async stop() {
await this.imageStore.stop();
}
/**
* authenticate against a registry
* @param userArg
* @param passArg
*/
public async auth(authData: IAuthData) {
const response = await this.request('POST', '/auth', authData);
if (response.body.Status !== 'Login Succeeded') {
console.log(`Login failed with ${response.body.Status}`);
throw new Error(response.body.Status);
}
console.log(response.body.Status);
this.registryToken = plugins.smartstring.base64.encode(
plugins.smartjson.stringify(authData),
);
}
/**
* gets the token from the .docker/config.json file for GitLab registry
*/
public async getAuthTokenFromDockerConfig(registryUrlArg: string) {
const dockerConfigPath = plugins.smartpath.get.home(
'~/.docker/config.json',
);
const configObject = plugins.smartfile.fs.toObjectSync(dockerConfigPath);
const gitlabAuthBase64 = configObject.auths[registryUrlArg].auth;
const gitlabAuth: string =
plugins.smartstring.base64.decode(gitlabAuthBase64);
const gitlabAuthArray = gitlabAuth.split(':');
await this.auth({
username: gitlabAuthArray[0],
password: gitlabAuthArray[1],
serveraddress: registryUrlArg,
});
}
// ==============
// NETWORKS
// ==============
/**
* gets all networks
*/
public async getNetworks() {
return await DockerNetwork.getNetworks(this);
}
/**
* create a network
*/
public async createNetwork(
optionsArg: Parameters<typeof DockerNetwork.createNetwork>[1],
) {
return await DockerNetwork.createNetwork(this, optionsArg);
}
/**
* get a network by name
*/
public async getNetworkByName(networkNameArg: string) {
return await DockerNetwork.getNetworkByName(this, networkNameArg);
}
// ==============
// CONTAINERS
// ==============
/**
* gets all containers
*/
public async getContainers() {
const containerArray = await DockerContainer.getContainers(this);
return containerArray;
}
// ==============
// SERVICES
// ==============
/**
* gets all services
*/
public async getServices() {
const serviceArray = await DockerService.getServices(this);
return serviceArray;
}
// ==============
// IMAGES
// ==============
/**
* get all images
*/
public async getImages() {
return await DockerImage.getImages(this);
}
/**
* get an image by name
*/
public async getImageByName(imageNameArg: string) {
return await DockerImage.getImageByName(this, imageNameArg);
}
/**
*
*/
public async getEventObservable(): Promise<plugins.rxjs.Observable<any>> {
const response = await this.requestStreaming('GET', '/events');
return plugins.rxjs.Observable.create((observer) => {
response.on('data', (data) => {
const eventString = data.toString();
try {
const eventObject = JSON.parse(eventString);
observer.next(eventObject);
} catch (e) {
console.log(e);
}
});
return () => {
response.emit('end');
};
});
}
/**
* activates docker swarm
*/
public async activateSwarm(addvertisementIpArg?: string) {
// determine advertisement address
let addvertisementIp: string;
if (addvertisementIpArg) {
addvertisementIp = addvertisementIpArg;
} else {
const smartnetworkInstance = new plugins.smartnetwork.SmartNetwork();
const defaultGateway = await smartnetworkInstance.getDefaultGateway();
if (defaultGateway) {
addvertisementIp = defaultGateway.ipv4.address;
}
}
const response = await this.request('POST', '/swarm/init', {
ListenAddr: '0.0.0.0:2377',
AdvertiseAddr: addvertisementIp,
DataPathPort: 4789,
DefaultAddrPool: ['10.10.0.0/8', '20.20.0.0/8'],
SubnetSize: 24,
ForceNewCluster: false,
});
if (response.statusCode === 200) {
logger.log('info', 'created Swam succesfully');
} else {
logger.log('error', 'could not initiate swarm');
}
}
/**
* fire a request
*/
public async request(methodArg: string, routeArg: string, dataArg = {}) {
const requestUrl = `${this.socketPath}${routeArg}`;
// Build the request using the fluent API
const smartRequest = plugins.smartrequest.SmartRequest.create()
.url(requestUrl)
.header('Content-Type', 'application/json')
.header('X-Registry-Auth', this.registryToken)
.header('Host', 'docker.sock')
.options({ keepAlive: false });
// Add body for methods that support it
if (dataArg && Object.keys(dataArg).length > 0) {
smartRequest.json(dataArg);
}
// Execute the request based on method
let response;
switch (methodArg.toUpperCase()) {
case 'GET':
response = await smartRequest.get();
break;
case 'POST':
response = await smartRequest.post();
break;
case 'PUT':
response = await smartRequest.put();
break;
case 'DELETE':
response = await smartRequest.delete();
break;
default:
throw new Error(`Unsupported HTTP method: ${methodArg}`);
}
// Parse the response body based on content type
let body;
const contentType = response.headers['content-type'] || '';
// Docker's streaming endpoints (like /images/create) return newline-delimited JSON
// which can't be parsed as a single JSON object
const isStreamingEndpoint =
routeArg.includes('/images/create') ||
routeArg.includes('/images/load') ||
routeArg.includes('/build');
if (contentType.includes('application/json') && !isStreamingEndpoint) {
body = await response.json();
} else {
body = await response.text();
// Try to parse as JSON if it looks like JSON and is not a streaming response
if (
!isStreamingEndpoint &&
body &&
(body.startsWith('{') || body.startsWith('['))
) {
try {
body = JSON.parse(body);
} catch {
// Keep as text if parsing fails
}
}
}
// Create a response object compatible with existing code
const legacyResponse = {
statusCode: response.status,
body: body,
headers: response.headers,
};
if (response.status !== 200) {
console.log(body);
}
return legacyResponse;
}
public async requestStreaming(
methodArg: string,
routeArg: string,
readStream?: plugins.smartstream.stream.Readable,
) {
const requestUrl = `${this.socketPath}${routeArg}`;
// Build the request using the fluent API
const smartRequest = plugins.smartrequest.SmartRequest.create()
.url(requestUrl)
.header('Content-Type', 'application/json')
.header('X-Registry-Auth', this.registryToken)
.header('Host', 'docker.sock')
.timeout(30000)
.options({ keepAlive: false, autoDrain: true }); // Disable auto-drain for streaming
// If we have a readStream, use the new stream method with logging
if (readStream) {
let counter = 0;
const smartduplex = new plugins.smartstream.SmartDuplex({
writeFunction: async (chunkArg) => {
if (counter % 1000 === 0) {
console.log(`posting chunk ${counter}`);
}
counter++;
return chunkArg;
},
});
// Pipe through the logging duplex stream
const loggedStream = readStream.pipe(smartduplex);
// Use the new stream method to stream the data
smartRequest.stream(loggedStream, 'application/octet-stream');
}
// Execute the request based on method
let response;
switch (methodArg.toUpperCase()) {
case 'GET':
response = await smartRequest.get();
break;
case 'POST':
response = await smartRequest.post();
break;
case 'PUT':
response = await smartRequest.put();
break;
case 'DELETE':
response = await smartRequest.delete();
break;
default:
throw new Error(`Unsupported HTTP method: ${methodArg}`);
}
console.log(response.status);
// For streaming responses, get the Node.js stream
const nodeStream = response.streamNode();
if (!nodeStream) {
// If no stream is available, consume the body as text
const body = await response.text();
console.log(body);
// Return a compatible response object
return {
statusCode: response.status,
body: body,
headers: response.headers,
};
}
// For streaming responses, return the stream with added properties
(nodeStream as any).statusCode = response.status;
(nodeStream as any).body = ''; // For compatibility
return nodeStream;
}
/**
* add s3 storage
* @param optionsArg
*/
public async addS3Storage(optionsArg: plugins.tsclass.storage.IS3Descriptor) {
this.smartBucket = new plugins.smartbucket.SmartBucket(optionsArg);
if (!optionsArg.bucketName) {
throw new Error('bucketName is required');
}
const bucket = await this.smartBucket.getBucketByName(
optionsArg.bucketName,
);
let wantedDirectory = await bucket.getBaseDirectory();
if (optionsArg.directoryPath) {
wantedDirectory = await wantedDirectory.getSubDirectoryByName(
optionsArg.directoryPath,
);
}
this.imageStore.options.bucketDir = wantedDirectory;
}
}

297
ts/classes.image.ts Normal file
View File

@@ -0,0 +1,297 @@
import * as plugins from './plugins.js';
import * as interfaces from './interfaces/index.js';
import { DockerHost } from './classes.host.js';
import { logger } from './logger.js';
/**
* represents a docker image on the remote docker host
*/
export class DockerImage {
// STATIC
public static async getImages(dockerHost: DockerHost) {
const images: DockerImage[] = [];
const response = await dockerHost.request('GET', '/images/json');
for (const imageObject of response.body) {
images.push(new DockerImage(dockerHost, imageObject));
}
return images;
}
public static async getImageByName(
dockerHost: DockerHost,
imageNameArg: string,
) {
const images = await this.getImages(dockerHost);
const result = images.find((image) => {
if (image.RepoTags) {
return image.RepoTags.includes(imageNameArg);
} else {
return false;
}
});
return result;
}
public static async createFromRegistry(
dockerHostArg: DockerHost,
optionsArg: {
creationObject: interfaces.IImageCreationDescriptor;
},
): Promise<DockerImage> {
// lets create a sanatized imageUrlObject
const imageUrlObject: {
imageUrl: string;
imageTag: string;
imageOriginTag: string;
} = {
imageUrl: optionsArg.creationObject.imageUrl,
imageTag: optionsArg.creationObject.imageTag,
imageOriginTag: null,
};
if (imageUrlObject.imageUrl.includes(':')) {
const imageUrl = imageUrlObject.imageUrl.split(':')[0];
const imageTag = imageUrlObject.imageUrl.split(':')[1];
if (imageUrlObject.imageTag) {
throw new Error(
`imageUrl ${imageUrlObject.imageUrl} can't be tagged with ${imageUrlObject.imageTag} because it is already tagged with ${imageTag}`,
);
} else {
imageUrlObject.imageUrl = imageUrl;
imageUrlObject.imageTag = imageTag;
}
} else if (!imageUrlObject.imageTag) {
imageUrlObject.imageTag = 'latest';
}
imageUrlObject.imageOriginTag = `${imageUrlObject.imageUrl}:${imageUrlObject.imageTag}`;
// lets actually create the image
const response = await dockerHostArg.request(
'POST',
`/images/create?fromImage=${encodeURIComponent(
imageUrlObject.imageUrl,
)}&tag=${encodeURIComponent(imageUrlObject.imageTag)}`,
);
if (response.statusCode < 300) {
logger.log(
'info',
`Successfully pulled image ${imageUrlObject.imageUrl} from the registry`,
);
const image = await DockerImage.getImageByName(
dockerHostArg,
imageUrlObject.imageOriginTag,
);
return image;
} else {
logger.log('error', `Failed at the attempt of creating a new image`);
}
}
/**
*
* @param dockerHostArg
* @param tarStreamArg
*/
public static async createFromTarStream(
dockerHostArg: DockerHost,
optionsArg: {
creationObject: interfaces.IImageCreationDescriptor;
tarStream: plugins.smartstream.stream.Readable;
},
): Promise<DockerImage> {
// Start the request for importing an image
const response = await dockerHostArg.requestStreaming(
'POST',
'/images/load',
optionsArg.tarStream,
);
/**
* Docker typically returns lines like:
* {"stream":"Loaded image: myrepo/myimage:latest"}
*
* So we will collect those lines and parse out the final image name.
*/
let rawOutput = '';
response.on('data', (chunk) => {
rawOutput += chunk.toString();
});
// Wrap the end event in a Promise for easier async/await usage
await new Promise<void>((resolve, reject) => {
response.on('end', () => {
resolve();
});
response.on('error', (err) => {
reject(err);
});
});
// Attempt to parse each line to find something like "Loaded image: ..."
let loadedImageTag: string | undefined;
const lines = rawOutput.trim().split('\n').filter(Boolean);
for (const line of lines) {
try {
const jsonLine = JSON.parse(line);
if (
jsonLine.stream &&
(jsonLine.stream.startsWith('Loaded image:') ||
jsonLine.stream.startsWith('Loaded image ID:'))
) {
// Examples:
// "Loaded image: your-image:latest"
// "Loaded image ID: sha256:...."
loadedImageTag = jsonLine.stream
.replace('Loaded image: ', '')
.replace('Loaded image ID: ', '')
.trim();
}
} catch {
// not valid JSON, ignore
}
}
if (!loadedImageTag) {
throw new Error(
`Could not parse the loaded image info from Docker response.\nResponse was:\n${rawOutput}`,
);
}
// Now try to look up that image by the "loadedImageTag".
// Depending on Dockers response, it might be something like:
// "myrepo/myimage:latest" OR "sha256:someHash..."
// If Docker gave you an ID (e.g. "sha256:..."), you may need a separate
// DockerImage.getImageById method; or if you prefer, you can treat it as a name.
const newlyImportedImage = await DockerImage.getImageByName(
dockerHostArg,
loadedImageTag,
);
if (!newlyImportedImage) {
throw new Error(
`Image load succeeded, but no local reference found for "${loadedImageTag}".`,
);
}
logger.log('info', `Successfully imported image "${loadedImageTag}".`);
return newlyImportedImage;
}
public static async tagImageByIdOrName(
dockerHost: DockerHost,
idOrNameArg: string,
newTagArg: string,
) {
const response = await dockerHost.request(
'POST',
`/images/${encodeURIComponent(idOrNameArg)}/${encodeURIComponent(newTagArg)}`,
);
}
public static async buildImage(dockerHostArg: DockerHost, dockerImageTag) {
// TODO: implement building an image
}
// INSTANCE
// references
public dockerHost: DockerHost;
// properties
/**
* the tags for an image
*/
public Containers: number;
public Created: number;
public Id: string;
public Labels: interfaces.TLabels;
public ParentId: string;
public RepoDigests: string[];
public RepoTags: string[];
public SharedSize: number;
public Size: number;
public VirtualSize: number;
constructor(dockerHostArg, dockerImageObjectArg: any) {
this.dockerHost = dockerHostArg;
Object.keys(dockerImageObjectArg).forEach((keyArg) => {
this[keyArg] = dockerImageObjectArg[keyArg];
});
}
/**
* tag an image
* @param newTag
*/
public async tagImage(newTag) {
throw new Error('.tagImage is not yet implemented');
}
/**
* pulls the latest version from the registry
*/
public async pullLatestImageFromRegistry(): Promise<boolean> {
const updatedImage = await DockerImage.createFromRegistry(this.dockerHost, {
creationObject: {
imageUrl: this.RepoTags[0],
},
});
Object.assign(this, updatedImage);
// TODO: Compare image digists before and after
return true;
}
// get stuff
public async getVersion() {
if (this.Labels && this.Labels.version) {
return this.Labels.version;
} else {
return '0.0.0';
}
}
/**
* exports an image to a tar ball
*/
public async exportToTarStream(): Promise<plugins.smartstream.stream.Readable> {
logger.log('info', `Exporting image ${this.RepoTags[0]} to tar stream.`);
const response = await this.dockerHost.requestStreaming(
'GET',
`/images/${encodeURIComponent(this.RepoTags[0])}/get`,
);
// Check if response is a Node.js stream
if (!response || typeof response.on !== 'function') {
throw new Error('Failed to get streaming response for image export');
}
let counter = 0;
const webduplexStream = new plugins.smartstream.SmartDuplex({
writeFunction: async (chunk, tools) => {
if (counter % 1000 === 0) console.log(`Got chunk: ${counter}`);
counter++;
return chunk;
},
});
response.on('data', (chunk) => {
if (!webduplexStream.write(chunk)) {
response.pause();
webduplexStream.once('drain', () => {
response.resume();
});
}
});
response.on('end', () => {
webduplexStream.end();
});
response.on('error', (error) => {
logger.log('error', `Error during image export: ${error.message}`);
webduplexStream.destroy(error);
});
return webduplexStream;
}
}

163
ts/classes.imagestore.ts Normal file
View File

@@ -0,0 +1,163 @@
import * as plugins from './plugins.js';
import * as paths from './paths.js';
import { logger } from './logger.js';
import type { DockerHost } from './classes.host.js';
export interface IDockerImageStoreConstructorOptions {
/**
* used for preparing images for longer term storage
*/
localDirPath: string;
/**
* a smartbucket dir for longer term storage.
*/
bucketDir: plugins.smartbucket.Directory;
}
export class DockerImageStore {
public options: IDockerImageStoreConstructorOptions;
constructor(optionsArg: IDockerImageStoreConstructorOptions) {
this.options = optionsArg;
}
// Method to store tar stream
public async storeImage(
imageName: string,
tarStream: plugins.smartstream.stream.Readable,
): Promise<void> {
logger.log('info', `Storing image ${imageName}...`);
const uniqueProcessingId = plugins.smartunique.shortId();
const initialTarDownloadPath = plugins.path.join(
this.options.localDirPath,
`${uniqueProcessingId}.tar`,
);
const extractionDir = plugins.path.join(
this.options.localDirPath,
uniqueProcessingId,
);
// Create a write stream to store the tar file
const writeStream = plugins.smartfile.fsStream.createWriteStream(
initialTarDownloadPath,
);
// lets wait for the write stream to finish
await new Promise((resolve, reject) => {
tarStream.pipe(writeStream);
writeStream.on('finish', resolve);
writeStream.on('error', reject);
});
logger.log(
'info',
`Image ${imageName} stored locally for processing. Extracting...`,
);
// lets process the image
const tarArchive = await plugins.smartarchive.SmartArchive.fromArchiveFile(
initialTarDownloadPath,
);
await tarArchive.exportToFs(extractionDir);
logger.log('info', `Image ${imageName} extracted.`);
await plugins.smartfile.fs.remove(initialTarDownloadPath);
logger.log('info', `deleted original tar to save space.`);
logger.log('info', `now repackaging for s3...`);
const smartfileIndexJson = await plugins.smartfile.SmartFile.fromFilePath(
plugins.path.join(extractionDir, 'index.json'),
);
const smartfileManifestJson =
await plugins.smartfile.SmartFile.fromFilePath(
plugins.path.join(extractionDir, 'manifest.json'),
);
const smartfileOciLayoutJson =
await plugins.smartfile.SmartFile.fromFilePath(
plugins.path.join(extractionDir, 'oci-layout'),
);
const smartfileRepositoriesJson =
await plugins.smartfile.SmartFile.fromFilePath(
plugins.path.join(extractionDir, 'repositories'),
);
const indexJson = JSON.parse(smartfileIndexJson.contents.toString());
const manifestJson = JSON.parse(smartfileManifestJson.contents.toString());
const ociLayoutJson = JSON.parse(
smartfileOciLayoutJson.contents.toString(),
);
const repositoriesJson = JSON.parse(
smartfileRepositoriesJson.contents.toString(),
);
indexJson.manifests[0].annotations['io.containerd.image.name'] = imageName;
manifestJson[0].RepoTags[0] = imageName;
const repoFirstKey = Object.keys(repositoriesJson)[0];
const repoFirstValue = repositoriesJson[repoFirstKey];
repositoriesJson[imageName] = repoFirstValue;
delete repositoriesJson[repoFirstKey];
smartfileIndexJson.contents = Buffer.from(
JSON.stringify(indexJson, null, 2),
);
smartfileManifestJson.contents = Buffer.from(
JSON.stringify(manifestJson, null, 2),
);
smartfileOciLayoutJson.contents = Buffer.from(
JSON.stringify(ociLayoutJson, null, 2),
);
smartfileRepositoriesJson.contents = Buffer.from(
JSON.stringify(repositoriesJson, null, 2),
);
await Promise.all([
smartfileIndexJson.write(),
smartfileManifestJson.write(),
smartfileOciLayoutJson.write(),
smartfileRepositoriesJson.write(),
]);
logger.log('info', 'repackaging archive for s3...');
const tartools = new plugins.smartarchive.TarTools();
const newTarPack = await tartools.packDirectory(extractionDir);
const finalTarName = `${uniqueProcessingId}.processed.tar`;
const finalTarPath = plugins.path.join(
this.options.localDirPath,
finalTarName,
);
const finalWriteStream =
plugins.smartfile.fsStream.createWriteStream(finalTarPath);
await new Promise((resolve, reject) => {
newTarPack.finalize();
newTarPack.pipe(finalWriteStream);
finalWriteStream.on('finish', resolve);
finalWriteStream.on('error', reject);
});
logger.log('ok', `Repackaged image ${imageName} for s3.`);
await plugins.smartfile.fs.remove(extractionDir);
const finalTarReadStream =
plugins.smartfile.fsStream.createReadStream(finalTarPath);
await this.options.bucketDir.fastPutStream({
stream: finalTarReadStream,
path: `${imageName}.tar`,
});
await plugins.smartfile.fs.remove(finalTarPath);
}
public async start() {
await plugins.smartfile.fs.ensureEmptyDir(this.options.localDirPath);
}
public async stop() {}
// Method to retrieve tar stream
public async getImage(
imageName: string,
): Promise<plugins.smartstream.stream.Readable> {
const imagePath = plugins.path.join(
this.options.localDirPath,
`${imageName}.tar`,
);
if (!(await plugins.smartfile.fs.fileExists(imagePath))) {
throw new Error(`Image ${imageName} does not exist.`);
}
return plugins.smartfile.fsStream.createReadStream(imagePath);
}
}

137
ts/classes.network.ts Normal file
View File

@@ -0,0 +1,137 @@
import * as plugins from './plugins.js';
import * as interfaces from './interfaces/index.js';
import { DockerHost } from './classes.host.js';
import { DockerService } from './classes.service.js';
import { logger } from './logger.js';
export class DockerNetwork {
public static async getNetworks(
dockerHost: DockerHost,
): Promise<DockerNetwork[]> {
const dockerNetworks: DockerNetwork[] = [];
const response = await dockerHost.request('GET', '/networks');
for (const networkObject of response.body) {
const dockerNetwork = new DockerNetwork(dockerHost);
Object.assign(dockerNetwork, networkObject);
dockerNetworks.push(dockerNetwork);
}
return dockerNetworks;
}
public static async getNetworkByName(
dockerHost: DockerHost,
dockerNetworkNameArg: string,
) {
const networks = await DockerNetwork.getNetworks(dockerHost);
return networks.find(
(dockerNetwork) => dockerNetwork.Name === dockerNetworkNameArg,
);
}
public static async createNetwork(
dockerHost: DockerHost,
networkCreationDescriptor: interfaces.INetworkCreationDescriptor,
): Promise<DockerNetwork> {
const response = await dockerHost.request('POST', '/networks/create', {
Name: networkCreationDescriptor.Name,
CheckDuplicate: true,
Driver: 'overlay',
EnableIPv6: false,
/* IPAM: {
Driver: 'default',
Config: [
{
Subnet: `172.20.${networkCreationDescriptor.NetworkNumber}.0/16`,
IPRange: `172.20.${networkCreationDescriptor.NetworkNumber}.0/24`,
Gateway: `172.20.${networkCreationDescriptor.NetworkNumber}.11`
}
]
}, */
Internal: false,
Attachable: true,
Ingress: false,
});
if (response.statusCode < 300) {
logger.log('info', 'Created network successfully');
return await DockerNetwork.getNetworkByName(
dockerHost,
networkCreationDescriptor.Name,
);
} else {
logger.log(
'error',
'There has been an error creating the wanted network',
);
return null;
}
}
// INSTANCE
// references
public dockerHost: DockerHost;
// properties
public Name: string;
public Id: string;
public Created: string;
public Scope: string;
public Driver: string;
public EnableIPv6: boolean;
public Internal: boolean;
public Attachable: boolean;
public Ingress: false;
public IPAM: {
Driver: 'default' | 'bridge' | 'overlay';
Config: [
{
Subnet: string;
IPRange: string;
Gateway: string;
},
];
};
constructor(dockerHostArg: DockerHost) {
this.dockerHost = dockerHostArg;
}
/**
* removes the network
*/
public async remove() {
const response = await this.dockerHost.request(
'DELETE',
`/networks/${this.Id}`,
);
}
public async getContainersOnNetwork(): Promise<
Array<{
Name: string;
EndpointID: string;
MacAddress: string;
IPv4Address: string;
IPv6Address: string;
}>
> {
const returnArray = [];
const response = await this.dockerHost.request(
'GET',
`/networks/${this.Id}`,
);
for (const key of Object.keys(response.body.Containers)) {
returnArray.push(response.body.Containers[key]);
}
return returnArray;
}
public async getContainersOnNetworkForService(serviceArg: DockerService) {
const containersOnNetwork = await this.getContainersOnNetwork();
const containersOfService = containersOnNetwork.filter((container) => {
return container.Name.startsWith(serviceArg.Spec.Name);
});
return containersOfService;
}
}

95
ts/classes.secret.ts Normal file
View File

@@ -0,0 +1,95 @@
import * as plugins from './plugins.js';
import { DockerHost } from './classes.host.js';
// interfaces
import * as interfaces from './interfaces/index.js';
export class DockerSecret {
// STATIC
public static async getSecrets(dockerHostArg: DockerHost) {
const response = await dockerHostArg.request('GET', '/secrets');
const secrets: DockerSecret[] = [];
for (const secret of response.body) {
const dockerSecretInstance = new DockerSecret(dockerHostArg);
Object.assign(dockerSecretInstance, secret);
secrets.push(dockerSecretInstance);
}
return secrets;
}
public static async getSecretByID(dockerHostArg: DockerHost, idArg: string) {
const secrets = await this.getSecrets(dockerHostArg);
return secrets.find((secret) => secret.ID === idArg);
}
public static async getSecretByName(
dockerHostArg: DockerHost,
nameArg: string,
) {
const secrets = await this.getSecrets(dockerHostArg);
return secrets.find((secret) => secret.Spec.Name === nameArg);
}
public static async createSecret(
dockerHostArg: DockerHost,
secretDescriptor: interfaces.ISecretCreationDescriptor,
) {
const labels: interfaces.TLabels = {
...secretDescriptor.labels,
version: secretDescriptor.version,
};
const response = await dockerHostArg.request('POST', '/secrets/create', {
Name: secretDescriptor.name,
Labels: labels,
Data: plugins.smartstring.base64.encode(secretDescriptor.contentArg),
});
const newSecretInstance = new DockerSecret(dockerHostArg);
Object.assign(newSecretInstance, response.body);
Object.assign(
newSecretInstance,
await DockerSecret.getSecretByID(dockerHostArg, newSecretInstance.ID),
);
return newSecretInstance;
}
// INSTANCE
public ID: string;
public Spec: {
Name: string;
Labels: interfaces.TLabels;
};
public Version: {
Index: string;
};
public dockerHost: DockerHost;
constructor(dockerHostArg: DockerHost) {
this.dockerHost = dockerHostArg;
}
/**
* updates a secret
*/
public async update(contentArg: string) {
const route = `/secrets/${this.ID}/update?=version=${this.Version.Index}`;
const response = await this.dockerHost.request(
'POST',
`/secrets/${this.ID}/update?version=${this.Version.Index}`,
{
Name: this.Spec.Name,
Labels: this.Spec.Labels,
Data: plugins.smartstring.base64.encode(contentArg),
},
);
}
public async remove() {
await this.dockerHost.request('DELETE', `/secrets/${this.ID}`);
}
// get things
public async getVersion() {
return this.Spec.Labels.version;
}
}

273
ts/classes.service.ts Normal file
View File

@@ -0,0 +1,273 @@
import * as plugins from './plugins.js';
import * as interfaces from './interfaces/index.js';
import { DockerHost } from './classes.host.js';
import { DockerImage } from './classes.image.js';
import { DockerSecret } from './classes.secret.js';
import { logger } from './logger.js';
export class DockerService {
// STATIC
public static async getServices(dockerHost: DockerHost) {
const services: DockerService[] = [];
const response = await dockerHost.request('GET', '/services');
for (const serviceObject of response.body) {
const dockerService = new DockerService(dockerHost);
Object.assign(dockerService, serviceObject);
services.push(dockerService);
}
return services;
}
public static async getServiceByName(
dockerHost: DockerHost,
networkName: string,
): Promise<DockerService> {
const allServices = await DockerService.getServices(dockerHost);
const wantedService = allServices.find((service) => {
return service.Spec.Name === networkName;
});
return wantedService;
}
/**
* creates a service
*/
public static async createService(
dockerHost: DockerHost,
serviceCreationDescriptor: interfaces.IServiceCreationDescriptor,
): Promise<DockerService> {
// lets get the image
logger.log(
'info',
`now creating service ${serviceCreationDescriptor.name}`,
);
// await serviceCreationDescriptor.image.pullLatestImageFromRegistry();
const serviceVersion = await serviceCreationDescriptor.image.getVersion();
const labels: interfaces.TLabels = {
...serviceCreationDescriptor.labels,
version: serviceVersion,
};
const mounts: Array<{
/**
* the target inside the container
*/
Target: string;
/**
* The Source from which to mount the data (Volume or host path)
*/
Source: string;
Type: 'bind' | 'volume' | 'tmpfs' | 'npipe';
ReadOnly: boolean;
Consistency: 'default' | 'consistent' | 'cached' | 'delegated';
}> = [];
if (serviceCreationDescriptor.accessHostDockerSock) {
mounts.push({
Target: '/var/run/docker.sock',
Source: '/var/run/docker.sock',
Consistency: 'default',
ReadOnly: false,
Type: 'bind',
});
}
if (
serviceCreationDescriptor.resources &&
serviceCreationDescriptor.resources.volumeMounts
) {
for (const volumeMount of serviceCreationDescriptor.resources
.volumeMounts) {
mounts.push({
Target: volumeMount.containerFsPath,
Source: volumeMount.hostFsPath,
Consistency: 'default',
ReadOnly: false,
Type: 'bind',
});
}
}
const networkArray: Array<{
Target: string;
Aliases: string[];
}> = [];
for (const network of serviceCreationDescriptor.networks) {
// Skip null networks (can happen if network creation fails)
if (!network) {
logger.log('warn', 'Skipping null network in service creation');
continue;
}
networkArray.push({
Target: network.Name,
Aliases: [serviceCreationDescriptor.networkAlias],
});
}
const ports = [];
for (const port of serviceCreationDescriptor.ports) {
const portArray = port.split(':');
const hostPort = portArray[0];
const containerPort = portArray[1];
ports.push({
Protocol: 'tcp',
PublishedPort: parseInt(hostPort, 10),
TargetPort: parseInt(containerPort, 10),
});
}
// lets configure secrets
const secretArray: any[] = [];
for (const secret of serviceCreationDescriptor.secrets) {
secretArray.push({
File: {
Name: 'secret.json', // TODO: make sure that works with multiple secrets
UID: '33',
GID: '33',
Mode: 384,
},
SecretID: secret.ID,
SecretName: secret.Spec.Name,
});
}
// lets configure limits
const memoryLimitMB =
serviceCreationDescriptor.resources &&
serviceCreationDescriptor.resources.memorySizeMB
? serviceCreationDescriptor.resources.memorySizeMB
: 1000;
const limits = {
MemoryBytes: memoryLimitMB * 1000000,
};
if (serviceCreationDescriptor.resources) {
limits.MemoryBytes =
serviceCreationDescriptor.resources.memorySizeMB * 1000000;
}
const response = await dockerHost.request('POST', '/services/create', {
Name: serviceCreationDescriptor.name,
TaskTemplate: {
ContainerSpec: {
Image: serviceCreationDescriptor.image.RepoTags[0],
Labels: labels,
Secrets: secretArray,
Mounts: mounts,
/* DNSConfig: {
Nameservers: ['1.1.1.1']
} */
},
UpdateConfig: {
Parallelism: 0,
Delay: 0,
FailureAction: 'pause',
Monitor: 15000000000,
MaxFailureRatio: 0.15,
},
ForceUpdate: 1,
Resources: {
Limits: limits,
},
LogDriver: {
Name: 'json-file',
Options: {
'max-file': '3',
'max-size': '10M',
},
},
},
Labels: labels,
Networks: networkArray,
EndpointSpec: {
Ports: ports,
},
});
const createdService = await DockerService.getServiceByName(
dockerHost,
serviceCreationDescriptor.name,
);
return createdService;
}
// INSTANCE
public dockerHostRef: DockerHost;
public ID: string;
public Version: { Index: number };
public CreatedAt: string;
public UpdatedAt: string;
public Spec: {
Name: string;
Labels: interfaces.TLabels;
TaskTemplate: {
ContainerSpec: {
Image: string;
Isolation: string;
Secrets: Array<{
File: {
Name: string;
UID: string;
GID: string;
Mode: number;
};
SecretID: string;
SecretName: string;
}>;
};
ForceUpdate: 0;
};
Mode: {};
Networks: [any[]];
};
public Endpoint: { Spec: {}; VirtualIPs: [any[]] };
constructor(dockerHostArg: DockerHost) {
this.dockerHostRef = dockerHostArg;
}
public async remove() {
await this.dockerHostRef.request('DELETE', `/services/${this.ID}`);
}
public async reReadFromDockerEngine() {
const dockerData = await this.dockerHostRef.request(
'GET',
`/services/${this.ID}`,
);
// TODO: Better assign: Object.assign(this, dockerData);
}
public async needsUpdate(): Promise<boolean> {
// TODO: implement digest based update recognition
await this.reReadFromDockerEngine();
const dockerImage = await DockerImage.createFromRegistry(
this.dockerHostRef,
{
creationObject: {
imageUrl: this.Spec.TaskTemplate.ContainerSpec.Image,
},
},
);
const imageVersion = new plugins.smartversion.SmartVersion(
dockerImage.Labels.version,
);
const serviceVersion = new plugins.smartversion.SmartVersion(
this.Spec.Labels.version,
);
if (imageVersion.greaterThan(serviceVersion)) {
console.log(`service ${this.Spec.Name} needs to be updated`);
return true;
} else {
console.log(`service ${this.Spec.Name} is up to date.`);
}
}
}

View File

@@ -1,262 +0,0 @@
import "typings-global"
import * as plugins from "./dockersock.plugins";
import { Observable } from "rxjs";
// interfaces
import { Objectmap } from 'lik'
export class Dockersock {
sockPath: string;
requestObjectmap = new plugins.lik.Objectmap<plugins.request.Request>();
constructor(pathArg: string = "http://unix:/var/run/docker.sock:") {
this.sockPath = pathArg;
}
// methods
auth (userArg: string, passArg: string) {
let done = plugins.q.defer();
this.request("POST", "");
return done.promise;
}
listContainers () {
let done = plugins.q.defer();
this.request("GET", "/containers")
.then(done.resolve);
return done.promise;
};
listContainersDetailed () {
let done = plugins.q.defer();
let detailedDataObject = [];
this.listContainers()
.then((dataArg) => {
let recursiveCounter = 0;
let makeDetailed = () => {
if (typeof dataArg[ recursiveCounter ] != "undefined") {
this.request("GET", "/containers/" + dataArg[ recursiveCounter ].Id)
.then((dataArg2) => {
detailedDataObject.push(dataArg2);
recursiveCounter++;
// recursive call
makeDetailed();
});
} else {
done.resolve(detailedDataObject);
}
};
makeDetailed();
});
return done.promise;
};
listContainersRunning () {
let done = plugins.q.defer();
return done.promise;
}
listContainersStopped () {
let done = plugins.q.defer();
return done.promise;
}
listImages () {
return this.request("GET", "/images", "?all=true");
}
listImagesDangling () {
return this.request("GET", "/images", "?dangling=true");
}
pullImage (imageLabelArg: string) {
let imageLabel = encodeURI(imageLabelArg);
return this.requestStream("POST", "/images/create?fromImage=" + imageLabel);
};
createContainer (optionsArg, pullFirstArg: boolean = true) {
let done = plugins.q.defer();
let create = () => {
return this.request("POST", "/containers/create", "", optionsArg);
}
if (pullFirstArg) {
this.pullImage(optionsArg.Image)
.then(create)
.then(done.resolve);
} else {
create()
.then(done.resolve)
}
return done.promise;
};
getContainerId () {
};
startContainer (containerNameArg) {
return this.request("POST", "/containers/" + containerNameArg + "/start");
};
stopContainer (containerNameArg) {
return this.request("POST", "/containers/" + containerNameArg + "/stop");
};
removeContainer (containerNameArg) {
return this.request("DELETE", "/containers/" + containerNameArg + "?v=1");
};
clean () {
let done = plugins.q.defer();
return done.promise;
};
callOnChange (cb: Function) {
let cbPromise;
let changeBuffered: boolean = false; // when cb is running then buffer any consequent change
let requestStream = plugins.request.get(this.sockPath + "/events");
requestStream.on("response", (response) => {
if (response.statusCode == 200) {
plugins.beautylog.ok("request returned status 200, so we are good!");
} else {
plugins.beautylog.error("request returned error: " + response.statusCode);
}
});
requestStream.on("data", (data: Buffer) => {
let status = JSON.parse(data.toString()).status;
plugins.beautylog.logReduced(status);
if (typeof cbPromise == "undefined" || cbPromise.state == "pending") {
cbPromise = cb();
} else if (changeBuffered) {
changeBuffered = true;
cbPromise.then(() => {
changeBuffered = false;
cbPromise = cb();
});
}
});
requestStream.on("end", () => {
});
};
/**
* gets you an observable that reports changes in the docker infrastructure
*/
getChangeObservable () {
let options = {
method: "GET",
url: this.sockPath + "/events",
headers: {
"Content-Type": "application/json",
"Host": "docker.sock"
}
};
let requestStream = plugins.request(options, (err, res, body) => {
if (!err && res.statusCode == 200) {
} else {
console.log(err);
console.log(res);
};
});
let incomingMessage
requestStream.on("response", (response) => {
incomingMessage = response
this.requestObjectmap.add(incomingMessage);
if (response.statusCode == 200) {
plugins.beautylog.ok("request returned status 200, so we are good!");
} else {
plugins.beautylog.error("request returned error: " + response.statusCode);
}
});
let changeObservable = Observable.fromEvent(requestStream, "data");
requestStream.on("end", () => {
this.requestObjectmap.remove(incomingMessage);
});
return changeObservable;
}
/**
* fire a request
* @param methodArg
* @param routeArg
* @param queryArg
* @param dataArg
*/
request (methodArg: string, routeArg: string, queryArg: string = "", dataArg = {}) {
let done = plugins.q.defer();
let jsonArg: string = JSON.stringify(dataArg);
let suffix: string = "";
if (methodArg == "GET") suffix = "/json";
let options = {
method: methodArg,
url: this.sockPath + routeArg + suffix + queryArg,
headers: {
"Content-Type": "application/json",
"Host": "docker.sock"
},
body: jsonArg
};
//console.log(options);
plugins.request(options, (err, res, body) => {
if (!err && res.statusCode == 200) {
var responseObj = JSON.parse(body);
done.resolve(responseObj);
} else {
console.log(err);
console.log(res);
done.reject(err);
};
});
return done.promise;
}
/**
* fire a streaming request
* @param methodArg
* @param routeArg
* @param queryArg
* @param dataArg
*/
requestStream (methodArg: string, routeArg: string, queryArg: string = "", dataArg = {}) {
let done = plugins.q.defer();
let jsonArg: string = JSON.stringify(dataArg);
let suffix: string = "";
let options = {
method: methodArg,
url: this.sockPath + routeArg + suffix + queryArg,
headers: {
"Content-Type": "application/json",
"Host": "docker.sock"
},
body: jsonArg
};
let requestStream = plugins.request(options, (err, res, body) => {
if (!err && res.statusCode == 200) {
done.resolve();
} else {
console.log(err);
console.log(res);
done.reject(err);
};
});
let incomingMessage
requestStream.on("response", (response) => {
incomingMessage = response
this.requestObjectmap.add(incomingMessage);
if (response.statusCode == 200) {
plugins.beautylog.ok("request returned status 200, so we are good!");
} else {
plugins.beautylog.error("request returned error: " + response.statusCode);
done.reject(response);
}
});
requestStream.on("data", (data: Buffer) => {
let status;
status = JSON.parse(data.toString()).status;
plugins.beautylog.logReduced(status);
});
requestStream.on("end", () => {
this.requestObjectmap.remove(incomingMessage);
});
return done.promise;
};
/**
* end all currently streaming requests
*/
endRequests () {
setTimeout(() => {
this.requestObjectmap.forEach((itemArg: plugins.request.Request) => {
itemArg.emit("end");
});
this.requestObjectmap.wipe();
}, 5000);
};
}

View File

@@ -1,6 +0,0 @@
import "typings-global";
export import beautylog = require("beautylog");
export import lik = require("lik");
export import q = require("q");
export import request = require("request");
export import rxjs = require("rxjs");

View File

@@ -1,2 +1,7 @@
import "typings-global";
export { Dockersock } from "./dockersock.classes.dockersock";
export * from './classes.host.js';
export * from './classes.container.js';
export * from './classes.image.js';
export * from './classes.imagestore.js';
export * from './classes.network.js';
export * from './classes.secret.js';
export * from './classes.service.js';

View File

@@ -0,0 +1,7 @@
import { DockerNetwork } from '../classes.network.js';
export interface IContainerCreationDescriptor {
Hostname: string;
Domainname: string;
networks?: DockerNetwork[];
}

4
ts/interfaces/image.ts Normal file
View File

@@ -0,0 +1,4 @@
export interface IImageCreationDescriptor {
imageUrl: string;
imageTag?: string;
}

7
ts/interfaces/index.ts Normal file
View File

@@ -0,0 +1,7 @@
export * from './container.js';
export * from './image.js';
export * from './label.js';
export * from './network.js';
export * from './port.js';
export * from './secret.js';
export * from './service.js';

2
ts/interfaces/label.ts Normal file
View File

@@ -0,0 +1,2 @@
// tslint:disable-next-line: interface-over-type-literal
export type TLabels = { [key: string]: string };

6
ts/interfaces/network.ts Normal file
View File

@@ -0,0 +1,6 @@
/**
* creates a new Network
*/
export interface INetworkCreationDescriptor {
Name: string;
}

6
ts/interfaces/port.ts Normal file
View File

@@ -0,0 +1,6 @@
export interface IPort {
PrivatePort: 80;
Type: 'tcp';
}
export type TPorts = IPort[];

8
ts/interfaces/secret.ts Normal file
View File

@@ -0,0 +1,8 @@
import * as interfaces from './index.js';
export interface ISecretCreationDescriptor {
name: string;
version: string;
contentArg: any;
labels: interfaces.TLabels;
}

21
ts/interfaces/service.ts Normal file
View File

@@ -0,0 +1,21 @@
import * as plugins from '../plugins.js';
import * as interfaces from './index.js';
import { DockerNetwork } from '../classes.network.js';
import { DockerSecret } from '../classes.secret.js';
import { DockerImage } from '../classes.image.js';
export interface IServiceCreationDescriptor {
name: string;
image: DockerImage;
labels: interfaces.TLabels;
networks: DockerNetwork[];
networkAlias: string;
secrets: DockerSecret[];
ports: string[];
accessHostDockerSock?: boolean;
resources?: {
memorySizeMB?: number;
volumeMounts?: plugins.tsclass.container.IVolumeMount[];
};
}

5
ts/logger.ts Normal file
View File

@@ -0,0 +1,5 @@
import * as plugins from './plugins.js';
import { commitinfo } from './00_commitinfo_data.js';
export const logger = plugins.smartlog.Smartlog.createForCommitinfo(commitinfo);
logger.enableConsole();

9
ts/paths.ts Normal file
View File

@@ -0,0 +1,9 @@
import * as plugins from './plugins.js';
export const packageDir = plugins.path.resolve(
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
'../',
);
export const nogitDir = plugins.path.resolve(packageDir, '.nogit/');
plugins.smartfile.fs.ensureDir(nogitDir);

47
ts/plugins.ts Normal file
View File

@@ -0,0 +1,47 @@
// node native path
import * as path from 'path';
export { path };
// @pushrocks scope
import * as lik from '@push.rocks/lik';
import * as smartarchive from '@push.rocks/smartarchive';
import * as smartbucket from '@push.rocks/smartbucket';
import * as smartfile from '@push.rocks/smartfile';
import * as smartjson from '@push.rocks/smartjson';
import * as smartlog from '@push.rocks/smartlog';
import * as smartnetwork from '@push.rocks/smartnetwork';
import * as smartpath from '@push.rocks/smartpath';
import * as smartpromise from '@push.rocks/smartpromise';
import * as smartrequest from '@push.rocks/smartrequest';
import * as smartstring from '@push.rocks/smartstring';
import * as smartstream from '@push.rocks/smartstream';
import * as smartunique from '@push.rocks/smartunique';
import * as smartversion from '@push.rocks/smartversion';
export {
lik,
smartarchive,
smartbucket,
smartfile,
smartjson,
smartlog,
smartnetwork,
smartpath,
smartpromise,
smartrequest,
smartstring,
smartstream,
smartunique,
smartversion,
};
// @tsclass scope
import * as tsclass from '@tsclass/tsclass';
export { tsclass };
// third party
import * as rxjs from 'rxjs';
export { rxjs };

14
tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true,
"baseUrl": ".",
"paths": {}
},
"exclude": ["dist_*/**/*.d.ts"]
}

826
yarn.lock
View File

@@ -1,826 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/chai-as-promised@0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-0.0.29.tgz#43d52892aa998e185a3de3e2477edb8573be1d77"
dependencies:
"@types/chai" "*"
"@types/promises-a-plus" "*"
"@types/chai-string@^1.1.30":
version "1.1.30"
resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.1.30.tgz#4d8744b31a5a2295fc01c981ed1e2d4c8a070f0a"
dependencies:
"@types/chai" "*"
"@types/chai@*":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.1.tgz#37fea779617cfec3fd2b19a0247e8bbdd5133bf6"
"@types/chai@^3.4.35":
version "3.5.2"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e"
"@types/lodash@^4.14.55", "@types/lodash@^4.14.67":
version "4.14.69"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.69.tgz#2bbd48c1565e02506f48ed8d1e8e53ea493fd0e6"
"@types/minimatch@2.x.x":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
"@types/node@*":
version "8.0.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.13.tgz#530f0f9254209b0335bf5cc6387822594ef47093"
"@types/promises-a-plus@*":
version "0.0.27"
resolved "https://registry.yarnpkg.com/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz#c64651134614c84b8f5d7114ce8901d36a609780"
"@types/q@1.x.x":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.0.2.tgz#41f0b0f6ae0eeed3a51b003e2e08cba5525b74f6"
"@types/shelljs@^0.7.2":
version "0.7.2"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.2.tgz#c2bdb3fe80cd7a3da08750ca898ae44c589671f3"
dependencies:
"@types/node" "*"
"@types/which@^1.0.28":
version "1.0.28"
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
ajv@^4.9.1:
version "4.11.8"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"
ansi-256-colors@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
asn1@~0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
assert-plus@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234"
assertion-error@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
aws-sign2@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
aws4@^1.2.1:
version "1.6.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
bcrypt-pbkdf@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
dependencies:
tweetnacl "^0.14.3"
beautycolor@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.7.tgz#a4715738ac4c8221371e9cbeb5a6cc6d11ecbf7c"
dependencies:
ansi-256-colors "^1.1.0"
typings-global "^1.0.14"
beautylog@^6.1.10:
version "6.1.10"
resolved "https://registry.yarnpkg.com/beautylog/-/beautylog-6.1.10.tgz#9c27e566937684cb689f9372d98cfa5415d50b72"
dependencies:
"@types/lodash" "^4.14.55"
beautycolor "^1.0.7"
figlet "^1.2.0"
lodash "^4.17.4"
ora "^1.1.0"
smartenv "^2.0.0"
smartq "^1.1.1"
typings-global "^1.0.14"
bindings@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11"
boom@2.x.x:
version "2.10.1"
resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
dependencies:
hoek "2.x.x"
brace-expansion@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
chai-as-promised@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-6.0.0.tgz#1a02a433a6f24dafac63b9c96fa1684db1aa8da6"
dependencies:
check-error "^1.0.2"
chai-string@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.4.0.tgz#359140c051d36a4e4b1a5fc6b910152f438a8d49"
chai@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247"
dependencies:
assertion-error "^1.0.1"
deep-eql "^0.1.3"
type-detect "^1.0.0"
chalk@^1.0.0, chalk@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"
check-error@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
cli-cursor@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
dependencies:
restore-cursor "^2.0.0"
cli-spinners@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a"
co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
combined-stream@^1.0.5, combined-stream@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
dependencies:
delayed-stream "~1.0.0"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
cryptiles@2.x.x:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
dependencies:
boom "2.x.x"
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
dependencies:
assert-plus "^1.0.0"
deep-eql@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
dependencies:
type-detect "0.1.1"
define-properties@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
dependencies:
foreach "^2.0.5"
object-keys "^1.0.8"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
early@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
dependencies:
beautycolor "^1.0.7"
smartq "^1.1.1"
typings-global "^1.0.16"
ecc-jsbn@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
dependencies:
jsbn "~0.1.0"
es-abstract@^1.5.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c"
dependencies:
es-to-primitive "^1.1.1"
function-bind "^1.1.0"
is-callable "^1.1.3"
is-regex "^1.0.3"
es-to-primitive@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
dependencies:
is-callable "^1.1.1"
is-date-object "^1.0.1"
is-symbol "^1.0.1"
es6-error@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98"
escape-string-regexp@^1.0.2:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
extend@~3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
extsprintf@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
figlet@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410"
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
form-data@~2.1.1:
version "2.1.4"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.5"
mime-types "^2.1.12"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
function-bind@^1.0.2, function-bind@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"
getpass@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
dependencies:
assert-plus "^1.0.0"
glob@^7.0.0:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
har-schema@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
har-validator@~4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a"
dependencies:
ajv "^4.9.1"
har-schema "^1.0.5"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"
has@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
dependencies:
function-bind "^1.0.2"
hawk@~3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
dependencies:
boom "2.x.x"
cryptiles "2.x.x"
hoek "2.x.x"
sntp "1.x.x"
hoek@2.x.x:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
http-signature@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
dependencies:
assert-plus "^0.2.0"
jsprim "^1.2.2"
sshpk "^1.7.0"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
interpret@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
is-callable@^1.1.1, is-callable@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
is-date-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-observable@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2"
dependencies:
symbol-observable "^0.2.2"
is-regex@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
dependencies:
has "^1.0.1"
is-symbol@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
json-stable-stringify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
dependencies:
jsonify "~0.0.0"
json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
jsonify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
jsprim@^1.2.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918"
dependencies:
assert-plus "1.0.0"
extsprintf "1.0.2"
json-schema "0.2.3"
verror "1.3.6"
leakage@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
dependencies:
es6-error "^4.0.2"
left-pad "^1.1.3"
memwatch-next "^0.3.0"
minimist "^1.2.0"
pretty-bytes "^4.0.2"
left-pad@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
lik@^1.0.38:
version "1.0.38"
resolved "https://registry.yarnpkg.com/lik/-/lik-1.0.38.tgz#ccff0abd3d9236a5e4b7d80d514c5c210f18469b"
dependencies:
"@types/lodash" "^4.14.67"
"@types/minimatch" "2.x.x"
"@types/q" "1.x.x"
lodash "^4.17.4"
minimatch "^3.0.4"
q "^1.5.0"
rxjs "^5.4.1"
smartq "^1.1.1"
typings-global "^1.0.19"
lodash@^4.17.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
log-symbols@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18"
dependencies:
chalk "^1.0.0"
memwatch-next@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
dependencies:
bindings "^1.2.1"
nan "^2.3.2"
mime-db@~1.27.0:
version "1.27.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1"
mime-types@^2.1.12, mime-types@~2.1.7:
version "2.1.15"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed"
dependencies:
mime-db "~1.27.0"
mimic-fn@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
nan@^2.3.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
object-keys@^1.0.8:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
object.getownpropertydescriptors@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.5.1"
observable-to-promise@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/observable-to-promise/-/observable-to-promise-0.5.0.tgz#c828f0f0dc47e9f86af8a4977c5d55076ce7a91f"
dependencies:
is-observable "^0.2.0"
symbol-observable "^1.0.4"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
onetime@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
dependencies:
mimic-fn "^1.0.0"
ora@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/ora/-/ora-1.3.0.tgz#80078dd2b92a934af66a3ad72a5b910694ede51a"
dependencies:
chalk "^1.1.1"
cli-cursor "^2.1.0"
cli-spinners "^1.0.0"
log-symbols "^1.0.2"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
performance-now@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
q@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1"
qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
dependencies:
resolve "^1.1.6"
request@^2.81.0:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
dependencies:
aws-sign2 "~0.6.0"
aws4 "^1.2.1"
caseless "~0.12.0"
combined-stream "~1.0.5"
extend "~3.0.0"
forever-agent "~0.6.1"
form-data "~2.1.1"
har-validator "~4.2.1"
hawk "~3.1.3"
http-signature "~1.1.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.7"
oauth-sign "~0.8.1"
performance-now "^0.2.0"
qs "~6.4.0"
safe-buffer "^5.0.1"
stringstream "~0.0.4"
tough-cookie "~2.3.0"
tunnel-agent "^0.6.0"
uuid "^3.0.0"
resolve@^1.1.6:
version "1.3.3"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5"
dependencies:
path-parse "^1.0.5"
restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
dependencies:
onetime "^2.0.0"
signal-exit "^3.0.2"
rxjs@^5.4.1, rxjs@^5.4.2:
version "5.4.2"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.2.tgz#2a3236fcbf03df57bae06fd6972fd99e5c08fcf7"
dependencies:
symbol-observable "^1.0.1"
safe-buffer@^5.0.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
semver@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
shelljs@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"
signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
smartchai@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.3.tgz#de6d010bb8b5aef24cb70b31a5f5334e8c41b72f"
dependencies:
"@types/chai" "^3.4.35"
"@types/chai-as-promised" "0.0.29"
"@types/chai-string" "^1.1.30"
chai "^3.5.0"
chai-as-promised "^6.0.0"
chai-string "^1.3.0"
smartdelay@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.3.tgz#5fd44dad77262d110702f0293efa80c072cfb579"
dependencies:
smartq "^1.1.1"
typings-global "^1.0.16"
smartenv@^2.0.0:
version "2.0.6"
resolved "https://registry.yarnpkg.com/smartenv/-/smartenv-2.0.6.tgz#b38c679b0c151b9af548f68c3a072c29d1417e8d"
dependencies:
lodash "^4.17.4"
smartq "^1.1.1"
typings-global "^1.0.14"
smartq@^1.1.1:
version "1.1.6"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
dependencies:
typings-global "^1.0.19"
util.promisify "^1.0.0"
smartshell@^1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.8.tgz#1535756c0fe8069f7e6da1e3f9cb6c8f77094e42"
dependencies:
"@types/shelljs" "^0.7.2"
"@types/which" "^1.0.28"
shelljs "^0.7.8"
smartq "^1.1.1"
typings-global "^1.0.19"
which "^1.2.14"
sntp@1.x.x:
version "1.0.9"
resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198"
dependencies:
hoek "2.x.x"
sshpk@^1.7.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
dependencies:
asn1 "~0.2.3"
assert-plus "^1.0.0"
dashdash "^1.12.0"
getpass "^0.1.1"
optionalDependencies:
bcrypt-pbkdf "^1.0.0"
ecc-jsbn "~0.1.1"
jsbn "~0.1.0"
tweetnacl "~0.14.0"
stringstream@~0.0.4:
version "0.0.5"
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
strip-ansi@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"
supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
symbol-observable@^0.2.2:
version "0.2.4"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40"
symbol-observable@^1.0.1, symbol-observable@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
tapbundle@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.1.tgz#ec4172c0e82a77b1f6133fef2606311ede28a62d"
dependencies:
early "^2.1.1"
leakage "^0.3.0"
smartchai "^1.0.3"
smartdelay "^1.0.3"
smartq "^1.1.1"
typings-global "^1.0.19"
tough-cookie@~2.3.0:
version "2.3.2"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
dependencies:
punycode "^1.4.1"
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
dependencies:
safe-buffer "^5.0.1"
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
type-detect@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
type-detect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19:
version "1.0.19"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.19.tgz#3376a72d4de1e5541bf5702248ff64c3e6ea316c"
dependencies:
semver "^5.3.0"
smartshell "^1.0.6"
util.promisify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
dependencies:
define-properties "^1.1.2"
object.getownpropertydescriptors "^2.0.3"
uuid@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
verror@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c"
dependencies:
extsprintf "1.0.2"
which@^1.2.14:
version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies:
isexe "^2.0.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"