@interopio/iocd-cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +96 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/apps.command.d.ts +3 -0
- package/dist/commands/apps.command.d.ts.map +1 -0
- package/dist/commands/apps.command.js +110 -0
- package/dist/commands/apps.command.js.map +1 -0
- package/dist/commands/components.command.d.ts +3 -0
- package/dist/commands/components.command.d.ts.map +1 -0
- package/dist/commands/components.command.js +116 -0
- package/dist/commands/components.command.js.map +1 -0
- package/dist/commands/create.command.d.ts +3 -0
- package/dist/commands/create.command.d.ts.map +1 -0
- package/dist/commands/create.command.js +19 -0
- package/dist/commands/create.command.js.map +1 -0
- package/dist/commands/dev.command.d.ts +4 -0
- package/dist/commands/dev.command.d.ts.map +1 -0
- package/dist/commands/dev.command.js +25 -0
- package/dist/commands/dev.command.js.map +1 -0
- package/dist/commands/installer.command.d.ts +3 -0
- package/dist/commands/installer.command.d.ts.map +1 -0
- package/dist/commands/installer.command.js +19 -0
- package/dist/commands/installer.command.js.map +1 -0
- package/dist/commands/license.command.d.ts +3 -0
- package/dist/commands/license.command.d.ts.map +1 -0
- package/dist/commands/license.command.js +23 -0
- package/dist/commands/license.command.js.map +1 -0
- package/dist/commands/modifications.command.d.ts +3 -0
- package/dist/commands/modifications.command.d.ts.map +1 -0
- package/dist/commands/modifications.command.js +28 -0
- package/dist/commands/modifications.command.js.map +1 -0
- package/dist/commands/setup.command.d.ts +4 -0
- package/dist/commands/setup.command.d.ts.map +1 -0
- package/dist/commands/setup.command.js +34 -0
- package/dist/commands/setup.command.js.map +1 -0
- package/dist/services/app-builder.service.d.ts +2 -0
- package/dist/services/app-builder.service.d.ts.map +1 -0
- package/dist/services/app-builder.service.js +3 -0
- package/dist/services/app-builder.service.js.map +1 -0
- package/dist/services/app.service.d.ts +74 -0
- package/dist/services/app.service.d.ts.map +1 -0
- package/dist/services/app.service.js +328 -0
- package/dist/services/app.service.js.map +1 -0
- package/dist/services/components/component.config.d.ts +11 -0
- package/dist/services/components/component.config.d.ts.map +1 -0
- package/dist/services/components/component.config.js +101 -0
- package/dist/services/components/component.config.js.map +1 -0
- package/dist/services/components/component.d.ts +12 -0
- package/dist/services/components/component.d.ts.map +1 -0
- package/dist/services/components/component.js +3 -0
- package/dist/services/components/component.js.map +1 -0
- package/dist/services/components/components.registry.d.ts +40 -0
- package/dist/services/components/components.registry.d.ts.map +1 -0
- package/dist/services/components/components.registry.js +72 -0
- package/dist/services/components/components.registry.js.map +1 -0
- package/dist/services/components/components.service.d.ts +20 -0
- package/dist/services/components/components.service.d.ts.map +1 -0
- package/dist/services/components/components.service.js +171 -0
- package/dist/services/components/components.service.js.map +1 -0
- package/dist/services/components/file.helper.d.ts +12 -0
- package/dist/services/components/file.helper.d.ts.map +1 -0
- package/dist/services/components/file.helper.js +124 -0
- package/dist/services/components/file.helper.js.map +1 -0
- package/dist/services/components/platform.utils.d.ts +72 -0
- package/dist/services/components/platform.utils.d.ts.map +1 -0
- package/dist/services/components/platform.utils.js +156 -0
- package/dist/services/components/platform.utils.js.map +1 -0
- package/dist/services/components/stores/github.store.d.ts +35 -0
- package/dist/services/components/stores/github.store.d.ts.map +1 -0
- package/dist/services/components/stores/github.store.js +157 -0
- package/dist/services/components/stores/github.store.js.map +1 -0
- package/dist/services/components/stores/local.store.d.ts +69 -0
- package/dist/services/components/stores/local.store.d.ts.map +1 -0
- package/dist/services/components/stores/local.store.js +300 -0
- package/dist/services/components/stores/local.store.js.map +1 -0
- package/dist/services/components/stores/s3.store.d.ts +98 -0
- package/dist/services/components/stores/s3.store.d.ts.map +1 -0
- package/dist/services/components/stores/s3.store.js +368 -0
- package/dist/services/components/stores/s3.store.js.map +1 -0
- package/dist/services/components/stores/store.d.ts +11 -0
- package/dist/services/components/stores/store.d.ts.map +1 -0
- package/dist/services/components/stores/store.js +3 -0
- package/dist/services/components/stores/store.js.map +1 -0
- package/dist/services/config/cli.config.d.ts +57 -0
- package/dist/services/config/cli.config.d.ts.map +1 -0
- package/dist/services/config/cli.config.js +3 -0
- package/dist/services/config/cli.config.js.map +1 -0
- package/dist/services/config/config.service.d.ts +14 -0
- package/dist/services/config/config.service.d.ts.map +1 -0
- package/dist/services/config/config.service.js +170 -0
- package/dist/services/config/config.service.js.map +1 -0
- package/dist/services/create.service.d.ts +58 -0
- package/dist/services/create.service.d.ts.map +1 -0
- package/dist/services/create.service.js +318 -0
- package/dist/services/create.service.js.map +1 -0
- package/dist/services/dev.service.d.ts +2 -0
- package/dist/services/dev.service.d.ts.map +1 -0
- package/dist/services/dev.service.js +78 -0
- package/dist/services/dev.service.js.map +1 -0
- package/dist/services/installer/electronBuilder.d.ts +2 -0
- package/dist/services/installer/electronBuilder.d.ts.map +1 -0
- package/dist/services/installer/electronBuilder.js +3 -0
- package/dist/services/installer/electronBuilder.js.map +1 -0
- package/dist/services/installer/electronForge.d.ts +2 -0
- package/dist/services/installer/electronForge.d.ts.map +1 -0
- package/dist/services/installer/electronForge.js +248 -0
- package/dist/services/installer/electronForge.js.map +1 -0
- package/dist/services/installer/installer.service.d.ts +5 -0
- package/dist/services/installer/installer.service.d.ts.map +1 -0
- package/dist/services/installer/installer.service.js +101 -0
- package/dist/services/installer/installer.service.js.map +1 -0
- package/dist/services/installer/macOS.helper.d.ts +3 -0
- package/dist/services/installer/macOS.helper.d.ts.map +1 -0
- package/dist/services/installer/macOS.helper.js +244 -0
- package/dist/services/installer/macOS.helper.js.map +1 -0
- package/dist/services/installer/prerequisites.d.ts +2 -0
- package/dist/services/installer/prerequisites.d.ts.map +1 -0
- package/dist/services/installer/prerequisites.js +73 -0
- package/dist/services/installer/prerequisites.js.map +1 -0
- package/dist/services/installer/windows.helper.d.ts +10 -0
- package/dist/services/installer/windows.helper.d.ts.map +1 -0
- package/dist/services/installer/windows.helper.js +394 -0
- package/dist/services/installer/windows.helper.js.map +1 -0
- package/dist/services/license.service.d.ts +7 -0
- package/dist/services/license.service.d.ts.map +1 -0
- package/dist/services/license.service.js +14 -0
- package/dist/services/license.service.js.map +1 -0
- package/dist/services/modifications/macOS.helper.d.ts +13 -0
- package/dist/services/modifications/macOS.helper.d.ts.map +1 -0
- package/dist/services/modifications/macOS.helper.js +274 -0
- package/dist/services/modifications/macOS.helper.js.map +1 -0
- package/dist/services/modifications/modifications.service.d.ts +2 -0
- package/dist/services/modifications/modifications.service.d.ts.map +1 -0
- package/dist/services/modifications/modifications.service.js +376 -0
- package/dist/services/modifications/modifications.service.js.map +1 -0
- package/dist/services/modifications/windows.helper.d.ts +2 -0
- package/dist/services/modifications/windows.helper.d.ts.map +1 -0
- package/dist/services/modifications/windows.helper.js +83 -0
- package/dist/services/modifications/windows.helper.js.map +1 -0
- package/dist/services/template.service.d.ts +116 -0
- package/dist/services/template.service.d.ts.map +1 -0
- package/dist/services/template.service.js +354 -0
- package/dist/services/template.service.js.map +1 -0
- package/dist/templates/auto-tests/README.md +31 -0
- package/dist/templates/auto-tests/playwright.config.js +19 -0
- package/dist/templates/auto-tests/template.json +12 -0
- package/dist/templates/auto-tests/tests/basic.test.js +15 -0
- package/dist/templates/ioconnect-desktop/.env.example +29 -0
- package/dist/templates/ioconnect-desktop/.github/workflows/build-installers.yml +170 -0
- package/dist/templates/ioconnect-desktop/LICENSE +0 -0
- package/dist/templates/ioconnect-desktop/README.md +0 -0
- package/dist/templates/ioconnect-desktop/config/mac-build/entitlements.mac.plist +44 -0
- package/dist/templates/ioconnect-desktop/config/win-build/template.nuspectemplate +33 -0
- package/dist/templates/ioconnect-desktop/forge.config.js +47 -0
- package/dist/templates/ioconnect-desktop/iocd.cli.config.json +45 -0
- package/dist/templates/ioconnect-desktop/modifications/iocd/assets/images/logo.icns +0 -0
- package/dist/templates/ioconnect-desktop/modifications/iocd/assets/images/logo.ico +0 -0
- package/dist/templates/ioconnect-desktop/modifications/iocd/assets/images/logo.png +0 -0
- package/dist/templates/ioconnect-desktop/modifications/iocd/config/system.json.merge +3 -0
- package/dist/templates/ioconnect-desktop/package.json +43 -0
- package/dist/templates/ioconnect-desktop/template.json +7 -0
- package/dist/templates/launchpad/apps/launchpad/.eslintrc.json +3 -0
- package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.dev.json +57 -0
- package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.prod.json +2 -0
- package/dist/templates/launchpad/apps/launchpad/config/iocd.system.dev.json +3 -0
- package/dist/templates/launchpad/apps/launchpad/config/iocd.system.prod.json +3 -0
- package/dist/templates/launchpad/apps/launchpad/index.html +16 -0
- package/dist/templates/launchpad/apps/launchpad/iocd.app.json +32 -0
- package/dist/templates/launchpad/apps/launchpad/package-lock.json +2778 -0
- package/dist/templates/launchpad/apps/launchpad/package.json +21 -0
- package/dist/templates/launchpad/apps/launchpad/public/favicon.ico +0 -0
- package/dist/templates/launchpad/apps/launchpad/src/app/app.tsx +39 -0
- package/dist/templates/launchpad/apps/launchpad/src/app/constants.ts +27 -0
- package/dist/templates/launchpad/apps/launchpad/src/components/logo.tsx +11 -0
- package/dist/templates/launchpad/apps/launchpad/src/components/main-context-menu.tsx +162 -0
- package/dist/templates/launchpad/apps/launchpad/src/components/notifications-button.tsx +44 -0
- package/dist/templates/launchpad/apps/launchpad/src/main.tsx +6 -0
- package/dist/templates/launchpad/apps/launchpad/src/styles.css +17 -0
- package/dist/templates/launchpad/apps/launchpad/tsconfig.json +10 -0
- package/dist/templates/launchpad/apps/launchpad/vite.config.ts +13 -0
- package/dist/templates/launchpad/template.json +12 -0
- package/dist/templates/splash-screen/apps/splash-screen/README.md +119 -0
- package/dist/templates/splash-screen/apps/splash-screen/config/system-dev.json +9 -0
- package/dist/templates/splash-screen/apps/splash-screen/config/system-prod.json +8 -0
- package/dist/templates/splash-screen/apps/splash-screen/index.html +55 -0
- package/dist/templates/splash-screen/apps/splash-screen/iocd.app.json +20 -0
- package/dist/templates/splash-screen/apps/splash-screen/package-lock.json +1059 -0
- package/dist/templates/splash-screen/apps/splash-screen/package.json +17 -0
- package/dist/templates/splash-screen/apps/splash-screen/public/assets/fonts/PTSans-Regular.ttf +0 -0
- package/dist/templates/splash-screen/apps/splash-screen/public/assets/images/logo-light.svg +85 -0
- package/dist/templates/splash-screen/apps/splash-screen/public/assets/images/splash-bg.png +0 -0
- package/dist/templates/splash-screen/apps/splash-screen/public/assets/styles/style.css +149 -0
- package/dist/templates/splash-screen/apps/splash-screen/public/assets/styles/style.css.map +1 -0
- package/dist/templates/splash-screen/apps/splash-screen/public/assets/styles/style.scss +90 -0
- package/dist/templates/splash-screen/apps/splash-screen/src/main.ts +93 -0
- package/dist/templates/splash-screen/apps/splash-screen/src/types.ts +28 -0
- package/dist/templates/splash-screen/apps/splash-screen/tsconfig.json +25 -0
- package/dist/templates/splash-screen/apps/splash-screen/vite.config.ts +27 -0
- package/dist/templates/splash-screen/template.json +12 -0
- package/dist/templates/web-groups/apps/web-groups/README.md +15 -0
- package/dist/templates/web-groups/apps/web-groups/config/web-group-dev.json +13 -0
- package/dist/templates/web-groups/apps/web-groups/config/web-group-prod.json +12 -0
- package/dist/templates/web-groups/apps/web-groups/index.html +18 -0
- package/dist/templates/web-groups/apps/web-groups/iocd.app.json +24 -0
- package/dist/templates/web-groups/apps/web-groups/package.json +28 -0
- package/dist/templates/web-groups/apps/web-groups/public/favicon.ico +0 -0
- package/dist/templates/web-groups/apps/web-groups/public/logo192.png +0 -0
- package/dist/templates/web-groups/apps/web-groups/public/logo512.png +0 -0
- package/dist/templates/web-groups/apps/web-groups/public/manifest.json +25 -0
- package/dist/templates/web-groups/apps/web-groups/public/robots.txt +3 -0
- package/dist/templates/web-groups/apps/web-groups/src/App.css +38 -0
- package/dist/templates/web-groups/apps/web-groups/src/App.tsx +11 -0
- package/dist/templates/web-groups/apps/web-groups/src/index.css +13 -0
- package/dist/templates/web-groups/apps/web-groups/src/index.tsx +25 -0
- package/dist/templates/web-groups/apps/web-groups/src/logo.svg +1 -0
- package/dist/templates/web-groups/apps/web-groups/src/reportWebVitals.ts +15 -0
- package/dist/templates/web-groups/apps/web-groups/tsconfig.json +26 -0
- package/dist/templates/web-groups/apps/web-groups/vite.config.ts +8 -0
- package/dist/templates/web-groups/template.json +12 -0
- package/dist/templates/workspaces/apps/workspaces/README.md +15 -0
- package/dist/templates/workspaces/apps/workspaces/config/workspaces-dev.json +21 -0
- package/dist/templates/workspaces/apps/workspaces/config/workspaces-prod.json +20 -0
- package/dist/templates/workspaces/apps/workspaces/index.html +17 -0
- package/dist/templates/workspaces/apps/workspaces/iocd.app.json +24 -0
- package/dist/templates/workspaces/apps/workspaces/package.json +29 -0
- package/dist/templates/workspaces/apps/workspaces/public/favicon.ico +0 -0
- package/dist/templates/workspaces/apps/workspaces/public/logo192.png +0 -0
- package/dist/templates/workspaces/apps/workspaces/public/logo512.png +0 -0
- package/dist/templates/workspaces/apps/workspaces/public/manifest.json +25 -0
- package/dist/templates/workspaces/apps/workspaces/public/robots.txt +3 -0
- package/dist/templates/workspaces/apps/workspaces/src/AddWindowButton.tsx +33 -0
- package/dist/templates/workspaces/apps/workspaces/src/AfterTabs.tsx +27 -0
- package/dist/templates/workspaces/apps/workspaces/src/App.css +38 -0
- package/dist/templates/workspaces/apps/workspaces/src/App.tsx +103 -0
- package/dist/templates/workspaces/apps/workspaces/src/GroupHeaderButtons.tsx +9 -0
- package/dist/templates/workspaces/apps/workspaces/src/index.css +4 -0
- package/dist/templates/workspaces/apps/workspaces/src/index.tsx +28 -0
- package/dist/templates/workspaces/apps/workspaces/src/logo.svg +7 -0
- package/dist/templates/workspaces/apps/workspaces/src/reportWebVitals.ts +15 -0
- package/dist/templates/workspaces/apps/workspaces/src/setupTests.ts +5 -0
- package/dist/templates/workspaces/apps/workspaces/src/useAddWindowButtonVisible.tsx +30 -0
- package/dist/templates/workspaces/apps/workspaces/tsconfig.json +26 -0
- package/dist/templates/workspaces/apps/workspaces/vite.config.ts +8 -0
- package/dist/templates/workspaces/template.json +12 -0
- package/dist/tools/rcedit-x64.exe +0 -0
- package/dist/utils/colors.d.ts +57 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/colors.js +151 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/deep.merge.d.ts +5 -0
- package/dist/utils/deep.merge.d.ts.map +1 -0
- package/dist/utils/deep.merge.js +27 -0
- package/dist/utils/deep.merge.js.map +1 -0
- package/dist/utils/electron.builder.config.helper.d.ts +6 -0
- package/dist/utils/electron.builder.config.helper.d.ts.map +1 -0
- package/dist/utils/electron.builder.config.helper.js +25 -0
- package/dist/utils/electron.builder.config.helper.js.map +1 -0
- package/dist/utils/ensure.iocd.exists.d.ts +2 -0
- package/dist/utils/ensure.iocd.exists.d.ts.map +1 -0
- package/dist/utils/ensure.iocd.exists.js +27 -0
- package/dist/utils/ensure.iocd.exists.js.map +1 -0
- package/dist/utils/error.handler.d.ts +30 -0
- package/dist/utils/error.handler.d.ts.map +1 -0
- package/dist/utils/error.handler.js +104 -0
- package/dist/utils/error.handler.js.map +1 -0
- package/dist/utils/file.d.ts +10 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +40 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/find.package.dir.d.ts +2 -0
- package/dist/utils/find.package.dir.d.ts.map +1 -0
- package/dist/utils/find.package.dir.js +23 -0
- package/dist/utils/find.package.dir.js.map +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +184 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/nextSteps.d.ts +2 -0
- package/dist/utils/nextSteps.d.ts.map +1 -0
- package/dist/utils/nextSteps.js +44 -0
- package/dist/utils/nextSteps.js.map +1 -0
- package/dist/utils/pacakge.json.helper.d.ts +9 -0
- package/dist/utils/pacakge.json.helper.d.ts.map +1 -0
- package/dist/utils/pacakge.json.helper.js +71 -0
- package/dist/utils/pacakge.json.helper.js.map +1 -0
- package/dist/utils/path.d.ts +19 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +81 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/version.d.ts +2 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +16 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +69 -0
- package/tools/rcedit-x64.exe +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentPlatformUtils = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
/**
|
|
6
|
+
* Platform utility for component stores
|
|
7
|
+
*
|
|
8
|
+
* This utility provides shared functionality for:
|
|
9
|
+
* - Platform detection from filenames
|
|
10
|
+
* - Component filename parsing (both OS-specific and OS-agnostic)
|
|
11
|
+
* - Current platform detection
|
|
12
|
+
* - Component matching logic
|
|
13
|
+
*
|
|
14
|
+
* Supports two component naming patterns:
|
|
15
|
+
* 1. OS-specific: <name>-v<version>-<platform>.zip (e.g., myapp-v1.0.0-win32.zip)
|
|
16
|
+
* 2. OS-agnostic: <name>-v<version>.zip (e.g., webapp-v1.0.0.zip)
|
|
17
|
+
*/
|
|
18
|
+
class ComponentPlatformUtils {
|
|
19
|
+
/**
|
|
20
|
+
* Get current platform string compatible with component naming
|
|
21
|
+
*/
|
|
22
|
+
static getCurrentPlatform() {
|
|
23
|
+
const platform = process.platform;
|
|
24
|
+
if (platform === 'win32') {
|
|
25
|
+
return 'win32';
|
|
26
|
+
}
|
|
27
|
+
if (platform === 'darwin') {
|
|
28
|
+
// Check if ARM64 based on process.arch
|
|
29
|
+
return 'darwin';
|
|
30
|
+
}
|
|
31
|
+
// Fallback to darwin if unknown
|
|
32
|
+
return 'darwin';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse component information from filename;
|
|
36
|
+
*
|
|
37
|
+
* Supports multiple patterns:
|
|
38
|
+
* - OS-specific: <component>-v<version>-<platform>.<ext>
|
|
39
|
+
* - OS-agnostic: <component>-v<version>.<ext>
|
|
40
|
+
*
|
|
41
|
+
* @param filename The component filename to parse
|
|
42
|
+
* @returns Parsed component info or null if parsing fails
|
|
43
|
+
* @throws Error if parsing fails
|
|
44
|
+
*/
|
|
45
|
+
static parseComponentFilename(filename) {
|
|
46
|
+
const nameWithoutExt = (0, path_1.parse)(filename).name;
|
|
47
|
+
return this.parseComponentName(nameWithoutExt);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Parse component information from a name (not filename)
|
|
51
|
+
*
|
|
52
|
+
* Supports multiple patterns:
|
|
53
|
+
* - OS-specific: <component>-v<version>-<platform>
|
|
54
|
+
* - OS-agnostic: <component>-v<version>
|
|
55
|
+
*
|
|
56
|
+
* @param filename The component filename to parse
|
|
57
|
+
* @returns Parsed component info or null if parsing fails
|
|
58
|
+
* @throws Error if parsing fails
|
|
59
|
+
*/
|
|
60
|
+
static parseComponentName(name) {
|
|
61
|
+
// Pattern 1: OS-specific format <component>-v<version>-<platform>
|
|
62
|
+
// e.g., iocd-v10.0.0-darwin-arm64
|
|
63
|
+
const osSpecificPattern = /^(.+)-v(\d+\.\d+\.\d+.*?)-(.+)$/;
|
|
64
|
+
const osSpecificMatch = name.match(osSpecificPattern);
|
|
65
|
+
if (osSpecificMatch) {
|
|
66
|
+
let platform = 'darwin';
|
|
67
|
+
const platformPart = osSpecificMatch[3].toLowerCase();
|
|
68
|
+
if (platformPart.includes('darwin') || platformPart === 'darwin') {
|
|
69
|
+
platform = 'darwin';
|
|
70
|
+
}
|
|
71
|
+
else if (platformPart.includes('win32') || platformPart === 'win32') {
|
|
72
|
+
platform = 'win32';
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
name: osSpecificMatch[1],
|
|
76
|
+
version: osSpecificMatch[2],
|
|
77
|
+
isOsSpecific: true,
|
|
78
|
+
platform: platform
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Pattern 2: OS-agnostic format <component>-v<version>
|
|
82
|
+
// e.g., webapp-v1.0.0
|
|
83
|
+
const osAgnosticPattern = /^(.+)-v(\d+\.\d+\.\d+.*)$/;
|
|
84
|
+
const osAgnosticMatch = name.match(osAgnosticPattern);
|
|
85
|
+
if (osAgnosticMatch) {
|
|
86
|
+
return {
|
|
87
|
+
name: osAgnosticMatch[1],
|
|
88
|
+
version: osAgnosticMatch[2],
|
|
89
|
+
isOsSpecific: false
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
throw new Error(`${name} does not match expected component patterns.`);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Check if a filename matches the current platform
|
|
96
|
+
*
|
|
97
|
+
* @param filename The filename to check
|
|
98
|
+
* @param currentPlatform Optional current platform (defaults to auto-detect)
|
|
99
|
+
* @returns True if the component matches the current platform
|
|
100
|
+
*/
|
|
101
|
+
static matchesCurrentPlatform(filename, currentPlatform) {
|
|
102
|
+
const platform = currentPlatform || this.getCurrentPlatform();
|
|
103
|
+
const parsed = this.parseComponentFilename(filename);
|
|
104
|
+
// OS-agnostic components match any platform
|
|
105
|
+
if (!parsed.isOsSpecific) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
if (!parsed.platform) {
|
|
109
|
+
throw new Error(`Component is not OS-specific but platform is missing in filename: ${filename}`);
|
|
110
|
+
}
|
|
111
|
+
const platformString = parsed.platform.toLowerCase();
|
|
112
|
+
let detectedPlatform = null;
|
|
113
|
+
if (platformString.includes('darwin') || platformString.includes('macos')) {
|
|
114
|
+
detectedPlatform = 'darwin';
|
|
115
|
+
}
|
|
116
|
+
if (platformString.includes('win32') || platformString.includes('windows')) {
|
|
117
|
+
detectedPlatform = 'win32';
|
|
118
|
+
}
|
|
119
|
+
if (!detectedPlatform) {
|
|
120
|
+
throw new Error(`Unable to determine platform from component filename: ${filename}`);
|
|
121
|
+
}
|
|
122
|
+
return detectedPlatform === platform;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Check if a file is a supported package format
|
|
126
|
+
*/
|
|
127
|
+
static isSupportedPackageFile(filename) {
|
|
128
|
+
const supportedExtensions = ['.zip', '.dmg'];
|
|
129
|
+
const lowerFilename = filename.toLowerCase();
|
|
130
|
+
return supportedExtensions.some(ext => lowerFilename.endsWith(ext));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Compare two version strings for sorting (simple lexicographic comparison)
|
|
134
|
+
* For proper semantic versioning, consider using a semver library
|
|
135
|
+
*
|
|
136
|
+
* @param a First version string
|
|
137
|
+
* @param b Second version string
|
|
138
|
+
* @returns -1 if a < b, 1 if a > b, 0 if equal
|
|
139
|
+
*/
|
|
140
|
+
static compareVersions(a, b) {
|
|
141
|
+
if (a === 'latest' && b === 'latest')
|
|
142
|
+
return 0;
|
|
143
|
+
if (a === 'latest')
|
|
144
|
+
return 1;
|
|
145
|
+
if (b === 'latest')
|
|
146
|
+
return -1;
|
|
147
|
+
// Simple string comparison - for production use, consider a proper semver library
|
|
148
|
+
if (a < b)
|
|
149
|
+
return -1;
|
|
150
|
+
if (a > b)
|
|
151
|
+
return 1;
|
|
152
|
+
return 0;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.ComponentPlatformUtils = ComponentPlatformUtils;
|
|
156
|
+
//# sourceMappingURL=platform.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.utils.js","sourceRoot":"","sources":["../../../src/services/components/platform.utils.ts"],"names":[],"mappings":";;;AACA,+BAA6B;AAQ7B;;;;;;;;;;;;GAYG;AACH,MAAa,sBAAsB;IAE/B;;OAEG;IACH,MAAM,CAAC,kBAAkB;QACrB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC;QACnB,CAAC;QACD,IAAI,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C;QAED,OAAO,gBAAgB,KAAK,QAAQ,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,QAAgB;QAC1C,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7C,MAAM,aAAa,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;QAE7C,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,eAAe,CAAC,CAAS,EAAE,CAAS;QACvC,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,QAAQ;YAAE,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,QAAQ;YAAE,OAAO,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,QAAQ;YAAE,OAAO,CAAC,CAAC,CAAC;QAE9B,kFAAkF;QAClF,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC;QACpB,OAAO,CAAC,CAAC;IACb,CAAC;CACJ;AAnJD,wDAmJC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Component } from "../component";
|
|
2
|
+
import { ComponentsStore } from "./store";
|
|
3
|
+
export declare class GitHubComponentsStore implements ComponentsStore {
|
|
4
|
+
private baseUrl;
|
|
5
|
+
private getByTagUrl;
|
|
6
|
+
private logger;
|
|
7
|
+
constructor(repo?: string);
|
|
8
|
+
getAll(): Promise<Component[]>;
|
|
9
|
+
download(name: string, version: string): Promise<{
|
|
10
|
+
name: string;
|
|
11
|
+
data: any;
|
|
12
|
+
filename: string;
|
|
13
|
+
}>;
|
|
14
|
+
getInfo(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Find a specific release by component name and version
|
|
17
|
+
*/
|
|
18
|
+
private findRelease;
|
|
19
|
+
/**
|
|
20
|
+
* Find the appropriate asset for the current platform
|
|
21
|
+
*/
|
|
22
|
+
private findAssetForPlatform;
|
|
23
|
+
/**
|
|
24
|
+
* Get all releases without parsing them into components
|
|
25
|
+
*/
|
|
26
|
+
private getAllReleases;
|
|
27
|
+
/**
|
|
28
|
+
* Extract the next page URL from the Link header
|
|
29
|
+
* Link header format: <https://api.github.com/repos/owner/repo/releases?page=2>; rel="next", <https://api.github.com/repos/owner/repo/releases?page=5>; rel="last"
|
|
30
|
+
*/
|
|
31
|
+
private getNextPageUrl;
|
|
32
|
+
/** Parse GitHub release information into component metadata */
|
|
33
|
+
private parseReleases;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=github.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.store.d.ts","sourceRoot":"","sources":["../../../../src/services/components/stores/github.store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAsB1C,qBAAa,qBAAsB,YAAW,eAAe;IACzD,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,MAAM,CAAwB;gBAE1B,IAAI,GAAE,MAA8C;IAK1D,MAAM,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAM9B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IA8B9F,OAAO;IAId;;OAEG;YACW,WAAW;IAmCzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgB5B;;OAEG;YACW,cAAc;IA+B5B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAgBtB,+DAA+D;IAC/D,OAAO,CAAC,aAAa;CAoBxB"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GitHubComponentsStore = void 0;
|
|
4
|
+
const error_handler_1 = require("../../../utils/error.handler");
|
|
5
|
+
const logger_1 = require("../../../utils/logger");
|
|
6
|
+
const platform_utils_1 = require("../platform.utils");
|
|
7
|
+
;
|
|
8
|
+
// The github release package name is in format {{component}}-{{version}}
|
|
9
|
+
// each release has multiple assets; each asset can be platform specific
|
|
10
|
+
// each release has a tag the same as the release name; this can be used to get a specific release
|
|
11
|
+
class GitHubComponentsStore {
|
|
12
|
+
baseUrl = '';
|
|
13
|
+
getByTagUrl = '';
|
|
14
|
+
logger = logger_1.Logger.getInstance();
|
|
15
|
+
constructor(repo = "interopio/desktop-releases/releases") {
|
|
16
|
+
this.baseUrl = `https://api.github.com/repos/${repo}`;
|
|
17
|
+
this.getByTagUrl = `${this.baseUrl}/tags/`;
|
|
18
|
+
}
|
|
19
|
+
async getAll() {
|
|
20
|
+
const allReleases = await this.getAllReleases();
|
|
21
|
+
return this.parseReleases(allReleases);
|
|
22
|
+
}
|
|
23
|
+
async download(name, version) {
|
|
24
|
+
// Find the specific release and asset for this component
|
|
25
|
+
const targetRelease = await this.findRelease(name, version);
|
|
26
|
+
const asset = this.findAssetForPlatform(targetRelease, platform_utils_1.ComponentPlatformUtils.getCurrentPlatform());
|
|
27
|
+
if (!asset) {
|
|
28
|
+
throw new Error(`No asset found for component in ${name}@${version} on platform '${platform_utils_1.ComponentPlatformUtils.getCurrentPlatform()}'`);
|
|
29
|
+
}
|
|
30
|
+
// Download the asset
|
|
31
|
+
this.logger.info(`Downloading ${asset.name} from ${asset.browser_download_url}`);
|
|
32
|
+
const response = await fetch(asset.browser_download_url);
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
throw new Error(`Failed to download asset: ${response.status} ${response.statusText}`);
|
|
35
|
+
}
|
|
36
|
+
// Get the data as buffer
|
|
37
|
+
const buffer = await response.arrayBuffer();
|
|
38
|
+
this.logger.info(`Downloaded ${name}@${version || 'latest'} (${asset.name}) successfully!`);
|
|
39
|
+
return {
|
|
40
|
+
name: name,
|
|
41
|
+
data: new Uint8Array(buffer),
|
|
42
|
+
filename: asset.name
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
getInfo() {
|
|
46
|
+
return `GitHub Releases Store: ${this.baseUrl}`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Find a specific release by component name and version
|
|
50
|
+
*/
|
|
51
|
+
async findRelease(componentName, version) {
|
|
52
|
+
if (version === 'latest') {
|
|
53
|
+
// If no version specified, find the latest release for this component
|
|
54
|
+
const allReleases = await this.getAllReleases();
|
|
55
|
+
const componentReleases = allReleases.filter(release => release.tag_name.startsWith(`${componentName}-v`));
|
|
56
|
+
if (componentReleases.length === 0) {
|
|
57
|
+
throw new Error(`No releases found for component '${componentName}'`);
|
|
58
|
+
}
|
|
59
|
+
// Return the most recent release (first in the list)
|
|
60
|
+
return componentReleases[0];
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
// If version is specified, look for exact match
|
|
64
|
+
const targetTag = `${componentName}-v${version}`;
|
|
65
|
+
const response = await fetch(`${this.getByTagUrl}${targetTag}`);
|
|
66
|
+
if (response.ok) {
|
|
67
|
+
return await response.json();
|
|
68
|
+
}
|
|
69
|
+
throw new error_handler_1.CLIError(`Release not found for ${componentName} v${version} (was looking for tag: ${targetTag})`, {
|
|
70
|
+
suggestions: [
|
|
71
|
+
`You are trying to install ${componentName}@${version} - check that the component name and version are correct`,
|
|
72
|
+
`Use iocd components browse" to see available components and versions`
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Find the appropriate asset for the current platform
|
|
79
|
+
*/
|
|
80
|
+
findAssetForPlatform(release, platform) {
|
|
81
|
+
this.logger.debug(`Finding asset for platform '${platform}' in release '${release.name}'. Assets available: ${release.assets.map(a => a.name).join(', ')}`);
|
|
82
|
+
// Filter assets that match the current platform or are OS-agnostic
|
|
83
|
+
const platformAssets = release.assets.filter(asset => {
|
|
84
|
+
return platform_utils_1.ComponentPlatformUtils.matchesCurrentPlatform(asset.name);
|
|
85
|
+
});
|
|
86
|
+
if (platformAssets.length === 0) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
// Prefer more specific platform matches (the utility handles this internally)
|
|
90
|
+
return platformAssets[0];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get all releases without parsing them into components
|
|
94
|
+
*/
|
|
95
|
+
async getAllReleases() {
|
|
96
|
+
const allReleases = [];
|
|
97
|
+
let nextUrl = `${this.baseUrl}?per_page=100&page=1`;
|
|
98
|
+
while (nextUrl) {
|
|
99
|
+
const response = await fetch(nextUrl);
|
|
100
|
+
if (!response.ok) {
|
|
101
|
+
throw new Error(`GitHub API error: ${response.status} ${response.statusText}`);
|
|
102
|
+
}
|
|
103
|
+
const releases = await response.json();
|
|
104
|
+
if (releases.length === 0) {
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
allReleases.push(...releases);
|
|
108
|
+
const linkHeader = response.headers.get('link');
|
|
109
|
+
nextUrl = this.getNextPageUrl(linkHeader);
|
|
110
|
+
// Safety limit
|
|
111
|
+
if (allReleases.length > 1000) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return allReleases;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Extract the next page URL from the Link header
|
|
119
|
+
* Link header format: <https://api.github.com/repos/owner/repo/releases?page=2>; rel="next", <https://api.github.com/repos/owner/repo/releases?page=5>; rel="last"
|
|
120
|
+
*/
|
|
121
|
+
getNextPageUrl(linkHeader) {
|
|
122
|
+
if (!linkHeader) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const links = linkHeader.split(',');
|
|
126
|
+
for (const link of links) {
|
|
127
|
+
const match = link.match(/<([^>]+)>;\s*rel="next"/);
|
|
128
|
+
if (match) {
|
|
129
|
+
return match[1];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
/** Parse GitHub release information into component metadata */
|
|
135
|
+
parseReleases(releases) {
|
|
136
|
+
const components = [];
|
|
137
|
+
for (const release of releases) {
|
|
138
|
+
try {
|
|
139
|
+
const { name, version, platform } = platform_utils_1.ComponentPlatformUtils.parseComponentName(release.tag_name);
|
|
140
|
+
for (const asset of release.assets) {
|
|
141
|
+
components.push({
|
|
142
|
+
name,
|
|
143
|
+
version,
|
|
144
|
+
platform: platform || platform_utils_1.ComponentPlatformUtils.getCurrentPlatform(),
|
|
145
|
+
downloadUrl: asset.browser_download_url
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
this.logger.warn(`Skipping release with unrecognized format: ${release.name}. Error: ${err.message}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return components;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.GitHubComponentsStore = GitHubComponentsStore;
|
|
157
|
+
//# sourceMappingURL=github.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.store.js","sourceRoot":"","sources":["../../../../src/services/components/stores/github.store.ts"],"names":[],"mappings":";;;AAAA,gEAAwD;AACxD,kDAA+C;AAG/C,sDAA2D;AAgB1D,CAAC;AAEF,yEAAyE;AACzE,wEAAwE;AACxE,kGAAkG;AAClG,MAAa,qBAAqB;IACtB,OAAO,GAAG,EAAE,CAAC;IACb,WAAW,GAAG,EAAE,CAAC;IACjB,MAAM,GAAG,eAAM,CAAC,WAAW,EAAE,CAAC;IAEtC,YAAY,OAAe,qCAAqC;QAC5D,IAAI,CAAC,OAAO,GAAG,gCAAgC,IAAI,E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AE,CAAC;gBACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8CAA8C,OAAO,CAAC,IAAI,YAAa,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YACrH,CAAC;QACL,CAAC;QACD,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AAtLD,sDAsLC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ComponentsStore } from './store';
|
|
2
|
+
import { Component } from '../component';
|
|
3
|
+
/**
|
|
4
|
+
* Local Components Store implementation
|
|
5
|
+
*
|
|
6
|
+
* This store reads components from a local directory following the same structure as the S3 store.
|
|
7
|
+
* Expected directory structure:
|
|
8
|
+
*
|
|
9
|
+
* componentsDirectory/
|
|
10
|
+
* ├── component1/
|
|
11
|
+
* │ ├── v1.0.0/
|
|
12
|
+
* │ │ ├── component1-v1.0.0-win32.zip
|
|
13
|
+
* │ │ ├── component1-v1.0.0-darwin.dmg
|
|
14
|
+
* │ │ └── component1-v1.0.0-darwin-arm64.dmg
|
|
15
|
+
* │ └── v1.1.0/
|
|
16
|
+
* │ ├── component1-v1.1.0-win32.zip
|
|
17
|
+
* │ └── component1-v1.1.0-darwin.dmg
|
|
18
|
+
* └── component2/
|
|
19
|
+
* └── v2.0.0/
|
|
20
|
+
* └── component2-v2.0.0-win32.zip
|
|
21
|
+
*
|
|
22
|
+
* Legacy support is maintained for flat file structures in the root directory.
|
|
23
|
+
*/
|
|
24
|
+
export declare class LocalComponentsStore implements ComponentsStore {
|
|
25
|
+
private logger;
|
|
26
|
+
private componentsDirectory;
|
|
27
|
+
constructor(componentsDirectory: string);
|
|
28
|
+
getInfo(): string;
|
|
29
|
+
getAll(): Promise<Component[]>;
|
|
30
|
+
download(name: string, version: string): Promise<{
|
|
31
|
+
name: string;
|
|
32
|
+
data: any;
|
|
33
|
+
filename: string;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Validate that the components directory exists and is accessible
|
|
37
|
+
*/
|
|
38
|
+
private validateDirectory;
|
|
39
|
+
/**
|
|
40
|
+
* Check if a file is a supported package format
|
|
41
|
+
*/
|
|
42
|
+
private isSupportedPackageFile;
|
|
43
|
+
/**
|
|
44
|
+
* Create a Component object from a single package file (legacy support)
|
|
45
|
+
*/
|
|
46
|
+
private createComponentFromFile;
|
|
47
|
+
/**
|
|
48
|
+
* Create a Component object from structured directory layout
|
|
49
|
+
* Expected filename format: componentName-vVersion-platform.ext
|
|
50
|
+
* Following S3 store structure: componentName/vVersion/componentName-vVersion-platform.ext
|
|
51
|
+
*/
|
|
52
|
+
private createStructuredComponent;
|
|
53
|
+
/**
|
|
54
|
+
* Scan component directory for version subdirectories
|
|
55
|
+
* Expected structure: componentName/vX.Y.Z/componentName-vX.Y.Z-platform.ext
|
|
56
|
+
*/
|
|
57
|
+
private scanComponentVersions;
|
|
58
|
+
/**
|
|
59
|
+
* Scan version directory for component package files
|
|
60
|
+
* Expected structure: vX.Y.Z/componentName-vX.Y.Z-platform.ext
|
|
61
|
+
*/
|
|
62
|
+
private scanVersionDirectory;
|
|
63
|
+
/**
|
|
64
|
+
* Get the latest version from a list of components with the same name
|
|
65
|
+
* Simple string comparison - for proper semver, you'd want to use a semver library
|
|
66
|
+
*/
|
|
67
|
+
private getLatestVersion;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=local.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.store.d.ts","sourceRoot":"","sources":["../../../../src/services/components/stores/local.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IACxD,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,mBAAmB,CAAS;gBAExB,mBAAmB,EAAE,MAAM;IAKvC,OAAO,IAAI,MAAM;IAIX,MAAM,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAmD9B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IA4ErG;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAezB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAI9B;;OAEG;YACW,uBAAuB;IAyBrC;;;;OAIG;YACW,yBAAyB;IAyBvC;;;OAGG;YACW,qBAAqB;IAwCnC;;;OAGG;YACW,oBAAoB;IAiClC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAW3B"}
|