create-qpq-app 0.1.7 → 0.1.8

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.
Files changed (74) hide show
  1. package/README.md +4 -4
  2. package/lib/commonjs/steps/013_printNextSteps.js +2 -2
  3. package/lib/commonjs/steps/013_printNextSteps.js.map +1 -1
  4. package/lib/esm/steps/013_printNextSteps.js +2 -2
  5. package/lib/esm/steps/013_printNextSteps.js.map +1 -1
  6. package/package.json +2 -2
  7. package/template/apps/qpqjs/bootstrap.qpq.ts +6 -0
  8. package/template/docusaurus/docs/actions/core/ai/ask-ai-prompt-stream.md +21 -1
  9. package/template/docusaurus/docs/actions/core/ai/ask-ai-prompt.md +9 -3
  10. package/template/docusaurus/docs/actions/core/array/ask-flat-map-parallel-batch.md +1 -1
  11. package/template/docusaurus/docs/actions/core/array/ask-map-parallel-batch.md +2 -2
  12. package/template/docusaurus/docs/actions/core/date/date-time-math.md +2 -2
  13. package/template/docusaurus/docs/actions/core/event/ask-process-event.md +1 -1
  14. package/template/docusaurus/docs/actions/core/file/ask-file-delete.md +3 -0
  15. package/template/docusaurus/docs/actions/core/file/ask-file-exists.md +3 -0
  16. package/template/docusaurus/docs/actions/core/file/ask-file-generate-temporary-secure-url.md +3 -0
  17. package/template/docusaurus/docs/actions/core/file/ask-file-generate-temporary-upload-secure-url.md +3 -0
  18. package/template/docusaurus/docs/actions/core/file/ask-file-is-cold-storage.md +3 -0
  19. package/template/docusaurus/docs/actions/core/file/ask-file-list-directory.md +4 -1
  20. package/template/docusaurus/docs/actions/core/file/ask-file-read-binary-contents.md +3 -0
  21. package/template/docusaurus/docs/actions/core/file/ask-file-read-object-json.md +5 -0
  22. package/template/docusaurus/docs/actions/core/file/ask-file-read-text-contents.md +4 -0
  23. package/template/docusaurus/docs/actions/core/file/ask-file-stream-open.md +3 -0
  24. package/template/docusaurus/docs/actions/core/file/ask-file-write-binary-contents.md +3 -0
  25. package/template/docusaurus/docs/actions/core/file/ask-file-write-object-json.md +3 -0
  26. package/template/docusaurus/docs/actions/core/file/ask-file-write-text-contents.md +3 -0
  27. package/template/docusaurus/docs/actions/core/graph-database/ask-graph-database-internal-field-names.md +1 -1
  28. package/template/docusaurus/docs/actions/core/json/ask-decode-json.md +1 -0
  29. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-delete.md +9 -1
  30. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-get-all.md +9 -1
  31. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-get.md +9 -1
  32. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query-single.md +3 -0
  33. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query.md +4 -1
  34. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-scan-all.md +2 -0
  35. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-scan.md +12 -0
  36. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-update-partial-properties.md +5 -1
  37. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-update.md +9 -1
  38. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-upsert-with-retry.md +1 -1
  39. package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-upsert.md +3 -0
  40. package/template/docusaurus/docs/actions/core/network/ask-network-request.md +1 -1
  41. package/template/docusaurus/docs/actions/core/state/ask-reduce-state.md +1 -1
  42. package/template/docusaurus/docs/actions/core/state/ask-state-dispatch.md +1 -1
  43. package/template/docusaurus/docs/actions/core/stream/ask-stream-map.md +1 -1
  44. package/template/docusaurus/docs/actions/core/stream/ask-stream-process.md +2 -1
  45. package/template/docusaurus/docs/actions/core/system/ask-trace-story.md +66 -0
  46. package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-authenticate-user.md +3 -3
  47. package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-set-access-token.md +1 -0
  48. package/template/docusaurus/docs/actions/features/event-doc/ask-apply-event-doc-event.md +47 -0
  49. package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-event-append.md +1 -0
  50. package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-process-send.md +11 -8
  51. package/template/docusaurus/docs/actions/features/web-socket-queue/_category_.json +1 -0
  52. package/template/docusaurus/docs/actions/{webserver/service → features/web-socket-queue}/ask-service-request.md +4 -3
  53. package/template/docusaurus/docs/actions/webserver/generic-data-resource/ask-put-generic-data-resource.md +4 -0
  54. package/template/docusaurus/docs/actions/webserver/generic-data-resource/ask-scan-generic-data-resource.md +4 -0
  55. package/template/docusaurus/docs/actions/webserver/websocket/ask-websocket-send-message.md +2 -2
  56. package/template/docusaurus/docs/architecture-overview.md +2 -0
  57. package/template/docusaurus/docs/config/config-aws/bootstrap-waf.md +36 -0
  58. package/template/docusaurus/docs/config/core/action-processors.md +24 -2
  59. package/template/docusaurus/docs/config/core/ai.md +5 -5
  60. package/template/docusaurus/docs/config/core/bundle-options.md +102 -0
  61. package/template/docusaurus/docs/config/core/global.md +1 -1
  62. package/template/docusaurus/docs/config/core/queue.md +1 -1
  63. package/template/docusaurus/docs/config/features/admin-settings.md +4 -7
  64. package/template/docusaurus/docs/config/features/event-doc-routes.md +2 -0
  65. package/template/docusaurus/docs/config/features/event-doc.md +2 -0
  66. package/template/docusaurus/docs/config/{webserver → features}/state-dispatch-over-websockets.md +2 -2
  67. package/template/docusaurus/docs/config/features/tenant-stores.md +80 -0
  68. package/template/docusaurus/docs/config/features/tenant.md +81 -0
  69. package/template/docusaurus/docs/config/features/tenanted-event-doc.md +51 -0
  70. package/template/docusaurus/docs/config/features/tenanted-web-socket-queue.md +52 -0
  71. package/template/docusaurus/docs/config/{webserver → features}/web-socket-queue.md +11 -8
  72. package/template/docusaurus/docs/config/webserver/websocket.md +3 -3
  73. package/template/package.json +4 -13
  74. package/template/docusaurus/docs/actions/webserver/service/_category_.json +0 -1
@@ -5,15 +5,15 @@ description: Define a managed WebSocket messaging layer — connection tracking,
5
5
 
6
6
  # defineWebSocketQueue
7
7
 
8
- Defines a **WebSocket queue**: a batteries-included messaging layer on top of a raw [WebSocket API](./websocket.md). Where [defineWebsocket](./websocket.md) hands you the bare `$connect`/`$disconnect`/`$default` hooks, `defineWebSocketQueue` supplies those handlers for you and wires in a built-in service that tracks live connections, authenticates clients, and exchanges typed client/server messages (ping/pong, authenticate, service request/response, state dispatch). Inbound frames are routed by message type, and outbound messages fan out to the connections registered for a user.
8
+ Defines a **WebSocket queue**: a batteries-included messaging layer on top of a raw [WebSocket API](../webserver/websocket.md). Where [defineWebsocket](../webserver/websocket.md) hands you the bare `$connect`/`$disconnect`/`$default` hooks, `defineWebSocketQueue` supplies those handlers for you and wires in a built-in service that tracks live connections, authenticates clients, and exchanges typed client/server messages (ping/pong, authenticate, service request/response, state dispatch). Inbound frames are routed by message type, and outbound messages fan out to the connections registered for a user.
9
9
 
10
10
  - **On AWS:** this define expands into several config settings, each deploying its own infrastructure:
11
- - a [WebSocket API](./websocket.md) (API Gateway v2 WebSocket API + Lambda) whose connect/disconnect/message handlers are the queue's built-in service entry points;
11
+ - a [WebSocket API](../webserver/websocket.md) (API Gateway v2 WebSocket API + Lambda) whose connect/disconnect/message handlers are the queue's built-in service entry points;
12
12
  - a [key-value store](../core/key-value-store.md) (DynamoDB table) named `qpq-wsq-<apiName>`, keyed by `id` with a `userId` index, that records each live connection so messages can be addressed to a user's connections;
13
- - two [globals](../core/global.md) recording the associated event-bus name and user-directory name.
13
+ - three [globals](../core/global.md) recording the associated event-bus name, user-directory name, and connection-scope-resolver name.
14
14
 
15
15
  ```typescript
16
- import { defineWebSocketQueue } from 'quidproquo-webserver';
16
+ import { defineWebSocketQueue } from 'quidproquo-features';
17
17
 
18
18
  export default [
19
19
  defineWebSocketQueue('my-event-bus', 'api', 'example.com', {
@@ -24,7 +24,7 @@ export default [
24
24
 
25
25
  ## How it relates to defineWebsocket
26
26
 
27
- `defineWebSocketQueue` **calls** [defineWebsocket](./websocket.md) internally — you do not need to declare one yourself. It passes its own service handlers as the `eventProcessors`:
27
+ `defineWebSocketQueue` **calls** [defineWebsocket](../webserver/websocket.md) internally — you do not need to declare one yourself. It passes its own service handlers as the `eventProcessors`:
28
28
 
29
29
  | Route | Handler wired by the queue |
30
30
  | --- | --- |
@@ -59,7 +59,7 @@ Logical name of the WebSocket API. Drives the resource names of the deployed API
59
59
 
60
60
  ### `rootDomain` — `string` (required)
61
61
 
62
- The registered domain the WebSocket API is served under (passed straight through to the underlying [defineWebsocket](./websocket.md)).
62
+ The registered domain the WebSocket API is served under (passed straight through to the underlying [defineWebsocket](../webserver/websocket.md)).
63
63
 
64
64
  ### `advancedSettings` — `QPQConfigAdvancedWebsocketQueueSettings` (optional)
65
65
 
@@ -67,22 +67,25 @@ The registered domain the WebSocket API is served under (passed straight through
67
67
  export interface QPQConfigAdvancedWebsocketQueueSettings extends QPQConfigAdvancedSettings {
68
68
  owner?: CrossModuleOwnerWithNoResourceOverride;
69
69
  userDirectoryName?: string;
70
+ connectionScopeResolver?: string;
70
71
  }
71
72
  ```
72
73
 
73
74
  | Property | Type | Default | Description |
74
75
  | --- | --- | --- | --- |
75
76
  | `userDirectoryName` | `string` | `''` | Name of the [user directory](../core/user-directory.md) used to authenticate clients (stored in the `qpq-wsq-kvs-name-<apiName>` global). Enables the authenticate client/server message flow. |
77
+ | `connectionScopeResolver` | `string` | `''` | Name of a registered [inline function](../core/inline-function.md) invoked with `{ userId, requestedScope }` on **every** Authenticate message, whether or not it claims a storage scope (stored in the `qpq-wsq-scope-resolver-<apiName>` global). It returns the effective scope to store on the connection (e.g. a membership-checked tenant scope for a claim, or the user's own scope for no claim), or throws to reject the authenticate. A scope claim with no resolver configured is rejected outright, leaving the connection unauthenticated. |
76
78
  | `owner` | `CrossModuleOwnerWithNoResourceOverride` | – | Declares the queue's resources as owned by another module/service, so this service references them instead of deploying its own. Applied to both the WebSocket API and the connection store. |
77
79
  | `deprecated` | `boolean` | `false` | Inherited from `QPQConfigAdvancedSettings`; when set, the underlying WebSocket API is not deployed. |
78
80
 
79
81
  ## Returns
80
82
 
81
- A `QPQConfig` array containing: two globals, the connection [key-value store](../core/key-value-store.md), and the [WebSocket API](./websocket.md) with the queue's built-in handlers.
83
+ A `QPQConfig` array containing: three globals, the connection [key-value store](../core/key-value-store.md), and the [WebSocket API](./websocket.md) with the queue's built-in handlers.
82
84
 
83
85
  ## Related
84
86
 
85
- - [defineWebsocket](./websocket.md) — the raw WebSocket API this define builds on and configures for you.
87
+ - [defineWebsocket](../webserver/websocket.md) — the raw WebSocket API this define builds on and configures for you.
86
88
  - [defineStateDispatchOverWebsockets](./state-dispatch-over-websockets.md) — routes core State-domain dispatches to clients through this queue.
89
+ - [defineTenantedWebSocketQueue](./tenanted-web-socket-queue.md) — this define with the tenant connection-scope resolver pre-wired.
87
90
  - [askWebsocketSendMessage](../../actions/webserver/websocket/ask-websocket-send-message.md) — send a raw message to a connection on the queue's API.
88
91
  - [defineEventBus](../core/event-bus.md), [defineKeyValueStore](../core/key-value-store.md), [defineUserDirectory](../core/user-directory.md) — the underlying resources it depends on.
@@ -101,10 +101,10 @@ A `WebSocketQPQWebServerConfigSetting` config setting (`configSettingType: WebSo
101
101
 
102
102
  ## Notes
103
103
 
104
- - `defineWebsocket` gives you the raw connect/disconnect/message hooks. If you want a batteries-included messaging layer — connection tracking, authentication, ping/pong, and typed client/server messages — use [defineWebSocketQueue](./web-socket-queue.md), which wires those three handlers to a built-in service for you.
104
+ - `defineWebsocket` gives you the raw connect/disconnect/message hooks. If you want a batteries-included messaging layer — connection tracking, authentication, ping/pong, and typed client/server messages — use [defineWebSocketQueue](../features/web-socket-queue.md), which wires those three handlers to a built-in service for you.
105
105
 
106
106
  ## Related
107
107
 
108
- - [defineWebSocketQueue](./web-socket-queue.md) — a higher-level WebSocket setup that provides `eventProcessors` for you and manages connections and messaging.
109
- - [defineStateDispatchOverWebsockets](./state-dispatch-over-websockets.md) — pushes core State-domain dispatches to clients over the WebSocket queue.
108
+ - [defineWebSocketQueue](../features/web-socket-queue.md) — a higher-level WebSocket setup that provides `eventProcessors` for you and manages connections and messaging.
109
+ - [defineStateDispatchOverWebsockets](../features/state-dispatch-over-websockets.md) — pushes core State-domain dispatches to clients over the WebSocket queue.
110
110
  - [askWebsocketSendMessage](../../actions/webserver/websocket/ask-websocket-send-message.md) — send a message to a connected client by `connectionId`.
@@ -19,23 +19,14 @@
19
19
  "apps/*/services/*/views"
20
20
  ],
21
21
  "scripts": {
22
- "build": "npm run build --workspaces --if-present",
22
+ "build": "qpq hooks build",
23
23
  "validate-ts": "npm run build --workspaces --if-present && npm run validate-ts --workspaces --if-present",
24
24
  "lint": "eslint .",
25
25
  "lint:fix": "eslint . --fix",
26
- "synth": "qpq synth",
27
- "go:dev": "qpq go:dev",
28
- "go:dev:api": "qpq go:dev:api",
29
- "go:dev:web": "qpq go:dev:web",
26
+ "dev": "qpq go:dev",
27
+ "deploy": "qpq go:docker",
30
28
  "prep": "qpq prep",
31
- "postinstall": "qpq hooks postinstall || true",
32
- "go": "qpq go",
33
- "publish": "qpq publish",
34
- "publish:build": "qpq publish:build",
35
- "publish:upload": "qpq publish:upload",
36
- "publish:deploy": "qpq publish:deploy",
37
- "go:docker": "qpq go:docker",
38
- "teardown": "qpq teardown"
29
+ "postinstall": "qpq hooks postinstall || true"
39
30
  },
40
31
  "devDependencies": {
41
32
  "@chakra-ui/cli": "^3.0.0",
@@ -1 +0,0 @@
1
- { "label": "Service", "link": { "type": "generated-index", "description": "Send RPC-style requests to another qpq service." } }