2018-01-09
This is a developers post.
The API of the sjs-3
interpreter was improved with the following.
The os.TYPESAFE
placement flag was added for moving, copying, creating files. This allows you to programmatically access the same typesafe file placement functionality present on the drag-and-drop frontend.
The os.TYPESAFE
flag enforces that a file can only be placed in a typesafe fashion, where typesafe means conforming the file’s .Accept
rules.
If the bucket is provided, and placement would not be typesafe, the operation will fail.
If the bucket is not provided, Boomla will find the first typesafe bucket and use it. If no bucket is safe, the operation will fail.
Similarly, the os.TYPESAFE_IF_POSSIBLE
placement flag was also added.
It’s like os.TYPESAFE
, but it will proceed anyway instead of failing, when a typesafe bucket is not available.
Docs: os.TYPESAFE_IF_POSSIBLE.
Now you can call f.inline()
directly, instead of calling os.inline(f)
.
Same goes for collection.inline()
, instead of os.inline(collection)
.
Docs: File.inline().
Docs: Collection.inline().
The last argument, the bucket, is now optional.
Now you can call
f.new(os.APPEND, "name")
instead of
f.new(os.APPEND, "name", 0)
The last 2 arguments are now optional. You can use the following 3 forms:
Similarly, the last 2 arguments are now optional. You can use the following 3 forms:
Cheers,