@newhomestar/sdk 0.7.2 → 0.7.5

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.d.ts CHANGED
@@ -167,6 +167,15 @@ export declare function action<I extends ZodTypeAny, O extends ZodTypeAny>(cfg:
167
167
  path?: string;
168
168
  scopes?: string[];
169
169
  category?: string;
170
+ /**
171
+ * Shorthand for subscribing to Nova event topics.
172
+ * Equivalent to `triggers: [{ type: 'event', events: [...] }]` but more concise.
173
+ *
174
+ * @example
175
+ * events: 'nova_ticketing_service.ticket_created'
176
+ * events: ['nova_ticketing_service.ticket_created', 'nova_ticketing_service.ticket_updated']
177
+ */
178
+ events?: string | string[];
170
179
  /**
171
180
  * Per-field parameter metadata — tells the platform where each input field
172
181
  * goes (path, query, body, header) and what UI widget to render.
package/dist/index.js CHANGED
@@ -159,6 +159,15 @@ function buildTriggerMap(def) {
159
159
  }
160
160
  }
161
161
  }
162
+ // Shorthand: events: string | string[]
163
+ const eventsShorthand = actionDef.events;
164
+ if (eventsShorthand) {
165
+ const eventList = Array.isArray(eventsShorthand) ? eventsShorthand : [eventsShorthand];
166
+ for (const topic of eventList) {
167
+ if (!map.has(topic))
168
+ map.set(topic, actionDef); // triggers take precedence over shorthand
169
+ }
170
+ }
162
171
  // Legacy: capabilities API (backward compat)
163
172
  if (actionDef.capabilities) {
164
173
  for (const cap of actionDef.capabilities) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newhomestar/sdk",
3
- "version": "0.7.2",
3
+ "version": "0.7.5",
4
4
  "description": "Type-safe SDK for building Nova pipelines (workers & functions)",
5
5
  "homepage": "https://github.com/newhomestar/nova-node-sdk#readme",
6
6
  "bugs": {