diff --git a/backend/files/misc/ide/macros/README.md b/backend/files/misc/ide/macros/README.md deleted file mode 100644 index dc6b1e02a2..0000000000 --- a/backend/files/misc/ide/macros/README.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Macros for Hyper IDE - -This folder contains all Hyperlambda macros for Hyper IDE. A macro is a Hyperlambda snippet that -typically creates code, endpoints, and/or folders for you. You can parametrise a macro dynamically, -changing how it behaves, resulting in changing its generated code. diff --git a/backend/files/misc/ide/macros/document-endpoints.hl b/backend/files/misc/ide/macros/document-endpoints.hl deleted file mode 100644 index a20c734687..0000000000 --- a/backend/files/misc/ide/macros/document-endpoints.hl +++ /dev/null @@ -1,210 +0,0 @@ - -// Macro for Hyper IDE that creates documentation for a module's endpoints. -.name:Documents all endpoints in module -.description:"Macro for Hyper IDE that creates Markdown documentation for a module's endpoints, and stores the documentation in an ENDPOINTS.md file at root of the module's folder." -.arguments - . - name:module - type:string - description:"Name of module to create a 'download file endpoint' for" - mandatory:bool:true - -// Lambda object executed as macro is actually executed. -.lambda - - // Sanity checking invocation. - validators.mandatory:x:@.arguments/*/module - validators.regex:x:@.arguments/*/module - regex:^[a-zA-Z0-9_-]+$ - - // Figuring out module's complete path. - .module-path - set-value:x:@.module-path - strings.concat - .:/modules/ - get-value:x:@.arguments/*/module - .:/ - - // Making sure that module exists. - if - not - io.folder.exists:x:@.module-path - .lambda - - // No such module - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' does not exist" - throw:x:- - public:bool:true - status:int:404 - - // Making sure that module does not already have a 'ENDPOINTS.md' file. - strings.concat - get-value:x:@.module-path - .:ENDPOINTS.md - if - io.file.exists:x:@strings.concat - .lambda - - // File already exists. - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' already has an 'ENDPOINTS.md' file and hence we cannot create another" - throw:x:- - public:bool:true - status:int:404 - - // Figuring out base URL to endpoints belonging to module. - .base-url - set-value:x:@.base-url - strings.concat - .:magic - get-value:x:@.module-path - - // Retrieving all endpoints and filtering out those not belonging to specified module. - endpoints.list - .endpoints - for-each:x:@endpoints.list/* - if - strings.starts-with:x:@.dp/#/*/path - get-value:x:@.base-url - .lambda - add:x:@.endpoints - get-nodes:x:@.dp/# - - // Now we have all endpoints belonging to module, and we can start creating documentation. - .documentation:"# Endpoints\r\n\r\nThis documentation was automatically generated by Magic by reading meta data from your endpoints, and automatically generating documentation for individual endpoints.\r\n" - for-each:x:@.endpoints/* - .description: - if - and - exists:x:@.dp/#/*/description - not - eq - get-value:x:@.dp/#/*/description - . - .lambda - set-value:x:@.description - strings.replace:x:@.dp/#/*/description - .:[ - .:\[ - set-value:x:@.description - strings.replace:x:@.description - .:] - .:\] - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:"\r\n" - .:"## " - get-value:x:@.dp/#/*/verb - .:" - " - get-value:x:@.dp/#/*/path - .:"\r\n\r\n" - get-value:x:@.description - .:"\r\n\r\n* __Type__ - " - get-value:x:@.dp/#/*/type - .:"\r\n* __Produces__ - " - get-value:x:@.dp/#/*/produces - if - exists:x:@.dp/#/*/consumes - .lambda - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:"\r\n* __Consumes__ - " - get-value:x:@.dp/#/*/consumes - if - exists:x:@.dp/#/*/auth - .lambda - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:"\r\n* __Authorisation__ -" - for-each:x:@.dp/#/*/auth/* - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:" `" - get-value:x:@.dp/# - .:` - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:@" -" - if - exists:x:@.dp/#/*/input/* - .lambda - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:@" -### Input -" - for-each:x:@.dp/#/*/input/* - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:@" -" - .:* __ - get-value:x:@.dp/#/*/name - .:__ - ` - get-value:x:@.dp/#/*/type - .:` - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:@" -" - if - exists:x:@.dp/#/*/output/* - .lambda - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:@" -### Output -" - for-each:x:@.dp/#/*/output/* - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:@" -" - .:* __ - get-value:x:@.dp/#/*/name - .:__ - if - and - exists:x:@.dp/#/*/type - not - eq - get-value:x:@.dp/#/*/type - . - .lambda - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:" - `" - get-value:x:@.dp/#/*/type - .:` - set-value:x:@.documentation - strings.concat - get-value:x:@.documentation - .:@" -" - - // Saving file as ENDPOINTS.md now that we have its entire content. - io.file.save:x:@strings.concat - get-value:x:@.documentation - - // Making sure we inform caller that he needs to refresh his folders. - set-value:x:@.lambda - strings.concat - .:folders-changed| - get-value:x:@strings.concat/@strings.concat diff --git a/backend/files/misc/ide/macros/download-file-endpoint.hl b/backend/files/misc/ide/macros/download-file-endpoint.hl deleted file mode 100644 index e673f9d4ab..0000000000 --- a/backend/files/misc/ide/macros/download-file-endpoint.hl +++ /dev/null @@ -1,126 +0,0 @@ - -// Macro for Hyper IDE that creates an upload image endpoint. -.name:Creates a download file endpoint -.description:"Macro for Hyper IDE that creates a 'download file' HTTP GET endpoint for you where the file is specified as an [file] query parameter. This macro goes hand in hand with the upload file macro, and becomes its 'get' equivalent." -.arguments - . - name:module - type:string - description:"Name of module to create a 'download file endpoint' for" - mandatory:bool:true - . - name:auth - type:string - description:Comma separated list of roles users must belong to in order to invoke endpoint. If empty, there are no authorisation requirements - mandatory:bool:false - . - name:name - type:string - description:Name of your endpoint that becomes the last parts of its URL - mandatory:bool:true - default:download-file - -// Lambda object executed as macro is actually executed. -.lambda - - // Sanity checking invocation. - validators.mandatory:x:@.arguments/*/module - validators.regex:x:@.arguments/*/module - regex:^[a-zA-Z0-9_-]+$ - validators.mandatory:x:@.arguments/*/name - validators.regex:x:@.arguments/*/name - regex:^[a-zA-Z0-9_-]+$ - - // Figuring out module's complete path. - .module-path - set-value:x:@.module-path - strings.concat - .:/modules/ - get-value:x:@.arguments/*/module - .:/ - - // Making sure that module exists. - if - not - io.folder.exists:x:@.module-path - .lambda - - // No such module - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' does not exist" - throw:x:- - public:bool:true - status:int:404 - - // Making sure that module does not already have a 'xxx.get.hl' file. - strings.concat - get-value:x:@.module-path - get-value:x:@.arguments/*/name - .:.get.hl - if - io.file.exists:x:@strings.concat - .lambda - - // File already exists. - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' already has a '" - get-value:x:@.arguments/*/name - .:".get.hl' file and hence we cannot create another" - throw:x:- - public:bool:true - status:int:404 - - // Copying main 'download-image.get.hl' template file from '/misc/idea/templates' folder. - io.file.copy:/misc/ide/templates/download-file.get.hl - get-value:x:@strings.concat - - /* - * Opening 'xxx.get.hl' file such that we can correctly decorate it - * according to arguments specified by caller. - */ - strings.concat - get-value:x:@.module-path - get-value:x:@.arguments/*/name - .:.get.hl - io.file.load:x:@strings.concat - hyper2lambda:x:@io.file.load - comments:true - - // Substituting parameters. - if - or - eq - get-value:x:@.arguments/*/auth - . - eq - get-value:x:@.arguments/*/auth - .: - not - exists:x:@.arguments/*/auth - .lambda - - // No [auth] specified. - remove-nodes:x:@hyper2lambda/**/=[[auth]] - else - - // Auth specified. - set-value:x:@hyper2lambda/**/=[[auth]] - get-value:x:@.arguments/*/auth - set-value:x:@hyper2lambda/**/=[[module]] - get-value:x:@.arguments/*/module - - // Then transforming file to Hyperlambda and saving it again. - lambda2hyper:x:@hyper2lambda/* - comments:true - io.file.save:x:@strings.concat - get-value:x:@lambda2hyper - - // Making sure we inform caller that he needs to refresh his folders. - set-value:x:@.lambda - strings.concat - .:folders-changed| - get-value:x:@.module-path diff --git a/backend/files/misc/ide/macros/download-image-endpoint.hl b/backend/files/misc/ide/macros/download-image-endpoint.hl deleted file mode 100644 index 958c36075e..0000000000 --- a/backend/files/misc/ide/macros/download-image-endpoint.hl +++ /dev/null @@ -1,126 +0,0 @@ - -// Macro for Hyper IDE that creates an upload image endpoint. -.name:Creates a download image endpoint -.description:"Macro for Hyper IDE that creates a 'download image' HTTP GET endpoint for you where the image is specified as an [image] query parameter. This macro goes hand in hand with the upload image macro, and becomes its 'get' equivalent." -.arguments - . - name:module - type:string - description:"Name of module to create a 'download image endpoint' for" - mandatory:bool:true - . - name:auth - type:string - description:Comma separated list of roles users must belong to in order to invoke endpoint. If empty, there are no authorisation requirements - mandatory:bool:false - . - name:name - type:string - description:Name of your endpoint that becomes the last parts of its URL - mandatory:bool:true - default:download-image - -// Lambda object executed as macro is actually executed. -.lambda - - // Sanity checking invocation. - validators.mandatory:x:@.arguments/*/module - validators.regex:x:@.arguments/*/module - regex:^[a-zA-Z0-9_-]+$ - validators.mandatory:x:@.arguments/*/name - validators.regex:x:@.arguments/*/name - regex:^[a-zA-Z0-9_-]+$ - - // Figuring out module's complete path. - .module-path - set-value:x:@.module-path - strings.concat - .:/modules/ - get-value:x:@.arguments/*/module - .:/ - - // Making sure that module exists. - if - not - io.folder.exists:x:@.module-path - .lambda - - // No such module - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' does not exist" - throw:x:- - public:bool:true - status:int:404 - - // Making sure that module does not already have a 'xxx.get.hl' file. - strings.concat - get-value:x:@.module-path - get-value:x:@.arguments/*/name - .:.get.hl - if - io.file.exists:x:@strings.concat - .lambda - - // File already exists. - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' already has a '" - get-value:x:@.arguments/*/name - .:".get.hl' file and hence we cannot create another" - throw:x:- - public:bool:true - status:int:404 - - // Copying main 'download-image.get.hl' template file from '/misc/idea/templates' folder. - io.file.copy:/misc/ide/templates/download-image.get.hl - get-value:x:@strings.concat - - /* - * Opening 'xxx.get.hl' file such that we can correctly decorate it - * according to arguments specified by caller. - */ - strings.concat - get-value:x:@.module-path - get-value:x:@.arguments/*/name - .:.get.hl - io.file.load:x:@strings.concat - hyper2lambda:x:@io.file.load - comments:true - - // Substituting parameters. - if - or - eq - get-value:x:@.arguments/*/auth - . - eq - get-value:x:@.arguments/*/auth - .: - not - exists:x:@.arguments/*/auth - .lambda - - // No [auth] specified. - remove-nodes:x:@hyper2lambda/**/=[[auth]] - else - - // Auth specified. - set-value:x:@hyper2lambda/**/=[[auth]] - get-value:x:@.arguments/*/auth - set-value:x:@hyper2lambda/**/=[[module]] - get-value:x:@.arguments/*/module - - // Then transforming file to Hyperlambda and saving it again. - lambda2hyper:x:@hyper2lambda/* - comments:true - io.file.save:x:@strings.concat - get-value:x:@lambda2hyper - - // Making sure we inform caller that he needs to refresh his folders. - set-value:x:@.lambda - strings.concat - .:folders-changed| - get-value:x:@strings.concat/@strings.concat diff --git a/backend/files/misc/ide/macros/ensure-database.hl b/backend/files/misc/ide/macros/ensure-database.hl deleted file mode 100644 index 8fb0a50832..0000000000 --- a/backend/files/misc/ide/macros/ensure-database.hl +++ /dev/null @@ -1,146 +0,0 @@ - -// Macro for Hyper IDE that creates a 'magic.startup' folder for you within your module that automatically creates your database if it does not exist from before. -.name:"Ensures your module's database exists" -.description:"Macro for Hyper IDE that creates a 'magic.startup' folder for you within your module's main folder that automatically creates your database if it does not exist from before. Notice, this macro requires that you supply at least one of a MySQL database create script or an MS SQL database create script, or preferably both if you can." -.arguments - . - name:module - type:string - description:"Name of module to create a 'magic.startup' folder for" - mandatory:bool:true - . - name:database - type:string - description:"The name of your application's database. Typically the same as your module's name" - mandatory:bool:true - . - name:mssql - type:multi_string - description:Microsoft SQL server create database SQL script. At least one of the MySQL, PostgreSQL or MS SQL create scripts needs to be supplied. - mandatory:bool:false - . - name:mysql - type:multi_string - description:MySQL create database SQL script. At least one of the MySQL, PostgreSQL or MS SQL create scripts needs to be supplied. - mandatory:bool:false - . - name:pgsql - type:multi_string - description:PostgreSQL create database SQL script. At least one of the MySQL, PostgreSQL or MS SQL create scripts needs to be supplied. - mandatory:bool:false - -// Lambda object executed as macro is actually executed. -.lambda - - // Sanity checking invocation. - validators.mandatory:x:@.arguments/*/module - validators.regex:x:@.arguments/*/module - regex:^[a-zA-Z0-9_-]+$ - - // Figuring out module's complete path. - .module-path - set-value:x:@.module-path - strings.concat - .:/modules/ - get-value:x:@.arguments/*/module - .:/ - - // Making sure that module exists. - if - not - io.folder.exists:x:@.module-path - .lambda - - // No such module - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' does not exist" - throw:x:- - public:bool:true - status:int:404 - - // Making sure that at least one of [mysql] or [mssql] arguments was given. - if - and - not - exists:x:@.arguments/*/mysql - not - exists:x:@.arguments/*/mssql - .lambda - - // Neither MS SQL nor MySQL was given, and hence there are no reasons to create 'magic.startup' folder. - throw:"You have to supply either [mysql] or [mssql] arguments, or both. There are no reasons to create a 'magic.startup' folder without at least one of these" - public:bool:true - status:int:404 - - // Copying main 'magic.startup' template folder from misc folder. - strings.concat - get-value:x:@.module-path - .:/magic.startup/ - io.folder.copy:/misc/ide/template-folders/magic.startup/ - get-value:x:@strings.concat - - /* - * Opening 'create-database.hl' file such that we can correctly decorate it - * according to arguments specified by caller. - * - * First loading file and transforming to lambda. - */ - strings.concat - get-value:x:@.module-path - .:/magic.startup/create-database.hl - io.file.load:x:@strings.concat - hyper2lambda:x:@io.file.load - comments:true - - // Adding module's name into file. - unwrap:x:+/*/* - add:x:@hyper2lambda/*/signal - . - module:x:@.arguments/*/module - database:x:@.arguments/*/module - - // Then transforming file to Hyperlambda and saving it again. - lambda2hyper:x:@hyper2lambda/* - comments:true - io.file.save:x:@strings.concat - get-value:x:@lambda2hyper - - /* - * Checking if caller supplied a [mssql] argument, and if so, creating the - * create MSSQL database file. - */ - if - exists:x:@.arguments/*/mssql - .lambda - - // Creating our 'module.mssql.sql' file. - strings.concat - get-value:x:@.module-path - .:/magic.startup/ - get-value:x:@.arguments/*/module - .:.mssql.sql - io.file.save:x:@strings.concat - get-value:x:@.arguments/*/mssql - - /* - * Checking if caller supplied a [mysql] argument, and if so, creating the - * create MYSQL database file. - */ - if - exists:x:@.arguments/*/mysql - .lambda - - // Creating our 'module.mysql.sql' file. - strings.concat - get-value:x:@.module-path - .:/magic.startup/ - get-value:x:@.arguments/*/module - .:.mysql.sql - io.file.save:x:@strings.concat - get-value:x:@.arguments/*/mysql - - // Making sure we inform caller that he needs to refresh his folders. - set-value:x:@.lambda - .:folders-changed diff --git a/backend/files/misc/ide/macros/ensure-etc-folder.hl b/backend/files/misc/ide/macros/ensure-etc-folder.hl deleted file mode 100644 index 5b0ba1be76..0000000000 --- a/backend/files/misc/ide/macros/ensure-etc-folder.hl +++ /dev/null @@ -1,88 +0,0 @@ - -// Macro for Hyper IDE that ensures that as module is installed, a folder inside of the '/etc/' folder will be created where the module can store its configuration files, images, and other types of dynamic files related to the module. -.name:Ensures your modules has an /etc/ dynamic files folder -.description:"Macro for Hyper IDE that ensures that as module is installed, a folder inside of the '/etc/' folder will be created where the module can store its configuration files, images, and other types of dynamic files related to the module. Notice, the image macros will by default store files inside of this folder, so if you execute the image upload/download macros, you should also probably execute this macro." -.arguments - . - name:module - type:string - description:"Name of module to create an '/etc/' folder for" - mandatory:bool:true - -// Lambda object executed as macro is actually executed. -.lambda - - // Sanity checking invocation. - validators.mandatory:x:@.arguments/*/module - validators.regex:x:@.arguments/*/module - regex:^[a-zA-Z0-9_-]+$ - - // Figuring out module's complete path. - .module-path - set-value:x:@.module-path - strings.concat - .:/modules/ - get-value:x:@.arguments/*/module - .:/ - - // Making sure that module exists. - if - not - io.folder.exists:x:@.module-path - .lambda - - // No such module - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' does not exist" - throw:x:- - public:bool:true - status:int:404 - - /* - * Making sure that module has a 'magic.startup' folder, and creating one - * if no such folder exists. - */ - strings.concat - get-value:x:@.module-path - .:/magic.startup/ - if - not - io.folder.exists:x:@strings.concat - .lambda - - // Creating the module's 'magic.startup' folder. - io.folder.create:x:@strings.concat - - /* - * Lambda object that will be persisted as 'ensure-etc-folder.hl' file inside of - * module's 'magic.startup' folder. - */ - set-value:x:./*/.file/*/.folder - strings.concat - .:/etc/ - .:x:@.arguments/*/module - .:/ - .file - .folder - if - not - io.folder.exists:x:@.folder - .lambda - io.folder.create:x:@.folder - - /* - * Transforming lambda to Hyperlambda and persisting - * as '/modules/xxx/magic.startup/ensure-etc-folder.hl' file. - */ - strings.concat - get-value:x:@.module-path - .:magic.startup/ - .:ensure-etc-folder.hl - io.file.save:x:@strings.concat - lambda2hyper:x:@.file/* - - // Making sure we inform caller that he needs to refresh his folders. - set-value:x:@.lambda - .:folders-changed diff --git a/backend/files/misc/ide/macros/upload-file-endpoint.hl b/backend/files/misc/ide/macros/upload-file-endpoint.hl deleted file mode 100644 index e075bdabcc..0000000000 --- a/backend/files/misc/ide/macros/upload-file-endpoint.hl +++ /dev/null @@ -1,122 +0,0 @@ - -// Macro for Hyper IDE that creates an upload file endpoint. -.name:Creates an upload file endpoint -.description:"Macro for Hyper IDE that creates an 'upload file' HTTP PUT endpoint for you that assumes the file is sent as multipart/form-data. This macros will by default persist the files uploaded in the '/etc/MODULE_NAME/' folder, so you might want to run the 'ensure etc folder' macro too." -.arguments - . - name:module - type:string - description:"Name of module to create an 'upload file endpoint' for" - mandatory:bool:true - . - name:auth - type:string - description:Comma separated list of roles users must belong to in order to invoke endpoint - mandatory:bool:true - . - name:name - type:string - description:Name of your endpoint that becomes the last parts of its URL - mandatory:bool:true - default:upload-file - -// Lambda object executed as macro is actually executed. -.lambda - - // Sanity checking invocation. - validators.mandatory:x:@.arguments/*/module - validators.regex:x:@.arguments/*/module - regex:^[a-zA-Z0-9_-]+$ - validators.mandatory:x:@.arguments/*/name - validators.regex:x:@.arguments/*/name - regex:^[a-zA-Z0-9_-]+$ - - // Figuring out module's complete path. - .module-path - set-value:x:@.module-path - strings.concat - .:/modules/ - get-value:x:@.arguments/*/module - .:/ - - // Making sure that module exists. - if - not - io.folder.exists:x:@.module-path - .lambda - - // No such module - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' does not exist" - throw:x:- - public:bool:true - status:int:404 - - // Making sure that module does not already have an 'xxx.put.hl' file. - strings.concat - get-value:x:@.module-path - get-value:x:@.arguments/*/name - .:.put.hl - if - io.file.exists:x:@strings.concat - .lambda - - // File already exists. - strings.concat - .:"The module called '" - get-value:x:@.arguments/*/module - .:"' already has a '" - get-value:x:@.arguments/*/name - .:".put.hl' file and hence we cannot create another" - throw:x:- - public:bool:true - status:int:404 - - // Copying main 'upload-file.put.hl' template file from 'misc/idea/templates' folder. - io.file.copy:/misc/ide/templates/upload-file.put.hl - get-value:x:@strings.concat - - /* - * Opening 'xxx.put.hl' file such that we can correctly decorate it - * according to arguments specified by caller. - */ - io.file.load:x:@strings.concat - hyper2lambda:x:@io.file.load - comments:true - - // Substituting parameters. - if - or - eq - get-value:x:@.arguments/*/auth - . - eq - get-value:x:@.arguments/*/auth - .: - not - exists:x:@.arguments/*/auth - .lambda - - // No [auth] specified. - remove-nodes:x:@hyper2lambda/**/=[[auth]] - else - - // Auth specified. - set-value:x:@hyper2lambda/**/=[[auth]] - get-value:x:@.arguments/*/auth - set-value:x:@hyper2lambda/**/=[[module]] - get-value:x:@.arguments/*/module - - // Then transforming file to Hyperlambda and saving it again. - lambda2hyper:x:@hyper2lambda/* - comments:true - io.file.save:x:@strings.concat - get-value:x:@lambda2hyper - - // Making sure we inform caller that he needs to refresh his folders. - set-value:x:@.lambda - strings.concat - .:folders-changed| - get-value:x:@strings.concat/@strings.concat diff --git a/backend/files/system/ide/execute-macro.post.hl b/backend/files/system/ide/execute-macro.post.hl deleted file mode 100644 index 4e753dea8a..0000000000 --- a/backend/files/system/ide/execute-macro.post.hl +++ /dev/null @@ -1,32 +0,0 @@ - -// Executes the specified [macro] file passing in the specified [args]. -.arguments - macro:string - args:* -.description:Executes the specified [macro] file passing in the specified [args] -.type:internal - -// Making sure user is authorised to access endpoint. -auth.ticket.verify:root - -// Sanity checking invocation. -validators.mandatory:x:@.arguments/*/macro - -// Loading macro Hyperlambda file and transforming to lambda. -io.file.load:x:@.arguments/*/macro -hyper2lambda:x:@io.file.load - -// Decorating macro's [.lambda] object. -add:x:+/*/* - get-nodes:x:@.arguments/*/args/* -insert-before:x:@hyper2lambda/*/.lambda/0 - . - .arguments - -// Executing macro. -eval:x:@hyper2lambda/*/.lambda - -// Returning success to caller. -unwrap:x:+/* -return - result:x:@hyper2lambda/*/.lambda diff --git a/backend/files/system/ide/macro.get.hl b/backend/files/system/ide/macro.get.hl deleted file mode 100644 index 13f0bf8b9a..0000000000 --- a/backend/files/system/ide/macro.get.hl +++ /dev/null @@ -1,25 +0,0 @@ - -// Returns macro definition to caller. -.arguments - macro:string -.description:Returns macro definition to caller -.type:internal - -// Making sure user is authorised to access endpoint. -auth.ticket.verify:root - -// Sanity checking invocation. -validators.mandatory:x:@.arguments/*/macro - -// Loading macro Hyperlambda file and transforming to lambda. -io.file.load:x:@.arguments/*/macro -hyper2lambda:x:@io.file.load -add:x:../*/return/*/arguments - get-nodes:x:@hyper2lambda/*/.arguments/* - -// Returning result to caller. -unwrap:x:+/* -return - name:x:@hyper2lambda/*/.name - description:x:@hyper2lambda/*/.description - arguments diff --git a/frontend/src/app/_general/components/shortkeys/shortkeys.component.ts b/frontend/src/app/_general/components/shortkeys/shortkeys.component.ts index 1c74188099..f29df454b2 100644 --- a/frontend/src/app/_general/components/shortkeys/shortkeys.component.ts +++ b/frontend/src/app/_general/components/shortkeys/shortkeys.component.ts @@ -158,10 +158,6 @@ const fullkeys: Keys[] = [ name: 'Delete Folder', key: 'Alt + X' }, - { - name: 'Execute macro', - key: 'Alt + O' - }, { name: 'New file', key: 'Alt + A' diff --git a/frontend/src/app/_protected/pages/create/hyper-ide/components/execute-macro-dialog/execute-macro-dialog.component.html b/frontend/src/app/_protected/pages/create/hyper-ide/components/execute-macro-dialog/execute-macro-dialog.component.html deleted file mode 100644 index 3f61d0e4a2..0000000000 --- a/frontend/src/app/_protected/pages/create/hyper-ide/components/execute-macro-dialog/execute-macro-dialog.component.html +++ /dev/null @@ -1,69 +0,0 @@ -
{{data.description}}
- -