@squidcloud/backend 1.0.471 → 1.0.472

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.
@@ -1,6 +1,7 @@
1
1
  import { UserAiAskResponse, UserAiChatOptions } from '@squidcloud/client';
2
2
  import { ClientId, IntegrationId } from '@squidcloud/client';
3
3
  import { CollectionName, DocIdOrDocIdObj, DocumentData } from '@squidcloud/client';
4
+ import { TriggerEvent } from '@squidcloud/client';
4
5
  import { ClientConnectionState } from '@squidcloud/client';
5
6
  import { AiFunctionCallContextWithIntegration, SecureAiAgentContext } from './ai-agent.public-context';
6
7
  import { ApiCallContext } from './api-call.public-context';
@@ -14,6 +15,8 @@ import { NativeQueryContext } from './native-query.public-context';
14
15
  import { AiQueryContext, QueryContext } from './query.public-context';
15
16
  import { StorageContext } from './storage.public-types';
16
17
  import { TopicReadContext, TopicWriteContext } from './topic.public-context';
18
+ /** Event types live in the client-visible public-types; re-exported here for the backend SDK surface. */
19
+ export { EmitEventRequest, TriggerEvent } from '@squidcloud/client';
17
20
  /**
18
21
  * @category Database
19
22
  */
@@ -77,6 +80,8 @@ export interface QueueMessageRequest<T = unknown> {
77
80
  /** The message payload. */
78
81
  message: T;
79
82
  }
83
+ /** A type defining an event handler function that responds to an emitted `TriggerEvent`. */
84
+ export type EventHandlerAction<T = unknown> = (event: TriggerEvent<T>) => void | Promise<void>;
80
85
  /** A type defining a trigger function that responds to document changes. */
81
86
  export type TriggerAction = ((request: TriggerRequest) => void | Promise<void>) | (() => void | Promise<void>);
82
87
  /** The context provided to a trigger function. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/backend",
3
- "version": "1.0.471",
3
+ "version": "1.0.472",
4
4
  "description": "Squid Cloud's backend SDK",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -35,7 +35,7 @@
35
35
  "typedoc-plugin-markdown": "^4.8.1"
36
36
  },
37
37
  "peerDependencies": {
38
- "@squidcloud/client": "^1.0.471"
38
+ "@squidcloud/client": "^1.0.472"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=20.0.0"