xod-project
Advanced tools
Comparing version 0.31.0 to 0.32.0
@@ -22,2 +22,3 @@ // Generated by BUCKLESCRIPT VERSION 5.0.0, PLEASE EDIT WITH CARE | ||
var BeltHoles_Map_String = require("belt-holes/src/BeltHoles_Map_String.bs.js"); | ||
var PatchPath$XodProject = require("./PatchPath.bs.js"); | ||
@@ -27,3 +28,3 @@ function getMatchingBusNodes(patch) { | ||
var toBusNodesByLabel = BeltHoles_Map_String.keepMap(Belt_MapString.keep(BeltHoles_List.groupByString(Belt_List.keep(nodes, function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.TO_BUS_PATH; | ||
return PatchPath$XodProject.isToBus(Node$XodProject.getType(n)); | ||
}), Node$XodProject.getLabel), function (param, ns) { | ||
@@ -37,3 +38,3 @@ return Belt_List.length(ns) === 1; | ||
return Belt_List.fromArray(Belt_MapString.valuesToArray(Belt_MapString.mapWithKey(Belt_MapString.keep(BeltHoles_List.groupByString(Belt_List.keep(nodes, function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.FROM_BUS_PATH; | ||
return PatchPath$XodProject.isFromBus(Node$XodProject.getType(n)); | ||
}), Node$XodProject.getLabel), function (label, param) { | ||
@@ -93,6 +94,6 @@ return Belt_MapString.has(toBusNodesByLabel, label); | ||
var isInputConnectedToBusNode = Belt_Option.mapWithDefault(Patch$XodProject.getNodeById(patch, Link$XodProject.getInputNodeId(link)), false, function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.TO_BUS_PATH; | ||
return PatchPath$XodProject.isToBus(Node$XodProject.getType(n)); | ||
}); | ||
var isOutputConnectedToBusNode = Belt_Option.mapWithDefault(Patch$XodProject.getNodeById(patch, Link$XodProject.getOutputNodeId(link)), false, function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.FROM_BUS_PATH; | ||
return PatchPath$XodProject.isFromBus(Node$XodProject.getType(n)); | ||
}); | ||
@@ -112,3 +113,3 @@ if (isOutputConnectedToBusNode) { | ||
return Belt_Option.map(Belt_Option.flatMap(Patch$XodProject.getNodeById(patch, Link$XodProject.getInputNodeId(link)), function (node) { | ||
var match = Node$XodProject.getType(node) === $dot$dot.TO_BUS_PATH; | ||
var match = PatchPath$XodProject.isToBus(Node$XodProject.getType(node)); | ||
if (match) { | ||
@@ -115,0 +116,0 @@ return Caml_option.some(node); |
@@ -43,2 +43,4 @@ 'use strict'; | ||
var GLOBALS_LITERALS = exports.GLOBALS_LITERALS = ['=XOD_USERNAME', '=XOD_PROJECT', '=XOD_TOKEN']; | ||
var MAX_ARITY_STEP = exports.MAX_ARITY_STEP = 3; | ||
@@ -45,0 +47,0 @@ |
@@ -116,6 +116,6 @@ 'use strict'; | ||
// :: String -> Boolean | ||
var isFromBusPatchPath = exports.isFromBusPatchPath = R.equals(CONST.FROM_BUS_PATH); | ||
var isFromBusPatchPath = exports.isFromBusPatchPath = R.startsWith(CONST.FROM_BUS_PATH); | ||
// :: String -> Boolean | ||
var isToBusPatchPath = exports.isToBusPatchPath = R.equals(CONST.TO_BUS_PATH); | ||
var isToBusPatchPath = exports.isToBusPatchPath = R.startsWith(CONST.TO_BUS_PATH); | ||
@@ -122,0 +122,0 @@ // :: String -> Boolean |
@@ -39,3 +39,4 @@ 'use strict'; | ||
version: '0.0.0', | ||
description: '' | ||
description: '', | ||
apiKey: '' | ||
}; | ||
@@ -42,0 +43,0 @@ |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.removeDebugNodes = exports.validatePatchReqursively = exports.isValidProject = exports.validateProject = exports.getPatchDependencies = exports.changeNodeTypeUnsafe = exports.omitDeadLinksByNodeId = exports.listAbstractPatchSpecializations = exports.resolveNodeTypesInProject = exports.isTerminalNodeInUse = exports.getPatchByNodeIdUnsafe = exports.getPatchByNodeId = exports.getNodePin = exports.updatePatch = exports.rebasePatch = exports.validatePatchRebase = exports.omitPatches = exports.dissocPatch = exports.mergePatchesList = exports.upsertPatches = exports.lensPatch = exports.assocPatch = exports.validatePatchContents = exports.getInvalidBoundNodePins = exports.validateLinkPins = exports.getNodePins = exports.getPatchByNode = exports.getPinsForNode = exports.hasPatch = exports.getPatchByPathUnsafe = exports.getPatchByPath = exports.listMissingLibraryNames = exports.listLibraryNamesUsedInProject = exports.listInstalledLibraryNames = exports.listLibraryPatches = exports.listLocalPatches = exports.listPatchPaths = exports.listGenuinePatches = exports.listPatches = exports.isPathBuiltIn = exports.injectProjectTypeHints = exports.setProjectLicense = exports.getProjectLicense = exports.setProjectAuthors = exports.getProjectAuthors = exports.setProjectDescription = exports.getProjectDescription = exports.setProjectVersion = exports.getProjectVersion = exports.setProjectName = exports.getProjectName = exports.createProject = undefined; | ||
exports.removeDebugNodes = exports.validatePatchReqursively = exports.isValidProject = exports.validateProject = exports.getPatchDependencies = exports.changeNodeTypeUnsafe = exports.omitDeadLinksByNodeId = exports.listAbstractPatchSpecializations = exports.resolveNodeTypesInProject = exports.isTerminalNodeInUse = exports.getPatchByNodeIdUnsafe = exports.getPatchByNodeId = exports.getNodePin = exports.updatePatch = exports.rebasePatch = exports.validatePatchRebase = exports.omitPatches = exports.dissocPatch = exports.mergePatchesList = exports.upsertPatches = exports.lensPatch = exports.assocPatch = exports.validatePatchContents = exports.getInvalidBoundNodePins = exports.validateLinkPins = exports.getNodePins = exports.getPatchByNode = exports.getPinsForNode = exports.hasPatch = exports.getPatchByPathUnsafe = exports.getPatchByPath = exports.listMissingLibraryNames = exports.listLibraryNamesUsedInProject = exports.listInstalledLibraryNames = exports.listLibraryPatches = exports.listLocalPatches = exports.listPatchPaths = exports.listGenuinePatches = exports.listPatches = exports.isPathBuiltIn = exports.injectProjectTypeHints = exports.setProjectLicense = exports.getProjectLicense = exports.setProjectAuthors = exports.getProjectAuthors = exports.setProjectDescription = exports.getProjectDescription = exports.setApiKey = exports.getApiKey = exports.setProjectVersion = exports.getProjectVersion = exports.setProjectName = exports.getProjectName = exports.createProject = undefined; | ||
@@ -85,3 +85,4 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
patches: {}, | ||
name: '' | ||
name: '', | ||
apiKey: '' | ||
}; | ||
@@ -98,2 +99,6 @@ }); | ||
var getApiKey = exports.getApiKey = (0, _types.def)('getXcsApiKey :: Project -> String', R.prop('apiKey')); | ||
var setApiKey = exports.setApiKey = (0, _types.def)('setXcsApiKey :: String -> Project -> Project', R.assoc('apiKey')); | ||
/** | ||
@@ -100,0 +105,0 @@ * @function getProjectDescription |
@@ -157,3 +157,4 @@ 'use strict'; | ||
version: Version, | ||
description: _sanctuaryDef2.default.String | ||
description: _sanctuaryDef2.default.String, | ||
apiKey: _sanctuaryDef2.default.String | ||
}); | ||
@@ -160,0 +161,0 @@ |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.isValidLiteral = exports.getTypeFromLiteralUnsafe = exports.getTypeFromLiteral = exports.isValidCharLiteral = exports.isLikeCharLiteral = exports.isValidPortLiteral = exports.isValidNumberDataValue = exports.numberDataTypeRegExp = exports.resolveLinkNodeIds = exports.resolveNodeIds = exports.isBuiltInType = exports.canCastTypes = exports.defaultValueOfType = exports.isGenericType = exports.validateId = exports.generateId = exports.ensureEndsWithSlash = undefined; | ||
exports.isValidLiteral = exports.getTypeFromLiteralUnsafe = exports.getTypeFromLiteral = exports.isValidStringLiteral = exports.isValidCharLiteral = exports.isLikeCharLiteral = exports.isValidPortLiteral = exports.isValidNumberDataValue = exports.numberDataTypeRegExp = exports.resolveLinkNodeIds = exports.resolveNodeIds = exports.isBuiltInType = exports.canCastTypes = exports.defaultValueOfType = exports.isGenericType = exports.validateId = exports.generateId = exports.ensureEndsWithSlash = undefined; | ||
@@ -194,2 +194,4 @@ var _ramda = require('ramda'); | ||
var isValidStringLiteral = exports.isValidStringLiteral = (0, _types.def)('isValidStringLiteral :: String -> Boolean', R.either((0, _xodFuncTools.isAmong)(R.values(CONST.GLOBALS_LITERALS)), R.test(/^".*"$/gi))); | ||
var getTypeFromLiteral = exports.getTypeFromLiteral = (0, _types.def)('getTypeFromLiteral :: DataValue -> Either Error DataType', function (literal) { | ||
@@ -202,3 +204,3 @@ if (!R.is(String, literal)) return (0, _xodFuncTools.fail)('BAD_LITERAL_VALUE', { value: literal }); | ||
if (R.test(/^".*"$/gi, literal)) return _ramdaFantasy.Either.of(CONST.PIN_TYPE.STRING); | ||
if (isValidStringLiteral(literal)) return _ramdaFantasy.Either.of(CONST.PIN_TYPE.STRING); | ||
@@ -205,0 +207,0 @@ if (R.either(isValidCharLiteral, R.test(/^[0-9a-f]{2}h|[0,1]{8}b|\d{1,3}d$/gi))(literal)) return _ramdaFantasy.Either.of(CONST.PIN_TYPE.BYTE); |
{ | ||
"name": "xod-project", | ||
"version": "0.31.0", | ||
"version": "0.32.0", | ||
"description": "API functions to work on XOD project state", | ||
@@ -31,3 +31,3 @@ "keywords": [], | ||
"shortid": "^2.2.6", | ||
"xod-func-tools": "^0.30.0" | ||
"xod-func-tools": "^0.32.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
@@ -22,2 +22,3 @@ // Generated by BUCKLESCRIPT VERSION 5.0.0, PLEASE EDIT WITH CARE | ||
var BeltHoles_Map_String = require("belt-holes/src/BeltHoles_Map_String.bs.js"); | ||
var PatchPath$XodProject = require("./PatchPath.bs.js"); | ||
@@ -27,3 +28,3 @@ function getMatchingBusNodes(patch) { | ||
var toBusNodesByLabel = BeltHoles_Map_String.keepMap(Belt_MapString.keep(BeltHoles_List.groupByString(Belt_List.keep(nodes, (function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.TO_BUS_PATH; | ||
return PatchPath$XodProject.isToBus(Node$XodProject.getType(n)); | ||
})), Node$XodProject.getLabel), (function (param, ns) { | ||
@@ -36,3 +37,3 @@ return Belt_List.length(ns) === 1; | ||
return Belt_List.fromArray(Belt_MapString.valuesToArray(Belt_MapString.mapWithKey(Belt_MapString.keep(BeltHoles_List.groupByString(Belt_List.keep(nodes, (function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.FROM_BUS_PATH; | ||
return PatchPath$XodProject.isFromBus(Node$XodProject.getType(n)); | ||
})), Node$XodProject.getLabel), (function (label, param) { | ||
@@ -96,6 +97,6 @@ return Belt_MapString.has(toBusNodesByLabel, label); | ||
var isInputConnectedToBusNode = Belt_Option.mapWithDefault(Patch$XodProject.getNodeById(patch, Link$XodProject.getInputNodeId(link)), false, (function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.TO_BUS_PATH; | ||
return PatchPath$XodProject.isToBus(Node$XodProject.getType(n)); | ||
})); | ||
var isOutputConnectedToBusNode = Belt_Option.mapWithDefault(Patch$XodProject.getNodeById(patch, Link$XodProject.getOutputNodeId(link)), false, (function (n) { | ||
return Node$XodProject.getType(n) === $dot$dot.FROM_BUS_PATH; | ||
return PatchPath$XodProject.isFromBus(Node$XodProject.getType(n)); | ||
})); | ||
@@ -118,3 +119,3 @@ if (isOutputConnectedToBusNode) { | ||
return Belt_Option.map(Belt_Option.flatMap(Patch$XodProject.getNodeById(patch, Link$XodProject.getInputNodeId(link)), (function (node) { | ||
var match = Node$XodProject.getType(node) === $dot$dot.TO_BUS_PATH; | ||
var match = PatchPath$XodProject.isToBus(Node$XodProject.getType(node)); | ||
if (match) { | ||
@@ -121,0 +122,0 @@ return Caml_option.some(node); |
@@ -46,2 +46,4 @@ export const IDENTIFIER_RULES = `Only a-z, 0-9 and - are allowed. | ||
export const GLOBALS_LITERALS = ['=XOD_USERNAME', '=XOD_PROJECT', '=XOD_TOKEN']; | ||
export const MAX_ARITY_STEP = 3; | ||
@@ -48,0 +50,0 @@ |
@@ -127,6 +127,6 @@ import * as R from 'ramda'; | ||
// :: String -> Boolean | ||
export const isFromBusPatchPath = R.equals(CONST.FROM_BUS_PATH); | ||
export const isFromBusPatchPath = R.startsWith(CONST.FROM_BUS_PATH); | ||
// :: String -> Boolean | ||
export const isToBusPatchPath = R.equals(CONST.TO_BUS_PATH); | ||
export const isToBusPatchPath = R.startsWith(CONST.TO_BUS_PATH); | ||
@@ -133,0 +133,0 @@ // :: String -> Boolean |
@@ -28,2 +28,3 @@ import * as R from 'ramda'; | ||
description: '', | ||
apiKey: '', | ||
}; | ||
@@ -30,0 +31,0 @@ |
@@ -56,2 +56,3 @@ import * as R from 'ramda'; | ||
name: '', | ||
apiKey: '', | ||
})); | ||
@@ -79,2 +80,12 @@ | ||
export const getApiKey = def( | ||
'getXcsApiKey :: Project -> String', | ||
R.prop('apiKey') | ||
); | ||
export const setApiKey = def( | ||
'setXcsApiKey :: String -> Project -> Project', | ||
R.assoc('apiKey') | ||
); | ||
/** | ||
@@ -81,0 +92,0 @@ * @function getProjectDescription |
@@ -150,2 +150,3 @@ import HMDef from 'hm-def'; | ||
description: $.String, | ||
apiKey: $.String, | ||
}); | ||
@@ -152,0 +153,0 @@ |
@@ -197,2 +197,7 @@ import * as R from 'ramda'; | ||
export const isValidStringLiteral = def( | ||
'isValidStringLiteral :: String -> Boolean', | ||
R.either(isAmong(R.values(CONST.GLOBALS_LITERALS)), R.test(/^".*"$/gi)) | ||
); | ||
export const getTypeFromLiteral = def( | ||
@@ -210,3 +215,3 @@ 'getTypeFromLiteral :: DataValue -> Either Error DataType', | ||
if (R.test(/^".*"$/gi, literal)) return Either.of(CONST.PIN_TYPE.STRING); | ||
if (isValidStringLiteral(literal)) return Either.of(CONST.PIN_TYPE.STRING); | ||
@@ -213,0 +218,0 @@ if ( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1267378
16157
+ Addedxod-func-tools@0.32.0(transitive)
- Removedxod-func-tools@0.30.0(transitive)
Updatedxod-func-tools@^0.32.0