@mkja/o-data 0.0.5 → 0.0.6

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/index.d.ts CHANGED
@@ -48,7 +48,7 @@ declare class CollectionOperation<S extends Schema<S>, QE extends QueryableEntit
48
48
  /**
49
49
  * Query a collection of entities.
50
50
  */
51
- query<Q extends CollectionQueryObject<QE, S>, O extends QueryOperationOptions>(q: Q, o?: O): Promise<CollectionQueryResponse<QE, Q, O>>;
51
+ query<Q extends CollectionQueryObject<QE, S>, O extends QueryOperationOptions>(q: Q, o?: O): Promise<CollectionQueryResponse<QE, Q, O, S>>;
52
52
  /**
53
53
  * Build the full URL for this operation.
54
54
  */
@@ -37,14 +37,12 @@ type ExtractQueryResultShape<E extends QueryableEntity, Q extends {
37
37
  select?: readonly (keyof E['properties'])[];
38
38
  expand?: Record<string, any>;
39
39
  }, S extends Schema<S> = Schema<any>> = Pick<E['properties'], ExtractSelectKeys<E, Q>> & ExtractExpandShape<E, Q, S>;
40
- export type CollectionQueryData<E extends QueryableEntity = any, Q extends CollectionQueryObject<E, any> = any, O = any> = Q extends CollectionQueryObject<E, infer S> ? {
41
- value: ExtractQueryResultShape<E, Q, S>[];
42
- } & ODataMetadata : {
43
- value: any[];
40
+ export type CollectionQueryData<E extends QueryableEntity = any, Q extends CollectionQueryObject<E, any> = any, O = any, Sch extends Schema<Sch> = Schema<any>> = {
41
+ value: ExtractQueryResultShape<E, Q, Sch>[];
44
42
  } & ODataMetadata;
45
43
  export type CollectionQueryError = ODataError;
46
- export type CollectionQueryResponse<E extends QueryableEntity = any, Q extends CollectionQueryObject<E, any> = any, O = any> = ODataResponse<CollectionQueryData<E, Q, O>, CollectionQueryError> & {
47
- next?: () => Promise<CollectionQueryResponse<E, Q, O>>;
44
+ export type CollectionQueryResponse<E extends QueryableEntity = any, Q extends CollectionQueryObject<E, any> = any, O = any, Sch extends Schema<Sch> = Schema<any>> = ODataResponse<CollectionQueryData<E, Q, O, Sch>, CollectionQueryError> & {
45
+ next?: () => Promise<CollectionQueryResponse<E, Q, O, Sch>>;
48
46
  };
49
47
  export type SingleQueryData<E extends QueryableEntity = any, Q extends SingleQueryObject<E, any> = any, S extends Schema<S> = Schema<any>> = ExtractQueryResultShape<E, Q, S> & ODataMetadata;
50
48
  export type SingleQueryError = ODataError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkja/o-data",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/m-kj-aldrin/o-data"