@fraym/crud 0.10.0 → 0.10.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.
|
@@ -5,8 +5,8 @@ export interface DeliveryClient {
|
|
|
5
5
|
create: (tenantId: string, type: string, data: Record<string, any>) => Promise<CreatedCrudData>;
|
|
6
6
|
update: (tenantId: string, type: string, id: string, data: Record<string, any>) => Promise<void>;
|
|
7
7
|
delete: (tenantId: string, type: string, id: string) => Promise<void>;
|
|
8
|
-
getData: <T extends {}>(tenantId: string, type: string, id: string, returnEmptyDataIfNotFound?: boolean) => Promise<T
|
|
9
|
-
getDataList: <T extends {}>(tenantId: string, type: string, limit?: number, page?: number, filter?: Filter) => Promise<GetCrudDataList<T
|
|
8
|
+
getData: <T extends {}>(tenantId: string, type: string, id: string, returnEmptyDataIfNotFound?: boolean) => Promise<T>;
|
|
9
|
+
getDataList: <T extends {}>(tenantId: string, type: string, limit?: number, page?: number, filter?: Filter) => Promise<GetCrudDataList<T>>;
|
|
10
10
|
close: () => Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export declare const newDeliveryClient: (config?: ClientConfig) => Promise<DeliveryClient>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeliveryServiceClient } from "@fraym/crud-proto";
|
|
2
|
-
export declare const getCrudData: <T extends {}>(tenantId: string, type: string, id: string, returnEmptyDataIfNotFound: boolean, serviceClient: DeliveryServiceClient) => Promise<T
|
|
2
|
+
export declare const getCrudData: <T extends {}>(tenantId: string, type: string, id: string, returnEmptyDataIfNotFound: boolean, serviceClient: DeliveryServiceClient) => Promise<T>;
|
package/dist/delivery/getData.js
CHANGED
|
@@ -17,8 +17,7 @@ const getCrudData = async (tenantId, type, id, returnEmptyDataIfNotFound, servic
|
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
if (response.result.length !== 1) {
|
|
20
|
-
|
|
21
|
-
return;
|
|
20
|
+
throw new Error("did not find the requested crud entry");
|
|
22
21
|
}
|
|
23
22
|
const data = {};
|
|
24
23
|
const resultData = response.result[0].data;
|
|
@@ -14,4 +14,4 @@ export interface FieldFilter {
|
|
|
14
14
|
operation: string;
|
|
15
15
|
value: any;
|
|
16
16
|
}
|
|
17
|
-
export declare const getCrudDataList: <T extends {}>(tenantId: string, type: string, limit: number, page: number, filter: Filter, serviceClient: DeliveryServiceClient) => Promise<GetCrudDataList<T
|
|
17
|
+
export declare const getCrudDataList: <T extends {}>(tenantId: string, type: string, limit: number, page: number, filter: Filter, serviceClient: DeliveryServiceClient) => Promise<GetCrudDataList<T>>;
|