@squidcloud/cli 1.0.463 → 1.0.465

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.
@@ -26,7 +26,7 @@ Squid is a backend-as-a-service platform that provides:
26
26
  - **[ai.md](reference/ai.md)** → AI agents, chat, ask, askWithAnnotations, askAsync, askWithVoiceResponse, transcribeAndChat, transcribeAndAsk, knowledge bases, RAG, embeddings, image generation, audio, transcription, text-to-speech, TTS, connectedAgents, connectedIntegrations, connectedKnowledgeBases, @aiFunction, @secureAiAgent, @secureAiQuery, memory, memoryOptions, voiceOptions, OpenAI, Anthropic, Gemini, Grok, DALL-E, Whisper, MCP, @mcpServer, @mcpTool, executeAiQuery, executeAiApiCall, extraction, createPdf, upsert agent, listAgents
27
27
  - **[chat-widget.md](reference/chat-widget.md)** → AI chat widget, @squidcloud/react-chat-widget, squid-chat-widget, squid-chat-widget-with-fab-button, embeddable chat, custom API webhook, AI query mode, chain-of-thought, status updates, session management, agentContext, memoryOptions, squid-ai-custom-api-url, squid-ai-agent-chat-options, FAB button, theming, CSS variables, localization, RTL, menu items slots, suggested prompts, voice transcription, error formatting, authentication, squid-auth-provider, onChange events
28
28
  - **[databases.md](reference/databases.md)** → collections, documents, queries, subscriptions, snapshots, insert, update, delete, CRUD, real-time, dereference, pagination, transactions, query operators, eq, neq, gt, gte, lt, lte, like, in, nin, arrayIncludesSome, arrayIncludesAll, sortBy, limit, join queries, OR queries, @trigger, native queries, SQL, MongoDB, Elasticsearch, incrementInPath, decrementInPath, watch changes, doc(), projectFields, field projection, __docId__, __id
29
- - **[backend.md](reference/backend.md)** → SquidService, @executable, @webhook, @trigger, TriggerRequest, @scheduler, @limits, rate limiting, quotas, decorators, backend functions, WebhookRequest, CronExpression, cron, file handling, SquidFile, getUserAuth, isAuthenticated, assertIsAuthenticated, createWebhookResponse, this.squid, this.secrets, @clientConnectionStateHandler, CLI, squid init, squid start, squid deploy, squid build, project structure, multiple services, service architecture, squidInject, cross-service communication
29
+ - **[backend.md](reference/backend.md)** → SquidService, @executable, @webhook, @trigger, TriggerRequest, @scheduler, @limits, rate limiting, quotas, decorators, backend functions, WebhookRequest, CronExpression, cron, file handling, SquidFile, getUserAuth, isAuthenticated, assertIsAuthenticated, createWebhookResponse, this.squid, this.secrets, @clientConnectionStateHandler, @onQueueMessage, QueueMessageRequest, queue message handler, server-side queue consumer, CLI, squid init, squid start, squid deploy, squid build, project structure, multiple services, service architecture, squidInject, cross-service communication
30
30
  - **[security.md](reference/security.md)** → security rules, @secureDatabase, @secureCollection, @secureTopic, @secureStorage, @secureApi, @secureNativeQuery, @secureAiQuery, @secureAiAgent, @secureDistributedLock, @secureGraphQL, QueryContext, MutationContext, isSubqueryOf, affectsPath, permissions, authorization, row-level security, role-based access
31
31
  - **[admin.md](reference/admin.md)** → ManagementClient, management API keys, organizations, applications, programmatic management, CI/CD, automation, integrations admin, secrets admin, upsertIntegration, discoverDataConnectionSchema, testDataConnection, createOrganization, createApplication
32
32
  - **[api.md](reference/api.md)** → API, REST API, HTTP endpoints, API reference, Agent API, AI Audio API, AI Image API, KnowledgeBase API, Matchmaking API, Web Utilities API, Database API, Extraction API
@@ -79,6 +79,7 @@ Client → Squid Cloud → Your Backend → Integration → Response
79
79
  | Webhooks from external services | **Yes** | Use `@webhook` decorator |
80
80
  | Scheduled jobs | **Yes** | Use `@scheduler` decorator |
81
81
  | Server-side secrets | **Yes** | Access via `this.secrets` |
82
+ | Handle queue messages server-side | **Yes** | Use `@onQueueMessage` decorator |
82
83
 
83
84
  ### What Squid Cloud Handles
84
85
 
@@ -17,10 +17,11 @@ Docs: https://docs.getsquid.ai/reference-docs/backend/
17
17
  - Triggers (@trigger)
18
18
  - Schedulers (@scheduler)
19
19
  - Rate Limiting (@limits)
20
+ - Queue Message Handlers (@onQueueMessage)
20
21
  - Client Connection State (@clientConnectionStateHandler)
21
22
  - Cross-Service Communication (squidInject)
22
23
  - Using Squid Client in Backend
23
- - File Handling``
24
+ - File Handling
24
25
 
25
26
  ## CLI Commands
26
27
 
@@ -461,6 +462,44 @@ export class MyService extends SquidService {
461
462
  **Scopes:** `'global'`, `'user'`, `'ip'`
462
463
  **Periods:** `'hourly'`, `'daily'`, `'weekly'`, `'monthly'`, `'quarterly'`, `'annually'`
463
464
 
465
+ ## Queue Message Handlers (@onQueueMessage)
466
+
467
+ The `@onQueueMessage` decorator registers a backend handler that is called server-side whenever a message is produced to a queue topic. Unlike client-side `.consume()`, this handler runs in the backend with full permissions and no client connection required.
468
+
469
+ ```typescript
470
+ import { SquidService, onQueueMessage, QueueMessageRequest } from '@squidcloud/backend';
471
+
472
+ export class MyService extends SquidService {
473
+ // Built-in queue (default integration)
474
+ @onQueueMessage<string>('notifications')
475
+ async onNotification(request: QueueMessageRequest<string>): Promise<void> {
476
+ console.log(request.message); // The message payload (typed)
477
+ console.log(request.topicName); // 'notifications'
478
+ console.log(request.integrationId); // 'built_in_queue'
479
+ // Full backend permissions: this.squid, this.secrets, etc.
480
+ await this.squid.collection('log').doc().insert({ msg: request.message });
481
+ }
482
+
483
+ // External Kafka integration
484
+ @onQueueMessage<OrderEvent>('orders', 'kafka')
485
+ async onKafkaOrder(request: QueueMessageRequest<OrderEvent>): Promise<void> {
486
+ console.log(request.message); // Typed OrderEvent payload
487
+ console.log(request.integrationId); // 'kafka'
488
+ }
489
+ }
490
+ ```
491
+
492
+ **`QueueMessageRequest<T>`:**
493
+ - `message: T` - The message payload (typed by the decorator's generic parameter)
494
+ - `topicName: string` - The topic name the message was received on
495
+ - `integrationId: string` - The integration ID (`'built_in_queue'` or custom)
496
+
497
+ **Notes:**
498
+ - The handler is called once per message, server-side — no client needs to be connected
499
+ - Works with both built-in queue and external Kafka integrations
500
+ - To secure the topic, use `@secureTopic` — see [security.md](security.md)
501
+ - The handler receives each message individually (not batched)
502
+
464
503
  ## Client Connection State (@clientConnectionStateHandler)
465
504
 
466
505
  Handle client connection and disconnection events.
@@ -285,7 +285,7 @@ const subscription = queue.consume<Message>().subscribe(message => {
285
285
  subscription.unsubscribe();
286
286
  ```
287
287
 
288
- To secure queue topics, see [security.md](security.md) for `@secureTopic`. For Kafka and other queue integrations, see [connectors.md](connectors.md).
288
+ To secure queue topics, see [security.md](security.md) for `@secureTopic`. For Kafka and other queue integrations, see [connectors.md](connectors.md). To handle messages server-side without a client subscriber, use `@onQueueMessage` in your backend — see [backend.md](backend.md).
289
289
 
290
290
  ## Distributed Locks
291
291
 
@@ -73,13 +73,13 @@ const voiceResult = await agent.askWithVoiceResponse('Hello', {
73
73
  });
74
74
  ```
75
75
 
76
- ## Image Generation (DALL-E)
76
+ ## Image Generation (gpt-image-*)
77
77
 
78
78
  ```typescript
79
79
  const imageUrl = await squid.ai().image().generate('A futuristic city', {
80
- modelName: 'dall-e-3',
81
- quality: 'hd', // 'hd' | 'standard'
82
- size: '1024x1024' // '1024x1024' | '1792x1024' | '1024x1792'
80
+ modelName: 'gpt-image-1',
81
+ quality: 'high', // 'auto' | 'high' | 'medium' | 'low'
82
+ size: '1024x1024' // '1024x1024' | '1024x1536' | '1536x1024' | 'auto'
83
83
  });
84
84
  ```
85
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/cli",
3
- "version": "1.0.463",
3
+ "version": "1.0.465",
4
4
  "description": "The Squid CLI",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@
28
28
  "node": ">=18.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "@squidcloud/local-backend": "^1.0.463",
31
+ "@squidcloud/local-backend": "^1.0.465",
32
32
  "adm-zip": "^0.5.16",
33
33
  "copy-webpack-plugin": "^14.0.0",
34
34
  "decompress": "^4.2.1",