- Bug fixes. Dependency updates.
EcIdentityManager is now instantiatable and may be passed into many library functions. Many method signatures have changed.
- All static EcIdentityManager methods are now instance methods.
- All functions with web interactions will optionally allow
repo
to be specified. - All functions with web or decryption interactions will optionally allow
eim
to be specified. - If
repo
is not specified, the library will employ several methods for operating on that data (in the case of get, delete). If it is specified, the library will strictly only operate on data in that repository. If that is not the case, that is now a defect. - If
eim
is not specified, the library will use a default EcIdentityManager found atEcIdentityManager.default
to perform any necessary operations. In an enforced multitenancy situation, we recommend setting EcIdentityManager.default to null, in order to force errors. - If you are using
eim
, we strongly recommend disabling caching to prevent any tenancy leaks.
As the new EcIdentityManager is instanceable and the static methods and properties are gone, use the default EcIdentityManager.
- Caching has been altered. Results that are not found are now stored in the cache and used to speed up (failed) retreival of data.
Please migrate your code in a separate branch, as you may need to wait for bug fixes and the like.
- All blocking calls are now asynchronous, and the blocking calls have been removed, except for fallback EcCrypto methods.
- All callback based methods now primarily support promise / async / await methods.
- Removed all assertion processing methods except for EcFrameworkGraph.
- Removed rollup rule parsed language.
- Removed /bin/. It was a neat idea.
- Removed dependencies on most JS files in /lib/, except one to facilitate worker based asynchronous cryptography.
- All schema.org objects are now in a schema object. As an example,
Thing
is nowschema.Thing
,Person
is nowschema.Person
. Schema.org objects have been updated to the most recent version. - All CTDL objects are now in a
ce
object. As an example, CE’s version ofCompetency
is now available underce.Competency
. CTDL objects have been updated to the most recent version. - All objects have been moved from using a st-js shim to do class definitions to the ECMAScript 6 class object.
- Removed dependencies on antlr4, browser-or-node, pure-uuid, request, text-encoding, xmlhttprequest, and added dependencies to axios, web-worker, promise-worker.
.getBlocking
is gone. This pattern must be migrated throughout. null
is the default return value if the method fails.
This pattern will continue to function as expected. If failure is omitted, a new Error(error)
will be thrown instead. The following patterns are available to augment use:
All such functions will now return a promise and function with await. If you find one that does not, that is a bug.
2.2 Ec<something>.<function>(<parameters>,success,failure) .then((output)=>console.log(output)) .catch((error)=>console.error(output))
- You may use promise chaining in conjunction with callbacks.
- The callbacks will operate first, and the promise chains will operate second.
- The callbacks are wired into the promises, so you may
return something
from the callbacks and they will be passed into the promises.then((something)=>{})
- The return value from
success
orfailure
will also be available as the result of anawait
ed promise. - The return value from
success
orfailure
may also be a promise. success
orfailure
methods may be async... that seems obvious, but you never know.
2.3 Ec<something>.<function>(<parameters>) .then( (output)=>console.log(output)) .catch((error)=>console.error(output))
You may also omit the callbacks. No callbacks are required. If failure is omitted, a new Error(error)
will be thrown if an error occurs.
2.4 await Ec<something>.<function>(<parameters>) .then( (output)=>console.log(output)) .catch((error)=>console.error(output))
Await on promise based functions also work. This includes search and save and delete!
Anything that had a success(output)
can now retreive that output
using assignment.
.search
,EcEncryptedValue
,EcFrameworkGraph
and any other methods will either use thefailure
callback or, if it doesn't exist, willthrow new Error(error)
and needtry/catch
blocks or.catch((error)=>console.error(error))
to catch the errors..get
andEc<RsaOaep/AesCtr>Async
willreturn null
if the operations fail, though you may use afailure
method if desired, as the callbacks are still supported. These are a special case to mirror the blockable methods.
These methods now use awaitable promises to perform their cryptography.
If any of these patterns do not work, please ask before working around, as there are expected to be edge cases that have not yet been found.
- The cassproject library is no longer created in the eduworks/ec library, and resides entirely within the cass-npm repository.
- All functions work in an equivalent manner.
- You must combine cass-npm with a browserify type method to make it usable on the web.