@aeriajs/types 0.0.59 → 0.0.60
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/functions.d.ts +4 -4
- package/package.json +1 -1
package/dist/functions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FilterOperators, StrictFilter as Filter, StrictUpdateFilter, WithId, OptionalId, ObjectId } from 'mongodb';
|
|
2
2
|
import type { Result } from './result.js';
|
|
3
|
-
import type { StrictEndpointError } from './endpointError.js';
|
|
3
|
+
import type { EndpointError, StrictEndpointError } from './endpointError.js';
|
|
4
4
|
import type { PackReferences } from './schema.js';
|
|
5
5
|
import type { ACError } from './accessControl.js';
|
|
6
6
|
import type { ValidationErrorCode } from './validation.js';
|
|
@@ -71,9 +71,9 @@ export type RemoveFilePayload = UploadAuxProps & {
|
|
|
71
71
|
};
|
|
72
72
|
export type InsertReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.InsecureOperator | ACError.OwnershipError | ACError.ResourceNotFound | ACError.TargetImmutable | ValidationErrorCode, unknown, HTTPStatus.NotFound | HTTPStatus.UnprocessableContent>, TDocument>;
|
|
73
73
|
export type GetReturnType<TDocument> = Result.Either<StrictEndpointError<ACError.ResourceNotFound | ACError.MalformedInput, unknown, HTTPStatus.NotFound | HTTPStatus.BadRequest>, TDocument>;
|
|
74
|
-
export type CountReturnType = Result.Either<
|
|
75
|
-
export type GetAllReturnType<TDocument> = Result.Either<
|
|
76
|
-
export type RemoveReturnType<TDocument> = Result.Either<
|
|
74
|
+
export type CountReturnType = Result.Either<EndpointError, number>;
|
|
75
|
+
export type GetAllReturnType<TDocument> = Result.Either<EndpointError, TDocument[]>;
|
|
76
|
+
export type RemoveReturnType<TDocument> = Result.Either<EndpointError, TDocument>;
|
|
77
77
|
export type CollectionFunctions<TDocument extends CollectionDocument<OptionalId<any>>> = {
|
|
78
78
|
count: (payload: CountPayload<TDocument>) => Promise<CountReturnType>;
|
|
79
79
|
get: (payload: GetPayload<TDocument>) => Promise<GetReturnType<TDocument>>;
|