@aeriajs/types 0.0.119 → 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 CHANGED
@@ -22,7 +22,8 @@ export type IndepthCollection<TCollection> = TCollection extends {
22
22
  functions?: infer InferredFunctions;
23
23
  } ? InferredDescription extends JsonSchema ? Omit<TCollection, 'functions'> & {
24
24
  item: SchemaWithId<InferredDescription>;
25
- functions: UnionFunctions<InferredFunctions, InferredDescription>;
25
+ context: () => Promise<Context<InferredDescription, InferredFunctions>>;
26
+ functions: InferredFunctions extends undefined ? Record<string, never> : UnionFunctions<InferredFunctions, InferredDescription>;
26
27
  originalFunctions: InferredFunctions;
27
28
  model: InferredDescription extends Description ? CollectionModel<InferredDescription> : never;
28
29
  middlewares?: Collection['middlewares'];
@@ -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 GetAllReturnType<TDocument> = Result.Either<ExtractError<InferSchema<ReturnType<typeof functionSchemas.getAllError>>>, TDocument[]>;
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 PaginatedGetAllReturnType<TDocument> = Result.Either<ExtractError<GetAllReturnType<TDocument>>, {
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<PaginatedGetAllReturnType<InferredDocument>>>;
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.119",
3
+ "version": "0.0.121",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",