@aeriajs/types 0.0.120 → 0.0.121
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/context.d.ts +1 -1
- package/dist/functions.d.ts +5 -3
- package/package.json +1 -1
package/dist/context.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type IndepthCollection<TCollection> = TCollection extends {
|
|
|
23
23
|
} ? InferredDescription extends JsonSchema ? Omit<TCollection, 'functions'> & {
|
|
24
24
|
item: SchemaWithId<InferredDescription>;
|
|
25
25
|
context: () => Promise<Context<InferredDescription, InferredFunctions>>;
|
|
26
|
-
functions: UnionFunctions<InferredFunctions, InferredDescription>;
|
|
26
|
+
functions: InferredFunctions extends undefined ? Record<string, never> : UnionFunctions<InferredFunctions, InferredDescription>;
|
|
27
27
|
originalFunctions: InferredFunctions;
|
|
28
28
|
model: InferredDescription extends Description ? CollectionModel<InferredDescription> : never;
|
|
29
29
|
middlewares?: Collection['middlewares'];
|
package/dist/functions.d.ts
CHANGED
|
@@ -75,10 +75,10 @@ export type RemoveFilePayload = UploadAuxProps & {
|
|
|
75
75
|
};
|
|
76
76
|
export type InsertReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.insertError>>>, TDocument>;
|
|
77
77
|
export type GetReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.getError>>>, TDocument>;
|
|
78
|
-
export type
|
|
78
|
+
export type UnpaginatedGetAllReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.getAllError>>>, TDocument[]>;
|
|
79
79
|
export type CountReturnType = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.countError>>>, number>;
|
|
80
80
|
export type RemoveReturnType<TDocument> = Result.Either<EndpointError, TDocument>;
|
|
81
|
-
export type
|
|
81
|
+
export type GetAllReturnType<TDocument> = Result.Either<ExtractError<UnpaginatedGetAllReturnType<TDocument>>, {
|
|
82
82
|
data: TDocument[];
|
|
83
83
|
pagination: Pagination;
|
|
84
84
|
}>;
|
|
@@ -92,16 +92,18 @@ export type CollectionFunctions<TSchema extends JsonSchema = JsonSchema> = Schem
|
|
|
92
92
|
remove: (payload: RemovePayload<InferredDocument>) => Promise<RemoveReturnType<InferredDocument>>;
|
|
93
93
|
removeAll: (payload: RemoveAllPayload) => Promise<unknown>;
|
|
94
94
|
removeFile: (payload: RemoveFilePayload) => Promise<unknown>;
|
|
95
|
+
unpaginatedGetAll: (payload?: GetAllPayload<InferredDocument>) => Promise<UnpaginatedGetAllReturnType<InferredDocument>>;
|
|
95
96
|
} : never : never;
|
|
96
97
|
export type CollectionFunctionsSDK<TSchema extends JsonSchema = JsonSchema> = SchemaWithId<TSchema> extends infer InferredDocument ? InferredDocument extends WithId<unknown> ? {
|
|
97
98
|
count: (payload: CountPayload<InferredDocument>) => Promise<WithACErrors<CountReturnType>>;
|
|
98
99
|
get: (payload: GetPayload<InferredDocument>) => Promise<WithACErrors<GetReturnType<InferredDocument>>>;
|
|
99
|
-
getAll: (payload?: GetAllPayload<InferredDocument>) => Promise<WithACErrors<
|
|
100
|
+
getAll: (payload?: GetAllPayload<InferredDocument>) => Promise<WithACErrors<GetAllReturnType<InferredDocument>>>;
|
|
100
101
|
insert: (payload: InsertPayload<SchemaWithId<TSchema, {
|
|
101
102
|
keepTempIds: true;
|
|
102
103
|
}>>) => Promise<WithACErrors<InsertReturnType<InferredDocument>>>;
|
|
103
104
|
remove: (payload: RemovePayload<InferredDocument>) => Promise<WithACErrors<RemoveReturnType<InferredDocument>>>;
|
|
104
105
|
removeAll: (payload: RemoveAllPayload) => Promise<unknown>;
|
|
105
106
|
removeFile: (payload: RemoveFilePayload) => Promise<unknown>;
|
|
107
|
+
unpaginatedGetAll: (payload?: GetAllPayload<InferredDocument>) => Promise<UnpaginatedGetAllReturnType<InferredDocument>>;
|
|
106
108
|
} : never : never;
|
|
107
109
|
export {};
|