New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

krl-compiler

Package Overview
Dependencies
Maintainers
2
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

krl-compiler - npm Package Versions

1
13

0.14.1

Diff

farskipper
published 0.14.0 •

farskipper
published 0.13.0 •

Changelog

Source

0.13.0 - September 13, 2017

Wrangler rewrite (krl/io.picolabs.pico.krl)

Wrangler provides a lot of the engine module functionality. It aims for easy, programmatically management of registering, installing, uninstalling, and listing rulesets, creation, deletion and listing of channels, as well as creation, deletion and listing of children picos. Wrangler allows you to write code to do everything that a user would us the UI for.

New Features

  • added testing for wrangler (see src/tests.js)
  • every pico now has an "admin" channel. To get it use engine:getAdminECI(pico_id)
  • engine:newPico(pico_id) now sets the parent id to pico_id creates an admin channel for you.
  • added engine:getParent(pico_id) and engine:listChildren(pico_id)
  • added engine:listInstalledRIDs(pico_id)
  • all engine:* functions that have a pico_id argument now defaults to meta:picoId
  • channel ECIs' are now sovrin DIDs.

Bug Fixes

  • sharing defaction between rulesets now return the right value
  • system rulesets (those in krl/) now are loaded by dependency ordering.
  • error handling on infinite recursion
farskipper
published 0.12.0 •

Changelog

Source

0.12.0 - May 25, 2017

New Features

  • defaction can return values (expose values to setting(..))
<name> = defaction(<params...>){
     <declaration 0>
     <declaration 1>
     ...

     <action block (i.e. anything you would put in a rule action)>

    returns <expr 0>, <expr 1>, ...
}

NOTE: returns is optional

For example

global {
    foo = defaction(){

        send_directive("foobar")

        returns 1, 2, 3
    }
}
rule bar {
    select when ...

    foo() setting(a, b, c)

    fired {
        //a = 1, b = 2, c = 3
    }
}

Another example

global {
    foo = defaction(){
        every {
            http:get(...) setting(resp)
        }
        return resp["content"].decode()["msg"]
    }
}
rule bar {
    select when ...

    foo() setting(message)
}
  • new action block type: sample This will randomly select an action to run.
rule bar {
    select when ...

    //randomly pick one of these 3 actions to run
    sample {
        send_directive("foo")

        send_directive("bar")

        send_directive("baz")
    }
}
  • action block syntax. The semi-colons are optional.
ActionBlock ->
      <action> ;
    | if <expr> then <action> ;
    | if <expr> then every  { <action 0> ; <action 1> ; ... }
    | if <expr> then sample { <action 0> ; <action 1> ; ... }
    | every  { <action 0> ; <action 1> ; ... }
    | sample { <action 0> ; <action 1> ; ... }
    | choose <expr> { <action 0> ; <action 1> ; ... }

BREAKING CHANGES

  • with is no longer used for named arguments. Both for functions and actions.
//OLD WAY
foo(1, 2) with a = 3 and b = 4

//NEW WAY
foo(1, 2, a = 3, b = 4)
  • with is no longer used on raise/schedule
//OLD WAY
raise domain event "type" with foo = 1 and bar = 2

//NEW WAY
raise domain event "type" attributes {"foo": 1, "bar": 2}
  • send_directive no longer uses with it's now send_directive(name, options = {})
//OLD WAY
send_directive("name") with foo = x and bar = y

//NEW WAY
send_directive("name", {"foo": x, "bar": y})
  • No optional semi-colon after select when ...
//OLD WAY
select when foo bar;

//NEW WAY
select when foo bar

Bug Fixes

  • syntax ambiguities caused by with
farskipper
published 0.11.0 •

Changelog

Source

0.11.0 - May 20, 2017

New Features

  • defaction can do anything a rule action can
<name> = defaction(<params...>){
     <declaration 0>
     <declaration 1>
     ...
     <action block (i.e. anything you would put in a rule action)>
}

For example

chooser = defaction(val){

    baz = "hello"
    qux = "bye"

    choose val {
        asdf =>
            foo(val)
        fdsa =>
            bar(val, "ok", "done")
    }
}
  • default parameters for function and defaction (no more configure using)
foo = function(bar = 2, baz = bar + 3){
    bar + baz
}

//-or- when it gets too long
foo = function(
    bar = 2,
    baz = bar + 3,
    qux = 4,
    quux = blah(qux),
){
   ...
}


//defaction parameters work the same way as functions

BREAKING CHANGES

  • You can no longer use actions as functions
//the following are now actions and cannot be used as a function
engine:newPico
engine:removePico
engine:newChannel
engine:removeChannel
engine:registerRuleset
engine:unregisterRuleset
engine:installRuleset
engine:uninstallRuleset
event:send
schedule:remove

Bug Fixes

  • re-registering rulesets breaks the schedule order
farskipper
published 0.10.1 •

farskipper
published 0.10.0 •

farskipper
published 0.9.0 •

farskipper
published 0.8.0 •

farskipper
published 0.7.2 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc