@oddington/sdk 0.1.27 → 0.1.28

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/README.md CHANGED
@@ -75,8 +75,9 @@ runtime contains `run.id`, `data`, `files`, `connections`, `inbox`, and `step`.
75
75
  Accepted input and saved values are immutable snapshots. Access declarations set
76
76
  maximum named capabilities and grant no authority; the trusted host checks current
77
77
  authority. Response handler IDs are local to the routine and must be unique. A
78
- declared `review` handler crosses the Inbox publication seam as
79
- `invoice-import/review`, without deploying or executing that handler.
78
+ declared `review` handler crosses the Inbox publication seam as `review`; Inbox
79
+ retains the canonical `invoice-import` routine identity separately, without
80
+ deploying or executing that handler.
80
81
 
81
82
  The bounded grammar supports closed objects with required properties, arrays with
82
83
  an explicit `maxItems` from 1 to 64, booleans, strings (at most 4096 code points),
package/dist/browser.js CHANGED
@@ -909,7 +909,10 @@ async function executeRoutineDefinition(definition, input, runtime) {
909
909
  get(_target, key) {
910
910
  return guarded(Reflect.get(value, key, value), value);
911
911
  }
912
- }) : value, qualify = (value) => value.questions === void 0 ? value : { ...value, questions: value.questions.map((question2) => question2.handler ? contract.responses.some((handler) => handler.id === question2.handler.id) ? { ...question2, handler: { ...question2.handler, id: `${contract.id}/${question2.handler.id}` } } : invalid3() : question2) }, os2 = Object.freeze({
912
+ }) : value, validateHandlers = (value) => {
913
+ for (let question2 of value.questions ?? []) if (question2.handler && !contract.responses.some((handler) => handler.id === question2.handler.id)) return invalid3();
914
+ return value;
915
+ }, os2 = Object.freeze({
913
916
  ...guarded({
914
917
  ...runtime,
915
918
  run: freezeRoutineMetadata({ ...runtime.run }),
@@ -923,7 +926,7 @@ async function executeRoutineDefinition(definition, input, runtime) {
923
926
  if (!active2 || broken) throw new Error("Run authority ended");
924
927
  return value;
925
928
  } },
926
- inbox: { ...runtime.inbox, publishAsk: (value, options) => runtime.inbox.publishAsk(qualify(value), options) }
929
+ inbox: { ...runtime.inbox, publishAsk: (value, options) => runtime.inbox.publishAsk(validateHandlers(value), options) }
927
930
  }),
928
931
  step(id3, ...input2) {
929
932
  let saved;
@@ -3280,7 +3283,7 @@ function createBrowserAuth(runtime) {
3280
3283
  }
3281
3284
  c.session = session;
3282
3285
  let email = typeof session.user.email == "string" ? session.user.email.trim() : "", metadata = session.user.user_metadata, name = ["name", "full_name", "first_name"].map((key) => metadata?.[key]).find((value) => typeof value == "string" && value.trim())?.trim() || email, account = !replaced && c.state.account?.email === email && c.state.account.displayName === name ? c.state.account : Object.freeze({ email, displayName: name });
3283
- publish(c, { status: "signed_in", account, ...pending ? { pending } : {} }), notify(c, event);
3286
+ notify(c, event), publish(c, { status: "signed_in", account, ...pending ? { pending } : {} });
3284
3287
  let checkExpiry = () => {
3285
3288
  if (!c.active || !c.session) return;
3286
3289
  let remaining = c.session.expires_at * 1e3 - Date.now();