@fraym/projections 0.14.0 → 0.14.1

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/README.md CHANGED
@@ -211,7 +211,7 @@ const data = await deliveryClient.getData(
211
211
  );
212
212
  ```
213
213
 
214
- ### Get (paginated / filtered) data
214
+ ### Get (paginated / filtered / ordered) data
215
215
 
216
216
  The name of `YourProjection` has to equal your type name in your schema (also in casing).
217
217
 
@@ -8,7 +8,7 @@ import { EventMetadata } from "./eventMetadata";
8
8
  export interface DeliveryClient {
9
9
  getData: <T extends {}>(projection: string, authData: AuthData, id: string, filter?: Filter, returnEmptyDataIfNotFound?: boolean) => Promise<T | null>;
10
10
  getDataList: <T extends {}>(projection: string, authData: AuthData, limit?: number, page?: number, filter?: Filter, order?: Order[]) => Promise<GetProjectionDataList<T> | null>;
11
- upsertData: <T extends {}>(projection: string, authData: AuthData, dataId: string, payload: T, eventMetadata?: EventMetadata) => Promise<UpsertResponse<T>>;
11
+ upsertData: <T extends {}>(projection: string, authData: AuthData, dataId: string, payload: Record<string, any>, eventMetadata?: EventMetadata) => Promise<UpsertResponse<T>>;
12
12
  deleteDataById: (projection: string, authData: AuthData, dataId: string, eventMetadata?: EventMetadata) => Promise<number>;
13
13
  deleteDataByFilter: (projection: string, authData: AuthData, filter?: Filter, eventMetadata?: EventMetadata) => Promise<number>;
14
14
  close: () => Promise<void>;
@@ -4,6 +4,7 @@ import { EventMetadata } from "./eventMetadata";
4
4
  export type UpsertResponse<T extends {}> = UpsertSuccessResponse<T> | UpsertValidationResponse;
5
5
  export interface UpsertSuccessResponse<T extends {}> {
6
6
  data: T;
7
+ id: string;
7
8
  }
8
9
  export interface UpsertValidationResponse {
9
10
  validationErrors: string[];
@@ -11,4 +12,4 @@ export interface UpsertValidationResponse {
11
12
  }
12
13
  export declare const isUpsertSuccessResponse: <T extends {}>(response: UpsertResponse<T>) => response is UpsertSuccessResponse<T>;
13
14
  export declare const isUpsertValidationResponse: <T extends {}>(response: UpsertResponse<T>) => response is UpsertValidationResponse;
14
- export declare const upsertProjectionData: <T extends {}>(projection: string, auth: AuthData, dataId: string, payload: T, eventMetadata: EventMetadata, serviceClient: DeliveryServiceClient) => Promise<UpsertResponse<T>>;
15
+ export declare const upsertProjectionData: <T extends {}>(projection: string, auth: AuthData, dataId: string, payload: Record<string, any>, eventMetadata: EventMetadata, serviceClient: DeliveryServiceClient) => Promise<UpsertResponse<T>>;
@@ -36,6 +36,7 @@ const upsertProjectionData = async (projection, auth, dataId, payload, eventMeta
36
36
  }
37
37
  resolve({
38
38
  data,
39
+ id: response.id,
39
40
  });
40
41
  });
41
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fraym/projections",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "license": "UNLICENSED",
5
5
  "homepage": "https://github.com/fraym/projections-nodejs",
6
6
  "repository": {
@@ -27,10 +27,10 @@
27
27
  "projections": "dist/cmd/projections.js"
28
28
  },
29
29
  "dependencies": {
30
- "@fraym/projections-proto": "^1.0.0-alpha.16",
30
+ "@fraym/projections-proto": "^1.0.0-alpha.17",
31
31
  "@graphql-tools/graphql-file-loader": "^7.5.16",
32
32
  "@graphql-tools/load": "^7.8.13",
33
- "@grpc/grpc-js": "^1.8.12",
33
+ "@grpc/grpc-js": "^1.8.13",
34
34
  "dotenv": "^16.0.3",
35
35
  "graphql": "^16.6.0",
36
36
  "yargs": "^17.7.1"
@@ -38,9 +38,9 @@
38
38
  "devDependencies": {
39
39
  "@becklyn/prettier": "^1.0.2",
40
40
  "@types/uuid": "^9.0.1",
41
- "@types/yargs": "^17.0.22",
42
- "prettier": "^2.8.4",
43
- "typescript": "^5.0.2",
41
+ "@types/yargs": "^17.0.24",
42
+ "prettier": "^2.8.7",
43
+ "typescript": "^5.0.3",
44
44
  "uuid": "^9.0.0"
45
45
  },
46
46
  "prettier": "@becklyn/prettier"