iii-browser-sdk 0.26.0-rc.2 → 0.26.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2895,6 +2895,8 @@ function resolveNamespace(optionNamespace) {
2895
2895
  if (optionNamespace !== void 0 && optionNamespace.trim() === "") throw new Error(`namespace is empty: options.namespace was set to ${JSON.stringify(optionNamespace)}. Give it a name, or leave it unset to register in \`default\`.`);
2896
2896
  return optionNamespace;
2897
2897
  }
2898
+ /** The upgrade guide the removed 0.25 trigger APIs point to. */
2899
+ const UPGRADE_GUIDE = "https://iii.dev/docs/upgrading/from-0-25-x";
2898
2900
  var Sdk = class {
2899
2901
  constructor(address, options) {
2900
2902
  this.address = address;
@@ -3087,6 +3089,15 @@ var Sdk = class {
3087
3089
  return this.invokeRemote(req, namespace);
3088
3090
  };
3089
3091
  this.trigger = this.call;
3092
+ this.registerTrigger = () => {
3093
+ throw new Error(`registerTrigger was removed in iii 0.26.0: bind functions with iii.observe(source, target). registerTrigger({ type: 'cron', function_id, config }) becomes iii.observe({ function_id: 'cron::on-tick', args: config }, function_id). Every trigger type's function is in the migration guide: ${UPGRADE_GUIDE}`);
3094
+ };
3095
+ this.registerTriggerType = () => {
3096
+ throw new Error(`registerTriggerType was removed in iii 0.26.0: a trigger type is now a function that consumers observe. Register it with registerFunction('<worker>::on-<event>', (event) => event, { args_format, private: true }), move the TriggerHandler to onObserverAdded and onObserverRemoved, and call the function once per event. Migration guide: ${UPGRADE_GUIDE}#move-a-trigger-type-to-an-observable-function`);
3097
+ };
3098
+ this.unregisterTriggerType = () => {
3099
+ throw new Error(`unregisterTriggerType was removed in iii 0.26.0: a trigger type is now a function. Unregister it with the FunctionRef that registerFunction returns: functionRef.unregister(). Migration guide: ${UPGRADE_GUIDE}#move-a-trigger-type-to-an-observable-function`);
3100
+ };
3090
3101
  this.__helpers_create_stream = (streamName, stream) => {
3091
3102
  this.registerFunction(`stream::get(${streamName})`, stream.get.bind(stream));
3092
3103
  this.registerFunction(`stream::set(${streamName})`, stream.set.bind(stream));