@squidcloud/backend 1.0.402 → 1.0.404
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/backend/src/actions.d.ts +18 -1
- package/dist/backend/src/project.d.ts +7 -2
- package/dist/backend/src/public-types.d.ts +1 -0
- package/dist/backend/src/squid.service.d.ts +12 -2
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/public-types-backend/bundle-api.public-types.d.ts +6 -1
- package/dist/internal-common/src/public-types-backend/bundle-data.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +11 -0
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AiFunctionId, ApiEndpointId, CollectionName, IntegrationId, IntegrationType, TopicName } from '@squidcloud/client';
|
|
2
2
|
import { JSONSchema } from 'json-schema-typed';
|
|
3
|
-
import { ActionMethodDecorator, AiFunctionAction, ClientConnectionStateChangeAction, ExecutableAction, LimiterConfig, LimitsAction, LlmAskAction, McpAuthorizerAction, McpToolAction, SchedulerAction, SecureAiAgentAction, SecureApiAction, SecureDatabaseAction, SecureDistributedLockAction, SecureGraphQLAction, SecureMetricAction, SecureNativeQueryAction, SecureStorageAction, SecureTopicAction, TriggerAction, WebhookAction } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
|
|
3
|
+
import { ActionMethodDecorator, AiFunctionAction, ClientConnectionStateChangeAction, ExecutableAction, LimiterConfig, LimitsAction, LlmAskAction, McpAuthorizerAction, McpToolAction, SchedulerAction, SecureAiAgentAction, SecureAiQueryAction, SecureApiAction, SecureDatabaseAction, SecureDistributedLockAction, SecureGraphQLAction, SecureMetricAction, SecureNativeQueryAction, SecureStorageAction, SecureTopicAction, TriggerAction, WebhookAction } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
|
|
4
4
|
import { AiFunctionAttributes, AiFunctionParam, DatabaseActionType, MetricActionType, StorageActionType, TopicActionType } from '../../internal-common/src/public-types-backend/bundle-data.public-types';
|
|
5
5
|
import { AiFunctionsConfiguratorRequest, AiFunctionsConfiguratorResponse, CronExpression, CronExpressionString, LlmServiceOptions, McpServerOptions, MutationType, SchedulerId, TriggerId, WebhookId } from './public-types';
|
|
6
6
|
/**
|
|
@@ -21,6 +21,23 @@ import { AiFunctionsConfiguratorRequest, AiFunctionsConfiguratorResponse, CronEx
|
|
|
21
21
|
* @category Decorator
|
|
22
22
|
*/
|
|
23
23
|
export declare function secureDatabase<T extends DatabaseActionType>(type: T, integrationId?: IntegrationId): ActionMethodDecorator<SecureDatabaseAction<T>>;
|
|
24
|
+
/**
|
|
25
|
+
* Decorator that marks a function for securing a database for querying it with AI (`executeAiQuery`).
|
|
26
|
+
*
|
|
27
|
+
* The decorator takes an optional integration ID.
|
|
28
|
+
* If no integration ID is provided, the `built_in_db` integration is used.
|
|
29
|
+
*
|
|
30
|
+
* The function should return a boolean or a `Promise` of a boolean indicating
|
|
31
|
+
* whether the action is allowed.
|
|
32
|
+
* In addition, the function takes a context object as a parameter.
|
|
33
|
+
* The context object contains information about the action.
|
|
34
|
+
*
|
|
35
|
+
* @param integrationId The ID of the integration to secure.
|
|
36
|
+
* @category Database
|
|
37
|
+
* @category Decorator
|
|
38
|
+
* @category AI
|
|
39
|
+
*/
|
|
40
|
+
export declare function secureAiQuery(integrationId?: IntegrationId): ActionMethodDecorator<SecureAiQueryAction>;
|
|
24
41
|
/**
|
|
25
42
|
* Decorator that marks a function for securing a collection inside a database.
|
|
26
43
|
* The decorator takes the collection, type of action, and an optional integration ID.
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { Squid } from '@squidcloud/client';
|
|
1
2
|
/**
|
|
2
3
|
* The SquidProject class is the entry point for the Squid backend project.
|
|
3
4
|
*/
|
|
4
5
|
export declare class SquidProject {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Initializes lifecycle metadata so the runtime knows which hooks the connector implements.
|
|
8
|
+
*/
|
|
9
|
+
constructor();
|
|
10
|
+
/** Returns the main Squid instance with the current backend configuration. */
|
|
11
|
+
get squid(): Squid;
|
|
7
12
|
}
|
|
@@ -2,6 +2,7 @@ export * from '../../internal-common/src/public-types-backend/ai-agent.public-co
|
|
|
2
2
|
export * from '../../internal-common/src/public-types-backend/api-call.public-context';
|
|
3
3
|
export * from '../../internal-common/src/public-types-backend/application.public-types';
|
|
4
4
|
export * from '../../internal-common/src/public-types-backend/bundle-api.public-types';
|
|
5
|
+
export * from '../../internal-common/src/public-types-backend/bundle-data.public-types';
|
|
5
6
|
export * from '../../internal-common/src/public-types-backend/distributed-lock.public-context';
|
|
6
7
|
export * from '../../internal-common/src/public-types-backend/graphql.public-context';
|
|
7
8
|
export * from '../../internal-common/src/public-types-backend/llm.public-types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AiStatusMessage, AuthWithApiKey, AuthWithBearer, ClientId, RunContext, SecretKey, SecretValue, Squid, SquidRegion } from '@squidcloud/client';
|
|
2
2
|
import { SquidFile } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
|
|
3
|
+
import { TenantModuleId } from '../../internal-common/src/public-types-backend/bundle-data.public-types';
|
|
3
4
|
/**
|
|
4
5
|
* A base class for all the different types of Squid backend services. This class serves as a container
|
|
5
6
|
* for the various methods implemented in the backend in order to customize the Squid backend for an application.
|
|
@@ -9,7 +10,6 @@ export declare class SquidService {
|
|
|
9
10
|
* Your application's region. When developing locally, the region will be set to `local`.
|
|
10
11
|
*/
|
|
11
12
|
readonly region: SquidRegion;
|
|
12
|
-
private readonly consoleRegion;
|
|
13
13
|
readonly backendBaseUrl: string;
|
|
14
14
|
private readonly config;
|
|
15
15
|
constructor();
|
|
@@ -129,5 +129,15 @@ export declare class SquidService {
|
|
|
129
129
|
* Returns a singleton instance of Squid service. Creates the service if needed.
|
|
130
130
|
* Inherits code bundle info from the caller service: should only be called from the services within the same code
|
|
131
131
|
* bundle (user code, connector, etc...).
|
|
132
|
+
* @deprecated: Use `squidInject`.
|
|
133
|
+
* This method will be removed in the future.
|
|
132
134
|
*/
|
|
133
|
-
export declare function getSquidService<T extends SquidService>(ctor: new () => T, callerService
|
|
135
|
+
export declare function getSquidService<T extends SquidService>(ctor: new () => T, callerService?: unknown): T;
|
|
136
|
+
/**
|
|
137
|
+
* Returns a singleton instance of Squid service. Creates the service if needed.
|
|
138
|
+
* This method can only be used after the Squid module is initialized:
|
|
139
|
+
* not from the static context when the module is loading.
|
|
140
|
+
*/
|
|
141
|
+
export declare function squidInject<T extends SquidService>(ctor: new () => T, moduleId?: TenantModuleId): T;
|
|
142
|
+
/** Returns the main Squid instance with the current backend configuration. */
|
|
143
|
+
export declare function getSquid(): Squid;
|