From de0e5dcb123107e914cd813a1a2e67236c27d909 Mon Sep 17 00:00:00 2001 From: Egor Kushnarev Date: Sat, 23 Mar 2024 00:21:29 +0300 Subject: [PATCH] windows repo maker remake --- pnpm-lock.yaml | 978 +------------------------------- src/artifactory-utils.ts | 168 ------ src/cli.ts | 42 -- src/config.ts | 78 --- src/http.ts | 87 --- src/index.mts | 6 - src/jewel-case.ts | 33 -- src/mac/mac-builder.mts | 12 +- src/repo-builder.ts | 94 --- src/repo.mts | 15 - src/utils.ts | 85 --- src/windows-repo-builder.ts | 149 ----- src/windows/windows-builder.mts | 186 ++++++ 13 files changed, 194 insertions(+), 1739 deletions(-) delete mode 100644 src/artifactory-utils.ts delete mode 100644 src/cli.ts delete mode 100644 src/config.ts delete mode 100644 src/http.ts delete mode 100644 src/jewel-case.ts delete mode 100644 src/repo-builder.ts delete mode 100644 src/repo.mts delete mode 100644 src/utils.ts delete mode 100644 src/windows-repo-builder.ts create mode 100644 src/windows/windows-builder.mts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1645339..5029eac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -152,95 +152,6 @@ packages: tslib: 1.14.1 dev: false -<<<<<<< HEAD - /@aws-crypto/util/2.0.2: - resolution: {integrity: sha512-Lgu5v/0e/BcrZ5m/IWqzPUf3UYFTy/PpeED+uc9SWUR1iZQL8XXbGQg10UfllwwBryO3hFF5dizK+78aoXC1eA==} - dependencies: - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-utf8-browser': 3.188.0 - tslib: 1.14.1 - dev: false - - /@aws-sdk/abort-controller/3.226.0: - resolution: {integrity: sha512-cJVzr1xxPBd08voknXvR0RLgtZKGKt6WyDpH/BaPCu3rfSqWCDZKzwqe940eqosjmKrxC6pUZNKASIqHOQ8xxQ==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/chunked-blob-reader-native/3.208.0: - resolution: {integrity: sha512-JeOZ95PW+fJ6bbuqPySYqLqHk1n4+4ueEEraJsiUrPBV0S1ZtyvOGHcnGztKUjr2PYNaiexmpWuvUve9K12HRA==} - dependencies: - '@aws-sdk/util-base64': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/chunked-blob-reader/3.188.0: - resolution: {integrity: sha512-zkPRFZZPL3eH+kH86LDYYXImiClA1/sW60zYOjse9Pgka+eDJlvBN6hcYxwDEKjcwATYiSRR1aVQHcfCinlGXg==} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/client-s3/3.226.0: - resolution: {integrity: sha512-N8S0i5txBqlTY30IHaWgi15HUPzdWpQVX01zfYoHU80HmxKBRhqrefIrmCbn/121br0B+MysgpgdfiSfhyHkLw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-crypto/sha1-browser': 2.0.0 - '@aws-crypto/sha256-browser': 2.0.0 - '@aws-crypto/sha256-js': 2.0.0 - '@aws-sdk/client-sts': 3.226.0 - '@aws-sdk/config-resolver': 3.226.0 - '@aws-sdk/credential-provider-node': 3.226.0 - '@aws-sdk/eventstream-serde-browser': 3.226.0 - '@aws-sdk/eventstream-serde-config-resolver': 3.226.0 - '@aws-sdk/eventstream-serde-node': 3.226.0 - '@aws-sdk/fetch-http-handler': 3.226.0 - '@aws-sdk/hash-blob-browser': 3.226.0 - '@aws-sdk/hash-node': 3.226.0 - '@aws-sdk/hash-stream-node': 3.226.0 - '@aws-sdk/invalid-dependency': 3.226.0 - '@aws-sdk/md5-js': 3.226.0 - '@aws-sdk/middleware-bucket-endpoint': 3.226.0 - '@aws-sdk/middleware-content-length': 3.226.0 - '@aws-sdk/middleware-endpoint': 3.226.0 - '@aws-sdk/middleware-expect-continue': 3.226.0 - '@aws-sdk/middleware-flexible-checksums': 3.226.0 - '@aws-sdk/middleware-host-header': 3.226.0 - '@aws-sdk/middleware-location-constraint': 3.226.0 - '@aws-sdk/middleware-logger': 3.226.0 - '@aws-sdk/middleware-recursion-detection': 3.226.0 - '@aws-sdk/middleware-retry': 3.226.0 - '@aws-sdk/middleware-sdk-s3': 3.226.0 - '@aws-sdk/middleware-serde': 3.226.0 - '@aws-sdk/middleware-signing': 3.226.0 - '@aws-sdk/middleware-ssec': 3.226.0 - '@aws-sdk/middleware-stack': 3.226.0 - '@aws-sdk/middleware-user-agent': 3.226.0 - '@aws-sdk/node-config-provider': 3.226.0 - '@aws-sdk/node-http-handler': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/signature-v4-multi-region': 3.226.0 - '@aws-sdk/smithy-client': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/url-parser': 3.226.0 - '@aws-sdk/util-base64': 3.208.0 - '@aws-sdk/util-body-length-browser': 3.188.0 - '@aws-sdk/util-body-length-node': 3.208.0 - '@aws-sdk/util-defaults-mode-browser': 3.226.0 - '@aws-sdk/util-defaults-mode-node': 3.226.0 - '@aws-sdk/util-endpoints': 3.226.0 - '@aws-sdk/util-stream-browser': 3.226.0 - '@aws-sdk/util-stream-node': 3.226.0 - '@aws-sdk/util-user-agent-browser': 3.226.0 - '@aws-sdk/util-user-agent-node': 3.226.0 - '@aws-sdk/util-utf8-browser': 3.188.0 - '@aws-sdk/util-utf8-node': 3.208.0 - '@aws-sdk/util-waiter': 3.226.0 - '@aws-sdk/xml-builder': 3.201.0 - fast-xml-parser: 4.0.11 - tslib: 2.4.1 -======= /@aws-crypto/util@3.0.0: resolution: {integrity: sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==} dependencies: @@ -321,50 +232,11 @@ packages: '@aws-sdk/xml-builder': 3.310.0 fast-xml-parser: 4.1.2 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - '@aws-sdk/signature-v4-crt' - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/client-sso-oidc/3.226.0: - resolution: {integrity: sha512-IKzAhL6RoPs7IZ/rJvekjedQ4oesazCO+Aqh9l2Xct+XY0MFBdh4amgg4t/8fjksfIzmJH48BZoNv5gVak6yRw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-crypto/sha256-browser': 2.0.0 - '@aws-crypto/sha256-js': 2.0.0 - '@aws-sdk/config-resolver': 3.226.0 - '@aws-sdk/fetch-http-handler': 3.226.0 - '@aws-sdk/hash-node': 3.226.0 - '@aws-sdk/invalid-dependency': 3.226.0 - '@aws-sdk/middleware-content-length': 3.226.0 - '@aws-sdk/middleware-endpoint': 3.226.0 - '@aws-sdk/middleware-host-header': 3.226.0 - '@aws-sdk/middleware-logger': 3.226.0 - '@aws-sdk/middleware-recursion-detection': 3.226.0 - '@aws-sdk/middleware-retry': 3.226.0 - '@aws-sdk/middleware-serde': 3.226.0 - '@aws-sdk/middleware-stack': 3.226.0 - '@aws-sdk/middleware-user-agent': 3.226.0 - '@aws-sdk/node-config-provider': 3.226.0 - '@aws-sdk/node-http-handler': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/smithy-client': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/url-parser': 3.226.0 - '@aws-sdk/util-base64': 3.208.0 - '@aws-sdk/util-body-length-browser': 3.188.0 - '@aws-sdk/util-body-length-node': 3.208.0 - '@aws-sdk/util-defaults-mode-browser': 3.226.0 - '@aws-sdk/util-defaults-mode-node': 3.226.0 - '@aws-sdk/util-endpoints': 3.226.0 - '@aws-sdk/util-user-agent-browser': 3.226.0 - '@aws-sdk/util-user-agent-node': 3.226.0 - '@aws-sdk/util-utf8-browser': 3.188.0 - '@aws-sdk/util-utf8-node': 3.208.0 - tslib: 2.4.1 -======= /@aws-sdk/client-sso-oidc@3.315.0: resolution: {integrity: sha512-OJgtmx6SpCWHBDCxBBi36Ro44uCqZBufGkThP/PVYrgVnRVnJ4V18d2wNGKmS37zKmCHHJPnhMPlGOgE2qyVPQ==} engines: {node: '>=14.0.0'} @@ -401,49 +273,10 @@ packages: '@aws-sdk/util-user-agent-node': 3.310.0 '@aws-sdk/util-utf8': 3.310.0 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/client-sso/3.226.0: - resolution: {integrity: sha512-+Hl1YSLKrxPnQLijhWryI6uV8eKZIsUhvWlzFKx75kjxzjsC/jyk5zV59jnCu0SCCepXB8DKyLVa2WpH7iAHew==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-crypto/sha256-browser': 2.0.0 - '@aws-crypto/sha256-js': 2.0.0 - '@aws-sdk/config-resolver': 3.226.0 - '@aws-sdk/fetch-http-handler': 3.226.0 - '@aws-sdk/hash-node': 3.226.0 - '@aws-sdk/invalid-dependency': 3.226.0 - '@aws-sdk/middleware-content-length': 3.226.0 - '@aws-sdk/middleware-endpoint': 3.226.0 - '@aws-sdk/middleware-host-header': 3.226.0 - '@aws-sdk/middleware-logger': 3.226.0 - '@aws-sdk/middleware-recursion-detection': 3.226.0 - '@aws-sdk/middleware-retry': 3.226.0 - '@aws-sdk/middleware-serde': 3.226.0 - '@aws-sdk/middleware-stack': 3.226.0 - '@aws-sdk/middleware-user-agent': 3.226.0 - '@aws-sdk/node-config-provider': 3.226.0 - '@aws-sdk/node-http-handler': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/smithy-client': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/url-parser': 3.226.0 - '@aws-sdk/util-base64': 3.208.0 - '@aws-sdk/util-body-length-browser': 3.188.0 - '@aws-sdk/util-body-length-node': 3.208.0 - '@aws-sdk/util-defaults-mode-browser': 3.226.0 - '@aws-sdk/util-defaults-mode-node': 3.226.0 - '@aws-sdk/util-endpoints': 3.226.0 - '@aws-sdk/util-user-agent-browser': 3.226.0 - '@aws-sdk/util-user-agent-node': 3.226.0 - '@aws-sdk/util-utf8-browser': 3.188.0 - '@aws-sdk/util-utf8-node': 3.208.0 - tslib: 2.4.1 -======= /@aws-sdk/client-sso@3.315.0: resolution: {integrity: sha512-P3QOOyHQER7EDVCzXOsAaJE2p/qfdsSFsYv8k2S8LqEKGH0fViQ4Ph540uKlmaOt1kEhwH1wI6cLRMJJX9XV4Q==} engines: {node: '>=14.0.0'} @@ -480,53 +313,10 @@ packages: '@aws-sdk/util-user-agent-node': 3.310.0 '@aws-sdk/util-utf8': 3.310.0 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/client-sts/3.226.0: - resolution: {integrity: sha512-ZBlqRVbnHvvbkN5g56+mXltNybHNzgV69+2ARubQ8ge9U2qF/LweCmGqZnZLWqdGXwaB9IOvz5ZW2npyJh1X/A==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-crypto/sha256-browser': 2.0.0 - '@aws-crypto/sha256-js': 2.0.0 - '@aws-sdk/config-resolver': 3.226.0 - '@aws-sdk/credential-provider-node': 3.226.0 - '@aws-sdk/fetch-http-handler': 3.226.0 - '@aws-sdk/hash-node': 3.226.0 - '@aws-sdk/invalid-dependency': 3.226.0 - '@aws-sdk/middleware-content-length': 3.226.0 - '@aws-sdk/middleware-endpoint': 3.226.0 - '@aws-sdk/middleware-host-header': 3.226.0 - '@aws-sdk/middleware-logger': 3.226.0 - '@aws-sdk/middleware-recursion-detection': 3.226.0 - '@aws-sdk/middleware-retry': 3.226.0 - '@aws-sdk/middleware-sdk-sts': 3.226.0 - '@aws-sdk/middleware-serde': 3.226.0 - '@aws-sdk/middleware-signing': 3.226.0 - '@aws-sdk/middleware-stack': 3.226.0 - '@aws-sdk/middleware-user-agent': 3.226.0 - '@aws-sdk/node-config-provider': 3.226.0 - '@aws-sdk/node-http-handler': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/smithy-client': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/url-parser': 3.226.0 - '@aws-sdk/util-base64': 3.208.0 - '@aws-sdk/util-body-length-browser': 3.188.0 - '@aws-sdk/util-body-length-node': 3.208.0 - '@aws-sdk/util-defaults-mode-browser': 3.226.0 - '@aws-sdk/util-defaults-mode-node': 3.226.0 - '@aws-sdk/util-endpoints': 3.226.0 - '@aws-sdk/util-user-agent-browser': 3.226.0 - '@aws-sdk/util-user-agent-node': 3.226.0 - '@aws-sdk/util-utf8-browser': 3.188.0 - '@aws-sdk/util-utf8-node': 3.208.0 - fast-xml-parser: 4.0.11 - tslib: 2.4.1 -======= /@aws-sdk/client-sts@3.315.0: resolution: {integrity: sha512-e34plg6m0hScADIPiu5kCKoiJVXRLRiAuens+iwMse0oPUmrv41hdjgufwWGA/pcNkEGzMdVS88Z4khxB3LHBw==} engines: {node: '>=14.0.0'} @@ -567,56 +357,10 @@ packages: '@aws-sdk/util-utf8': 3.310.0 fast-xml-parser: 4.1.2 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/config-resolver/3.226.0: - resolution: {integrity: sha512-0UWXtfnTT0OtnRP8jJodc8V7xAnWSqsh4RCRyV5uu3Z2Tv+xyW91GKxO+gOXoUP0hHu0lvBM9lYiMJcJWZYLYw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/signature-v4': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-config-provider': 3.208.0 - '@aws-sdk/util-middleware': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/credential-provider-env/3.226.0: - resolution: {integrity: sha512-sd8uK1ojbXxaZXlthzw/VXZwCPUtU3PjObOfr3Evj7MPIM2IH8h29foOlggx939MdLQGboJf9gKvLlvKDWtJRA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/credential-provider-imds/3.226.0: - resolution: {integrity: sha512-//z/COQm2AjYFI1Lb0wKHTQSrvLFTyuKLFQGPJsKS7DPoxGOCKB7hmYerlbl01IDoCxTdyL//TyyPxbZEOQD5Q==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/node-config-provider': 3.226.0 - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/url-parser': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/credential-provider-ini/3.226.0: - resolution: {integrity: sha512-Sj7SGl53qmKkD7wvgU0MSTyj8ho6A3tKVbadTHljVz60jiauTEM97Z1DIai6U3oPFVteaKqx7npc8ozeK6mKNg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/credential-provider-env': 3.226.0 - '@aws-sdk/credential-provider-imds': 3.226.0 - '@aws-sdk/credential-provider-sso': 3.226.0 - '@aws-sdk/credential-provider-web-identity': 3.226.0 - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/shared-ini-file-loader': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 -======= /@aws-sdk/config-resolver@3.310.0: resolution: {integrity: sha512-8vsT+/50lOqfDxka9m/rRt6oxv1WuGZoP8oPMk0Dt+TxXMbAzf4+rejBgiB96wshI1k3gLokYRjSQZn+dDtT8g==} engines: {node: '>=14.0.0'} @@ -660,27 +404,10 @@ packages: '@aws-sdk/shared-ini-file-loader': 3.310.0 '@aws-sdk/types': 3.310.0 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/credential-provider-node/3.226.0: - resolution: {integrity: sha512-kuOeiVmlhSyMC1Eix0pqHmb4EmpbMHrTw+9ObZbQ2bRXy05Q9fLA6SVBcI01bI1KVh7Qqz9i8ojOY3A2zscjyA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/credential-provider-env': 3.226.0 - '@aws-sdk/credential-provider-imds': 3.226.0 - '@aws-sdk/credential-provider-ini': 3.226.0 - '@aws-sdk/credential-provider-process': 3.226.0 - '@aws-sdk/credential-provider-sso': 3.226.0 - '@aws-sdk/credential-provider-web-identity': 3.226.0 - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/shared-ini-file-loader': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 -======= /@aws-sdk/credential-provider-node@3.315.0: resolution: {integrity: sha512-OuzKAIg+xPAzBrb/Big5VKDpJmBhVR+N0Hfflrjj2BunQGWO7zxtkKFCz921MtP9ZunDV+UxzTpar8U5TAPtzA==} engines: {node: '>=14.0.0'} @@ -695,33 +422,10 @@ packages: '@aws-sdk/shared-ini-file-loader': 3.310.0 '@aws-sdk/types': 3.310.0 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/credential-provider-process/3.226.0: - resolution: {integrity: sha512-iUDMdnrTvbvaCFhWwqyXrhvQ9+ojPqPqXhwZtY1X/Qaz+73S9gXBPJHZaZb2Ke0yKE1Ql3bJbKvmmxC/qLQMng==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/shared-ini-file-loader': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/credential-provider-sso/3.226.0: - resolution: {integrity: sha512-QSBeyOIAus4/8u/DeAstE8w/zw+F7PQohdB8JFP/BPaCfc8uKue4UkqqvQWRfm4VSEnHeXt037MDopmCpd98Iw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/client-sso': 3.226.0 - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/shared-ini-file-loader': 3.226.0 - '@aws-sdk/token-providers': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 -======= /@aws-sdk/credential-provider-process@3.310.0: resolution: {integrity: sha512-h73sg6GPMUWC+3zMCbA1nZ2O03nNJt7G96JdmnantiXBwHpRKWW8nBTLzx5uhXn6hTuTaoQRP/P+oxQJKYdMmA==} engines: {node: '>=14.0.0'} @@ -742,362 +446,10 @@ packages: '@aws-sdk/token-providers': 3.315.0 '@aws-sdk/types': 3.310.0 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/credential-provider-web-identity/3.226.0: - resolution: {integrity: sha512-CCpv847rLB0SFOHz2igvUMFAzeT2fD3YnY4C8jltuJoEkn0ITn1Hlgt13nTJ5BUuvyti2mvyXZHmNzhMIMrIlw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/eventstream-codec/3.226.0: - resolution: {integrity: sha512-6uPtR8vSwz3fqoZk9hrb6qBYdp3PJ22+JxV5Wimdesvow4kJXSgDQXIxEkxbv6SxB9tNRB4uJHD84RetHEi15Q==} - dependencies: - '@aws-crypto/crc32': 2.0.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-hex-encoding': 3.201.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/eventstream-serde-browser/3.226.0: - resolution: {integrity: sha512-otYC5aZE9eJUqAlKpy8w0rPDQ1eKGvZPtgxWXmFYSO2lDVGfI1nBBNmdZ4MdHqNuQ7ucsKMQYF8BFJ65K2tYPA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/eventstream-serde-universal': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/eventstream-serde-config-resolver/3.226.0: - resolution: {integrity: sha512-A56Gypg+lyEfA5cna+EUH9XTrj0SvRG1gwNW7lrUzviN36SeA/LFTUIOEjxVML3Lowy+EPAcrSZ67h6aepoAig==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/eventstream-serde-node/3.226.0: - resolution: {integrity: sha512-KWLnKkKDzI9RNkiK6OiSYpG/XjZfue6Bsp/vRG+H5z3fbXdHv4X2+iW+Efu2Kvn7jsUyUv82TCl57DyJ/HKYhQ==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/eventstream-serde-universal': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/eventstream-serde-universal/3.226.0: - resolution: {integrity: sha512-Q8viYM1Sv90/yIUqyWNeG1GEvyVlAI3GIrInQcCMC+xT59jS+IKGy2y7ojCvSWXnhf5/HMXKcmG092QsqeKy0Q==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/eventstream-codec': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/fetch-http-handler/3.226.0: - resolution: {integrity: sha512-JewZPMNEBXfi1xVnRa7pVtK/zgZD8/lQ/YnD8pq79WuMa2cwyhDtr8oqCoqsPW+WJT5ScXoMtuHxN78l8eKWgg==} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/querystring-builder': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-base64': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/hash-blob-browser/3.226.0: - resolution: {integrity: sha512-5DCvWE6L4xGoViEHyjcPFuUe1G2EtNx8TqswWaoaKgyasP/yuRm4H99Ra7rqIrjCcSTAGD9NVsUQvVVw1bGt9w==} - dependencies: - '@aws-sdk/chunked-blob-reader': 3.188.0 - '@aws-sdk/chunked-blob-reader-native': 3.208.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/hash-node/3.226.0: - resolution: {integrity: sha512-MdlJhJ9/Espwd0+gUXdZRsHuostB2WxEVAszWxobP0FTT9PnicqnfK7ExmW+DUAc0ywxtEbR3e0UND65rlSTVw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-buffer-from': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/hash-stream-node/3.226.0: - resolution: {integrity: sha512-cgNTGlF8SdHaQXtjEmuLXz2U8SLM2JDKtIVPku/lHTMsUsEn+fuv2C+h1f/hvd4aNw5t1zggym7sO1/h/rv56Q==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/invalid-dependency/3.226.0: - resolution: {integrity: sha512-QXOYFmap8g9QzRjumcRCIo2GEZkdCwd7ePQW0OABWPhKHzlJ74vvBxywjU3s39EEBEluWXtZ7Iufg6GxZM4ifw==} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/is-array-buffer/3.201.0: - resolution: {integrity: sha512-UPez5qLh3dNgt0DYnPD/q0mVJY84rA17QE26hVNOW3fAji8W2wrwrxdacWOxyXvlxWsVRcKmr+lay1MDqpAMfg==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/md5-js/3.226.0: - resolution: {integrity: sha512-ENigJRNudqyh6xsch166SZ4gggHd3XzZJ8gkCU4CWPne04HcR3BkWSO774IuWooCHt8zkaEHKecPurRz6qR+Vw==} - dependencies: - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-utf8-browser': 3.188.0 - '@aws-sdk/util-utf8-node': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-bucket-endpoint/3.226.0: - resolution: {integrity: sha512-A1Vq5W2X7jgTfjqcKPmjoHohF0poP+9fxwL97fQMvzcwmjhtoCV3bLEpo6CGYx0pKPiSlRJXZkRwRPj2hDHDmA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-arn-parser': 3.208.0 - '@aws-sdk/util-config-provider': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-content-length/3.226.0: - resolution: {integrity: sha512-ksUzlHJN2JMuyavjA46a4sctvnrnITqt2tbGGWWrAuXY1mel2j+VbgnmJUiwHKUO6bTFBBeft5Vd1TSOb4JmiA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-endpoint/3.226.0: - resolution: {integrity: sha512-EvLFafjtUxTT0AC9p3aBQu1/fjhWdIeK58jIXaNFONfZ3F8QbEYUPuF/SqZvJM6cWfOO9qwYKkRDbCSTYhprIg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/middleware-serde': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/signature-v4': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/url-parser': 3.226.0 - '@aws-sdk/util-config-provider': 3.208.0 - '@aws-sdk/util-middleware': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-expect-continue/3.226.0: - resolution: {integrity: sha512-YxvQKTV/eA9P8AgW0hXOgj5Qa+TSnNFfyOkfeP089aP3f6p92b1cESf33TEOKsddive2mHT5LRCN6MuPcgWWrA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-flexible-checksums/3.226.0: - resolution: {integrity: sha512-8A9Ot9A7794UP5tMGl2MnfTW/UM/jYy1wRWF9YkR/hPIcPb7OmE0hmlwIQGzb/7grxpYw66ETKf0WeH/41YfeQ==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-crypto/crc32': 2.0.0 - '@aws-crypto/crc32c': 2.0.0 - '@aws-sdk/is-array-buffer': 3.201.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-host-header/3.226.0: - resolution: {integrity: sha512-haVkWVh6BUPwKgWwkL6sDvTkcZWvJjv8AgC8jiQuSl8GLZdzHTB8Qhi3IsfFta9HAuoLjxheWBE5Z/L0UrfhLA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-location-constraint/3.226.0: - resolution: {integrity: sha512-qHiYaBYPc2R37KxG2uqsUUwh4usrQMHfGkrpTUnx5d4rGzM3mC+muPsTpSHnAL63K2/yJOHQJFjss3GGwV4SSA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-logger/3.226.0: - resolution: {integrity: sha512-m9gtLrrYnpN6yckcQ09rV7ExWOLMuq8mMPF/K3DbL/YL0TuILu9i2T1W+JuxSX+K9FMG2HrLAKivE/kMLr55xA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-recursion-detection/3.226.0: - resolution: {integrity: sha512-mwRbdKEUeuNH5TEkyZ5FWxp6bL2UC1WbY+LDv6YjHxmSMKpAoOueEdtU34PqDOLrpXXxIGHDFmjeGeMfktyEcA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-retry/3.226.0: - resolution: {integrity: sha512-uMn4dSkv9Na2uvt6K3HgTnVrCRAlGv1MBAtUDLXONqUv1L/Z1fp3CkFkLKQHKylfBwBhe6dXfYEo87i8LZFoqg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/service-error-classification': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-middleware': 3.226.0 - tslib: 2.4.1 - uuid: 8.3.2 - dev: false - - /@aws-sdk/middleware-sdk-s3/3.226.0: - resolution: {integrity: sha512-sOFLFCnlN3kPgSI8C9mq/X3o6Oy4lIk4jz5kuB11zfvsm+YlIlxL4s06FkYqHsGDBH9hmh8dEuOxQ+YktyyeoA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/middleware-bucket-endpoint': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-arn-parser': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-sdk-sts/3.226.0: - resolution: {integrity: sha512-NN9T/qoSD1kZvAT+VLny3NnlqgylYQcsgV3rvi/8lYzw/G/2s8VS6sm/VTWGGZhx08wZRv20MWzYu3bftcyqUg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/middleware-signing': 3.226.0 - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/signature-v4': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-serde/3.226.0: - resolution: {integrity: sha512-nPuOOAkSfx9TxzdKFx0X2bDlinOxGrqD7iof926K/AEflxGD1DBdcaDdjlYlPDW2CVE8LV/rAgbYuLxh/E/1VA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-signing/3.226.0: - resolution: {integrity: sha512-E6HmtPcl+IjYDDzi1xI2HpCbBq2avNWcjvCriMZWuTAtRVpnA6XDDGW5GY85IfS3A8G8vuWqEVPr8JcYUcjfew==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/signature-v4': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-middleware': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-ssec/3.226.0: - resolution: {integrity: sha512-DR97oWoLHiMdaUP/wu99HtzG7/ijvCrjZGDH37WBO1rxFtEti6L7T09wgHzwxMN8gtL8FJA7dU8IrffGSC9VmA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-stack/3.226.0: - resolution: {integrity: sha512-85wF29LvPvpoed60fZGDYLwv1Zpd/cM0C22WSSFPw1SSJeqO4gtFYyCg2squfT3KI6kF43IIkOCJ+L7GtryPug==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/middleware-user-agent/3.226.0: - resolution: {integrity: sha512-N1WnfzCW1Y5yWhVAphf8OPGTe8Df3vmV7/LdsoQfmpkCZgLZeK2o0xITkUQhRj1mbw7yp8tVFLFV3R2lMurdAQ==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/node-config-provider/3.226.0: - resolution: {integrity: sha512-B8lQDqiRk7X5izFEUMXmi8CZLOKCTWQJU9HQf3ako+sF0gexo4nHN3jhoRWyLtcgC5S3on/2jxpAcqtm7kuY3w==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/shared-ini-file-loader': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/node-http-handler/3.226.0: - resolution: {integrity: sha512-xQCddnZNMiPmjr3W7HYM+f5ir4VfxgJh37eqZwX6EZmyItFpNNeVzKUgA920ka1VPz/ZUYB+2OFGiX3LCLkkaA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/abort-controller': 3.226.0 - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/querystring-builder': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/property-provider/3.226.0: - resolution: {integrity: sha512-TsljjG+Sg0LmdgfiAlWohluWKnxB/k8xenjeozZfzOr5bHmNHtdbWv6BtNvD/R83hw7SFXxbJHlD5H4u9p2NFg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/protocol-http/3.226.0: - resolution: {integrity: sha512-zWkVqiTA9RXL6y0hhfZc9bcU4DX2NI6Hw9IhQmSPeM59mdbPjJlY4bLlMr5YxywqO3yQ/ylNoAfrEzrDjlOSRg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/querystring-builder/3.226.0: - resolution: {integrity: sha512-LVurypuNeotO4lmirKXRC4NYrZRAyMJXuwO0f2a5ZAUJCjauwYrifKue6yCfU7bls7gut7nfcR6B99WBYpHs3g==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-uri-escape': 3.201.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/querystring-parser/3.226.0: - resolution: {integrity: sha512-FzB+VrQ47KAFxiPt2YXrKZ8AOLZQqGTLCKHzx4bjxGmwgsjV8yIbtJiJhZLMcUQV4LtGeIY9ixIqQhGvnZHE4A==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/service-error-classification/3.226.0: - resolution: {integrity: sha512-9R01dBpE8JILe2CTft7YN2tMufT2mMWMTqxmHwPSmOpsxHTj8hEII7GTfvpb95ThHwW7XMNhg7pbHLbrTJZCVA==} - engines: {node: '>=14.0.0'} - dev: false - - /@aws-sdk/shared-ini-file-loader/3.226.0: - resolution: {integrity: sha512-661VQefsARxVyyV2FX9V61V+nNgImk7aN2hYlFKla6BCwZfMng+dEtD0xVGyg1PfRw0qvEv5LQyxMVgHcUSevA==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/signature-v4-multi-region/3.226.0: - resolution: {integrity: sha512-QHxNuf9ynK208v7Y3imdsa3Cz8ynYV7ZOf3sBJdItuEtHN6uy/KxaOrtvpF8I5Hyn48Hc8z5miTSMujFKT7GEw==} -======= /@aws-sdk/credential-provider-web-identity@3.310.0: resolution: {integrity: sha512-H4SzuZXILNhK6/IR1uVvsUDZvzc051hem7GLyYghBCu8mU+tq28YhKE8MfSroi6eL2e5Vujloij1OM2EQQkPkw==} engines: {node: '>=14.0.0'} @@ -1443,7 +795,6 @@ packages: /@aws-sdk/signature-v4-multi-region@3.310.0: resolution: {integrity: sha512-q8W+RIomTS/q85Ntgks/CoDElwqkC9+4OCicee5YznNHjQ4gtNWhUkYIyIRWRmXa/qx/AUreW9DM8FAecCOdng==} ->>>>>>> origin/mac-repo-maker engines: {node: '>=14.0.0'} peerDependencies: '@aws-sdk/signature-v4-crt': ^3.118.0 @@ -1451,45 +802,6 @@ packages: '@aws-sdk/signature-v4-crt': optional: true dependencies: -<<<<<<< HEAD - '@aws-sdk/protocol-http': 3.226.0 - '@aws-sdk/signature-v4': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-arn-parser': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/signature-v4/3.226.0: - resolution: {integrity: sha512-/R5q5agdPd7HJB68XMzpxrNPk158EHUvkFkuRu5Qf3kkkHebEzWEBlWoVpUe6ss4rP9Tqcue6xPuaftEmhjpYw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/is-array-buffer': 3.201.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-hex-encoding': 3.201.0 - '@aws-sdk/util-middleware': 3.226.0 - '@aws-sdk/util-uri-escape': 3.201.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/smithy-client/3.226.0: - resolution: {integrity: sha512-BWr1FhWSUhkSBp0TLzliD5AQBjA2Jmo9FlOOt+cBwd9BKkSGlGj+HgATYJ83Sjjg2+J6qvEZBxB78LKVHhorBw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/middleware-stack': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/token-providers/3.226.0: - resolution: {integrity: sha512-3ouRt2i3ve8ivg54PxPhtOTcipzf6BoQsMw0EiO23yYKujhyeFH2IkxV4EYC687xFrUjheqJf8FWU/DD8EQ/ow==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/client-sso-oidc': 3.226.0 - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/shared-ini-file-loader': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 -======= '@aws-sdk/protocol-http': 3.310.0 '@aws-sdk/signature-v4': 3.310.0 '@aws-sdk/types': 3.310.0 @@ -1527,160 +839,10 @@ packages: '@aws-sdk/shared-ini-file-loader': 3.310.0 '@aws-sdk/types': 3.310.0 tslib: 2.5.0 ->>>>>>> origin/mac-repo-maker transitivePeerDependencies: - aws-crt dev: false -<<<<<<< HEAD - /@aws-sdk/types/3.226.0: - resolution: {integrity: sha512-MmmNHrWeO4man7wpOwrAhXlevqtOV9ZLcH4RhnG5LmRce0RFOApx24HoKENfFCcOyCm5LQBlsXCqi0dZWDWU0A==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/url-parser/3.226.0: - resolution: {integrity: sha512-p5RLE0QWyP0OcTOLmFcLdVgUcUEzmEfmdrnOxyNzomcYb0p3vUagA5zfa1HVK2azsQJFBv28GfvMnba9bGhObg==} - dependencies: - '@aws-sdk/querystring-parser': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-arn-parser/3.208.0: - resolution: {integrity: sha512-QV4af+kscova9dv4VuHOgH8wEr/IIYHDGcnyVtkUEqahCejWr1Kuk+SBK0xMwnZY5LSycOtQ8aeqHOn9qOjZtA==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-base64/3.208.0: - resolution: {integrity: sha512-PQniZph5A6N7uuEOQi+1hnMz/FSOK/8kMFyFO+4DgA1dZ5pcKcn5wiFwHkcTb/BsgVqQa3Jx0VHNnvhlS8JyTg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/util-buffer-from': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-body-length-browser/3.188.0: - resolution: {integrity: sha512-8VpnwFWXhnZ/iRSl9mTf+VKOX9wDE8QtN4bj9pBfxwf90H1X7E8T6NkiZD3k+HubYf2J94e7DbeHs7fuCPW5Qg==} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-body-length-node/3.208.0: - resolution: {integrity: sha512-3zj50e5g7t/MQf53SsuuSf0hEELzMtD8RX8C76f12OSRo2Bca4FLLYHe0TZbxcfQHom8/hOaeZEyTyMogMglqg==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-buffer-from/3.208.0: - resolution: {integrity: sha512-7L0XUixNEFcLUGPeBF35enCvB9Xl+K6SQsmbrPk1P3mlV9mguWSDQqbOBwY1Ir0OVbD6H/ZOQU7hI/9RtRI0Zw==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/is-array-buffer': 3.201.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-config-provider/3.208.0: - resolution: {integrity: sha512-DSRqwrERUsT34ug+anlMBIFooBEGwM8GejC7q00Y/9IPrQy50KnG5PW2NiTjuLKNi7pdEOlwTSEocJE15eDZIg==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-defaults-mode-browser/3.226.0: - resolution: {integrity: sha512-chLx+6AeMSjuPsCVbI1B4Pg3jftjjcsuTsJucjo0DKBb1VSWqPCitmOILQVvKiA2Km8TSs3VcbUuOCyDExkzAg==} - engines: {node: '>= 10.0.0'} - dependencies: - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/types': 3.226.0 - bowser: 2.11.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-defaults-mode-node/3.226.0: - resolution: {integrity: sha512-Zr0AEj6g8gqiOhr31Pa2tdOFdPQciaAUCg3Uj/eH0znNBdVoptCj67oCW/I5v4pY4ZLZtGhr3uuoxDJH2MB3yg==} - engines: {node: '>= 10.0.0'} - dependencies: - '@aws-sdk/config-resolver': 3.226.0 - '@aws-sdk/credential-provider-imds': 3.226.0 - '@aws-sdk/node-config-provider': 3.226.0 - '@aws-sdk/property-provider': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-endpoints/3.226.0: - resolution: {integrity: sha512-iqOkac/zLmyPBUJd7SLN0PeZMkOmlGgD5PHmmekTClOkce2eUjK9SNX1PzL73aXPoPTyhg9QGLH8uEZEQ8YUzg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-hex-encoding/3.201.0: - resolution: {integrity: sha512-7t1vR1pVxKx0motd3X9rI3m/xNp78p3sHtP5yo4NP4ARpxyJ0fokBomY8ScaH2D/B+U5o9ARxldJUdMqyBlJcA==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-locate-window/3.208.0: - resolution: {integrity: sha512-iua1A2+P7JJEDHVgvXrRJSvsnzG7stYSGQnBVphIUlemwl6nN5D+QrgbjECtrbxRz8asYFHSzhdhECqN+tFiBg==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-middleware/3.226.0: - resolution: {integrity: sha512-B96CQnwX4gRvQdaQkdUtqvDPkrptV5+va6FVeJOocU/DbSYMAScLxtR3peMS8cnlOT6nL1Eoa42OI9AfZz1VwQ==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-stream-browser/3.226.0: - resolution: {integrity: sha512-ZvjlA1ySaLd0DqUWTKmL7LsxfPhroAONpzsinaHmw9aZVL40s2cADU9eWgBdHTuAOeFklL7NP0cc6UiTFHKe8g==} - dependencies: - '@aws-sdk/fetch-http-handler': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-base64': 3.208.0 - '@aws-sdk/util-hex-encoding': 3.201.0 - '@aws-sdk/util-utf8-browser': 3.188.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-stream-node/3.226.0: - resolution: {integrity: sha512-HADXiIgDGoXcCLSKuPnjCLENf0iC0lzqqnymZu9H2FoACZhJB7DvJ9LnP51Pvw9lfCu+yvLzbMqSPdbXtMbRWg==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/node-http-handler': 3.226.0 - '@aws-sdk/types': 3.226.0 - '@aws-sdk/util-buffer-from': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-uri-escape/3.201.0: - resolution: {integrity: sha512-TeTWbGx4LU2c5rx0obHeDFeO9HvwYwQtMh1yniBz00pQb6Qt6YVOETVQikRZ+XRQwEyCg/dA375UplIpiy54mA==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-user-agent-browser/3.226.0: - resolution: {integrity: sha512-PhBIu2h6sPJPcv2I7ELfFizdl5pNiL4LfxrasMCYXQkJvVnoXztHA1x+CQbXIdtZOIlpjC+6BjDcE0uhnpvfcA==} - dependencies: - '@aws-sdk/types': 3.226.0 - bowser: 2.11.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-user-agent-node/3.226.0: - resolution: {integrity: sha512-othPc5Dz/pkYkxH+nZPhc1Al0HndQT8zHD4e9h+EZ+8lkd8n+IsnLfTS/mSJWrfiC6UlNRVw55cItstmJyMe/A==} -======= /@aws-sdk/types@3.310.0: resolution: {integrity: sha512-j8eamQJ7YcIhw7fneUfs8LYl3t01k4uHi4ZDmNRgtbmbmTTG3FZc2MotStZnp3nZB6vLiPF1o5aoJxWVvkzS6A==} engines: {node: '>=14.0.0'} @@ -1836,7 +998,6 @@ packages: /@aws-sdk/util-user-agent-node@3.310.0: resolution: {integrity: sha512-Ra3pEl+Gn2BpeE7KiDGpi4zj7WJXZA5GXnGo3mjbi9+Y3zrbuhJAbdZO3mO/o7xDgMC6ph4xCTbaSGzU6b6EDg==} ->>>>>>> origin/mac-repo-maker engines: {node: '>=14.0.0'} peerDependencies: aws-crt: '>=1.0.0' @@ -1844,44 +1005,6 @@ packages: aws-crt: optional: true dependencies: -<<<<<<< HEAD - '@aws-sdk/node-config-provider': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-utf8-browser/3.188.0: - resolution: {integrity: sha512-jt627x0+jE+Ydr9NwkFstg3cUvgWh56qdaqAMDsqgRlKD21md/6G226z/Qxl7lb1VEW2LlmCx43ai/37Qwcj2Q==} - dependencies: - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-utf8-node/3.208.0: - resolution: {integrity: sha512-jKY87Acv0yWBdFxx6bveagy5FYjz+dtV8IPT7ay1E2WPWH1czoIdMAkc8tSInK31T6CRnHWkLZ1qYwCbgRfERQ==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/util-buffer-from': 3.208.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/util-waiter/3.226.0: - resolution: {integrity: sha512-qYQMRxnu5k8qQihJXoIWMkBOj0+XkHHj/drLdbRnwL6ni6NcG8++cs9M3DSjIcxmxgF/7SLpDjn1H3sC7cYo4g==} - engines: {node: '>=14.0.0'} - dependencies: - '@aws-sdk/abort-controller': 3.226.0 - '@aws-sdk/types': 3.226.0 - tslib: 2.4.1 - dev: false - - /@aws-sdk/xml-builder/3.201.0: - resolution: {integrity: sha512-brRdB1wwMgjWEnOQsv7zSUhIQuh7DEicrfslAqHop4S4FtSI3GQAShpQqgOpMTNFYcpaWKmE/Y1MJmNY7xLCnw==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.4.1 - dev: false - - /@babel/code-frame/7.18.6: -======= '@aws-sdk/node-config-provider': 3.310.0 '@aws-sdk/types': 3.310.0 tslib: 2.5.0 @@ -1918,7 +1041,6 @@ packages: dev: false /@babel/code-frame@7.18.6: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} engines: {node: '>=6.9.0'} dependencies: @@ -2517,13 +1639,8 @@ packages: '@jest/schemas': 29.0.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 -<<<<<<< HEAD - '@types/node': 18.11.10 - '@types/yargs': 17.0.16 -======= '@types/node': 18.13.0 '@types/yargs': 17.0.20 ->>>>>>> origin/mac-repo-maker chalk: 4.1.2 dev: true @@ -2723,13 +1840,8 @@ packages: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true -<<<<<<< HEAD - /@types/yargs/17.0.16: - resolution: {integrity: sha512-Mh3OP0oh8X7O7F9m5AplC+XHYLBWuPKNkGVD3gIZFLFebBnuFI2Nz5Sf8WLvwGxECJ8YjifQvFdh79ubODkdug==} -======= /@types/yargs@17.0.20: resolution: {integrity: sha512-eknWrTHofQuPk2iuqDm1waA7V6xPlbgBoaaXEgYkClhLOnB0TtbW+srJaOToAgawPxPlHQzwypFA2bhZaUGP5A==} ->>>>>>> origin/mac-repo-maker dependencies: '@types/yargs-parser': 21.0.0 dev: true @@ -3053,13 +2165,6 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} -<<<<<<< HEAD - - /bowser/2.11.0: - resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} - dev: false -======= ->>>>>>> origin/mac-repo-maker /bowser@2.11.0: resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} @@ -3188,11 +2293,7 @@ packages: string-width: 5.1.2 dev: true -<<<<<<< HEAD - /cliui/7.0.4: -======= /cliui@7.0.4: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} dependencies: string-width: 4.2.3 @@ -3200,11 +2301,7 @@ packages: wrap-ansi: 7.0.0 dev: false -<<<<<<< HEAD - /cliui/8.0.1: -======= /cliui@8.0.1: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} dependencies: @@ -3588,23 +2685,14 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true -<<<<<<< HEAD - /fast-xml-parser/4.0.11: - resolution: {integrity: sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==} -======= /fast-xml-parser@4.1.2: resolution: {integrity: sha512-CDYeykkle1LiA/uqQyNwYpFbyF6Axec6YapmpUP+/RHWIoR1zKjocdvNaTsxCxZzQ6v9MLXaSYm9Qq0thv0DHg==} ->>>>>>> origin/mac-repo-maker hasBin: true dependencies: strnum: 1.0.5 dev: false -<<<<<<< HEAD - /fastq/1.14.0: -======= /fastq@1.14.0: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==} dependencies: reusify: 1.0.4 @@ -4536,6 +3624,7 @@ packages: engines: {node: '>=10'} dependencies: yallist: 4.0.0 + dev: true /make-dir@3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} @@ -4581,21 +3670,13 @@ packages: engines: {node: '>=12'} dev: true -<<<<<<< HEAD - /minimatch/3.0.4: -======= /minimatch@3.0.4: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} dependencies: brace-expansion: 1.1.11 dev: false -<<<<<<< HEAD - /minimatch/3.1.2: -======= /minimatch@3.1.2: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 @@ -4958,19 +4039,11 @@ packages: tslib: 2.5.0 dev: true -<<<<<<< HEAD - /s3-groundskeeper/0.2.2: - resolution: {integrity: sha512-62ntqZMhd7v85yWM+YXKsVLJdf6us6Lc+L52Ia91kRpZMgb/E9hjeXKsIoydgN9XoALoUEL+/Rp37LUrKOOl4Q==} - hasBin: true - dependencies: - '@aws-sdk/client-s3': 3.226.0 -======= /s3-groundskeeper@0.3.1: resolution: {integrity: sha512-NOATkeUjia83Dks5rTafwRauqRP3/UYXe/7psX6EXs320fKmJHKfzRNcBsVdeRJwQvE3Vc+0xJX0KkyZ5qpJpg==} hasBin: true dependencies: '@aws-sdk/client-s3': 3.315.0 ->>>>>>> origin/mac-repo-maker minimatch: 3.0.4 yargs: 16.2.0 transitivePeerDependencies: @@ -4978,11 +4051,7 @@ packages: - aws-crt dev: false -<<<<<<< HEAD - /semver/6.3.0: -======= /semver@6.3.0: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true dev: true @@ -4993,6 +4062,7 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: true /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -5131,19 +4201,11 @@ packages: engines: {node: '>=8'} dev: true -<<<<<<< HEAD - /strnum/1.0.5: - resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} - dev: false - - /supports-color/5.5.0: -======= /strnum@1.0.5: resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} dev: false /supports-color@5.5.0: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} dependencies: @@ -5285,13 +4347,8 @@ packages: /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} -<<<<<<< HEAD - /tslib/2.4.1: - resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} -======= /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} ->>>>>>> origin/mac-repo-maker /tsutils@3.21.0(typescript@5.0.4): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -5353,20 +4410,12 @@ packages: punycode: 2.1.1 dev: true -<<<<<<< HEAD - /uuid/8.3.2: -======= /uuid@8.3.2: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} hasBin: true dev: false -<<<<<<< HEAD - /v8-compile-cache-lib/3.0.1: -======= /v8-compile-cache-lib@3.0.1: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true @@ -5450,37 +4499,14 @@ packages: engines: {node: '>= 14'} dev: true -<<<<<<< HEAD - /yargs-parser/20.2.9: -======= /yargs-parser@20.2.9: ->>>>>>> origin/mac-repo-maker resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} dev: false -<<<<<<< HEAD - /yargs-parser/21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - /yargs/16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} - dependencies: - cliui: 7.0.4 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.9 - dev: false -======= /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} ->>>>>>> origin/mac-repo-maker /yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} diff --git a/src/artifactory-utils.ts b/src/artifactory-utils.ts deleted file mode 100644 index 5d58b81..0000000 --- a/src/artifactory-utils.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as http from './http.js'; - -import { ArtifactoryClient, createArtifactoryClient } from 's3-groundskeeper'; -import { configuration } from './config.js'; -import type stream from 'stream'; - -let artifactoryHelperInstance: ArtifactoryHelper | undefined = undefined; - -export interface BuildsList { - buildsNumbers: { - uri: string, - started: string - }[] -} - -export interface BuildInfo { - buildInfo: { - modules: { - artifacts: Artifact[] - }[], - properties: { - 'buildInfo.env.CI_RUNNER_TAGS': string, - 'buildInfo.env.VERSION': string - } - } -} - -export interface Artifact { - type : string, - sha1 : string, - sha256 : string, - md5 : string, - name : string -} - -export interface ArtifactoryHelperConfig { - host: string; - user: string; - apiKey: string; - project: string; -} - -export class ArtifactoryHelper { - private artifactoryClient?: ArtifactoryClient; - private buildsList?: BuildsList; - private project: string; - - constructor(config: ArtifactoryHelperConfig) { - this.project = config.project; - this.artifactoryClient = createArtifactoryClient({ protocol: 'https', host: config.host, apiKey: config.apiKey, user: config.user }); - } - - public async init(): Promise { - if (!this.artifactoryClient) { - throw new Error('Artifactory client does not exists'); - } - - const apiEndpoint = this.artifactoryClient.resolveUri('api/build'); - const buildsEndpoint = `${apiEndpoint}/${this.project}`; - - const allBuilds = await http.get(buildsEndpoint); - this.buildsList = JSON.parse(allBuilds.toString()) as BuildsList; - } - - public client(): ArtifactoryClient { - if (!this.artifactoryClient) { - throw new Error('Artifactory client does not exists'); - } - - return this.artifactoryClient; - } - - public macOsArtifactsByBuildNumber(buildNumber: string): Promise { - return this.artifactsByBuildNumber(buildNumber, 'mac-shell'); - } - - public async windowsArtifactsByBuildNumber(buildNumber: string): Promise { - return (await this.artifactsByBuildNumber(buildNumber, 'windows, code-signing')).filter(value => value.name.endsWith('.msix')); - } - - public async debArtifactsByBuildNumber(buildNumber: string): Promise { - return (await this.artifactsByBuildNumber(buildNumber, 'tvd-runner')).filter(value => value.name.endsWith('.deb')); - } - - private async artifactsByBuildNumber(buildNumber: string, osKey: string): Promise { - const buildInfo = await this.buildInfoByNumber(buildNumber, osKey); - - if (buildInfo.buildInfo.modules.length !== 1) { - throw new Error('Build must contain only one module'); - } - - const firstModule = buildInfo.buildInfo.modules[0]; - - if (!firstModule) { - throw new Error('Build must contain only one module'); - } - - return firstModule.artifacts; - } - - private async buildInfoByNumber(buildNumber: string, osKey: string): Promise { - if (!this.artifactoryClient) { - throw new Error('Artifactory client does not exists'); - } - - const apiEndpoint = this.artifactoryClient?.resolveUri('api/build'); - const buildsEndpoint = `${apiEndpoint}/${this.project}`; - - const buildTimes = (buildUri: string): Date[] => { - const times: Date[] = []; - - this.buildsList?.buildsNumbers.forEach(build => { - if (build.uri === `/${buildUri}`) { - times.push(new Date(build.started)); - } - }); - - return times; - }; - - const buildInfoResult: Promise[] = []; - - for (const value of buildTimes(buildNumber)) { - const buildInfoEndpoint = `${buildsEndpoint}/${buildNumber}?started=${value.toISOString()}`; - buildInfoResult.push(http.get(buildInfoEndpoint)); - } - - const result = (await Promise.all(buildInfoResult)); - - for (const buildInfo of result) { - const parsedInfo = JSON.parse(buildInfo.toString()) as BuildInfo; - if (parsedInfo.buildInfo.properties['buildInfo.env.CI_RUNNER_TAGS'] === osKey) { - return parsedInfo; - } - } - - throw new Error(`No build with build number: ${buildNumber} and osKey: ${osKey} found`); - } -} - -export function artifactoryHelper(): ArtifactoryHelper { - if (!artifactoryHelperInstance) { - const host = configuration().artifactoryHost; - const user = configuration().artifactoryUser; - const apiKey = configuration().artifactoryApiKey; - const project = configuration().artifactoryProjectKey; - - if (!host) { - throw new Error('Artifactory host must be specified'); - } - - if (!user) { - throw new Error('Artifactory user must be specified'); - } - - if (!apiKey) { - throw new Error('Artifactory API key must be specified'); - } - - if (!project) { - throw new Error('Artifactory project key must be specified'); - } - - artifactoryHelperInstance = new ArtifactoryHelper({ host, user, apiKey, project }); - } - - return artifactoryHelperInstance; -} diff --git a/src/cli.ts b/src/cli.ts deleted file mode 100644 index 1159829..0000000 --- a/src/cli.ts +++ /dev/null @@ -1,42 +0,0 @@ -import yargs from 'yargs'; - -type CliType = Awaited>; -let cliInstance: CliType | undefined = undefined; - -const yargsParsePromise = yargs(process.argv.slice(2)) - .option('artifactory-host', { description: 'JFrog Artifactory host. Alternale env:ARTIFACTORY_HOST', group: 'JFrog Artifactory:', string: true }) - .option('artifactory-user', { description: 'JFrog Artifactory username. Alternale env:ARTIFACTORY_USER', group: 'JFrog Artifactory:', string: true }) - .option('artifactory-api-key', { description: 'JFrog Artifactory ApiKey. Alternale env:ARTIFACTORY_API_KEY', group: 'JFrog Artifactory:', string: true }) - .option('artifactory-project-key', { description: 'JFrog Artifactory Project key.', group: 'JFrog Artifactory:', string: true }) - .option('s3-access-key-id', { description: 'Amazon S3 access key id. Alternale env:S3_ACCESS_KEY_ID', group: 'AWS S3:', string: true }) - .option('s3-secret-access-key', { description: 'Amazon S3 secret access key. Alternale env:S3_SECRET_ACCESS_KEY', group: 'AWS S3:', string: true }) - .option('s3-region', { description: 'Amazon S3 region. Alternale env:S3_REGION', group: 'AWS S3:', string: true }) - .option('s3-bucket', { description: 'Amazon S3 bucket. Alternale env:S3_BUCKET', group: 'AWS S3:', string: true }) - .option('gpg-key-name', { description: 'Signing GPG key name. Alternale env:GPG_KEY_NAME', group: 'Linux specific:', string: true }) - .command('plan [source-dir]', 'Prepare repositories for deploy', yargs => { - yargs.positional('repo-out', { describe: 'Outup dir wich will contain prepeared repository', type: 'string', default: 'out' }) - .positional('source-dir', { describe: 'Source dir wich contains releases description', type: 'string' }); - }) - .command('apply ', 'Deploy repositories', yargs => { - yargs.positional('repo-dir', { describe: 'Source dir wich contains repository prepeared before. Only for S3 deploying', type: 'string' }); - }); - -export async function initCli(): Promise { - if (cliInstance) { - throw new Error('CLI already initialized'); - } - - const tmp = await yargsParsePromise.parse(); - - if (!cliInstance) { - cliInstance = tmp; - } -} - -export function cli(): CliType { - if (!cliInstance) { - throw new Error('CLI must be initialized before use'); - } - - return cliInstance; -} diff --git a/src/config.ts b/src/config.ts deleted file mode 100644 index 631682f..0000000 --- a/src/config.ts +++ /dev/null @@ -1,78 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { pathToFileURL } from 'url'; - -import { cli } from './cli.js'; -import type { MsixS3Config } from './windows-repo-builder.js'; - -let configurationInstance: Config | undefined = undefined; - -type ExhaustConfig = MsixS3Config; - -class Config { - artifactoryHost: string | undefined; - artifactoryUser: string | undefined; - artifactoryApiKey: string | undefined; - artifactoryProjectKey: string | undefined; - s3AccessKeyId: string | undefined; - s3SecretAccessKey: string | undefined; - s3Region: string | undefined; - s3Bucket: string | undefined; - gpgKeyName: string | undefined; - exhaust: ExhaustConfig | undefined; - - constructor() { - const ARTIFACTORY_HOST = 'ARTIFACTORY_HOST'; - const ARTIFACTORY_USER = 'ARTIFACTORY_USER'; - const ARTIFACTORY_API_KEY = 'ARTIFACTORY_API_KEY'; - const S3_ACCESS_KEY_ID = 'S3_ACCESS_KEY_ID'; - const S3_SECRET_ACCESS_KEY = 'S3_SECRET_ACCESS_KEY'; - const S3_REGION = 'S3_REGION'; - const S3_BUCKET = 'S3_BUCKET'; - const GPG_KEY_NAME = 'GPG_KEY_NAME'; - - this.artifactoryHost = envToString(ARTIFACTORY_HOST) ?? cli().artifactoryHost; - this.artifactoryUser = envToString(ARTIFACTORY_USER) ?? cli().artifactoryUser; - this.artifactoryApiKey = envToString(ARTIFACTORY_API_KEY) ?? cli().artifactoryApiKey; - this.artifactoryProjectKey = cli().artifactoryProjectKey; - this.s3AccessKeyId = envToString(S3_ACCESS_KEY_ID) ?? cli().s3AccessKeyId; - this.s3SecretAccessKey = envToString(S3_SECRET_ACCESS_KEY) ?? cli().s3SecretAccessKey; - this.s3Region = envToString(S3_REGION) ?? cli().s3Region; - this.s3Bucket = envToString(S3_BUCKET) ?? cli().s3Bucket; - this.gpgKeyName = envToString(GPG_KEY_NAME) ?? cli().gpgKeyName; - } - - async init(): Promise { - const resolvedPath = path.resolve(process.cwd(), 'jewel-case.config.mjs'); - if (resolvedPath && fs.existsSync(resolvedPath)) { - this.exhaust = (await import(pathToFileURL(resolvedPath).toString())).default as ExhaustConfig; - - return; - } - - throw new Error('jewel-case.config.mjs not found'); - } -} - -function envToString(envName: string): string | undefined { - const value = process.env[envName]; - - return value; -} - -export function initConfiguration(): Promise { - if (configurationInstance) { - throw new Error('Configuration already initialized'); - } - - configurationInstance = new Config(); - return configurationInstance.init(); -} - -export function configuration(): Config { - if (!configurationInstance) { - throw new Error('Configuration must be initialized before use'); - } - - return configurationInstance; -} diff --git a/src/http.ts b/src/http.ts deleted file mode 100644 index 762b8ac..0000000 --- a/src/http.ts +++ /dev/null @@ -1,87 +0,0 @@ -import * as https from 'https'; - -import type * as stream from 'stream'; -import type { IncomingMessage } from 'http'; - -export interface RequestBody { - content: string | Buffer; - contentType?: string; -} - -export interface RequestData { - headers?: Record; - body?: RequestBody; - redirectHandler?: (url: string) => string | undefined; -} - -export function requestStream(url: string, method: string, requestData?: RequestData): Promise { - return new Promise((resolve, reject) => { - try { - const req = https.request(url, { method }); - - req - .on('response', (incomingMessage: IncomingMessage) => { - if (incomingMessage.statusCode !== 200) { - const stCode = incomingMessage.statusCode ?? 'NO_CODE'; - const stMessage = incomingMessage.statusMessage ?? 'NO_MESSAGE'; - const message = `[${method} ${url}]:${stCode}/${stMessage}`; - reject(new Error(message)); - return; - } - - resolve(incomingMessage); - }) - .on('error', (err: Error) => { - const errno = (err as {errno?: string}).errno ?? ''; - if (errno === 'ETIMEDOUT') { - reject(new Error(`Request (${url}) timeout.`)); - } else { - reject(err); - } - }); - - if (requestData?.headers) { - for (const key of Object.getOwnPropertyNames(requestData.headers)) { - const value = requestData.headers[key]; - - if (value) { - req.setHeader(key, value); - } - } - } - - if (requestData?.body) { - if (requestData.body.contentType) { - req.setHeader('Content-Type', requestData.body.contentType); - } - req.write(requestData.body.content); - } - - req.end(); - } catch (err) { - reject(err); - } - }); -} - - -export async function request(url: string, method: string, requestData?: RequestData): Promise { - const responseStream = await requestStream(url, method, requestData); - - let buffer: Buffer | undefined = undefined; - - for await (const item of responseStream) { - const chunk = item as Buffer; - buffer = (typeof buffer === 'undefined') ? chunk : Buffer.concat([buffer, chunk]); - } - - return buffer ? buffer : Buffer.from(''); -} - -export function get(url: string, opt: {stream: boolean} = { stream: false }): Promise { - return opt.stream ? requestStream(url, 'GET', undefined) : request(url, 'GET', undefined); -} - -export function post(url: string, requestData?: RequestData): Promise { - return request(url, 'POST', requestData); -} diff --git a/src/index.mts b/src/index.mts index e2929f8..0673664 100644 --- a/src/index.mts +++ b/src/index.mts @@ -2,12 +2,6 @@ import type { Config } from './config.mjs'; export type { Config }; export type { Artifact, ArtifactProvider } from './artifact-provider.mjs'; export type { ProviderType, ArtifactProviderConfig } from './artifact-provider-config.mjs'; -export { - type DebDescriptor, - type DebRepo, - type Config as DebBuilderConfig, - DebBuilder, -} from './deb/deb-builder.mjs'; export { default as JfrogArtifactProvider } from './jfrog/artifact-provider.mjs'; export { createMetapointerFile as createS3MetapointerFile } from './s3-metapointer.mjs'; diff --git a/src/jewel-case.ts b/src/jewel-case.ts deleted file mode 100644 index b8e75fd..0000000 --- a/src/jewel-case.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Repo, RepoBuilder, scanSourceDir } from './repo-builder.js'; - -import { artifactoryHelper } from './artifactory-utils.js'; -import { configuration } from './config.js'; -import { WindowsRepoBuilder } from './windows-repo-builder.js'; - -export async function plan(outDir: string, sourceDir: string): Promise { - await artifactoryHelper().init(); - const repo = await scanSourceDir(sourceDir); - const builders = createBuilders(repo, outDir); - - const repoBuildResilts: Promise[] = []; - builders.forEach(builder => { - repoBuildResilts.push(builder.build()); - }); - - await Promise.all(repoBuildResilts); -} - -export function apply(repoDir?: string): void { - console.log(repoDir); -} - -function createBuilders(repo: Repo, outDir: string): RepoBuilder[] { - const builders: RepoBuilder[] = []; - const hasMsixS3 = Boolean(configuration().exhaust?.msixS3); - - if (hasMsixS3) { - builders.push(new WindowsRepoBuilder(artifactoryHelper(), repo, outDir)); - } - - return builders; -} diff --git a/src/mac/mac-builder.mts b/src/mac/mac-builder.mts index a365bd4..d1e8c8b 100644 --- a/src/mac/mac-builder.mts +++ b/src/mac/mac-builder.mts @@ -40,12 +40,6 @@ function interateChannels(repo: MacRepo, callback: (channel: string, channelObj: }); } -const YmlContentTemplate = -`version: $VERSION -path: $PATH -sha512: $SHA512 -releaseDate: '$DATE'`; - function iteratePackages(repo: MacRepo, callback: (channel: string, pack: PackageDescriptor) => void): void { const channels = Object.keys(repo); @@ -60,6 +54,12 @@ function iteratePackages(repo: MacRepo, callback: (channel: string, pack: Packag }); } +const YmlContentTemplate = +`version: $VERSION +path: $PATH +sha512: $SHA512 +releaseDate: '$DATE'`; + export class MacBuilder implements Deployer { private readonly config: Config; private readonly artifactProvider: ArtifactProvider; diff --git a/src/repo-builder.ts b/src/repo-builder.ts deleted file mode 100644 index 9ea53a4..0000000 --- a/src/repo-builder.ts +++ /dev/null @@ -1,94 +0,0 @@ -import * as fs from 'fs'; -import * as path from 'path'; -import * as semver from 'semver'; - -export interface Package { - version: string, - buildNumber: string, -} - -interface Release { - packages: Package[], - highest: Package, -} - -type Channel = string; -export type Repo = Map; - -export interface RepoBuilder { - build(): Promise; -} - -export async function scanSourceDir(sourceDir: string): Promise { - console.log(`Prepearing meta repo from "${sourceDir}"`); - const repo: Repo = new Map(); - - const processChannelDirectory = async(srcPath: string, channel: string): Promise => { - const fullChannelPath = path.resolve(srcPath, channel); - const list: string[] = await fs.promises.readdir(fullChannelPath); - const packages: Package[] = []; - - const findHighestVersion = (packs: Package[]): Package => { - let highest: Package = { - version: '0.0.0', - buildNumber: '', - }; - - for (const pack of packs) { - if (semver.compare(pack.version, highest.version) > 0) { - highest = pack; - } - } - - if (highest.version === '0.0.0') { - throw new Error('Could not find highest version'); - } - - return highest; - }; - - if (list.length === 0) { - throw new Error(`Channel directory "${fullChannelPath}" is empty`); - } - - for (const releasePath of list) { - const fullReleasePath = path.resolve(fullChannelPath, releasePath); - const key = path.relative(sourceDir, fullReleasePath); - const stats = fs.lstatSync(fullReleasePath); - - console.log(`${key} found`); - - const version = path.basename(releasePath, '.txt'); - - if (stats.isDirectory()) { - console.log(`Skipping directory - ${fullReleasePath}`); - } else if (stats.isFile()) { - const buildNumber = fs.readFileSync(fullReleasePath).toString(); - packages.push({ version, buildNumber }); - } - } - - repo.set(channel, { packages, highest: findHighestVersion(packages) }); - }; - - const iterateDirectory = async(dirPath: string): Promise => { - const list: string[] = await fs.promises.readdir(dirPath); - - if (list.length === 0) { - throw new Error(`Source directory "${dirPath}" is empty`); - } - - const processResults: Promise[] = []; - for (const channel of list) { - processResults.push(processChannelDirectory(dirPath, channel)); - } - - await Promise.all(processResults); - }; - - await iterateDirectory(sourceDir); - - return repo; -} - - diff --git a/src/repo.mts b/src/repo.mts deleted file mode 100644 index 74225a6..0000000 --- a/src/repo.mts +++ /dev/null @@ -1,15 +0,0 @@ -export interface Package { - version: string, - buildNumber: string -} - -export interface Packages { - packages: Package[], - highest: Package, -} - -export type Channel = string; -export type Repo = { - channel: Channel, - packages: Packages -}[] diff --git a/src/utils.ts b/src/utils.ts deleted file mode 100644 index 4c53760..0000000 --- a/src/utils.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as fs from 'fs'; - -import { spawnSync } from 'child_process'; - -export function createMetapointerContent(fileMd5Hash: string): string { - return `#metapointer jfrogart\noid md5:${fileMd5Hash}`; -} - -export function createFile(path: string, content: string): void { - const dirPath = path.split('/').slice(0, -1) - .join('/'); - - createDir(dirPath); - - fs.writeFileSync(path, content); -} - -export function createDir(dirName: string): void { - if (!fs.existsSync(dirName)) { - fs.mkdirSync(dirName, { recursive: true }); - } -} - -export function ignorePromise(promise: Promise): void { - promise.catch((error: unknown) => { - const err = error as Error; - console.warn(`Ignoring promise, but error: ${err.message}`); - console.warn(err.stack); - }); -} - -// eslint-disable-next-line max-params -export async function execToolToFile(tool: string, args: string[], outputPath?: string, append?: boolean): Promise { - if (!append && outputPath && fs.existsSync(outputPath)) { - await fs.promises.unlink(outputPath); - } - - const toolProcessResult = spawnSync(tool, args, { stdio: 'pipe', encoding: 'utf-8' }); - const toolOutput = toolProcessResult.stdout; - - const dumpToolOutput = (): void => { - const toolErrOutput = toolProcessResult.stderr; - if (toolOutput && toolOutput.length > 0) { - console.log(toolOutput); - } - if (toolErrOutput && toolErrOutput.length > 0) { - console.warn(toolErrOutput); - } - }; - - if (outputPath) { - console.log(`Execute ${tool} ${args.join(' ')} => ${outputPath}`); - dumpToolOutput(); - if (append) { - return fs.promises.appendFile(outputPath, toolOutput); - } - - return fs.promises.writeFile(outputPath, toolOutput); - } - - console.log(`Execute ${tool} ${args.join(' ')}`); - dumpToolOutput(); - - return Promise.resolve(); -} - -export function getMessageOfError(error: unknown): string { - if (error === null || typeof error === 'undefined') { - return ''; - } - - if (error instanceof Error) { - return error.message; - } - - if (typeof error === 'string') { - return error; - } - - if (typeof error === 'object') { - return (error as { message?: string; }).message ?? 'unknown error'; - } - - return 'unknown error'; -} diff --git a/src/windows-repo-builder.ts b/src/windows-repo-builder.ts deleted file mode 100644 index 2ae6fdd..0000000 --- a/src/windows-repo-builder.ts +++ /dev/null @@ -1,149 +0,0 @@ -import * as fs from 'fs'; -import * as path from 'path'; - -import { TextEncoder } from 'util'; - -import type { Artifact, ArtifactoryHelper } from './artifactory-utils.js'; -import type { Package, Repo, RepoBuilder } from './repo-builder.js'; - -import { createDir, createFile, createMetapointerContent } from './utils.js'; -import { configuration } from './config.js'; - -export interface MsixS3Config { - msixS3: { - msixName: string, - appInstaller: { - name: string, - host: string, - hoursBetweenUpdateChecks: number, - packageName: string, - publisher: string - } - } -} - -export class WindowsRepoBuilder implements RepoBuilder { - private readonly artifactory: ArtifactoryHelper; - private readonly repo: Repo; - private readonly out: string; - private readonly config: MsixS3Config; - private readonly arch: string = 'x64'; - - constructor(artifactory: ArtifactoryHelper, repo: Repo, out: string) { - this.artifactory = artifactory; - this.repo = repo; - this.out = out; - - const msixConfig = configuration().exhaust?.msixS3; - - if (msixConfig) { - this.config = { msixS3: msixConfig }; - } else { - throw new Error('MsixS3Config must be specified'); - } - } - - public build(): Promise { - return this.prepareJfrogMetaFiles(); - } - - private async prepareJfrogMetaFiles(): Promise { - console.log('WindowsBuilder: prepareJfrogMetaFiles'); - - const channelResult: Promise[] = []; - const latestResult: Promise[] = []; - - for (const [channel, release] of this.repo) { - channelResult.push(this.makeChannel(channel, release.packages)); - } - - await Promise.all(channelResult); - - for (const [channel, release] of this.repo) { - latestResult.push(this.makeLatest(channel, release.highest)); - } - - // eslint-disable-next-line no-empty-function - return Promise.all(latestResult).then(() => {}); - } - - private async artifactsWithVersion(version: string, buildNumber: string): Promise<{ version: string, artifacts: Artifact[] }> { - return { version, artifacts: await this.artifactory.windowsArtifactsByBuildNumber(buildNumber) }; - } - - private async makeChannel(channel: string, packs: Package[]): Promise { - const artifactsResult: Promise<{ version: string, artifacts: Artifact[] }>[] = []; - - packs.forEach(pack => { - artifactsResult.push(this.artifactsWithVersion(pack.version, pack.buildNumber)); - }); - - const artifacts = await Promise.all(artifactsResult); - - artifacts.forEach(value => { - console.log(`WindowsBuilder: Processing ${value.version}`); - value.artifacts.forEach(artifact => { - const msixDir = path.join(this.out, channel, value.version, 'win32', this.arch); - createDir(msixDir); - this.createMsix(msixDir, artifact.md5); - }); - }); - } - - private async makeLatest(channel: string, highest: Package): Promise { - console.log('WindowsBuilder: makeRelease'); - - const latestDir = path.join(this.out, channel, 'latest', 'win32', this.arch); - createDir(latestDir); - - this.createAppInstallerFile(latestDir, `${highest.version}.${highest.buildNumber}`, channel); - await fs.promises.copyFile(path.join(this.out, channel, highest.version, 'win32', this.arch, `${this.config.msixS3.msixName}.msix`), - path.join(latestDir, `${this.config.msixS3.msixName}.msix`)); - } - - private createAppInstallerFile(out: string, version: string, channel: string): void { - const appInstallerContent = this.appInstallerFileContent(version, channel); - const adjustedAppInstallerContent = adjustAppinstallerSize(appInstallerContent); - - createFile(`${out}/${this.config.msixS3.appInstaller.name}.appinstaller`, adjustedAppInstallerContent); - } - - private appInstallerFileContent(version: string, channel: string): string { - return ` - - - - - - \n`; - } - - private createMsix(out: string, md5: string): void { - createFile(`${out}/${this.config.msixS3.msixName}.msix`, createMetapointerContent(md5)); - } -} - -function adjustAppinstallerSize(appInstallerContent: string): string { - const encoder = new TextEncoder(); - const appInstallerRequiredSize = 4096; - - const createFillComment = (fillComment: string): string => ``; - - const appInstallerContentSize = encoder.encode(appInstallerContent).length; - const fillCommentSize = appInstallerRequiredSize - appInstallerContentSize - encoder.encode(createFillComment('')).length; - - if (fillCommentSize >= 0) { - const commentStr = new Array(fillCommentSize + 1).join('X'); - return `${appInstallerContent}${createFillComment(commentStr)}`; - } - - throw new Error('Appinstaller file is too big'); -} diff --git a/src/windows/windows-builder.mts b/src/windows/windows-builder.mts new file mode 100644 index 0000000..8b82fe2 --- /dev/null +++ b/src/windows/windows-builder.mts @@ -0,0 +1,186 @@ +import * as fs from 'fs'; +import * as path from 'path'; + +import { TextEncoder } from 'util'; + +import type { Artifact } from '../artifact-provider.mjs'; +import type { Deployer } from '../deployer.mjs'; + +type Channel = string; + +export interface PackageDescriptor { + version: string, + buildNumber: string, + msix: Artifact +} + +export interface WindowsRepo { + [key: Channel]: { + latest: string, + additionalFiles?: string[], + packages: PackageDescriptor[] + } +} + +export interface Config { + host: string, + out: string, + repo: WindowsRepo +} + +function interateChannels(repo: WindowsRepo, callback: (channel: string, channelObj: { + latest: string, + additionalFiles?: string[], + packages: PackageDescriptor[]}) => void): void { + const channels = Object.keys(repo); + + channels.forEach(channel => { + const channelObject = repo[channel]; + if (channelObject) { + callback(channel, channelObject); + } + }); +} + +function iteratePackages(repo: WindowsRepo, callback: (channel: string, pack: PackageDescriptor) => void): void { + const channels = Object.keys(repo); + + channels.forEach(channel => { + const channelObject = repo[channel]; + if (channelObject) { + const packs = channelObject.packages; + packs.forEach(pack => { + callback(channel, pack); + }); + } + }); +} + +const AppInstallerContentTemplate = +` + + + + + +\n`; + +export class WindowsBuilder implements Deployer { + private readonly config: Config; + private readonly packageCreator: (md5: string, path: string) => (Promise | void); + + constructor(config: Config, packageCreator: (md5: string, path: string) => (Promise | void)) { + this.config = config; + this.packageCreator = packageCreator; + } + + public async plan(): Promise { + await this.makePackages(); + await this.makeRelease(); + } + + public apply(): void { + console.log(this); + } + + private async makePackages(): Promise { + const promises: Promise[] = []; + + iteratePackages(this.config.repo, (channel: string, packs: PackageDescriptor) => { + promises.push(this.handlePackage(channel, packs)); + }); + + await Promise.all(promises); + } + + private async makeRelease(): Promise { + const promises: Promise[] = []; + + interateChannels(this.config.repo, (channel: string, channelObj: { latest: string, packages: PackageDescriptor[]}) => { + promises.push(this.handleLatest(channel, channelObj)); + }); + + await Promise.all(promises); + } + + private async handlePackage(channel: string, pack: PackageDescriptor): Promise { + const msixPath = path.join(this.config.out, channel, pack.version, 'win32', 'TradingView.msix'); + + const msixCreation = this.packageCreator(pack.msix.md5, msixPath); + + if (msixCreation instanceof Promise) { + await msixCreation; + } + } + + private async handleLatest(channel: string, channelObj: {latest: string, additionalFiles?: string[], packages: PackageDescriptor[]}): Promise { + const latestPath = path.posix.join(channel, 'latest', 'win32'); + const appinstallerPath = path.posix.join(latestPath, 'Tradingview.appinstaller'); + const msixPath = path.join(latestPath, 'TradingView.msix'); + const latestPackage = channelObj.packages.find(pack => pack.version === channelObj.latest); + const promises: Promise[] = []; + + if (!latestPackage) { + throw new Error('latest must be specified'); + } + + const msixCreation = this.packageCreator(latestPackage.msix.md5, path.posix.join(this.config.out, msixPath)); + + if (msixCreation instanceof Promise) { + promises.push(msixCreation); + } + + const appinstallerUri = new URL(path.posix.join(this.config.host, appinstallerPath)).toString(); + const appinstallerVersion = `${latestPackage.version}.${latestPackage.buildNumber}`; + const packageName = 'TradingView.Desktop'; + const packageVersion = appinstallerVersion; + const publisher = 'CN="TradingView, Inc.", O="TradingView, Inc.", S=Ohio, C=US'; + const msixUri = new URL(path.posix.join(this.config.host, channel, latestPackage.version, 'win32', 'x64', 'TradingView.msix')).toString(); + + const appinstallerContent = AppInstallerContentTemplate + .replace('$APPINSTALLER_URI', appinstallerUri) + .replace('$APPINSTALLER_VERSION', appinstallerVersion) + .replace('$PACKAGE_NAME', packageName) + .replace('$PACKAGE_VERSION', packageVersion) + .replace('$PUBLISHER', publisher) + .replace('$ARCH', 'x64') + .replace('$MSIX_URI', msixUri) + .replace('$UPDATES_INTERVAL', '1'); + + promises.push(fs.promises.writeFile(path.posix.join(this.config.out, appinstallerPath), adjustAppinstallerSize(appinstallerContent))); + + channelObj.additionalFiles?.forEach(filePath => { + const resolvedFilePath = path.resolve(filePath); + const targetPath = path.join(this.config.out, latestPath, path.basename(resolvedFilePath)); + promises.push(fs.promises.copyFile(resolvedFilePath, targetPath)); + }); + + await Promise.all(promises); + } +} + +function adjustAppinstallerSize(appInstallerContent: string): string { + const encoder = new TextEncoder(); + const appInstallerRequiredSize = 4096; + + const createFillComment = (fillComment: string): string => ``; + + const appInstallerContentSize = encoder.encode(appInstallerContent).length; + const fillCommentSize = appInstallerRequiredSize - appInstallerContentSize - encoder.encode(createFillComment('')).length; + + if (fillCommentSize >= 0) { + const commentStr = new Array(fillCommentSize + 1).join('X'); + return `${appInstallerContent}${createFillComment(commentStr)}`; + } + + throw new Error('Appinstaller file is too big'); +}