diff --git a/locales/en.json b/locales/en.json index aa6e62a..6415573 100644 --- a/locales/en.json +++ b/locales/en.json @@ -330,6 +330,7 @@ "noBundle": "Disable bundling", "bundleDisabledInDirectory": "Bundling is disabled but the path points to a directory. The {filename} file will be uploaded.", "functionDeployToPrivateStorage": "[🧪 Alpha] Function code will be private", + "functionsUseSgx": "[🧪 Alpha] Function will use trusted execution environment for sensitive computations", "environmentVariables": "Set environment variables, do not include any sensitive information if your function is not private!", "environmentVariablesFile": "Set environment variables from a file, do not include any sensitive information if your function is not private!", "missingEnvVar": "Environment variable {key} is missing", @@ -340,4 +341,4 @@ "requireDeprecatedUseES6Syntax": "The use of 'require' is deprecated in this context. Please switch to using ES6 'import' syntax for module imports. For example, change 'require' to 'import from '';'. This adjustment is necessary to comply with modern JavaScript standards and improve compatibility with Fleek Functions runtime and environment.", "expectedNotFoundGeneric": "We had trouble locating the {name}. Please try again, and contact us if the issue persists.", "unexpectedFileFormat": "We weren't expecting the format {format}. Please report the issue to our team and provide details for a quick fix." -} +} \ No newline at end of file diff --git a/src/commands/functions/deploy.ts b/src/commands/functions/deploy.ts index 9fb5ebd..dace616 100644 --- a/src/commands/functions/deploy.ts +++ b/src/commands/functions/deploy.ts @@ -21,6 +21,7 @@ type DeployActionArgs = { private: boolean; env: string[]; envFile?: string; + sgx?: boolean; }; const deployAction: SdkGuardedFunction = async ({ @@ -31,6 +32,7 @@ const deployAction: SdkGuardedFunction = async ({ const functionToDeploy = await getFunctionOrPrompt({ name: args.name, sdk }); const filePath = await getFunctionPathOrPrompt({ path: args.filePath }); const bundle = !args.noBundle; + const sgx = args.sgx ?? false; const bundledFilePath = await getCodeFromPath({ filePath, bundle, @@ -111,7 +113,7 @@ const deployAction: SdkGuardedFunction = async ({ await sdk .functions() - .deploy({ functionId: functionToDeploy.id, cid: uploadResult.pin.cid }); + .deploy({ functionId: functionToDeploy.id, cid: uploadResult.pin.cid, sgx }); output.success(t('commonNameCreateSuccess', { name: 'deployment' })); output.printNewLine(); diff --git a/src/commands/functions/index.ts b/src/commands/functions/index.ts index 78c2bec..a77bc2a 100644 --- a/src/commands/functions/index.ts +++ b/src/commands/functions/index.ts @@ -15,6 +15,7 @@ type DeployOptions = { private: boolean; env?: string[]; envFile?: string; + sgx?: boolean; }; export default (program: Command) => { @@ -69,6 +70,7 @@ export default (program: Command) => { .option('--noBundle', t('noBundle'), false) .option('--private', t('functionDeployToPrivateStorage'), false) .option('-e, --env ', t('environmentVariables')) + .option('--sgx', t('functionsUseSgx'), false) .option( '--envFile ', t('environmentVariablesFile'), @@ -81,6 +83,7 @@ export default (program: Command) => { private: options.private, env: options.env ?? [], envFile: options.envFile, + sgx: options.sgx }), );