@integrationos/cli
Advanced tools
+12
-28
@@ -20,7 +20,3 @@ #!/usr/bin/env node | ||
| interface StartArguments { | ||
| kmsKeyId: string; | ||
| kmsKeyRingId: string; | ||
| gcpLocationId: string; | ||
| gcpProjectId: string; | ||
| home: string; | ||
| iosCryptoSecret: string; | ||
| seed?: boolean; | ||
@@ -31,7 +27,3 @@ } | ||
| return new Promise(async (resolve) => { | ||
| const kmsKeyId = await askForValue("KMS Key ID"); | ||
| const kmsKeyRingId = await askForValue("KMS Key Ring ID"); | ||
| const gcpLocationId = await askForValue("GCP Location ID"); | ||
| const gcpProjectId = await askForValue("GCP Project ID"); | ||
| const home = await askForValue("Home Path"); | ||
| const iosCryptoSecret = await askForValue("IOS Crypto Secret (32 characters long)", 32); | ||
| const seed = await askIfSeedingIsRequired(); | ||
@@ -42,7 +34,3 @@ | ||
| resolve({ | ||
| kmsKeyId, | ||
| kmsKeyRingId, | ||
| gcpLocationId, | ||
| gcpProjectId, | ||
| home, | ||
| iosCryptoSecret, | ||
| seed, | ||
@@ -53,3 +41,3 @@ }); | ||
| const askForValue = async (variableName: string): Promise<string> => { | ||
| const askForValue = async (variableName: string, length?: number): Promise<string> => { | ||
| return new Promise((resolve) => { | ||
@@ -61,2 +49,6 @@ readLineInterface.question(`Enter the ${variableName}: `, async (value) => { | ||
| if (length && value.length !== length) { | ||
| resolve(await askForValue(variableName)); | ||
| } | ||
| resolve(value); | ||
@@ -109,3 +101,3 @@ }); | ||
| const unixStart = async (options: StartArguments) => { | ||
| const { kmsKeyId, kmsKeyRingId, gcpLocationId, gcpProjectId, home, seed } = options; | ||
| const { iosCryptoSecret, seed } = options; | ||
@@ -116,7 +108,3 @@ const userConfig = await getUserConfiguration(); | ||
| ...(userConfig?.variables ?? settings.variables), | ||
| KMS_KEY_ID: kmsKeyId, | ||
| KMS_KEY_RING_ID: kmsKeyRingId, | ||
| GCP_LOCATION_ID: gcpLocationId, | ||
| GCP_PROJECT_ID: gcpProjectId, | ||
| HOME: home, | ||
| IOS_CRYPTO_SECRET: iosCryptoSecret, | ||
| }); | ||
@@ -174,3 +162,3 @@ | ||
| const windowsStart = async (options: StartArguments) => { | ||
| const { kmsKeyId, kmsKeyRingId, gcpLocationId, gcpProjectId, home, seed } = options; | ||
| const { iosCryptoSecret, seed } = options; | ||
@@ -197,7 +185,3 @@ const userConfig = await getUserConfiguration(); | ||
| ...(userConfig?.variables ?? settings.variables), | ||
| KMS_KEY_ID: kmsKeyId, | ||
| KMS_KEY_RING_ID: kmsKeyRingId, | ||
| GCP_LOCATION_ID: gcpLocationId, | ||
| GCP_PROJECT_ID: gcpProjectId, | ||
| HOME: home, | ||
| IOS_CRYPTO_SECRET: iosCryptoSecret, | ||
| }; | ||
@@ -204,0 +188,0 @@ |
+10
-15
@@ -50,15 +50,7 @@ #!/usr/bin/env node | ||
| return new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () { | ||
| const kmsKeyId = yield askForValue("KMS Key ID"); | ||
| const kmsKeyRingId = yield askForValue("KMS Key Ring ID"); | ||
| const gcpLocationId = yield askForValue("GCP Location ID"); | ||
| const gcpProjectId = yield askForValue("GCP Project ID"); | ||
| const home = yield askForValue("Home Path"); | ||
| const iosCryptoSecret = yield askForValue("IOS Crypto Secret (32 characters long)", 32); | ||
| const seed = yield askIfSeedingIsRequired(); | ||
| helpers_1.readLineInterface.close(); | ||
| resolve({ | ||
| kmsKeyId, | ||
| kmsKeyRingId, | ||
| gcpLocationId, | ||
| gcpProjectId, | ||
| home, | ||
| iosCryptoSecret, | ||
| seed, | ||
@@ -68,3 +60,3 @@ }); | ||
| }); | ||
| const askForValue = (variableName) => __awaiter(void 0, void 0, void 0, function* () { | ||
| const askForValue = (variableName, length) => __awaiter(void 0, void 0, void 0, function* () { | ||
| return new Promise((resolve) => { | ||
@@ -75,2 +67,5 @@ helpers_1.readLineInterface.question(`Enter the ${variableName}: `, (value) => __awaiter(void 0, void 0, void 0, function* () { | ||
| } | ||
| if (length && value.length !== length) { | ||
| resolve(yield askForValue(variableName)); | ||
| } | ||
| resolve(value); | ||
@@ -122,5 +117,5 @@ })); | ||
| var _a; | ||
| const { kmsKeyId, kmsKeyRingId, gcpLocationId, gcpProjectId, home, seed } = options; | ||
| const { iosCryptoSecret, seed } = options; | ||
| const userConfig = yield (0, helpers_1.getUserConfiguration)(); | ||
| const env = yield (0, helpers_1.joinKeyValuePairs)(Object.assign(Object.assign({}, ((_a = userConfig === null || userConfig === void 0 ? void 0 : userConfig.variables) !== null && _a !== void 0 ? _a : settings_json_1.default.variables)), { KMS_KEY_ID: kmsKeyId, KMS_KEY_RING_ID: kmsKeyRingId, GCP_LOCATION_ID: gcpLocationId, GCP_PROJECT_ID: gcpProjectId, HOME: home })); | ||
| const env = yield (0, helpers_1.joinKeyValuePairs)(Object.assign(Object.assign({}, ((_a = userConfig === null || userConfig === void 0 ? void 0 : userConfig.variables) !== null && _a !== void 0 ? _a : settings_json_1.default.variables)), { IOS_CRYPTO_SECRET: iosCryptoSecret })); | ||
| const execute = (0, node_util_1.promisify)(node_child_process_1.exec); | ||
@@ -163,3 +158,3 @@ const startDocker = () => __awaiter(void 0, void 0, void 0, function* () { | ||
| var _a; | ||
| const { kmsKeyId, kmsKeyRingId, gcpLocationId, gcpProjectId, home, seed } = options; | ||
| const { iosCryptoSecret, seed } = options; | ||
| const userConfig = yield (0, helpers_1.getUserConfiguration)(); | ||
@@ -181,3 +176,3 @@ const download = (url) => { | ||
| }; | ||
| const replacements = Object.assign(Object.assign({}, ((_a = userConfig === null || userConfig === void 0 ? void 0 : userConfig.variables) !== null && _a !== void 0 ? _a : settings_json_1.default.variables)), { KMS_KEY_ID: kmsKeyId, KMS_KEY_RING_ID: kmsKeyRingId, GCP_LOCATION_ID: gcpLocationId, GCP_PROJECT_ID: gcpProjectId, HOME: home }); | ||
| const replacements = Object.assign(Object.assign({}, ((_a = userConfig === null || userConfig === void 0 ? void 0 : userConfig.variables) !== null && _a !== void 0 ? _a : settings_json_1.default.variables)), { IOS_CRYPTO_SECRET: iosCryptoSecret }); | ||
| const escapeRegex = (string) => { | ||
@@ -184,0 +179,0 @@ return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string |
+1
-1
| { | ||
| "name": "@integrationos/cli", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Build and manage performant, high-converting native integrations with a few lines of code.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
+3
-7
@@ -1,2 +0,2 @@ | ||
| # [IntegrationOS](https://www.integrationos.com) | ||
| # [IntegrationOS CLI](https://www.integrationos.com) | ||
@@ -61,8 +61,4 @@ Build performant, high-converting native integrations with a few lines of code. By unlocking more integrations, you can | ||
| # To start the docker containers | ||
| cios start --kmsKeyId --kmsKeyRingId --gcpLocationId --gcpProjectId --home | ||
| Enter the KMS Key ID: random-key-id | ||
| Enter the KMS Key Ring ID: random-kms-key-ring-id | ||
| Enter the GCP Location ID: global | ||
| Enter the GCP Project ID: random-gcp-project-id | ||
| Enter the Home: /home/gcp_config | ||
| cios start | ||
| Enter the IOS Crypto Secret (32 characters long): xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| Do you want to seed? (Y/N) y | ||
@@ -69,0 +65,0 @@ ``` |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
136
0.74%689230
-0.17%14147
-0.17%529
-0.75%