Skip to content

Commit 47d0607

Browse files
authored
Add errors to descriptor props (#53)
Vue would not show validation errors without this.
1 parent d346fcc commit 47d0607

37 files changed

+198
-63
lines changed

lib-esm/model.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CollectionProxy, RecordProxy } from "./proxies";
1+
import { CollectionProxy, RecordProxy, NullProxy } from "./proxies";
22
import { LocalStorage, StorageBackend } from "./local-storage";
33
import { Attribute } from "./attribute";
44
import { Scope, WhereClause, SortScope, FieldScope, StatsScope, IncludeScope } from "./scope";
@@ -119,7 +119,7 @@ export declare class JSORMBase {
119119
static fullBasePath(): string;
120120
static middlewareStack: MiddlewareStack;
121121
static scope<I extends typeof JSORMBase>(this: I): Scope<I>;
122-
static first<I extends typeof JSORMBase>(this: I): Promise<RecordProxy<I["prototype"]>>;
122+
static first<I extends typeof JSORMBase>(this: I): Promise<NullProxy | RecordProxy<I["prototype"]>>;
123123
static all<I extends typeof JSORMBase>(this: I): Promise<CollectionProxy<I["prototype"]>>;
124124
static find<I extends typeof JSORMBase>(this: I, id: string | number): Promise<RecordProxy<I["prototype"]>>;
125125
static where<I extends typeof JSORMBase>(this: I, clause: WhereClause): Scope<I>;

lib-esm/model.js

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

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/proxies/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export { CollectionProxy } from "./collection-proxy";
22
export { RecordProxy } from "./record-proxy";
3+
export { NullProxy } from "./null-proxy";
34
import { JsonapiResponseDoc } from "../jsonapi-spec";
45
export interface IResultProxy<T> {
56
data: T | T[] | null;

lib-esm/proxies/index.js

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

lib-esm/proxies/index.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/proxies/null-proxy.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { JsonapiResponseDoc } from "../jsonapi-spec";
2+
import { IResultProxy } from "./index";
3+
export declare class NullProxy implements IResultProxy<null> {
4+
private _raw_json;
5+
constructor(raw_json: JsonapiResponseDoc);
6+
readonly raw: JsonapiResponseDoc;
7+
readonly data: null;
8+
readonly meta: Record<string, any>;
9+
}

lib-esm/proxies/null-proxy.js

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

lib-esm/proxies/null-proxy.js.map

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

lib-esm/request.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export declare class Request {
1717
private _logResponse(responseJSON);
1818
private _fetchWithLogging(url, options);
1919
private _fetch(url, options);
20-
private _handleResponse(response);
20+
private _handleResponse(response, requestOptions);
2121
}

0 commit comments

Comments
 (0)