Skip to content

Commit 05dbf75

Browse files
authored
Merge pull request #81 from richmolj/select
Select
2 parents 8fe9893 + 6ce5639 commit 05dbf75

24 files changed

+137
-56
lines changed

lib-esm/model.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CollectionProxy, RecordProxy, NullProxy } from "./proxies";
22
import { CredentialStorage, StorageBackend } from "./credential-storage";
33
import { IDMap } from "./id-map";
44
import { Attribute } from "./attribute";
5-
import { Scope, WhereClause, SortScope, FieldScope, StatsScope, IncludeScope } from "./scope";
5+
import { Scope, WhereClause, SortScope, FieldArg, StatsScope, IncludeScope } from "./scope";
66
import { JsonapiTypeRegistry } from "./jsonapi-type-registry";
77
import { ILogger } from "./logger";
88
import { MiddlewareStack, BeforeFilter, AfterFilter } from "./middleware-stack";
@@ -146,8 +146,8 @@ export declare class JSORMBase {
146146
static page<I extends typeof JSORMBase>(this: I, pageNum: number): Scope<I>;
147147
static per<I extends typeof JSORMBase>(this: I, size: number): Scope<I>;
148148
static order<I extends typeof JSORMBase>(this: I, clause: SortScope | string): Scope<I>;
149-
static select<I extends typeof JSORMBase>(this: I, clause: FieldScope): Scope<I>;
150-
static selectExtra<I extends typeof JSORMBase>(this: I, clause: FieldScope): Scope<I>;
149+
static select<I extends typeof JSORMBase>(this: I, clause: FieldArg): Scope<I>;
150+
static selectExtra<I extends typeof JSORMBase>(this: I, clause: FieldArg): Scope<I>;
151151
static stats<I extends typeof JSORMBase>(this: I, clause: StatsScope): Scope<I>;
152152
static includes<I extends typeof JSORMBase>(this: I, clause: IncludeScope): Scope<I>;
153153
static merge<I extends typeof JSORMBase>(this: I, obj: Record<string, Scope>): Scope<I>;

lib-esm/model.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib-esm/scope.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface JsonapiQueryParams {
1313
export declare type SortDir = "asc" | "desc";
1414
export declare type SortScope = Record<string, SortDir>;
1515
export declare type FieldScope = Record<string, string[]>;
16+
export declare type FieldArg = FieldScope | string[];
1617
export declare type WhereClause = Record<string, string | number | boolean>;
1718
export declare type StatsScope = Record<string, string | string[]>;
1819
export declare type IncludeScope = string | IncludeArgHash | (string | IncludeArgHash)[];
@@ -37,8 +38,8 @@ export declare class Scope<T extends typeof JSORMBase = typeof JSORMBase> {
3738
where(clause: WhereClause): Scope<T>;
3839
stats(clause: StatsScope): Scope<T>;
3940
order(clause: SortScope | string): Scope<T>;
40-
select(clause: FieldScope): Scope<T>;
41-
selectExtra(clause: FieldScope): Scope<T>;
41+
select(clause: FieldArg): Scope<T>;
42+
selectExtra(clause: FieldArg): Scope<T>;
4243
includes(clause: IncludeScope): Scope<T>;
4344
scope(): Scope<T>;
4445
asQueryParams(): JsonapiQueryParams;

lib-esm/scope.js

Lines changed: 20 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib-esm/scope.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib-esm/util/validation-error-builder.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)