@byline/client 3.13.2 → 3.14.0

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/index.d.ts CHANGED
@@ -8,4 +8,4 @@
8
8
  export { type AuditLogEntry, type AuditLogPage, type ChangeStatusResult, type CreateDocumentResult, type CycleRelationValue, createReadContext, type DeleteDocumentResult, ERR_CONFLICT, ERR_INVALID_TRANSITION, ERR_NOT_FOUND, ERR_READ_BUDGET_EXCEEDED, ERR_VALIDATION, type PopulatedRelationValue, type PopulateFieldOptions, type PopulateFieldSpec, type PopulateMap, type PopulateSpec, type ReadContext, type ReadMode, type RestoreVersionResult, type UnpublishResult, type UnresolvedRelationValue, type UpdateDocumentResult, } from '@byline/core';
9
9
  export { BylineClient, createBylineClient } from './client.js';
10
10
  export { CollectionHandle } from './collection-handle.js';
11
- export type { AuditLogOptions, BylineClientConfig, ClientDocument, CreateOptions, FilterOperators, FindByIdOptions, FindByPathOptions, FindOneOptions, FindOptions, FindResult, GetAncestorsOptions, GetSubtreeOptions, PlaceTreeNodeOptions, PopulatedRelation, SortDirection, SortSpec, TreeNode, UpdateOptions, WhereClause, WhereValue, WithPopulated, } from './types.js';
11
+ export type { AuditLogOptions, BylineClientConfig, ClientDocument, CreateOptions, FilterOperators, FindByIdOptions, FindByPathOptions, FindOneOptions, FindOptions, FindResult, GetAncestorsOptions, GetSubtreeOptions, PlaceTreeNodeOptions, PopulatedRelation, SortDirection, SortSpec, TreeNode, UpdateOptions, WhereClause, WhereValue, WithPopulated, WithPopulatedMany, } from './types.js';
package/dist/types.d.ts CHANGED
@@ -509,3 +509,17 @@ export interface PopulatedRelation<T> {
509
509
  export type WithPopulated<F, K extends keyof F, Target> = {
510
510
  [P in keyof F]: P extends K ? PopulatedRelation<Target> : F[P];
511
511
  };
512
+ /**
513
+ * `hasMany` counterpart of {@link WithPopulated}: re-types key `K` as an
514
+ * **ordered array** of populated relation envelopes. Use for `hasMany: true`
515
+ * relation fields, whose populated value is `PopulatedRelation<Target>[]` (one
516
+ * envelope per referenced target, in stored order).
517
+ *
518
+ * ```ts
519
+ * type ArticlePopulated = WithPopulatedMany<ArticleFields, 'authors', AuthorFields>
520
+ * client.collection('articles').find<ArticlePopulated>({ populate: { authors: '*' } })
521
+ * ```
522
+ */
523
+ export type WithPopulatedMany<F, K extends keyof F, Target> = {
524
+ [P in keyof F]: P extends K ? Array<PopulatedRelation<Target>> : F[P];
525
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@byline/client",
3
3
  "private": false,
4
4
  "license": "MPL-2.0",
5
- "version": "3.13.2",
5
+ "version": "3.14.0",
6
6
  "engines": {
7
7
  "node": ">=20.9.0"
8
8
  },
@@ -38,8 +38,8 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "npm-run-all": "^4.1.5",
41
- "@byline/auth": "3.13.2",
42
- "@byline/core": "3.13.2"
41
+ "@byline/auth": "3.14.0",
42
+ "@byline/core": "3.14.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@biomejs/biome": "2.4.15",
@@ -51,7 +51,7 @@
51
51
  "tsx": "^4.22.3",
52
52
  "typescript": "6.0.3",
53
53
  "vitest": "^4.1.7",
54
- "@byline/db-postgres": "3.13.2"
54
+ "@byline/db-postgres": "3.14.0"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public",