@mxpicture/gcp-functions-frontend 0.1.44 → 0.1.46
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/api/FrontendApi.d.ts +1 -21
- package/dist/api/FrontendApi.js +50 -30
- package/dist/api/IFrontendApi.d.ts +3 -3
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +0 -1
- package/dist/function/FrontendFunction.d.ts +1 -20
- package/dist/function/FrontendFunction.js +61 -31
- package/dist/function/index.d.ts +0 -1
- package/dist/function/index.js +0 -1
- package/package.json +1 -1
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { DocumentData, WithKey, CallbackAble, ApiFromRoutes, CrudRoutes, WithoutKey, DocumentKey, ApiFilter } from "@mxpicture/gcp-functions-common/types";
|
|
3
|
-
import { IFrontendApi } from "./IFrontendApi.js";
|
|
4
|
-
import { FrontendFunction } from "../function/FrontendFunction.js";
|
|
5
|
-
export declare class FrontendApi<DTO extends DocumentData, FUNC extends FrontendFunction<DTO>> extends IFrontendApi<DTO, FUNC> implements ApiFromRoutes<CrudRoutes<DTO>> {
|
|
6
|
-
constructor(funcC: CallbackAble<FUNC>);
|
|
7
|
-
delete(request: DocumentKey): Promise<{
|
|
8
|
-
deleted: true;
|
|
9
|
-
}>;
|
|
10
|
-
get(request: DocumentKey): Promise<WithKey<DTO>>;
|
|
11
|
-
query(request?: ApiFilter | null): Promise<WithKey<DTO>[]>;
|
|
12
|
-
count(request?: ApiFilter | null): Promise<{
|
|
13
|
-
count: number;
|
|
14
|
-
}>;
|
|
15
|
-
exists(request: DocumentKey): Promise<{
|
|
16
|
-
exists: boolean;
|
|
17
|
-
}>;
|
|
18
|
-
meta(): Promise<MetaItem[]>;
|
|
19
|
-
create(request: WithoutKey<DTO>): Promise<WithKey<DTO>>;
|
|
20
|
-
update(request: WithKey<Partial<DTO>>): Promise<WithKey<DTO>>;
|
|
21
|
-
}
|
|
1
|
+
export {};
|
package/dist/api/FrontendApi.js
CHANGED
|
@@ -1,30 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
// todo not needed?
|
|
2
|
+
// import type { MetaItem } from "@mxpicture/zod-meta";
|
|
3
|
+
// import type {
|
|
4
|
+
// DocumentData,
|
|
5
|
+
// WithKey,
|
|
6
|
+
// CallbackAble,
|
|
7
|
+
// ApiFromRoutes,
|
|
8
|
+
// CrudRoutes,
|
|
9
|
+
// WithoutKey,
|
|
10
|
+
// DocumentKey,
|
|
11
|
+
// ApiFilter,
|
|
12
|
+
// } from "@mxpicture/gcp-functions-common/types";
|
|
13
|
+
// import { IFrontendApi } from "./IFrontendApi.js";
|
|
14
|
+
// import { FrontendFunction } from "../function/FrontendFunction.js";
|
|
15
|
+
export {};
|
|
16
|
+
// export class FrontendApi<
|
|
17
|
+
// DTO extends DocumentData,
|
|
18
|
+
// FUNC extends FrontendFunction<DTO>,
|
|
19
|
+
// >
|
|
20
|
+
// extends IFrontendApi<DTO, FUNC>
|
|
21
|
+
// implements ApiFromRoutes<CrudRoutes<DTO>>
|
|
22
|
+
// {
|
|
23
|
+
// public constructor(funcC: CallbackAble<FUNC>) {
|
|
24
|
+
// super(funcC);
|
|
25
|
+
// }
|
|
26
|
+
// public async delete(request: DocumentKey): Promise<{ deleted: true }> {
|
|
27
|
+
// return (await (await this.func()).delete(request)).data;
|
|
28
|
+
// }
|
|
29
|
+
// public async get(request: DocumentKey): Promise<WithKey<DTO>> {
|
|
30
|
+
// return (await (await this.func()).get(request)).data;
|
|
31
|
+
// }
|
|
32
|
+
// public async query(request?: ApiFilter | null): Promise<WithKey<DTO>[]> {
|
|
33
|
+
// return (await (await this.func()).query(request)).data;
|
|
34
|
+
// }
|
|
35
|
+
// public async count(request?: ApiFilter | null): Promise<{ count: number }> {
|
|
36
|
+
// return (await (await this.func()).count(request)).data;
|
|
37
|
+
// }
|
|
38
|
+
// public async exists(request: DocumentKey): Promise<{ exists: boolean }> {
|
|
39
|
+
// return (await (await this.func()).exists(request)).data;
|
|
40
|
+
// }
|
|
41
|
+
// public async meta(): Promise<MetaItem[]> {
|
|
42
|
+
// return (await (await this.func()).meta()).data;
|
|
43
|
+
// }
|
|
44
|
+
// public async create(request: WithoutKey<DTO>): Promise<WithKey<DTO>> {
|
|
45
|
+
// return (await (await this.func()).create(request)).data;
|
|
46
|
+
// }
|
|
47
|
+
// public async update(request: WithKey<Partial<DTO>>): Promise<WithKey<DTO>> {
|
|
48
|
+
// return (await (await this.func()).update(request)).data;
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
export declare class IFrontendApi<
|
|
1
|
+
import type { CallbackAble } from "@mxpicture/gcp-functions-common/types";
|
|
2
|
+
import { IFrontendFunction } from "../function/IFrontendFunction.js";
|
|
3
|
+
export declare class IFrontendApi<FUNC extends IFrontendFunction> {
|
|
4
4
|
protected funcC: CallbackAble<FUNC>;
|
|
5
5
|
protected _func?: FUNC;
|
|
6
6
|
protected constructor(funcC: CallbackAble<FUNC>);
|
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.js
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IFrontendFunction } from "./IFrontendFunction.js";
|
|
3
|
-
import { MetaItem } from "@mxpicture/zod-meta";
|
|
4
|
-
export declare class FrontendFunction<DTO extends DocumentData> extends IFrontendFunction implements FunctionFromRoutes<CrudRoutes<DTO>> {
|
|
5
|
-
constructor(name: string, additionalRoutes?: string[]);
|
|
6
|
-
create(request: WithoutKey<DTO>): Promise<FunctionResponse<WithKey<DTO>>>;
|
|
7
|
-
update(request: WithKey<Partial<DTO>>): Promise<FunctionResponse<WithKey<DTO>>>;
|
|
8
|
-
delete(request: DocumentKey): Promise<FunctionResponse<{
|
|
9
|
-
deleted: true;
|
|
10
|
-
}>>;
|
|
11
|
-
get(request: DocumentKey): Promise<FunctionResponse<WithKey<DTO>>>;
|
|
12
|
-
query(request: ApiFilter | null | undefined): Promise<FunctionResponse<WithKey<DTO>[]>>;
|
|
13
|
-
count(request: ApiFilter | null | undefined): Promise<FunctionResponse<{
|
|
14
|
-
count: number;
|
|
15
|
-
}>>;
|
|
16
|
-
exists(request: DocumentKey): Promise<FunctionResponse<{
|
|
17
|
-
exists: boolean;
|
|
18
|
-
}>>;
|
|
19
|
-
meta(): Promise<FunctionResponse<MetaItem[]>>;
|
|
20
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,31 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
1
|
+
// todo not needed?
|
|
2
|
+
// import type {
|
|
3
|
+
// DocumentData,
|
|
4
|
+
// CrudRoutes,
|
|
5
|
+
// FunctionFromRoutes,
|
|
6
|
+
// ApiFilter,
|
|
7
|
+
// DocumentKey,
|
|
8
|
+
// FunctionResponse,
|
|
9
|
+
// WithKey,
|
|
10
|
+
// WithoutKey,
|
|
11
|
+
// } from "@mxpicture/gcp-functions-common/types";
|
|
12
|
+
// import { IFrontendFunction } from "./IFrontendFunction.js";
|
|
13
|
+
// import { MetaItem } from "@mxpicture/zod-meta";
|
|
14
|
+
// import { CRUD_ROUTES } from "@mxpicture/gcp-functions-common/config";
|
|
15
|
+
export {};
|
|
16
|
+
// export class FrontendFunction<DTO extends DocumentData>
|
|
17
|
+
// extends IFrontendFunction
|
|
18
|
+
// implements FunctionFromRoutes<CrudRoutes<DTO>>
|
|
19
|
+
// {
|
|
20
|
+
// public constructor(name: string, additionalRoutes?: string[]) {
|
|
21
|
+
// super(name, [...CRUD_ROUTES, ...(additionalRoutes ?? [])]);
|
|
22
|
+
// }
|
|
23
|
+
// public async create(
|
|
24
|
+
// request: WithoutKey<DTO>,
|
|
25
|
+
// ): Promise<FunctionResponse<WithKey<DTO>>> {
|
|
26
|
+
// return this.outgress({ data: request, route: "create" });
|
|
27
|
+
// }
|
|
28
|
+
// public async update(
|
|
29
|
+
// request: WithKey<Partial<DTO>>,
|
|
30
|
+
// ): Promise<FunctionResponse<WithKey<DTO>>> {
|
|
31
|
+
// return this.outgress({ data: request, route: "update" });
|
|
32
|
+
// }
|
|
33
|
+
// public async delete(
|
|
34
|
+
// request: DocumentKey,
|
|
35
|
+
// ): Promise<FunctionResponse<{ deleted: true }>> {
|
|
36
|
+
// return this.outgress({ data: request, route: "delete" });
|
|
37
|
+
// }
|
|
38
|
+
// public async get(
|
|
39
|
+
// request: DocumentKey,
|
|
40
|
+
// ): Promise<FunctionResponse<WithKey<DTO>>> {
|
|
41
|
+
// return this.outgress({ data: request, route: "get" });
|
|
42
|
+
// }
|
|
43
|
+
// public async query(
|
|
44
|
+
// request: ApiFilter | null | undefined,
|
|
45
|
+
// ): Promise<FunctionResponse<WithKey<DTO>[]>> {
|
|
46
|
+
// return this.outgress({ data: request, route: "query" });
|
|
47
|
+
// }
|
|
48
|
+
// public async count(
|
|
49
|
+
// request: ApiFilter | null | undefined,
|
|
50
|
+
// ): Promise<FunctionResponse<{ count: number }>> {
|
|
51
|
+
// return this.outgress({ data: request, route: "count" });
|
|
52
|
+
// }
|
|
53
|
+
// public async exists(
|
|
54
|
+
// request: DocumentKey,
|
|
55
|
+
// ): Promise<FunctionResponse<{ exists: boolean }>> {
|
|
56
|
+
// return this.outgress({ data: request, route: "exists" });
|
|
57
|
+
// }
|
|
58
|
+
// public async meta(): Promise<FunctionResponse<MetaItem[]>> {
|
|
59
|
+
// return this.outgress({ data: null, route: "meta" });
|
|
60
|
+
// }
|
|
61
|
+
// }
|
package/dist/function/index.d.ts
CHANGED
package/dist/function/index.js
CHANGED