@aeriajs/types 0.0.116 → 0.0.118

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.
@@ -65,7 +65,9 @@ export type InsertPayload<TDocument extends WithId<unknown>> = {
65
65
  export type RemovePayload<TDocument extends WithId<unknown>> = {
66
66
  filters: Filters<TDocument>;
67
67
  };
68
- export type RemoveAllPayload<TDocument extends WithId<unknown>> = GetPayload<TDocument>;
68
+ export type RemoveAllPayload = {
69
+ filters: (ObjectId | string)[];
70
+ };
69
71
  export type RemoveFilePayload = UploadAuxProps & {
70
72
  filters: {
71
73
  _id: ObjectId | string;
@@ -88,7 +90,7 @@ export type CollectionFunctions<TSchema extends JsonSchema = JsonSchema> = Schem
88
90
  keepTempIds: true;
89
91
  }>>) => Promise<InsertReturnType<InferredDocument>>;
90
92
  remove: (payload: RemovePayload<InferredDocument>) => Promise<RemoveReturnType<InferredDocument>>;
91
- removeAll: (payload: RemoveAllPayload<InferredDocument>) => Promise<unknown>;
93
+ removeAll: (payload: RemoveAllPayload) => Promise<unknown>;
92
94
  removeFile: (payload: RemoveFilePayload) => Promise<unknown>;
93
95
  } : never : never;
94
96
  export type CollectionFunctionsSDK<TSchema extends JsonSchema = JsonSchema> = SchemaWithId<TSchema> extends infer InferredDocument ? InferredDocument extends WithId<unknown> ? {
@@ -99,7 +101,7 @@ export type CollectionFunctionsSDK<TSchema extends JsonSchema = JsonSchema> = Sc
99
101
  keepTempIds: true;
100
102
  }>>) => Promise<WithACErrors<InsertReturnType<InferredDocument>>>;
101
103
  remove: (payload: RemovePayload<InferredDocument>) => Promise<WithACErrors<RemoveReturnType<InferredDocument>>>;
102
- removeAll: (payload: RemoveAllPayload<InferredDocument>) => Promise<unknown>;
104
+ removeAll: (payload: RemoveAllPayload) => Promise<unknown>;
103
105
  removeFile: (payload: RemoveFilePayload) => Promise<unknown>;
104
106
  } : never : never;
105
107
  export {};
package/dist/schema.d.ts CHANGED
@@ -55,13 +55,13 @@ export type Schema<TSchema, TSchemaOptions extends SchemaOptions = {}> = CaseTim
55
55
  export type SchemaWithId<TSchema, TSchemaOptions extends SchemaOptions = {}> = Schema<TSchema, TSchemaOptions> & {
56
56
  _id: ObjectId;
57
57
  };
58
- export type InferProperties<TSchema> = TSchema extends readonly unknown[] ? TSchema extends readonly (infer SchemaOption)[] ? SchemaOption extends unknown ? SchemaOption extends {
58
+ export type InferProperties<TSchema> = (TSchema extends readonly unknown[] ? TSchema extends readonly (infer SchemaOption)[] ? SchemaOption extends unknown ? SchemaOption : never : never : TSchema) extends infer InferredSchema ? InferredSchema extends {
59
59
  $ref: infer K;
60
60
  } | {
61
61
  items: {
62
62
  $ref: infer K;
63
63
  };
64
- } ? K extends keyof Collections ? 'items' extends keyof SchemaOption ? Collections[K]['item'][] : Collections[K]['item'] : never : InferProperty<SchemaOption> : never : never : InferProperty<TSchema>;
64
+ } ? K extends keyof Collections ? 'items' extends keyof InferredSchema ? Collections[K]['item'][] : Collections[K]['item'] : never : InferProperty<InferredSchema> : never;
65
65
  export type PackReferences<T> = {
66
66
  [P in keyof T]: PackReferencesAux<T[P]>;
67
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.116",
3
+ "version": "0.0.118",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",