@fjell/client-api 4.4.0 → 4.4.2
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/.kodrdriv/config.yaml +10 -0
- package/.kodrdriv/context/content.md +1 -0
- package/dist/AItemAPI.js +3 -1
- package/dist/AItemAPI.js.map +1 -0
- package/dist/CItemAPI.d.ts +11 -9
- package/dist/CItemAPI.js +4 -2
- package/dist/CItemAPI.js.map +1 -0
- package/dist/ClientApi.d.ts +11 -9
- package/dist/PItemAPI.d.ts +12 -10
- package/dist/PItemAPI.js +6 -2
- package/dist/PItemAPI.js.map +1 -0
- package/dist/Utilities.js +1 -1
- package/dist/Utilities.js.map +1 -0
- package/dist/index.cjs +486 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -0
- package/dist/logger.js +2 -2
- package/dist/logger.js.map +1 -0
- package/dist/ops/action.js +1 -1
- package/dist/ops/action.js.map +1 -0
- package/dist/ops/all.js +1 -1
- package/dist/ops/all.js.map +1 -0
- package/dist/ops/allAction.js +1 -1
- package/dist/ops/allAction.js.map +1 -0
- package/dist/ops/create.js +1 -1
- package/dist/ops/create.js.map +1 -0
- package/dist/ops/facet.d.ts +5 -0
- package/dist/ops/facet.js +32 -0
- package/dist/ops/facet.js.map +1 -0
- package/dist/ops/find.js +1 -1
- package/dist/ops/find.js.map +1 -0
- package/dist/ops/findOne.d.ts +5 -0
- package/dist/ops/findOne.js +26 -0
- package/dist/ops/findOne.js.map +1 -0
- package/dist/ops/get.js +1 -1
- package/dist/ops/get.js.map +1 -0
- package/dist/ops/index.js +5 -1
- package/dist/ops/index.js.map +1 -0
- package/dist/ops/one.d.ts +1 -1
- package/dist/ops/one.js +2 -2
- package/dist/ops/one.js.map +1 -0
- package/dist/ops/remove.js +1 -1
- package/dist/ops/remove.js.map +1 -0
- package/dist/ops/update.js +1 -1
- package/dist/ops/update.js.map +1 -0
- package/package.json +25 -25
- package/src/AItemAPI.ts +12 -9
- package/src/CItemAPI.ts +27 -19
- package/src/ClientApi.ts +25 -14
- package/src/PItemAPI.ts +63 -35
- package/src/Utilities.ts +47 -47
- package/src/logger.ts +1 -1
- package/src/ops/facet.ts +59 -0
- package/src/ops/findOne.ts +52 -0
- package/src/ops/index.ts +74 -61
- package/src/ops/one.ts +22 -23
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This the Fjell library that provides a framework for client-side APIs
|
package/dist/AItemAPI.js
CHANGED
|
@@ -33,7 +33,9 @@ const createAItemAPI = (api, pkType, pathNames, options)=>{
|
|
|
33
33
|
all: operations.all,
|
|
34
34
|
allAction: operations.allAction,
|
|
35
35
|
create: operations.create,
|
|
36
|
+
facet: operations.facet,
|
|
36
37
|
find: operations.find,
|
|
38
|
+
findOne: operations.findOne,
|
|
37
39
|
get: operations.get,
|
|
38
40
|
one: operations.one,
|
|
39
41
|
remove: operations.remove,
|
|
@@ -42,4 +44,4 @@ const createAItemAPI = (api, pkType, pathNames, options)=>{
|
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
export { createAItemAPI, finderToParams };
|
|
45
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=AItemAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AItemAPI.js","sources":["../src/AItemAPI.ts"],"sourcesContent":["/* eslint-disable indent */\nimport { Item, QueryParams } from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"./ClientApiOptions\";\nimport { getOperations } from \"./ops\";\nimport { createUtilities } from \"./Utilities\";\nimport { ClientApi } from \"./ClientApi\";\n\nimport LibLogger from \"@/logger\";\n\nconst logger = LibLogger.get('AItemAPI');\n\nexport type PathNamesArray<\n L1 extends string = never,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n> =\n ([L5] extends [never] ?\n ([L4] extends [never] ?\n ([L3] extends [never] ?\n ([L2] extends [never] ?\n ([L1] extends [never] ?\n [string] :\n [string, string]) :\n [string, string, string]) :\n [string, string, string, string]) :\n [string, string, string, string, string]) :\n [string, string, string, string, string, string]);\n\nexport const finderToParams = (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>\n): QueryParams => {\n return {\n finder,\n finderParams: JSON.stringify(finderParams),\n };\n};\n\nexport const createAItemAPI = <\n V extends Item<S, L1, L2, L3, L4, L5>,\n S extends string,\n L1 extends string = never,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n>(\n api: HttpApi,\n pkType: S,\n pathNames: PathNamesArray<L1, L2, L3, L4, L5>,\n options?: ClientApiOptions,\n): ClientApi<V, S, L1, L2, L3, L4, L5> => {\n\n logger.default('createAItemAPI', { pkType, pathNames, options });\n\n let mergedOptions: ClientApiOptions;\n\n const defaultOptions: ClientApiOptions = {\n readAuthenticated: true,\n allAuthenticated: true,\n writeAuthenticated: true,\n };\n\n if (options) {\n mergedOptions = Object.assign({}, defaultOptions, options);\n } else {\n mergedOptions = defaultOptions;\n }\n\n const utilities = createUtilities<V, S, L1, L2, L3, L4, L5>(pkType, pathNames);\n const operations = getOperations<V, S, L1, L2, L3, L4, L5>(api, mergedOptions, utilities);\n\n return {\n action: operations.action,\n all: operations.all,\n allAction: operations.allAction,\n create: operations.create,\n facet: operations.facet,\n find: operations.find,\n findOne: operations.findOne,\n get: operations.get,\n one: operations.one,\n remove: operations.remove,\n update: operations.update,\n }\n}"],"names":["logger","LibLogger","get","finderToParams","finder","finderParams","JSON","stringify","createAItemAPI","api","pkType","pathNames","options","default","mergedOptions","defaultOptions","readAuthenticated","allAuthenticated","writeAuthenticated","Object","assign","utilities","createUtilities","operations","getOperations","action","all","allAction","create","facet","find","findOne","one","remove","update"],"mappings":";;;;AAWA,MAAMA,MAAAA,GAASC,SAAUC,CAAAA,GAAG,CAAC,UAAA,CAAA;AAqBtB,MAAMC,cAAiB,GAAA,CAC5BC,MACAC,EAA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AAWU,MAAM;AACzBC,QAAAA,MAAAA,EAAQX,WAAWW;AACrB,KAAA;AACF;;;;"}
|
package/dist/CItemAPI.d.ts
CHANGED
|
@@ -4,13 +4,15 @@ import { PathNamesArray } from './AItemAPI';
|
|
|
4
4
|
import { ClientApi } from './ClientApi';
|
|
5
5
|
import { ClientApiOptions } from './ClientApiOptions';
|
|
6
6
|
export interface CItemApi<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> extends ClientApi<V, S, L1, L2, L3, L4, L5> {
|
|
7
|
-
action: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, action: string, body: any, options
|
|
8
|
-
all: (query: ItemQuery, options
|
|
9
|
-
allAction: (action: string, body: any, options
|
|
10
|
-
get: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, options
|
|
11
|
-
create: (item: TypesProperties<V, S, L1, L2, L3, L4, L5>, options
|
|
12
|
-
remove: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, options
|
|
13
|
-
update: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, item: TypesProperties<V, S, L1, L2, L3, L4, L5>, options
|
|
14
|
-
|
|
7
|
+
action: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, action: string, body: any, options?: Partial<PostMethodOptions>) => Promise<V>;
|
|
8
|
+
all: (query: ItemQuery, options?: Partial<GetMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
|
9
|
+
allAction: (action: string, body: any, options?: Partial<PostMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
|
10
|
+
get: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, options?: Partial<GetMethodOptions>) => Promise<V | null>;
|
|
11
|
+
create: (item: TypesProperties<V, S, L1, L2, L3, L4, L5>, options?: Partial<PostMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V>;
|
|
12
|
+
remove: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, options?: Partial<DeleteMethodOptions>) => Promise<boolean>;
|
|
13
|
+
update: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, item: TypesProperties<V, S, L1, L2, L3, L4, L5>, options?: Partial<PutMethodOptions>) => Promise<V>;
|
|
14
|
+
facet: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, facet: string, options?: Partial<GetMethodOptions>) => Promise<any>;
|
|
15
|
+
find: (finder: string, finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, options?: Partial<GetMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
|
16
|
+
findOne: (finder: string, finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, options?: Partial<GetMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V>;
|
|
15
17
|
}
|
|
16
|
-
export declare const createCItemApi: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(api: HttpApi, type: S, pathNames: PathNamesArray<L1, L2, L3, L4, L5>, options
|
|
18
|
+
export declare const createCItemApi: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(api: HttpApi, type: S, pathNames: PathNamesArray<L1, L2, L3, L4, L5>, options?: ClientApiOptions) => CItemApi<V, S, L1, L2, L3, L4, L5>;
|
package/dist/CItemAPI.js
CHANGED
|
@@ -19,9 +19,11 @@ const createCItemApi = (api, type, pathNames, options)=>{
|
|
|
19
19
|
create: aItemAPI.create,
|
|
20
20
|
remove: aItemAPI.remove,
|
|
21
21
|
update: aItemAPI.update,
|
|
22
|
-
|
|
22
|
+
facet: aItemAPI.facet,
|
|
23
|
+
find: aItemAPI.find,
|
|
24
|
+
findOne: aItemAPI.findOne
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
export { createCItemApi };
|
|
27
|
-
//# sourceMappingURL=
|
|
29
|
+
//# sourceMappingURL=CItemAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CItemAPI.js","sources":["../src/CItemAPI.ts"],"sourcesContent":["\nimport {\n ComKey,\n Item,\n ItemQuery,\n LocKeyArray,\n PriKey,\n TypesProperties\n} from \"@fjell/core\";\nimport {\n DeleteMethodOptions,\n GetMethodOptions,\n HttpApi,\n PostMethodOptions,\n PutMethodOptions,\n} from \"@fjell/http-api\";\nimport { createAItemAPI, PathNamesArray } from \"./AItemAPI\";\n\nimport { ClientApi } from \"./ClientApi\";\nimport { ClientApiOptions } from \"./ClientApiOptions\";\nimport LibLogger from \"@/logger\";\n\nconst logger = LibLogger.get('CItemAPI');\n\nexport interface CItemApi<\n V extends Item<S, L1, L2, L3, L4, L5>,\n S extends string,\n L1 extends string,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n> extends ClientApi<V, S, L1, L2, L3, L4, L5> {\n action: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n action: string,\n body: any,\n options?: Partial<PostMethodOptions>\n ) => Promise<V>;\n all: (\n query: ItemQuery,\n options?: Partial<GetMethodOptions>,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V[]>;\n allAction: (\n action: string,\n body: any,\n options?: Partial<PostMethodOptions>,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V[]>;\n get: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n options?: Partial<GetMethodOptions>,\n ) => Promise<V | null>;\n create: (\n item: TypesProperties<V, S, L1, L2, L3, L4, L5>,\n options?: Partial<PostMethodOptions>,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V>;\n remove: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n options?: Partial<DeleteMethodOptions>\n ) => Promise<boolean>;\n update: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n item: TypesProperties<V, S, L1, L2, L3, L4, L5>,\n options?: Partial<PutMethodOptions>\n ) => Promise<V>;\n facet: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n facet: string,\n options?: Partial<GetMethodOptions>,\n ) => Promise<any>;\n find: (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n options?: Partial<GetMethodOptions>,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V[]>;\n findOne: (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n options?: Partial<GetMethodOptions>,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V>;\n};\n\nexport const createCItemApi = <\n V extends Item<S, L1, L2, L3, L4, L5>,\n S extends string,\n L1 extends string,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n>(api: HttpApi, type: S, pathNames: PathNamesArray<L1, L2, L3, L4, L5>, options?: ClientApiOptions): CItemApi<V, S, L1, L2, L3, L4, L5> => {\n\n logger.default('createCItemApi', { api, type, pathNames, options });\n\n const aItemAPI = createAItemAPI(api, type, pathNames, options);\n\n return {\n action: aItemAPI.action,\n all: aItemAPI.all,\n allAction: aItemAPI.allAction,\n one: aItemAPI.one,\n get: aItemAPI.get,\n create: aItemAPI.create,\n remove: aItemAPI.remove,\n update: aItemAPI.update,\n facet: aItemAPI.facet,\n find: aItemAPI.find,\n findOne: aItemAPI.findOne,\n } as unknown as CItemApi<V, S, L1, L2, L3, L4, L5>;\n}\n"],"names":["logger","LibLogger","get","createCItemApi","api","type","pathNames","options","default","aItemAPI","createAItemAPI","action","all","allAction","one","create","remove","update","facet","find","findOne"],"mappings":";;;AAsBA,MAAMA,MAAAA,GAASC,SAAUC,CAAAA,GAAG,CAAC,UAAA,CAAA;AAiEhBC,MAAAA,cAAAA,GAAiB,CAQ5BC,GAAAA,EAAcC,MAASC,SAA+CC,EAAAA,OAAAA,GAAAA;IAEtEP,MAAOQ,CAAAA,OAAO,CAAC,gBAAkB,EAAA;AAAEJ,QAAAA,GAAAA;AAAKC,QAAAA,IAAAA;AAAMC,QAAAA,SAAAA;AAAWC,QAAAA;AAAQ,KAAA,CAAA;AAEjE,IAAA,MAAME,QAAWC,GAAAA,cAAAA,CAAeN,GAAKC,EAAAA,IAAAA,EAAMC,SAAWC,EAAAA,OAAAA,CAAAA;IAEtD,OAAO;AACLI,QAAAA,MAAAA,EAAQF,SAASE,MAAM;AACvBC,QAAAA,GAAAA,EAAKH,SAASG,GAAG;AACjBC,QAAAA,SAAAA,EAAWJ,SAASI,SAAS;AAC7BC,QAAAA,GAAAA,EAAKL,SAASK,GAAG;AACjBZ,QAAAA,GAAAA,EAAKO,SAASP,GAAG;AACjBa,QAAAA,MAAAA,EAAQN,SAASM,MAAM;AACvBC,QAAAA,MAAAA,EAAQP,SAASO,MAAM;AACvBC,QAAAA,MAAAA,EAAQR,SAASQ,MAAM;AACvBC,QAAAA,KAAAA,EAAOT,SAASS,KAAK;AACrBC,QAAAA,IAAAA,EAAMV,SAASU,IAAI;AACnBC,QAAAA,OAAAA,EAASX,SAASW;AACpB,KAAA;AACF;;;;"}
|
package/dist/ClientApi.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ComKey, Item, ItemQuery, LocKeyArray, PriKey, TypesProperties } from '@fjell/core';
|
|
2
2
|
import { DeleteMethodOptions, GetMethodOptions, PostMethodOptions, PutMethodOptions } from '@fjell/http-api';
|
|
3
3
|
export interface ClientApi<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> {
|
|
4
|
-
action: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, action: string, body: any, options
|
|
5
|
-
all: (query: ItemQuery, options
|
|
6
|
-
allAction: (action: string, body: any, options
|
|
7
|
-
create: (item: TypesProperties<V, S, L1, L2, L3, L4, L5>, options
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
action: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, action: string, body: any, options?: Partial<PostMethodOptions>) => Promise<V>;
|
|
5
|
+
all: (query: ItemQuery, options?: Partial<GetMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
|
6
|
+
allAction: (action: string, body: any, options?: Partial<PostMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
|
7
|
+
create: (item: TypesProperties<V, S, L1, L2, L3, L4, L5>, options?: Partial<PostMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V>;
|
|
8
|
+
facet: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, facet: string, options?: Partial<GetMethodOptions>) => Promise<any>;
|
|
9
|
+
find: (finder: string, finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, options?: Partial<GetMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
|
10
|
+
findOne: (finder: string, finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, options?: Partial<GetMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V>;
|
|
11
|
+
get: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, options?: Partial<GetMethodOptions>) => Promise<V | null>;
|
|
12
|
+
one: (query: ItemQuery, options?: Partial<GetMethodOptions>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V | null>;
|
|
13
|
+
remove: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, options?: Partial<DeleteMethodOptions>) => Promise<boolean>;
|
|
14
|
+
update: (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, item: TypesProperties<V, S, L1, L2, L3, L4, L5>, options?: Partial<PutMethodOptions>) => Promise<V>;
|
|
13
15
|
}
|
package/dist/PItemAPI.d.ts
CHANGED
|
@@ -3,14 +3,16 @@ import { HttpApi, DeleteMethodOptions, GetMethodOptions, PostMethodOptions, PutM
|
|
|
3
3
|
import { ClientApi } from './ClientApi';
|
|
4
4
|
import { ClientApiOptions } from './ClientApiOptions';
|
|
5
5
|
export interface PItemApi<V extends Item<S>, S extends string> extends ClientApi<V, S> {
|
|
6
|
-
action: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, action: string, body: any, options
|
|
7
|
-
all: (query: ItemQuery, options
|
|
8
|
-
allAction: (action: string, body: any, options
|
|
9
|
-
one: (query: ItemQuery, options
|
|
10
|
-
get: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, options
|
|
11
|
-
create: (item: TypesProperties<V, S>, options
|
|
12
|
-
remove: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, options
|
|
13
|
-
update: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, item: TypesProperties<V, S>, options
|
|
14
|
-
|
|
6
|
+
action: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, action: string, body: any, options?: Partial<PostMethodOptions>, locations?: []) => Promise<V>;
|
|
7
|
+
all: (query: ItemQuery, options?: Partial<GetMethodOptions>, locations?: []) => Promise<V[]>;
|
|
8
|
+
allAction: (action: string, body: any, options?: Partial<PostMethodOptions>) => Promise<V[]>;
|
|
9
|
+
one: (query: ItemQuery, options?: Partial<GetMethodOptions>) => Promise<V | null>;
|
|
10
|
+
get: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, options?: Partial<GetMethodOptions>, locations?: []) => Promise<V | null>;
|
|
11
|
+
create: (item: TypesProperties<V, S>, options?: Partial<PostMethodOptions>, locations?: []) => Promise<V>;
|
|
12
|
+
remove: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, options?: Partial<DeleteMethodOptions>, locations?: []) => Promise<boolean>;
|
|
13
|
+
update: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, item: TypesProperties<V, S>, options?: Partial<PutMethodOptions>, locations?: []) => Promise<V>;
|
|
14
|
+
facet: (ik: PriKey<S> | ComKey<S, never, never, never, never, never>, facet: string, options?: Partial<GetMethodOptions>) => Promise<any>;
|
|
15
|
+
find: (finder: string, finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, options?: Partial<GetMethodOptions>, locations?: []) => Promise<V[]>;
|
|
16
|
+
findOne: (finder: string, finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, options?: Partial<GetMethodOptions>, locations?: []) => Promise<V>;
|
|
15
17
|
}
|
|
16
|
-
export declare const createPItemApi: <V extends Item<S>, S extends string>(api: HttpApi, type: S, pathName: string, options
|
|
18
|
+
export declare const createPItemApi: <V extends Item<S>, S extends string>(api: HttpApi, type: S, pathName: string, options?: ClientApiOptions) => PItemApi<V, S>;
|
package/dist/PItemAPI.js
CHANGED
|
@@ -19,7 +19,9 @@ const createPItemApi = (api, type, pathName, options)=>{
|
|
|
19
19
|
const create = async (item, options = {})=>await aItemAPI.create(item, options, []);
|
|
20
20
|
const remove = async (ik, options = {})=>await aItemAPI.remove(ik, options);
|
|
21
21
|
const update = async (ik, item, options = {})=>await aItemAPI.update(ik, item, options);
|
|
22
|
+
const facet = async (ik, facet, options = {})=>await aItemAPI.facet(ik, facet, options);
|
|
22
23
|
const find = async (finder, finderParams, options = {})=>await aItemAPI.find(finder, finderParams, options, []);
|
|
24
|
+
const findOne = async (finder, finderParams, options = {})=>await aItemAPI.findOne(finder, finderParams, options, []);
|
|
23
25
|
return {
|
|
24
26
|
...aItemAPI,
|
|
25
27
|
action,
|
|
@@ -30,9 +32,11 @@ const createPItemApi = (api, type, pathName, options)=>{
|
|
|
30
32
|
create,
|
|
31
33
|
remove,
|
|
32
34
|
update,
|
|
33
|
-
|
|
35
|
+
facet,
|
|
36
|
+
find,
|
|
37
|
+
findOne
|
|
34
38
|
};
|
|
35
39
|
};
|
|
36
40
|
|
|
37
41
|
export { createPItemApi };
|
|
38
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=PItemAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PItemAPI.js","sources":["../src/PItemAPI.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { ComKey, Item, ItemProperties, ItemQuery, PriKey, TypesProperties } from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\nimport { createAItemAPI, PathNamesArray } from \"./AItemAPI\";\nimport { ClientApi } from \"./ClientApi\";\n\nimport { DeleteMethodOptions, GetMethodOptions, PostMethodOptions, PutMethodOptions } from \"@fjell/http-api\";\nimport { ClientApiOptions } from \"./ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nconst logger = LibLogger.get('PItemAPI');\n\nexport interface PItemApi<\n V extends Item<S>,\n S extends string\n> extends ClientApi<V, S> {\n\n action: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n action: string,\n body: any,\n options?: Partial<PostMethodOptions>,\n locations?: []\n ) => Promise<V>;\n\n all: (\n query: ItemQuery,\n options?: Partial<GetMethodOptions>,\n locations?: []\n ) => Promise<V[]>;\n\n allAction: (\n action: string,\n body: any,\n options?: Partial<PostMethodOptions>\n ) => Promise<V[]>;\n\n one: (\n query: ItemQuery,\n options?: Partial<GetMethodOptions>\n ) => Promise<V | null>;\n\n get: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n options?: Partial<GetMethodOptions>,\n locations?: []\n ) => Promise<V | null>;\n\n create: (\n item: TypesProperties<V, S>,\n options?: Partial<PostMethodOptions>,\n locations?: []\n ) => Promise<V>;\n\n remove: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n options?: Partial<DeleteMethodOptions>,\n locations?: []\n ) => Promise<boolean>;\n\n update: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n item: TypesProperties<V, S>,\n options?: Partial<PutMethodOptions>,\n locations?: []\n ) => Promise<V>;\n\n facet: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n facet: string,\n options?: Partial<GetMethodOptions>,\n ) => Promise<any>;\n\n find: (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n options?: Partial<GetMethodOptions>,\n locations?: []\n ) => Promise<V[]>;\n\n findOne: (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n options?: Partial<GetMethodOptions>,\n locations?: []\n ) => Promise<V>;\n}\n\nexport const createPItemApi = <V extends Item<S>, S extends string>(\n api: HttpApi,\n type: S,\n pathName: string,\n options?: ClientApiOptions\n): PItemApi<V, S> => {\n\n logger.default('createPItemApi', { type, pathName, options });\n\n const aItemAPI = createAItemAPI<V, S>(api, type, [pathName], options);\n\n const action =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n action: string,\n body: any = {},\n options: Partial<PostMethodOptions> = {},\n ): Promise<V> =>\n await aItemAPI.action(ik, action, body, options) as V;\n\n const all =\n async (\n query: ItemQuery = {} as ItemQuery,\n options: Partial<GetMethodOptions> = {},\n ): Promise<V[]> =>\n await aItemAPI.all(query, options, []) as V[];\n\n const allAction =\n async (\n action: string,\n body: any = {},\n options: Partial<PostMethodOptions> = {},\n ): Promise<V[]> =>\n await aItemAPI.allAction(action, body, options, []) as V[];\n\n const one =\n async (\n query: ItemQuery = {} as ItemQuery,\n options: Partial<GetMethodOptions> = {},\n ): Promise<V | null> =>\n await aItemAPI.one(query, options, []) as V | null;\n\n const get =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n options: Partial<GetMethodOptions> = {},\n ): Promise<V | null> =>\n await aItemAPI.get(ik, options) as V | null;\n\n const create =\n async (\n item: TypesProperties<V, S>,\n options: Partial<PostMethodOptions> = {},\n ): Promise<V> =>\n await aItemAPI.create(item, options, []) as V;\n\n const remove =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n options: Partial<DeleteMethodOptions> = {},\n ): Promise<boolean> =>\n await aItemAPI.remove(ik, options) as boolean;\n\n const update =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n item: TypesProperties<V, S>,\n options: Partial<PutMethodOptions> = {},\n ): Promise<V> =>\n await aItemAPI.update(ik, item, options) as V;\n\n const facet =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n facet: string,\n options: Partial<GetMethodOptions> = {},\n ): Promise<any> =>\n await aItemAPI.facet(ik, facet, options) as any;\n\n const find =\n async (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n options: Partial<GetMethodOptions> = {},\n ): Promise<V[]> =>\n await aItemAPI.find(finder, finderParams, options, []) as V[];\n\n const findOne =\n async (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n options: Partial<GetMethodOptions> = {},\n ): Promise<V> =>\n await aItemAPI.findOne(finder, finderParams, options, []) as V;\n\n return {\n ...aItemAPI,\n action,\n all,\n allAction,\n one,\n get,\n create,\n remove,\n update,\n facet,\n find,\n findOne,\n };\n\n};\n"],"names":["logger","LibLogger","get","createPItemApi","api","type","pathName","options","default","aItemAPI","createAItemAPI","action","ik","body","all","query","allAction","one","create","item","remove","update","facet","find","finder","finderParams","findOne"],"mappings":";;;AAUA,MAAMA,MAAAA,GAASC,SAAUC,CAAAA,GAAG,CAAC,UAAA,CAAA;AA8EhBC,MAAAA,cAAAA,GAAiB,CAC5BC,GAAAA,EACAC,MACAC,QACAC,EAAAA,OAAAA,GAAAA;IAGAP,MAAOQ,CAAAA,OAAO,CAAC,gBAAkB,EAAA;AAAEH,QAAAA,IAAAA;AAAMC,QAAAA,QAAAA;AAAUC,QAAAA;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O,EAAAA,IAAAA,EACAZ,OAAqC,GAAA,EAAE,GAEvC,MAAME,QAAAA,CAASY,MAAM,CAACT,IAAIO,IAAMZ,EAAAA,OAAAA,CAAAA;AAEpC,IAAA,MAAMe,KACJ,GAAA,OACEV,EACAU,EAAAA,KAAAA,EACAf,OAAqC,GAAA,EAAE,GAEvC,MAAME,QAAAA,CAASa,KAAK,CAACV,IAAIU,KAAOf,EAAAA,OAAAA,CAAAA;AAEpC,IAAA,MAAMgB,IACJ,GAAA,OACEC,MACAC,EAAAA,YAAAA,EACAlB,UAAqC,EAAE,GAEvC,MAAME,SAASc,IAAI,CAACC,MAAQC,EAAAA,YAAAA,EAAclB,SAAS,EAAE,CAAA;AAEzD,IAAA,MAAMmB,OACJ,GAAA,OACEF,MACAC,EAAAA,YAAAA,EACAlB,UAAqC,EAAE,GAEvC,MAAME,SAASiB,OAAO,CAACF,MAAQC,EAAAA,YAAAA,EAAclB,SAAS,EAAE,CAAA;IAE5D,OAAO;AACL,QAAA,GAAGE,QAAQ;AACXE,QAAAA,MAAAA;AACAG,QAAAA,GAAAA;AACAE,QAAAA,SAAAA;AACAC,QAAAA,GAAAA;AACAf,QAAAA,GAAAA;AACAgB,QAAAA,MAAAA;AACAE,QAAAA,MAAAA;AACAC,QAAAA,MAAAA;AACAC,QAAAA,KAAAA;AACAC,QAAAA,IAAAA;AACAG,QAAAA;AACF,KAAA;AAEF;;;;"}
|
package/dist/Utilities.js
CHANGED
|
@@ -150,4 +150,4 @@ const createUtilities = (pkType, pathNames)=>{
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
export { createUtilities };
|
|
153
|
-
//# sourceMappingURL=
|
|
153
|
+
//# sourceMappingURL=Utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utilities.js","sources":["../src/Utilities.ts"],"sourcesContent":["import {\n ComKey,\n validatePK as coreValidatePK,\n generateKeyArray,\n isPriKey,\n Item,\n LocKey,\n LocKeyArray,\n PriKey,\n} from \"@fjell/core\";\n\nimport LibLogger from \"@/logger\";\nimport deepmerge from \"deepmerge\";\n\nconst logger = LibLogger.get('client-api', 'Utility');\n\nexport interface Utilities<\n V extends Item<S, L1, L2, L3, L4, L5>,\n S extends string,\n L1 extends string = never,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n> {\n verifyLocations: (locations: LocKeyArray<L1, L2, L3, L4, L5> | [] | never) => boolean;\n processOne: (apiCall: Promise<V>) => Promise<V>;\n processArray: (api: Promise<V[]>) => Promise<V[]>;\n convertDoc: (doc: V) => V;\n getPath: (key: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S> | LocKeyArray<L1, L2, L3, L4, L5> | []) => string;\n validatePK: (item: Item<S, L1, L2, L3, L4, L5> | Item<S, L1, L2, L3, L4, L5>[]) =>\n Item<S, L1, L2, L3, L4, L5> | Item<S, L1, L2, L3, L4, L5>[];\n}\n\nexport const createUtilities = <\n V extends Item<S, L1, L2, L3, L4, L5>,\n S extends string,\n L1 extends string = never,\n L2 extends string = never,\n L3 extends string = never,\n L4 extends string = never,\n L5 extends string = never\n>(pkType: S, pathNames: string[]): Utilities<V, S, L1, L2, L3, L4, L5> => {\n\n logger.default('createUtilities', { pkType, pathNames });\n\n const verifyLocations = (\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] | never,\n ): boolean => {\n\n if (locations && locations.length < pathNames.length - 1) {\n throw new Error('Not enough locations for pathNames: locations:'\n + locations.length + ' pathNames:' + pathNames.length);\n }\n return true;\n }\n\n const processOne = async (\n apiCall: Promise<V>,\n ): Promise<V> => {\n logger.default('processOne', { apiCall });\n const response = await apiCall;\n logger.default('processOne response', { response: JSON.stringify(response, null, 2) });\n return convertDoc(response);\n };\n\n const processArray = async (\n api: Promise<V[]>,\n ): Promise<V[]> => {\n logger.default('processArray', { api });\n const response = await api;\n logger.default('processArray response', { response: JSON.stringify(response, null, 2) });\n if (response && Array.isArray(response)) {\n return response.map((subjectChat: V) =>\n convertDoc(subjectChat),\n ) as unknown as V[];\n } else {\n logger.error('Response was not an array', { response });\n throw new Error('Response was not an array');\n }\n };\n\n const convertDoc = (doc: V): V => {\n logger.default('convertDoc', { doc });\n // console.log(JSON.stringify(doc, null, 2));\n if (doc && doc.events) {\n const events = doc.events;\n for (const key in events) {\n events[key] = deepmerge(events[key], { at: events[key].at ? new Date(events[key].at) : null });\n }\n\n return doc as unknown as V;\n } else {\n return doc;\n }\n };\n\n const getPath =\n (\n key: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S> | LocKeyArray<L1, L2, L3, L4, L5> | [],\n ):\n string => {\n\n const localPathNames = [...pathNames];\n logger.default('getPath', { key, pathNames: localPathNames });\n\n // console.log('getPath key: ' + JSON.stringify(key));\n\n const keys = generateKeyArray(key);\n\n // console.log('getPath keys: ' + JSON.stringify(keys));\n // console.log('getPath pathNames: ' + JSON.stringify(pathNames));\n\n let path: string = addPath('', keys, localPathNames);\n\n // If there is only one collection left in the collections array, this means that\n // we received LocKeys and we need to add the last collection to the reference\n if (localPathNames.length === 1) {\n path = `${path}/${localPathNames[0]}`;\n }\n\n logger.default('getPath created', { key, path });\n\n return path;\n };\n\n const addPath = (\n base: string,\n keys: Array<PriKey<S> | LocKey<L1 | L2 | L3 | L4 | L5>>,\n localPathNames: string[],\n ): string => {\n logger.default('addPath', { base, keys, pathNames: localPathNames });\n if (keys.length < localPathNames.length - 1) {\n logger.error('addPath should never have keys with a length less than the length of pathNames - 1',\n { keys, localPathNames });\n throw new Error('addPath should never have keys with a length less than the length of pathNames - 1: '\n + keys.length + ' ' + localPathNames.length + ' ' + JSON.stringify(keys, localPathNames));\n } else if (keys.length > localPathNames.length) {\n logger.error('addPath should never have keys with a length greater than the length of pathNames',\n { keys, pathNames });\n throw new Error('addPath should never have keys with a length greater than the length of pathNames: '\n + keys.length + ' ' + localPathNames.length + ' ' + JSON.stringify(keys, localPathNames));\n }\n if (keys.length === 0) {\n // If you've recursively consumed all of the keys, return the base.\n logger.default('addPath returning base', { base });\n return base;\n } else {\n // Retrieve the next key and collection, and create the next base\n let nextBase: string;\n const key = keys.pop();\n const pathName = localPathNames.pop();\n if (isPriKey(key)) {\n const PriKey = key as PriKey<S>;\n nextBase = `${base}/${pathName}/${PriKey.pk}`;\n logger.default('Adding Path for PK', { pathName, PriKey, nextBase });\n } else {\n const LocKey = key as LocKey<L1 | L2 | L3 | L4 | L5>;\n nextBase = `${base}/${pathName}/${LocKey.lk}`;\n logger.default('Retrieving Collection for LK', { pathName, LocKey });\n }\n\n logger.default('calling addPath recursively', { nextBase, keys, localPathNames });\n return addPath(nextBase, keys, localPathNames);\n }\n\n }\n\n const validatePK = (\n item: Item<S, L1, L2, L3, L4, L5> | Item<S, L1, L2, L3, L4, L5>[]):\n Item<S, L1, L2, L3, L4, L5> | Item<S, L1, L2, L3, L4, L5>[] => {\n return coreValidatePK<S, L1, L2, L3, L4, L5>(item, pkType);\n }\n\n return {\n verifyLocations,\n processOne,\n convertDoc,\n processArray,\n getPath,\n validatePK,\n }\n}\n"],"names":["logger","LibLogger","get","createUtilities","pkType","pathNames","default","verifyLocations","locations","length","Error","processOne","apiCall","response","JSON","stringify","convertDoc","processArray","api","Array","isArray","map","subjectChat","error","doc","events","key","deepmerge","at","Date","getPath","localPathNames","keys","generateKeyArray","path","addPath","base","nextBase","pop","pathName","isPriKey","PriKey","pk","LocKey","lk","validatePK","item","coreValidatePK"],"mappings":";;;;AAcA,MAAMA,MAASC,GAAAA,SAAAA,CAAUC,GAAG,CAAC,YAAc,EAAA,SAAA,CAAA;AAoBpC,MAAMC,eAAkB,GAAA,CAQ7BC,MAAWC,EAAAA,SAAAA,GAAAA;IAEXL,MAAOM,CAAAA,OAAO,CAAC,iBAAmB,EAAA;AAAEF,QAAAA,MAAAA;AAAQC,QAAAA;AAAU,KAAA,CAAA;AAEtD,IAAA,MAAME,kBAAkB,CACtBC,SAAAA,GAAAA;AAGA,QAAA,IAAIA,aAAaA,SAAUC,CAAAA,MAAM,G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