Skip to content

Commit ecaa110

Browse files
committed
Tweaked API documentation
1 parent 6e4bc6c commit ecaa110

5 files changed

Lines changed: 22 additions & 13 deletions

File tree

endpoints/Endpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export class Endpoint {
235235
* Shows whether the server has indicated that a specific HTTP method is currently allowed.
236236
* Uses cached data from last response.
237237
* @param method The HTTP methods (e.g. GET, POST, ...) to check.
238-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
238+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
239239
*/
240240
protected isMethodAllowed(method: HttpMethod): boolean | undefined {
241241
if (this.allowedMethods.length === 0)

endpoints/generic/ElementEndpoint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class ElementEndpoint<TEntity> extends ETagEndpointBase {
5353
/**
5454
* Shows whether the server has indicated that {@link set} is currently allowed.
5555
* Uses cached data from last response.
56-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
56+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
5757
*/
5858
get setAllowed() { return this.isMethodAllowed(HttpMethod.Put); }
5959

@@ -79,7 +79,7 @@ export class ElementEndpoint<TEntity> extends ETagEndpointBase {
7979
/**
8080
* Shows whether the server has indicated that {@link merge} is currently allowed.
8181
* Uses cached data from last response.
82-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
82+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
8383
*/
8484
get mergeAllowed() { return this.isMethodAllowed(HttpMethod.Patch); }
8585

@@ -135,7 +135,7 @@ export class ElementEndpoint<TEntity> extends ETagEndpointBase {
135135
/**
136136
* Shows whether the server has indicated that {@link delete} is currently allowed.
137137
* Uses cached data from last response.
138-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
138+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
139139
*/
140140
get deleteAllowed() { return this.isMethodAllowed(HttpMethod.Delete); }
141141

endpoints/generic/GenericCollectionEndpoint.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,25 @@ export class GenericCollectionEndpoint<TEntity, TElementEndpoint extends Element
4343
/**
4444
* Shows whether the server has indicated that {@link readAll} is currently allowed.
4545
* Uses cached data from last response.
46-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
46+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
4747
*/
4848
get readAllAllowed() { return this.isMethodAllowed(HttpMethod.Get); }
4949

50-
async readAll() { return this.serializer.deserialize<TEntity[]>(await this.getContent()); }
50+
/**
51+
* Returns all `TEntity`s in the collection.
52+
* @throws {@link AuthenticationError}: {@link HttpStatusCode.Unauthorized}
53+
* @throws {@link AuthorizationError}: {@link HttpStatusCode.Forbidden}
54+
* @throws {@link ConflictError}: {@link HttpStatusCode.Conflict}
55+
* @throws {@link HttpError}: Other non-success status code
56+
*/
57+
async readAll() {
58+
return this.serializer.deserialize<TEntity[]>(await this.getContent(signal));
59+
}
5160

5261
/**
5362
* Shows whether the server has indicated that {@link create} is currently allowed.
5463
* Uses cached data from last response.
55-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
64+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
5665
*/
5766
get createAllowed() { return this.isMethodAllowed(HttpMethod.Post); }
5867

@@ -82,7 +91,7 @@ export class GenericCollectionEndpoint<TEntity, TElementEndpoint extends Element
8291
/**
8392
* Shows whether the server has indicated that {@link createAll} is currently allowed.
8493
* Uses cached data from last response.
85-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
94+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
8695
*/
8796
get createAllAllowed() { return this.isMethodAllowed(HttpMethod.Patch); }
8897

@@ -104,7 +113,7 @@ export class GenericCollectionEndpoint<TEntity, TElementEndpoint extends Element
104113
/**
105114
* Shows whether the server has indicated that {@link setAll} is currently allowed.
106115
* Uses cached data from last response.
107-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
116+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
108117
*/
109118
get setAllAllowed() { return this.isMethodAllowed(HttpMethod.Put); }
110119

endpoints/raw/BlobEndpoint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class BlobEndpoint extends Endpoint {
2323
/**
2424
* Shows whether the server has indicated that {@link download} is currently allowed.
2525
* Uses cached data from last response.
26-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
26+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
2727
*/
2828
get downloadAllowed() { return this.isMethodAllowed(HttpMethod.Get); }
2929

@@ -43,7 +43,7 @@ export class BlobEndpoint extends Endpoint {
4343
/**
4444
* Shows whether the server has indicated that {@link upload} is currently allowed.
4545
* Uses cached data from last response.
46-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
46+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
4747
*/
4848
get uploadAllowed() { return this.isMethodAllowed(HttpMethod.Put); }
4949

@@ -60,7 +60,7 @@ export class BlobEndpoint extends Endpoint {
6060
/**
6161
* Shows whether the server has indicated that {@link delete} is currently allowed.
6262
* Uses cached data from last response.
63-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
63+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
6464
*/
6565
get deleteAllowed() { return this.isMethodAllowed(HttpMethod.Delete); }
6666

endpoints/rpc/RpcEndpointBase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class RpcEndpointBase extends Endpoint {
2626
/**
2727
* Shows whether the server has indicated that the invoke method is currently allowed.
2828
* Uses cached data from last response.
29-
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` If no request has been sent yet or the server did not specify allowed methods.
29+
* @returns `true` if the method is allowed, `false` if the method is not allowed, `undefined` if no request has been sent yet or the server did not specify allowed methods.
3030
*/
3131
get invokeAllowed() { return this.isMethodAllowed(HttpMethod.Post); }
3232
}

0 commit comments

Comments
 (0)