Socket
Book a DemoInstallSign in
Socket

@concepto/dsl_parser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@concepto/dsl_parser

Concepto DSL - visually create and maintain modern node.js based apps (@dsl_parser)

Source
npmnpm
Version
1.5.63
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Concepto DSL Logo

A progressive Node.js framework for visually building efficient and scalable nodejs based applications.

NPM Version Package License NPM Downloads

Description

ES6 Class for creating and parsing Concepto DSL files.
Note you need to pass all arguments as an object with keys.

API Reference

dsl_parser: A class for parsing Concepto DSL files, and compile them with the OPEN Framework.

dsl_parser.process()

Executes initial processing for parser

Kind: instance method of dsl_parser

dsl_parser.getParser() ⇒ Object

Gets a reference to the internal parser

Kind: instance method of dsl_parser

Get all nodes that contain the given arguments (all optional)

Kind: instance method of dsl_parser

ParamTypeDefaultDescription
[text]StringFinds all nodes that contain its text with this value
[attribute]StringFinds all nodes that contain an attribute with this name
[attribute_value]StringFinds all nodes that contain an attribute with this value
[icon]StringFinds all nodes that contain these icons
[level]IntFinds all nodes that are on this level
[link]StringFinds all nodes that contains this link
[recurse]Booleantrueinclude its children
[nodes_raw]Booleanfalseif this is true, includes key nodes_raw (children nodes) in result with a cheerio reference instead of processing them.

dsl_parser.addNode(parent_id, node)

Adds a node as an xml child of the given parent node ID

Kind: instance method of dsl_parser

ParamTypeDescription
parent_idStringID of parent node
nodeNodeDSLNodeDSL object to add

dsl_parser.editNode(node_id, data)

Edits the given node ID data keys

Kind: instance method of dsl_parser

ParamTypeDescription
node_idStringID of node to edit
dataNodeDSLNodeDSL object properties to modify or method(existing_properties_of_node) that returns object data to modify

dsl_parser.nodeToXML(node)

Converts a NodeDSL into an XML of ConceptoDSL node child

Kind: instance method of dsl_parser

ParamTypeDescription
nodeNodeDSLNodeDSL origin object

dsl_parser.getNode(id, [recurse], [dates], [$], [nodes_raw]) ⇒ Array.<NodeDSL>

Get node data for the given id

Kind: instance method of dsl_parser

ParamTypeDefaultDescription
idStringID of node to request
[recurse]Booleantrueinclude its children
[dates]Booleantrueinclude parsing creation/modification dates
[$]Booleanfalseinclude cheerio reference
[nodes_raw]Booleanfalseif recurse is false and this is true, includes key nodes_raw (children nodes) in result with a cheerio reference instead of processing them.

dsl_parser.getParentNode(id, [recurse]) ⇒ NodeDSL

Returns the parent node of the given node id

Kind: instance method of dsl_parser

ParamTypeDefaultDescription
idStringID of node to request
[recurse]Booleanfalseinclude its children

dsl_parser.getParentNodesIDs(id, [array]) ⇒ String | Array

Returns the parent nodes ids of the given node id

Kind: instance method of dsl_parser

ParamTypeDefaultDescription
idStringnode id to query
[array]Booleanfalseget results as array, or as a string

dsl_parser.getChildrenNodesIDs(id, [array]) ⇒ String | Array

Returns the children nodes ids of the given node id

Kind: instance method of dsl_parser

ParamTypeDefaultDescription
idStringnode id to query
[array]Booleanfalseget results as array, or as a string

dsl_parser.getBrotherNodesIDs(id, [before], [after], [array]) ⇒ String

Returns the brother nodes ids of the given node id

Kind: instance method of dsl_parser

ParamTypeDefaultDescription
idStringnode id to query
[before]Booleantrueconsider brothers before the queried node
[after]Booleantrueconsider brothers after the queried node
[array]Booleanfalseget results as array of objects, or as a string

dsl_parser.createGitVersion([remove], [extrastep]) ⇒ String

Returns a modified version of the current loaded DSL, ready to be push to a version control (like github)

Kind: instance method of dsl_parser
Returns: String - Modified DSL source ready to be saved and pushed to a version control

ParamTypeDefaultDescription
[remove]BooleantrueRemove modified dates? (default:true)
[extrastep]functionOptional method to return make additional cleansing and return the xml

dsl_parser.findVariables(text, [symbol], [symbol_closing], [array]) ⇒ String

Finds variables within given text

Kind: instance method of dsl_parser

ParamTypeDefaultDescription
textStringString from where to parse variables
[symbol]String**Wrapper symbol used as variable openning definition.
[symbol_closing]String**Wrapper symbol used as variable closing definition.
[array]Booleanfalseget results as array, or as a string

dsl_parser.replaceVarsSymbol(text, from, to) ⇒ String

Finds and transform variables wrapping/handlebars symbols given a 'from' symbol object and a 'to' symbol object within the given text

Kind: instance method of dsl_parser

ParamTypeDescription
textStringString from where to parse variables
fromObjectObject to identify source variables symbols (keys: open and close)
toObjectObject to identify target variables symbols (keys: open and close)

dsl_parser.getDifferences(from, to)

Finds all differences 'from' given dsl 'to' given dsl (for CLI arg --diff-from file.dsl) and returns an object with 'deleted', 'added', and 'modified' IDs keys

Kind: instance method of dsl_parser

ParamTypeDescription
fromStringFrom source DSL content (before code)
toStringTo source DSL content (after code, to compare)

dsl_parser~NodeDSL : Object

A node object representation of a DSL node.

Kind: inner typedef of dsl_parser
Properties

NameTypeDescription
idstringNode unique ID.
levelnumberIndicates the depth level from the center of the dsl map.
textstringIndicates the text defined in the node itself.
text_richstringIndicates the html defined in the node itself.
text_notestringIndicates the text/html defined in the notes view of the node (if any).
imagestringImage link defined as an image within the node.
cloudObjectCloud information of the node.
cloud.bgcolorstringBackground color of cloud.
cloud.usedbooleanTrue if cloud is used, false otherwise.
arrowsArray.<Arrow>Visual connections of this node with other nodes #module_dsl_parser..Arrow.
nodesArray.<NodeDSL>Children nodes of current node.
fontObjectDefine font, size and styles of node texts.
font.faceObjectFont face type used on node.
font.sizeObjectFont size used on node.
font.boldObjectTrue if node text is in bold.
font.italicObjectTrue if node text is in italics.
stylestringStyle applied to the node.
colorstringText color of node.
bgcolorstringBackground color of node.
linkstringLink defined on node.
positionstringPosition in relation of central node (left,right).
attributesObjectObject with each attribute (key is attribute name, value is attribute value).
iconsArray.<string>Array with icon names used in the node.
date_modifieddateDate of node when it was last modified.
date_createddateDate of node when it was created.

dsl_parser~Arrow : Object

Arrow object definition, for connections to other nodes within a DSL.

Kind: inner typedef of dsl_parser
Properties

NameTypeDescription
targetstringTarget node ID of connection.
colorstringColor of visual connection.
stylestringGraphical representation type of link (source-to-target, target-to-source, both-ways).

© 2020-2022 Pablo Schaffner <pablo@puntorigen.com>.

Keywords

creador

FAQs

Package last updated on 06 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts