@jskit-ai/agent-docs 0.1.269 → 0.1.270
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/guide/agent/app-setup/existing-application-migration.md +3 -0
- package/guide/agent/framework/typed-features.md +41 -0
- package/package.json +1 -1
- package/patterns/minimal-foundation/example/package.json +1 -1
- package/patterns/shell-foundation/example/package.json +1 -1
- package/reference/autogen/PATTERN_INDEX.md +10 -10
- package/reference/autogen/packages/json-rest-api-core.md +1 -0
- package/skills/jskit/references/existing-application-migration.md +3 -0
- package/skills/jskit/references/heuristics/INDEX.md +1 -1
- package/skills/jskit/references/heuristics/typed-features.md +2 -0
- package/skills/jskit/references/pattern-index.md +10 -10
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +1 -1
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +1 -1
- package/skills/jskit/references/patterns/crud/json-api-resource-package/example/packages/books/package.json +1 -1
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +1 -1
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +2 -2
- package/skills/jskit/references/typed-features.md +41 -0
|
@@ -183,6 +183,9 @@ The JSKIT host defaults to plain output and full write responses; standard
|
|
|
183
183
|
document repositories explicitly request JSON:API output and full create/patch
|
|
184
184
|
responses. A plain collection is still `{ data: [...], meta?, links? }`; use
|
|
185
185
|
`extractJsonRestCollectionRows()` when a custom repository needs its rows.
|
|
186
|
+
A query without a page returns only the resource's first 20 rows; a
|
|
187
|
+
server-side read that needs every row uses `queryAllJsonRestCollectionRows()`
|
|
188
|
+
([every row](/guide/framework/typed-features#every-row)).
|
|
186
189
|
|
|
187
190
|
```js
|
|
188
191
|
await jsonRestApi.resources.books.patch({
|
|
@@ -683,6 +683,47 @@ const trx = resolveTransaction(options);
|
|
|
683
683
|
const trx = options?.trx || options?.transaction || null;
|
|
684
684
|
```
|
|
685
685
|
|
|
686
|
+
### Every row
|
|
687
|
+
|
|
688
|
+
**A server-side resource query that needs every row it matches reads them
|
|
689
|
+
with `queryAllJsonRestCollectionRows(resource, params, context)`
|
|
690
|
+
(`@jskit-ai/json-rest-api-core/server/jsonRestApiHost`). A query without a
|
|
691
|
+
page means "the first 20 rows".**
|
|
692
|
+
|
|
693
|
+
- json-rest-api answers a query that names no page with the resource's
|
|
694
|
+
default page, 20 rows, and says nothing about the rest. The CRUD
|
|
695
|
+
repository's `queryDocuments(query)` without a `limit` is the same first
|
|
696
|
+
page.
|
|
697
|
+
- The helper reads cursor pages of the resource's maximum size
|
|
698
|
+
(`queryMaxLimit`, 100 unless the resource sets it) in id order until none
|
|
699
|
+
follows, keeping the call's transaction and context, so no row is skipped
|
|
700
|
+
or repeated. It sets the page and sort itself; sort the rows it returns.
|
|
701
|
+
- A lookup by a unique key (an id, a slug, a token hash, a unique pair such
|
|
702
|
+
as workspace and user) matches at most one row and may read `rows[0]` of a
|
|
703
|
+
plain query. A read of the newest or first few rows names its own `sort`
|
|
704
|
+
and `page`.
|
|
705
|
+
- HTTP list routes keep the caller's page: their default and maximum page
|
|
706
|
+
sizes are public behaviour, not a server-side limit to raise.
|
|
707
|
+
|
|
708
|
+
Why: a list read without a page looks complete until the 21st row, then
|
|
709
|
+
silently drops the rest from every person picker, scope and delivery built on it.
|
|
710
|
+
|
|
711
|
+
```js
|
|
712
|
+
// good
|
|
713
|
+
const rows = await queryAllJsonRestCollectionRows(api.resources.workspaceMemberships, {
|
|
714
|
+
queryParams: { filters: { workspace: workspaceId, status: "active" }, include: ["user"] },
|
|
715
|
+
transaction: resolveTransaction(options),
|
|
716
|
+
format: "plain"
|
|
717
|
+
}, options.context);
|
|
718
|
+
|
|
719
|
+
// bad: the first 20 members only
|
|
720
|
+
const rows = extractJsonRestCollectionRows(await api.resources.workspaceMemberships.query({
|
|
721
|
+
queryParams: { filters: { workspace: workspaceId, status: "active" }, include: ["user"] },
|
|
722
|
+
transaction: resolveTransaction(options),
|
|
723
|
+
format: "plain"
|
|
724
|
+
}, createJsonRestContext(options.context)));
|
|
725
|
+
```
|
|
726
|
+
|
|
686
727
|
### Routes
|
|
687
728
|
|
|
688
729
|
**A route does HTTP work only (status, cookies, redirects) and runs an action
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.270`
|
|
19
19
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](../../skills/jskit/references/patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.270`
|
|
30
30
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](../../skills/jskit/references/patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
|
|
|
246
246
|
|
|
247
247
|
- Id: `console/console-surface`
|
|
248
248
|
- Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
|
|
249
|
-
- Owner: `@jskit-ai/console-web@0.1.
|
|
249
|
+
- Owner: `@jskit-ai/console-web@0.1.232`
|
|
250
250
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/console/console-surface/PATTERN.md)
|
|
251
251
|
- Examples: [example/](../../skills/jskit/references/patterns/console/console-surface/example/)
|
|
252
252
|
- Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
|
|
@@ -268,7 +268,7 @@ Build a complete application-owned CRUD server package from a migration, resourc
|
|
|
268
268
|
|
|
269
269
|
- Id: `crud/json-api-resource-package`
|
|
270
270
|
- Keywords: `actions`, `crud`, `database`, `json-api`, `migration`, `permissions`, `provider`, `repository`, `routes`, `service`
|
|
271
|
-
- Owner: `@jskit-ai/crud-core@0.2.
|
|
271
|
+
- Owner: `@jskit-ai/crud-core@0.2.8`
|
|
272
272
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/crud/json-api-resource-package/PATTERN.md)
|
|
273
273
|
- Examples: [example/](../../skills/jskit/references/patterns/crud/json-api-resource-package/example/)
|
|
274
274
|
- Requires: `@jskit-ai/crud-core`, `@jskit-ai/resource-crud-core`
|
|
@@ -334,7 +334,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
|
|
|
334
334
|
|
|
335
335
|
- Id: `rewards/google-rewarded`
|
|
336
336
|
- Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
|
|
337
|
-
- Owner: `@jskit-ai/rewarded-web@0.2.
|
|
337
|
+
- Owner: `@jskit-ai/rewarded-web@0.2.10`
|
|
338
338
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/rewards/google-rewarded/PATTERN.md)
|
|
339
339
|
- Examples: [example/](../../skills/jskit/references/patterns/rewards/google-rewarded/example/)
|
|
340
340
|
- Requires: `@jskit-ai/rewarded-web`
|
|
@@ -345,7 +345,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
345
345
|
|
|
346
346
|
- Id: `server/feature-package`
|
|
347
347
|
- Keywords: `actions`, `feature`, `json-rest`, `knex`, `orchestration`, `package`, `provider`, `repository`, `routes`, `server`
|
|
348
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
348
|
+
- Owner: `@jskit-ai/agent-docs@0.1.270`
|
|
349
349
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/server/feature-package/PATTERN.md)
|
|
350
350
|
- Examples: [example/](../../skills/jskit/references/patterns/server/feature-package/example/)
|
|
351
351
|
- Requires: `@jskit-ai/kernel`
|
|
@@ -378,7 +378,7 @@ Compose an account settings route and profile, preference, notification, and sig
|
|
|
378
378
|
|
|
379
379
|
- Id: `users/account-settings`
|
|
380
380
|
- Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
|
|
381
|
-
- Owner: `@jskit-ai/users-web@0.2.
|
|
381
|
+
- Owner: `@jskit-ai/users-web@0.2.15`
|
|
382
382
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/users/account-settings/PATTERN.md)
|
|
383
383
|
- Examples: [example/](../../skills/jskit/references/patterns/users/account-settings/example/)
|
|
384
384
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
|
|
@@ -389,7 +389,7 @@ Expose user administration and workspace-scoped member operations through app-ow
|
|
|
389
389
|
|
|
390
390
|
- Id: `users/user-administration-server`
|
|
391
391
|
- Keywords: `account`, `admin`, `member`, `repository`, `resource`, `routes`, `service`, `user`, `workspace`
|
|
392
|
-
- Owner: `@jskit-ai/users-core@0.2.
|
|
392
|
+
- Owner: `@jskit-ai/users-core@0.2.9`
|
|
393
393
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/users/user-administration-server/PATTERN.md)
|
|
394
394
|
- Examples: [example/](../../skills/jskit/references/patterns/users/user-administration-server/example/)
|
|
395
395
|
- Requires: `@jskit-ai/crud-core`, `@jskit-ai/users-core`
|
|
@@ -400,7 +400,7 @@ Configure roles, workspace access policy, invitations, and app-owned invitation
|
|
|
400
400
|
|
|
401
401
|
- Id: `workspaces/workspace-server`
|
|
402
402
|
- Keywords: `access`, `invite`, `membership`, `multitenancy`, `policy`, `role`, `tenancy`, `workspace`
|
|
403
|
-
- Owner: `@jskit-ai/workspaces-core@0.2.
|
|
403
|
+
- Owner: `@jskit-ai/workspaces-core@0.2.9`
|
|
404
404
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/workspaces/workspace-server/PATTERN.md)
|
|
405
405
|
- Examples: [example/](../../skills/jskit/references/patterns/workspaces/workspace-server/example/)
|
|
406
406
|
- Requires: `@jskit-ai/users-core`, `@jskit-ai/workspaces-core`
|
|
@@ -411,7 +411,7 @@ Compose workspace selection, invitation, member administration, settings, and re
|
|
|
411
411
|
|
|
412
412
|
- Id: `workspaces/workspace-surfaces`
|
|
413
413
|
- Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
|
|
414
|
-
- Owner: `@jskit-ai/workspaces-web@0.2.
|
|
414
|
+
- Owner: `@jskit-ai/workspaces-web@0.2.15`
|
|
415
415
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/PATTERN.md)
|
|
416
416
|
- Examples: [example/](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/example/)
|
|
417
417
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
|
|
@@ -21,6 +21,7 @@ Exports
|
|
|
21
21
|
- `createJsonRestResourceScopeOptions(resource = {}, { writeSerializers = {}, normalizeId, rowPolicy, searchSchema, queryFields } = {})`
|
|
22
22
|
- `createJsonRestContext(context = null)`
|
|
23
23
|
- `extractJsonRestCollectionRows(payload)`
|
|
24
|
+
- `queryAllJsonRestCollectionRows(resource, { queryParams, ...params }, context)`
|
|
24
25
|
- `returnNullWhenJsonRestResourceMissing(run)`
|
|
25
26
|
- `returnBadRequestWhenJsonRestFieldsetInvalid(run)`
|
|
26
27
|
- `resolveWorkspaceScopeValue(context = null)`
|
|
@@ -178,6 +178,9 @@ The JSKIT host defaults to plain output and full write responses; standard
|
|
|
178
178
|
document repositories explicitly request JSON:API output and full create/patch
|
|
179
179
|
responses. A plain collection is still `{ data: [...], meta?, links? }`; use
|
|
180
180
|
`extractJsonRestCollectionRows()` when a custom repository needs its rows.
|
|
181
|
+
A query without a page returns only the resource's first 20 rows; a
|
|
182
|
+
server-side read that needs every row uses `queryAllJsonRestCollectionRows()`
|
|
183
|
+
([every row](typed-features.md#every-row)).
|
|
181
184
|
|
|
182
185
|
```js
|
|
183
186
|
await jsonRestApi.resources.books.patch({
|
|
@@ -44,7 +44,7 @@ How to use it:
|
|
|
44
44
|
- [crud-repository-mapping.md](./crud-repository-mapping.md)
|
|
45
45
|
- row policy, permission filtering, visibility before pagination, recursive CTE, descendants, package cycle, `RowPolicyPlugin`
|
|
46
46
|
- [row-policies.md](./row-policies.md)
|
|
47
|
-
- typed features, server feature, provider, service, repository, collaborator, `typeof`, `= null`, `setProvider`, `register`, `input || {}`, `payload = {}`, `async execute`, `Object.freeze`, `requires`, `optional`, `types.js`, `RuntimeKnex`, `silentLogger`, `create<Name>Actions`, `ActionSpecifications`, request context, `jskit/*` lint findings, `readable-check: allow`, `optional operation:`, `process.env`, `AppError` code, `Object.assign(new Error`, `idempotency`, `…ForTests` export, file or function size
|
|
47
|
+
- typed features, server feature, provider, service, repository, collaborator, `typeof`, `= null`, `setProvider`, `register`, `input || {}`, `payload = {}`, `async execute`, `Object.freeze`, `requires`, `optional`, `types.js`, `RuntimeKnex`, `silentLogger`, `create<Name>Actions`, `ActionSpecifications`, request context, `api.resources.x.query`, every row, list stops at 20 rows, `queryAllJsonRestCollectionRows`, `jskit/*` lint findings, `readable-check: allow`, `optional operation:`, `process.env`, `AppError` code, `Object.assign(new Error`, `idempotency`, `…ForTests` export, file or function size
|
|
48
48
|
- [typed-features.md](./typed-features.md)
|
|
49
49
|
- client features, composable, `use<Name>`, Vue component, client provider, props, emits, `inject`, `provide`, `ref`, `reactive`, `watch`, `addEventListener`, `setInterval`, module state, `Object.freeze` on a composable, `?.()` in a template, `jskit/typed-inject`, `jskit/collaborator-props`, `jskit/fixed-result-shape`, `jskit/released-listeners`, `jskit/no-module-state`, `jskit/no-frozen-vue-state`, `clientFeaturesConfig`, `shared resource:`
|
|
50
50
|
- [client-features.md](./client-features.md)
|
|
@@ -63,6 +63,8 @@ ends with the same link.
|
|
|
63
63
|
- [One helper per package](../typed-features.md#one-helper-per-package)
|
|
64
64
|
- `options?.trx || options?.transaction`, a hand-read actor, cursor or created id
|
|
65
65
|
- [One reader per fact](../typed-features.md#one-reader-per-fact)
|
|
66
|
+
- `api.resources.x.query(…)` with no `page` for a list, `queryDocuments(query)` with no `limit` in a service, a list that stops at 20 rows
|
|
67
|
+
- [Every row](../typed-features.md#every-row)
|
|
66
68
|
- a route that queries storage, `boot*.js` holding routes
|
|
67
69
|
- [Routes](../typed-features.md#routes)
|
|
68
70
|
- `new AppError(status, message)` with no code, `new NotFoundError("…")`, one code for two sentences (`jskit/app-error-code`)
|
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.270`
|
|
19
19
|
- Read: [PATTERN.md](patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.270`
|
|
30
30
|
- Read: [PATTERN.md](patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
|
|
|
246
246
|
|
|
247
247
|
- Id: `console/console-surface`
|
|
248
248
|
- Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
|
|
249
|
-
- Owner: `@jskit-ai/console-web@0.1.
|
|
249
|
+
- Owner: `@jskit-ai/console-web@0.1.232`
|
|
250
250
|
- Read: [PATTERN.md](patterns/console/console-surface/PATTERN.md)
|
|
251
251
|
- Examples: [example/](patterns/console/console-surface/example/)
|
|
252
252
|
- Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
|
|
@@ -268,7 +268,7 @@ Build a complete application-owned CRUD server package from a migration, resourc
|
|
|
268
268
|
|
|
269
269
|
- Id: `crud/json-api-resource-package`
|
|
270
270
|
- Keywords: `actions`, `crud`, `database`, `json-api`, `migration`, `permissions`, `provider`, `repository`, `routes`, `service`
|
|
271
|
-
- Owner: `@jskit-ai/crud-core@0.2.
|
|
271
|
+
- Owner: `@jskit-ai/crud-core@0.2.8`
|
|
272
272
|
- Read: [PATTERN.md](patterns/crud/json-api-resource-package/PATTERN.md)
|
|
273
273
|
- Examples: [example/](patterns/crud/json-api-resource-package/example/)
|
|
274
274
|
- Requires: `@jskit-ai/crud-core`, `@jskit-ai/resource-crud-core`
|
|
@@ -334,7 +334,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
|
|
|
334
334
|
|
|
335
335
|
- Id: `rewards/google-rewarded`
|
|
336
336
|
- Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
|
|
337
|
-
- Owner: `@jskit-ai/rewarded-web@0.2.
|
|
337
|
+
- Owner: `@jskit-ai/rewarded-web@0.2.10`
|
|
338
338
|
- Read: [PATTERN.md](patterns/rewards/google-rewarded/PATTERN.md)
|
|
339
339
|
- Examples: [example/](patterns/rewards/google-rewarded/example/)
|
|
340
340
|
- Requires: `@jskit-ai/rewarded-web`
|
|
@@ -345,7 +345,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
345
345
|
|
|
346
346
|
- Id: `server/feature-package`
|
|
347
347
|
- Keywords: `actions`, `feature`, `json-rest`, `knex`, `orchestration`, `package`, `provider`, `repository`, `routes`, `server`
|
|
348
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
348
|
+
- Owner: `@jskit-ai/agent-docs@0.1.270`
|
|
349
349
|
- Read: [PATTERN.md](patterns/server/feature-package/PATTERN.md)
|
|
350
350
|
- Examples: [example/](patterns/server/feature-package/example/)
|
|
351
351
|
- Requires: `@jskit-ai/kernel`
|
|
@@ -378,7 +378,7 @@ Compose an account settings route and profile, preference, notification, and sig
|
|
|
378
378
|
|
|
379
379
|
- Id: `users/account-settings`
|
|
380
380
|
- Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
|
|
381
|
-
- Owner: `@jskit-ai/users-web@0.2.
|
|
381
|
+
- Owner: `@jskit-ai/users-web@0.2.15`
|
|
382
382
|
- Read: [PATTERN.md](patterns/users/account-settings/PATTERN.md)
|
|
383
383
|
- Examples: [example/](patterns/users/account-settings/example/)
|
|
384
384
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
|
|
@@ -389,7 +389,7 @@ Expose user administration and workspace-scoped member operations through app-ow
|
|
|
389
389
|
|
|
390
390
|
- Id: `users/user-administration-server`
|
|
391
391
|
- Keywords: `account`, `admin`, `member`, `repository`, `resource`, `routes`, `service`, `user`, `workspace`
|
|
392
|
-
- Owner: `@jskit-ai/users-core@0.2.
|
|
392
|
+
- Owner: `@jskit-ai/users-core@0.2.9`
|
|
393
393
|
- Read: [PATTERN.md](patterns/users/user-administration-server/PATTERN.md)
|
|
394
394
|
- Examples: [example/](patterns/users/user-administration-server/example/)
|
|
395
395
|
- Requires: `@jskit-ai/crud-core`, `@jskit-ai/users-core`
|
|
@@ -400,7 +400,7 @@ Configure roles, workspace access policy, invitations, and app-owned invitation
|
|
|
400
400
|
|
|
401
401
|
- Id: `workspaces/workspace-server`
|
|
402
402
|
- Keywords: `access`, `invite`, `membership`, `multitenancy`, `policy`, `role`, `tenancy`, `workspace`
|
|
403
|
-
- Owner: `@jskit-ai/workspaces-core@0.2.
|
|
403
|
+
- Owner: `@jskit-ai/workspaces-core@0.2.9`
|
|
404
404
|
- Read: [PATTERN.md](patterns/workspaces/workspace-server/PATTERN.md)
|
|
405
405
|
- Examples: [example/](patterns/workspaces/workspace-server/example/)
|
|
406
406
|
- Requires: `@jskit-ai/users-core`, `@jskit-ai/workspaces-core`
|
|
@@ -411,7 +411,7 @@ Compose workspace selection, invitation, member administration, settings, and re
|
|
|
411
411
|
|
|
412
412
|
- Id: `workspaces/workspace-surfaces`
|
|
413
413
|
- Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
|
|
414
|
-
- Owner: `@jskit-ai/workspaces-web@0.2.
|
|
414
|
+
- Owner: `@jskit-ai/workspaces-web@0.2.15`
|
|
415
415
|
- Read: [PATTERN.md](patterns/workspaces/workspace-surfaces/PATTERN.md)
|
|
416
416
|
- Examples: [example/](patterns/workspaces/workspace-surfaces/example/)
|
|
417
417
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.8",
|
|
14
14
|
"@jskit-ai/resource-crud-core": "0.1.198",
|
|
15
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
15
|
+
"@jskit-ai/workspaces-core": "0.2.9"
|
|
16
16
|
},
|
|
17
17
|
"jskit": {
|
|
18
18
|
"kind": "runtime",
|
|
@@ -678,6 +678,47 @@ const trx = resolveTransaction(options);
|
|
|
678
678
|
const trx = options?.trx || options?.transaction || null;
|
|
679
679
|
```
|
|
680
680
|
|
|
681
|
+
### Every row
|
|
682
|
+
|
|
683
|
+
**A server-side resource query that needs every row it matches reads them
|
|
684
|
+
with `queryAllJsonRestCollectionRows(resource, params, context)`
|
|
685
|
+
(`@jskit-ai/json-rest-api-core/server/jsonRestApiHost`). A query without a
|
|
686
|
+
page means "the first 20 rows".**
|
|
687
|
+
|
|
688
|
+
- json-rest-api answers a query that names no page with the resource's
|
|
689
|
+
default page, 20 rows, and says nothing about the rest. The CRUD
|
|
690
|
+
repository's `queryDocuments(query)` without a `limit` is the same first
|
|
691
|
+
page.
|
|
692
|
+
- The helper reads cursor pages of the resource's maximum size
|
|
693
|
+
(`queryMaxLimit`, 100 unless the resource sets it) in id order until none
|
|
694
|
+
follows, keeping the call's transaction and context, so no row is skipped
|
|
695
|
+
or repeated. It sets the page and sort itself; sort the rows it returns.
|
|
696
|
+
- A lookup by a unique key (an id, a slug, a token hash, a unique pair such
|
|
697
|
+
as workspace and user) matches at most one row and may read `rows[0]` of a
|
|
698
|
+
plain query. A read of the newest or first few rows names its own `sort`
|
|
699
|
+
and `page`.
|
|
700
|
+
- HTTP list routes keep the caller's page: their default and maximum page
|
|
701
|
+
sizes are public behaviour, not a server-side limit to raise.
|
|
702
|
+
|
|
703
|
+
Why: a list read without a page looks complete until the 21st row, then
|
|
704
|
+
silently drops the rest from every person picker, scope and delivery built on it.
|
|
705
|
+
|
|
706
|
+
```js
|
|
707
|
+
// good
|
|
708
|
+
const rows = await queryAllJsonRestCollectionRows(api.resources.workspaceMemberships, {
|
|
709
|
+
queryParams: { filters: { workspace: workspaceId, status: "active" }, include: ["user"] },
|
|
710
|
+
transaction: resolveTransaction(options),
|
|
711
|
+
format: "plain"
|
|
712
|
+
}, options.context);
|
|
713
|
+
|
|
714
|
+
// bad: the first 20 members only
|
|
715
|
+
const rows = extractJsonRestCollectionRows(await api.resources.workspaceMemberships.query({
|
|
716
|
+
queryParams: { filters: { workspace: workspaceId, status: "active" }, include: ["user"] },
|
|
717
|
+
transaction: resolveTransaction(options),
|
|
718
|
+
format: "plain"
|
|
719
|
+
}, createJsonRestContext(options.context)));
|
|
720
|
+
```
|
|
721
|
+
|
|
681
722
|
### Routes
|
|
682
723
|
|
|
683
724
|
**A route does HTTP work only (status, cookies, redirects) and runs an action
|